9
0
Fork 0

svn_rev_173

WIP
This commit is contained in:
Sascha Hauer 2007-07-05 18:01:29 +02:00 committed by Sascha Hauer
parent 957a710f42
commit 0c48f25ade
11 changed files with 49 additions and 65 deletions

View File

@ -10,7 +10,7 @@ cpu-$(CONFIG_MPC5200) := mpc5xxx
TEXT_BASE = $(CONFIG_TEXT_BASE)
CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE) -P
CFLAGS := -fno-common -Os
CFLAGS := -fno-common -Os -mrelocatable
LDFLAGS_vmlinux :=-L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc -Ttext $(TEXT_BASE)
ifeq ($(incdir-y),)

View File

@ -122,8 +122,10 @@ int ppc_mem_alloc_init(void)
{
ulong dest_addr = CFG_MONITOR_BASE + gd->reloc_off;
mem_alloc_init(dest_addr - TOTAL_MALLOC_LEN,
mem_malloc_init(dest_addr - TOTAL_MALLOC_LEN,
dest_addr);
return 0;
}
core_initcall(ppc_mem_alloc_init);
@ -344,28 +346,23 @@ PUTC(':');
void board_init_r (gd_t *id, ulong dest_addr)
{
cmd_tbl_t *cmdtp;
char *s, *e;
bd_t *bd;
initcall_t *initcall;
extern initcall_t __u_boot_initcalls_start[], __u_boot_initcalls_end[];
int i;
extern void malloc_bin_reloc (void);
PUTC('B');
while(1);
gd = id; /* initialize RAM version of global data */
bd = gd->bd;
gd->flags |= GD_FLG_RELOC; /* tell others: relocation done */
gd->reloc_off = dest_addr - CFG_MONITOR_BASE;
gd->reloc_off = dest_addr;
PUTC('\n');
PUTHEX_LL(dest_addr);
debug ("Now running in RAM - U-Boot at: %08lx\n", dest_addr);
WATCHDOG_RESET ();
#if defined(CONFIG_BOARD_EARLY_INIT_R)
board_early_init_r ();
#endif
monitor_flash_len = (ulong)&__init_end - dest_addr;
for (initcall = __u_boot_initcalls_start; initcall < __u_boot_initcalls_end; initcall++)
*initcall += gd->reloc_off;
/*
* We have to relocate the command table manually
@ -391,8 +388,6 @@ while(1);
#endif
}
WATCHDOG_RESET ();
asm ("sync ; isync");
/*
@ -400,17 +395,11 @@ while(1);
*/
trap_init (dest_addr);
WATCHDOG_RESET ();
/* initialize higher level parts of CPU like time base and timers */
cpu_init_r ();
WATCHDOG_RESET ();
malloc_bin_reloc ();
WATCHDOG_RESET ();
/*
* Enable Interrupts
*/
@ -422,20 +411,5 @@ while(1);
/* Initialization complete - start the monitor */
/* main_loop() can return to retry autoboot, if so just run it again. */
for (;;) {
WATCHDOG_RESET ();
main_loop ();
}
/* NOTREACHED - no way out of command loop except booting */
}
void hang (void)
{
puts ("### ERROR ### Please RESET the board ###\n");
#ifdef CONFIG_SHOW_BOOT_PROGRESS
show_boot_progress(-30);
#endif
for (;;);
start_uboot();
}

View File

@ -1,4 +1,4 @@
#include <common.h>
#include <mem_malloc.h>
/*

View File

@ -138,6 +138,7 @@ static int mpc5xxx_bd_init(void)
bd->bi_mbar_base = CFG_MBAR; /* base of internal registers */
bd->bi_ipbfreq = gd->ipb_clk;
bd->bi_pcifreq = gd->pci_clk;
return 0;
}
bd_initcall(mpc5xxx_bd_init);

View File

@ -211,7 +211,8 @@ int i2c_init(void)
struct mpc5xxx_i2c *regs = (struct mpc5xxx_i2c *)I2C_BASE;
mpc_reg_out(&regs->mcr, 0, 0);
mpc_reg_out(&regs->madr, saddr << 1, 0);
#warning mpc5xxx i2c is broken
// mpc_reg_out(&regs->madr, saddr << 1, 0);
/* Set clock
*/

View File

@ -71,16 +71,6 @@
GOT_ENTRY(__bss_start)
END_GOT
/*
* Version string
*/
.data
.globl version_string
version_string:
.ascii U_BOOT_VERSION
.ascii " (", __DATE__, " - ", __TIME__, ")"
.ascii CONFIG_IDENT_STRING, "\0"
/*
* Exception vectors
*/

View File

@ -368,7 +368,7 @@ void icache_disable(void);
int dcache_status (void);
void dcache_enable (void);
void dcache_disable(void);
//void relocate_code (ulong, gd_t *, ulong);
void relocate_code (ulong, gd_t *, ulong);
ulong get_endaddr (void);
void trap_init (ulong);
#if defined (CONFIG_4xx) || \
@ -549,7 +549,6 @@ void wait_ticks (unsigned long);
int udelay (unsigned long);
ulong usec2ticks (unsigned long usec);
ulong ticks2usec (unsigned long ticks);
int init_timebase (void);
/* lib_generic/vsprintf.c */
ulong simple_strtoul(const char *cp,char **endp,unsigned int base);
@ -642,4 +641,6 @@ int spec_str_to_info(const char *str, struct memarea_info *info);
/* Just like simple_strtoul(), but this one honors a K/M/G suffix */
unsigned long strtoul_suffix(const char *str, char **endp, int base);
extern void start_uboot(void);
#endif /* __COMMON_H_ */

View File

@ -25,8 +25,10 @@
#ifndef __INCLUDE_DEBUG_LL_H__
#define __INCLUDE_DEBUG_LL_H__
#if defined (CONFIG_DEBUG_LL)
# include <asm/arch/debug_ll.h>
#define PUTC(x) serial_putc(x)
//#if defined (CONFIG_DEBUG_LL)
//# include <asm/arch/debug_ll.h>
# define PUTHEX_LL(value) ({ unsigned long v = (unsigned long) (value); \
int i; unsigned char ch; \
@ -34,10 +36,10 @@
ch = ((v >> (i*4)) & 0xf);\
ch += (ch >= 10) ? 'a' - 10 : '0';\
PUTC (ch); }})
#else
# define PUTC_LL(c) do {} while (0)
# define PUTHEX_LL(v) do {} while (0)
//#else
//# define PUTC_LL(c) do {} while (0)
//# define PUTHEX_LL(v) do {} while (0)
#endif
//#endif
#endif /* __INCLUDE_DEBUG_LL_H__ */

View File

@ -50,7 +50,6 @@
* Initialization, must be called once on start up, may be called
* repeatedly to change the speed and slave addresses.
*/
void i2c_init(int speed, int slaveaddr);
#ifdef CFG_I2C_INIT_BOARD
void i2c_init_board(void);
#endif

View File

@ -5,28 +5,34 @@
#include <malloc.h>
#include <asm-generic/errno.h>
struct device_d global_dev;
static struct device_d global_dev;
int global_add_parameter(struct param_d *param)
{
return dev_add_parameter(&global_dev, param);
}
struct device_d global_dev = {
static int my_probe(struct device_d *dev)
{
return 0;
}
static struct device_d global_dev = {
.name = "global",
.id = "env",
.map_base = 0,
.size = 0,
};
struct driver_d global_driver = {
static struct driver_d global_driver = {
.name = "global",
.probe = dummy_probe,
.probe = my_probe,
};
static int global_init(void)
{
register_device(&global_dev);
global_driver.probe = my_probe;
register_device(&global_dev);
register_driver(&global_driver);
return 0;
}

View File

@ -2,6 +2,7 @@
#include <common.h>
#include <command.h>
#include <driver.h>
#include <init.h>
#include <linux/ctype.h>
int cmd_get_data_size(char* arg, int default_size)
@ -58,7 +59,9 @@ struct device_d *get_device_by_id(char *id)
static int match(struct driver_d *drv, struct device_d *dev)
{
int(*handler)(struct device_d *);
printf("match: 0x%p 0x%p\n", drv, dev);
printf("match: %s %s\n",dev->name, drv->name);
printf("match: probe: 0x%08x\n",drv->probe);
if (strcmp(dev->name, drv->name))
return -1;
if (dev->type != drv->type)
@ -486,3 +489,10 @@ U_BOOT_CMD(
""
);
int dev_init(void) {
memset(device_handler, 0, sizeof(ulong) * MAX_DEVICE_TYPE);
return 0;
}
core_initcall(dev_init);