From 8e585f02f82c17cc66cd229dbf0fd3066bbbf658 Mon Sep 17 00:00:00 2001 From: TsiChung Liew Date: Mon, 18 Jun 2007 13:50:13 -0500 Subject: Added M5329AFEE and M5329BFEE Platforms Added board/freescale/m5329evb, cpu/mcf532x, drivers/net, drivers/serial, immap_5329.h, m5329.h, mcfrtc.h, include/configs/M5329EVB.h, lib_m68k/interrupts.c, and rtc/mcfrtc.c Modified CREDITS, MAKEFILE, Makefile, README, common/cmd_bdinfo.c, common/cmd_mii.c, include/asm-m68k/byteorder.h, include/asm-m68k/fec.h, include/asm-m68k/io.h, include/asm-m68k/mcftimer.h, include/asm-m68k/mcfuart.h, include/asm-m68k/ptrace.h, include/asm-m68k/u-boot.h, lib_m68k/Makefile, lib_m68k/board.c, lib_m68k/time.c, net/eth.c and rtc/Makefile Signed-off-by: TsiChung Liew --- common/cmd_bdinfo.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ common/cmd_mii.c | 2 +- 2 files changed, 54 insertions(+), 1 deletion(-) (limited to 'common') diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index d97c09e88e..9651b30974 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -207,6 +207,59 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return 0; } +#elif defined(CONFIG_M68K) /* M68K */ + +int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +{ + int i; + bd_t *bd = gd->bd; + print_num ("memstart", (ulong)bd->bi_memstart); + print_num ("memsize", (ulong)bd->bi_memsize); + print_num ("flashstart", (ulong)bd->bi_flashstart); + print_num ("flashsize", (ulong)bd->bi_flashsize); + print_num ("flashoffset", (ulong)bd->bi_flashoffset); +#if defined(CFG_INIT_RAM_ADDR) + print_num ("sramstart", (ulong)bd->bi_sramstart); + print_num ("sramsize", (ulong)bd->bi_sramsize); +#endif +#if defined(CFG_MBAR) + print_num ("mbar", bd->bi_mbar_base ); +#endif +#if defined(CFG_CMD_NET) + puts ("ethaddr ="); + for (i=0; i<6; ++i) { + printf ("%c%02X", i ? ':' : ' ', bd->bi_enetaddr[i]); + } + +#if defined(CONFIG_HAS_ETH1) + puts ("\neth1addr ="); + for (i=0; i<6; ++i) { + printf ("%c%02X", i ? ':' : ' ', bd->bi_enet1addr[i]); + } +#endif + +#if defined(CONFIG_HAS_ETH2) + puts ("\neth2addr ="); + for (i=0; i<6; ++i) { + printf ("%c%02X", i ? ':' : ' ', bd->bi_enet2addr[i]); + } +#endif + +#if defined(CONFIG_HAS_ETH3) + puts ("\neth3addr ="); + for (i=0; i<6; ++i) { + printf ("%c%02X", i ? ':' : ' ', bd->bi_enet3addr[i]); + } +#endif + + puts ("\nip_addr = "); + print_IPaddr (bd->bi_ip_addr); +#endif /* CFG_CMD_NET */ + printf ("\nbaudrate = %d bps\n", bd->bi_baudrate); + + return 0; +} + #else /* ! PPC, which leaves MIPS */ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) diff --git a/common/cmd_mii.c b/common/cmd_mii.c index e6595360cb..c3f43d7f46 100644 --- a/common/cmd_mii.c +++ b/common/cmd_mii.c @@ -438,7 +438,7 @@ int do_mii (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) int rcode = 0; char *devname; -#ifdef CONFIG_8xx +#if defined(CONFIG_8xx) || defined(CONFIG_MCF532x) mii_init (); #endif -- cgit v1.2.3 From 10e038932f22ee80ebd53de312531e70e6590a2f Mon Sep 17 00:00:00 2001 From: Thomas Knobloch Date: Fri, 6 Jul 2007 14:58:39 +0200 Subject: [NAND] Bad block skipping for command nboot The old implementation of command nboot does not support reading the image from NAND flash with skipping of bad blocks. The patch implements a new version of the nboot command: by calling nboot.jffs2 from the u-boot command line the command will load the image from NAND flash with respect to bad blocks (by using nand_read_opts()). This is similar to e.g. the NAND read command: "nand read.jffs2 ...". Signed-off-by: Thomas Knobloch Signed-off-by: Stefan Roese --- common/cmd_nand.c | 37 ++++++++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 5 deletions(-) (limited to 'common') diff --git a/common/cmd_nand.c b/common/cmd_nand.c index b011b5e3de..9ef31d456d 100644 --- a/common/cmd_nand.c +++ b/common/cmd_nand.c @@ -476,14 +476,31 @@ static int nand_load_image(cmd_tbl_t *cmdtp, nand_info_t *nand, ulong offset, ulong addr, char *cmd) { int r; - char *ep; + char *ep, *s; ulong cnt; image_header_t *hdr; + int jffs2 = 0; + + s = strchr(cmd, '.'); + if (s != NULL && + (!strcmp(s, ".jffs2") || !strcmp(s, ".e") || !strcmp(s, ".i"))) + jffs2 = 1; printf("\nLoading from %s, offset 0x%lx\n", nand->name, offset); cnt = nand->oobblock; - r = nand_read(nand, offset, &cnt, (u_char *) addr); + if (jffs2) { + nand_read_options_t opts; + memset(&opts, 0, sizeof(opts)); + opts.buffer = (u_char*) addr; + opts.length = cnt; + opts.offset = offset; + opts.quiet = 1; + r = nand_read_opts(nand, &opts); + } else { + r = nand_read(nand, offset, &cnt, (u_char *) addr); + } + if (r) { puts("** Read error\n"); SHOW_BOOT_PROGRESS(-1); @@ -501,8 +518,18 @@ static int nand_load_image(cmd_tbl_t *cmdtp, nand_info_t *nand, print_image_hdr(hdr); cnt = (ntohl(hdr->ih_size) + sizeof (image_header_t)); + if (jffs2) { + nand_read_options_t opts; + memset(&opts, 0, sizeof(opts)); + opts.buffer = (u_char*) addr; + opts.length = cnt; + opts.offset = offset; + opts.quiet = 1; + r = nand_read_opts(nand, &opts); + } else { + r = nand_read(nand, offset, &cnt, (u_char *) addr); + } - r = nand_read(nand, offset, &cnt, (u_char *) addr); if (r) { puts("** Read error\n"); SHOW_BOOT_PROGRESS(-1); @@ -550,7 +577,7 @@ int do_nandboot(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) if (argc > 3) goto usage; if (argc == 3) - addr = simple_strtoul(argv[2], NULL, 16); + addr = simple_strtoul(argv[1], NULL, 16); else addr = CFG_LOAD_ADDR; return nand_load_image(cmdtp, &nand_info[dev->id->num], @@ -605,7 +632,7 @@ usage: U_BOOT_CMD(nboot, 4, 1, do_nandboot, "nboot - boot from NAND device\n", - "[partition] | [[[loadAddr] dev] offset]\n"); + "[.jffs2] [partition] | [[[loadAddr] dev] offset]\n"); #endif /* (CONFIG_COMMANDS & CFG_CMD_NAND) */ -- cgit v1.2.3 From 10aaf716cb0dc6614df54ef78bed5144afd23ef8 Mon Sep 17 00:00:00 2001 From: Andy Fleming Date: Wed, 15 Aug 2007 17:30:56 -0500 Subject: Fix of_data copying for CONFIG_OF_FLAT_TREE-using boards The fix, "Fix where the #ifdef CFG_BOOTMAPSZ is placed" neglected to *also* put the code inside the similar #ifdef for CONFIG_OF_FLAT_TREE. Signed-off-by: Andy Fleming --- common/cmd_bootm.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'common') diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index df1d0380d4..90e3f8b9af 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -987,6 +987,15 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, #endif #endif /* CONFIG_OF_LIBFDT */ #if defined(CONFIG_OF_FLAT_TREE) +#ifdef CFG_BOOTMAPSZ + /* + * The blob must be within CFG_BOOTMAPSZ, + * so we flag it to be copied if it is not. + */ + if (of_flat_tree >= (char *)CFG_BOOTMAPSZ) + of_data = of_flat_tree; +#endif + /* move of_flat_tree if needed */ if (of_data) { ulong of_start, of_len; -- cgit v1.2.3 From 82bd9ee77490588d4da785d75829ca63d0176baf Mon Sep 17 00:00:00 2001 From: Andy Fleming Date: Wed, 15 Aug 2007 20:06:50 -0500 Subject: Fix warnings from of_data copy fix Forgot to cast of_flat_tree to ulong. Signed-off-by: Andy Fleming --- common/cmd_bootm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'common') diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 90e3f8b9af..bcb927fd10 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -932,7 +932,7 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, * so we flag it to be copied if it is not. */ if (of_flat_tree >= (char *)CFG_BOOTMAPSZ) - of_data = of_flat_tree; + of_data = (ulong)of_flat_tree; #endif /* move of_flat_tree if needed */ @@ -993,7 +993,7 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, * so we flag it to be copied if it is not. */ if (of_flat_tree >= (char *)CFG_BOOTMAPSZ) - of_data = of_flat_tree; + of_data = (ulong)of_flat_tree; #endif /* move of_flat_tree if needed */ -- cgit v1.2.3 From d35b508a55508535b6e8445b718585d27df733d3 Mon Sep 17 00:00:00 2001 From: Kim Phillips Date: Wed, 15 Aug 2007 22:29:56 -0500 Subject: fdt: suppress unused variable 'bd' warning Signed-off-by: Kim Phillips --- common/fdt_support.c | 1 - 1 file changed, 1 deletion(-) (limited to 'common') diff --git a/common/fdt_support.c b/common/fdt_support.c index caaa682a4f..175d59eb99 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -46,7 +46,6 @@ struct fdt_header *fdt; int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force) { - bd_t *bd = gd->bd; int nodeoffset; int err; u32 tmp; /* used to set 32 bit integer properties */ -- cgit v1.2.3 From ab77bc547ba561c25ea34457ed17aa0b2f7c2723 Mon Sep 17 00:00:00 2001 From: TsiChungLiew Date: Wed, 15 Aug 2007 15:39:17 -0500 Subject: ColdFire: MCF5329 Update and cleanup Signed-off-by: TsiChungLiew --- common/cmd_bdinfo.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'common') diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index 58ee9f350f..889cff8411 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -225,7 +225,7 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) #if defined(CFG_MBAR) print_num ("mbar", bd->bi_mbar_base ); #endif -#if defined(CFG_CMD_NET) +#if defined(CONFIG_CMD_NET) puts ("ethaddr ="); for (i=0; i<6; ++i) { printf ("%c%02X", i ? ':' : ' ', bd->bi_enetaddr[i]); @@ -239,22 +239,22 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) #endif #if defined(CONFIG_HAS_ETH2) - puts ("\neth2addr ="); - for (i=0; i<6; ++i) { + puts ("\neth2addr ="); + for (i=0; i<6; ++i) { printf ("%c%02X", i ? ':' : ' ', bd->bi_enet2addr[i]); } #endif #if defined(CONFIG_HAS_ETH3) - puts ("\neth3addr ="); - for (i=0; i<6; ++i) { + puts ("\neth3addr ="); + for (i=0; i<6; ++i) { printf ("%c%02X", i ? ':' : ' ', bd->bi_enet3addr[i]); } #endif puts ("\nip_addr = "); print_IPaddr (bd->bi_ip_addr); -#endif /* CFG_CMD_NET */ +#endif /* CONFIG_CMD_NET */ printf ("\nbaudrate = %d bps\n", bd->bi_baudrate); return 0; -- cgit v1.2.3 From 8ae158cd87a4a25722b27835261b6ff0fa2aa6a7 Mon Sep 17 00:00:00 2001 From: TsiChungLiew Date: Thu, 16 Aug 2007 15:05:11 -0500 Subject: ColdFire: Add M54455EVB for MCF5445x Signed-off-by: TsiChungLiew --- common/cmd_bdinfo.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'common') diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index 889cff8411..7686080f35 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -208,24 +208,36 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) } #elif defined(CONFIG_M68K) /* M68K */ +static void print_str(const char *, const char *); int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { int i; bd_t *bd = gd->bd; + char buf[32]; + print_num ("memstart", (ulong)bd->bi_memstart); print_num ("memsize", (ulong)bd->bi_memsize); print_num ("flashstart", (ulong)bd->bi_flashstart); print_num ("flashsize", (ulong)bd->bi_flashsize); print_num ("flashoffset", (ulong)bd->bi_flashoffset); #if defined(CFG_INIT_RAM_ADDR) - print_num ("sramstart", (ulong)bd->bi_sramstart); - print_num ("sramsize", (ulong)bd->bi_sramsize); + print_num ("sramstart", (ulong)bd->bi_sramstart); + print_num ("sramsize", (ulong)bd->bi_sramsize); #endif #if defined(CFG_MBAR) - print_num ("mbar", bd->bi_mbar_base ); + print_num ("mbar", bd->bi_mbar_base); #endif -#if defined(CONFIG_CMD_NET) + print_str ("busfreq", strmhz(buf, bd->bi_busfreq)); +#ifdef CONFIG_PCI + print_str ("pcifreq", strmhz(buf, bd->bi_pcifreq)); +#endif +#ifdef CONFIG_EXTRA_CLOCK + print_str ("flbfreq", strmhz(buf, bd->bi_flbfreq)); + print_str ("inpfreq", strmhz(buf, bd->bi_inpfreq)); + print_str ("vcofreq", strmhz(buf, bd->bi_vcofreq)); +#endif +#if defined(CFG_CMD_NET) puts ("ethaddr ="); for (i=0; i<6; ++i) { printf ("%c%02X", i ? ':' : ' ', bd->bi_enetaddr[i]); @@ -323,7 +335,7 @@ static void print_num(const char *name, ulong value) printf ("%-12s= 0x%08lX\n", name, value); } -#ifdef CONFIG_PPC +#if defined(CONFIG_PPC) || defined(CONFIG_M68K) static void print_str(const char *name, const char *str) { printf ("%-12s= %6s MHz\n", name, str); -- cgit v1.2.3 From 26667b7fa05a8bf2fc65fb9f3230b02b1a10c367 Mon Sep 17 00:00:00 2001 From: Stefan Roese Date: Sat, 18 Aug 2007 14:37:52 +0200 Subject: ColdFire: Fix some remaining problems with CFG_CMD_ Signed-off-by: Stefan Roese --- common/cmd_bdinfo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'common') diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index 7686080f35..ef15a006cd 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -237,7 +237,7 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) print_str ("inpfreq", strmhz(buf, bd->bi_inpfreq)); print_str ("vcofreq", strmhz(buf, bd->bi_vcofreq)); #endif -#if defined(CFG_CMD_NET) +#if defined(CONFIG_CMD_NET) puts ("ethaddr ="); for (i=0; i<6; ++i) { printf ("%c%02X", i ? ':' : ' ', bd->bi_enetaddr[i]); @@ -266,7 +266,7 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) puts ("\nip_addr = "); print_IPaddr (bd->bi_ip_addr); -#endif /* CONFIG_CMD_NET */ +#endif printf ("\nbaudrate = %d bps\n", bd->bi_baudrate); return 0; -- cgit v1.2.3 From f98984cb194bb34dbe1db9429d3b51133af30d07 Mon Sep 17 00:00:00 2001 From: Heiko Schocher Date: Tue, 28 Aug 2007 17:39:14 +0200 Subject: IDE: - make ide_inb () and ide_outb () "weak", so boards can define there own I/O functions. (Needed for the pcs440ep board). - The default I/O Functions are again 8 Bit accesses. - Added CONFIG_CMD_IDE for the pcs440ep Board. Signed-off-by: Heiko Schocher --- common/cmd_ide.c | 51 ++++++++++++++++----------------------------------- 1 file changed, 16 insertions(+), 35 deletions(-) (limited to 'common') diff --git a/common/cmd_ide.c b/common/cmd_ide.c index 89fefed33d..bb064eaa04 100644 --- a/common/cmd_ide.c +++ b/common/cmd_ide.c @@ -31,6 +31,7 @@ #include #include #include +#include #if defined(CONFIG_IDE_8xx_DIRECT) || defined(CONFIG_IDE_PCMCIA) # include @@ -128,8 +129,6 @@ ulong ide_bus_offset[CFG_IDE_MAXBUS] = { }; -#define ATA_CURR_BASE(dev) (CFG_ATA_BASE_ADDR+ide_bus_offset[IDE_BUS(dev)]) - #ifndef CONFIG_AMIGAONEG3SE static int ide_bus_ok[CFG_IDE_MAXBUS]; #else @@ -172,8 +171,8 @@ static uchar ide_wait (int dev, ulong t); #define IDE_SPIN_UP_TIME_OUT 5000 /* 5 sec spin-up timeout */ -static void __inline__ ide_outb(int dev, int port, unsigned char val); -static unsigned char __inline__ ide_inb(int dev, int port); +void inline ide_outb(int dev, int port, unsigned char val); +unsigned char inline ide_inb(int dev, int port); static void input_data(int dev, ulong *sect_buf, int words); static void output_data(int dev, ulong *sect_buf, int words); static void ident_cpy (unsigned char *dest, unsigned char *src, unsigned int len); @@ -805,45 +804,27 @@ set_pcmcia_timing (int pmode) /* ------------------------------------------------------------------------- */ -#if defined(__PPC__) || defined(CONFIG_PXA_PCMCIA) -static void __inline__ -ide_outb(int dev, int port, unsigned char val) +void inline +__ide_outb(int dev, int port, unsigned char val) { debug ("ide_outb (dev= %d, port= 0x%x, val= 0x%02x) : @ 0x%08lx\n", - dev, port, val, (ATA_CURR_BASE(dev)+port)); - - /* Ensure I/O operations complete */ - EIEIO; - *((u16 *)(ATA_CURR_BASE(dev)+CFG_ATA_PORT_ADDR(port))) = val; -} -#else /* ! __PPC__ */ -static void __inline__ -ide_outb(int dev, int port, unsigned char val) -{ - outb(val, ATA_CURR_BASE(dev)+CFG_ATA_PORT_ADDR(port)); + dev, port, val, (ATA_CURR_BASE(dev)+CFG_ATA_PORT_ADDR(port))); + outb(val, (ATA_CURR_BASE(dev)+CFG_ATA_PORT_ADDR(port))); } -#endif /* __PPC__ */ - +void inline ide_outb (int dev, int port, unsigned char val) + __attribute__((weak, alias("__ide_outb"))); -#if defined(__PPC__) || defined(CONFIG_PXA_PCMCIA) -static unsigned char __inline__ -ide_inb(int dev, int port) +unsigned char inline +__ide_inb(int dev, int port) { uchar val; - /* Ensure I/O operations complete */ - EIEIO; - val = *((u16 *)(ATA_CURR_BASE(dev)+CFG_ATA_PORT_ADDR(port))); + val = inb((ATA_CURR_BASE(dev)+CFG_ATA_PORT_ADDR(port))); debug ("ide_inb (dev= %d, port= 0x%x) : @ 0x%08lx -> 0x%02x\n", - dev, port, (ATA_CURR_BASE(dev)+port), val); - return (val); + dev, port, (ATA_CURR_BASE(dev)+CFG_ATA_PORT_ADDR(port)), val); + return val; } -#else /* ! __PPC__ */ -static unsigned char __inline__ -ide_inb(int dev, int port) -{ - return inb(ATA_CURR_BASE(dev)+CFG_ATA_PORT_ADDR(port)); -} -#endif /* __PPC__ */ +unsigned char inline ide_inb(int dev, int port) + __attribute__((weak, alias("__ide_inb"))); #ifdef __PPC__ # ifdef CONFIG_AMIGAONEG3SE -- cgit v1.2.3 From 9bb8b209ed2058a5756ecbeb544c067e44a42aea Mon Sep 17 00:00:00 2001 From: Dirk Behme Date: Mon, 20 Aug 2007 07:09:05 +0200 Subject: Fix compilation error for omap2420h4_config. omap2420h4 switched to cfi, so remove old (already disabled) flash.c and flash_probe() calls in env_flash.c. Signed-off-by: Dirk Behme --- common/env_flash.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'common') diff --git a/common/env_flash.c b/common/env_flash.c index 7a37e550de..eccfb62a3b 100644 --- a/common/env_flash.c +++ b/common/env_flash.c @@ -107,13 +107,6 @@ int env_init(void) ulong addr1 = (ulong)&(flash_addr->data); ulong addr2 = (ulong)&(flash_addr_new->data); -#ifdef CONFIG_OMAP2420H4 - int flash_probe(void); - - if(flash_probe() == 0) - goto bad_flash; -#endif - crc1_ok = (crc32(0, flash_addr->data, ENV_SIZE) == flash_addr->crc); crc2_ok = (crc32(0, flash_addr_new->data, ENV_SIZE) == flash_addr_new->crc); @@ -143,9 +136,6 @@ int env_init(void) gd->env_valid = 2; } -#ifdef CONFIG_OMAP2420H4 -bad_flash: -#endif return (0); } @@ -259,20 +249,12 @@ Done: int env_init(void) { -#ifdef CONFIG_OMAP2420H4 - int flash_probe(void); - - if(flash_probe() == 0) - goto bad_flash; -#endif if (crc32(0, env_ptr->data, ENV_SIZE) == env_ptr->crc) { gd->env_addr = (ulong)&(env_ptr->data); gd->env_valid = 1; return(0); } -#ifdef CONFIG_OMAP2420H4 -bad_flash: -#endif + gd->env_addr = (ulong)&default_environment[0]; gd->env_valid = 0; return (0); -- cgit v1.2.3 From e79021223bc339df655e360645a52c457a74b067 Mon Sep 17 00:00:00 2001 From: Grant Likely Date: Thu, 6 Sep 2007 09:47:40 -0600 Subject: bootm/fdt: Only process the fdt if an fdt address was provided Boards with CONFIG_OF_LIBFDT enabled are not able to boot old-style kernels using the board info structure (instead of passing a device tree) This change allows the old style booting to be used if the fdt argument was not passed to 'bootm'. Signed-off-by: Grant Likely Acked-by: Kim Phillips --- common/cmd_bootm.c | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) (limited to 'common') diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index bcb927fd10..919188f67c 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -962,29 +962,31 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, * Add the chosen node if it doesn't exist, add the env and bd_t * if the user wants it (the logic is in the subroutines). */ - if (fdt_chosen(of_flat_tree, initrd_start, initrd_end, 0) < 0) { - puts ("ERROR: /chosen node create failed - " - "must RESET the board to recover.\n"); - do_reset (cmdtp, flag, argc, argv); - } + if (of_flat_tree) { + if (fdt_chosen(of_flat_tree, initrd_start, initrd_end, 0) < 0) { + puts ("ERROR: /chosen node create failed - " + "must RESET the board to recover.\n"); + do_reset (cmdtp, flag, argc, argv); + } #ifdef CONFIG_OF_HAS_UBOOT_ENV - if (fdt_env(of_flat_tree) < 0) { - puts ("ERROR: /u-boot-env node create failed - " - "must RESET the board to recover.\n"); - do_reset (cmdtp, flag, argc, argv); - } + if (fdt_env(of_flat_tree) < 0) { + puts ("ERROR: /u-boot-env node create failed - " + "must RESET the board to recover.\n"); + do_reset (cmdtp, flag, argc, argv); + } #endif #ifdef CONFIG_OF_HAS_BD_T - if (fdt_bd_t(of_flat_tree) < 0) { - puts ("ERROR: /bd_t node create failed - " - "must RESET the board to recover.\n"); - do_reset (cmdtp, flag, argc, argv); - } + if (fdt_bd_t(of_flat_tree) < 0) { + puts ("ERROR: /bd_t node create failed - " + "must RESET the board to recover.\n"); + do_reset (cmdtp, flag, argc, argv); + } #endif #ifdef CONFIG_OF_BOARD_SETUP - /* Call the board-specific fixup routine */ - ft_board_setup(of_flat_tree, gd->bd); + /* Call the board-specific fixup routine */ + ft_board_setup(of_flat_tree, gd->bd); #endif + } #endif /* CONFIG_OF_LIBFDT */ #if defined(CONFIG_OF_FLAT_TREE) #ifdef CFG_BOOTMAPSZ -- cgit v1.2.3 From 5b729fb3bd98f49855d6bfc657c3fbae95f2adc2 Mon Sep 17 00:00:00 2001 From: Bartlomiej Sieka Date: Tue, 4 Sep 2007 17:31:22 +0200 Subject: Fix do_bootm_linux() so that multi-file images with FDT blob boot. Fix incorrect blob address calculation in do_bootm_linux() that prevents booting the kernel from a multi-file image (kernel + initrd + blob). Also, make minor updates to the U-Boot's output and to the coding style. Signed-off-by: Bartlomiej Sieka --- common/cmd_bootm.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'common') diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 919188f67c..9f5e0b4ee4 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -817,27 +817,32 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int i; /* skip kernel length, initrd length, and terminator */ - of_data = (ulong)(&len_ptr[3]); + of_flat_tree = (char *)(&len_ptr[3]); /* skip any additional image length fields */ for (i=2; len_ptr[i]; ++i) - of_data += 4; + of_flat_tree += 4; /* add kernel length, and align */ - of_data += ntohl(len_ptr[0]); + of_flat_tree += ntohl(len_ptr[0]); if (tail) { - of_data += 4 - tail; + of_flat_tree += 4 - tail; } /* add initrd length, and align */ tail = ntohl(len_ptr[1]) % 4; - of_data += ntohl(len_ptr[1]); + of_flat_tree += ntohl(len_ptr[1]); if (tail) { - of_data += 4 - tail; + of_flat_tree += 4 - tail; } + /* move the blob if it is in flash (set of_data to !null) */ + if (addr2info ((ulong)of_flat_tree) != NULL) + of_data = (ulong)of_flat_tree; + + #if defined(CONFIG_OF_FLAT_TREE) - if (*((ulong *)(of_flat_tree + sizeof(image_header_t))) != OF_DT_HEADER) { + if (*((ulong *)(of_flat_tree)) != OF_DT_HEADER) { #else - if (fdt_check_header(of_flat_tree + sizeof(image_header_t)) != 0) { + if (fdt_check_header (of_flat_tree) != 0) { #endif puts ("ERROR: image is not a fdt - " "must RESET the board to recover.\n"); @@ -845,9 +850,11 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, } #if defined(CONFIG_OF_FLAT_TREE) - if (((struct boot_param_header *)of_data)->totalsize != ntohl(len_ptr[2])) { + if (((struct boot_param_header *)of_flat_tree)->totalsize != + ntohl (len_ptr[2])) { #else - if (be32_to_cpu(fdt_totalsize(of_data)) != ntohl(len_ptr[2])) { + if (be32_to_cpu (fdt_totalsize (of_flat_tree)) != + ntohl(len_ptr[2])) { #endif puts ("ERROR: fdt size != image size - " "must RESET the board to recover.\n"); @@ -957,6 +964,7 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, "must RESET the board to recover.\n"); do_reset (cmdtp, flag, argc, argv); } + puts ("OK\n"); } /* * Add the chosen node if it doesn't exist, add the env and bd_t @@ -1013,6 +1021,7 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, printf (" Loading Device Tree to %08lx, end %08lx ... ", of_start, of_start + of_len - 1); memmove ((void *)of_start, (void *)of_data, of_len); + puts ("OK\n"); } /* * Create the /chosen node and modify the blob with board specific -- cgit v1.2.3 From 80172c6181c912fbb34ea3ba0c22b232b419b47f Mon Sep 17 00:00:00 2001 From: stefano babic Date: Thu, 30 Aug 2007 22:57:04 +0200 Subject: PXA270: Add support for multiple serial ports. This patch adds support for multiple serial ports to the PXA target. FFUART, BTUART and STUART are supported. Signed-off-by: Stefano Babic --- common/serial.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'common') diff --git a/common/serial.c b/common/serial.c index 13e9f30e41..dee1cc0ab9 100644 --- a/common/serial.c +++ b/common/serial.c @@ -32,7 +32,7 @@ DECLARE_GLOBAL_DATA_PTR; static struct serial_device *serial_devices = NULL; static struct serial_device *serial_current = NULL; -#ifndef CONFIG_LWMON +#if !defined(CONFIG_LWMON) && !defined(CONFIG_PXA27X) struct serial_device *default_serial_console (void) { #if defined(CONFIG_8xx_CONS_SMC1) || defined(CONFIG_8xx_CONS_SMC2) @@ -65,7 +65,7 @@ struct serial_device *default_serial_console (void) } #endif -static int serial_register (struct serial_device *dev) +int serial_register (struct serial_device *dev) { dev->init += gd->reloc_off; dev->setbrg += gd->reloc_off; @@ -110,6 +110,15 @@ void serial_initialize (void) serial_register(&eserial4_device); #endif #endif /* CFG_NS16550_SERIAL */ +#if defined (CONFIG_FFUART) + serial_register(&serial_ffuart_device); +#endif +#if defined (CONFIG_BTUART) + serial_register(&serial_btuart_device); +#endif +#if defined (CONFIG_STUART) + serial_register(&serial_stuart_device); +#endif serial_assign (default_serial_console ()->name); } -- cgit v1.2.3 From a7d7eca791a37f452c9da10fef4b31dd7aa9a622 Mon Sep 17 00:00:00 2001 From: Grant Likely Date: Fri, 7 Sep 2007 09:25:07 -0600 Subject: Bugfix: make bootm+libfdt compile on boards with no flash Signed-off-by: Grant Likely --- common/cmd_bootm.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'common') diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 9f5e0b4ee4..6ebedfbc83 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -834,9 +834,11 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, of_flat_tree += 4 - tail; } +#ifndef CFG_NO_FLASH /* move the blob if it is in flash (set of_data to !null) */ if (addr2info ((ulong)of_flat_tree) != NULL) of_data = (ulong)of_flat_tree; +#endif #if defined(CONFIG_OF_FLAT_TREE) -- cgit v1.2.3