Re: [U-Boot] Flatten device tree PPC linu
Thanks for clearing that up. One other question, if i update to u-boot 1.3.4 or whatever is the latest, can i configure so that i doesn't use FDT to boot kernel ? TIA --- On Thu, 8/14/08, Paul Gortmaker [EMAIL PROTECTED] wrote: From: Paul Gortmaker [EMAIL PROTECTED] Subject: Re: [U-Boot] Flatten device tree PPC linu To: [EMAIL PROTECTED] Cc: u-boot@lists.denx.de Date: Thursday, August 14, 2008, 6:35 PM On Thu, Aug 14, 2008 at 4:10 PM, Fundu [EMAIL PROTECTED] wrote: i'm using a the taishan board u-boot 1.2.0 and linux 2.4 Uh, OK. Those are both pretty darn old by now. does u-boot-1.2.0 pass a flatten device tree to the kernel ? Maybe. how do i make confirm this ? TIA I believe the 4xx boards were probably not using FDT back then. You can confirm by help bootm -- if it only takes the kernel addy and the optional ramdisk addy, then it is non-FDT. But whether or not u-boot is FDT capable is pretty much moot point if you are on a v2.4.x kernel, as they don't use FDT. P. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] Enquiry for code supporting for MPC8572pc.Thanks!
Hello, I downloaded the U-boot code yesterday, I can see that there is support for Freescale MPC85XX, but no specifically code supporting for MPC8572pc. So I am wondering when the code for MPC8572 will be relased? Will it be soon? Thanks attachment: Blank Bkgrd.gif___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Flatten device tree PPC linu
Dear Fundu, In message [EMAIL PROTECTED] you wrote: Thanks for clearing that up. One other question, if i update to u-boot 1.3.4 or whatever is the latest, can i configure so that i doesn't use FDT to boot kernel ? You don't have to configure that - it just depoends on how you boot the Linux kenrel image - either you pass a device tree address (as the third argument to the bootm command), or you don't. 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: [EMAIL PROTECTED] Research is what I'm doing when I don't know what I'm doing. -- Wernher von Braun ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Resubmit : [PATCH] Correct ARM Versatile TimerInitialization
Hi Hi, according to datasheet for the register TimerXControl we are supposed to not modify the bits [31:8] and [4] so we are suppose to read the register and modify only the others registers/register/bits/ Does this mean i need to resend the earlier patch. Writing 00 to these bits ( 31:8 4) is undefined. Generally, in ARM terminology, one should avoid writing values where writing a value or bit is undefined. Not only in ARM. Undefined implies, not that there is no result, but that the outcome is not defined by the specification. Hence it is good practice to read/change/write registers with undefined bits, or bits where writing is undefined. That exaclty what I mean This is especially important with bits defined as such in ARM TRMs since different ARM customers may implement the ARM IP in different ways i.e writing a value to such bits may have different results in different implementations and or versions of the hardware. Thanks Peter for the clarification, I checked the source code found that the original code itself modifies the Timer Control Register directly. Also, after going through the Timer Module i found that, For free-running Mode of the timer, Writing to Timer_Load register has no effect. The TRM Says, If the timer is operating in Free-Running Mode, it continues to decrement from its maximum value So i think the writing to timer_load register is also unnecessary in this case. Kindly correct me if i am wrong. Also Kindly let me know, if i need to change anything in the patch. Else i resend the patch once again regards Gururaja ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] - Correct Invalid Timer Register Field Declaration
Hi, I searched the Entire u-boot-1.3.4\ directory for PTV_BIT declaration couldn't find any. Rather MPUTIM_PTV_BIT is defined which is the correct declaration. Below Patch Corrects the declaration of MPUTIM_PTV_MASK bit in both omap1510.h omap730.h. Kindly update me if i am wrong. TIA Regards Gururaja - Correct Invalid #define of MPUTIM_PTV_MASK for omap1510 omap730 register definition MPUTIM_PTV_MASK is defined as #define MPUTIM_PTV_MASK(0x7PTV_BIT) while it should have been #define MPUTIM_PTV_MASK(0x7MPUTIM_PTV_BIT) - Below Patch corrects the same Signed-off-by: Gururaja Hebbar [EMAIL PROTECTED] --- include/configs/omap1510.h |2 +- include/configs/omap730.h |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/configs/omap1510.h b/include/configs/omap1510.h index 6787b19..931560c 100755 --- a/include/configs/omap1510.h +++ b/include/configs/omap1510.h @@ -482,7 +482,7 @@ /* CNTL_TIMER register bits */ #define MPUTIM_FREE(16) #define MPUTIM_CLOCK_ENABLE(15) -#define MPUTIM_PTV_MASK(0x7PTV_BIT) +#define MPUTIM_PTV_MASK(0x7MPUTIM_PTV_BIT) #define MPUTIM_PTV_BIT 2 #define MPUTIM_AR (11) #define MPUTIM_ST (10) diff --git a/include/configs/omap730.h b/include/configs/omap730.h index 03abcb3..04d5144 100755 --- a/include/configs/omap730.h +++ b/include/configs/omap730.h @@ -150,7 +150,7 @@ /* MPU_CNTL_TIMER register bits */ #define MPUTIM_FREE (16) #define MPUTIM_CLOCK_ENABLE (15) -#define MPUTIM_PTV_MASK (0x7PTV_BIT) +#define MPUTIM_PTV_MASK (0x7MPUTIM_PTV_BIT) #define MPUTIM_PTV_BIT2 #define MPUTIM_AR (11) #define MPUTIM_ST (10) -- 1.5.6.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] U-Boot configuration
Hello, we use an TQM5200 Board on an own designed Baseboard than the TB5200 or STK52xx. Do we have to reconfigure the U-boot Source for this new baseboard? And specially, is it necessary to disable the PCI Bus in the U-Boot Sources when we donĀ“t use this Bus? Axel Beierlein ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Enquiry for code supporting for MPC8572pc.Thanks!
lifengkai wrote: I downloaded the U-boot code yesterday, I can see that there is support for Freescale MPC85XX, but no specifically code supporting for MPC8572pc. So I am wondering when the code for MPC8572 will be relased? Will it be soon? Support for the MPC8572 has been posted only recently, so it's not included in the mainline yet and you need to patch your sources manually; see: http://www.nabble.com/-U-Boot---PATCH-1-3--mpc85xx%3A-Add-support-for-the-MPC8572DS-reference-board-td18947664.html Note this is for the MPC8572DS, but it should get you started with your device. kind regards, Rafal ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Enquiry for code supporting for MPC8572pc.Thanks!
On Aug 15, 2008, at 4:05 AM, Rafal Jaworowski wrote: lifengkai wrote: I downloaded the U-boot code yesterday, I can see that there is support for Freescale MPC85XX, but no specifically code supporting for MPC8572pc. So I am wondering when the code for MPC8572 will be relased? Will it be soon? Support for the MPC8572 has been posted only recently, so it's not included in the mainline yet and you need to patch your sources manually; see: http://www.nabble.com/-U-Boot---PATCH-1-3--mpc85xx%3A-Add-support-for-the-MPC8572DS-reference-board-td18947664.html Note this is for the MPC8572DS, but it should get you started with your device. The 8572 support that was posted depends on the new DDR code getting in first. - k ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 01/15] Update linux bootm to support ePAPR client interface
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 [EMAIL PROTECTED] --- 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 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 02/15] Clean up usage of icache_disable/dcache_disable
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 [EMAIL PROTECTED] --- 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) + mflrr4 + bl invalidate_l1_instruction_cache /* uses r3 */ + sync + mtlrr4 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 ---
[U-Boot] [PATCH 04/15] fdt: added the ability to set initrd start/end via chosen command
Signed-off-by: Kumar Gala [EMAIL PROTECTED] --- 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 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 05/15] fdt: fdt addr w/o any args reports back the current working address
Signed-off-by: Kumar Gala [EMAIL PROTECTED] --- 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 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 03/15] Add command to enable/disable interrupts
Signed-off-by: Kumar Gala [EMAIL PROTECTED] --- 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 000..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 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 07/15] bootm: refactor ramdisk locating code
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 [EMAIL PROTECTED] --- 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
[U-Boot] [PATCH 06/15] bootm: refactor entry point code
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 [EMAIL PROTECTED] --- 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
[U-Boot] [PATCH 08/15] bootm: refactor fdt locating and relocation code
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 [EMAIL PROTECTED] --- 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
[U-Boot] [PATCH 10/15] bootm: move lmb into the bootm_headers_t structure
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 [EMAIL PROTECTED] --- 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 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 11/15] bootm: refactor image detection and os load steps
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 [EMAIL PROTECTED] --- 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; - uintunc_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 */
[U-Boot] [PATCH 12/15] fdt: refactor fdt resize code
Move the fdt resizing code out of ppc specific boot code and into common fdt support code. Signed-off-by: Kumar Gala [EMAIL PROTECTED] --- 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 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 13/15] fdt: refactor initrd related code
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 [EMAIL PROTECTED] --- 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); -
[U-Boot] [PATCH 14/15] fdt: Added resize command
Resize the fdt to size + padding to 4k boundary Signed-off-by: Kumar Gala [EMAIL PROTECTED] --- 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 setpath prop [val]- Set property [to val]\n -- 1.5.5.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 15/15] bootm: refactor do_reset and os boot function args
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 [EMAIL PROTECTED] --- 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
[U-Boot] unassigned-patches/24: [PATCH] PHY: Add support for the M88E1121R Marvell chip.
Signed-off-by: Yuri Tikhonov [EMAIL PROTECTED] Signed-off-by: Sergei Poselenov [EMAIL PROTECTED] --- Added to GNATS database as unassigned-patches/24 Responsible:patch-coord Message-Id: [EMAIL PROTECTED] In-Reply-To: References: Patch-Date: Fri Aug 15 15:42:08 +0200 2008 --- drivers/net/tsec.c | 50 ++ drivers/net/tsec.h |7 +++ 2 files changed, 57 insertions(+), 0 deletions(-) diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c index 6e0f2c6..fb5002d 100644 --- a/drivers/net/tsec.c +++ b/drivers/net/tsec.c @@ -1157,6 +1157,55 @@ struct phy_info phy_info_M88E1118 = { }, }; +/* + * Since to access LED register we need do switch the page, we + * do LED configuring in the miim_read-like function as follows + */ +uint mii_88E1121_set_led (uint mii_reg, struct tsec_private *priv) +{ + uint pg; + + /* Switch the page to access the led register */ + pg = read_phy_reg(priv, MIIM_88E1121_PHY_PAGE); + write_phy_reg(priv, MIIM_88E1121_PHY_PAGE, MIIM_88E1121_PHY_LED_PAGE); + + /* Configure leds */ + write_phy_reg(priv, MIIM_88E1121_PHY_LED_CTRL, + MIIM_88E1121_PHY_LED_DEF); + + /* Restore the page pointer */ + write_phy_reg(priv, MIIM_88E1121_PHY_PAGE, pg); + return 0; +} + +struct phy_info phy_info_M88E1121R = { + 0x01410cb, + Marvell 88E1121R, + 4, + (struct phy_cmd[]){ /* config */ + /* Reset and configure the PHY */ + {MIIM_CONTROL, MIIM_CONTROL_RESET, NULL}, + {MIIM_GBIT_CONTROL, MIIM_GBIT_CONTROL_INIT, NULL}, + {MIIM_ANAR, MIIM_ANAR_INIT, NULL}, + /* Configure leds */ + {MIIM_88E1121_PHY_LED_CTRL, miim_read, +mii_88E1121_set_led}, + {MIIM_CONTROL, MIIM_CONTROL_INIT, mii_cr_init}, + {miim_end,} + }, + (struct phy_cmd[]){ /* startup */ + /* Status is read once to clear old link state */ + {MIIM_STATUS, miim_read, NULL}, + {MIIM_STATUS, miim_read, mii_parse_sr}, + {MIIM_STATUS, miim_read, mii_parse_link}, + {miim_end,} + }, + (struct phy_cmd[]){ /* shutdown */ + {miim_end,} + }, +}; + + static unsigned int m88e1145_setmode(uint mii_reg, struct tsec_private *priv) { uint mii_data = read_phy_reg(priv, mii_reg); @@ -1522,6 +1571,7 @@ struct phy_info *phy_info[] = { phy_info_M88E1011S, phy_info_M88ES, phy_info_M88E1118, + phy_info_M88E1121R, phy_info_M88E1145, phy_info_M88E1149S, phy_info_dm9161, diff --git a/drivers/net/tsec.h b/drivers/net/tsec.h index 6a2338b..fee5934 100644 --- a/drivers/net/tsec.h +++ b/drivers/net/tsec.h @@ -184,6 +184,13 @@ #define MIIM_88E_PHY_LED_DIRECT0x4100 #define MIIM_88E_PHY_LED_COMBINE 0x411C +/* 88E1121 PHY LED Control Register */ +#define MIIM_88E1121_PHY_LED_CTRL 16 +#define MIIM_88E1121_PHY_LED_PAGE 3 +#define MIIM_88E1121_PHY_LED_DEF 0x0030 + +#define MIIM_88E1121_PHY_PAGE 22 + /* 88E1145 Extended PHY Specific Control Register */ #define MIIM_88E1145_PHY_EXT_CR 20 #define MIIM_M88E1145_RGMII_RX_DELAY 0x0080 -- 1.5.6.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] unassigned-patches/23: [PATCH] RX 8025 RTC: analyze 12/24-hour mode flag in rtc_get().
Signed-off-by: Yuri Tikhonov [EMAIL PROTECTED] --- Added to GNATS database as unassigned-patches/23 Responsible:patch-coord Message-Id: [EMAIL PROTECTED] In-Reply-To:[EMAIL PROTECTED] References: [EMAIL PROTECTED] Patch-Date: Fri Aug 15 15:42:09 +0200 2008 --- drivers/rtc/rx8025.c |6 +- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/drivers/rtc/rx8025.c b/drivers/rtc/rx8025.c index 64eafe5..6ba9df2 100644 --- a/drivers/rtc/rx8025.c +++ b/drivers/rtc/rx8025.c @@ -136,7 +136,11 @@ int rtc_get (struct rtc_time *tmp) tmp-tm_sec = bcd2bin (sec 0x7F); tmp-tm_min = bcd2bin (min 0x7F); - tmp-tm_hour = bcd2bin (hour 0x3F); + if (rtc_read(RTC_CTL1_REG_ADDR) RTC_CTL1_BIT_2412) + tmp-tm_hour = bcd2bin (hour 0x3F); + else + tmp-tm_hour = bcd2bin (hour 0x1F) % 12 + + ((hour 0x20) ? 12 : 0); tmp-tm_mday = bcd2bin (mday 0x3F); tmp-tm_mon = bcd2bin (mon 0x1F); tmp-tm_year = bcd2bin (year) + ( bcd2bin (year) = 70 ? 1900 : 2000); -- 1.5.6.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] unassigned-patches/25: [PATCH] USB EHCI: reset root hub
Some of multi-function USB controllers (e.g. ISP1562) allow root hub resetting only via EHCI registers. So, this patch adds the corresponding kind of reset to OHCI's hc_reset() if the newly introduced CONFIG_PCI_EHCI_DEVNO option is set (e.g. for Socrates board). Signed-off-by: Yuri Tikhonov [EMAIL PROTECTED] --- Added to GNATS database as unassigned-patches/25 Responsible:patch-coord Message-Id: [EMAIL PROTECTED] In-Reply-To:[EMAIL PROTECTED] References: [EMAIL PROTECTED] [EMAIL PROTECTED] Patch-Date: Fri Aug 15 15:42:10 +0200 2008 --- drivers/usb/usb_ohci.c | 31 +++ drivers/usb/usb_ohci.h |3 +++ include/configs/socrates.h |1 + 3 files changed, 35 insertions(+), 0 deletions(-) diff --git a/drivers/usb/usb_ohci.c b/drivers/usb/usb_ohci.c index fd60edb..0f5bd06 100644 --- a/drivers/usb/usb_ohci.c +++ b/drivers/usb/usb_ohci.c @@ -1571,11 +1571,42 @@ int submit_int_msg(struct usb_device *dev, unsigned long pipe, void *buffer, static int hc_reset (ohci_t *ohci) { +#ifdef CONFIG_PCI_EHCI_DEVNO + pci_dev_t pdev; + struct pci_device_id ehci_pci_ids[] = { + {0x1131, 0x1562}, /* Philips 1562 PCI EHCI module ids */ + {0, 0} + }; +#endif int timeout = 30; int smm_timeout = 50; /* 0,5 sec */ dbg(%s\n, __FUNCTION__); +#ifdef CONFIG_PCI_EHCI_DEVNO + /* +* Some multi-function controllers (e.g. ISP1562) allow root hub +* resetting via EHCI registers only. +*/ + pdev = pci_find_devices(ehci_pci_ids, CONFIG_PCI_EHCI_DEVNO); + if (pdev != -1) { + u32 base; + int timeout = 1000; + + pci_read_config_dword(pdev, PCI_BASE_ADDRESS_0, base); + writel (readl(base + EHCI_USBCMD_OFF) | EHCI_USBCMD_HCRESET, + base + EHCI_USBCMD_OFF); + + while (readl(base + EHCI_USBCMD_OFF) EHCI_USBCMD_HCRESET) { + if (timeout-- = 0) { + printf(USB RootHub reset timed out!); + break; + } + udelay(1); + } + } else + printf(No EHCI func at %d index!\n, CONFIG_PCI_EHCI_DEVNO); +#endif if (readl (ohci-regs-control) OHCI_CTRL_IR) { /* SMM owns the HC */ writel (OHCI_OCR, ohci-regs-cmdstatus); /* request ownership */ info(USB HC TakeOver from SMM); diff --git a/drivers/usb/usb_ohci.h b/drivers/usb/usb_ohci.h index 380cb4c..7a04bf5 100644 --- a/drivers/usb/usb_ohci.h +++ b/drivers/usb/usb_ohci.h @@ -195,6 +195,9 @@ struct ohci_regs { } roothub; } __attribute((aligned(32))); +/* Some EHCI controls */ +#define EHCI_USBCMD_OFF0x20 +#define EHCI_USBCMD_HCRESET(1 1) /* OHCI CONTROL AND STATUS REGISTER MASKS */ diff --git a/include/configs/socrates.h b/include/configs/socrates.h index 8a64942..fdc1557 100644 --- a/include/configs/socrates.h +++ b/include/configs/socrates.h @@ -403,6 +403,7 @@ #define CONFIG_USB_OHCI_NEW1 #define CONFIG_PCI_OHCI1 #define CONFIG_PCI_OHCI_DEVNO 3 /* Number in PCI list */ +#define CONFIG_PCI_EHCI_DEVNO (CONFIG_PCI_OHCI_DEVNO / 2) #define CFG_USB_OHCI_MAX_ROOT_PORTS15 #define CFG_USB_OHCI_SLOT_NAME ohci_pci #define CFG_OHCI_SWAP_REG_ACCESS 1 -- 1.5.6.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] unassigned-patches/26: [PATCH] 85xx: socrates: Enable Lime support.
This patch adds Lime GDC support together with support for the PWM backlight control through the w83782d chip. The reset pin of the latter is attached to GPIO, so we need to reset it in early_board_init_r. Signed-off-by: Anatolij Gustschin [EMAIL PROTECTED] --- Added to GNATS database as unassigned-patches/26 Responsible:patch-coord Message-Id: [EMAIL PROTECTED] In-Reply-To:[EMAIL PROTECTED] References: [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] Patch-Date: Fri Aug 15 15:42:13 +0200 2008 --- board/socrates/law.c |4 +- board/socrates/socrates.c | 198 board/socrates/tlb.c | 13 +++- board/socrates/upm_table.h | 20 + drivers/video/mb862xx.c|3 +- include/configs/socrates.h | 24 ++ 6 files changed, 259 insertions(+), 3 deletions(-) diff --git a/board/socrates/law.c b/board/socrates/law.c index 35c4a90..89b446f 100644 --- a/board/socrates/law.c +++ b/board/socrates/law.c @@ -36,6 +36,7 @@ * 0x_0x2fff_ DDR 512M * 0x8000_0x9fff_ PCI1 MEM512M * 0xc000_0xc00f_ FPGA1M + * 0xc800_0xcbff_ LIME64M * 0xe000_0xe00f_ CCSR1M (mapped by CCSRBAR) * 0xe200_0xe2ff_ PCI1 IO 16M * 0xfc00_0x_ FLASH 64M @@ -48,11 +49,12 @@ struct law_entry law_table[] = { SET_LAW(CFG_DDR_SDRAM_BASE, LAW_SIZE_512M, LAW_TRGT_IF_DDR), SET_LAW(CFG_PCI1_MEM_PHYS, LAW_SIZE_512M, LAW_TRGT_IF_PCI), - SET_LAW(CFG_LBC_FLASH_BASE, LAW_SIZE_128M, LAW_TRGT_IF_LBC), + SET_LAW(CFG_LBC_FLASH_BASE, LAW_SIZE_64M, LAW_TRGT_IF_LBC), SET_LAW(CFG_PCI1_IO_PHYS, LAW_SIZE_16M, LAW_TRGT_IF_PCI), #if defined(CFG_FPGA_BASE) SET_LAW(CFG_FPGA_BASE, LAWAR_SIZE_1M, LAW_TRGT_IF_LBC), #endif + SET_LAW(CFG_LIME_BASE, LAWAR_SIZE_64M, LAW_TRGT_IF_LBC), }; int num_law_entries = ARRAY_SIZE(law_table); diff --git a/board/socrates/socrates.c b/board/socrates/socrates.c index 63694a7..73a2d9d 100644 --- a/board/socrates/socrates.c +++ b/board/socrates/socrates.c @@ -173,6 +173,12 @@ void local_bus_init (void) /* Init UPMA for FPGA access */ out_be32 (lbc-mamr, 0x0); /* Use a customer-supplied value */ upmconfig (UPMA, (uint *)UPMTableA, sizeof(UPMTableA)/sizeof(int)); + + if (getenv(lime)) { + /* Init UPMB for Lime controller access */ + out_be32 (lbc-mbmr, 0x40); /* Use a customer-supplied value */ + upmconfig (UPMB, (uint *)UPMTableB, sizeof(UPMTableB)/sizeof(int)); + } } #if defined(CONFIG_PCI) @@ -239,6 +245,14 @@ ft_board_setup(void *blob, bd_t *bd) val[i++] = gd-bd-bi_flashstart; val[i++] = gd-bd-bi_flashsize; + if (getenv(lime)) { + /* Fixup LIME mapping */ + val[i++] = 2; /* chip select number */ + val[i++] = 0; /* always 0 */ + val[i++] = CFG_LIME_BASE; + val[i++] = CFG_LIME_SIZE; + } + /* Fixup FPGA mapping */ val[i++] = 3; /* chip select number */ val[i++] = 0; /* always 0 */ @@ -252,3 +266,187 @@ ft_board_setup(void *blob, bd_t *bd) fdt_strerror(rc)); } #endif /* defined(CONFIG_OF_LIBFDT) defined(CONFIG_OF_BOARD_SETUP) */ + +#include i2c.h +#include mb862xx.h +#include video_fb.h + +#define CFG_LIME_SRST ((CFG_LIME_BASE) + 0x01FC002C) +#define CFG_LIME_CCF ((CFG_LIME_BASE) + 0x01FC0038) +#define CFG_LIME_MMR ((CFG_LIME_BASE) + 0x01FCFFFC) +/* Lime clock frequency */ +#define CFG_LIME_CLK_100MHZ0x0 +#define CFG_LIME_CLK_133MHZ0x1 +/* SDRAM parameter */ +#define CFG_LIME_MMR_VALUE 0x4157BA63 + +#define DISPLAY_WIDTH 800 +#define DISPLAY_HEIGHT 480 +#define DEFAULT_BRIGHTNESS 25 +#define BACKLIGHT_ENABLE (1 31) + +extern GraphicDevice mb862xx; + +static const gdc_regs init_regs [] = +{ + {0x0100, 0x00010f00}, + {0x0020, 0x801901df}, + {0x0024, 0x}, + {0x0028, 0x}, + {0x002c, 0x}, + {0x0110, 0x}, + {0x0114, 0x}, + {0x0118, 0x01df0320}, + {0x0004, 0x041f}, + {0x0008, 0x031f031f}, + {0x000c, 0x017f0349}, + {0x0010, 0x020c}, + {0x0014, 0x01df01e9}, + {0x0018, 0x}, + {0x001c, 0x01e00320}, + {0x0100, 0x80010f00}, + {0x0, 0x0} +}; + +const gdc_regs *board_get_regs (void) +{ + return init_regs; +} + +/* Returns Lime base address */ +unsigned int board_video_init (void) +{ + + if (!getenv(lime)) + return 0; + + /* +*
[U-Boot] unassigned-patches/22: [PATCH] Removed hardcoded MxMR loop value from upmconfig() for MPC85xx.
Signed-off-by: Sergei Poselenov [EMAIL PROTECTED] --- Added to GNATS database as unassigned-patches/22 Responsible:patch-coord Message-Id: [EMAIL PROTECTED] In-Reply-To:[EMAIL PROTECTED] References: [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] Patch-Date: Fri Aug 15 15:42:11 +0200 2008 --- cpu/mpc85xx/cpu.c | 16 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cpu/mpc85xx/cpu.c b/cpu/mpc85xx/cpu.c index bde8e56..eb041bb 100644 --- a/cpu/mpc85xx/cpu.c +++ b/cpu/mpc85xx/cpu.c @@ -288,16 +288,16 @@ int dma_xfer(void *dest, uint count, void *src) { return dma_check(); } #endif + /* - * Configures a UPM. Currently, the loop fields in MxMR (RLF, WLF and TLF) - * are hardcoded as 1.size is the number or entries, not a sizeof. + * Configures a UPM. The function requires the respective MxMR to be set + * before calling this function. size is the number or entries, not a sizeof. */ void upmconfig (uint upm, uint * table, uint size) { int i, mdr, mad, old_mad = 0; volatile u32 *mxmr; volatile ccsr_lbc_t *lbc = (void *)(CFG_MPC85xx_LBC_ADDR); - int loopval = 0x4440; volatile u32 *brp,*orp; volatile u8* dummy = NULL; int upmmask; @@ -325,8 +325,8 @@ void upmconfig (uint upm, uint * table, uint size) i++, brp += 2, orp += 2) { /* Look for a valid BR with selected UPM */ - if ((in_be32(brp) (BR_V | upmmask)) == (BR_V | upmmask)) { - dummy = (volatile u8*)(in_be32(brp) BR_BA_SHIFT); + if ((in_be32(brp) (BR_V | BR_MSEL)) == (BR_V | upmmask)) { + dummy = (volatile u8*)(in_be32(brp) BR_BA); break; } } @@ -338,7 +338,7 @@ void upmconfig (uint upm, uint * table, uint size) for (i = 0; i size; i++) { /* 1 */ - out_be32(mxmr, loopval | 0x1000 | i); /* OP_WRITE */ + out_be32(mxmr, (in_be32(mxmr) 0x4fc0) | MxMR_OP_WARR | i); /* 2 */ out_be32(lbc-mdr, table[i]); /* 3 */ @@ -347,11 +347,11 @@ void upmconfig (uint upm, uint * table, uint size) *(volatile u8 *)dummy = 0; /* 5 */ do { - mad = in_be32(mxmr) 0x3f; + mad = in_be32(mxmr) MxMR_MAD_MSK; } while (mad = old_mad !(!mad i == (size-1))); old_mad = mad; } - out_be32(mxmr, loopval); /* OP_NORMAL */ + out_be32(mxmr, (in_be32(mxmr) 0x4fc0) | MxMR_OP_NORM); } #if defined(CONFIG_TSEC_ENET) || defined(CONFIGMPC85XX_FEC) -- 1.5.6.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] unassigned-patches/27: [PATCH] 85xx: Socrates: Major code update.
- Update the local bus ranges in the FDT for Linux for the various devices connected to the local bus via chip-select. - Set the LCRR_DBYP bit in the LCRR for local bus frequencies lower than 66 MHz and uses I/O accessor functions consequently. - UPM data update. - Update of default environment and configuration. Use I2C multibus as we do have two I2C buses. Also enable sdram and ext2 commands. Signed-off-by: Wolfgang Grandegger [EMAIL PROTECTED] Signed-off-by: Sergei Poselenov [EMAIL PROTECTED] Signed-off-by: Detlev Zundel [EMAIL PROTECTED] --- Added to GNATS database as unassigned-patches/27 Responsible:patch-coord Message-Id: [EMAIL PROTECTED] In-Reply-To:[EMAIL PROTECTED] References: [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] Patch-Date: Fri Aug 15 15:42:12 +0200 2008 --- board/socrates/socrates.c | 82 +++- board/socrates/upm_table.h | 32 ++-- include/configs/socrates.h | 110 +++- 3 files changed, 132 insertions(+), 92 deletions(-) diff --git a/board/socrates/socrates.c b/board/socrates/socrates.c index d791f11..63694a7 100644 --- a/board/socrates/socrates.c +++ b/board/socrates/socrates.c @@ -37,9 +37,8 @@ #include fdt_support.h #include asm/io.h -#if defined(CFG_FPGA_BASE) #include upm_table.h -#endif + DECLARE_GLOBAL_DATA_PTR; extern flash_info_t flash_info[]; /* FLASH chips info */ @@ -50,6 +49,7 @@ ulong flash_get_size (ulong base, int banknum); int checkboard (void) { volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR); + char *src; int f; char *s = getenv(serial#); @@ -79,10 +79,6 @@ int checkboard (void) * Initialize local bus. */ local_bus_init (); -#if defined(CFG_FPGA_BASE) - /* Init UPMA for FPGA access */ - upmconfig(UPMA, (uint *)UPMTableA, sizeof(UPMTableA)/sizeof(int)); -#endif return 0; } @@ -149,15 +145,34 @@ int misc_init_r (void) */ void local_bus_init (void) { - volatile ccsr_lbc_t *lbc = (void *)(CFG_MPC85xx_LBC_ADDR); volatile ccsr_local_ecm_t *ecm = (void *)(CFG_MPC85xx_ECM_ADDR); + sys_info_t sysinfo; + uint clkdiv; + uint lbc_mhz; + uint lcrr = CFG_LBC_LCRR; + + get_sys_info (sysinfo); + clkdiv = lbc-lcrr 0x0f; + lbc_mhz = sysinfo.freqSystemBus / 100 / clkdiv; + + /* Disable PLL bypass for Local Bus Clock = 66 MHz */ + if (lbc_mhz = 66) + lcrr = ~LCRR_DBYP; /* DLL Enabled */ + else + lcrr |= LCRR_DBYP; /* DLL Bypass */ + + out_be32 (lbc-lcrr, lcrr); + asm (sync;isync;msync); - lbc-ltesr = 0x;/* Clear LBC error interrupts */ - lbc-lteir = 0x;/* Enable LBC error interrupts */ - ecm-eedr = 0x; /* Clear ecm errors */ - ecm-eeer = 0x; /* Enable ecm errors */ + out_be32 (lbc-ltesr, 0x); /* Clear LBC error interrupts */ + out_be32 (lbc-lteir, 0x); /* Enable LBC error interrupts */ + out_be32 (ecm-eedr, 0x); /* Clear ecm errors */ + out_be32 (ecm-eeer, 0x); /* Enable ecm errors */ + /* Init UPMA for FPGA access */ + out_be32 (lbc-mamr, 0x0); /* Use a customer-supplied value */ + upmconfig (UPMA, (uint *)UPMTableA, sizeof(UPMTableA)/sizeof(int)); } #if defined(CONFIG_PCI) @@ -197,9 +212,14 @@ void pci_init_board (void) #ifdef CONFIG_BOARD_EARLY_INIT_R int board_early_init_r (void) { -#ifdef CONFIG_PS2MULT - ps2mult_early_init(); -#endif /* CONFIG_PS2MULT */ + volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR); + + /* set and reset the GPIO pin 2 which will reset the W83782G chip */ + out_8((unsigned char*)gur-gpoutdr, 0x3F ); + out_be32((unsigned int*)gur-gpiocr, 0x200 ); /* enable GPOut */ + udelay(200); + out_8( (unsigned char*)gur-gpoutdr, 0x1F ); + return (0); } #endif /* CONFIG_BOARD_EARLY_INIT_R */ @@ -208,31 +228,27 @@ int board_early_init_r (void) void ft_board_setup(void *blob, bd_t *bd) { - u32 val[4]; - int rc; + u32 val[12]; + int rc, i = 0; ft_cpu_setup(blob, bd); - /* Fixup NOR mapping */ - val[0] = 0; /* chip select number */ - val[1] = 0; /* always 0 */ - val[2] = gd-bd-bi_flashstart; - val[3] = gd-bd-bi_flashsize; + /* Fixup NOR FLASH mapping */ + val[i++] = 0; /* chip select number */ + val[i++] = 0; /* always 0 */ + val[i++] = gd-bd-bi_flashstart; + val[i++] = gd-bd-bi_flashsize; - rc = fdt_find_and_setprop(blob, /localbus, ranges, - val, sizeof(val), 1); - if (rc) -
[U-Boot] onenand compile failures w/top of tree on ARM
When trying to build the apollon_config w/top of tree I get: arm-linux-gcc -g -Os -fno-strict-aliasing -fno-common -ffixed-r8 - msoft-float -D__KERNEL__ -DTEXT_BASE=0x80e8 -I/tmp/u-boot-85xx/ include -fno-builtin -ffreestanding -nostdinc -isystem /local/opt/eldk/ 4.1/arm-linux-x86/usr/bin/../lib/gcc/arm-linux/4.0.0/include -pipe - DCONFIG_ARM -D__ARM__ -march=armv5 -mabi=apcs-gnu -mno-thumb-interwork -Wall -Wstrict-prototypes -c -o onenand_base.o onenand_base.c onenand_base.c: In function 'onenand_bufferram_offset': onenand_base.c:331: error: 'struct mtd_info' has no member named 'oobblock' onenand_base.c: In function 'onenand_read_ecc': onenand_base.c:541: error: 'struct mtd_info' has no member named 'oobblock' onenand_base.c:543: error: 'struct mtd_info' has no member named 'oobblock' onenand_base.c:544: error: 'struct mtd_info' has no member named 'oobblock' onenand_base.c:545: error: 'struct mtd_info' has no member named 'oobblock' onenand_base.c:549: error: 'struct mtd_info' has no member named 'oobblock' onenand_base.c: In function 'onenand_read_oob': onenand_base.c:664: error: 'struct mtd_info' has no member named 'oobblock' onenand_base.c: In function 'onenand_write_ecc': onenand_base.c:749: error: 'struct mtd_info' has no member named 'oobblock' onenand_base.c:749: error: 'struct mtd_info' has no member named 'oobblock' onenand_base.c:760: error: 'struct mtd_info' has no member named 'oobblock' onenand_base.c:762: error: 'struct mtd_info' has no member named 'oobblock' onenand_base.c:768: error: 'struct mtd_info' has no member named 'oobblock' onenand_base.c: In function 'onenand_probe': onenand_base.c:1212: error: 'struct mtd_info' has no member named 'oobblock' onenand_base.c:1214: error: 'struct mtd_info' has no member named 'oobblock' onenand_base.c:1216: error: 'struct mtd_info' has no member named 'oobblock' onenand_base.c:1219: error: 'struct mtd_info' has no member named 'oobblock' onenand_base.c:1221: error: 'struct mtd_info' has no member named 'oobblock' onenand_base.c:1243: error: 'struct mtd_info' has no member named 'read_ecc' onenand_base.c:1244: error: 'struct mtd_info' has no member named 'write_ecc' onenand_base.c:1245: warning: assignment from incompatible pointer type onenand_base.c:1246: warning: assignment from incompatible pointer type make[1]: *** [onenand_base.o] Error 1 make[1]: Leaving directory `/tmp/u-boot-85xx/drivers/mtd/onenand' make: *** [drivers/mtd/onenand/libonenand.a] Error 2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] mpc85xx/22
Synopsis: [PATCH] Removed hardcoded MxMR loop value from upmconfig() for MPC85xx. Responsible-Changed-From-To: patch-coord-gu-mpc85xx Responsible-Changed-By: dzu Responsible-Changed-When: Fri, 15 Aug 2008 15:53:11 +0200 Responsible-Changed-Why: Assign to custodian ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] net/24
Synopsis: [PATCH] PHY: Add support for the M88E1121R Marvell chip. Responsible-Changed-From-To: patch-coord-gu-net Responsible-Changed-By: dzu Responsible-Changed-When: Fri, 15 Aug 2008 15:53:42 +0200 Responsible-Changed-Why: Assign to custodian ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] common/23
Synopsis: [PATCH] RX 8025 RTC: analyze 12/24-hour mode flag in rtc_get(). Responsible-Changed-From-To: patch-coord-wd Responsible-Changed-By: dzu Responsible-Changed-When: Fri, 15 Aug 2008 16:23:20 +0200 Responsible-Changed-Why: Assign to prokect lead ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] onenand compile failures w/top of tree on ARM
On Fri, Aug 15, 2008 at 08:51:45AM -0500, Kumar Gala wrote: When trying to build the apollon_config w/top of tree I get: What SHA-1? arm-linux-gcc -g -Os -fno-strict-aliasing -fno-common -ffixed-r8 - msoft-float -D__KERNEL__ -DTEXT_BASE=0x80e8 -I/tmp/u-boot-85xx/ include -fno-builtin -ffreestanding -nostdinc -isystem /local/opt/eldk/ 4.1/arm-linux-x86/usr/bin/../lib/gcc/arm-linux/4.0.0/include -pipe - DCONFIG_ARM -D__ARM__ -march=armv5 -mabi=apcs-gnu -mno-thumb-interwork -Wall -Wstrict-prototypes -c -o onenand_base.o onenand_base.c onenand_base.c: In function 'onenand_bufferram_offset': onenand_base.c:331: error: 'struct mtd_info' has no member named 'oobblock' onenand_base.c: In function 'onenand_read_ecc': onenand_base.c:541: error: 'struct mtd_info' has no member named 'oobblock' onenand_base.c:543: error: 'struct mtd_info' has no member named 'oobblock' onenand_base.c:544: error: 'struct mtd_info' has no member named 'oobblock' onenand_base.c:545: error: 'struct mtd_info' has no member named ...etc. This should be fixed by d438d50848e9425286e5fb0493e0affb5a0b1e1b. onenand_base.c:1245: warning: assignment from incompatible pointer type onenand_base.c:1246: warning: assignment from incompatible pointer type This needs updating for the new API, though nothing should be calling onenand via this interface yet. -Scott ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] coldfire: fix CFI drivers activation with new macro
rename CFG_FLASH_CFI_DRIVER to CONFIG_FLASH_CFI_DRIVER Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD [EMAIL PROTECTED] diff --git a/include/configs/M5253DEMO.h b/include/configs/M5253DEMO.h index b91d7d6..f2c2317 100644 --- a/include/configs/M5253DEMO.h +++ b/include/configs/M5253DEMO.h @@ -206,7 +206,7 @@ * Amd/Atmel use 0x30 for sector erase, SST use 0x50. * 0x30 is block erase in SST */ -# define CFG_FLASH_CFI_DRIVER 1 +# define CONFIG_FLASH_CFI_DRIVER 1 # define CFG_FLASH_SIZE 0x80 # define CFG_FLASH_CFI_WIDTH FLASH_CFI_16BIT # define CONFIG_FLASH_CFI_LEGACY diff --git a/include/configs/ml507.h b/include/configs/ml507.h index c653a51..f8cd499 100644 --- a/include/configs/ml507.h +++ b/include/configs/ml507.h @@ -110,7 +110,7 @@ #defineCFG_FLASH_BASE XPAR_FLASH_MEM0_BASEADDR #defineCFG_FLASH_SIZE (32*1024*1024) #defineCFG_FLASH_CFI 1 -#defineCFG_FLASH_CFI_DRIVER1 +#defineCONFIG_FLASH_CFI_DRIVER 1 #defineCFG_FLASH_EMPTY_INFO1 #defineCFG_MAX_FLASH_BANKS 1 #defineCFG_MAX_FLASH_SECT 259 diff --git a/include/configs/redwood.h b/include/configs/redwood.h index 32ed574..78ca1b3 100644 --- a/include/configs/redwood.h +++ b/include/configs/redwood.h @@ -165,7 +165,7 @@ * FLASH related *--*/ #define CFG_FLASH_CFI /* The flash is CFI compatible */ -#define CFG_FLASH_CFI_DRIVER/* Use common CFI driver*/ +#define CONFIG_FLASH_CFI_DRIVER/* Use common CFI driver*/ #define CFG_FLASH_CFI_AMD_RESET 1 /* Use AMD (Spansion) reset cmd */ #define CFG_MAX_FLASH_BANKS3 /* number of banks */ -- 1.5.6.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-boot-Users][GIT PULL] Please pull coldfire tree
Jean, I'll send patch for your new boards Thank you. I totally forgot about this one. Regards, TsiChung ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 0/7 v7] SMDK6400 support
Hi On Thu, Aug 14, 2008 at 10:08:00PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote: Hi Harald, Could you take a look on this patchset? I will do some review over the weekend. Please note that there is almost no technical relationship of the s3c64xx with s3c24xx (at least anything != 2460). Cheers, -- - Harald Welte [EMAIL PROTECTED] http://laforge.gnumonks.org/ Privacy in residential applications is a desirable marketing option. (ETSI EN 300 175-7 Ch. A6) signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [RFC] setting pio modes for IDE devices
Dear Steven A. Falco, In message [EMAIL PROTECTED] you wrote: I realized that I should be checking to see if word 163 is applicable to the ATA device in question. To do that, I need to call ata_id_is_cfa() from libata.h. However, libata.h conflicts with ata.h because of duplicate enum values. Therefore, this respin of the proposed patch deletes the duplicate enums from ata.h and instead includes libata.h to supply the enums. Then, I can call ata_id_is_cfa() and more accurately detect PIO 5 and 6. I believe cleaning up ata.h is a good thing, because duplicating the enums in both places invites them to get out of sync. It is, but can you please split this into two independent patches? Thanks in advance. 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: [EMAIL PROTECTED] A father doesn't destroy his children. -- Lt. Carolyn Palamas, Who Mourns for Adonais?, stardate 3468.1. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/3] setting pio modes for IDE devices
Wolfgang Denk wrote: Dear Steven A. Falco, In message [EMAIL PROTECTED] you wrote: I realized that I should be checking to see if word 163 is applicable to the ATA device in question. To do that, I need to call ata_id_is_cfa() from libata.h. However, libata.h conflicts with ata.h because of duplicate enum values. Therefore, this respin of the proposed patch deletes the duplicate enums from ata.h and instead includes libata.h to supply the enums. Then, I can call ata_id_is_cfa() and more accurately detect PIO 5 and 6. I believe cleaning up ata.h is a good thing, because duplicating the enums in both places invites them to get out of sync. It is, but can you please split this into two independent patches? Thanks in advance. Best regards, Wolfgang Denk [PATCH 2/3] Add a hook to allow board-specific PIO mode setting. This patch adds a hook whereby a board-specific routine can be called to configure hardware for a PIO mode. The prototype for the board-specific routine is: int inline ide_set_piomode(int pio_mode) ide_set_piomode should be prepared to configure hardware for a pio_mode between 0 and 6, inclusive. It should return 0 on success or 1 on failure. Signed-off-by: Steven A. Falco [EMAIL PROTECTED] --- common/cmd_ide.c | 46 ++ include/ata.h|4 +++- 2 files changed, 49 insertions(+), 1 deletions(-) diff --git a/common/cmd_ide.c b/common/cmd_ide.c index d6ba79f..0691007 100644 --- a/common/cmd_ide.c +++ b/common/cmd_ide.c @@ -543,6 +543,16 @@ __ide_inb(int dev, int port) unsigned char inline ide_inb(int dev, int port) __attribute__((weak, alias(__ide_inb))); +#ifdef CONFIG_TUNE_PIO +int inline +__ide_set_piomode(int pio_mode) +{ + return 0; +} +int inline ide_set_piomode(int pio_mode) + __attribute__((weak, alias(__ide_set_piomode))); +#endif + void ide_init (void) { @@ -1053,6 +1063,10 @@ static void ide_ident (block_dev_desc_t *dev_desc) int do_retry = 0; #endif +#ifdef CONFIG_TUNE_PIO + int pio_mode; +#endif + #if 0 int mode, cycle_time; #endif @@ -1168,6 +1182,38 @@ static void ide_ident (block_dev_desc_t *dev_desc) else dev_desc-removable = 0; +#ifdef CONFIG_TUNE_PIO + /* Mode 0 - 2 only, are directly determined by word 51. */ + pio_mode = iop-tPIO; + if (pio_mode 2) { + printf(WARNING: Invalid PIO (word 51 = %d).\n, pio_mode); + pio_mode = 0; /* Force it to dead slow, and hope for the best... */ + } + + /* Any CompactFlash Storage Card that supports PIO mode 3 or above +* shall set bit 1 of word 53 to one and support the fields contained +* in words 64 through 70. +*/ + if (iop-field_valid 0x02) { + /* Mode 3 and above are possible. Check in order from slow +* to fast, so we wind up with the highest mode allowed. +*/ + if (iop-eide_pio_modes 0x01) + pio_mode = 3; + if (iop-eide_pio_modes 0x02) + pio_mode = 4; + if (ata_id_is_cfa((u16 *)iop)) { + if ((iop-cf_advanced_caps 0x07) == 0x01) + pio_mode = 5; + if ((iop-cf_advanced_caps 0x07) == 0x02) + pio_mode = 6; + } + } + + /* System-specific, depends on bus speeds, etc. */ + ide_set_piomode(pio_mode); +#endif /* CONFIG_TUNE_PIO */ + #if 0 /* * Drive PIO mode autoselection diff --git a/include/ata.h b/include/ata.h index b669423..2396769 100644 --- a/include/ata.h +++ b/include/ata.h @@ -236,7 +236,9 @@ typedef struct hd_driveid { unsigned short words130_155[26];/* reserved vendor words 130-155 */ unsigned short word156; unsigned short words157_159[3];/* reserved vendor words 157-159 */ - unsigned short words160_255[95];/* reserved words 160-255 */ + unsigned short words160_162[3];/* reserved words 160-162 */ + unsigned short cf_advanced_caps; + unsigned short words164_255[92];/* reserved words 164-255 */ } hd_driveid_t; -- 1.5.5.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] mod_i2c_mem() bugfix
The last used chip, address, and address length were not being stored for the imm and imn commands. Signed-off-by: Peter Tyser [EMAIL PROTECTED] --- common/cmd_i2c.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c index aac7e9a..91bf25b 100644 --- a/common/cmd_i2c.c +++ b/common/cmd_i2c.c @@ -529,9 +529,9 @@ mod_i2c_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char *argv[]) } } while (nbytes); - chip = i2c_mm_last_chip; - addr = i2c_mm_last_addr; - alen = i2c_mm_last_alen; + i2c_mm_last_chip = chip; + i2c_mm_last_addr = addr; + i2c_mm_last_alen = alen; return 0; } -- 1.5.4.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] Replace references to extern console_buffer with a function call
Dear Peter Tyser, what is the purpose of this patch? As far as I can see we gain nothing, but we lose on memory footpint. I guess there is some problem you're trying to fix, but you did not mention it? 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: [EMAIL PROTECTED] The use of COBOL cripples the mind; its teaching should, therefore, be regarded as a criminal offence. -- Edsger W. Dijkstra, SIGPLAN Notices, Volume 17, Number 5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] Replace references to extern console_buffer with a function call
what is the purpose of this patch? As far as I can see we gain nothing, but we lose on memory footpint. I guess there is some problem you're trying to fix, but you did not mention it? I've added a basic debug serial console which relies on this patch. The debug console is a simple command prompt which allows the user to issue commands before relocating to SDRAM. We've found this feature very useful for operations such as initially programming SPD data, debugging hardware issues (SDRAM/I2C). I'll submit the debug console patches shortly. I'm not sure if the debug console will be accepted to mainline, but I think this patch alone is an improvement over the current implementation of using a global string and multiple external console_buffer references. I've always thought global variables should be avoided if there is a reasonable alternative Best, Peter ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] [RFC] Early serial debug console
The following 3 patches enable a basic serial console while U-Boot is still executing out of flash. When enabled, the user is dropped to the debug console when an error occurs in a function in the init_sequence[]. The user can also drop to a debug console by pressing ctrl-c during bootup. Many commands do not work since interrupts aren't enabled (no sleeping), the bss segment hasn't been zeroed out, and the data section can't be written to. The i2c and memory commands were updated to work while executing from flash to aide in programming SPD's and debugging SDRAM issues. The code has been tested on an mpc8548 and mpc8572 SBC. An example session is pasted below where the SPD has been corrupted. These patches assume that the previous 2 patches sent out (mod_i2c_mem() bugfix and Replace references to extern console_buffer with a function call have been applied. Does anyone have suggestions/comments? Any chance this feature could make it into mainline U-Boot? Thanks for any criticism/comments, Peter Sample output with corrupted SPD: U-Boot 1.3.4-00113-g8b3bc07 (Aug 15 2008 - 14:26:37) CPU: 8572E, Version: 1.0, (0x80e80010) Core: E500, Version: 3.0, (0x80210030) Clock Configuration: CPU0:1500 MHz, CPU1:1500 MHz, CCB: 600 MHz, DDR: 300 MHz (600 MT/s data rate) (Synchronous), LBC: 75 MHz L1:D-cache 32 kB enabled I-cache 32 kB enabled Board: X-ES XPedite5370 3U VPX SBC I2C: ready DRAM: DDR: No DIMMs found. *** failed *** ERROR: init function at fff894bc failed (debug) = imm 54 200.2 0200: 00 ? 80 0201: 00 ? 8 0202: 00 ? 8 0203: 0e ? . (debug) = reset U-Boot 1.3.4-00113-g8b3bc07 (Aug 15 2008 - 14:26:37) SPD fixed, board boots... ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] [RFC] Early serial debug console
On Aug 15, 2008, at 2:16 PM, Peter Tyser wrote: Does anyone have suggestions/comments? Any chance this feature could make it into mainline U-Boot? Are going to take on the challenge of making this work with processors that use CPM/QE devices for serial ports? :-) Thanks. -- Dan ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/3] [RFC] Add support for early serial debug console
I understand what you are trying todo, but I think it doesn't work. You are invoking a numer of pretty complex functions (like readline() and run_command() and ...) which in turn ionvoke other functions etc. - all of them written in C with theassumption that they have a valid C runtime environment, which is simply not the case before relocation to RAM. I attempted to account for this fact. I followed the program flow of run_command() and readline() in particular looking for global data writes and bss reads. For the instances where global data was being written, I made it conditional on (gd-flags GD_FLG_RELOC). I also forced some variables to reside in the data section so that they could be read while executing from flash (__attribute__ ((section(.data. I also monitored the flash WE pin while executing the memory and i2c commands to make sure that the data section (which is still in flash) was not being written to. There is a chance that uninitialized data is being read from the bss, but I didn't see any and the board functions fine:) And your patch seems to be inclomplete, it does not apply. Hmm, I built the patches off 07efc9e321619c3dec213310c32e011aa6f02783 with the 2 patches I just submitted also applied (mod_i2c_mem() bugfix and Replace references to extern console_buffer with a function call). What error are you seeing while applying it? Some parts seem to be missing (like the necessary changes to eliminate accesses to the console_buffer[] in BSS). I don't follow. The console_buffer_addr() conditionally places the console_buffer in SDRAM if U-Boot has relocated, or at CFG_DEBUG_CONSOLE_ADDR if executing from flash. That's why the Replace references to extern console_buffer with a function call patch I just submitted was necessary. But in any case - You make a few commands usable, and the behaviour of the remainig undefined. I don't think this is a good idea. I agree that it is hokey that some commands work, some don't. However, the ones that are very useful do work:) The memory test, modify, and display functions as well as the i2c functions work. These few commands allow further diagnosis (and possible fixing) of most board hardware problems that prevent a board from booting. And we pay for this with a log of uglier code (many, many #ifdef's) and increased memory size. Agreed, the code is a bit dirtier, but I think the #ifdefs could be minimized some. For example, the sequence of code in lib_xxx/board.c: for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) { if ((*init_fnc_ptr)() != 0 { #ifdef CONFIG_DEBUG_CONSOLE could be put in 1 file for all architectures to share. In that case, there would only be an additional 4-5 #ifdefs added. The patches themselves aren't all that large. I'm interested to hear what others say, but so far I tend to reject this. Thanks for the feedback, I'm curious what others have to say as well. Let me know if I can provide any additional details. Peter ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] Replace references to extern console_buffer with a function call
I'm not sure if the debug console will be accepted to mainline, but I think this patch alone is an improvement over the current implementation Frankly, I don't think so - it just makes the code bigger for no good use to 99.9% of the users. of using a global string and multiple external console_buffer references. I've always thought global variables should be avoided if there is a reasonable alternative But this is a boot loader, and size matters. I had assumed gcc/ld would be smart enough to optimize the function call away, seeing as there is no conditional code in it. I just tested, and the size was increased by 48 bytes for the MPC8548CDS reference board after applying the patch. Inlining the console_buffer_addr() didn't get rid of the 48 bytes of bloat. I guess this patch's fate will be the same as [RFC] Add support for early serial debug console... Thanks, Peter ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 1/1] Adding bootlimit/bootcount feature for MPC5XXX on TQM5200 Boards
Tested with TQM5200S on STK52XX.200 Board Signed-off-by: Axel Beierlein [EMAIL PROTECTED] --- cpu/mpc5xxx/cpu.c | 20 include/configs/TQM5200.h |1 + include/mpc5xxx.h |1 + 3 files changed, 22 insertions(+), 0 deletions(-) diff --git a/cpu/mpc5xxx/cpu.c b/cpu/mpc5xxx/cpu.c index ace1653..d87f42c 100644 --- a/cpu/mpc5xxx/cpu.c +++ b/cpu/mpc5xxx/cpu.c @@ -135,3 +135,23 @@ void ft_cpu_setup(void *blob, bd_t *bd) #endif } #endif + +#ifdef CONFIG_BOOTCOUNT_LIMIT + +void bootcount_store (ulong a) +{ + volatile ulong *save_addr = (volatile ulong *)(MPC5XXX_CDM_BRDCRMB); + + *save_addr = (BOOTCOUNT_MAGIC 0x) | a; +} + +ulong bootcount_load (void) +{ + volatile ulong *save_addr = (volatile ulong *)(MPC5XXX_CDM_BRDCRMB); + + if ((*save_addr 0x) != (BOOTCOUNT_MAGIC 0x)) + return 0; + else + return (*save_addr 0x); +} +#endif /* CONFIG_BOOTCOUNT_LIMIT */ diff --git a/include/configs/TQM5200.h b/include/configs/TQM5200.h index bfb478a..5fb5f80 100644 --- a/include/configs/TQM5200.h +++ b/include/configs/TQM5200.h @@ -55,6 +55,7 @@ #define CONFIG_PSC_CONSOLE 1 /* console is on PSC1 */ #define CONFIG_BAUDRATE115200 /* ... at 115200 bps */ #define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 } +#define CONFIG_BOOTCOUNT_LIMIT 1 #ifdef CONFIG_FO300 #define CFG_DEVICE_NULLDEV 1 /* enable null device */ diff --git a/include/mpc5xxx.h b/include/mpc5xxx.h index 5d11ef0..0f5bee5 100644 --- a/include/mpc5xxx.h +++ b/include/mpc5xxx.h @@ -137,6 +137,7 @@ /* Clock Distribution Module */ #define MPC5XXX_CDM_JTAGID (MPC5XXX_CDM + 0x) #define MPC5XXX_CDM_PORCFG (MPC5XXX_CDM + 0x0004) +#define MPC5XXX_CDM_BRDCRMB(MPC5XXX_CDM + 0x0008) #define MPC5XXX_CDM_CFG(MPC5XXX_CDM + 0x000c) #define MPC5XXX_CDM_48_FDC (MPC5XXX_CDM + 0x0010) #define MPC5XXX_CDM_SRESET (MPC5XXX_CDM + 0x0020) -- 1.5.4.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot