diff options
author | Stefan Roese <sr@denx.de> | 2007-08-15 14:51:27 +0200 |
---|---|---|
committer | Stefan Roese <sr@denx.de> | 2007-08-15 14:51:27 +0200 |
commit | d61ea14885631e58a25feaa81ee82eb464c62d6a (patch) | |
tree | 27927975039d0a15e6c6d4dfe8f765a76a12820a /lib_ppc | |
parent | 3ba4c2d68f6541db4677b4aea12071f56e6ff6e6 (diff) | |
parent | 594e79838ce5078a90d0c27abb2b2d61d5f8e8a7 (diff) | |
download | u-boot-imx-d61ea14885631e58a25feaa81ee82eb464c62d6a.zip u-boot-imx-d61ea14885631e58a25feaa81ee82eb464c62d6a.tar.gz u-boot-imx-d61ea14885631e58a25feaa81ee82eb464c62d6a.tar.bz2 |
Merge with git://www.denx.de/git/u-boot.git
Diffstat (limited to 'lib_ppc')
-rw-r--r-- | lib_ppc/board.c | 57 | ||||
-rw-r--r-- | lib_ppc/extable.c | 2 | ||||
-rw-r--r-- | lib_ppc/kgdb.c | 4 |
3 files changed, 36 insertions, 27 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 diff --git a/lib_ppc/extable.c b/lib_ppc/extable.c index 8354411..2d995fa 100644 --- a/lib_ppc/extable.c +++ b/lib_ppc/extable.c @@ -89,7 +89,7 @@ search_exception_table(unsigned long addr) /* if the serial port does not hang in exception, printf can be used */ #if !defined(CFG_SERIAL_HANG_IN_EXCEPTION) if (ex_tab_message) - printf("Bus Fault @ 0x%08lx, fixup 0x%08lx\n", addr, ret); + debug("Bus Fault @ 0x%08lx, fixup 0x%08lx\n", addr, ret); #endif if (ret) return ret; diff --git a/lib_ppc/kgdb.c b/lib_ppc/kgdb.c index 4c5d79a..78c2f0c 100644 --- a/lib_ppc/kgdb.c +++ b/lib_ppc/kgdb.c @@ -1,7 +1,7 @@ #include <common.h> #include <command.h> -#if (CONFIG_COMMANDS & CFG_CMD_KGDB) +#if defined(CONFIG_CMD_KGDB) #include <kgdb.h> #include <asm/signal.h> @@ -323,4 +323,4 @@ kgdb_breakpoint(int argc, char *argv[]) "); } -#endif /* CFG_CMD_KGDB */ +#endif |