diff options
-rw-r--r-- | arch/ppc/lib/board.c | 31 | ||||
-rw-r--r-- | arch/ppc/lib/ppclinux.c | 18 | ||||
-rw-r--r-- | common/Kconfig | 5 | ||||
-rw-r--r-- | common/Makefile | 2 | ||||
-rw-r--r-- | common/cmd_boot.c | 6 | ||||
-rw-r--r-- | common/cmd_bootm.c | 3 | ||||
-rw-r--r-- | common/console.c | 19 | ||||
-rw-r--r-- | common/ft_build.c | 8 | ||||
-rw-r--r-- | cpu/mpc5xxx/cpu.c | 7 | ||||
-rw-r--r-- | include/asm-ppc/u-boot.h | 16 | ||||
-rw-r--r-- | include/common.h | 1 | ||||
-rw-r--r-- | lib_generic/vsprintf.c | 9 |
12 files changed, 72 insertions, 53 deletions
diff --git a/arch/ppc/lib/board.c b/arch/ppc/lib/board.c index d306d8ec9c..7a4a580ca4 100644 --- a/arch/ppc/lib/board.c +++ b/arch/ppc/lib/board.c @@ -50,15 +50,15 @@ char *strmhz (char *buf, long hz) /***********************************************************************/ 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 */ + bd->bi_memstart = CFG_SDRAM_BASE; /* start of DRAM memory */ +// bd->bi_memsize = gd->ram_size; /* size of DRAM memory in bytes */ /* FIXME */ #ifdef CONFIG_IP860 -// bd->bi_sramstart = SRAM_BASE; /* start of SRAM memory */ -// bd->bi_sramsize = SRAM_SIZE; /* size of SRAM memory */ + bd->bi_sramstart = SRAM_BASE; /* start of SRAM memory */ + bd->bi_sramsize = 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 */ + bd->bi_sramstart = 0; /* FIXME */ /* start of SRAM memory */ + bd->bi_sramsize = 0; /* FIXME */ /* size of SRAM memory */ #endif #if defined(CONFIG_8xx) || defined(CONFIG_8260) || defined(CONFIG_5xx) || \ @@ -103,23 +103,22 @@ static void init_bd(bd_t *bd, ulong bootflag) { * ************************************************************************ */ + +bd_t *bd; + void board_init_r (ulong end_of_ram) { - bd_t *bd; - char *x; extern void malloc_bin_reloc (void); - asm ("sync ; isync"); + asm ("sync ; isync"); - mem_malloc_init((void *)(end_of_ram - 4096 - CFG_MALLOC_LEN), (void *)(end_of_ram - 4096)); + mem_malloc_init((void *)(end_of_ram - 4096 - CFG_MALLOC_LEN), (void *)(end_of_ram - 4096)); - /* get gd and bd */ - gd = malloc(sizeof(gd_t)); - memset(gd, 0x0, sizeof(gd_t)); - bd = malloc(sizeof(bd_t)); - memset(bd, 0x0, sizeof(bd_t)); + /* get gd and bd */ + bd = malloc(sizeof(bd_t)); + memset(bd, 0x0, sizeof(bd_t)); - gd->bd = bd; + init_bd(bd, 0); /* * Setup trap handlers diff --git a/arch/ppc/lib/ppclinux.c b/arch/ppc/lib/ppclinux.c index 6562860e58..8ef91a40be 100644 --- a/arch/ppc/lib/ppclinux.c +++ b/arch/ppc/lib/ppclinux.c @@ -10,6 +10,8 @@ #ifdef CONFIG_OF_FLAT_TREE #include <ft_build.h> #endif +extern bd_t *bd; +#define SHOW_BOOT_PROGRESS(x) void __attribute__((noinline)) do_bootm_linux (cmd_tbl_t *cmdtp, int flag, @@ -18,7 +20,6 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, ulong *len_ptr, int verify) { -#if 0 ulong sp; ulong len, checksum; ulong initrd_start, initrd_end; @@ -76,7 +77,7 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, debug ("=> set upper limit to 0x%08lX\n", sp); - cmdline = (char *)((sp - CFG_BARGSIZE) & ~0xF); + cmdline = (char *)((sp - CONFIG_CBSIZE) & ~0xF); kbd = (bd_t *)(((ulong)cmdline - sizeof(bd_t)) & ~0xF); if ((s = getenv("bootargs")) == NULL) @@ -87,7 +88,7 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, cmd_start = (ulong)&cmdline[0]; cmd_end = cmd_start + strlen(cmdline); - *kbd = *(gd->bd); + *kbd = *(bd); #ifdef DEBUG printf ("## cmdline at 0x%08lX ... 0x%08lX\n", cmd_start, cmd_end); @@ -146,7 +147,7 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, if (ntohl(hdr->ih_magic) != IH_MAGIC) { puts ("Bad Magic Number\n"); SHOW_BOOT_PROGRESS (-10); - do_reset (cmdtp, flag, argc, argv); + do_reset (); } data = (ulong)&header; @@ -158,7 +159,7 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, if (crc32 (0, (uchar *)data, len) != checksum) { puts ("Bad Header Checksum\n"); SHOW_BOOT_PROGRESS (-11); - do_reset (cmdtp, flag, argc, argv); + do_reset(); } SHOW_BOOT_PROGRESS (10); @@ -195,7 +196,7 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, if (csum != ntohl(hdr->ih_dcrc)) { puts ("Bad Data CRC\n"); SHOW_BOOT_PROGRESS (-12); - do_reset (cmdtp, flag, argc, argv); + do_reset (); } puts ("OK\n"); } @@ -207,7 +208,7 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, (hdr->ih_type != IH_TYPE_RAMDISK) ) { puts ("No Linux PPC Ramdisk Image\n"); SHOW_BOOT_PROGRESS (-13); - do_reset (cmdtp, flag, argc, argv); + do_reset (); } /* @@ -247,7 +248,7 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, hdr = (image_header_t *)of_flat_tree; if (*(ulong *)of_flat_tree == OF_DT_HEADER) { -#ifndef CFG_NO_FLASH +#ifdef CONFIG_OF_FLAT_TREE_FLASH /* FIXME */ if (addr2info((ulong)of_flat_tree) != NULL) of_data = (ulong)of_flat_tree; #endif @@ -464,6 +465,5 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, (*kernel) ((bd_t *)of_flat_tree, (ulong)kernel, 0, 0, 0); #endif -#endif } diff --git a/common/Kconfig b/common/Kconfig index 9370c23bb0..9ecc869154 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -107,6 +107,11 @@ config CONSOLE_ACTIVATE_ALL help Enabling this options activates all consoles on startup, so you will get output and a prompt on all consoles simultaneously. + +config OF_FLAT_TREE + bool + prompt "Open Firmware flat device tree support" + endmenu menu "Commands" diff --git a/common/Makefile b/common/Makefile index 01d4542aa3..5aabb80a1c 100644 --- a/common/Makefile +++ b/common/Makefile @@ -20,6 +20,7 @@ obj-$(CONFIG_CMDLINE_EDITING) += readline.o obj-$(CONFIG_SIMPLE_READLINE) += readline_simple.o obj-$(CONFIG_GREGORIAN_CALENDER) += date.o obj-y += cmd_fs.o +obj-$(CONFIG_OF_FLAT_TREE) += ft_build.o obj-y += exports.o obj-y += main.o @@ -55,7 +56,6 @@ obj-y += readkey.o #obj-y += cmd_fat.o #obj-y += cmd_pci.o #obj-y += cmd_ximg.o -#obj-y += ft_build.o #obj-y += miiphybb.o #obj-y += usb_storage.o #obj-y += circbuf.o diff --git a/common/cmd_boot.c b/common/cmd_boot.c index af549c9f5c..246d3e0265 100644 --- a/common/cmd_boot.c +++ b/common/cmd_boot.c @@ -82,7 +82,11 @@ U_BOOT_CMD_START(go) " passing 'arg' as arguments\n") U_BOOT_CMD_END -extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); +static int cmd_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +{ + do_reset(); + return 1; +} U_BOOT_CMD_START(reset) .maxargs = CONFIG_MAXARGS, diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 0edaf879c9..be0f973155 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -38,7 +38,6 @@ DECLARE_GLOBAL_DATA_PTR; /*cmd_boot.c*/ - extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); #if (CONFIG_COMMANDS & CFG_CMD_DATE) || defined(CONFIG_TIMESTAMP) #include <rtc.h> @@ -332,7 +331,7 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) (uchar *)data, &len) != 0) { puts ("GUNZIP ERROR - must RESET board to recover\n"); SHOW_BOOT_PROGRESS (-6); - do_reset (cmdtp, flag, argc, argv); + do_reset(); } break; #endif diff --git a/common/console.c b/common/console.c index 270c927fee..8f8e433b76 100644 --- a/common/console.c +++ b/common/console.c @@ -175,6 +175,24 @@ int fputs(int fd, const char *s) return 0; } +void fprintf (int file, const char *fmt, ...) +{ + va_list args; + uint i; + char printbuffer[CFG_PBSIZE]; + + va_start (args, fmt); + + /* For this to work, printbuffer must be larger than + * anything we ever want to print. + */ + i = vsprintf (printbuffer, fmt, args); + va_end (args); + + /* Print the string */ + fputs (file, printbuffer); +} + void printf (const char *fmt, ...) { va_list args; @@ -193,6 +211,7 @@ void printf (const char *fmt, ...) puts (printbuffer); } + void vprintf (const char *fmt, va_list args) { uint i; diff --git a/common/ft_build.c b/common/ft_build.c index 980e40f55d..c85082fa14 100644 --- a/common/ft_build.c +++ b/common/ft_build.c @@ -22,10 +22,10 @@ #include <common.h> #include <malloc.h> #include <environment.h> +#include <asm/byteorder.h> +#include <stdio.h> -#ifdef CONFIG_OF_FLAT_TREE - -#include <asm/errno.h> +#include <errno.h> #include <stddef.h> #include <ft_build.h> @@ -588,4 +588,4 @@ void ft_setup(void *blob, bd_t * bd, ulong initrd_start, ulong initrd_end) ft_dump_blob(blob); #endif } -#endif + diff --git a/cpu/mpc5xxx/cpu.c b/cpu/mpc5xxx/cpu.c index 6d5ea03f5e..c83526928c 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 <asm/byteorder.h> #include <init.h> #include <types.h> @@ -73,8 +74,7 @@ int checkcpu (void) /* ------------------------------------------------------------------------- */ -int -do_reset (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) +void do_reset (void) { ulong msr; /* Interrupts and MMU off */ @@ -87,9 +87,6 @@ do_reset (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) *(vu_long *)(MPC5XXX_GPT0_COUNTER) = 0x0001000f; *(vu_long *)(MPC5XXX_GPT0_ENABLE) = 0x9004; /* wden|ce|timer_ms */ while(1); - - return 1; - } /* ------------------------------------------------------------------------- */ diff --git a/include/asm-ppc/u-boot.h b/include/asm-ppc/u-boot.h index e13361e8b7..30b44e3d22 100644 --- a/include/asm-ppc/u-boot.h +++ b/include/asm-ppc/u-boot.h @@ -37,19 +37,19 @@ #ifndef __ASSEMBLY__ typedef struct bd_info { -// unsigned long bi_memstart; /* start of DRAM memory */ -// unsigned long bi_memsize; /* size of DRAM memory in bytes */ -// unsigned long bi_flashstart; /* start of FLASH memory */ -// unsigned long bi_flashsize; /* size of FLASH memory */ -// unsigned long bi_flashoffset; /* reserved area for startup monitor */ -// unsigned long bi_sramstart; /* start of SRAM memory */ -// unsigned long bi_sramsize; /* size of SRAM memory */ + unsigned long bi_memstart; /* start of DRAM memory */ + unsigned long bi_memsize; /* size of DRAM memory in bytes */ + unsigned long bi_flashstart; /* start of FLASH memory */ + unsigned long bi_flashsize; /* size of FLASH memory */ + unsigned long bi_flashoffset; /* reserved area for startup monitor */ + unsigned long bi_sramstart; /* start of SRAM memory */ + unsigned long bi_sramsize; /* size of SRAM memory */ #if defined(CONFIG_5xx) || defined(CONFIG_8xx) || defined(CONFIG_8260) \ || defined(CONFIG_E500) || defined(CONFIG_MPC86xx) unsigned long bi_immr_base; /* base of IMMR register */ #endif #if defined(CONFIG_MPC5xxx) -// unsigned long bi_mbar_base; /* base of internal registers */ + unsigned long bi_mbar_base; /* base of internal registers */ #endif #if defined(CONFIG_MPC83XX) unsigned long bi_immrbar; diff --git a/include/common.h b/include/common.h index e6f7d662ec..68644e0415 100644 --- a/include/common.h +++ b/include/common.h @@ -73,6 +73,7 @@ typedef void (interrupt_handler_t)(void *); /* * Function Prototypes */ +void do_reset(void); #ifdef CONFIG_SERIAL_SOFTWARE_FIFO void serial_buffered_init (void); diff --git a/lib_generic/vsprintf.c b/lib_generic/vsprintf.c index 2740f2e769..5e320f5248 100644 --- a/lib_generic/vsprintf.c +++ b/lib_generic/vsprintf.c @@ -15,11 +15,6 @@ #include <linux/ctype.h> #include <common.h> -#if !defined (CONFIG_PANIC_HANG) -#include <command.h> -/*cmd_boot.c*/ -extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); -#endif unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base) { @@ -379,7 +374,7 @@ void panic(const char *fmt, ...) #if defined (CONFIG_PANIC_HANG) hang(); #else - udelay (100000); /* allow messages to go out */ - do_reset (NULL, 0, 0, NULL); + udelay(100000); /* allow messages to go out */ + do_reset(); #endif } |