[U-Boot] [PATCH 01/11] arm/pxa: remove unused u-boot.lds from board/vpac270

This file is not used, automatically generated u-boot.lds is used instead
Signed-off-by: Mikhail Kshevetskiy mikhail.kshevetskiy@gmail.com --- board/vpac270/u-boot.lds | 55 ---------------------------------------------- 1 files changed, 0 insertions(+), 55 deletions(-) delete mode 100644 board/vpac270/u-boot.lds
diff --git a/board/vpac270/u-boot.lds b/board/vpac270/u-boot.lds deleted file mode 100644 index 58c371d..0000000 --- a/board/vpac270/u-boot.lds +++ /dev/null @@ -1,55 +0,0 @@ -/* - * (C) Copyright 2000 - * Wolfgang Denk, DENX Software Engineering, wd@denx.de. - * - * 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 - */ - -OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") -OUTPUT_ARCH(arm) -ENTRY(_start) -SECTIONS -{ - . = 0x00000000; - - . = ALIGN(4); - .text : - { - cpu/pxa/start.o (.text) - *(.text) - } - - . = ALIGN(4); - .rodata : { *(.rodata) } - - . = ALIGN(4); - .data : { *(.data) } - - . = ALIGN(4); - .got : { *(.got) } - - __u_boot_cmd_start = .; - .u_boot_cmd : { *(.u_boot_cmd) } - __u_boot_cmd_end = .; - - . = ALIGN(4); - __bss_start = .; - .bss : { *(.bss) } - _end = .; -}

Signed-off-by: Mikhail Kshevetskiy mikhail.kshevetskiy@gmail.com --- board/vpac270/vpac270.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/board/vpac270/vpac270.c b/board/vpac270/vpac270.c index 18e47e2..2f29cf4 100644 --- a/board/vpac270/vpac270.c +++ b/board/vpac270/vpac270.c @@ -73,6 +73,7 @@ int dram_init (void) return 0; }
+#ifdef CONFIG_CMD_USB int usb_board_init(void) { UHCHR = (UHCHR | UHCHR_PCPL | UHCHR_PSPL) & @@ -119,6 +120,7 @@ void usb_board_stop(void)
return; } +#endif
#ifdef CONFIG_DRIVER_DM9000 int board_eth_init(bd_t *bis)

Signed-off-by: Mikhail Kshevetskiy mikhail.kshevetskiy@gmail.com --- include/configs/vpac270.h | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/include/configs/vpac270.h b/include/configs/vpac270.h index d3e22d9..e31b08a 100644 --- a/include/configs/vpac270.h +++ b/include/configs/vpac270.h @@ -62,7 +62,10 @@ * Serial Console Configuration */ #define CONFIG_PXA_SERIAL +#define CONFIG_SERIAL_MULTI #define CONFIG_FFUART 1 +#define CONFIG_STUART 1 +#define CONFIG_BTUART 1 #define CONFIG_BAUDRATE 115200 #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }

* CONFIG_SYS_CLKS_IN_HZ is not used anywhere, so removing it * CONFIG_SYS_HZ is set to 1000 on most architectures, so it seems to be the safe default
Signed-off-by: Mikhail Kshevetskiy mikhail.kshevetskiy@gmail.com --- include/configs/vpac270.h | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/include/configs/vpac270.h b/include/configs/vpac270.h index e31b08a..4c162bd 100644 --- a/include/configs/vpac270.h +++ b/include/configs/vpac270.h @@ -151,8 +151,7 @@ /* * Clock Configuration */ -#undef CONFIG_SYS_CLKS_IN_HZ -#define CONFIG_SYS_HZ 3250000 /* Timer @ 3250000 Hz */ +#define CONFIG_SYS_HZ 1000 /* Timer @ 3250000 Hz */ #define CONFIG_SYS_CPUSPEED 0x190 /* standard setting for 312MHz; L=16, N=1.5, A=0, SDCLK!=SystemBus */
/*

Define MONITOR_BASE on the base of used flash type. Define ENV_ADDR as MONITOR_BASE + MONITOR_LEN. Fix environment sector size (NOR: 32Kb for first four sectors and 128Kb for other; OneNAND: 128Kb).
Last but not least: we have MONITOR_LEN = 0x40000, one sector for environment and one sector for its redundancy copy (2 * 0x20000 = 256Kb). So the kernel may start from 0x00080000 only.
Signed-off-by: Mikhail Kshevetskiy mikhail.kshevetskiy@gmail.com --- include/configs/vpac270.h | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/include/configs/vpac270.h b/include/configs/vpac270.h index 4c162bd..d3e805a 100644 --- a/include/configs/vpac270.h +++ b/include/configs/vpac270.h @@ -49,7 +49,7 @@ "if usb reset && fatload usb 0 0xa4000000 uImage; then " \ "bootm 0xa4000000; " \ "fi; " \ - "bootm 0x40000;" + "bootm 0x00080000;" #define CONFIG_BOOTARGS "console=tty0 console=ttyS0,115200" #define CONFIG_TIMESTAMP #define CONFIG_BOOTDELAY 2 /* Autoboot delay */ @@ -188,6 +188,7 @@ #if defined(CONFIG_CMD_FLASH) /* NOR */ #define PHYS_FLASH_1 0x00000000 /* Flash Bank #1 */ #define PHYS_FLASH_2 0x02000000 /* Flash Bank #2 */ +#define CONFIG_SYS_MONITOR_BASE PHYS_FLASH_1
#define CONFIG_SYS_FLASH_CFI #define CONFIG_FLASH_CFI_DRIVER 1 @@ -207,18 +208,19 @@ #elif defined(CONFIG_CMD_ONENAND) /* OneNAND */ #define CONFIG_SYS_NO_FLASH #define CONFIG_SYS_ONENAND_BASE 0x00000000 +#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_ONENAND_BASE #define CONFIG_ENV_IS_IN_ONENAND 1
#else /* No flash */ #define CONFIG_SYS_NO_FLASH #define CONFIG_SYS_ENV_IS_NOWHERE +#define CONFIG_SYS_MONITOR_BASE 0x000000 #endif
-#define CONFIG_SYS_MONITOR_BASE 0x000000 #define CONFIG_SYS_MONITOR_LEN 0x40000
-#define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_LEN) -#define CONFIG_ENV_SECT_SIZE 0x40000 +#define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN) +#define CONFIG_ENV_SECT_SIZE 0x20000 #define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR + CONFIG_ENV_SECT_SIZE) #define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SIZE)

Dne Čt 26. srpna 2010 12:48:00 Mikhail Kshevetskiy napsal(a):
Define MONITOR_BASE on the base of used flash type. Define ENV_ADDR as MONITOR_BASE + MONITOR_LEN. Fix environment sector size (NOR: 32Kb for first four sectors and 128Kb for other; OneNAND: 128Kb).
Last but not least: we have MONITOR_LEN = 0x40000, one sector for environment and one sector for its redundancy copy (2 * 0x20000 = 256Kb). So the kernel may start from 0x00080000 only.
Signed-off-by: Mikhail Kshevetskiy mikhail.kshevetskiy@gmail.com
include/configs/vpac270.h | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/include/configs/vpac270.h b/include/configs/vpac270.h index 4c162bd..d3e805a 100644 --- a/include/configs/vpac270.h +++ b/include/configs/vpac270.h @@ -49,7 +49,7 @@ "if usb reset && fatload usb 0 0xa4000000 uImage; then " \ "bootm 0xa4000000; " \ "fi; " \
- "bootm 0x40000;"
- "bootm 0x00080000;"
Good catch, but let's make it 0x60000 as spare env isn't used.
#define CONFIG_BOOTARGS "console=tty0
console=ttyS0,115200"
#define CONFIG_TIMESTAMP #define CONFIG_BOOTDELAY 2 /* Autoboot delay */ @@ -188,6 +188,7 @@ #if defined(CONFIG_CMD_FLASH) /* NOR */ #define PHYS_FLASH_1 0x00000000 /* Flash Bank #1
*/
#define PHYS_FLASH_2 0x02000000 /* Flash Bank #2
*/
+#define CONFIG_SYS_MONITOR_BASE PHYS_FLASH_1
This is always 0 ... that's why it's defined in common place.
#define CONFIG_SYS_FLASH_CFI #define CONFIG_FLASH_CFI_DRIVER 1 @@ -207,18 +208,19 @@ #elif defined(CONFIG_CMD_ONENAND) /* OneNAND */ #define CONFIG_SYS_NO_FLASH #define CONFIG_SYS_ONENAND_BASE 0x00000000 +#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_ONENAND_BASE #define CONFIG_ENV_IS_IN_ONENAND 1
#else /* No flash */ #define CONFIG_SYS_NO_FLASH #define CONFIG_SYS_ENV_IS_NOWHERE +#define CONFIG_SYS_MONITOR_BASE 0x000000 #endif
-#define CONFIG_SYS_MONITOR_BASE 0x000000 #define CONFIG_SYS_MONITOR_LEN 0x40000
-#define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_LEN) -#define CONFIG_ENV_SECT_SIZE 0x40000 +#define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN) +#define CONFIG_ENV_SECT_SIZE 0x20000 #define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR + CONFIG_ENV_SECT_SIZE) #define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SIZE)
Please rebase the patch on top of for-wd-master.

it is not required and not recommended.
Signed-off-by: Mikhail Kshevetskiy mikhail.kshevetskiy@gmail.com --- include/configs/vpac270.h | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/include/configs/vpac270.h b/include/configs/vpac270.h index d3e805a..c8663e8 100644 --- a/include/configs/vpac270.h +++ b/include/configs/vpac270.h @@ -40,8 +40,6 @@ #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 128*1024) #define CONFIG_SYS_GBL_DATA_SIZE 128
-#define CONFIG_ENV_OVERWRITE /* override default environment */ - #define CONFIG_BOOTCOMMAND \ "if mmc init && fatload mmc 0 0xa4000000 uImage; then " \ "bootm 0xa4000000; " \

Dne Čt 26. srpna 2010 12:48:01 Mikhail Kshevetskiy napsal(a):
it is not required and not recommended.
If CONFIG_ENV_OVERWRITE is #defined in your config file, the write protection for vendor parameters is completely disabled. Anybody can change or delete these parameters.
I think that's ok. Anyone can remove it before deploying the real product.
Signed-off-by: Mikhail Kshevetskiy mikhail.kshevetskiy@gmail.com
include/configs/vpac270.h | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/include/configs/vpac270.h b/include/configs/vpac270.h index d3e805a..c8663e8 100644 --- a/include/configs/vpac270.h +++ b/include/configs/vpac270.h @@ -40,8 +40,6 @@ #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 128*1024) #define CONFIG_SYS_GBL_DATA_SIZE 128
-#define CONFIG_ENV_OVERWRITE /* override default environment
*/
#define CONFIG_BOOTCOMMAND
\
"if mmc init && fatload mmc 0 0xa4000000 uImage; then " \ "bootm 0xa4000000; " \

it looks like 4Kb for environment and 64Kb for stack is sufficient
Signed-off-by: Mikhail Kshevetskiy mikhail.kshevetskiy@gmail.com --- include/configs/vpac270.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/configs/vpac270.h b/include/configs/vpac270.h index c8663e8..98faf9a 100644 --- a/include/configs/vpac270.h +++ b/include/configs/vpac270.h @@ -36,7 +36,7 @@ /* * Environment settings */ -#define CONFIG_ENV_SIZE 0x4000 +#define CONFIG_ENV_SIZE (4 * 1024) #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 128*1024) #define CONFIG_SYS_GBL_DATA_SIZE 128
@@ -157,7 +157,7 @@ * * The stack sizes are set up in start.S using the settings below */ -#define CONFIG_STACKSIZE (128*1024) /* regular stack */ +#define CONFIG_STACKSIZE (64*1024) /* regular stack */ #ifdef CONFIG_USE_IRQ #define CONFIG_STACKSIZE_IRQ (4*1024) /* IRQ stack */ #define CONFIG_STACKSIZE_FIQ (4*1024) /* FIQ stack */

Dne Čt 26. srpna 2010 12:48:02 Mikhail Kshevetskiy napsal(a):
it looks like 4Kb for environment and 64Kb for stack is sufficient
Wolfgang, what's your opinion?
Thanks
Signed-off-by: Mikhail Kshevetskiy mikhail.kshevetskiy@gmail.com
include/configs/vpac270.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/configs/vpac270.h b/include/configs/vpac270.h index c8663e8..98faf9a 100644 --- a/include/configs/vpac270.h +++ b/include/configs/vpac270.h @@ -36,7 +36,7 @@ /*
- Environment settings
*/ -#define CONFIG_ENV_SIZE 0x4000 +#define CONFIG_ENV_SIZE (4 * 1024) #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 128*1024) #define CONFIG_SYS_GBL_DATA_SIZE 128
@@ -157,7 +157,7 @@
- The stack sizes are set up in start.S using the settings below
*/ -#define CONFIG_STACKSIZE (128*1024) /* regular stack
*/
+#define CONFIG_STACKSIZE (64*1024) /* regular stack
*/
#ifdef CONFIG_USE_IRQ #define CONFIG_STACKSIZE_IRQ (4*1024) /* IRQ stack */ #define CONFIG_STACKSIZE_FIQ (4*1024) /* FIQ stack */

Dear Marek Vasut,
In message 201008261345.41408.marek.vasut@gmail.com you wrote:
Dne Ct 26. srpna 2010 12:48:02 Mikhail Kshevetskiy napsal(a):
it looks like 4Kb for environment and 64Kb for stack is sufficient
Wolfgang, what's your opinion?
I don't think this makes sense on a real-life system, but then, I don't know neither the hardware nor it's use cases. If the board maintainer claims that this is OK for all known use cases...
Best regards,
Wolfgang Denk

it looks like u-boot allocates a buffer of CONFIG_ENV_SECT_SIZE size when making "saveenv" command. In our case CONFIG_ENV_SECT_SIZE is 128Kb, so having CONFIG_SYS_MALLOC_LEN = (128Kb + space for environment) is not sufficient.
Increase CONFIG_SYS_MALLOC_LEN to (196Kb + space for environment) to resolve a problem.
Signed-off-by: Mikhail Kshevetskiy mikhail.kshevetskiy@gmail.com --- include/configs/vpac270.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/configs/vpac270.h b/include/configs/vpac270.h index 98faf9a..ddb3e0e 100644 --- a/include/configs/vpac270.h +++ b/include/configs/vpac270.h @@ -37,7 +37,7 @@ * Environment settings */ #define CONFIG_ENV_SIZE (4 * 1024) -#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 128*1024) +#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 196*1024) #define CONFIG_SYS_GBL_DATA_SIZE 128
#define CONFIG_BOOTCOMMAND \

Dne Čt 26. srpna 2010 12:48:03 Mikhail Kshevetskiy napsal(a):
it looks like u-boot allocates a buffer of CONFIG_ENV_SECT_SIZE size when making "saveenv" command. In our case CONFIG_ENV_SECT_SIZE is 128Kb, so having CONFIG_SYS_MALLOC_LEN = (128Kb + space for environment) is not sufficient.
Increase CONFIG_SYS_MALLOC_LEN to (196Kb + space for environment) to resolve a problem.
You probably hit this because you changed the ENV size. Wolfgang, can you please comment on this one too?
Thanks
Signed-off-by: Mikhail Kshevetskiy mikhail.kshevetskiy@gmail.com
include/configs/vpac270.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/configs/vpac270.h b/include/configs/vpac270.h index 98faf9a..ddb3e0e 100644 --- a/include/configs/vpac270.h +++ b/include/configs/vpac270.h @@ -37,7 +37,7 @@
- Environment settings
*/ #define CONFIG_ENV_SIZE (4 * 1024) -#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 128*1024) +#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 196*1024) #define CONFIG_SYS_GBL_DATA_SIZE 128
#define CONFIG_BOOTCOMMAND
\

Dear Marek Vasut,
In message 201008261348.08623.marek.vasut@gmail.com you wrote:
Dne Ct 26. srpna 2010 12:48:03 Mikhail Kshevetskiy napsal(a):
it looks like u-boot allocates a buffer of CONFIG_ENV_SECT_SIZE size when making "saveenv" command. In our case CONFIG_ENV_SECT_SIZE is 128Kb, so having CONFIG_SYS_MALLOC_LEN = (128Kb + space for environment) is not sufficient.
Increase CONFIG_SYS_MALLOC_LEN to (196Kb + space for environment) to resolve a problem.
You probably hit this because you changed the ENV size. Wolfgang, can you p> lease comment on this one too?
The space needed for malloc() depends on many things. Most systems have sufficient RAM these days, so it makes little sense to be stingy here.
Best regards,
Wolfgang Denk
participants (3)
-
Marek Vasut
-
Mikhail Kshevetskiy
-
Wolfgang Denk