diff options
author | Wolfgang Denk <wd@pollux.denx.de> | 2005-10-13 01:45:54 +0200 |
---|---|---|
committer | Wolfgang Denk <wd@pollux.denx.de> | 2005-10-13 01:45:54 +0200 |
commit | f57f70aab9d5ed7964f2f791829a2d780b788a7e (patch) | |
tree | a618aa9c21d7e9ee9cb79161f0085edaa5f22672 /common | |
parent | 3df5bea0b0bddc196bf952c51d1dd54d966b82ba (diff) |
Support passing of OF flat trees to the kernel.
Patch by Pantelis Antoniou, 04 Sep 2005
Diffstat (limited to 'common')
-rw-r--r-- | common/Makefile | 2 | ||||
-rw-r--r-- | common/cmd_bootm.c | 42 | ||||
-rw-r--r-- | common/cmd_immap.c | 13 |
3 files changed, 54 insertions, 3 deletions
diff --git a/common/Makefile b/common/Makefile index 6366e0226a9..7dbf84a555e 100644 --- a/common/Makefile +++ b/common/Makefile @@ -46,7 +46,7 @@ COBJS = main.o ACEX1K.o altera.o bedbug.o circbuf.o \ env_nand.o env_dataflash.o env_flash.o env_eeprom.o \ env_nvram.o env_nowhere.o \ exports.o \ - flash.o fpga.o \ + flash.o fpga.o ft_build.o \ hush.o kgdb.o lcd.o lists.o lynxkdi.o \ memsize.o miiphybb.o miiphyutil.o \ s_record.o serial.o soft_i2c.o soft_spi.o spartan2.o spartan3.o \ diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index ab6ccbb07cb..ee1b5c1c242 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -34,6 +34,10 @@ #include <environment.h> #include <asm/byteorder.h> +#ifdef CONFIG_OF_FLAT_TREE +#include <ft_build.h> +#endif + /*cmd_boot.c*/ extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); @@ -489,6 +493,11 @@ fixup_silent_linux () } #endif /* CONFIG_SILENT_CONSOLE */ +#ifdef CONFIG_OF_FLAT_TREE +extern const unsigned char oftree_dtb[]; +extern const unsigned int oftree_dtb_len; +#endif + #ifdef CONFIG_PPC static void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, @@ -511,6 +520,9 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, bd_t *kbd; void (*kernel)(bd_t *, ulong, ulong, ulong, ulong); image_header_t *hdr = &header; +#ifdef CONFIG_OF_FLAT_TREE + char *of_flat_tree; +#endif if ((s = getenv ("initrd_high")) != NULL) { /* a value of "no" or a similar string will act like 0, @@ -776,15 +788,26 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, initrd_end = 0; } +#ifdef CONFIG_OF_FLAT_TREE + if (initrd_start == 0) + of_flat_tree = (char *)(((ulong)kbd - OF_FLAT_TREE_MAX_SIZE - + sizeof(bd_t)) & ~0xF); + else + of_flat_tree = (char *)((initrd_start - OF_FLAT_TREE_MAX_SIZE - + sizeof(bd_t)) & ~0xF); +#endif debug ("## Transferring control to Linux (at address %08lx) ...\n", (ulong)kernel); SHOW_BOOT_PROGRESS (15); +#ifndef CONFIG_OF_FLAT_TREE + #if defined(CFG_INIT_RAM_LOCK) && !defined(CONFIG_E500) unlock_ram_in_cache(); #endif + /* * Linux Kernel Parameters: * r3: ptr to board info data @@ -794,6 +817,25 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, * r7: End of command line string */ (*kernel) (kbd, initrd_start, initrd_end, cmd_start, cmd_end); + +#else + ft_setup(of_flat_tree, OF_FLAT_TREE_MAX_SIZE, kbd); + /* ft_dump_blob(of_flat_tree); */ + +#if defined(CFG_INIT_RAM_LOCK) && !defined(CONFIG_E500) + unlock_ram_in_cache(); +#endif + /* + * Linux Kernel Parameters: + * r3: ptr to OF flat tree, followed by the board info data + * r4: initrd_start or 0 if no initrd + * r5: initrd_end - unused if r4 is 0 + * r6: Start of command line string + * r7: End of command line string + */ + (*kernel) ((bd_t *)of_flat_tree, initrd_start, initrd_end, cmd_start, cmd_end); + +#endif } #endif /* CONFIG_PPC */ diff --git a/common/cmd_immap.c b/common/cmd_immap.c index 9db5f2cc46c..f1b05357c8a 100644 --- a/common/cmd_immap.c +++ b/common/cmd_immap.c @@ -318,11 +318,20 @@ int do_iopset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { uint rcode = 0; + iopin_t iopin; static uint port = 0; static uint pin = 0; static uint value = 0; - static enum { DIR, PAR, SOR, ODR, DAT, INT } cmd = DAT; - iopin_t iopin; + static enum { + DIR, + PAR, + SOR, + ODR, + DAT, +#if defined(CONFIG_8xx) + INT +#endif + } cmd = DAT; if (argc != 5) { puts ("iopset PORT PIN CMD VALUE\n"); |