* [U-Boot] [PATCH 01/15] Update linux bootm to support ePAPR client interface @ 2008-08-15 13:24 Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 02/15] Clean up usage of icache_disable/dcache_disable Kumar Gala 2008-08-18 22:55 ` [U-Boot] [PATCH 01/15] Update linux bootm to support ePAPR client interface Wolfgang Denk 0 siblings, 2 replies; 41+ messages in thread From: Kumar Gala @ 2008-08-15 13:24 UTC (permalink / raw) To: u-boot the ePAPR spec has some subtle differences from the current device tree based boot interface to the powerpc linux kernel. The powerpc linux kernel currently ignores the differences that ePAPR specifies. Signed-off-by: Kumar Gala <galak@kernel.crashing.org> --- lib_ppc/bootm.c | 33 +++++++++++++++++++++++---------- 1 files changed, 23 insertions(+), 10 deletions(-) diff --git a/lib_ppc/bootm.c b/lib_ppc/bootm.c index cbe5592..e83c860 100644 --- a/lib_ppc/bootm.c +++ b/lib_ppc/bootm.c @@ -80,7 +80,8 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], ulong cmd_start, cmd_end, bootmap_base; bd_t *kbd; ulong ep = 0; - void (*kernel)(bd_t *, ulong, ulong, ulong, ulong); + void (*kernel)(bd_t *, ulong r4, ulong r5, ulong r6, + ulong r7, ulong r8, ulong r9); int ret; ulong of_size = 0; struct lmb *lmb = images->lmb; @@ -166,8 +167,8 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], puts ("Could not find kernel entry point!\n"); goto error; } - kernel = (void (*)(bd_t *, ulong, ulong, ulong, ulong))ep; - + kernel = (void (*)(bd_t *, ulong, ulong, ulong, + ulong, ulong, ulong))ep; /* find ramdisk */ ret = boot_get_ramdisk (argc, argv, images, IH_ARCH_PPC, &rd_data_start, &rd_data_end); @@ -282,14 +283,23 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], if (of_flat_tree) { /* device tree; boot new style */ /* * Linux Kernel Parameters (passing device tree): - * r3: pointer to the fdt, followed by the board info data - * r4: physical pointer to the kernel itself - * r5: NULL - * r6: NULL - * r7: NULL + * r3: pointer to the fdt + * r4: 0 + * r5: 0 + * r6: epapr magic + * r7: size of IMA in bytes + * r8: 0 + * r9: 0 */ +#if defined(CONFIG_85xx) || defined(CONFIG_440) + #define EPAPR_MAGIC (0x45504150) +#else + #define EPAPR_MAGIC (0x65504150) +#endif + debug (" Booting using OF flat tree...\n"); - (*kernel) ((bd_t *)of_flat_tree, (ulong)kernel, 0, 0, 0); + (*kernel) ((bd_t *)of_flat_tree, 0, 0, EPAPR_MAGIC, + CFG_BOOTMAPSZ, 0, 0); /* does not return */ } else #endif @@ -301,9 +311,12 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], * r5: initrd_end - unused if r4 is 0 * r6: Start of command line string * r7: End of command line string + * r8: 0 + * r9: 0 */ debug (" Booting using board info...\n"); - (*kernel) (kbd, initrd_start, initrd_end, cmd_start, cmd_end); + (*kernel) (kbd, initrd_start, initrd_end, + cmd_start, cmd_end, 0, 0); /* does not return */ } return ; -- 1.5.5.1 ^ permalink raw reply related [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 02/15] Clean up usage of icache_disable/dcache_disable 2008-08-15 13:24 [U-Boot] [PATCH 01/15] Update linux bootm to support ePAPR client interface Kumar Gala @ 2008-08-15 13:24 ` Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 03/15] Add command to enable/disable interrupts Kumar Gala 2008-08-18 22:57 ` [U-Boot] [PATCH 02/15] Clean up usage of icache_disable/dcache_disable Wolfgang Denk 2008-08-18 22:55 ` [U-Boot] [PATCH 01/15] Update linux bootm to support ePAPR client interface Wolfgang Denk 1 sibling, 2 replies; 41+ messages in thread From: Kumar Gala @ 2008-08-15 13:24 UTC (permalink / raw) To: u-boot There is no point in disabling the icache on 7xx/74xx/86xx parts and not also flushing the icache. All callers of invalidate_l1_instruction_cache() call icache_disable() right after. Make it so icache_disable() calls invalidate_l1_instruction_cache() for us. Also, dcache_disable() already calls dcache_flush() so there is no point in the explicit calls of dcache_flush(). Signed-off-by: Kumar Gala <galak@kernel.crashing.org> --- board/Marvell/db64360/db64360.c | 5 ----- board/Marvell/db64460/db64460.c | 5 ----- board/esd/cpci750/cpci750.c | 4 ---- board/freescale/mpc7448hpc2/mpc7448hpc2.c | 2 -- board/prodrive/p3mx/p3mx.c | 2 -- common/cmd_bootm.c | 2 -- cpu/74xx_7xx/cache.S | 4 ++++ cpu/mpc86xx/cache.S | 4 ++++ 8 files changed, 8 insertions(+), 20 deletions(-) diff --git a/board/Marvell/db64360/db64360.c b/board/Marvell/db64360/db64360.c index a2ab2d7..2a810a6 100644 --- a/board/Marvell/db64360/db64360.c +++ b/board/Marvell/db64360/db64360.c @@ -51,9 +51,6 @@ #define DP(x) #endif -extern void flush_data_cache (void); -extern void invalidate_l1_instruction_cache (void); - /* ------------------------------------------------------------------------- */ /* this is the current GT register space location */ @@ -930,7 +927,5 @@ void board_prebootm_init () my_remap_gt_regs_bootm (CFG_GT_REGS, BRIDGE_REG_BASE_BOOTM); icache_disable (); - invalidate_l1_instruction_cache (); - flush_data_cache (); dcache_disable (); } diff --git a/board/Marvell/db64460/db64460.c b/board/Marvell/db64460/db64460.c index a4abf8d..1ae898d 100644 --- a/board/Marvell/db64460/db64460.c +++ b/board/Marvell/db64460/db64460.c @@ -51,9 +51,6 @@ #define DP(x) #endif -extern void flush_data_cache (void); -extern void invalidate_l1_instruction_cache (void); - /* ------------------------------------------------------------------------- */ /* this is the current GT register space location */ @@ -930,7 +927,5 @@ void board_prebootm_init () my_remap_gt_regs_bootm (CFG_GT_REGS, BRIDGE_REG_BASE_BOOTM); icache_disable (); - invalidate_l1_instruction_cache (); - flush_data_cache (); dcache_disable (); } diff --git a/board/esd/cpci750/cpci750.c b/board/esd/cpci750/cpci750.c index 298aa6a..5ab76c6 100644 --- a/board/esd/cpci750/cpci750.c +++ b/board/esd/cpci750/cpci750.c @@ -120,8 +120,6 @@ static char show_config_tab[][15] = {{"PCI0DLL_2 "}, /* 31 */ {"DRAMPLL_NDiv_1"}, /* 01 */ {"DRAMPLL_NDiv_0"}}; /* 00 */ -extern void flush_data_cache (void); -extern void invalidate_l1_instruction_cache (void); extern flash_info_t flash_info[]; /* ------------------------------------------------------------------------- */ @@ -961,8 +959,6 @@ void board_prebootm_init () my_remap_gt_regs_bootm (CFG_GT_REGS, CFG_DFL_GT_REGS); icache_disable (); - invalidate_l1_instruction_cache (); - flush_data_cache (); dcache_disable (); } diff --git a/board/freescale/mpc7448hpc2/mpc7448hpc2.c b/board/freescale/mpc7448hpc2/mpc7448hpc2.c index b3d83cc..6f74c31 100644 --- a/board/freescale/mpc7448hpc2/mpc7448hpc2.c +++ b/board/freescale/mpc7448hpc2/mpc7448hpc2.c @@ -37,8 +37,6 @@ DECLARE_GLOBAL_DATA_PTR; -extern void flush_data_cache (void); -extern void invalidate_l1_instruction_cache (void); extern void tsi108_init_f (void); int display_mem_map (void); diff --git a/board/prodrive/p3mx/p3mx.c b/board/prodrive/p3mx/p3mx.c index d54ddaf..69d7c9b 100644 --- a/board/prodrive/p3mx/p3mx.c +++ b/board/prodrive/p3mx/p3mx.c @@ -62,8 +62,6 @@ DECLARE_GLOBAL_DATA_PTR; #define DP(x) #endif -extern void flush_data_cache (void); -extern void invalidate_l1_instruction_cache (void); extern flash_info_t flash_info[]; /* ------------------------------------------------------------------------- */ diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 5295969..0b14b06 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -236,8 +236,6 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) * bios emulation, so turn them off again */ icache_disable(); - invalidate_l1_instruction_cache(); - flush_data_cache(); dcache_disable(); #endif diff --git a/cpu/74xx_7xx/cache.S b/cpu/74xx_7xx/cache.S index 3a745cb..eac4544 100644 --- a/cpu/74xx_7xx/cache.S +++ b/cpu/74xx_7xx/cache.S @@ -245,6 +245,10 @@ _GLOBAL(icache_enable) * Disable L1 Instruction cache */ _GLOBAL(icache_disable) + mflr r4 + bl invalidate_l1_instruction_cache /* uses r3 */ + sync + mtlr r4 mfspr r3, HID0 li r5, 0 ori r5, r5, HID0_ICE diff --git a/cpu/mpc86xx/cache.S b/cpu/mpc86xx/cache.S index 2e4ea02..80ff688 100644 --- a/cpu/mpc86xx/cache.S +++ b/cpu/mpc86xx/cache.S @@ -232,6 +232,10 @@ _GLOBAL(icache_enable) * Disable L1 Instruction cache */ _GLOBAL(icache_disable) + mflr r4 + bl invalidate_l1_instruction_cache /* uses r3 */ + sync + mtlr r4 mfspr r3, HID0 li r5, 0 ori r5, r5, HID0_ICE -- 1.5.5.1 ^ permalink raw reply related [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 03/15] Add command to enable/disable interrupts 2008-08-15 13:24 ` [U-Boot] [PATCH 02/15] Clean up usage of icache_disable/dcache_disable Kumar Gala @ 2008-08-15 13:24 ` Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 04/15] fdt: added the ability to set initrd start/end via chosen command Kumar Gala ` (2 more replies) 2008-08-18 22:57 ` [U-Boot] [PATCH 02/15] Clean up usage of icache_disable/dcache_disable Wolfgang Denk 1 sibling, 3 replies; 41+ messages in thread From: Kumar Gala @ 2008-08-15 13:24 UTC (permalink / raw) To: u-boot Signed-off-by: Kumar Gala <galak@kernel.crashing.org> --- common/Makefile | 1 + common/cmd_irq.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 0 deletions(-) create mode 100644 common/cmd_irq.c diff --git a/common/Makefile b/common/Makefile index c2b381b..0edeb11 100644 --- a/common/Makefile +++ b/common/Makefile @@ -78,6 +78,7 @@ endif COBJS-$(CONFIG_CMD_I2C) += cmd_i2c.o COBJS-$(CONFIG_CMD_IDE) += cmd_ide.o COBJS-$(CONFIG_CMD_IMMAP) += cmd_immap.o +COBJS-$(CONFIG_CMD_IRQ) += cmd_irq.o COBJS-$(CONFIG_CMD_ITEST) += cmd_itest.o COBJS-$(CONFIG_CMD_JFFS2) += cmd_jffs2.o COBJS-y += cmd_load.o diff --git a/common/cmd_irq.c b/common/cmd_irq.c new file mode 100644 index 0000000..04914c6 --- /dev/null +++ b/common/cmd_irq.c @@ -0,0 +1,50 @@ +/* + * Copyright 2008 Freescale Semiconductor, Inc. + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#include <common.h> +#include <config.h> +#include <command.h> + +int do_interrupts(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +{ + + if (argc != 2) { + printf ("Usage:\n%s\n", cmdtp->usage); + return 1; + } + + /* on */ + if (strncmp(argv[1], "on", 2) == 0) { + enable_interrupts(); + } else { + disable_interrupts(); + } + + return 0; +} + +U_BOOT_CMD( + interrupts, 5, 0, do_interrupts, + "interrupts - enable or disable interrupts\n", + "[on, off]\n" + " - enable or disable interrupts\n" +); -- 1.5.5.1 ^ permalink raw reply related [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 04/15] fdt: added the ability to set initrd start/end via chosen command 2008-08-15 13:24 ` [U-Boot] [PATCH 03/15] Add command to enable/disable interrupts Kumar Gala @ 2008-08-15 13:24 ` Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 05/15] fdt: fdt addr w/o any args reports back the current working address Kumar Gala ` (2 more replies) 2008-08-18 22:59 ` [U-Boot] [PATCH 03/15] Add command to enable/disable interrupts Wolfgang Denk 2008-08-20 22:53 ` Wolfgang Denk 2 siblings, 3 replies; 41+ messages in thread From: Kumar Gala @ 2008-08-15 13:24 UTC (permalink / raw) To: u-boot Signed-off-by: Kumar Gala <galak@kernel.crashing.org> --- common/cmd_fdt.c | 21 +++++++++++++++++---- 1 files changed, 17 insertions(+), 4 deletions(-) diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c index d3b19dd..436fec9 100644 --- a/common/cmd_fdt.c +++ b/common/cmd_fdt.c @@ -417,9 +417,21 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) ft_board_setup(working_fdt, gd->bd); #endif /* Create a chosen node */ - else if (argv[1][0] == 'c') - fdt_chosen(working_fdt, 0, 0, 1); - else { + else if (argv[1][0] == 'c') { + unsigned long initrd_start = 0, initrd_end = 0; + + if ((argc != 2) && (argc != 4)) { + printf ("Usage:\n%s\n", cmdtp->usage); + return 1; + } + + if (argc == 4) { + initrd_start = simple_strtoul(argv[2], NULL, 16); + initrd_end = simple_strtoul(argv[3], NULL, 16); + } + + fdt_chosen(working_fdt, initrd_start, initrd_end, 1); + } else { /* Unrecognized command */ printf ("Usage:\n%s\n", cmdtp->usage); return 1; @@ -798,7 +810,8 @@ U_BOOT_CMD( "fdt rsvmem print - Show current mem reserves\n" "fdt rsvmem add <addr> <size> - Add a mem reserve\n" "fdt rsvmem delete <index> - Delete a mem reserves\n" - "fdt chosen - Add/update the /chosen branch in the tree\n" + "fdt chosen [<start> <end>] - Add/update the /chosen branch in the tree\n" + " <start>/<end> - initrd start/end addr\n" "NOTE: If the path or property you are setting/printing has a '#' character\n" " or spaces, you MUST escape it with a \\ character or quote it with \".\n" ); -- 1.5.5.1 ^ permalink raw reply related [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 05/15] fdt: fdt addr w/o any args reports back the current working address 2008-08-15 13:24 ` [U-Boot] [PATCH 04/15] fdt: added the ability to set initrd start/end via chosen command Kumar Gala @ 2008-08-15 13:24 ` Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 06/15] bootm: refactor entry point code Kumar Gala ` (2 more replies) 2008-08-18 23:04 ` [U-Boot] [PATCH 04/15] fdt: added the ability to set initrd start/end via chosen command Wolfgang Denk 2008-08-20 22:56 ` Wolfgang Denk 2 siblings, 3 replies; 41+ messages in thread From: Kumar Gala @ 2008-08-15 13:24 UTC (permalink / raw) To: u-boot Signed-off-by: Kumar Gala <galak@kernel.crashing.org> --- common/cmd_fdt.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c index 436fec9..c129993 100644 --- a/common/cmd_fdt.c +++ b/common/cmd_fdt.c @@ -67,6 +67,14 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) /* * Set the address [and length] of the fdt. */ + if (argc == 2) { + if (!fdt_valid()) { + return 1; + } + printf("The address of the fdt is %p\n", working_fdt); + return 0; + } + working_fdt = (struct fdt_header *)simple_strtoul(argv[2], NULL, 16); if (!fdt_valid()) { -- 1.5.5.1 ^ permalink raw reply related [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 06/15] bootm: refactor entry point code 2008-08-15 13:24 ` [U-Boot] [PATCH 05/15] fdt: fdt addr w/o any args reports back the current working address Kumar Gala @ 2008-08-15 13:24 ` Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 07/15] bootm: refactor ramdisk locating code Kumar Gala ` (2 more replies) 2008-08-18 23:07 ` [U-Boot] [PATCH 05/15] fdt: fdt addr w/o any args reports back the current working address Wolfgang Denk 2008-08-20 22:56 ` Wolfgang Denk 2 siblings, 3 replies; 41+ messages in thread From: Kumar Gala @ 2008-08-15 13:24 UTC (permalink / raw) To: u-boot Move entry point code out of each arch and into common code. Keep the entry point in the bootm_headers_t images struct. Signed-off-by: Kumar Gala <galak@kernel.crashing.org> --- common/cmd_bootm.c | 31 ++++++++++++++++++++++--------- include/image.h | 2 ++ lib_arm/bootm.c | 19 +------------------ lib_avr32/bootm.c | 19 +------------------ lib_blackfin/bootm.c | 19 +------------------ lib_m68k/bootm.c | 19 +------------------ lib_microblaze/bootm.c | 19 +------------------ lib_mips/bootm.c | 18 +----------------- lib_nios2/bootm.c | 20 +------------------- lib_ppc/bootm.c | 22 +++------------------- lib_sh/bootm.c | 19 +------------------ lib_sparc/bootm.c | 12 ++---------- 12 files changed, 37 insertions(+), 182 deletions(-) diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 0b14b06..3f63b84 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -205,6 +205,23 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return 1; } + /* find kernel entry point */ + if (images.legacy_hdr_valid) { + images.ep = image_get_ep (&images.legacy_hdr_os_copy); +#if defined(CONFIG_FIT) + } else if (images.fit_uname_os) { + ret = fit_image_get_entry (images.fit_hdr_os, + images.fit_noffset_os, &images.ep); + if (ret) { + puts ("Can't get entry point property!\n"); + return 1; + } +#endif + } else { + puts ("Could not find kernel entry point!\n"); + return 1; + } + image_start = (ulong)os_hdr; load_end = 0; type_name = genimg_get_type_name (type); @@ -942,7 +959,7 @@ static void do_bootm_netbsd (cmd_tbl_t *cmdtp, int flag, cmdline = ""; } - loader = (void (*)(bd_t *, image_header_t *, char *, char *))image_get_ep (hdr); + loader = (void (*)(bd_t *, image_header_t *, char *, char *))images->ep; printf ("## Transferring control to NetBSD stage-2 loader (at address %08lx) ...\n", (ulong)loader); @@ -981,7 +998,6 @@ static void do_bootm_rtems (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], bootm_headers_t *images) { - image_header_t *hdr = &images->legacy_hdr_os_copy; void (*entry_point)(bd_t *); #if defined(CONFIG_FIT) @@ -991,7 +1007,7 @@ static void do_bootm_rtems (cmd_tbl_t *cmdtp, int flag, } #endif - entry_point = (void (*)(bd_t *))image_get_ep (hdr); + entry_point = (void (*)(bd_t *))images->ep; printf ("## Transferring control to RTEMS (at address %08lx) ...\n", (ulong)entry_point); @@ -1011,7 +1027,6 @@ static void do_bootm_vxworks (cmd_tbl_t *cmdtp, int flag, bootm_headers_t *images) { char str[80]; - image_header_t *hdr = &images->legacy_hdr_os_copy; #if defined(CONFIG_FIT) if (!images->legacy_hdr_valid) { @@ -1020,7 +1035,7 @@ static void do_bootm_vxworks (cmd_tbl_t *cmdtp, int flag, } #endif - sprintf(str, "%x", image_get_ep (hdr)); /* write entry-point into string */ + sprintf(str, "%lx", images->ep); /* write entry-point into string */ setenv("loadaddr", str); do_bootvx(cmdtp, 0, 0, NULL); } @@ -1031,7 +1046,6 @@ static void do_bootm_qnxelf(cmd_tbl_t *cmdtp, int flag, { char *local_args[2]; char str[16]; - image_header_t *hdr = &images->legacy_hdr_os_copy; #if defined(CONFIG_FIT) if (!images->legacy_hdr_valid) { @@ -1040,7 +1054,7 @@ static void do_bootm_qnxelf(cmd_tbl_t *cmdtp, int flag, } #endif - sprintf(str, "%x", image_get_ep (hdr)); /* write entry-point into string */ + sprintf(str, "%lx", images->ep); /* write entry-point into string */ local_args[0] = argv[0]; local_args[1] = str; /* and provide it via the arguments */ do_bootelf(cmdtp, 0, 2, local_args); @@ -1058,7 +1072,6 @@ static void do_bootm_artos (cmd_tbl_t *cmdtp, int flag, int i, j, nxt, len, envno, envsz; bd_t *kbd; void (*entry)(bd_t *bd, char *cmdline, char **fwenv, ulong top); - image_header_t *hdr = &images->legacy_hdr_os_copy; #if defined(CONFIG_FIT) if (!images->legacy_hdr_valid) { @@ -1133,7 +1146,7 @@ static void do_bootm_artos (cmd_tbl_t *cmdtp, int flag, } *ss++ = NULL; /* terminate */ - entry = (void (*)(bd_t *, char *, char **, ulong))image_get_ep (hdr); + entry = (void (*)(bd_t *, char *, char **, ulong))images->ep; (*entry) (kbd, cmdline, fwenv, top); } #endif diff --git a/include/image.h b/include/image.h index 4b9c582..e16c253 100644 --- a/include/image.h +++ b/include/image.h @@ -219,6 +219,8 @@ typedef struct bootm_headers { #endif #endif + ulong ep; /* entry point of OS */ + int verify; /* getenv("verify")[0] != 'n' */ struct lmb *lmb; /* for memory mgmt */ } bootm_headers_t; diff --git a/lib_arm/bootm.c b/lib_arm/bootm.c index 955a1ae..5660a50 100644 --- a/lib_arm/bootm.c +++ b/lib_arm/bootm.c @@ -62,7 +62,6 @@ void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], bootm_headers_t *images) { ulong initrd_start, initrd_end; - ulong ep = 0; bd_t *bd = gd->bd; char *s; int machid = bd->bi_arch_number; @@ -73,23 +72,7 @@ void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], char *commandline = getenv ("bootargs"); #endif - /* find kernel entry point */ - if (images->legacy_hdr_valid) { - ep = image_get_ep (&images->legacy_hdr_os_copy); -#if defined(CONFIG_FIT) - } else if (images->fit_uname_os) { - ret = fit_image_get_entry (images->fit_hdr_os, - images->fit_noffset_os, &ep); - if (ret) { - puts ("Can't get entry point property!\n"); - goto error; - } -#endif - } else { - puts ("Could not find kernel entry point!\n"); - goto error; - } - theKernel = (void (*)(int, int, uint))ep; + theKernel = (void (*)(int, int, uint))images->ep; s = getenv ("machid"); if (s) { diff --git a/lib_avr32/bootm.c b/lib_avr32/bootm.c index 60e6b36..7beab99 100644 --- a/lib_avr32/bootm.c +++ b/lib_avr32/bootm.c @@ -177,29 +177,12 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], bootm_headers_t *images) { ulong initrd_start, initrd_end; - ulong ep = 0; void (*theKernel)(int magic, void *tagtable); struct tag *params, *params_start; char *commandline = getenv("bootargs"); int ret; - /* find kernel entry point */ - if (images->legacy_hdr_valid) { - ep = image_get_ep (&images->legacy_hdr_os_copy); -#if defined(CONFIG_FIT) - } else if (images->fit_uname_os) { - ret = fit_image_get_entry (images->fit_hdr_os, - images->fit_noffset_os, &ep); - if (ret) { - puts ("Can't get entry point property!\n"); - goto error; - } -#endif - } else { - puts ("Could not find kernel entry point!\n"); - goto error; - } - theKernel = (void *)ep; + theKernel = (void *)images->ep; ret = boot_get_ramdisk (argc, argv, images, IH_ARCH_AVR32, &initrd_start, &initrd_end); diff --git a/lib_blackfin/bootm.c b/lib_blackfin/bootm.c index 54f69a9..f789e24 100644 --- a/lib_blackfin/bootm.c +++ b/lib_blackfin/bootm.c @@ -38,29 +38,12 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], { int (*appl) (char *cmdline); char *cmdline; - ulong ep = 0; #ifdef SHARED_RESOURCES swap_to(FLASH); #endif - /* find kernel entry point */ - if (images->legacy_hdr_valid) { - ep = image_get_ep (&images->legacy_hdr_os_copy); -#if defined(CONFIG_FIT) - } else if (images->fit_uname_os) { - int ret = fit_image_get_entry (images->fit_hdr_os, - images->fit_noffset_os, &ep); - if (ret) { - puts ("Can't get entry point property!\n"); - goto error; - } -#endif - } else { - puts ("Could not find kernel entry point!\n"); - goto error; - } - appl = (int (*)(char *))ep; + appl = (int (*)(char *))images->ep; printf("Starting Kernel at = %x\n", appl); cmdline = make_command_line(); diff --git a/lib_m68k/bootm.c b/lib_m68k/bootm.c index b45203d..fe658fe 100644 --- a/lib_m68k/bootm.c +++ b/lib_m68k/bootm.c @@ -57,7 +57,6 @@ void do_bootm_linux(cmd_tbl_t * cmdtp, int flag, ulong cmd_start, cmd_end; ulong bootmap_base; bd_t *kbd; - ulong ep = 0; void (*kernel) (bd_t *, ulong, ulong, ulong, ulong); struct lmb *lmb = images->lmb; @@ -94,23 +93,7 @@ void do_bootm_linux(cmd_tbl_t * cmdtp, int flag, } set_clocks_in_mhz(kbd); - /* find kernel entry point */ - if (images->legacy_hdr_valid) { - ep = image_get_ep (&images->legacy_hdr_os_copy); -#if defined(CONFIG_FIT) - } else if (images->fit_uname_os) { - ret = fit_image_get_entry (images->fit_hdr_os, - images->fit_noffset_os, &ep); - if (ret) { - puts ("Can't get entry point property!\n"); - goto error; - } -#endif - } else { - puts ("Could not find kernel entry point!\n"); - goto error; - } - kernel = (void (*)(bd_t *, ulong, ulong, ulong, ulong))ep; + kernel = (void (*)(bd_t *, ulong, ulong, ulong, ulong))images->ep; /* find ramdisk */ ret = boot_get_ramdisk (argc, argv, images, IH_ARCH_M68K, diff --git a/lib_microblaze/bootm.c b/lib_microblaze/bootm.c index 68edcdb..baf6d77 100644 --- a/lib_microblaze/bootm.c +++ b/lib_microblaze/bootm.c @@ -40,25 +40,8 @@ void do_bootm_linux (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[], /* First parameter is mapped to $r5 for kernel boot args */ void (*theKernel) (char *); char *commandline = getenv ("bootargs"); - ulong ep = 0; - /* find kernel entry point */ - if (images->legacy_hdr_valid) { - ep = image_get_ep (&images->legacy_hdr_os_copy); -#if defined(CONFIG_FIT) - } else if (images->fit_uname_os) { - int ret = fit_image_get_entry (images->fit_hdr_os, - images->fit_noffset_os, &ep); - if (ret) { - puts ("Can't get entry point property!\n"); - goto error; - } -#endif - } else { - puts ("Could not find kernel entry point!\n"); - goto error; - } - theKernel = (void (*)(char *))ep; + theKernel = (void (*)(char *))images->ep; show_boot_progress (15); diff --git a/lib_mips/bootm.c b/lib_mips/bootm.c index 53e8e19..7df6ce6 100644 --- a/lib_mips/bootm.c +++ b/lib_mips/bootm.c @@ -49,7 +49,6 @@ void do_bootm_linux (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[], bootm_headers_t *images) { ulong initrd_start, initrd_end; - ulong ep = 0; void (*theKernel) (int, char **, char **, int *); char *commandline = getenv ("bootargs"); char env_buf[12]; @@ -57,22 +56,7 @@ void do_bootm_linux (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[], char *cp; /* find kernel entry point */ - if (images->legacy_hdr_valid) { - ep = image_get_ep (&images->legacy_hdr_os_copy); -#if defined(CONFIG_FIT) - } else if (images->fit_uname_os) { - ret = fit_image_get_entry (images->fit_hdr_os, - images->fit_noffset_os, &ep); - if (ret) { - puts ("Can't get entry point property!\n"); - goto error; - } -#endif - } else { - puts ("Could not find kernel entry point!\n"); - goto error; - } - theKernel = (void (*)(int, char **, char **, int *))ep; + theKernel = (void (*)(int, char **, char **, int *))images->ep; ret = boot_get_ramdisk (argc, argv, images, IH_ARCH_MIPS, &initrd_start, &initrd_end); diff --git a/lib_nios2/bootm.c b/lib_nios2/bootm.c index 18cf773..c74b5d6 100644 --- a/lib_nios2/bootm.c +++ b/lib_nios2/bootm.c @@ -30,25 +30,7 @@ extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], bootm_headers_t *images) { - ulong ep = 0; - - /* find kernel entry point */ - if (images->legacy_hdr_valid) { - ep = image_get_ep (&images->legacy_hdr_os_copy); -#if defined(CONFIG_FIT) - } else if (images->fit_uname_os) { - int ret = fit_image_get_entry (images->fit_hdr_os, - images->fit_noffset_os, &ep); - if (ret) { - puts ("Can't get entry point property!\n"); - goto error; - } -#endif - } else { - puts ("Could not find kernel entry point!\n"); - goto error; - } - void (*kernel)(void) = (void (*)(void))ep; + void (*kernel)(void) = (void (*)(void))images->ep; /* For now we assume the Microtronix linux ... which only * needs to be called ;-) diff --git a/lib_ppc/bootm.c b/lib_ppc/bootm.c index e83c860..b08ee0d 100644 --- a/lib_ppc/bootm.c +++ b/lib_ppc/bootm.c @@ -79,7 +79,6 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], ulong cmd_start, cmd_end, bootmap_base; bd_t *kbd; - ulong ep = 0; void (*kernel)(bd_t *, ulong r4, ulong r5, ulong r6, ulong r7, ulong r8, ulong r9); int ret; @@ -90,6 +89,9 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], char *of_flat_tree = NULL; #endif + kernel = (void (*)(bd_t *, ulong, ulong, ulong, + ulong, ulong, ulong))images->ep; + bootmap_base = getenv_bootm_low(); bootm_size = getenv_bootm_size(); @@ -151,24 +153,6 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], set_clocks_in_mhz(kbd); } - /* find kernel entry point */ - if (images->legacy_hdr_valid) { - ep = image_get_ep (&images->legacy_hdr_os_copy); -#if defined(CONFIG_FIT) - } else if (images->fit_uname_os) { - ret = fit_image_get_entry (images->fit_hdr_os, - images->fit_noffset_os, &ep); - if (ret) { - puts ("Can't get entry point property!\n"); - goto error; - } -#endif - } else { - puts ("Could not find kernel entry point!\n"); - goto error; - } - kernel = (void (*)(bd_t *, ulong, ulong, ulong, - ulong, ulong, ulong))ep; /* find ramdisk */ ret = boot_get_ramdisk (argc, argv, images, IH_ARCH_PPC, &rd_data_start, &rd_data_end); diff --git a/lib_sh/bootm.c b/lib_sh/bootm.c index 4ee7ff3..9d2c908 100644 --- a/lib_sh/bootm.c +++ b/lib_sh/bootm.c @@ -62,26 +62,9 @@ static void hexdump (unsigned char *buf, int len) void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], bootm_headers_t *images) { - ulong ep = 0; char *bootargs = getenv("bootargs"); - /* find kernel entry point */ - if (images->legacy_hdr_valid) { - ep = image_get_ep (&images->legacy_hdr_os_copy); -#if defined(CONFIG_FIT) - } else if (images->fit_uname_os) { - int ret = fit_image_get_entry (images->fit_hdr_os, - images->fit_noffset_os, &ep); - if (ret) { - puts ("Can't get entry point property!\n"); - goto error; - } -#endif - } else { - puts ("Could not find kernel entry point!\n"); - goto error; - } - void (*kernel) (void) = (void (*)(void))ep; + void (*kernel) (void) = (void (*)(void))images->ep; /* Setup parameters */ memset(PARAM, 0, 0x1000); /* Clear zero page */ diff --git a/lib_sparc/bootm.c b/lib_sparc/bootm.c index b1a3d98..ac15396 100644 --- a/lib_sparc/bootm.c +++ b/lib_sparc/bootm.c @@ -87,7 +87,7 @@ void do_bootm_linux(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[], bootm_headers_t * images) { char *bootargs; - ulong ep, load; + ulong load; ulong initrd_start, initrd_end; ulong rd_data_start, rd_data_end, rd_len; unsigned int data, len, checksum; @@ -97,17 +97,9 @@ void do_bootm_linux(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[], int ret; if (images->legacy_hdr_valid) { - ep = image_get_ep(images->legacy_hdr_os); load = image_get_load(images->legacy_hdr_os); #if defined(CONFIG_FIT) } else if (images->fit_uname_os) { - int ret = fit_image_get_entry(images->fit_hdr_os, - images->fit_noffset_os, &ep); - if (ret) { - puts("Can't get entry point property!\n"); - goto error; - } - ret = fit_image_get_load(images->fit_hdr_os, images->fit_noffset_os, &load); if (ret) { @@ -124,7 +116,7 @@ void do_bootm_linux(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[], linux_hdr = (void *)load; /* */ - kernel = (void (*)(struct linux_romvec *, void *))ep; + kernel = (void (*)(struct linux_romvec *, void *))images->ep; /* check for a SPARC kernel */ if ((linux_hdr->hdr[0] != 'H') || -- 1.5.5.1 ^ permalink raw reply related [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 07/15] bootm: refactor ramdisk locating code 2008-08-15 13:24 ` [U-Boot] [PATCH 06/15] bootm: refactor entry point code Kumar Gala @ 2008-08-15 13:24 ` Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 08/15] bootm: refactor fdt locating and relocation code Kumar Gala 2008-08-26 21:35 ` [U-Boot] [PATCH 07/15] bootm: refactor ramdisk locating code Wolfgang Denk 2008-08-21 12:02 ` [U-Boot] [PATCH 06/15] bootm: refactor entry point code Kumar Gala 2008-08-26 21:31 ` Wolfgang Denk 2 siblings, 2 replies; 41+ messages in thread From: Kumar Gala @ 2008-08-15 13:24 UTC (permalink / raw) To: u-boot Move determing if we have a ramdisk and where its located into the common code. Keep track of the ramdisk start and end in the bootm_headers_t image struct. Signed-off-by: Kumar Gala <galak@kernel.crashing.org> --- common/cmd_bootm.c | 38 ++++++++++++++++++++++++++++++++++++++ include/image.h | 2 ++ lib_arm/bootm.c | 10 ++-------- lib_avr32/bootm.c | 12 +++--------- lib_i386/bootm.c | 8 +------- lib_m68k/bootm.c | 12 +++--------- lib_mips/bootm.c | 12 +++--------- lib_ppc/bootm.c | 16 +++++----------- lib_sparc/bootm.c | 17 +++-------------- 9 files changed, 60 insertions(+), 67 deletions(-) diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 3f63b84..56236b9 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -116,6 +116,33 @@ void __board_lmb_reserve(struct lmb *lmb) } void board_lmb_reserve(struct lmb *lmb) __attribute__((weak, alias("__board_lmb_reserve"))); +#if defined(__ARM__) + #define IH_INITRD_ARCH IH_ARCH_ARM +#elif defined(__avr32__) + #define IH_INITRD_ARCH IH_ARCH_AVR32 +#elif defined(__bfin__) + #define IH_INITRD_ARCH IH_ARCH_BLACKFIN +#elif defined(__I386__) + #define IH_INITRD_ARCH IH_ARCH_I386 +#elif defined(__M68K__) + #define IH_INITRD_ARCH IH_ARCH_M68K +#elif defined(__microblaze__) + #define IH_INITRD_ARCH IH_ARCH_MICROBLAZE +#elif defined(__mips__) + #define IH_INITRD_ARCH IH_ARCH_MIPS +#elif defined(__nios__) + #define IH_INITRD_ARCH IH_ARCH_NIOS +#elif defined(__nios2__) + #define IH_INITRD_ARCH IH_ARCH_NIOS2 +#elif defined(__PPC__) + #define IH_INITRD_ARCH IH_ARCH_PPC +#elif defined(__sh__) + #define IH_INITRD_ARCH IH_ARCH_SH +#elif defined(__sparc__) + #define IH_INITRD_ARCH IH_ARCH_SPARC +#else +# error Unknown CPU type +#endif /*******************************************************************/ /* bootm - boot application image from image in memory */ @@ -133,6 +160,7 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) ulong load_start, load_end; ulong mem_start; phys_size_t mem_size; + int ret; struct lmb lmb; @@ -222,6 +250,16 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return 1; } + if (os == IH_OS_LINUX) { + /* find ramdisk */ + ret = boot_get_ramdisk (argc, argv, &images, IH_INITRD_ARCH, + &images.rd_start, &images.rd_end); + if (ret) { + puts ("Ramdisk image is corrupt\n"); + return 1; + } + } + image_start = (ulong)os_hdr; load_end = 0; type_name = genimg_get_type_name (type); diff --git a/include/image.h b/include/image.h index e16c253..b8577a0 100644 --- a/include/image.h +++ b/include/image.h @@ -221,6 +221,8 @@ typedef struct bootm_headers { ulong ep; /* entry point of OS */ + ulong rd_start, rd_end;/* ramdisk start/end */ + int verify; /* getenv("verify")[0] != 'n' */ struct lmb *lmb; /* for memory mgmt */ } bootm_headers_t; diff --git a/lib_arm/bootm.c b/lib_arm/bootm.c index 5660a50..f9f702f 100644 --- a/lib_arm/bootm.c +++ b/lib_arm/bootm.c @@ -61,7 +61,6 @@ extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], bootm_headers_t *images) { - ulong initrd_start, initrd_end; bd_t *bd = gd->bd; char *s; int machid = bd->bi_arch_number; @@ -80,11 +79,6 @@ void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], printf ("Using machid 0x%x from environment\n", machid); } - ret = boot_get_ramdisk (argc, argv, images, IH_ARCH_ARM, - &initrd_start, &initrd_end); - if (ret) - goto error; - show_boot_progress (15); debug ("## Transferring control to Linux (at address %08lx) ...\n", @@ -111,8 +105,8 @@ void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], setup_commandline_tag (bd, commandline); #endif #ifdef CONFIG_INITRD_TAG - if (initrd_start && initrd_end) - setup_initrd_tag (bd, initrd_start, initrd_end); + if (images->rd_start && images->rd_end) + setup_initrd_tag (bd, images->rd_start, images->rd_end); #endif #if defined (CONFIG_VFD) || defined (CONFIG_LCD) setup_videolfb_tag ((gd_t *) gd); diff --git a/lib_avr32/bootm.c b/lib_avr32/bootm.c index 7beab99..762701f 100644 --- a/lib_avr32/bootm.c +++ b/lib_avr32/bootm.c @@ -176,7 +176,6 @@ static void setup_end_tag(struct tag *params) void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], bootm_headers_t *images) { - ulong initrd_start, initrd_end; void (*theKernel)(int magic, void *tagtable); struct tag *params, *params_start; char *commandline = getenv("bootargs"); @@ -184,20 +183,15 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], theKernel = (void *)images->ep; - ret = boot_get_ramdisk (argc, argv, images, IH_ARCH_AVR32, - &initrd_start, &initrd_end); - if (ret) - goto error; - show_boot_progress (15); params = params_start = (struct tag *)gd->bd->bi_boot_params; params = setup_start_tag(params); params = setup_memory_tags(params); - if (initrd_start) { + if (images->rd_start) { params = setup_ramdisk_tag(params, - PHYSADDR(initrd_start), - PHYSADDR(initrd_end)); + PHYSADDR(images->rd_start), + PHYSADDR(images->rd_end)); } params = setup_commandline_tag(params, commandline); params = setup_clock_tags(params); diff --git a/lib_i386/bootm.c b/lib_i386/bootm.c index 452eef7..8c0b225 100644 --- a/lib_i386/bootm.c +++ b/lib_i386/bootm.c @@ -36,7 +36,6 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], { void *base_ptr; ulong os_data, os_len; - ulong initrd_start, initrd_end; image_header_t *hdr; int ret; #if defined(CONFIG_FIT) @@ -44,11 +43,6 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], size_t len; #endif - ret = boot_get_ramdisk (argc, argv, images, IH_ARCH_I386, - &initrd_start, &initrd_end); - if (ret) - goto error; - if (images->legacy_hdr_valid) { hdr = images->legacy_hdr_os; if (image_check_type (hdr, IH_TYPE_MULTI)) { @@ -76,7 +70,7 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], } base_ptr = load_zimage ((void*)os_data, os_len, - initrd_start, initrd_end - initrd_start, 0); + images->rd_start, images->rd_end - images->rd_start, 0); if (NULL == base_ptr) { printf ("## Kernel loading failed ...\n"); diff --git a/lib_m68k/bootm.c b/lib_m68k/bootm.c index fe658fe..241721d 100644 --- a/lib_m68k/bootm.c +++ b/lib_m68k/bootm.c @@ -50,7 +50,7 @@ void do_bootm_linux(cmd_tbl_t * cmdtp, int flag, { ulong sp; - ulong rd_data_start, rd_data_end, rd_len; + ulong rd_len; ulong initrd_start, initrd_end; int ret; @@ -95,14 +95,8 @@ void do_bootm_linux(cmd_tbl_t * cmdtp, int flag, kernel = (void (*)(bd_t *, ulong, ulong, ulong, ulong))images->ep; - /* find ramdisk */ - ret = boot_get_ramdisk (argc, argv, images, IH_ARCH_M68K, - &rd_data_start, &rd_data_end); - if (ret) - goto error; - - rd_len = rd_data_end - rd_data_start; - ret = boot_ramdisk_high (lmb, rd_data_start, rd_len, + rd_len = images->rd_end - images->rd_start; + ret = boot_ramdisk_high (lmb, images->rd_start, rd_len, &initrd_start, &initrd_end); if (ret) goto error; diff --git a/lib_mips/bootm.c b/lib_mips/bootm.c index 7df6ce6..9869c33 100644 --- a/lib_mips/bootm.c +++ b/lib_mips/bootm.c @@ -48,7 +48,6 @@ extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); void do_bootm_linux (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[], bootm_headers_t *images) { - ulong initrd_start, initrd_end; void (*theKernel) (int, char **, char **, int *); char *commandline = getenv ("bootargs"); char env_buf[12]; @@ -58,11 +57,6 @@ void do_bootm_linux (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[], /* find kernel entry point */ theKernel = (void (*)(int, char **, char **, int *))images->ep; - ret = boot_get_ramdisk (argc, argv, images, IH_ARCH_MIPS, - &initrd_start, &initrd_end); - if (ret) - goto error; - show_boot_progress (15); #ifdef DEBUG @@ -82,10 +76,10 @@ void do_bootm_linux (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[], linux_env_set ("memsize", env_buf); - sprintf (env_buf, "0x%08X", (uint) UNCACHED_SDRAM (initrd_start)); - linux_env_set ("initrd_start", env_buf); + sprintf (env_buf, "0x%08X", (uint) UNCACHED_SDRAM (images->rd_start)); + linux_env_set ("images->rd_start", env_buf); - sprintf (env_buf, "0x%X", (uint) (initrd_end - initrd_start)); + sprintf (env_buf, "0x%X", (uint) (images->rd_end - images->rd_start)); linux_env_set ("initrd_size", env_buf); sprintf (env_buf, "0x%08X", (uint) (gd->bd->bi_flashstart)); diff --git a/lib_ppc/bootm.c b/lib_ppc/bootm.c index b08ee0d..e6a6e44 100644 --- a/lib_ppc/bootm.c +++ b/lib_ppc/bootm.c @@ -73,7 +73,7 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], ulong sp; ulong initrd_start, initrd_end; - ulong rd_data_start, rd_data_end, rd_len; + ulong rd_len; ulong size; phys_size_t bootm_size; @@ -153,13 +153,7 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], set_clocks_in_mhz(kbd); } - /* find ramdisk */ - ret = boot_get_ramdisk (argc, argv, images, IH_ARCH_PPC, - &rd_data_start, &rd_data_end); - if (ret) - goto error; - - rd_len = rd_data_end - rd_data_start; + rd_len = images->rd_end - images->rd_start; #if defined(CONFIG_OF_LIBFDT) ret = boot_relocate_fdt (lmb, bootmap_base, @@ -171,7 +165,7 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], */ if (of_size) { /* pass in dummy initrd info, we'll fix up later */ - if (fdt_chosen(of_flat_tree, rd_data_start, rd_data_end, 0) < 0) { + if (fdt_chosen(of_flat_tree, images->rd_start, images->rd_end, 0) < 0) { fdt_error ("/chosen node create failed"); goto error; } @@ -221,7 +215,7 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], } #endif /* CONFIG_OF_LIBFDT */ - ret = boot_ramdisk_high (lmb, rd_data_start, rd_len, &initrd_start, &initrd_end); + ret = boot_ramdisk_high (lmb, images->rd_start, rd_len, &initrd_start, &initrd_end); if (ret) goto error; @@ -235,7 +229,7 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], /* Look for the dummy entry and delete it */ for (j = 0; j < total; j++) { fdt_get_mem_rsv(of_flat_tree, j, &addr, &size); - if (addr == rd_data_start) { + if (addr == images->rd_start) { fdt_del_mem_rsv(of_flat_tree, j); break; } diff --git a/lib_sparc/bootm.c b/lib_sparc/bootm.c index ac15396..71d34ba 100644 --- a/lib_sparc/bootm.c +++ b/lib_sparc/bootm.c @@ -89,7 +89,7 @@ void do_bootm_linux(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[], char *bootargs; ulong load; ulong initrd_start, initrd_end; - ulong rd_data_start, rd_data_end, rd_len; + ulong rd_len; unsigned int data, len, checksum; unsigned int initrd_addr, kernend; void (*kernel) (struct linux_romvec *, void *); @@ -139,19 +139,8 @@ void do_bootm_linux(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[], * extracted and is writeable. */ - /* - * Are we going to use an initrd image? - */ - ret = boot_get_ramdisk(argc, argv, images, IH_ARCH_SPARC, - &rd_data_start, &rd_data_end); - if (ret) { - /* RAM disk found but was corrupt */ - puts("RAM Disk corrupt\n"); - goto error; - } - /* Calc length of RAM disk, if zero no ramdisk available */ - rd_len = rd_data_end - rd_data_start; + rd_len = images->rd_end - images->rd_start; if (rd_len) { @@ -161,7 +150,7 @@ void do_bootm_linux(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[], */ lmb_reserve(lmb, CFG_RELOC_MONITOR_BASE, CFG_RAM_END); - ret = boot_ramdisk_high(lmb, rd_data_start, rd_len, + ret = boot_ramdisk_high(lmb, images->rd_start, rd_len, &initrd_start, &initrd_end); if (ret) { puts("### Failed to relocate RAM disk\n"); -- 1.5.5.1 ^ permalink raw reply related [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 08/15] bootm: refactor fdt locating and relocation code 2008-08-15 13:24 ` [U-Boot] [PATCH 07/15] bootm: refactor ramdisk locating code Kumar Gala @ 2008-08-15 13:24 ` Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 09/15] bootm: Set working fdt address as part of the bootm flow Kumar Gala 2008-08-26 21:37 ` [U-Boot] [PATCH 08/15] bootm: refactor fdt locating and relocation code Wolfgang Denk 2008-08-26 21:35 ` [U-Boot] [PATCH 07/15] bootm: refactor ramdisk locating code Wolfgang Denk 1 sibling, 2 replies; 41+ messages in thread From: Kumar Gala @ 2008-08-15 13:24 UTC (permalink / raw) To: u-boot Move the code that handles finding a device tree blob and relocating it (if needed) into common code so all arch's have access to it. Signed-off-by: Kumar Gala <galak@kernel.crashing.org> --- common/cmd_bootm.c | 10 + common/image.c | 502 ++++++++++++++++++++++++++++++++++++++++++++++++++++ include/image.h | 13 ++ lib_ppc/bootm.c | 492 +-------------------------------------------------- 4 files changed, 533 insertions(+), 484 deletions(-) diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 56236b9..9a745f1 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -258,6 +258,16 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) puts ("Ramdisk image is corrupt\n"); return 1; } + +#if defined(CONFIG_OF_LIBFDT) + /* find flattened device tree */ + ret = boot_get_fdt (flag, argc, argv, &images, + &images.ft_addr, &images.ft_len); + if (ret) { + puts ("Could not find a valid device tree\n"); + return 1; + } +#endif } image_start = (ulong)os_hdr; diff --git a/common/image.c b/common/image.c index 6d2ce32..18d667d 100644 --- a/common/image.c +++ b/common/image.c @@ -1070,6 +1070,508 @@ error: return -1; } +#ifdef CONFIG_OF_LIBFDT +static void fdt_error (const char *msg) +{ + puts ("ERROR: "); + puts (msg); + puts (" - must RESET the board to recover.\n"); +} + +static image_header_t *image_get_fdt (ulong fdt_addr) +{ + image_header_t *fdt_hdr = (image_header_t *)fdt_addr; + + image_print_contents (fdt_hdr); + + puts (" Verifying Checksum ... "); + if (!image_check_hcrc (fdt_hdr)) { + fdt_error ("fdt header checksum invalid"); + return NULL; + } + + if (!image_check_dcrc (fdt_hdr)) { + fdt_error ("fdt checksum invalid"); + return NULL; + } + puts ("OK\n"); + + if (!image_check_type (fdt_hdr, IH_TYPE_FLATDT)) { + fdt_error ("uImage is not a fdt"); + return NULL; + } + if (image_get_comp (fdt_hdr) != IH_COMP_NONE) { + fdt_error ("uImage is compressed"); + return NULL; + } + if (fdt_check_header ((char *)image_get_data (fdt_hdr)) != 0) { + fdt_error ("uImage data is not a fdt"); + return NULL; + } + return fdt_hdr; +} + +/** + * fit_check_fdt - verify FIT format FDT subimage + * @fit_hdr: pointer to the FIT header + * fdt_noffset: FDT subimage node offset within FIT image + * @verify: data CRC verification flag + * + * fit_check_fdt() verifies integrity of the FDT subimage and from + * specified FIT image. + * + * returns: + * 1, on success + * 0, on failure + */ +#if defined(CONFIG_FIT) +static int fit_check_fdt (const void *fit, int fdt_noffset, int verify) +{ + fit_image_print (fit, fdt_noffset, " "); + + if (verify) { + puts (" Verifying Hash Integrity ... "); + if (!fit_image_check_hashes (fit, fdt_noffset)) { + fdt_error ("Bad Data Hash"); + return 0; + } + puts ("OK\n"); + } + + if (!fit_image_check_type (fit, fdt_noffset, IH_TYPE_FLATDT)) { + fdt_error ("Not a FDT image"); + return 0; + } + + if (!fit_image_check_comp (fit, fdt_noffset, IH_COMP_NONE)) { + fdt_error ("FDT image is compressed"); + return 0; + } + + return 1; +} +#endif /* CONFIG_FIT */ + +#ifndef CFG_FDT_PAD +#define CFG_FDT_PAD 0x3000 +#endif + +/** + * boot_relocate_fdt - relocate flat device tree + * @lmb: pointer to lmb handle, will be used for memory mgmt + * @bootmap_base: base address of the bootmap region + * @of_flat_tree: pointer to a char* variable, will hold fdt start address + * @of_size: pointer to a ulong variable, will hold fdt length + * + * boot_relocate_fdt() determines if the of_flat_tree address is within + * the bootmap and if not relocates it into that region + * + * of_flat_tree and of_size are set to final (after relocation) values + * + * returns: + * 0 - success + * 1 - failure + */ +int boot_relocate_fdt (struct lmb *lmb, ulong bootmap_base, + char **of_flat_tree, ulong *of_size) +{ + char *fdt_blob = *of_flat_tree; + ulong relocate = 0; + ulong of_len = 0; + + /* nothing to do */ + if (*of_size == 0) + return 0; + + if (fdt_check_header (fdt_blob) != 0) { + fdt_error ("image is not a fdt"); + goto error; + } + +#ifndef CFG_NO_FLASH + /* move the blob if it is in flash (set relocate) */ + if (addr2info ((ulong)fdt_blob) != NULL) + relocate = 1; +#endif + + /* + * The blob needs to be inside the boot mapping. + */ + if (fdt_blob < (char *)bootmap_base) + relocate = 1; + + if ((fdt_blob + *of_size + CFG_FDT_PAD) >= + ((char *)CFG_BOOTMAPSZ + bootmap_base)) + relocate = 1; + + /* move flattend device tree if needed */ + if (relocate) { + int err; + ulong of_start = 0; + + /* position on a 4K boundary before the alloc_current */ + /* Pad the FDT by a specified amount */ + of_len = *of_size + CFG_FDT_PAD; + of_start = (unsigned long)lmb_alloc_base(lmb, of_len, 0x1000, + (CFG_BOOTMAPSZ + bootmap_base)); + + if (of_start == 0) { + puts("device tree - allocation error\n"); + goto error; + } + + debug ("## device tree at 0x%08lX ... 0x%08lX (len=%ld=0x%lX)\n", + (ulong)fdt_blob, (ulong)fdt_blob + *of_size - 1, + of_len, of_len); + + printf (" Loading Device Tree to %08lx, end %08lx ... ", + of_start, of_start + of_len - 1); + + err = fdt_open_into (fdt_blob, (void *)of_start, of_len); + if (err != 0) { + fdt_error ("fdt move failed"); + goto error; + } + puts ("OK\n"); + + *of_flat_tree = (char *)of_start; + *of_size = of_len; + } else { + *of_flat_tree = fdt_blob; + of_len = (CFG_BOOTMAPSZ + bootmap_base) - (ulong)fdt_blob; + lmb_reserve(lmb, (ulong)fdt_blob, of_len); + fdt_set_totalsize(*of_flat_tree, of_len); + + *of_size = of_len; + } + + return 0; + +error: + return 1; +} + +/** + * boot_get_fdt - main fdt handling routine + * @argc: command argument count + * @argv: command argument list + * @images: pointer to the bootm images structure + * @of_flat_tree: pointer to a char* variable, will hold fdt start address + * @of_size: pointer to a ulong variable, will hold fdt length + * + * boot_get_fdt() is responsible for finding a valid flat device tree image. + * Curently supported are the following ramdisk sources: + * - multicomponent kernel/ramdisk image, + * - commandline provided address of decicated ramdisk image. + * + * returns: + * 0, if fdt image was found and valid, or skipped + * of_flat_tree and of_size are set to fdt start address and length if + * fdt image is found and valid + * + * 1, if fdt image is found but corrupted + * of_flat_tree and of_size are set to 0 if no fdt exists + */ +int boot_get_fdt (int flag, int argc, char *argv[], bootm_headers_t *images, + char **of_flat_tree, ulong *of_size) +{ + ulong fdt_addr; + image_header_t *fdt_hdr; + char *fdt_blob = NULL; + ulong image_start, image_end; + ulong load_start, load_end; +#if defined(CONFIG_FIT) + void *fit_hdr; + const char *fit_uname_config = NULL; + const char *fit_uname_fdt = NULL; + ulong default_addr; + int cfg_noffset; + int fdt_noffset; + const void *data; + size_t size; +#endif + + *of_flat_tree = NULL; + *of_size = 0; + + if (argc > 3 || genimg_has_config (images)) { +#if defined(CONFIG_FIT) + if (argc > 3) { + /* + * If the FDT blob comes from the FIT image and the + * FIT image address is omitted in the command line + * argument, try to use ramdisk or os FIT image + * address or default load address. + */ + if (images->fit_uname_rd) + default_addr = (ulong)images->fit_hdr_rd; + else if (images->fit_uname_os) + default_addr = (ulong)images->fit_hdr_os; + else + default_addr = load_addr; + + if (fit_parse_conf (argv[3], default_addr, + &fdt_addr, &fit_uname_config)) { + debug ("* fdt: config '%s' from image at 0x%08lx\n", + fit_uname_config, fdt_addr); + } else if (fit_parse_subimage (argv[3], default_addr, + &fdt_addr, &fit_uname_fdt)) { + debug ("* fdt: subimage '%s' from image at 0x%08lx\n", + fit_uname_fdt, fdt_addr); + } else +#endif + { + fdt_addr = simple_strtoul(argv[3], NULL, 16); + debug ("* fdt: cmdline image address = 0x%08lx\n", + fdt_addr); + } +#if defined(CONFIG_FIT) + } else { + /* use FIT configuration provided in first bootm + * command argument + */ + fdt_addr = (ulong)images->fit_hdr_os; + fit_uname_config = images->fit_uname_cfg; + debug ("* fdt: using config '%s' from image at 0x%08lx\n", + fit_uname_config, fdt_addr); + + /* + * Check whether configuration has FDT blob defined, + * if not quit silently. + */ + fit_hdr = (void *)fdt_addr; + cfg_noffset = fit_conf_get_node (fit_hdr, + fit_uname_config); + if (cfg_noffset < 0) { + debug ("* fdt: no such config\n"); + return 0; + } + + fdt_noffset = fit_conf_get_fdt_node (fit_hdr, + cfg_noffset); + if (fdt_noffset < 0) { + debug ("* fdt: no fdt in config\n"); + return 0; + } + } +#endif + + debug ("## Checking for 'FDT'/'FDT Image' at %08lx\n", + fdt_addr); + + /* copy from dataflash if needed */ + fdt_addr = genimg_get_image (fdt_addr); + + /* + * Check if there is an FDT image at the + * address provided in the second bootm argument + * check image type, for FIT images get a FIT node. + */ + switch (genimg_get_format ((void *)fdt_addr)) { + case IMAGE_FORMAT_LEGACY: + /* verify fdt_addr points to a valid image header */ + printf ("## Flattened Device Tree from Legacy Image@%08lx\n", + fdt_addr); + fdt_hdr = image_get_fdt (fdt_addr); + if (!fdt_hdr) + goto error; + + /* + * move image data to the load address, + * make sure we don't overwrite initial image + */ + image_start = (ulong)fdt_hdr; + image_end = image_get_image_end (fdt_hdr); + + load_start = image_get_load (fdt_hdr); + load_end = load_start + image_get_data_size (fdt_hdr); + + if ((load_start < image_end) && (load_end > image_start)) { + fdt_error ("fdt overwritten"); + goto error; + } + + debug (" Loading FDT from 0x%08lx to 0x%08lx\n", + image_get_data (fdt_hdr), load_start); + + memmove ((void *)load_start, + (void *)image_get_data (fdt_hdr), + image_get_data_size (fdt_hdr)); + + fdt_blob = (char *)load_start; + break; + case IMAGE_FORMAT_FIT: + /* + * This case will catch both: new uImage format + * (libfdt based) and raw FDT blob (also libfdt + * based). + */ +#if defined(CONFIG_FIT) + /* check FDT blob vs FIT blob */ + if (fit_check_format ((const void *)fdt_addr)) { + /* + * FIT image + */ + fit_hdr = (void *)fdt_addr; + printf ("## Flattened Device Tree from FIT Image at %08lx\n", + fdt_addr); + + if (!fit_uname_fdt) { + /* + * no FDT blob image node unit name, + * try to get config node first. If + * config unit node name is NULL + * fit_conf_get_node() will try to + * find default config node + */ + cfg_noffset = fit_conf_get_node (fit_hdr, + fit_uname_config); + + if (cfg_noffset < 0) { + fdt_error ("Could not find configuration node\n"); + goto error; + } + + fit_uname_config = fdt_get_name (fit_hdr, + cfg_noffset, NULL); + printf (" Using '%s' configuration\n", + fit_uname_config); + + fdt_noffset = fit_conf_get_fdt_node (fit_hdr, + cfg_noffset); + fit_uname_fdt = fit_get_name (fit_hdr, + fdt_noffset, NULL); + } else { + /* get FDT component image node offset */ + fdt_noffset = fit_image_get_node (fit_hdr, + fit_uname_fdt); + } + if (fdt_noffset < 0) { + fdt_error ("Could not find subimage node\n"); + goto error; + } + + printf (" Trying '%s' FDT blob subimage\n", + fit_uname_fdt); + + if (!fit_check_fdt (fit_hdr, fdt_noffset, + images->verify)) + goto error; + + /* get ramdisk image data address and length */ + if (fit_image_get_data (fit_hdr, fdt_noffset, + &data, &size)) { + fdt_error ("Could not find FDT subimage data"); + goto error; + } + + /* verift that image data is a proper FDT blob */ + if (fdt_check_header ((char *)data) != 0) { + fdt_error ("Subimage data is not a FTD"); + goto error; + } + + /* + * move image data to the load address, + * make sure we don't overwrite initial image + */ + image_start = (ulong)fit_hdr; + image_end = fit_get_end (fit_hdr); + + if (fit_image_get_load (fit_hdr, fdt_noffset, + &load_start) == 0) { + load_end = load_start + size; + + if ((load_start < image_end) && + (load_end > image_start)) { + fdt_error ("FDT overwritten"); + goto error; + } + + printf (" Loading FDT from 0x%08lx to 0x%08lx\n", + (ulong)data, load_start); + + memmove ((void *)load_start, + (void *)data, size); + + fdt_blob = (char *)load_start; + } else { + fdt_blob = (char *)data; + } + + images->fit_hdr_fdt = fit_hdr; + images->fit_uname_fdt = fit_uname_fdt; + images->fit_noffset_fdt = fdt_noffset; + break; + } else +#endif + { + /* + * FDT blob + */ + fdt_blob = (char *)fdt_addr; + debug ("* fdt: raw FDT blob\n"); + printf ("## Flattened Device Tree blob at %08lx\n", (long)fdt_blob); + } + break; + default: + fdt_error ("Did not find a cmdline Flattened Device Tree"); + goto error; + } + + printf (" Booting using the fdt blob at 0x%x\n", (int)fdt_blob); + + } else if (images->legacy_hdr_valid && + image_check_type (&images->legacy_hdr_os_copy, IH_TYPE_MULTI)) { + + ulong fdt_data, fdt_len; + + /* + * Now check if we have a legacy multi-component image, + * get second entry data start address and len. + */ + printf ("## Flattened Device Tree from multi " + "component Image at %08lX\n", + (ulong)images->legacy_hdr_os); + + image_multi_getimg (images->legacy_hdr_os, 2, &fdt_data, &fdt_len); + if (fdt_len) { + + fdt_blob = (char *)fdt_data; + printf (" Booting using the fdt at 0x%x\n", (int)fdt_blob); + + if (fdt_check_header (fdt_blob) != 0) { + fdt_error ("image is not a fdt"); + goto error; + } + + if (be32_to_cpu (fdt_totalsize (fdt_blob)) != fdt_len) { + fdt_error ("fdt size != image size"); + goto error; + } + } else { + debug ("## No Flattened Device Tree\n"); + return 0; + } + } else { + debug ("## No Flattened Device Tree\n"); + return 0; + } + + *of_flat_tree = fdt_blob; + *of_size = be32_to_cpu (fdt_totalsize (fdt_blob)); + debug (" of_flat_tree at 0x%08lx size 0x%08lx\n", + *of_flat_tree, *of_size); + + return 0; + +error: + *of_flat_tree = 0; + *of_size = 0; + return 1; +} +#endif /* CONFIG_OF_LIBFDT */ + /** * boot_get_cmdline - allocate and initialize kernel cmdline * @lmb: pointer to lmb handle, will be used for memory mgmt diff --git a/include/image.h b/include/image.h index b8577a0..653cbc6 100644 --- a/include/image.h +++ b/include/image.h @@ -223,6 +223,11 @@ typedef struct bootm_headers { ulong rd_start, rd_end;/* ramdisk start/end */ +#ifdef CONFIG_OF_LIBFDT + char *ft_addr; /* flat dev tree address */ +#endif + ulong ft_len; /* length of flat device tree */ + int verify; /* getenv("verify")[0] != 'n' */ struct lmb *lmb; /* for memory mgmt */ } bootm_headers_t; @@ -273,6 +278,14 @@ ulong genimg_get_image (ulong img_addr); int boot_get_ramdisk (int argc, char *argv[], bootm_headers_t *images, uint8_t arch, ulong *rd_start, ulong *rd_end); + +#ifdef CONFIG_OF_LIBFDT +int boot_get_fdt (int flag, int argc, char *argv[], bootm_headers_t *images, + char **of_flat_tree, ulong *of_size); +int boot_relocate_fdt (struct lmb *lmb, ulong bootmap_base, + char **of_flat_tree, ulong *of_size); +#endif + #if defined(CONFIG_PPC) || defined(CONFIG_M68K) int boot_ramdisk_high (struct lmb *lmb, ulong rd_data, ulong rd_len, ulong *initrd_start, ulong *initrd_end); diff --git a/lib_ppc/bootm.c b/lib_ppc/bootm.c index e6a6e44..a3e632f 100644 --- a/lib_ppc/bootm.c +++ b/lib_ppc/bootm.c @@ -39,22 +39,12 @@ #include <libfdt.h> #include <fdt_support.h> -static void fdt_error (const char *msg); -static int boot_get_fdt (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], - bootm_headers_t *images, char **of_flat_tree, ulong *of_size); -static int boot_relocate_fdt (struct lmb *lmb, ulong bootmap_base, - cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], - char **of_flat_tree, ulong *of_size); #endif #ifdef CFG_INIT_RAM_LOCK #include <asm/cache.h> #endif -#ifndef CFG_FDT_PAD -#define CFG_FDT_PAD 0x3000 -#endif - DECLARE_GLOBAL_DATA_PTR; extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); @@ -82,11 +72,11 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], void (*kernel)(bd_t *, ulong r4, ulong r5, ulong r6, ulong r7, ulong r8, ulong r9); int ret; - ulong of_size = 0; + ulong of_size = images->ft_len; struct lmb *lmb = images->lmb; #if defined(CONFIG_OF_LIBFDT) - char *of_flat_tree = NULL; + char *of_flat_tree = images->ft_addr; #endif kernel = (void (*)(bd_t *, ulong, ulong, ulong, @@ -128,14 +118,6 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], sp -= 1024; lmb_reserve(lmb, sp, (CFG_SDRAM_BASE + get_effective_memsize() - sp)); -#if defined(CONFIG_OF_LIBFDT) - /* find flattened device tree */ - ret = boot_get_fdt (cmdtp, flag, argc, argv, images, &of_flat_tree, &of_size); - - if (ret) - goto error; -#endif - if (!of_size) { /* allocate space and init command line */ ret = boot_get_cmdline (lmb, &cmd_start, &cmd_end, bootmap_base); @@ -156,8 +138,9 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], rd_len = images->rd_end - images->rd_start; #if defined(CONFIG_OF_LIBFDT) - ret = boot_relocate_fdt (lmb, bootmap_base, - cmdtp, flag, argc, argv, &of_flat_tree, &of_size); + ret = boot_relocate_fdt(lmb, bootmap_base, &of_flat_tree, &of_size); + if (ret) + goto error; /* * Add the chosen node if it doesn't exist, add the env and bd_t @@ -166,7 +149,9 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], if (of_size) { /* pass in dummy initrd info, we'll fix up later */ if (fdt_chosen(of_flat_tree, images->rd_start, images->rd_end, 0) < 0) { - fdt_error ("/chosen node create failed"); + puts ("ERROR: "); + puts ("/chosen node create failed"); + puts (" - must RESET the board to recover.\n"); goto error; } #ifdef CONFIG_OF_BOARD_SETUP @@ -339,464 +324,3 @@ static void set_clocks_in_mhz (bd_t *kbd) #endif /* CONFIG_MPC5xxx */ } } - -#if defined(CONFIG_OF_LIBFDT) -static void fdt_error (const char *msg) -{ - puts ("ERROR: "); - puts (msg); - puts (" - must RESET the board to recover.\n"); -} - -static image_header_t *image_get_fdt (ulong fdt_addr) -{ - image_header_t *fdt_hdr = (image_header_t *)fdt_addr; - - image_print_contents (fdt_hdr); - - puts (" Verifying Checksum ... "); - if (!image_check_hcrc (fdt_hdr)) { - fdt_error ("fdt header checksum invalid"); - return NULL; - } - - if (!image_check_dcrc (fdt_hdr)) { - fdt_error ("fdt checksum invalid"); - return NULL; - } - puts ("OK\n"); - - if (!image_check_type (fdt_hdr, IH_TYPE_FLATDT)) { - fdt_error ("uImage is not a fdt"); - return NULL; - } - if (image_get_comp (fdt_hdr) != IH_COMP_NONE) { - fdt_error ("uImage is compressed"); - return NULL; - } - if (fdt_check_header ((char *)image_get_data (fdt_hdr)) != 0) { - fdt_error ("uImage data is not a fdt"); - return NULL; - } - return fdt_hdr; -} - -/** - * fit_check_fdt - verify FIT format FDT subimage - * @fit_hdr: pointer to the FIT header - * fdt_noffset: FDT subimage node offset within FIT image - * @verify: data CRC verification flag - * - * fit_check_fdt() verifies integrity of the FDT subimage and from - * specified FIT image. - * - * returns: - * 1, on success - * 0, on failure - */ -#if defined(CONFIG_FIT) -static int fit_check_fdt (const void *fit, int fdt_noffset, int verify) -{ - fit_image_print (fit, fdt_noffset, " "); - - if (verify) { - puts (" Verifying Hash Integrity ... "); - if (!fit_image_check_hashes (fit, fdt_noffset)) { - fdt_error ("Bad Data Hash"); - return 0; - } - puts ("OK\n"); - } - - if (!fit_image_check_type (fit, fdt_noffset, IH_TYPE_FLATDT)) { - fdt_error ("Not a FDT image"); - return 0; - } - - if (!fit_image_check_comp (fit, fdt_noffset, IH_COMP_NONE)) { - fdt_error ("FDT image is compressed"); - return 0; - } - - return 1; -} -#endif /* CONFIG_FIT */ - -static int boot_get_fdt (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], - bootm_headers_t *images, char **of_flat_tree, ulong *of_size) -{ - ulong fdt_addr; - image_header_t *fdt_hdr; - char *fdt_blob = NULL; - ulong image_start, image_end; - ulong load_start, load_end; -#if defined(CONFIG_FIT) - void *fit_hdr; - const char *fit_uname_config = NULL; - const char *fit_uname_fdt = NULL; - ulong default_addr; - int cfg_noffset; - int fdt_noffset; - const void *data; - size_t size; -#endif - - *of_flat_tree = NULL; - *of_size = 0; - - if (argc > 3 || genimg_has_config (images)) { -#if defined(CONFIG_FIT) - if (argc > 3) { - /* - * If the FDT blob comes from the FIT image and the - * FIT image address is omitted in the command line - * argument, try to use ramdisk or os FIT image - * address or default load address. - */ - if (images->fit_uname_rd) - default_addr = (ulong)images->fit_hdr_rd; - else if (images->fit_uname_os) - default_addr = (ulong)images->fit_hdr_os; - else - default_addr = load_addr; - - if (fit_parse_conf (argv[3], default_addr, - &fdt_addr, &fit_uname_config)) { - debug ("* fdt: config '%s' from image at 0x%08lx\n", - fit_uname_config, fdt_addr); - } else if (fit_parse_subimage (argv[3], default_addr, - &fdt_addr, &fit_uname_fdt)) { - debug ("* fdt: subimage '%s' from image at 0x%08lx\n", - fit_uname_fdt, fdt_addr); - } else -#endif - { - fdt_addr = simple_strtoul(argv[3], NULL, 16); - debug ("* fdt: cmdline image address = 0x%08lx\n", - fdt_addr); - } -#if defined(CONFIG_FIT) - } else { - /* use FIT configuration provided in first bootm - * command argument - */ - fdt_addr = (ulong)images->fit_hdr_os; - fit_uname_config = images->fit_uname_cfg; - debug ("* fdt: using config '%s' from image at 0x%08lx\n", - fit_uname_config, fdt_addr); - - /* - * Check whether configuration has FDT blob defined, - * if not quit silently. - */ - fit_hdr = (void *)fdt_addr; - cfg_noffset = fit_conf_get_node (fit_hdr, - fit_uname_config); - if (cfg_noffset < 0) { - debug ("* fdt: no such config\n"); - return 0; - } - - fdt_noffset = fit_conf_get_fdt_node (fit_hdr, - cfg_noffset); - if (fdt_noffset < 0) { - debug ("* fdt: no fdt in config\n"); - return 0; - } - } -#endif - - debug ("## Checking for 'FDT'/'FDT Image' at %08lx\n", - fdt_addr); - - /* copy from dataflash if needed */ - fdt_addr = genimg_get_image (fdt_addr); - - /* - * Check if there is an FDT image at the - * address provided in the second bootm argument - * check image type, for FIT images get a FIT node. - */ - switch (genimg_get_format ((void *)fdt_addr)) { - case IMAGE_FORMAT_LEGACY: - /* verify fdt_addr points to a valid image header */ - printf ("## Flattened Device Tree from Legacy Image@%08lx\n", - fdt_addr); - fdt_hdr = image_get_fdt (fdt_addr); - if (!fdt_hdr) - goto error; - - /* - * move image data to the load address, - * make sure we don't overwrite initial image - */ - image_start = (ulong)fdt_hdr; - image_end = image_get_image_end (fdt_hdr); - - load_start = image_get_load (fdt_hdr); - load_end = load_start + image_get_data_size (fdt_hdr); - - if ((load_start < image_end) && (load_end > image_start)) { - fdt_error ("fdt overwritten"); - goto error; - } - - debug (" Loading FDT from 0x%08lx to 0x%08lx\n", - image_get_data (fdt_hdr), load_start); - - memmove ((void *)load_start, - (void *)image_get_data (fdt_hdr), - image_get_data_size (fdt_hdr)); - - fdt_blob = (char *)load_start; - break; - case IMAGE_FORMAT_FIT: - /* - * This case will catch both: new uImage format - * (libfdt based) and raw FDT blob (also libfdt - * based). - */ -#if defined(CONFIG_FIT) - /* check FDT blob vs FIT blob */ - if (fit_check_format ((const void *)fdt_addr)) { - /* - * FIT image - */ - fit_hdr = (void *)fdt_addr; - printf ("## Flattened Device Tree from FIT Image at %08lx\n", - fdt_addr); - - if (!fit_uname_fdt) { - /* - * no FDT blob image node unit name, - * try to get config node first. If - * config unit node name is NULL - * fit_conf_get_node() will try to - * find default config node - */ - cfg_noffset = fit_conf_get_node (fit_hdr, - fit_uname_config); - - if (cfg_noffset < 0) { - fdt_error ("Could not find configuration node\n"); - goto error; - } - - fit_uname_config = fdt_get_name (fit_hdr, - cfg_noffset, NULL); - printf (" Using '%s' configuration\n", - fit_uname_config); - - fdt_noffset = fit_conf_get_fdt_node (fit_hdr, - cfg_noffset); - fit_uname_fdt = fit_get_name (fit_hdr, - fdt_noffset, NULL); - } else { - /* get FDT component image node offset */ - fdt_noffset = fit_image_get_node (fit_hdr, - fit_uname_fdt); - } - if (fdt_noffset < 0) { - fdt_error ("Could not find subimage node\n"); - goto error; - } - - printf (" Trying '%s' FDT blob subimage\n", - fit_uname_fdt); - - if (!fit_check_fdt (fit_hdr, fdt_noffset, - images->verify)) - goto error; - - /* get ramdisk image data address and length */ - if (fit_image_get_data (fit_hdr, fdt_noffset, - &data, &size)) { - fdt_error ("Could not find FDT subimage data"); - goto error; - } - - /* verift that image data is a proper FDT blob */ - if (fdt_check_header ((char *)data) != 0) { - fdt_error ("Subimage data is not a FTD"); - goto error; - } - - /* - * move image data to the load address, - * make sure we don't overwrite initial image - */ - image_start = (ulong)fit_hdr; - image_end = fit_get_end (fit_hdr); - - if (fit_image_get_load (fit_hdr, fdt_noffset, - &load_start) == 0) { - load_end = load_start + size; - - if ((load_start < image_end) && - (load_end > image_start)) { - fdt_error ("FDT overwritten"); - goto error; - } - - printf (" Loading FDT from 0x%08lx to 0x%08lx\n", - (ulong)data, load_start); - - memmove ((void *)load_start, - (void *)data, size); - - fdt_blob = (char *)load_start; - } else { - fdt_blob = (char *)data; - } - - images->fit_hdr_fdt = fit_hdr; - images->fit_uname_fdt = fit_uname_fdt; - images->fit_noffset_fdt = fdt_noffset; - break; - } else -#endif - { - /* - * FDT blob - */ - fdt_blob = (char *)fdt_addr; - debug ("* fdt: raw FDT blob\n"); - printf ("## Flattened Device Tree blob at %08lx\n", (long)fdt_blob); - } - break; - default: - fdt_error ("Did not find a cmdline Flattened Device Tree"); - goto error; - } - - printf (" Booting using the fdt blob at 0x%x\n", (int)fdt_blob); - - } else if (images->legacy_hdr_valid && - image_check_type (&images->legacy_hdr_os_copy, IH_TYPE_MULTI)) { - - ulong fdt_data, fdt_len; - - /* - * Now check if we have a legacy multi-component image, - * get second entry data start address and len. - */ - printf ("## Flattened Device Tree from multi " - "component Image at %08lX\n", - (ulong)images->legacy_hdr_os); - - image_multi_getimg (images->legacy_hdr_os, 2, &fdt_data, &fdt_len); - if (fdt_len) { - - fdt_blob = (char *)fdt_data; - printf (" Booting using the fdt at 0x%x\n", (int)fdt_blob); - - if (fdt_check_header (fdt_blob) != 0) { - fdt_error ("image is not a fdt"); - goto error; - } - - if (be32_to_cpu (fdt_totalsize (fdt_blob)) != fdt_len) { - fdt_error ("fdt size != image size"); - goto error; - } - } else { - debug ("## No Flattened Device Tree\n"); - return 0; - } - } else { - debug ("## No Flattened Device Tree\n"); - return 0; - } - - *of_flat_tree = fdt_blob; - *of_size = be32_to_cpu (fdt_totalsize (fdt_blob)); - debug (" of_flat_tree at 0x%08lx size 0x%08lx\n", - *of_flat_tree, *of_size); - - return 0; - -error: - do_reset (cmdtp, flag, argc, argv); - return 1; -} - -static int boot_relocate_fdt (struct lmb *lmb, ulong bootmap_base, - cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], - char **of_flat_tree, ulong *of_size) -{ - char *fdt_blob = *of_flat_tree; - ulong relocate = 0; - ulong of_len = 0; - - /* nothing to do */ - if (*of_size == 0) - return 0; - - if (fdt_check_header (fdt_blob) != 0) { - fdt_error ("image is not a fdt"); - goto error; - } - -#ifndef CFG_NO_FLASH - /* move the blob if it is in flash (set relocate) */ - if (addr2info ((ulong)fdt_blob) != NULL) - relocate = 1; -#endif - - /* - * The blob needs to be inside the boot mapping. - */ - if (fdt_blob < (char *)bootmap_base) - relocate = 1; - - if ((fdt_blob + *of_size + CFG_FDT_PAD) >= - ((char *)CFG_BOOTMAPSZ + bootmap_base)) - relocate = 1; - - /* move flattend device tree if needed */ - if (relocate) { - int err; - ulong of_start = 0; - - /* position on a 4K boundary before the alloc_current */ - /* Pad the FDT by a specified amount */ - of_len = *of_size + CFG_FDT_PAD; - of_start = (unsigned long)lmb_alloc_base(lmb, of_len, 0x1000, - (CFG_BOOTMAPSZ + bootmap_base)); - - if (of_start == 0) { - puts("device tree - allocation error\n"); - goto error; - } - - debug ("## device tree at 0x%08lX ... 0x%08lX (len=%ld=0x%lX)\n", - (ulong)fdt_blob, (ulong)fdt_blob + *of_size - 1, - of_len, of_len); - - printf (" Loading Device Tree to %08lx, end %08lx ... ", - of_start, of_start + of_len - 1); - - err = fdt_open_into (fdt_blob, (void *)of_start, of_len); - if (err != 0) { - fdt_error ("fdt move failed"); - goto error; - } - puts ("OK\n"); - - *of_flat_tree = (char *)of_start; - *of_size = of_len; - } else { - *of_flat_tree = fdt_blob; - of_len = (CFG_BOOTMAPSZ + bootmap_base) - (ulong)fdt_blob; - lmb_reserve(lmb, (ulong)fdt_blob, of_len); - fdt_set_totalsize(*of_flat_tree, of_len); - - *of_size = of_len; - } - - return 0; - -error: - return 1; -} -#endif -- 1.5.5.1 ^ permalink raw reply related [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 09/15] bootm: Set working fdt address as part of the bootm flow 2008-08-15 13:24 ` [U-Boot] [PATCH 08/15] bootm: refactor fdt locating and relocation code Kumar Gala @ 2008-08-15 13:24 ` Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 10/15] bootm: move lmb into the bootm_headers_t structure Kumar Gala 2008-08-26 21:37 ` [U-Boot] [PATCH 09/15] bootm: Set working fdt address as part of the bootm flow Wolfgang Denk 2008-08-26 21:37 ` [U-Boot] [PATCH 08/15] bootm: refactor fdt locating and relocation code Wolfgang Denk 1 sibling, 2 replies; 41+ messages in thread From: Kumar Gala @ 2008-08-15 13:24 UTC (permalink / raw) To: u-boot Set the fdt working address so "fdt FOO" commands can be used as part of the bootm flow. Also set an the environment variable "fdtaddr" with the value. Signed-off-by: Kumar Gala <galak@kernel.crashing.org> --- common/cmd_bootm.c | 8 ++++++++ common/cmd_fdt.c | 14 +++++++++++++- common/image.c | 1 + include/fdt_support.h | 2 ++ 4 files changed, 24 insertions(+), 1 deletions(-) diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 9a745f1..022cef8 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -44,6 +44,12 @@ #include <hush.h> #endif +#if defined(CONFIG_OF_LIBFDT) +#include <fdt.h> +#include <libfdt.h> +#include <fdt_support.h> +#endif + DECLARE_GLOBAL_DATA_PTR; extern int gunzip (void *dst, int dstlen, unsigned char *src, unsigned long *lenp); @@ -267,6 +273,8 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) puts ("Could not find a valid device tree\n"); return 1; } + + set_working_fdt_addr(images.ft_addr); #endif } diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c index c129993..89bffa9 100644 --- a/common/cmd_fdt.c +++ b/common/cmd_fdt.c @@ -50,6 +50,16 @@ static int fdt_print(const char *pathp, char *prop, int depth); */ struct fdt_header *working_fdt; +void set_working_fdt_addr(void *addr) +{ + char buf[17]; + + working_fdt = addr; + + sprintf(buf, "%lx", (unsigned long)addr); + setenv("fdtaddr", buf); +} + /* * Flattened Device Tree command, see the help for parameter definitions. */ @@ -64,6 +74,7 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) * Set the address of the fdt ********************************************************************/ if (argv[1][0] == 'a') { + unsigned long addr; /* * Set the address [and length] of the fdt. */ @@ -75,7 +86,8 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) return 0; } - working_fdt = (struct fdt_header *)simple_strtoul(argv[2], NULL, 16); + addr = simple_strtoul(argv[2], NULL, 16); + set_working_fdt_addr((void *)addr); if (!fdt_valid()) { return 1; diff --git a/common/image.c b/common/image.c index 18d667d..55c4cce 100644 --- a/common/image.c +++ b/common/image.c @@ -1245,6 +1245,7 @@ int boot_relocate_fdt (struct lmb *lmb, ulong bootmap_base, *of_size = of_len; } + set_working_fdt_addr(*of_flat_tree); return 0; error: diff --git a/include/fdt_support.h b/include/fdt_support.h index a7c6326..761f85c 100644 --- a/include/fdt_support.h +++ b/include/fdt_support.h @@ -68,5 +68,7 @@ void ft_cpu_setup(void *blob, bd_t *bd); void ft_pci_setup(void *blob, bd_t *bd); #endif +void set_working_fdt_addr(void *addr); + #endif /* ifdef CONFIG_OF_LIBFDT */ #endif /* ifndef __FDT_SUPPORT_H */ -- 1.5.5.1 ^ permalink raw reply related [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 10/15] bootm: move lmb into the bootm_headers_t structure 2008-08-15 13:24 ` [U-Boot] [PATCH 09/15] bootm: Set working fdt address as part of the bootm flow Kumar Gala @ 2008-08-15 13:24 ` Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 11/15] bootm: refactor image detection and os load steps Kumar Gala 2008-08-26 21:38 ` [U-Boot] [PATCH 10/15] bootm: move lmb into the bootm_headers_t structure Wolfgang Denk 2008-08-26 21:37 ` [U-Boot] [PATCH 09/15] bootm: Set working fdt address as part of the bootm flow Wolfgang Denk 1 sibling, 2 replies; 41+ messages in thread From: Kumar Gala @ 2008-08-15 13:24 UTC (permalink / raw) To: u-boot To allow for persistent state between future bootm subcommands we need the lmb to exist in a global state. Moving it into the bootm_headers_t allows us to do that. Signed-off-by: Kumar Gala <galak@kernel.crashing.org> --- common/cmd_bootm.c | 11 ++++------- include/image.h | 4 +++- lib_m68k/bootm.c | 2 +- lib_ppc/bootm.c | 2 +- lib_sparc/bootm.c | 2 +- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 022cef8..dc88e63 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -168,20 +168,17 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) phys_size_t mem_size; int ret; - struct lmb lmb; - memset ((void *)&images, 0, sizeof (images)); images.verify = getenv_yesno ("verify"); - images.lmb = &lmb; - lmb_init(&lmb); + lmb_init(&images.lmb); mem_start = getenv_bootm_low(); mem_size = getenv_bootm_size(); - lmb_add(&lmb, (phys_addr_t)mem_start, mem_size); + lmb_add(&images.lmb, (phys_addr_t)mem_start, mem_size); - board_lmb_reserve(&lmb); + board_lmb_reserve(&images.lmb); /* get kernel image header, start address and length */ os_hdr = boot_get_kernel (cmdtp, flag, argc, argv, @@ -387,7 +384,7 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) show_boot_progress (8); - lmb_reserve(&lmb, load_start, (load_end - load_start)); + lmb_reserve(&images.lmb, load_start, (load_end - load_start)); switch (os) { default: /* handled by (original) Linux case */ diff --git a/include/image.h b/include/image.h index 653cbc6..c1acd7b 100644 --- a/include/image.h +++ b/include/image.h @@ -229,7 +229,9 @@ typedef struct bootm_headers { ulong ft_len; /* length of flat device tree */ int verify; /* getenv("verify")[0] != 'n' */ - struct lmb *lmb; /* for memory mgmt */ +#ifndef USE_HOSTCC + struct lmb lmb; /* for memory mgmt */ +#endif } bootm_headers_t; /* diff --git a/lib_m68k/bootm.c b/lib_m68k/bootm.c index 241721d..1c3b9c9 100644 --- a/lib_m68k/bootm.c +++ b/lib_m68k/bootm.c @@ -58,7 +58,7 @@ void do_bootm_linux(cmd_tbl_t * cmdtp, int flag, ulong bootmap_base; bd_t *kbd; void (*kernel) (bd_t *, ulong, ulong, ulong, ulong); - struct lmb *lmb = images->lmb; + struct lmb *lmb = &images->lmb; bootmap_base = getenv_bootm_low(); diff --git a/lib_ppc/bootm.c b/lib_ppc/bootm.c index a3e632f..b86169a 100644 --- a/lib_ppc/bootm.c +++ b/lib_ppc/bootm.c @@ -73,7 +73,7 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], ulong r7, ulong r8, ulong r9); int ret; ulong of_size = images->ft_len; - struct lmb *lmb = images->lmb; + struct lmb *lmb = &images->lmb; #if defined(CONFIG_OF_LIBFDT) char *of_flat_tree = images->ft_addr; diff --git a/lib_sparc/bootm.c b/lib_sparc/bootm.c index 71d34ba..aac05e4 100644 --- a/lib_sparc/bootm.c +++ b/lib_sparc/bootm.c @@ -93,7 +93,7 @@ void do_bootm_linux(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[], unsigned int data, len, checksum; unsigned int initrd_addr, kernend; void (*kernel) (struct linux_romvec *, void *); - struct lmb *lmb = images->lmb; + struct lmb *lmb = &images->lmb; int ret; if (images->legacy_hdr_valid) { -- 1.5.5.1 ^ permalink raw reply related [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 11/15] bootm: refactor image detection and os load steps 2008-08-15 13:24 ` [U-Boot] [PATCH 10/15] bootm: move lmb into the bootm_headers_t structure Kumar Gala @ 2008-08-15 13:24 ` Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 12/15] fdt: refactor fdt resize code Kumar Gala 2008-08-26 21:42 ` [U-Boot] [PATCH 11/15] bootm: refactor image detection and os load steps Wolfgang Denk 2008-08-26 21:38 ` [U-Boot] [PATCH 10/15] bootm: move lmb into the bootm_headers_t structure Wolfgang Denk 1 sibling, 2 replies; 41+ messages in thread From: Kumar Gala @ 2008-08-15 13:24 UTC (permalink / raw) To: u-boot Created a bootm_start() that handles the parsing and detection of all the images that will be used by the bootm command (OS, ramdisk, fdt). As part of this we now tract all the relevant image offsets in the bootm_headers_t struct. This will allow us to have all the needed state for future sub-commands and lets us reduce a bit of arch specific code on SPARC. Created a bootm_load_os() that deals with decompression and loading the OS image. Signed-off-by: Kumar Gala <galak@kernel.crashing.org> --- common/cmd_bootm.c | 216 ++++++++++++++++++++++++++++++---------------------- include/image.h | 9 ++ lib_sparc/bootm.c | 19 +----- 3 files changed, 136 insertions(+), 108 deletions(-) diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index dc88e63..5f7458b 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -150,22 +150,11 @@ void board_lmb_reserve(struct lmb *lmb) __attribute__((weak, alias("__board_lmb_ # error Unknown CPU type #endif -/*******************************************************************/ -/* bootm - boot application image from image in memory */ -/*******************************************************************/ -int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +static int bootm_start(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { - ulong iflag; - const char *type_name; - uint unc_len = CFG_BOOTM_LEN; - uint8_t comp, type, os; - - void *os_hdr; - ulong os_data, os_len; - ulong image_start, image_end; - ulong load_start, load_end; ulong mem_start; phys_size_t mem_size; + void *os_hdr; int ret; memset ((void *)&images, 0, sizeof (images)); @@ -182,8 +171,8 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) /* get kernel image header, start address and length */ os_hdr = boot_get_kernel (cmdtp, flag, argc, argv, - &images, &os_data, &os_len); - if (os_len == 0) { + &images, &images.os.image_start, &images.os.image_len); + if (images.os.image_len == 0) { puts ("ERROR: can't get kernel image!\n"); return 1; } @@ -191,40 +180,40 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) /* get image parameters */ switch (genimg_get_format (os_hdr)) { case IMAGE_FORMAT_LEGACY: - type = image_get_type (os_hdr); - comp = image_get_comp (os_hdr); - os = image_get_os (os_hdr); + images.os.type = image_get_type (os_hdr); + images.os.comp = image_get_comp (os_hdr); + images.os.os = image_get_os (os_hdr); - image_end = image_get_image_end (os_hdr); - load_start = image_get_load (os_hdr); + images.os.end = image_get_image_end (os_hdr); + images.os.load = image_get_load (os_hdr); break; #if defined(CONFIG_FIT) case IMAGE_FORMAT_FIT: if (fit_image_get_type (images.fit_hdr_os, - images.fit_noffset_os, &type)) { + images.fit_noffset_os, &images.os.type)) { puts ("Can't get image type!\n"); show_boot_progress (-109); return 1; } if (fit_image_get_comp (images.fit_hdr_os, - images.fit_noffset_os, &comp)) { + images.fit_noffset_os, &images.os.comp)) { puts ("Can't get image compression!\n"); show_boot_progress (-110); return 1; } if (fit_image_get_os (images.fit_hdr_os, - images.fit_noffset_os, &os)) { + images.fit_noffset_os, &images.os.os)) { puts ("Can't get image OS!\n"); show_boot_progress (-111); return 1; } - image_end = fit_get_end (images.fit_hdr_os); + images.os.end = fit_get_end (images.fit_hdr_os); if (fit_image_get_load (images.fit_hdr_os, images.fit_noffset_os, - &load_start)) { + &images.os.load)) { puts ("Can't get image load address!\n"); show_boot_progress (-112); return 1; @@ -253,7 +242,7 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return 1; } - if (os == IH_OS_LINUX) { + if (images.os.os == IH_OS_LINUX) { /* find ramdisk */ ret = boot_get_ramdisk (argc, argv, &images, IH_INITRD_ARCH, &images.rd_start, &images.rd_end); @@ -275,64 +264,52 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) #endif } - image_start = (ulong)os_hdr; - load_end = 0; - type_name = genimg_get_type_name (type); + images.os.start = (ulong)os_hdr; + images.valid = 1; - /* - * We have reached the point of no return: we are going to - * overwrite all exception vector code, so we cannot easily - * recover from any failures any more... - */ - iflag = disable_interrupts(); - -#if defined(CONFIG_CMD_USB) - /* - * turn off USB to prevent the host controller from writing to the - * SDRAM while Linux is booting. This could happen (at least for OHCI - * controller), because the HCCA (Host Controller Communication Area) - * lies within the SDRAM and the host controller writes continously to - * this area (as busmaster!). The HccaFrameNumber is for example - * updated every 1 ms within the HCCA structure in SDRAM! For more - * details see the OpenHCI specification. - */ - usb_stop(); -#endif + return 0; +} +#define BOOTM_ERR_RESET -1 +#define BOOTM_ERR_OVERLAP -2 +#define BOOTM_ERR_UNIMPLEMENTED -3 +static int bootm_load_os(image_info_t os, ulong *load_end, int boot_progress) +{ + uint8_t comp = os.comp; + ulong load = os.load; + ulong blob_start = os.start; + ulong blob_end = os.end; + ulong image_start = os.image_start; + ulong image_len = os.image_len; + uint unc_len = CFG_BOOTM_LEN; -#ifdef CONFIG_AMIGAONEG3SE - /* - * We've possible left the caches enabled during - * bios emulation, so turn them off again - */ - icache_disable(); - dcache_disable(); -#endif + const char *type_name = genimg_get_type_name (os.type); switch (comp) { case IH_COMP_NONE: - if (load_start == (ulong)os_hdr) { + if (load == blob_start) { printf (" XIP %s ... ", type_name); } else { printf (" Loading %s ... ", type_name); - memmove_wd ((void *)load_start, - (void *)os_data, os_len, CHUNKSZ); + memmove_wd ((void *)load, + (void *)image_start, image_len, CHUNKSZ); } - load_end = load_start + os_len; + *load_end = load + image_len; puts("OK\n"); break; case IH_COMP_GZIP: printf (" Uncompressing %s ... ", type_name); - if (gunzip ((void *)load_start, unc_len, - (uchar *)os_data, &os_len) != 0) { + if (gunzip ((void *)load, unc_len, + (uchar *)image_start, &image_len) != 0) { puts ("GUNZIP: uncompress or overwrite error " "- must RESET board to recover\n"); - show_boot_progress (-6); - do_reset (cmdtp, flag, argc, argv); + if (boot_progress) + show_boot_progress (-6); + return BOOTM_ERR_RESET; } - load_end = load_start + os_len; + *load_end = load + image_len; break; #ifdef CONFIG_BZIP2 case IH_COMP_BZIP2: @@ -342,51 +319,110 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) * use slower decompression algorithm which requires * at most 2300 KB of memory. */ - int i = BZ2_bzBuffToBuffDecompress ((char*)load_start, - &unc_len, (char *)os_data, os_len, + int i = BZ2_bzBuffToBuffDecompress ((char*)load, + &unc_len, (char *)image_start, image_len, CFG_MALLOC_LEN < (4096 * 1024), 0); if (i != BZ_OK) { printf ("BUNZIP2: uncompress or overwrite error %d " "- must RESET board to recover\n", i); - show_boot_progress (-6); - do_reset (cmdtp, flag, argc, argv); + if (boot_progress) + show_boot_progress (-6); + return BOOTM_ERR_RESET; } - load_end = load_start + unc_len; + *load_end = load + unc_len; break; #endif /* CONFIG_BZIP2 */ default: - if (iflag) - enable_interrupts(); printf ("Unimplemented compression type %d\n", comp); - show_boot_progress (-7); - return 1; + return BOOTM_ERR_UNIMPLEMENTED; } puts ("OK\n"); - debug (" kernel loaded at 0x%08lx, end = 0x%08lx\n", load_start, load_end); - show_boot_progress (7); + debug (" kernel loaded@0x%08lx, end = 0x%08lx\n", load, load_end); + if (boot_progress) + show_boot_progress (7); - if ((load_start < image_end) && (load_end > image_start)) { - debug ("image_start = 0x%lX, image_end = 0x%lx\n", image_start, image_end); - debug ("load_start = 0x%lx, load_end = 0x%lx\n", load_start, load_end); + if ((load < blob_end) && (*load_end > blob_start)) { + debug ("images.os.start = 0x%lX, images.os.end = 0x%lx\n", blob_start, blob_end); + debug ("images.os.load = 0x%lx, load_end = 0x%lx\n", load, load_end); - if (images.legacy_hdr_valid) { - if (image_get_type (&images.legacy_hdr_os_copy) == IH_TYPE_MULTI) - puts ("WARNING: legacy format multi component " - "image overwritten\n"); - } else { - puts ("ERROR: new format image overwritten - " - "must RESET the board to recover\n"); - show_boot_progress (-113); + return BOOTM_ERR_OVERLAP; + } + + return 0; +} + +/*******************************************************************/ +/* bootm - boot application image from image in memory */ +/*******************************************************************/ +int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +{ + + ulong iflag; + ulong load_end = 0; + int ret; + + bootm_start(cmdtp, flag, argc, argv); + + /* + * We have reached the point of no return: we are going to + * overwrite all exception vector code, so we cannot easily + * recover from any failures any more... + */ + iflag = disable_interrupts(); + +#if defined(CONFIG_CMD_USB) + /* + * turn off USB to prevent the host controller from writing to the + * SDRAM while Linux is booting. This could happen (at least for OHCI + * controller), because the HCCA (Host Controller Communication Area) + * lies within the SDRAM and the host controller writes continously to + * this area (as busmaster!). The HccaFrameNumber is for example + * updated every 1 ms within the HCCA structure in SDRAM! For more + * details see the OpenHCI specification. + */ + usb_stop(); +#endif + +#ifdef CONFIG_AMIGAONEG3SE + /* + * We've possible left the caches enabled during + * bios emulation, so turn them off again + */ + icache_disable(); + dcache_disable(); +#endif + + ret = bootm_load_os(images.os, &load_end, 1); + + if (ret < 0) { + if (ret == BOOTM_ERR_RESET) do_reset (cmdtp, flag, argc, argv); + if (ret == BOOTM_ERR_OVERLAP) { + if (images.legacy_hdr_valid) { + if (image_get_type (&images.legacy_hdr_os_copy) == IH_TYPE_MULTI) + puts ("WARNING: legacy format multi component " + "image overwritten\n"); + } else { + puts ("ERROR: new format image overwritten - " + "must RESET the board to recover\n"); + show_boot_progress (-113); + do_reset (cmdtp, flag, argc, argv); + } + } + if (ret == BOOTM_ERR_UNIMPLEMENTED) { + if (iflag) + enable_interrupts(); + show_boot_progress (-7); + return 1; } } - show_boot_progress (8); + lmb_reserve(&images.lmb, images.os.load, (load_end - images.os.load)); - lmb_reserve(&images.lmb, load_start, (load_end - load_start)); + show_boot_progress (8); - switch (os) { + switch (images.os.os) { default: /* handled by (original) Linux case */ case IH_OS_LINUX: #ifdef CONFIG_SILENT_CONSOLE diff --git a/include/image.h b/include/image.h index c1acd7b..9be806e 100644 --- a/include/image.h +++ b/include/image.h @@ -187,6 +187,13 @@ typedef struct image_header { uint8_t ih_name[IH_NMLEN]; /* Image Name */ } image_header_t; +typedef struct image_info { + ulong start, end; /* start/end of blob */ + ulong image_start, image_len; /* start of image within blob, len of image */ + ulong load; /* load addr for the image */ + uint8_t comp, type, os; /* compression, type of image, os type */ +} image_info_t; + /* * Legacy and FIT format headers used by do_bootm() and do_bootm_<os>() * routines. @@ -219,6 +226,7 @@ typedef struct bootm_headers { #endif #endif + image_info_t os; /* os image info */ ulong ep; /* entry point of OS */ ulong rd_start, rd_end;/* ramdisk start/end */ @@ -229,6 +237,7 @@ typedef struct bootm_headers { ulong ft_len; /* length of flat device tree */ int verify; /* getenv("verify")[0] != 'n' */ + int valid; /* set to 1 if we've set values in the header */ #ifndef USE_HOSTCC struct lmb lmb; /* for memory mgmt */ #endif diff --git a/lib_sparc/bootm.c b/lib_sparc/bootm.c index aac05e4..f3abdcf 100644 --- a/lib_sparc/bootm.c +++ b/lib_sparc/bootm.c @@ -87,7 +87,6 @@ void do_bootm_linux(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[], bootm_headers_t * images) { char *bootargs; - ulong load; ulong initrd_start, initrd_end; ulong rd_len; unsigned int data, len, checksum; @@ -96,24 +95,8 @@ void do_bootm_linux(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[], struct lmb *lmb = &images->lmb; int ret; - if (images->legacy_hdr_valid) { - load = image_get_load(images->legacy_hdr_os); -#if defined(CONFIG_FIT) - } else if (images->fit_uname_os) { - ret = fit_image_get_load(images->fit_hdr_os, - images->fit_noffset_os, &load); - if (ret) { - puts("Can't get load address property!\n"); - goto error; - } -#endif - } else { - puts("Could not find kernel entry point!\n"); - goto error; - } - /* Get virtual address of kernel start */ - linux_hdr = (void *)load; + linux_hdr = (void *)images->os.load; /* */ kernel = (void (*)(struct linux_romvec *, void *))images->ep; -- 1.5.5.1 ^ permalink raw reply related [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 12/15] fdt: refactor fdt resize code 2008-08-15 13:24 ` [U-Boot] [PATCH 11/15] bootm: refactor image detection and os load steps Kumar Gala @ 2008-08-15 13:24 ` Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 13/15] fdt: refactor initrd related code Kumar Gala 2008-08-26 21:43 ` [U-Boot] [PATCH 12/15] fdt: refactor fdt resize code Wolfgang Denk 2008-08-26 21:42 ` [U-Boot] [PATCH 11/15] bootm: refactor image detection and os load steps Wolfgang Denk 1 sibling, 2 replies; 41+ messages in thread From: Kumar Gala @ 2008-08-15 13:24 UTC (permalink / raw) To: u-boot Move the fdt resizing code out of ppc specific boot code and into common fdt support code. Signed-off-by: Kumar Gala <galak@kernel.crashing.org> --- common/fdt_support.c | 39 +++++++++++++++++++++++++++++++++++++++ include/fdt_support.h | 1 + lib_ppc/bootm.c | 32 ++++---------------------------- 3 files changed, 44 insertions(+), 28 deletions(-) diff --git a/common/fdt_support.c b/common/fdt_support.c index 93b144e..dadb294 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -529,3 +529,42 @@ void fdt_fixup_crypto_node(void *blob, int sec_rev) fdt_strerror(err)); } #endif /* defined(CONFIG_MPC83XX) || defined(CONFIG_MPC85xx) */ + +/* Resize the fdt to its actual size + a bit of padding */ +int fdt_resize(void *blob) +{ + int i; + uint64_t addr, size; + int total, ret; + uint actualsize; + + if (!blob) + return 0; + + total = fdt_num_mem_rsv(blob); + for (i = 0; i < total; i++) { + fdt_get_mem_rsv(blob, i, &addr, &size); + if (addr == (uint64_t)(u32)blob) { + fdt_del_mem_rsv(blob, i); + break; + } + } + + /* Calculate the actual size of the fdt */ + actualsize = fdt_off_dt_strings(blob) + + fdt_size_dt_strings(blob); + + /* Make it so the fdt ends on a page boundary */ + actualsize = ALIGN(actualsize, 0x1000); + actualsize = actualsize - ((uint)blob & 0xfff); + + /* Change the fdt header to reflect the correct size */ + fdt_set_totalsize(blob, actualsize); + + /* Add the new reservation */ + ret = fdt_add_mem_rsv(blob, (uint)blob, actualsize); + if (ret < 0) + return ret; + + return actualsize; +} diff --git a/include/fdt_support.h b/include/fdt_support.h index 761f85c..b3f0adb 100644 --- a/include/fdt_support.h +++ b/include/fdt_support.h @@ -69,6 +69,7 @@ void ft_pci_setup(void *blob, bd_t *bd); #endif void set_working_fdt_addr(void *addr); +int fdt_resize(void *blob); #endif /* ifdef CONFIG_OF_LIBFDT */ #endif /* ifndef __FDT_SUPPORT_H */ diff --git a/lib_ppc/bootm.c b/lib_ppc/bootm.c index b86169a..300e00a 100644 --- a/lib_ppc/bootm.c +++ b/lib_ppc/bootm.c @@ -162,38 +162,14 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], /* Fixup the fdt memreserve now that we know how big it is */ if (of_flat_tree) { - int j; - uint64_t addr, size; - int total = fdt_num_mem_rsv(of_flat_tree); - uint actualsize; - - for (j = 0; j < total; j++) { - fdt_get_mem_rsv(of_flat_tree, j, &addr, &size); - if (addr == (uint64_t)(u32)of_flat_tree) { - fdt_del_mem_rsv(of_flat_tree, j); - break; - } - } - /* Delete the old LMB reservation */ lmb_free(lmb, (phys_addr_t)(u32)of_flat_tree, (phys_size_t)fdt_totalsize(of_flat_tree)); - /* Calculate the actual size of the fdt */ - actualsize = fdt_off_dt_strings(of_flat_tree) + - fdt_size_dt_strings(of_flat_tree); - - /* Make it so the fdt ends on a page boundary */ - actualsize = ALIGN(actualsize, 0x1000); - actualsize = actualsize - ((uint)of_flat_tree & 0xfff); - - /* Change the fdt header to reflect the correct size */ - fdt_set_totalsize(of_flat_tree, actualsize); - of_size = actualsize; - - /* Add the new reservation */ - ret = fdt_add_mem_rsv(of_flat_tree, (uint)of_flat_tree, - of_size); + ret = fdt_resize(of_flat_tree); + if (ret < 0) + goto error; + of_size = ret; /* Create a new LMB reservation */ lmb_reserve(lmb, (ulong)of_flat_tree, of_size); -- 1.5.5.1 ^ permalink raw reply related [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 13/15] fdt: refactor initrd related code 2008-08-15 13:24 ` [U-Boot] [PATCH 12/15] fdt: refactor fdt resize code Kumar Gala @ 2008-08-15 13:24 ` Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 14/15] fdt: Added resize command Kumar Gala ` (2 more replies) 2008-08-26 21:43 ` [U-Boot] [PATCH 12/15] fdt: refactor fdt resize code Wolfgang Denk 1 sibling, 3 replies; 41+ messages in thread From: Kumar Gala @ 2008-08-15 13:24 UTC (permalink / raw) To: u-boot Created a new fdt_initrd() to deal with setting the initrd properties in the device tree and fixing up the mem reserve. We can use this both in the choosen node handling and lets us remove some duplicated code when we fixup the initrd info in bootm on PPC. Signed-off-by: Kumar Gala <galak@kernel.crashing.org> --- common/fdt_support.c | 109 ++++++++++++++++++++++++++++++------------------- include/fdt_support.h | 1 + lib_ppc/bootm.c | 28 +------------ 3 files changed, 70 insertions(+), 68 deletions(-) diff --git a/common/fdt_support.c b/common/fdt_support.c index dadb294..4fc1915 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -99,44 +99,85 @@ static int fdt_fixup_stdout(void *fdt, int chosenoff) } #endif -int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force) +int fdt_initrd(void *fdt, ulong initrd_start, ulong initrd_end, int force) { int nodeoffset; - int err; - u32 tmp; /* used to set 32 bit integer properties */ - char *str; /* used to set string properties */ + int err, j, total; + u32 tmp; const char *path; + uint64_t addr, size; - err = fdt_check_header(fdt); - if (err < 0) { - printf("fdt_chosen: %s\n", fdt_strerror(err)); - return err; + /* Find the "chosen" node. */ + nodeoffset = fdt_path_offset (fdt, "/chosen"); + + /* If there is no "chosen" node in the blob return */ + if (nodeoffset < 0) { + printf("fdt_initrd: %s\n", fdt_strerror(nodeoffset)); + return nodeoffset; } - if (initrd_start && initrd_end) { - uint64_t addr, size; - int total = fdt_num_mem_rsv(fdt); - int j; + /* just return if initrd_start/end aren't valid */ + if ((initrd_start == 0) || (initrd_end == 0)) + return 0; - /* - * Look for an existing entry and update it. If we don't find - * the entry, we will j be the next available slot. - */ - for (j = 0; j < total; j++) { - err = fdt_get_mem_rsv(fdt, j, &addr, &size); - if (addr == initrd_start) { - fdt_del_mem_rsv(fdt, j); - break; - } + total = fdt_num_mem_rsv(fdt); + + /* + * Look for an existing entry and update it. If we don't find + * the entry, we will j be the next available slot. + */ + for (j = 0; j < total; j++) { + err = fdt_get_mem_rsv(fdt, j, &addr, &size); + if (addr == initrd_start) { + fdt_del_mem_rsv(fdt, j); + break; } + } - err = fdt_add_mem_rsv(fdt, initrd_start, initrd_end - initrd_start + 1); + err = fdt_add_mem_rsv(fdt, initrd_start, initrd_end - initrd_start + 1); + if (err < 0) { + printf("fdt_initrd: %s\n", fdt_strerror(err)); + return err; + } + + path = fdt_getprop(fdt, nodeoffset, "linux,initrd-start", NULL); + if ((path == NULL) || force) { + tmp = __cpu_to_be32(initrd_start); + err = fdt_setprop(fdt, nodeoffset, + "linux,initrd-start", &tmp, sizeof(tmp)); + if (err < 0) { + printf("WARNING: " + "could not set linux,initrd-start %s.\n", + fdt_strerror(err)); + return err; + } + tmp = __cpu_to_be32(initrd_end); + err = fdt_setprop(fdt, nodeoffset, + "linux,initrd-end", &tmp, sizeof(tmp)); if (err < 0) { - printf("fdt_chosen: %s\n", fdt_strerror(err)); + printf("WARNING: could not set linux,initrd-end %s.\n", + fdt_strerror(err)); + return err; } } + return 0; +} + +int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force) +{ + int nodeoffset; + int err; + char *str; /* used to set string properties */ + const char *path; + + err = fdt_check_header(fdt); + if (err < 0) { + printf("fdt_chosen: %s\n", fdt_strerror(err)); + return err; + } + /* * Find the "chosen" node. */ @@ -173,24 +214,8 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force) fdt_strerror(err)); } } - if (initrd_start && initrd_end) { - path = fdt_getprop(fdt, nodeoffset, "linux,initrd-start", NULL); - if ((path == NULL) || force) { - tmp = __cpu_to_be32(initrd_start); - err = fdt_setprop(fdt, nodeoffset, - "linux,initrd-start", &tmp, sizeof(tmp)); - if (err < 0) - printf("WARNING: " - "could not set linux,initrd-start %s.\n", - fdt_strerror(err)); - tmp = __cpu_to_be32(initrd_end); - err = fdt_setprop(fdt, nodeoffset, - "linux,initrd-end", &tmp, sizeof(tmp)); - if (err < 0) - printf("WARNING: could not set linux,initrd-end %s.\n", - fdt_strerror(err)); - } - } + + fdt_initrd(fdt, initrd_start, initrd_end, force); #ifdef CONFIG_OF_STDOUT_VIA_ALIAS path = fdt_getprop(fdt, nodeoffset, "linux,stdout-path", NULL); diff --git a/include/fdt_support.h b/include/fdt_support.h index b3f0adb..07cb7f6 100644 --- a/include/fdt_support.h +++ b/include/fdt_support.h @@ -29,6 +29,7 @@ #include <fdt.h> int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force); +int fdt_initrd(void *fdt, ulong initrd_start, ulong initrd_end, int force); void do_fixup_by_path(void *fdt, const char *path, const char *prop, const void *val, int len, int create); void do_fixup_by_path_u32(void *fdt, const char *path, const char *prop, diff --git a/lib_ppc/bootm.c b/lib_ppc/bootm.c index 300e00a..9892afa 100644 --- a/lib_ppc/bootm.c +++ b/lib_ppc/bootm.c @@ -182,32 +182,8 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], #if defined(CONFIG_OF_LIBFDT) /* fixup the initrd now that we know where it should be */ - if ((of_flat_tree) && (initrd_start && initrd_end)) { - uint64_t addr, size; - int total = fdt_num_mem_rsv(of_flat_tree); - int j; - - /* Look for the dummy entry and delete it */ - for (j = 0; j < total; j++) { - fdt_get_mem_rsv(of_flat_tree, j, &addr, &size); - if (addr == images->rd_start) { - fdt_del_mem_rsv(of_flat_tree, j); - break; - } - } - - ret = fdt_add_mem_rsv(of_flat_tree, initrd_start, - initrd_end - initrd_start + 1); - if (ret < 0) { - printf("fdt_chosen: %s\n", fdt_strerror(ret)); - goto error; - } - - do_fixup_by_path_u32(of_flat_tree, "/chosen", - "linux,initrd-start", initrd_start, 0); - do_fixup_by_path_u32(of_flat_tree, "/chosen", - "linux,initrd-end", initrd_end, 0); - } + if ((of_flat_tree) && (initrd_start && initrd_end)) + fdt_initrd(of_flat_tree, initrd_start, initrd_end, 1); #endif debug ("## Transferring control to Linux (at address %08lx) ...\n", (ulong)kernel); -- 1.5.5.1 ^ permalink raw reply related [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 14/15] fdt: Added resize command 2008-08-15 13:24 ` [U-Boot] [PATCH 13/15] fdt: refactor initrd related code Kumar Gala @ 2008-08-15 13:24 ` Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 15/15] bootm: refactor do_reset and os boot function args Kumar Gala 2008-08-26 21:46 ` [U-Boot] [PATCH 14/15] fdt: Added resize command Wolfgang Denk 2008-08-26 21:45 ` [U-Boot] [PATCH 13/15] fdt: refactor initrd related code Wolfgang Denk 2008-08-26 21:45 ` Wolfgang Denk 2 siblings, 2 replies; 41+ messages in thread From: Kumar Gala @ 2008-08-15 13:24 UTC (permalink / raw) To: u-boot Resize the fdt to size + padding to 4k boundary Signed-off-by: Kumar Gala <galak@kernel.crashing.org> --- common/cmd_fdt.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c index 89bffa9..15ae6f9 100644 --- a/common/cmd_fdt.c +++ b/common/cmd_fdt.c @@ -451,7 +451,12 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) } fdt_chosen(working_fdt, initrd_start, initrd_end, 1); - } else { + } + /* resize the fdt */ + else if (strncmp(argv[1], "re", 2) == 0) { + fdt_resize(working_fdt); + } + else { /* Unrecognized command */ printf ("Usage:\n%s\n", cmdtp->usage); return 1; @@ -819,6 +824,7 @@ U_BOOT_CMD( "fdt boardsetup - Do board-specific set up\n" #endif "fdt move <fdt> <newaddr> <length> - Copy the fdt to <addr> and make it active\n" + "fdt resize - Resize fdt to size + padding to 4k addr\n" "fdt print <path> [<prop>] - Recursive print starting at <path>\n" "fdt list <path> [<prop>] - Print one level starting at <path>\n" "fdt set <path> <prop> [<val>] - Set <property> [to <val>]\n" -- 1.5.5.1 ^ permalink raw reply related [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 15/15] bootm: refactor do_reset and os boot function args 2008-08-15 13:24 ` [U-Boot] [PATCH 14/15] fdt: Added resize command Kumar Gala @ 2008-08-15 13:24 ` Kumar Gala 2008-08-26 21:48 ` Wolfgang Denk 2008-08-26 21:46 ` [U-Boot] [PATCH 14/15] fdt: Added resize command Wolfgang Denk 1 sibling, 1 reply; 41+ messages in thread From: Kumar Gala @ 2008-08-15 13:24 UTC (permalink / raw) To: u-boot There is no need for each OS specific function to call do_reset() we can just do it once in bootm. This means its feasible on an error for the os boot function to return. Also, remove passing in cmd_tbl_t as its not needed by the OS boot functions. flag isn't currently used but might be in the future so we left it alone. Signed-off-by: Kumar Gala <galak@kernel.crashing.org> --- common/cmd_bootm.c | 67 +++++++++++++++++++++++++----------------------- lib_arm/bootm.c | 10 +----- lib_avr32/bootm.c | 10 +----- lib_blackfin/bootm.c | 11 ++----- lib_i386/bootm.c | 9 +----- lib_m68k/bootm.c | 10 +----- lib_microblaze/bootm.c | 10 +----- lib_mips/bootm.c | 12 +------- lib_nios/bootm.c | 4 +- lib_nios2/bootm.c | 9 +----- lib_ppc/bootm.c | 11 +++----- lib_sh/bootm.c | 9 +----- lib_sparc/bootm.c | 7 +--- 13 files changed, 62 insertions(+), 117 deletions(-) diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 5f7458b..0db7b75 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -92,8 +92,7 @@ extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); * - loaded (first part of) image to header load address, * - disabled interrupts. */ -typedef void boot_os_fn (cmd_tbl_t *cmdtp, int flag, - int argc, char *argv[], +typedef int boot_os_fn (int flag, int argc, char *argv[], bootm_headers_t *images); /* pointers to os/initrd/fdt */ extern boot_os_fn do_bootm_linux; @@ -428,36 +427,36 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) #ifdef CONFIG_SILENT_CONSOLE fixup_silent_linux(); #endif - do_bootm_linux (cmdtp, flag, argc, argv, &images); + do_bootm_linux (0, argc, argv, &images); break; case IH_OS_NETBSD: - do_bootm_netbsd (cmdtp, flag, argc, argv, &images); + do_bootm_netbsd (0, argc, argv, &images); break; #ifdef CONFIG_LYNXKDI case IH_OS_LYNXOS: - do_bootm_lynxkdi (cmdtp, flag, argc, argv, &images); + do_bootm_lynxkdi (0, argc, argv, &images); break; #endif case IH_OS_RTEMS: - do_bootm_rtems (cmdtp, flag, argc, argv, &images); + do_bootm_rtems (0, argc, argv, &images); break; #if defined(CONFIG_CMD_ELF) case IH_OS_VXWORKS: - do_bootm_vxworks (cmdtp, flag, argc, argv, &images); + do_bootm_vxworks (0, argc, argv, &images); break; case IH_OS_QNX: - do_bootm_qnxelf (cmdtp, flag, argc, argv, &images); + do_bootm_qnxelf (0, argc, argv, &images); break; #endif #ifdef CONFIG_ARTOS case IH_OS_ARTOS: - do_bootm_artos (cmdtp, flag, argc, argv, &images); + do_bootm_artos (0, argc, argv, &images); break; #endif } @@ -465,10 +464,8 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) show_boot_progress (-9); #ifdef DEBUG puts ("\n## Control returned to monitor - resetting...\n"); - do_reset (cmdtp, flag, argc, argv); #endif - if (iflag) - enable_interrupts(); + do_reset (cmdtp, flag, argc, argv); return 1; } @@ -983,8 +980,7 @@ static void fixup_silent_linux () /* OS booting routines */ /*******************************************************************/ -static void do_bootm_netbsd (cmd_tbl_t *cmdtp, int flag, - int argc, char *argv[], +static int do_bootm_netbsd (int flag, int argc, char *argv[], bootm_headers_t *images) { void (*loader)(bd_t *, image_header_t *, char *, char *); @@ -996,7 +992,7 @@ static void do_bootm_netbsd (cmd_tbl_t *cmdtp, int flag, #if defined(CONFIG_FIT) if (!images->legacy_hdr_valid) { fit_unsupported_reset ("NetBSD"); - do_reset (cmdtp, flag, argc, argv); + return 1; } #endif hdr = images->legacy_hdr_os; @@ -1063,11 +1059,12 @@ static void do_bootm_netbsd (cmd_tbl_t *cmdtp, int flag, * r6: boot args string */ (*loader) (gd->bd, os_hdr, consdev, cmdline); + + return 1; } #ifdef CONFIG_LYNXKDI -static void do_bootm_lynxkdi (cmd_tbl_t *cmdtp, int flag, - int argc, char *argv[], +static int do_bootm_lynxkdi (int flag, int argc, char *argv[], bootm_headers_t *images) { image_header_t *hdr = &images->legacy_hdr_os_copy; @@ -1075,16 +1072,17 @@ static void do_bootm_lynxkdi (cmd_tbl_t *cmdtp, int flag, #if defined(CONFIG_FIT) if (!images->legacy_hdr_valid) { fit_unsupported_reset ("Lynx"); - do_reset (cmdtp, flag, argc, argv); + return 1; } #endif lynxkdi_boot ((image_header_t *)hdr); + + return 1; } #endif /* CONFIG_LYNXKDI */ -static void do_bootm_rtems (cmd_tbl_t *cmdtp, int flag, - int argc, char *argv[], +static int do_bootm_rtems (int flag, int argc, char *argv[], bootm_headers_t *images) { void (*entry_point)(bd_t *); @@ -1092,7 +1090,7 @@ static void do_bootm_rtems (cmd_tbl_t *cmdtp, int flag, #if defined(CONFIG_FIT) if (!images->legacy_hdr_valid) { fit_unsupported_reset ("RTEMS"); - do_reset (cmdtp, flag, argc, argv); + return 1; } #endif @@ -1108,11 +1106,12 @@ static void do_bootm_rtems (cmd_tbl_t *cmdtp, int flag, * r3: ptr to board info data */ (*entry_point)(gd->bd); + + return 1; } #if defined(CONFIG_CMD_ELF) -static void do_bootm_vxworks (cmd_tbl_t *cmdtp, int flag, - int argc, char *argv[], +static int do_bootm_vxworks (int flag, int argc, char *argv[], bootm_headers_t *images) { char str[80]; @@ -1120,17 +1119,18 @@ static void do_bootm_vxworks (cmd_tbl_t *cmdtp, int flag, #if defined(CONFIG_FIT) if (!images->legacy_hdr_valid) { fit_unsupported_reset ("VxWorks"); - do_reset (cmdtp, flag, argc, argv); + return 1; } #endif sprintf(str, "%lx", images->ep); /* write entry-point into string */ setenv("loadaddr", str); - do_bootvx(cmdtp, 0, 0, NULL); + do_bootvx(NULL, 0, 0, NULL); + + return 1; } -static void do_bootm_qnxelf(cmd_tbl_t *cmdtp, int flag, - int argc, char *argv[], +static int do_bootm_qnxelf(int flag, int argc, char *argv[], bootm_headers_t *images) { char *local_args[2]; @@ -1139,20 +1139,21 @@ static void do_bootm_qnxelf(cmd_tbl_t *cmdtp, int flag, #if defined(CONFIG_FIT) if (!images->legacy_hdr_valid) { fit_unsupported_reset ("QNX"); - do_reset (cmdtp, flag, argc, argv); + return 1; } #endif sprintf(str, "%lx", images->ep); /* write entry-point into string */ local_args[0] = argv[0]; local_args[1] = str; /* and provide it via the arguments */ - do_bootelf(cmdtp, 0, 2, local_args); + do_bootelf(NULL, 0, 2, local_args); + + return 1; } #endif #if defined(CONFIG_ARTOS) && defined(CONFIG_PPC) -static void do_bootm_artos (cmd_tbl_t *cmdtp, int flag, - int argc, char *argv[], +static int do_bootm_artos (int flag, int argc, char *argv[], bootm_headers_t *images) { ulong top; @@ -1165,7 +1166,7 @@ static void do_bootm_artos (cmd_tbl_t *cmdtp, int flag, #if defined(CONFIG_FIT) if (!images->legacy_hdr_valid) { fit_unsupported_reset ("ARTOS"); - do_reset (cmdtp, flag, argc, argv); + return 1; } #endif @@ -1237,5 +1238,7 @@ static void do_bootm_artos (cmd_tbl_t *cmdtp, int flag, entry = (void (*)(bd_t *, char *, char **, ulong))images->ep; (*entry) (kbd, cmdline, fwenv, top); + + return 1; } #endif diff --git a/lib_arm/bootm.c b/lib_arm/bootm.c index f9f702f..6c2f37e 100644 --- a/lib_arm/bootm.c +++ b/lib_arm/bootm.c @@ -56,10 +56,7 @@ static void setup_videolfb_tag (gd_t *gd); static struct tag *params; #endif /* CONFIG_SETUP_MEMORY_TAGS || CONFIG_CMDLINE_TAG || CONFIG_INITRD_TAG */ -extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); - -void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], - bootm_headers_t *images) +int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images) { bd_t *bd = gd->bd; char *s; @@ -128,11 +125,8 @@ void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], theKernel (0, machid, bd->bi_boot_params); /* does not return */ - return; - error: - do_reset (cmdtp, flag, argc, argv); - return; + return 1; } diff --git a/lib_avr32/bootm.c b/lib_avr32/bootm.c index 762701f..8a6109d 100644 --- a/lib_avr32/bootm.c +++ b/lib_avr32/bootm.c @@ -34,8 +34,6 @@ DECLARE_GLOBAL_DATA_PTR; /* CPU-specific hook to allow flushing of caches, etc. */ extern void prepare_to_boot(void); -extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); - static struct tag *setup_start_tag(struct tag *params) { params->hdr.tag = ATAG_CORE; @@ -173,8 +171,7 @@ static void setup_end_tag(struct tag *params) params->hdr.size = 0; } -void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], - bootm_headers_t *images) +int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images) { void (*theKernel)(int magic, void *tagtable); struct tag *params, *params_start; @@ -205,9 +202,6 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], theKernel(ATAG_MAGIC, params_start); /* does not return */ - return; - error: - do_reset (cmdtp, flag, argc, argv); - return; + return 1; } diff --git a/lib_blackfin/bootm.c b/lib_blackfin/bootm.c index f789e24..d0afb21 100644 --- a/lib_blackfin/bootm.c +++ b/lib_blackfin/bootm.c @@ -14,8 +14,6 @@ #include <image.h> #include <asm/blackfin.h> -extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); - #ifdef SHARED_RESOURCES extern void swap_to(int device_id); #endif @@ -33,8 +31,7 @@ static char *make_command_line(void) return dest; } -void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], - bootm_headers_t *images) +int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images) { int (*appl) (char *cmdline); char *cmdline; @@ -51,8 +48,6 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], dcache_disable(); (*appl) (cmdline); /* does not return */ - return; - - error: - do_reset (cmdtp, flag, argc, argv); +error: + return 1; } diff --git a/lib_i386/bootm.c b/lib_i386/bootm.c index 8c0b225..522d7ad 100644 --- a/lib_i386/bootm.c +++ b/lib_i386/bootm.c @@ -29,10 +29,7 @@ #include <asm/zimage.h> /*cmd_boot.c*/ -extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); - -void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], - bootm_headers_t *images) +int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images) { void *base_ptr; ulong os_data, os_len; @@ -88,9 +85,7 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], boot_zimage(base_ptr); /* does not return */ - return; error: - do_reset (cmdtp, flag, argc, argv); - return; + return 1; } diff --git a/lib_m68k/bootm.c b/lib_m68k/bootm.c index 1c3b9c9..6504cc9 100644 --- a/lib_m68k/bootm.c +++ b/lib_m68k/bootm.c @@ -42,11 +42,8 @@ DECLARE_GLOBAL_DATA_PTR; static ulong get_sp (void); static void set_clocks_in_mhz (bd_t *kbd); -extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); -void do_bootm_linux(cmd_tbl_t * cmdtp, int flag, - int argc, char *argv[], - bootm_headers_t *images) +int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images) { ulong sp; @@ -116,11 +113,8 @@ void do_bootm_linux(cmd_tbl_t * cmdtp, int flag, */ (*kernel) (kbd, initrd_start, initrd_end, cmd_start, cmd_end); /* does not return */ - return ; - error: - do_reset (cmdtp, flag, argc, argv); - return ; + return 1; } static ulong get_sp (void) diff --git a/lib_microblaze/bootm.c b/lib_microblaze/bootm.c index baf6d77..5986a31 100644 --- a/lib_microblaze/bootm.c +++ b/lib_microblaze/bootm.c @@ -32,10 +32,7 @@ DECLARE_GLOBAL_DATA_PTR; -extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); - -void do_bootm_linux (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[], - bootm_headers_t *images) +int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images) { /* First parameter is mapped to $r5 for kernel boot args */ void (*theKernel) (char *); @@ -52,9 +49,6 @@ void do_bootm_linux (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[], theKernel (commandline); /* does not return */ - return; - error: - do_reset (cmdtp, flag, argc, argv); - return; + return 1; } diff --git a/lib_mips/bootm.c b/lib_mips/bootm.c index 9869c33..c1bf21e 100644 --- a/lib_mips/bootm.c +++ b/lib_mips/bootm.c @@ -43,15 +43,11 @@ static int linux_env_idx; static void linux_params_init (ulong start, char * commandline); static void linux_env_set (char * env_name, char * env_val); -extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); - -void do_bootm_linux (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[], - bootm_headers_t *images) +int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images) { void (*theKernel) (int, char **, char **, int *); char *commandline = getenv ("bootargs"); char env_buf[12]; - int ret; char *cp; /* find kernel entry point */ @@ -103,11 +99,7 @@ void do_bootm_linux (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[], theKernel (linux_argc, linux_argv, linux_env, 0); /* does not return */ - return; - -error: - do_reset (cmdtp, flag, argc, argv); - return; + return 1; } static void linux_params_init (ulong start, char *line) diff --git a/lib_nios/bootm.c b/lib_nios/bootm.c index fb2e9b5..b0d5b82 100644 --- a/lib_nios/bootm.c +++ b/lib_nios/bootm.c @@ -28,7 +28,7 @@ * we can get this working. ;-) * */ -void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], - bootm_headers_t *images) +int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images) { + return 1; } diff --git a/lib_nios2/bootm.c b/lib_nios2/bootm.c index c74b5d6..c0be4fd 100644 --- a/lib_nios2/bootm.c +++ b/lib_nios2/bootm.c @@ -25,10 +25,7 @@ #include <command.h> #include <asm/byteorder.h> -extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); - -void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], - bootm_headers_t *images) +int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images) { void (*kernel)(void) = (void (*)(void))images->ep; @@ -37,9 +34,7 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], */ kernel (); /* does not return */ - return; error: - do_reset (cmdtp, flag, argc, argv); - return; + return 1; } diff --git a/lib_ppc/bootm.c b/lib_ppc/bootm.c index 9892afa..348421f 100644 --- a/lib_ppc/bootm.c +++ b/lib_ppc/bootm.c @@ -47,7 +47,6 @@ DECLARE_GLOBAL_DATA_PTR; -extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); extern ulong get_effective_memsize(void); static ulong get_sp (void); static void set_clocks_in_mhz (bd_t *kbd); @@ -56,9 +55,8 @@ static void set_clocks_in_mhz (bd_t *kbd); #define CFG_LINUX_LOWMEM_MAX_SIZE (768*1024*1024) #endif -void __attribute__((noinline)) -do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], - bootm_headers_t *images) +__attribute__((noinline)) +int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images) { ulong sp; @@ -234,11 +232,10 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], cmd_start, cmd_end, 0, 0); /* does not return */ } - return ; + return 1; error: - do_reset (cmdtp, flag, argc, argv); - return ; + return 1; } static ulong get_sp (void) diff --git a/lib_sh/bootm.c b/lib_sh/bootm.c index 9d2c908..e92c848 100644 --- a/lib_sh/bootm.c +++ b/lib_sh/bootm.c @@ -43,8 +43,6 @@ #define RAMDISK_IMAGE_START_MASK 0x07FF -extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); - #ifdef CFG_DEBUG static void hexdump (unsigned char *buf, int len) { @@ -59,8 +57,7 @@ static void hexdump (unsigned char *buf, int len) } #endif -void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], - bootm_headers_t *images) +int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images) { char *bootargs = getenv("bootargs"); @@ -72,9 +69,7 @@ void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], kernel(); /* does not return */ - return; error: - do_reset (cmdtp, flag, argc, argv); - return; + return 1; } diff --git a/lib_sparc/bootm.c b/lib_sparc/bootm.c index f3abdcf..4e8c920 100644 --- a/lib_sparc/bootm.c +++ b/lib_sparc/bootm.c @@ -33,7 +33,6 @@ extern image_header_t header; extern void srmmu_init_cpu(unsigned int entry); extern void prepare_bootargs(char *bootargs); -extern int do_reset(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]); #ifdef CONFIG_USB_UHCI extern int usb_lowlevel_stop(void); @@ -83,8 +82,7 @@ struct __attribute__ ((packed)) { image_header_t ihdr; /* boot the linux kernel */ -void do_bootm_linux(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[], - bootm_headers_t * images) +int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t * images) { char *bootargs; ulong initrd_start, initrd_end; @@ -181,6 +179,5 @@ void do_bootm_linux(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[], while (1) ; error: - do_reset(cmdtp, flag, argc, argv); - return; + return 1; } -- 1.5.5.1 ^ permalink raw reply related [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 15/15] bootm: refactor do_reset and os boot function args 2008-08-15 13:24 ` [U-Boot] [PATCH 15/15] bootm: refactor do_reset and os boot function args Kumar Gala @ 2008-08-26 21:48 ` Wolfgang Denk 0 siblings, 0 replies; 41+ messages in thread From: Wolfgang Denk @ 2008-08-26 21:48 UTC (permalink / raw) To: u-boot Dear Kumar Gala, In message <1218806685-3615-15-git-send-email-galak@kernel.crashing.org> you wrote: > There is no need for each OS specific function to call do_reset() > we can just do it once in bootm. This means its feasible on an > error for the os boot function to return. > > Also, remove passing in cmd_tbl_t as its not needed by the OS > boot functions. flag isn't currently used but might be in the future > so we left it alone. > > Signed-off-by: Kumar Gala <galak@kernel.crashing.org> > --- > common/cmd_bootm.c | 67 +++++++++++++++++++++++++----------------------- > lib_arm/bootm.c | 10 +----- > lib_avr32/bootm.c | 10 +----- > lib_blackfin/bootm.c | 11 ++----- > lib_i386/bootm.c | 9 +----- > lib_m68k/bootm.c | 10 +----- > lib_microblaze/bootm.c | 10 +----- > lib_mips/bootm.c | 12 +------- > lib_nios/bootm.c | 4 +- > lib_nios2/bootm.c | 9 +----- > lib_ppc/bootm.c | 11 +++----- > lib_sh/bootm.c | 9 +----- > lib_sparc/bootm.c | 7 +--- > 13 files changed, 62 insertions(+), 117 deletions(-) Applied, thanks. Wow. What a patch series... Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de In an organization, each person rises to the level of his own incom- petency - The Peter Principle ^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 14/15] fdt: Added resize command 2008-08-15 13:24 ` [U-Boot] [PATCH 14/15] fdt: Added resize command Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 15/15] bootm: refactor do_reset and os boot function args Kumar Gala @ 2008-08-26 21:46 ` Wolfgang Denk 1 sibling, 0 replies; 41+ messages in thread From: Wolfgang Denk @ 2008-08-26 21:46 UTC (permalink / raw) To: u-boot Dear Kumar Gala, In message <1218806685-3615-14-git-send-email-galak@kernel.crashing.org> you wrote: > Resize the fdt to size + padding to 4k boundary > > Signed-off-by: Kumar Gala <galak@kernel.crashing.org> > --- > common/cmd_fdt.c | 8 +++++++- > 1 files changed, 7 insertions(+), 1 deletions(-) Applied, thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de It may be that your whole purpose in life is simply to serve as a warning to others. ^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 13/15] fdt: refactor initrd related code 2008-08-15 13:24 ` [U-Boot] [PATCH 13/15] fdt: refactor initrd related code Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 14/15] fdt: Added resize command Kumar Gala @ 2008-08-26 21:45 ` Wolfgang Denk 2008-08-26 21:45 ` Wolfgang Denk 2 siblings, 0 replies; 41+ messages in thread From: Wolfgang Denk @ 2008-08-26 21:45 UTC (permalink / raw) To: u-boot Dear Kumar Gala, In message <1218806685-3615-13-git-send-email-galak@kernel.crashing.org> you wrote: > Created a new fdt_initrd() to deal with setting the initrd properties > in the device tree and fixing up the mem reserve. We can use this both > in the choosen node handling and lets us remove some duplicated code when > we fixup the initrd info in bootm on PPC. > > Signed-off-by: Kumar Gala <galak@kernel.crashing.org> > --- > common/fdt_support.c | 109 ++++++++++++++++++++++++++++++------------------- > include/fdt_support.h | 1 + > lib_ppc/bootm.c | 28 +------------ > 3 files changed, 70 insertions(+), 68 deletions(-) Applied, thanks. Please remind me that we need to do some big uint64_t => phys_addr_t cleanup one day. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Where a calculator on the ENIAC is equipped with 18,000 vacuum tubes and weighs 30 tons, computers in the future may have only 1,000 vacuum tubes and weigh only 1/2 tons. - Popular Mechanics, March 1949 ^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 13/15] fdt: refactor initrd related code 2008-08-15 13:24 ` [U-Boot] [PATCH 13/15] fdt: refactor initrd related code Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 14/15] fdt: Added resize command Kumar Gala 2008-08-26 21:45 ` [U-Boot] [PATCH 13/15] fdt: refactor initrd related code Wolfgang Denk @ 2008-08-26 21:45 ` Wolfgang Denk 2 siblings, 0 replies; 41+ messages in thread From: Wolfgang Denk @ 2008-08-26 21:45 UTC (permalink / raw) To: u-boot Dear Kumar Gala, In message <1218806685-3615-13-git-send-email-galak@kernel.crashing.org> you wrote: > Created a new fdt_initrd() to deal with setting the initrd properties > in the device tree and fixing up the mem reserve. We can use this both > in the choosen node handling and lets us remove some duplicated code when > we fixup the initrd info in bootm on PPC. > > Signed-off-by: Kumar Gala <galak@kernel.crashing.org> > --- > common/fdt_support.c | 109 ++++++++++++++++++++++++++++++------------------- > include/fdt_support.h | 1 + > lib_ppc/bootm.c | 28 +------------ > 3 files changed, 70 insertions(+), 68 deletions(-) Applied, thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "How to make a million dollars: First, get a million dollars." - Steve Martin ^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 12/15] fdt: refactor fdt resize code 2008-08-15 13:24 ` [U-Boot] [PATCH 12/15] fdt: refactor fdt resize code Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 13/15] fdt: refactor initrd related code Kumar Gala @ 2008-08-26 21:43 ` Wolfgang Denk 1 sibling, 0 replies; 41+ messages in thread From: Wolfgang Denk @ 2008-08-26 21:43 UTC (permalink / raw) To: u-boot Dear Kumar Gala, In message <1218806685-3615-12-git-send-email-galak@kernel.crashing.org> you wrote: > Move the fdt resizing code out of ppc specific boot code and into > common fdt support code. > > Signed-off-by: Kumar Gala <galak@kernel.crashing.org> > --- > common/fdt_support.c | 39 +++++++++++++++++++++++++++++++++++++++ > include/fdt_support.h | 1 + > lib_ppc/bootm.c | 32 ++++---------------------------- > 3 files changed, 44 insertions(+), 28 deletions(-) Applied, thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de ATTENTION: Despite Any Other Listing of Product Contents Found Here- on, the Consumer is Advised That, in Actuality, This Product Consists Of 99.9999999999% Empty Space. ^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 11/15] bootm: refactor image detection and os load steps 2008-08-15 13:24 ` [U-Boot] [PATCH 11/15] bootm: refactor image detection and os load steps Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 12/15] fdt: refactor fdt resize code Kumar Gala @ 2008-08-26 21:42 ` Wolfgang Denk 1 sibling, 0 replies; 41+ messages in thread From: Wolfgang Denk @ 2008-08-26 21:42 UTC (permalink / raw) To: u-boot Dear Kumar Gala, In message <1218806685-3615-11-git-send-email-galak@kernel.crashing.org> you wrote: > Created a bootm_start() that handles the parsing and detection of all the > images that will be used by the bootm command (OS, ramdisk, fdt). As part > of this we now tract all the relevant image offsets in the bootm_headers_t > struct. This will allow us to have all the needed state for future > sub-commands and lets us reduce a bit of arch specific code on SPARC. > > Created a bootm_load_os() that deals with decompression and loading the > OS image. > > Signed-off-by: Kumar Gala <galak@kernel.crashing.org> > --- > common/cmd_bootm.c | 216 ++++++++++++++++++++++++++++++---------------------- > include/image.h | 9 ++ > lib_sparc/bootm.c | 19 +----- > 3 files changed, 136 insertions(+), 108 deletions(-) Frankly, I have no idea if this really works with all image types we have to deal with. But the easiest way to find out is to apply it and make people scream if it doesn't ;-) Applied, thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Anything that is worth doing at all is worth doing well. -- Philip Earl of Chesterfield ^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 10/15] bootm: move lmb into the bootm_headers_t structure 2008-08-15 13:24 ` [U-Boot] [PATCH 10/15] bootm: move lmb into the bootm_headers_t structure Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 11/15] bootm: refactor image detection and os load steps Kumar Gala @ 2008-08-26 21:38 ` Wolfgang Denk 1 sibling, 0 replies; 41+ messages in thread From: Wolfgang Denk @ 2008-08-26 21:38 UTC (permalink / raw) To: u-boot Dear Kumar Gala, In message <1218806685-3615-10-git-send-email-galak@kernel.crashing.org> you wrote: > To allow for persistent state between future bootm subcommands we need > the lmb to exist in a global state. Moving it into the bootm_headers_t > allows us to do that. > > Signed-off-by: Kumar Gala <galak@kernel.crashing.org> > --- > common/cmd_bootm.c | 11 ++++------- > include/image.h | 4 +++- > lib_m68k/bootm.c | 2 +- > lib_ppc/bootm.c | 2 +- > lib_sparc/bootm.c | 2 +- > 5 files changed, 10 insertions(+), 11 deletions(-) Applied, thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de [Braddock:] Mr. Churchill, you are drunk. [Churchill:] And you madam, are ugly. But I shall be sober tomorrow. ^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 09/15] bootm: Set working fdt address as part of the bootm flow 2008-08-15 13:24 ` [U-Boot] [PATCH 09/15] bootm: Set working fdt address as part of the bootm flow Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 10/15] bootm: move lmb into the bootm_headers_t structure Kumar Gala @ 2008-08-26 21:37 ` Wolfgang Denk 1 sibling, 0 replies; 41+ messages in thread From: Wolfgang Denk @ 2008-08-26 21:37 UTC (permalink / raw) To: u-boot Dear Kumar Gala, In message <1218806685-3615-9-git-send-email-galak@kernel.crashing.org> you wrote: > Set the fdt working address so "fdt FOO" commands can be used as part > of the bootm flow. Also set an the environment variable "fdtaddr" > with the value. > > Signed-off-by: Kumar Gala <galak@kernel.crashing.org> > --- > common/cmd_bootm.c | 8 ++++++++ > common/cmd_fdt.c | 14 +++++++++++++- > common/image.c | 1 + > include/fdt_support.h | 2 ++ > 4 files changed, 24 insertions(+), 1 deletions(-) Applied, thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de All I ask is a chance to prove that money can't make me happy. ^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 08/15] bootm: refactor fdt locating and relocation code 2008-08-15 13:24 ` [U-Boot] [PATCH 08/15] bootm: refactor fdt locating and relocation code Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 09/15] bootm: Set working fdt address as part of the bootm flow Kumar Gala @ 2008-08-26 21:37 ` Wolfgang Denk 1 sibling, 0 replies; 41+ messages in thread From: Wolfgang Denk @ 2008-08-26 21:37 UTC (permalink / raw) To: u-boot Dear Kumar Gala, In message <1218806685-3615-8-git-send-email-galak@kernel.crashing.org> you wrote: > Move the code that handles finding a device tree blob and relocating > it (if needed) into common code so all arch's have access to it. > > Signed-off-by: Kumar Gala <galak@kernel.crashing.org> > --- > common/cmd_bootm.c | 10 + > common/image.c | 502 ++++++++++++++++++++++++++++++++++++++++++++++++++++ > include/image.h | 13 ++ > lib_ppc/bootm.c | 492 +-------------------------------------------------- > 4 files changed, 533 insertions(+), 484 deletions(-) Applied, thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Even if you aren't in doubt, consider the mental welfare of the per- son who has to maintain the code after you, and who will probably put parens in the wrong place. - Larry Wall in the perl man page ^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 07/15] bootm: refactor ramdisk locating code 2008-08-15 13:24 ` [U-Boot] [PATCH 07/15] bootm: refactor ramdisk locating code Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 08/15] bootm: refactor fdt locating and relocation code Kumar Gala @ 2008-08-26 21:35 ` Wolfgang Denk 1 sibling, 0 replies; 41+ messages in thread From: Wolfgang Denk @ 2008-08-26 21:35 UTC (permalink / raw) To: u-boot Dear Kumar Gala, In message <1218806685-3615-7-git-send-email-galak@kernel.crashing.org> you wrote: > Move determing if we have a ramdisk and where its located into the common > code. Keep track of the ramdisk start and end in the bootm_headers_t image > struct. > > Signed-off-by: Kumar Gala <galak@kernel.crashing.org> > --- > common/cmd_bootm.c | 38 ++++++++++++++++++++++++++++++++++++++ > include/image.h | 2 ++ > lib_arm/bootm.c | 10 ++-------- > lib_avr32/bootm.c | 12 +++--------- > lib_i386/bootm.c | 8 +------- > lib_m68k/bootm.c | 12 +++--------- > lib_mips/bootm.c | 12 +++--------- > lib_ppc/bootm.c | 16 +++++----------- > lib_sparc/bootm.c | 17 +++-------------- > 9 files changed, 60 insertions(+), 67 deletions(-) Applied, thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Presidency: The greased pig in the field game of American politics. - Ambrose Bierce ^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 06/15] bootm: refactor entry point code 2008-08-15 13:24 ` [U-Boot] [PATCH 06/15] bootm: refactor entry point code Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 07/15] bootm: refactor ramdisk locating code Kumar Gala @ 2008-08-21 12:02 ` Kumar Gala 2008-08-26 21:34 ` Wolfgang Denk 2008-08-26 21:31 ` Wolfgang Denk 2 siblings, 1 reply; 41+ messages in thread From: Kumar Gala @ 2008-08-21 12:02 UTC (permalink / raw) To: u-boot On Aug 15, 2008, at 8:24 AM, Kumar Gala wrote: > Move entry point code out of each arch and into common code. Keep > the entry point in the bootm_headers_t images struct. > > Signed-off-by: Kumar Gala <galak@kernel.crashing.org> > --- > common/cmd_bootm.c | 31 ++++++++++++++++++++++--------- > include/image.h | 2 ++ > lib_arm/bootm.c | 19 +------------------ > lib_avr32/bootm.c | 19 +------------------ > lib_blackfin/bootm.c | 19 +------------------ > lib_m68k/bootm.c | 19 +------------------ > lib_microblaze/bootm.c | 19 +------------------ > lib_mips/bootm.c | 18 +----------------- > lib_nios2/bootm.c | 20 +------------------- > lib_ppc/bootm.c | 22 +++------------------- > lib_sh/bootm.c | 19 +------------------ > lib_sparc/bootm.c | 12 ++---------- > 12 files changed, 37 insertions(+), 182 deletions(-) Wolfgang, I'm hoping the bootm rework patches 06..15 are still in your queue for review? - k ^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 06/15] bootm: refactor entry point code 2008-08-21 12:02 ` [U-Boot] [PATCH 06/15] bootm: refactor entry point code Kumar Gala @ 2008-08-26 21:34 ` Wolfgang Denk 2008-08-26 21:47 ` Jerry Van Baren 0 siblings, 1 reply; 41+ messages in thread From: Wolfgang Denk @ 2008-08-26 21:34 UTC (permalink / raw) To: u-boot Dear Kumar Gala, In message <C2276CA5-334E-46AD-8552-400EBDD87A67@kernel.crashing.org> you wrote: > > I'm hoping the bootm rework patches 06..15 are still in your queue for > review? Of course. I never forget anything. Never. I... I mean... Hm. Forgot what I wanted to add... Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Use C++ to confuse your enemies; use C to produce stable code. ^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 06/15] bootm: refactor entry point code 2008-08-26 21:34 ` Wolfgang Denk @ 2008-08-26 21:47 ` Jerry Van Baren 2008-08-26 21:57 ` Wolfgang Denk 0 siblings, 1 reply; 41+ messages in thread From: Jerry Van Baren @ 2008-08-26 21:47 UTC (permalink / raw) To: u-boot Wolfgang Denk wrote: > Dear Kumar Gala, > > In message <C2276CA5-334E-46AD-8552-400EBDD87A67@kernel.crashing.org> you wrote: >> I'm hoping the bootm rework patches 06..15 are still in your queue for >> review? > > Of course. I never forget anything. Never. > > I... I mean... Hm. Forgot what I wanted to add... > > Best regards, > > Wolfgang Denk Awww, and I was planning to horn in with an "Acked-by" to get my name in the lights. Too late now. Seriously, I reviewed and applied the patches last night, did a smoke test (all passed), and planned to ack the changesets. Thanks for doing this work, Kumar. Best regards, gvb ^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 06/15] bootm: refactor entry point code 2008-08-26 21:47 ` Jerry Van Baren @ 2008-08-26 21:57 ` Wolfgang Denk 2008-08-27 0:07 ` Kumar Gala 0 siblings, 1 reply; 41+ messages in thread From: Wolfgang Denk @ 2008-08-26 21:57 UTC (permalink / raw) To: u-boot Dear Jerry Van Baren, In message <48B479FF.8000809@gmail.com> you wrote: > > Awww, and I was planning to horn in with an "Acked-by" to get my name in > the lights. Too late now. You will have plenty of opportunity to get your name on other patches :-) > Seriously, I reviewed and applied the patches last night, did a smoke > test (all passed), and planned to ack the changesets. Thanks for doing > this work, Kumar. Thanks for the ACK. Indeed I too think that this was a very important step forward, last but not least when we want to push using the device tree on more architectures. Thanks, Kumar, from me, too. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "Ahead warp factor 1" - Captain Kirk ^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 06/15] bootm: refactor entry point code 2008-08-26 21:57 ` Wolfgang Denk @ 2008-08-27 0:07 ` Kumar Gala 0 siblings, 0 replies; 41+ messages in thread From: Kumar Gala @ 2008-08-27 0:07 UTC (permalink / raw) To: u-boot On Aug 26, 2008, at 4:57 PM, Wolfgang Denk wrote: > Dear Jerry Van Baren, > > In message <48B479FF.8000809@gmail.com> you wrote: >> >> Awww, and I was planning to horn in with an "Acked-by" to get my >> name in >> the lights. Too late now. > > You will have plenty of opportunity to get your name on other > patches :-) > >> Seriously, I reviewed and applied the patches last night, did a smoke >> test (all passed), and planned to ack the changesets. Thanks for >> doing >> this work, Kumar. > > Thanks for the ACK. > > Indeed I too think that this was a very important step forward, last > but not least when we want to push using the device tree on more > architectures. Thanks, Kumar, from me, too. Now we can talk about the subcommand support for bootm, which the real functionality I want :) - k ^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 06/15] bootm: refactor entry point code 2008-08-15 13:24 ` [U-Boot] [PATCH 06/15] bootm: refactor entry point code Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 07/15] bootm: refactor ramdisk locating code Kumar Gala 2008-08-21 12:02 ` [U-Boot] [PATCH 06/15] bootm: refactor entry point code Kumar Gala @ 2008-08-26 21:31 ` Wolfgang Denk 2 siblings, 0 replies; 41+ messages in thread From: Wolfgang Denk @ 2008-08-26 21:31 UTC (permalink / raw) To: u-boot Dear Kumar Gala, In message <1218806685-3615-6-git-send-email-galak@kernel.crashing.org> you wrote: > Move entry point code out of each arch and into common code. Keep > the entry point in the bootm_headers_t images struct. > > Signed-off-by: Kumar Gala <galak@kernel.crashing.org> > --- > common/cmd_bootm.c | 31 ++++++++++++++++++++++--------- > include/image.h | 2 ++ > lib_arm/bootm.c | 19 +------------------ > lib_avr32/bootm.c | 19 +------------------ > lib_blackfin/bootm.c | 19 +------------------ > lib_m68k/bootm.c | 19 +------------------ > lib_microblaze/bootm.c | 19 +------------------ > lib_mips/bootm.c | 18 +----------------- > lib_nios2/bootm.c | 20 +------------------- > lib_ppc/bootm.c | 22 +++------------------- > lib_sh/bootm.c | 19 +------------------ > lib_sparc/bootm.c | 12 ++---------- > 12 files changed, 37 insertions(+), 182 deletions(-) Applied, thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Man is the best computer we can put aboard a spacecraft ... and the only one that can be mass produced with unskilled labor. - Wernher von Braun ^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 05/15] fdt: fdt addr w/o any args reports back the current working address 2008-08-15 13:24 ` [U-Boot] [PATCH 05/15] fdt: fdt addr w/o any args reports back the current working address Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 06/15] bootm: refactor entry point code Kumar Gala @ 2008-08-18 23:07 ` Wolfgang Denk 2008-08-18 23:23 ` Jerry Van Baren 2008-08-20 22:56 ` Wolfgang Denk 2 siblings, 1 reply; 41+ messages in thread From: Wolfgang Denk @ 2008-08-18 23:07 UTC (permalink / raw) To: u-boot Hi Jerry, In message <1218806685-3615-5-git-send-email-galak@kernel.crashing.org> Kumar Gala wrote: > Signed-off-by: Kumar Gala <galak@kernel.crashing.org> > --- > common/cmd_fdt.c | 8 ++++++++ > 1 files changed, 8 insertions(+), 0 deletions(-) > > diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c > index 436fec9..c129993 100644 > --- a/common/cmd_fdt.c > +++ b/common/cmd_fdt.c > @@ -67,6 +67,14 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) > /* > * Set the address [and length] of the fdt. > */ > + if (argc == 2) { > + if (!fdt_valid()) { > + return 1; > + } > + printf("The address of the fdt is %p\n", working_fdt); > + return 0; > + } > + > working_fdt = (struct fdt_header *)simple_strtoul(argv[2], NULL, 16); > > if (!fdt_valid()) { This looks ok to me. Will you add this, or should I pull it directly? Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de A Puritan is someone who is deathly afraid that someone, somewhere, is having fun. ^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 05/15] fdt: fdt addr w/o any args reports back the current working address 2008-08-18 23:07 ` [U-Boot] [PATCH 05/15] fdt: fdt addr w/o any args reports back the current working address Wolfgang Denk @ 2008-08-18 23:23 ` Jerry Van Baren 0 siblings, 0 replies; 41+ messages in thread From: Jerry Van Baren @ 2008-08-18 23:23 UTC (permalink / raw) To: u-boot Wolfgang Denk wrote: > Hi Jerry, > > In message <1218806685-3615-5-git-send-email-galak@kernel.crashing.org> Kumar Gala wrote: >> Signed-off-by: Kumar Gala <galak@kernel.crashing.org> >> --- >> common/cmd_fdt.c | 8 ++++++++ >> 1 files changed, 8 insertions(+), 0 deletions(-) [snip] > > This looks ok to me. Will you add this, or should I pull it directly? > > Best regards, > > Wolfgang Denk Please pull it directly. Thanks, gvb ^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 05/15] fdt: fdt addr w/o any args reports back the current working address 2008-08-15 13:24 ` [U-Boot] [PATCH 05/15] fdt: fdt addr w/o any args reports back the current working address Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 06/15] bootm: refactor entry point code Kumar Gala 2008-08-18 23:07 ` [U-Boot] [PATCH 05/15] fdt: fdt addr w/o any args reports back the current working address Wolfgang Denk @ 2008-08-20 22:56 ` Wolfgang Denk 2 siblings, 0 replies; 41+ messages in thread From: Wolfgang Denk @ 2008-08-20 22:56 UTC (permalink / raw) To: u-boot Dear Kumar Gala, In message <1218806685-3615-5-git-send-email-galak@kernel.crashing.org> you wrote: > Signed-off-by: Kumar Gala <galak@kernel.crashing.org> > --- > common/cmd_fdt.c | 8 ++++++++ > 1 files changed, 8 insertions(+), 0 deletions(-) Applied, thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de A star captain's most solemn oath is that he will give his life, even his entire crew, rather than violate the Prime Directive. -- Kirk, "The Omega Glory", stardate unknown ^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 04/15] fdt: added the ability to set initrd start/end via chosen command 2008-08-15 13:24 ` [U-Boot] [PATCH 04/15] fdt: added the ability to set initrd start/end via chosen command Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 05/15] fdt: fdt addr w/o any args reports back the current working address Kumar Gala @ 2008-08-18 23:04 ` Wolfgang Denk 2008-08-20 22:56 ` Wolfgang Denk 2 siblings, 0 replies; 41+ messages in thread From: Wolfgang Denk @ 2008-08-18 23:04 UTC (permalink / raw) To: u-boot Dear Kumar Gala, In message <1218806685-3615-4-git-send-email-galak@kernel.crashing.org> you wrote: > Signed-off-by: Kumar Gala <galak@kernel.crashing.org> > --- > common/cmd_fdt.c | 21 +++++++++++++++++---- > 1 files changed, 17 insertions(+), 4 deletions(-) > > diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c > index d3b19dd..436fec9 100644 > --- a/common/cmd_fdt.c > +++ b/common/cmd_fdt.c > @@ -417,9 +417,21 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) > ft_board_setup(working_fdt, gd->bd); > #endif > /* Create a chosen node */ > - else if (argv[1][0] == 'c') > - fdt_chosen(working_fdt, 0, 0, 1); > - else { > + else if (argv[1][0] == 'c') { > + unsigned long initrd_start = 0, initrd_end = 0; I guess we should use phys_addr_t here. > + if ((argc != 2) && (argc != 4)) { > + printf ("Usage:\n%s\n", cmdtp->usage); > + return 1; > + } > + > + if (argc == 4) { > + initrd_start = simple_strtoul(argv[2], NULL, 16); > + initrd_end = simple_strtoul(argv[3], NULL, 16); Ah - do we have some "simple_strtouphys" yet? I think we don't. This might be a sleeping dog in a lot af places in the code, actually... Hm... what do you think? [Except from that it's fine with me.] Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de A supercomputer is a machine that runs an endless loop in 2 seconds. ^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 04/15] fdt: added the ability to set initrd start/end via chosen command 2008-08-15 13:24 ` [U-Boot] [PATCH 04/15] fdt: added the ability to set initrd start/end via chosen command Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 05/15] fdt: fdt addr w/o any args reports back the current working address Kumar Gala 2008-08-18 23:04 ` [U-Boot] [PATCH 04/15] fdt: added the ability to set initrd start/end via chosen command Wolfgang Denk @ 2008-08-20 22:56 ` Wolfgang Denk 2 siblings, 0 replies; 41+ messages in thread From: Wolfgang Denk @ 2008-08-20 22:56 UTC (permalink / raw) To: u-boot Dear Kumar Gala, In message <1218806685-3615-4-git-send-email-galak@kernel.crashing.org> you wrote: > Signed-off-by: Kumar Gala <galak@kernel.crashing.org> > --- > common/cmd_fdt.c | 21 +++++++++++++++++---- > 1 files changed, 17 insertions(+), 4 deletions(-) Applied, thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. -- Albert Einstein ^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 03/15] Add command to enable/disable interrupts 2008-08-15 13:24 ` [U-Boot] [PATCH 03/15] Add command to enable/disable interrupts Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 04/15] fdt: added the ability to set initrd start/end via chosen command Kumar Gala @ 2008-08-18 22:59 ` Wolfgang Denk 2008-08-18 23:18 ` Kumar Gala 2008-08-20 22:53 ` Wolfgang Denk 2 siblings, 1 reply; 41+ messages in thread From: Wolfgang Denk @ 2008-08-18 22:59 UTC (permalink / raw) To: u-boot Dear Kumar Gala, In message <1218806685-3615-3-git-send-email-galak@kernel.crashing.org> you wrote: > Signed-off-by: Kumar Gala <galak@kernel.crashing.org> > --- > common/Makefile | 1 + > common/cmd_irq.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 51 insertions(+), 0 deletions(-) > create mode 100644 common/cmd_irq.c ... > +U_BOOT_CMD( > + interrupts, 5, 0, do_interrupts, > + "interrupts - enable or disable interrupts\n", > + "[on, off]\n" > + " - enable or disable interrupts\n" I suggest to also support this command without argument, in which case it would print the current setting. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de The use of anthropomorphic terminology when dealing with computing systems is a symptom of professional immaturity. -- Edsger Dijkstra ^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 03/15] Add command to enable/disable interrupts 2008-08-18 22:59 ` [U-Boot] [PATCH 03/15] Add command to enable/disable interrupts Wolfgang Denk @ 2008-08-18 23:18 ` Kumar Gala 0 siblings, 0 replies; 41+ messages in thread From: Kumar Gala @ 2008-08-18 23:18 UTC (permalink / raw) To: u-boot On Aug 18, 2008, at 5:59 PM, Wolfgang Denk wrote: > Dear Kumar Gala, > > In message <1218806685-3615-3-git-send-email- > galak at kernel.crashing.org> you wrote: >> Signed-off-by: Kumar Gala <galak@kernel.crashing.org> >> --- >> common/Makefile | 1 + >> common/cmd_irq.c | 50 ++++++++++++++++++++++++++++++++++++++++++++ >> ++++++ >> 2 files changed, 51 insertions(+), 0 deletions(-) >> create mode 100644 common/cmd_irq.c > ... >> +U_BOOT_CMD( >> + interrupts, 5, 0, do_interrupts, >> + "interrupts - enable or disable interrupts\n", >> + "[on, off]\n" >> + " - enable or disable interrupts\n" > > I suggest to also support this command without argument, in which case > it would print the current setting. The current arch interfaces don't have a "clean" way to do this right now. I can hack it in via: iflag = disable_interrupts() if (iflag) { enable_interrupts() printf("interrupts are enabled\n"); } else { printf("interrupts are disabled\n"); } If this isn't ok, I'd request you take this patch and I'll look at adding an get_irqflags() to all the arches and add support to print the interrupt state based on that. - k ^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 03/15] Add command to enable/disable interrupts 2008-08-15 13:24 ` [U-Boot] [PATCH 03/15] Add command to enable/disable interrupts Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 04/15] fdt: added the ability to set initrd start/end via chosen command Kumar Gala 2008-08-18 22:59 ` [U-Boot] [PATCH 03/15] Add command to enable/disable interrupts Wolfgang Denk @ 2008-08-20 22:53 ` Wolfgang Denk 2 siblings, 0 replies; 41+ messages in thread From: Wolfgang Denk @ 2008-08-20 22:53 UTC (permalink / raw) To: u-boot Dear Kumar Gala, In message <1218806685-3615-3-git-send-email-galak@kernel.crashing.org> you wrote: > Signed-off-by: Kumar Gala <galak@kernel.crashing.org> > --- > common/Makefile | 1 + > common/cmd_irq.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 51 insertions(+), 0 deletions(-) > create mode 100644 common/cmd_irq.c Applied, thanks. Let's keep in mind to enahnce this command for status inquiry later. Thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de [Doctors and Bartenders], We both get the same two kinds of customers -- the living and the dying. -- Dr. Boyce, "The Menagerie" ("The Cage"), stardate unknown ^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 02/15] Clean up usage of icache_disable/dcache_disable 2008-08-15 13:24 ` [U-Boot] [PATCH 02/15] Clean up usage of icache_disable/dcache_disable Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 03/15] Add command to enable/disable interrupts Kumar Gala @ 2008-08-18 22:57 ` Wolfgang Denk 1 sibling, 0 replies; 41+ messages in thread From: Wolfgang Denk @ 2008-08-18 22:57 UTC (permalink / raw) To: u-boot Dear Kumar Gala, In message <1218806685-3615-2-git-send-email-galak@kernel.crashing.org> you wrote: > There is no point in disabling the icache on 7xx/74xx/86xx parts and not > also flushing the icache. All callers of invalidate_l1_instruction_cache() > call icache_disable() right after. Make it so icache_disable() calls > invalidate_l1_instruction_cache() for us. > > Also, dcache_disable() already calls dcache_flush() so there is no point > in the explicit calls of dcache_flush(). > > Signed-off-by: Kumar Gala <galak@kernel.crashing.org> > --- > board/Marvell/db64360/db64360.c | 5 ----- > board/Marvell/db64460/db64460.c | 5 ----- > board/esd/cpci750/cpci750.c | 4 ---- > board/freescale/mpc7448hpc2/mpc7448hpc2.c | 2 -- > board/prodrive/p3mx/p3mx.c | 2 -- > common/cmd_bootm.c | 2 -- > cpu/74xx_7xx/cache.S | 4 ++++ > cpu/mpc86xx/cache.S | 4 ++++ > 8 files changed, 8 insertions(+), 20 deletions(-) Applied, thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Small is beautiful. ^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 01/15] Update linux bootm to support ePAPR client interface 2008-08-15 13:24 [U-Boot] [PATCH 01/15] Update linux bootm to support ePAPR client interface Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 02/15] Clean up usage of icache_disable/dcache_disable Kumar Gala @ 2008-08-18 22:55 ` Wolfgang Denk 1 sibling, 0 replies; 41+ messages in thread From: Wolfgang Denk @ 2008-08-18 22:55 UTC (permalink / raw) To: u-boot Dear Kumar Gala, In message <1218806685-3615-1-git-send-email-galak@kernel.crashing.org> you wrote: > the ePAPR spec has some subtle differences from the current device tree > based boot interface to the powerpc linux kernel. The powerpc linux kernel > currently ignores the differences that ePAPR specifies. > > Signed-off-by: Kumar Gala <galak@kernel.crashing.org> > --- > lib_ppc/bootm.c | 33 +++++++++++++++++++++++---------- > 1 files changed, 23 insertions(+), 10 deletions(-) Applied, thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de A princess should not be afraid -- not with a brave knight to protect her. -- McCoy, "Shore Leave", stardate 3025.3 ^ permalink raw reply [flat|nested] 41+ messages in thread
end of thread, other threads:[~2008-08-27 0:07 UTC | newest] Thread overview: 41+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2008-08-15 13:24 [U-Boot] [PATCH 01/15] Update linux bootm to support ePAPR client interface Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 02/15] Clean up usage of icache_disable/dcache_disable Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 03/15] Add command to enable/disable interrupts Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 04/15] fdt: added the ability to set initrd start/end via chosen command Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 05/15] fdt: fdt addr w/o any args reports back the current working address Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 06/15] bootm: refactor entry point code Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 07/15] bootm: refactor ramdisk locating code Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 08/15] bootm: refactor fdt locating and relocation code Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 09/15] bootm: Set working fdt address as part of the bootm flow Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 10/15] bootm: move lmb into the bootm_headers_t structure Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 11/15] bootm: refactor image detection and os load steps Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 12/15] fdt: refactor fdt resize code Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 13/15] fdt: refactor initrd related code Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 14/15] fdt: Added resize command Kumar Gala 2008-08-15 13:24 ` [U-Boot] [PATCH 15/15] bootm: refactor do_reset and os boot function args Kumar Gala 2008-08-26 21:48 ` Wolfgang Denk 2008-08-26 21:46 ` [U-Boot] [PATCH 14/15] fdt: Added resize command Wolfgang Denk 2008-08-26 21:45 ` [U-Boot] [PATCH 13/15] fdt: refactor initrd related code Wolfgang Denk 2008-08-26 21:45 ` Wolfgang Denk 2008-08-26 21:43 ` [U-Boot] [PATCH 12/15] fdt: refactor fdt resize code Wolfgang Denk 2008-08-26 21:42 ` [U-Boot] [PATCH 11/15] bootm: refactor image detection and os load steps Wolfgang Denk 2008-08-26 21:38 ` [U-Boot] [PATCH 10/15] bootm: move lmb into the bootm_headers_t structure Wolfgang Denk 2008-08-26 21:37 ` [U-Boot] [PATCH 09/15] bootm: Set working fdt address as part of the bootm flow Wolfgang Denk 2008-08-26 21:37 ` [U-Boot] [PATCH 08/15] bootm: refactor fdt locating and relocation code Wolfgang Denk 2008-08-26 21:35 ` [U-Boot] [PATCH 07/15] bootm: refactor ramdisk locating code Wolfgang Denk 2008-08-21 12:02 ` [U-Boot] [PATCH 06/15] bootm: refactor entry point code Kumar Gala 2008-08-26 21:34 ` Wolfgang Denk 2008-08-26 21:47 ` Jerry Van Baren 2008-08-26 21:57 ` Wolfgang Denk 2008-08-27 0:07 ` Kumar Gala 2008-08-26 21:31 ` Wolfgang Denk 2008-08-18 23:07 ` [U-Boot] [PATCH 05/15] fdt: fdt addr w/o any args reports back the current working address Wolfgang Denk 2008-08-18 23:23 ` Jerry Van Baren 2008-08-20 22:56 ` Wolfgang Denk 2008-08-18 23:04 ` [U-Boot] [PATCH 04/15] fdt: added the ability to set initrd start/end via chosen command Wolfgang Denk 2008-08-20 22:56 ` Wolfgang Denk 2008-08-18 22:59 ` [U-Boot] [PATCH 03/15] Add command to enable/disable interrupts Wolfgang Denk 2008-08-18 23:18 ` Kumar Gala 2008-08-20 22:53 ` Wolfgang Denk 2008-08-18 22:57 ` [U-Boot] [PATCH 02/15] Clean up usage of icache_disable/dcache_disable Wolfgang Denk 2008-08-18 22:55 ` [U-Boot] [PATCH 01/15] Update linux bootm to support ePAPR client interface Wolfgang Denk
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox