From 4b99327a4121a28d2bdb2c2b841f5d97931ae905 Mon Sep 17 00:00:00 2001 From: Richard Retanubun Date: Fri, 15 Jan 2010 10:06:06 -0500 Subject: PPC: Record U-Boot's relocated address in RAM and show in bdinfo. This patch uses gd->relocaddr variable to store uboot's relocated address in RAM and shows it in bdinfo command. This patch moves CONFIG_AMIGAONEG3SE style copying of the address in board_init_f to just before relocation is actually done. Signed-off-by: Richard Retanubun Tested-by: Detlev Zundel --- common/cmd_bdinfo.c | 1 + 1 file changed, 1 insertion(+) (limited to 'common') diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index 11c154731e3..f8400bcc04b 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -115,6 +115,7 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) #endif printf ("IP addr = %pI4\n", &bd->bi_ip_addr); printf ("baudrate = %6ld bps\n", bd->bi_baudrate ); + print_num ("relocaddr", gd->relocaddr); return 0; } -- cgit v1.2.3 From 143cd21fe22e69bf0cdaefd57be98f07ed8f04fa Mon Sep 17 00:00:00 2001 From: Wolfgang Denk Date: Thu, 11 Mar 2010 23:56:03 +0100 Subject: Move CONFIG_UPDATE_TFTP code after CONFIG_PREBOOT The auto-update feature (CONFIG_UPDATE_TFTP) requires that the env variable serverip be set for the TFTP access. If DHCP is to be used to get the serverip env variable, this doesn't work as DHCP happens after the auto-update attempt has run. A solution is to run DHCP in PREBOOT, but even this is too late. To solve this, we move update_tftp() below the PREBOOT stuff. Signed-off-by: Wolfgang Denk --- common/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'common') diff --git a/common/main.c b/common/main.c index 10d8904170b..c860b0b0e52 100644 --- a/common/main.c +++ b/common/main.c @@ -305,10 +305,6 @@ void main_loop (void) trab_vfd (bmp); #endif /* CONFIG_VFD && VFD_TEST_LOGO */ -#if defined(CONFIG_UPDATE_TFTP) - update_tftp (); -#endif /* CONFIG_UPDATE_TFTP */ - #ifdef CONFIG_BOOTCOUNT_LIMIT bootcount = bootcount_load(); bootcount++; @@ -369,6 +365,10 @@ void main_loop (void) } #endif /* CONFIG_PREBOOT */ +#if defined(CONFIG_UPDATE_TFTP) + update_tftp (); +#endif /* CONFIG_UPDATE_TFTP */ + #if defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY >= 0) s = getenv ("bootdelay"); bootdelay = s ? (int)simple_strtol(s, NULL, 10) : CONFIG_BOOTDELAY; -- cgit v1.2.3 From a693447ceadff49155e260cbbaef4e09c926cab5 Mon Sep 17 00:00:00 2001 From: Anatolij Gustschin Date: Wed, 24 Feb 2010 00:29:44 +0100 Subject: cmd_mtdparts.c: prevent printbuffer overflows The length of configured MTDPARTS_DEFAULT string could be greater than console printbuffer size. Replace printf() by puts() to avoid potential buffer overflows. Signed-off-by: Anatolij Gustschin --- common/cmd_mtdparts.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'common') diff --git a/common/cmd_mtdparts.c b/common/cmd_mtdparts.c index b375feaad19..20fed2aadce 100644 --- a/common/cmd_mtdparts.c +++ b/common/cmd_mtdparts.c @@ -1254,8 +1254,14 @@ static void list_partitions(void) printf("\ndefaults:\n"); printf("mtdids : %s\n", mtdids_default ? mtdids_default : "none"); - printf("mtdparts: %s\n", - mtdparts_default ? mtdparts_default : "none"); + /* + * Using printf() here results in printbuffer overflow + * if default mtdparts string is greater than console + * printbuffer. Use puts() to prevent system crashes. + */ + puts("mtdparts: "); + puts(mtdparts_default ? mtdparts_default : "none"); + puts("\n"); } /** -- cgit v1.2.3 From 5f8419597f427aaf9bb501460735d703d10db5ee Mon Sep 17 00:00:00 2001 From: Michael Zaidman Date: Sun, 28 Feb 2010 16:28:25 +0200 Subject: Cosmetic change - indentation correction. Signed-off-by: Michael Zaidman --- common/miiphyutil.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'common') diff --git a/common/miiphyutil.c b/common/miiphyutil.c index 856fbc70b84..4b186dd28c0 100644 --- a/common/miiphyutil.c +++ b/common/miiphyutil.c @@ -377,7 +377,7 @@ int miiphy_speed (char *devname, unsigned char addr) /* Get speed from basic control settings. */ return (bmcr & PHY_BMCR_100MB) ? _100BASET : _10BASET; - miiphy_read_failed: +miiphy_read_failed: printf (" read failed, assuming 10BASE-T\n"); return _10BASET; } @@ -436,7 +436,7 @@ int miiphy_duplex (char *devname, unsigned char addr) /* Get speed from basic control settings. */ return (bmcr & PHY_BMCR_DPLX) ? FULL : HALF; - miiphy_read_failed: +miiphy_read_failed: printf (" read failed, assuming half duplex\n"); return HALF; } -- cgit v1.2.3 From 93910edb595a88d394da3eb2cf5148096155dfe9 Mon Sep 17 00:00:00 2001 From: Wolfgang Denk Date: Fri, 12 Mar 2010 23:06:04 +0100 Subject: Prepare v2010.03-rc1 Coding style cleanup, update CHANGELOG. Signed-off-by: Wolfgang Denk --- common/cmd_ximg.c | 2 +- common/env_eeprom.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'common') diff --git a/common/cmd_ximg.c b/common/cmd_ximg.c index b34c4d02da0..75499b4b84b 100644 --- a/common/cmd_ximg.c +++ b/common/cmd_ximg.c @@ -230,7 +230,7 @@ do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) printf (" Uncompressing part %d ... ", part); /* - * If we've got less than 4 MB of malloc() + * If we've got less than 4 MB of malloc() * space, use slower decompression algorithm * which requires at most 2300 KB of memory. */ diff --git a/common/env_eeprom.c b/common/env_eeprom.c index 95a7d0d3bc9..4f7f0dbdea1 100644 --- a/common/env_eeprom.c +++ b/common/env_eeprom.c @@ -281,4 +281,3 @@ int env_init(void) return (0); } #endif - -- cgit v1.2.3 From 9d90a93d367272ee65550c0c9f82615cec967c70 Mon Sep 17 00:00:00 2001 From: Frans Meulenbroeks Date: Thu, 25 Feb 2010 14:03:08 +0100 Subject: cmd_mmc remove \n This patch removes the \n after the help message for mmcinfo. This resulted in an empty line being displayed after the mmcinfo line when the help command was given. Signed-off-by: Frans Meulenbroeks --- common/cmd_mmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common') diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c index 0e3393b5f44..c67c9cf728f 100644 --- a/common/cmd_mmc.c +++ b/common/cmd_mmc.c @@ -136,7 +136,7 @@ int do_mmcinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) } U_BOOT_CMD(mmcinfo, 2, 0, do_mmcinfo, - "mmcinfo -- display MMC info\n", + "mmcinfo -- display MMC info", "" ); -- cgit v1.2.3 From a74908161a1b37d780d3a826a86807bbc50a3857 Mon Sep 17 00:00:00 2001 From: Anatolij Gustschin Date: Tue, 16 Mar 2010 15:29:33 +0100 Subject: console.c: fix problem with splashimage If a board uses cfb_console driver and splash image and also defines CONFIG_SILENT_CONSOLE, the user is locked out even if "silent" is not set. It is not possible to get any output, neither on vga console device nor on serial console after redirecting the output to the serial console, since the GD_FLG_SILENT flag remains set. Fix the problem by redirecting the output from frame buffer to serial console if splashimage is used. Only suppress the output if "silent" environment variable was set and don't set the GD_FLG_SILENT flag arbitrarily. Signed-off-by: Anatolij Gustschin --- common/console.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'common') diff --git a/common/console.c b/common/console.c index dc0d13b5a52..51c6fb6264a 100644 --- a/common/console.c +++ b/common/console.c @@ -659,10 +659,14 @@ int console_init_r(void) #ifdef CONFIG_SPLASH_SCREEN /* * suppress all output if splash screen is enabled and we have - * a bmp to display + * a bmp to display. We redirect the output from frame buffer + * console to serial console in this case or suppress it if + * "silent" mode was requested. */ - if (getenv("splashimage") != NULL) - gd->flags |= GD_FLG_SILENT; + if (getenv("splashimage") != NULL) { + if (!(gd->flags & GD_FLG_SILENT)) + outputdev = search_device (DEV_FLAGS_OUTPUT, "serial"); + } #endif /* Scan devices looking for input and output devices */ -- cgit v1.2.3