summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/ppc/lib/board.c443
-rw-r--r--arch/ppc/lib/time.c3
-rw-r--r--common/Makefile3
-rw-r--r--common/startup.c30
-rw-r--r--cpu/mpc5xxx/cpu.c12
-rw-r--r--cpu/mpc5xxx/i2c.c10
-rw-r--r--cpu/mpc5xxx/speed.c2
-rw-r--r--cpu/mpc8220/cpu.c29
-rw-r--r--cpu/mpc83xx/cpu.c10
9 files changed, 72 insertions, 470 deletions
diff --git a/arch/ppc/lib/board.c b/arch/ppc/lib/board.c
index 65f82d23e6..41e564d38c 100644
--- a/arch/ppc/lib/board.c
+++ b/arch/ppc/lib/board.c
@@ -26,6 +26,8 @@
#include <watchdog.h>
#include <command.h>
#include <malloc.h>
+#include <mem_malloc.h>
+#include <init.h>
#include <devices.h>
#ifdef CONFIG_8xx
#include <mpc8xx.h>
@@ -116,45 +118,15 @@ ulong monitor_flash_len;
#include <bedbug/type.h>
#endif
-/*
- * Begin and End of memory area for malloc(), and current "brk"
- */
-static ulong mem_malloc_start = 0;
-static ulong mem_malloc_end = 0;
-static ulong mem_malloc_brk = 0;
-
-/************************************************************************
- * Utilities *
- ************************************************************************
- */
-
-/*
- * The Malloc area is immediately below the monitor copy in DRAM
- */
-static void mem_malloc_init (void)
+int ppc_mem_alloc_init(void)
{
ulong dest_addr = CFG_MONITOR_BASE + gd->reloc_off;
- mem_malloc_end = dest_addr;
- mem_malloc_start = dest_addr - TOTAL_MALLOC_LEN;
- mem_malloc_brk = mem_malloc_start;
-
- memset ((void *) mem_malloc_start,
- 0,
- mem_malloc_end - mem_malloc_start);
+ mem_alloc_init(dest_addr - TOTAL_MALLOC_LEN,
+ dest_addr);
}
-void *sbrk (ptrdiff_t increment)
-{
- ulong old = mem_malloc_brk;
- ulong new = old + increment;
-
- if ((new < mem_malloc_start) || (new > mem_malloc_end)) {
- return (NULL);
- }
- mem_malloc_brk = new;
- return ((void *) old);
-}
+core_initcall(ppc_mem_alloc_init);
char *strmhz (char *buf, long hz)
{
@@ -189,61 +161,6 @@ typedef int (init_fnc_t) (void);
void board_add_ram_info(int);
#endif
-static int init_func_ram (void)
-{
-#ifdef CONFIG_BOARD_TYPES
- int board_type = gd->board_type;
-#else
- int board_type = 0; /* use dummy arg */
-#endif
- puts ("DRAM: ");
-
- if ((gd->ram_size = initdram (board_type)) > 0) {
- print_size (gd->ram_size, "");
-#ifdef CONFIG_ADD_RAM_INFO
- board_add_ram_info(0);
-#endif
- putc('\n');
- return (0);
- }
- puts (failed);
- return (1);
-}
-
-/***********************************************************************/
-
-#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
-static int init_func_i2c (void)
-{
- puts ("I2C: ");
- i2c_init (CFG_I2C_SPEED, CFG_I2C_SLAVE);
- puts ("ready\n");
- return (0);
-}
-#endif
-
-/***********************************************************************/
-
-#if defined(CONFIG_WATCHDOG)
-static int init_func_watchdog_init (void)
-{
- puts (" Watchdog enabled\n");
- WATCHDOG_RESET ();
- return (0);
-}
-# define INIT_FUNC_WATCHDOG_INIT init_func_watchdog_init,
-
-static int init_func_watchdog_reset (void)
-{
- WATCHDOG_RESET ();
- return (0);
-}
-# define INIT_FUNC_WATCHDOG_RESET init_func_watchdog_reset,
-#else
-# define INIT_FUNC_WATCHDOG_INIT /* undef */
-# define INIT_FUNC_WATCHDOG_RESET /* undef */
-#endif /* CONFIG_WATCHDOG */
-
static void init_bd(bd_t *bd, ulong bootflag) {
bd->bi_memstart = CFG_SDRAM_BASE; /* start of DRAM memory */
bd->bi_memsize = gd->ram_size; /* size of DRAM memory in bytes */
@@ -251,9 +168,6 @@ static void init_bd(bd_t *bd, ulong bootflag) {
#ifdef CONFIG_IP860
bd->bi_sramstart = SRAM_BASE; /* start of SRAM memory */
bd->bi_sramsize = SRAM_SIZE; /* size of SRAM memory */
-#elif defined CONFIG_MPC8220
- bd->bi_sramstart = CFG_SRAM_BASE; /* start of SRAM memory */
- bd->bi_sramsize = CFG_SRAM_SIZE; /* size of SRAM memory */
#else
bd->bi_sramstart = 0; /* FIXME */ /* start of SRAM memory */
bd->bi_sramsize = 0; /* FIXME */ /* size of SRAM memory */
@@ -263,32 +177,6 @@ static void init_bd(bd_t *bd, ulong bootflag) {
defined(CONFIG_E500) || defined(CONFIG_MPC86xx)
bd->bi_immr_base = CFG_IMMR; /* base of IMMR register */
#endif
-#if defined(CONFIG_MPC5xxx)
- bd->bi_mbar_base = CFG_MBAR; /* base of internal registers */
-#endif
-#if defined(CONFIG_MPC83XX)
- bd->bi_immrbar = CFG_IMMR;
-#endif
-#if defined(CONFIG_MPC8220)
- bd->bi_mbar_base = CFG_MBAR; /* base of internal registers */
- bd->bi_inpfreq = gd->inp_clk;
- bd->bi_pcifreq = gd->pci_clk;
- bd->bi_vcofreq = gd->vco_clk;
- bd->bi_pevfreq = gd->pev_clk;
- bd->bi_flbfreq = gd->flb_clk;
-
- /* store bootparam to sram (backward compatible), here? */
- {
- u32 *sram = (u32 *)CFG_SRAM_BASE;
- *sram++ = gd->ram_size;
- *sram++ = gd->bus_clk;
- *sram++ = gd->inp_clk;
- *sram++ = gd->cpu_clk;
- *sram++ = gd->vco_clk;
- *sram++ = gd->flb_clk;
- *sram++ = 0xb8c3ba11; /* boot signature */
- }
-#endif
bd->bi_bootflags = bootflag; /* boot / reboot flag (for LynxOS) */
@@ -301,10 +189,6 @@ static void init_bd(bd_t *bd, ulong bootflag) {
bd->bi_sccfreq = gd->scc_clk;
bd->bi_vco = gd->vco_out;
#endif /* CONFIG_CPM2 */
-#if defined(CONFIG_MPC5xxx)
- bd->bi_ipbfreq = gd->ipb_clk;
- bd->bi_pcifreq = gd->pci_clk;
-#endif /* CONFIG_MPC5xxx */
bd->bi_baudrate = gd->baudrate; /* Console Baudrate */
#ifdef CFG_EXTBDINFO
@@ -323,22 +207,6 @@ static void init_bd(bd_t *bd, ulong bootflag) {
}
/************************************************************************
- * Initialization sequence *
- ************************************************************************
- */
-
-init_fnc_t *init_sequence[] = {
-
- get_clocks, /* get CPU and bus clocks (etc.) */
- init_timebase,
- serial_init,
- checkcpu,
- checkboard,
-
- NULL, /* Terminate this list */
-};
-
-/************************************************************************
*
* This is the first part of the initialization sequence that is
* implemented in C, but still running from ROM.
@@ -369,14 +237,8 @@ void board_init_f (ulong bootflag)
/* Clear initial global data */
memset ((void *) gd, 0, sizeof (gd_t));
-#if 0
- for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {
- if ((*init_fnc_ptr) () != 0) {
- hang ();
- }
- }
-#endif
- /*
+
+ /*
* Now that we have DRAM mapped and working, we can
* relocate the code and continue running from DRAM.
*
@@ -390,9 +252,8 @@ void board_init_f (ulong bootflag)
len = (ulong)&_end - CFG_MONITOR_BASE;
addr = CFG_SDRAM_BASE + initdram (0);
-PUTHEX_LL(addr);
-PUTC(':');
- /*
+
+ /*
* reserve memory for U-Boot code, data & bss
* round down to next 4 kB limit
*/
@@ -489,9 +350,6 @@ void board_init_r (gd_t *id, ulong dest_addr)
extern void malloc_bin_reloc (void);
PUTC('B');
while(1);
-#ifndef CFG_NO_FLASH
- ulong flash_size;
-#endif
gd = id; /* initialize RAM version of global data */
bd = gd->bd;
@@ -499,10 +357,6 @@ while(1);
gd->flags |= GD_FLG_RELOC; /* tell others: relocation done */
gd->reloc_off = dest_addr - CFG_MONITOR_BASE;
-#ifdef CONFIG_SERIAL_MULTI
- serial_initialize();
-#endif
-
debug ("Now running in RAM - U-Boot at: %08lx\n", dest_addr);
WATCHDOG_RESET ();
@@ -536,44 +390,9 @@ while(1);
}
#endif
}
- /* there are some other pointer constants we must deal with */
WATCHDOG_RESET ();
-#ifdef CONFIG_LOGBUFFER
- logbuff_init_ptrs ();
-#endif
-#ifdef CONFIG_POST
- post_output_backlog ();
- post_reloc ();
-#endif
-
- WATCHDOG_RESET();
-
-#if defined(CONFIG_IP860) || defined(CONFIG_PCU_E) || \
- defined (CONFIG_FLAGADM) || defined(CONFIG_MPC83XX)
- icache_enable (); /* it's time to enable the instruction cache */
-#endif
-
-#if defined(CFG_INIT_RAM_LOCK) && defined(CONFIG_E500)
- unlock_ram_in_cache(); /* it's time to unlock D-cache in e500 */
-#endif
-
-#if defined(CONFIG_BAB7xx) || defined(CONFIG_CPC45)
- /*
- * Do PCI configuration on BAB7xx and CPC45 _before_ the flash
- * gets initialised, because we need the ISA resp. PCI_to_LOCAL bus
- * bridge there.
- */
- pci_init ();
-#endif
-#if defined(CONFIG_BAB7xx)
- /*
- * Initialise the ISA bridge
- */
- initialise_w83c553f ();
-#endif
-
asm ("sync ; isync");
/*
@@ -588,261 +407,19 @@ while(1);
WATCHDOG_RESET ();
- /* initialize malloc() area */
- mem_malloc_init ();
malloc_bin_reloc ();
-#ifdef CONFIG_SPI
-# if !defined(CFG_ENV_IS_IN_EEPROM)
- spi_init_f ();
-# endif
- spi_init_r ();
-#endif
-
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
WATCHDOG_RESET ();
- puts ("NAND: ");
- nand_init(); /* go init the NAND */
-#endif
-
- /* relocate environment function pointers etc. */
-// env_relocate ();
-
- /*
- * Fill in missing fields of bd_info.
- * We do this here, where we have "normal" access to the
- * environment; we used to do this still running from ROM,
- * where had to use getenv_r(), which can be pretty slow when
- * the environment is in EEPROM.
- */
-
-#if defined(CFG_EXTBDINFO)
-#if defined(CONFIG_405GP) || defined(CONFIG_405EP)
-#if defined(CONFIG_I2CFAST)
- /*
- * set bi_iic_fast for linux taking environment variable
- * "i2cfast" into account
- */
- {
- char *s = getenv ("i2cfast");
- if (s && ((*s == 'y') || (*s == 'Y'))) {
- bd->bi_iic_fast[0] = 1;
- bd->bi_iic_fast[1] = 1;
- } else {
- bd->bi_iic_fast[0] = 0;
- bd->bi_iic_fast[1] = 0;
- }
- }
-#else
- bd->bi_iic_fast[0] = 0;
- bd->bi_iic_fast[1] = 0;
-#endif /* CONFIG_I2CFAST */
-#endif /* CONFIG_405GP, CONFIG_405EP */
-#endif /* CFG_EXTBDINFO */
-
- s = getenv ("ethaddr");
-#if defined (CONFIG_MBX) || \
- defined (CONFIG_RPXCLASSIC) || \
- defined(CONFIG_IAD210) || \
- defined(CONFIG_V38B)
- if (s == NULL)
- board_get_enetaddr (bd->bi_enetaddr);
- else
-#endif
- for (i = 0; i < 6; ++i) {
- bd->bi_enetaddr[i] = s ? simple_strtoul (s, &e, 16) : 0;
- if (s)
- s = (*e) ? e + 1 : e;
- }
-#ifdef CONFIG_HERMES
- if ((gd->board_type >> 16) == 2)
- bd->bi_ethspeed = gd->board_type & 0xFFFF;
- else
- bd->bi_ethspeed = 0xFFFF;
-#endif
-
-#ifdef CONFIG_NX823
- load_sernum_ethaddr ();
-#endif
-
-#ifdef CONFIG_HAS_ETH1
- /* handle the 2nd ethernet address */
-
- s = getenv ("eth1addr");
-
- for (i = 0; i < 6; ++i) {
- bd->bi_enet1addr[i] = s ? simple_strtoul (s, &e, 16) : 0;
- if (s)
- s = (*e) ? e + 1 : e;
- }
-#endif
-#ifdef CONFIG_HAS_ETH2
- /* handle the 3rd ethernet address */
-
- s = getenv ("eth2addr");
-#if defined(CONFIG_XPEDITE1K) || defined(CONFIG_METROBOX) || defined(CONFIG_KAREF)
- if (s == NULL)
- board_get_enetaddr(bd->bi_enet2addr);
- else
-#endif
- for (i = 0; i < 6; ++i) {
- bd->bi_enet2addr[i] = s ? simple_strtoul (s, &e, 16) : 0;
- if (s)
- s = (*e) ? e + 1 : e;
- }
-#endif
-
-#ifdef CONFIG_HAS_ETH3
- /* handle 4th ethernet address */
- s = getenv("eth3addr");
-#if defined(CONFIG_XPEDITE1K) || defined(CONFIG_METROBOX) || defined(CONFIG_KAREF)
- if (s == NULL)
- board_get_enetaddr(bd->bi_enet3addr);
- else
-#endif
- for (i = 0; i < 6; ++i) {
- bd->bi_enet3addr[i] = s ? simple_strtoul (s, &e, 16) : 0;
- if (s)
- s = (*e) ? e + 1 : e;
- }
-#endif
-
-#ifdef CFG_ID_EEPROM
- mac_read_from_eeprom();
-#endif
-
- WATCHDOG_RESET ();
-
-#if defined(CONFIG_PCI) && !defined(CONFIG_BAB7xx) && !defined(CONFIG_CPC45)
- /*
- * Do pci configuration
- */
- pci_init ();
-#endif
-
-#ifdef CONFIG_HERMES
- if (bd->bi_ethspeed != 0xFFFF)
- hermes_start_lxt980 ((int) bd->bi_ethspeed);
-#endif
-
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
- WATCHDOG_RESET ();
- puts ("KGDB: ");
- kgdb_init ();
-#endif
-
- debug ("U-Boot relocated to %08lx\n", dest_addr);
/*
* Enable Interrupts
*/
interrupt_init ();
- /* Must happen after interrupts are initialized since
- * an irq handler gets installed
- */
-#ifdef CONFIG_SERIAL_SOFTWARE_FIFO
- serial_buffered_init();
-#endif
-
#ifdef CONFIG_STATUS_LED
status_led_set (STATUS_LED_BOOT, STATUS_LED_BLINKING);
#endif
- udelay (20);
-
- set_timer (0);
-
- WATCHDOG_RESET ();
-
-#if (CONFIG_COMMANDS & CFG_CMD_SCSI)
- WATCHDOG_RESET ();
- puts ("SCSI: ");
- scsi_init ();
-#endif
-
-#if (CONFIG_COMMANDS & CFG_CMD_DOC)
- WATCHDOG_RESET ();
- puts ("DOC: ");
- doc_init ();
-#endif
-
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
-#if defined(CONFIG_NET_MULTI)
- WATCHDOG_RESET ();
- puts ("Net: ");
-#endif
-
-#endif
-
-#ifdef CONFIG_POST
- post_run (NULL, POST_RAM | post_bootmode_get(0));
-#endif
-
-#if (CONFIG_COMMANDS & CFG_CMD_PCMCIA) && !(CONFIG_COMMANDS & CFG_CMD_IDE)
- WATCHDOG_RESET ();
- puts ("PCMCIA:");
- pcmcia_init ();
-#endif
-
-#if (CONFIG_COMMANDS & CFG_CMD_IDE)
- WATCHDOG_RESET ();
-# ifdef CONFIG_IDE_8xx_PCCARD
- puts ("PCMCIA:");
-# else
- puts ("IDE: ");
-#endif
- ide_init ();
-#endif /* CFG_CMD_IDE */
-
-#ifdef CONFIG_LAST_STAGE_INIT
- WATCHDOG_RESET ();
- /*
- * Some parts can be only initialized if all others (like
- * Interrupts) are up and running (i.e. the PC-style ISA
- * keyboard).
- */
- last_stage_init ();
-#endif
-
-#if (CONFIG_COMMANDS & CFG_CMD_BEDBUG)
- WATCHDOG_RESET ();
- bedbug_init ();
-#endif
-
-#if defined(CONFIG_PRAM) || defined(CONFIG_LOGBUFFER)
- /*
- * Export available size of memory for Linux,
- * taking into account the protected RAM at top of memory
- */
- {
- ulong pram;
- uchar memsz[32];
-#ifdef CONFIG_PRAM
- char *s;
-
- if ((s = getenv ("pram")) != NULL) {
- pram = simple_strtoul (s, NULL, 10);
- } else {
- pram = CONFIG_PRAM;
- }
-#else
- pram=0;
-#endif
-#ifdef CONFIG_LOGBUFFER
- /* Also take the logbuffer into account (pram is in kB) */
- pram += (LOGBUFF_LEN+LOGBUFF_OVERHEAD)/1024;
-#endif
- sprintf ((char *)memsz, "%ldk", (bd->bi_memsize / 1024) - pram);
- setenv ("mem", (char *)memsz);
- }
-#endif
-
-#ifdef CONFIG_PS2KBD
- puts ("PS/2: ");
- kbd_init();
-#endif
-
/* Initialization complete - start the monitor */
/* main_loop() can return to retry autoboot, if so just run it again. */
diff --git a/arch/ppc/lib/time.c b/arch/ppc/lib/time.c
index a7697a172a..a66f57ba98 100644
--- a/arch/ppc/lib/time.c
+++ b/arch/ppc/lib/time.c
@@ -65,7 +65,7 @@ unsigned long ticks2usec(unsigned long ticks)
/* ------------------------------------------------------------------------- */
-int init_timebase (void)
+static int init_timebase (void)
{
#if defined(CONFIG_5xx) || defined(CONFIG_8xx)
volatile immap_t *immap = (immap_t *) CFG_IMMR;
@@ -98,6 +98,7 @@ static struct clocksource cs = {
static int clocksource_init (void)
{
+ init_timebase();
cs.mult = clocksource_hz2mult(get_tbclk(), cs.shift);
diff --git a/common/Makefile b/common/Makefile
index 915ea69f30..42bd5f79b5 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -87,4 +87,5 @@ obj-$(CONFIG_CMD_SLEEP) += cmd_misc.o
obj-y += mtdpart.o
obj-y += env.o
-
+obj-y += startup.o
+obj-y += misc.o
diff --git a/common/startup.c b/common/startup.c
index 8dc42ab905..0758d78fe4 100644
--- a/common/startup.c
+++ b/common/startup.c
@@ -64,36 +64,6 @@ ulong monitor_flash_len;
const char version_string[] =
U_BOOT_VERSION" (" __DATE__ " - " __TIME__ ")"CONFIG_IDENT_STRING;
-/*
- * Begin and End of memory area for malloc(), and current "brk"
- */
-static ulong mem_malloc_start = 0;
-static ulong mem_malloc_end = 0;
-static ulong mem_malloc_brk = 0;
-
-static void mem_malloc_init (void)
-{
- mem_malloc_start = _armboot_start - CFG_MALLOC_LEN;
- mem_malloc_end = _armboot_start;
- mem_malloc_brk = mem_malloc_start;
-
- memset ((void *) mem_malloc_start, 0,
- mem_malloc_end - mem_malloc_start);
-}
-
-void *sbrk (ptrdiff_t increment)
-{
- ulong old = mem_malloc_brk;
- ulong new = old + increment;
-
- if ((new < mem_malloc_start) || (new > mem_malloc_end)) {
- return (NULL);
- }
- mem_malloc_brk = new;
-
- return ((void *) old);
-}
-
/************************************************************************
* Init Utilities *
************************************************************************
diff --git a/cpu/mpc5xxx/cpu.c b/cpu/mpc5xxx/cpu.c
index 813aa7935d..d7e5903752 100644
--- a/cpu/mpc5xxx/cpu.c
+++ b/cpu/mpc5xxx/cpu.c
@@ -30,6 +30,7 @@
#include <command.h>
#include <mpc5xxx.h>
#include <asm/processor.h>
+#include <init.h>
#if defined(CONFIG_OF_FLAT_TREE)
#include <ft_build.h>
@@ -129,3 +130,14 @@ ft_cpu_setup(void *blob, bd_t *bd)
memcpy(p, bd->bi_enetaddr, 6);
}
#endif
+
+static int mpc5xxx_bd_init(void)
+{
+ bd_t *bd = gd->bd;
+
+ bd->bi_mbar_base = CFG_MBAR; /* base of internal registers */
+ bd->bi_ipbfreq = gd->ipb_clk;
+ bd->bi_pcifreq = gd->pci_clk;
+}
+
+bd_initcall(mpc5xxx_bd_init);
diff --git a/cpu/mpc5xxx/i2c.c b/cpu/mpc5xxx/i2c.c
index b497c9469a..7a8f8ed79a 100644
--- a/cpu/mpc5xxx/i2c.c
+++ b/cpu/mpc5xxx/i2c.c
@@ -22,11 +22,10 @@
*/
#include <common.h>
+#include <init.h>
DECLARE_GLOBAL_DATA_PTR;
-#ifdef CONFIG_HARD_I2C
-
#include <mpc5xxx.h>
#include <i2c.h>
@@ -207,7 +206,7 @@ static int receive_bytes(uchar chip, char *buf, int len)
/**************** I2C API ****************/
-void i2c_init(int speed, int saddr)
+int i2c_init(void)
{
struct mpc5xxx_i2c *regs = (struct mpc5xxx_i2c *)I2C_BASE;
@@ -216,7 +215,7 @@ void i2c_init(int speed, int saddr)
/* Set clock
*/
- mpc_reg_out(&regs->mfdr, mpc_get_fdr(speed), 0);
+ mpc_reg_out(&regs->mfdr, mpc_get_fdr(CFG_I2C_SPEED), 0);
/* Enable module
*/
@@ -226,6 +225,8 @@ void i2c_init(int speed, int saddr)
return;
}
+device_initcall(i2c_init);
+
static int mpc_get_fdr(int speed)
{
static int fdr = -1;
@@ -393,4 +394,3 @@ void i2c_reg_write(uchar chip, uchar reg, uchar val)
return;
}
-#endif /* CONFIG_HARD_I2C */
diff --git a/cpu/mpc5xxx/speed.c b/cpu/mpc5xxx/speed.c
index 7847adcefa..6325e26132 100644
--- a/cpu/mpc5xxx/speed.c
+++ b/cpu/mpc5xxx/speed.c
@@ -79,6 +79,8 @@ int get_clocks (void)
return (0);
}
+core_initcall(get_clocks);
+
int prt_mpc5xxx_clks (void)
{
printf(" Bus %ld MHz, IPB %ld MHz, PCI %ld MHz\n",
diff --git a/cpu/mpc8220/cpu.c b/cpu/mpc8220/cpu.c
index be274cde9e..b4e351fe46 100644
--- a/cpu/mpc8220/cpu.c
+++ b/cpu/mpc8220/cpu.c
@@ -89,3 +89,32 @@ unsigned long get_tbclk (void)
}
/* ------------------------------------------------------------------------- */
+
+static int mpc8220_bd_init(void)
+{
+ bd_t *bd = gd->bd;
+
+ bd->bi_sramstart = CFG_SRAM_BASE; /* start of SRAM memory */
+ bd->bi_sramsize = CFG_SRAM_SIZE; /* size of SRAM memory */
+
+ bd->bi_mbar_base = CFG_MBAR; /* base of internal registers */
+ bd->bi_inpfreq = gd->inp_clk;
+ bd->bi_pcifreq = gd->pci_clk;
+ bd->bi_vcofreq = gd->vco_clk;
+ bd->bi_pevfreq = gd->pev_clk;
+ bd->bi_flbfreq = gd->flb_clk;
+
+ /* store bootparam to sram (backward compatible), here? */
+ {
+ u32 *sram = (u32 *)CFG_SRAM_BASE;
+ *sram++ = gd->ram_size;
+ *sram++ = gd->bus_clk;
+ *sram++ = gd->inp_clk;
+ *sram++ = gd->cpu_clk;
+ *sram++ = gd->vco_clk;
+ *sram++ = gd->flb_clk;
+ *sram++ = 0xb8c3ba11; /* boot signature */
+ }
+}
+
+bd_initcall(mpc8220_bd_init);
diff --git a/cpu/mpc83xx/cpu.c b/cpu/mpc83xx/cpu.c
index 1b5107881e..3331d9952f 100644
--- a/cpu/mpc83xx/cpu.c
+++ b/cpu/mpc83xx/cpu.c
@@ -32,6 +32,7 @@
#include <mpc83xx.h>
#include <ft_build.h>
#include <asm/processor.h>
+#include <init.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -387,3 +388,12 @@ int dma_xfer(void *dest, u32 count, void *src)
return ((int)dma_check());
}
#endif /*CONFIG_DDR_ECC*/
+
+static int mpc5xxx_bd_init(void)
+{
+ bd_t *bd = gd->bd;
+
+ bd->bi_immrbar = CFG_IMMR;
+}
+
+bd_initcall(mpc5xxx_bd_init);