summaryrefslogtreecommitdiff
path: root/lib_ppc/board.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib_ppc/board.c')
-rw-r--r--lib_ppc/board.c57
1 files changed, 33 insertions, 24 deletions
diff --git a/lib_ppc/board.c b/lib_ppc/board.c
index 3b1bfea..c87d46c 100644
--- a/lib_ppc/board.c
+++ b/lib_ppc/board.c
@@ -35,13 +35,13 @@
#ifdef CONFIG_MPC5xxx
#include <mpc5xxx.h>
#endif
-#if (CONFIG_COMMANDS & CFG_CMD_IDE)
+#if defined(CONFIG_CMD_IDE)
#include <ide.h>
#endif
-#if (CONFIG_COMMANDS & CFG_CMD_SCSI)
+#if defined(CONFIG_CMD_SCSI)
#include <scsi.h>
#endif
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
#include <kgdb.h>
#endif
#ifdef CONFIG_STATUS_LED
@@ -80,14 +80,14 @@ extern int update_flash_size (int flash_size);
extern void sc3_read_eeprom(void);
#endif
-#if (CONFIG_COMMANDS & CFG_CMD_DOC)
+#if defined(CONFIG_CMD_DOC)
void doc_init (void);
#endif
#if defined(CONFIG_HARD_I2C) || \
defined(CONFIG_SOFT_I2C)
#include <i2c.h>
#endif
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
void nand_init (void);
#endif
@@ -118,7 +118,7 @@ extern ulong __init_end;
extern ulong _end;
ulong monitor_flash_len;
-#if (CONFIG_COMMANDS & CFG_CMD_BEDBUG)
+#if defined(CONFIG_CMD_BEDBUG)
#include <bedbug/type.h>
#endif
@@ -139,10 +139,10 @@ static ulong mem_malloc_brk = 0;
*/
static void mem_malloc_init (void)
{
- ulong dest_addr = CFG_MONITOR_BASE + gd->reloc_off;
-
- mem_malloc_end = dest_addr;
- mem_malloc_start = dest_addr - TOTAL_MALLOC_LEN;
+#if !defined(CONFIG_RELOC_FIXUP_WORKS)
+ mem_malloc_end = CFG_MONITOR_BASE + gd->reloc_off;
+#endif
+ mem_malloc_start = mem_malloc_end - TOTAL_MALLOC_LEN;
mem_malloc_brk = mem_malloc_start;
memset ((void *) mem_malloc_start,
@@ -309,7 +309,9 @@ init_fnc_t *init_sequence[] = {
prt_8260_rsr,
prt_8260_clks,
#endif /* CONFIG_8260 */
-
+#if defined(CONFIG_MPC83XX)
+ prt_83xx_rsr,
+#endif
checkcpu,
#if defined(CONFIG_MPC5xxx)
prt_mpc5xxx_clks,
@@ -376,7 +378,7 @@ void board_init_f (ulong bootflag)
/* compiler optimization barrier needed for GCC >= 3.4 */
__asm__ __volatile__("": : :"memory");
-#if !defined(CONFIG_CPM2)
+#if !defined(CONFIG_CPM2) && !defined(CONFIG_MPC83XX)
/* Clear initial global data */
memset ((void *) gd, 0, sizeof (gd_t));
#endif
@@ -620,7 +622,13 @@ void board_init_r (gd_t *id, ulong dest_addr)
bd = gd->bd;
gd->flags |= GD_FLG_RELOC; /* tell others: relocation done */
+
+#if defined(CONFIG_RELOC_FIXUP_WORKS)
+ gd->reloc_off = 0;
+ mem_malloc_end = dest_addr;
+#else
gd->reloc_off = dest_addr - CFG_MONITOR_BASE;
+#endif
#ifdef CONFIG_SERIAL_MULTI
serial_initialize();
@@ -779,7 +787,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
spi_init_r ();
#endif
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
WATCHDOG_RESET ();
puts ("NAND: ");
nand_init(); /* go init the NAND */
@@ -942,7 +950,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
hermes_start_lxt980 ((int) bd->bi_ethspeed);
#endif
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
WATCHDOG_RESET ();
puts ("KGDB: ");
kgdb_init ();
@@ -974,27 +982,27 @@ void board_init_r (gd_t *id, ulong dest_addr)
if ((s = getenv ("loadaddr")) != NULL) {
load_addr = simple_strtoul (s, NULL, 16);
}
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
if ((s = getenv ("bootfile")) != NULL) {
copy_filename (BootFile, s, sizeof (BootFile));
}
-#endif /* CFG_CMD_NET */
+#endif
WATCHDOG_RESET ();
-#if (CONFIG_COMMANDS & CFG_CMD_SCSI)
+#if defined(CONFIG_CMD_SCSI)
WATCHDOG_RESET ();
puts ("SCSI: ");
scsi_init ();
#endif
-#if (CONFIG_COMMANDS & CFG_CMD_DOC)
+#if defined(CONFIG_CMD_DOC)
WATCHDOG_RESET ();
puts ("DOC: ");
doc_init ();
#endif
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
#if defined(CONFIG_NET_MULTI)
WATCHDOG_RESET ();
puts ("Net: ");
@@ -1002,7 +1010,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
eth_initialize (bd);
#endif
-#if (CONFIG_COMMANDS & CFG_CMD_NET) && ( \
+#if defined(CONFIG_CMD_NET) && ( \
defined(CONFIG_CCM) || \
defined(CONFIG_ELPT860) || \
defined(CONFIG_EP8260) || \
@@ -1027,13 +1035,14 @@ void board_init_r (gd_t *id, ulong dest_addr)
post_run (NULL, POST_RAM | post_bootmode_get(0));
#endif
-#if (CONFIG_COMMANDS & CFG_CMD_PCMCIA) && !(CONFIG_COMMANDS & CFG_CMD_IDE)
+#if defined(CONFIG_CMD_PCMCIA) \
+ && !defined(CONFIG_CMD_IDE)
WATCHDOG_RESET ();
puts ("PCMCIA:");
pcmcia_init ();
#endif
-#if (CONFIG_COMMANDS & CFG_CMD_IDE)
+#if defined(CONFIG_CMD_IDE)
WATCHDOG_RESET ();
# ifdef CONFIG_IDE_8xx_PCCARD
puts ("PCMCIA:");
@@ -1046,7 +1055,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
#else
ide_init ();
#endif
-#endif /* CFG_CMD_IDE */
+#endif
#ifdef CONFIG_LAST_STAGE_INIT
WATCHDOG_RESET ();
@@ -1058,7 +1067,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
last_stage_init ();
#endif
-#if (CONFIG_COMMANDS & CFG_CMD_BEDBUG)
+#if defined(CONFIG_CMD_BEDBUG)
WATCHDOG_RESET ();
bedbug_init ();
#endif