[U-Boot] [PATCH 0/3] Fixes and updates for goni platform

This patchset modifies goni platform configuration to make it working with latest version of first stage bootloader. There were some memory controller configuraion modifications, so we update SDRAM memory base, memory banks and environmental variables to be correct with new memory layout.
As described changes helped to reveal bug in memory handling at goni platform, this patch series contains also fix for this bug - now we avoid having gap in used memory area.
Detailed description of changes can be found in commit messages.
Best regards Robert Baldyga
Robert Baldyga (3): arm: goni: make board generic arm: goni: update SDRAM memory layout arm: goni: update environmental variables
board/samsung/goni/goni.c | 3 +-- include/configs/s5p_goni.h | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-)

Define CONFIG_SYS_GENERIC_BOARD to make board generic.
Signed-off-by: Robert Baldyga r.baldyga@samsung.com --- include/configs/s5p_goni.h | 1 + 1 file changed, 1 insertion(+)
diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h index a51215d..82bd212 100644 --- a/include/configs/s5p_goni.h +++ b/include/configs/s5p_goni.h @@ -23,6 +23,7 @@ #define CONFIG_ARCH_CPU_INIT #define CONFIG_DISPLAY_CPUINFO #define CONFIG_DISPLAY_BOARDINFO +#define CONFIG_SYS_GENERIC_BOARD
/* input clock of PLL: has 24MHz input clock at S5PC110 */ #define CONFIG_SYS_CLK_FREQ_C110 24000000

Hi Robert,
On 17 September 2014 02:03, Robert Baldyga r.baldyga@samsung.com wrote:
Define CONFIG_SYS_GENERIC_BOARD to make board generic.
Signed-off-by: Robert Baldyga r.baldyga@samsung.com
Please see this patch too:
http://patchwork.ozlabs.org/patch/389163/
Regards, Simon

According to changes in memory configuration in first stage bootloader, we change PHYS_SDRAM_1 from 0x30000000 to 0x20000000. This change revealed problem in memory handling at goni platform, so this patch fix this problem by changing CONFIG_SYS_SDRAM_BASE to 0x40000000.
So far SDRAM base was set to 0x30000000 and total memory size was calulated as sum of memory sizes in all banks. But at goni platform memory address range is not continuous.
We have: 0x20000000-0x24ffffff - 80 MiB 0x25000000-0x3fffffff - gap 0x40000000-0x4fffffff - 256 MiB 0x50000000-0x57ffffff - 128 MiB
It caused problem - u-boot has seen memory area as continous, so it could try to read/write to memory address in the gap range.
The solution would be to create algorithm of handling non-continous memory area, but it's much simpler to omit the first memory range and gap between 0x25000000-0x3fffffff, and set memory base to 0x40000000. It decreases total available memory size from 464 MiB to 384 MiB, but after all we have still more than enough memory for each u-boot feature.
Signed-off-by: Robert Baldyga r.baldyga@samsung.com --- board/samsung/goni/goni.c | 3 +-- include/configs/s5p_goni.h | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c index eb0f9bf..9aceb2e 100644 --- a/board/samsung/goni/goni.c +++ b/board/samsung/goni/goni.c @@ -50,8 +50,7 @@ int power_init_board(void)
int dram_init(void) { - gd->ram_size = PHYS_SDRAM_1_SIZE + PHYS_SDRAM_2_SIZE + - PHYS_SDRAM_3_SIZE; + gd->ram_size = PHYS_SDRAM_2_SIZE + PHYS_SDRAM_3_SIZE;
return 0; } diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h index 82bd212..eab9288 100644 --- a/include/configs/s5p_goni.h +++ b/include/configs/s5p_goni.h @@ -29,10 +29,10 @@ #define CONFIG_SYS_CLK_FREQ_C110 24000000
/* DRAM Base */ -#define CONFIG_SYS_SDRAM_BASE 0x30000000 +#define CONFIG_SYS_SDRAM_BASE 0x40000000
/* Text Base */ -#define CONFIG_SYS_TEXT_BASE 0x34800000 +#define CONFIG_SYS_TEXT_BASE 0x41800000
#define CONFIG_SETUP_MEMORY_TAGS #define CONFIG_CMDLINE_TAG @@ -220,7 +220,7 @@
/* Goni has 3 banks of DRAM, but swap the bank */ #define CONFIG_NR_DRAM_BANKS 3 -#define PHYS_SDRAM_1 CONFIG_SYS_SDRAM_BASE /* OneDRAM Bank #0 */ +#define PHYS_SDRAM_1 0x20000000 /* OneDRAM Bank #0 */ #define PHYS_SDRAM_1_SIZE (80 << 20) /* 80 MB in Bank #0 */ #define PHYS_SDRAM_2 0x40000000 /* mDDR DMC1 Bank #1 */ #define PHYS_SDRAM_2_SIZE (256 << 20) /* 256 MB in Bank #1 */

According to changes in memory configuration in first stage bootloader, memory in address range 0x30000000-0x35000000 is no longer available. It has moved to 0x20000000-0x25000000 to make DRAM base for kernel the same as in another platforms based on s5pv210 SoC.
Because this memory bank is not currently used by u-boot we have only to change addresses used in default environmental variables to be sure that operations like kernel loading will be done at correct address in memory.
Signed-off-by: Robert Baldyga r.baldyga@samsung.com --- include/configs/s5p_goni.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h index eab9288..97891b0 100644 --- a/include/configs/s5p_goni.h +++ b/include/configs/s5p_goni.h @@ -149,7 +149,7 @@ CONFIG_COMMON_BOOT
#define CONFIG_UPDATEB "updateb=onenand erase 0x0 0x100000;" \ - " onenand write 0x32008000 0x0 0x100000\0" + " onenand write 0x22008000 0x0 0x100000\0"
#define CONFIG_MISC_COMMON #define CONFIG_MISC_INIT_R @@ -162,13 +162,13 @@ CONFIG_UPDATEB \ "updatek=" \ "onenand erase 0xc00000 0x600000;" \ - "onenand write 0x31008000 0xc00000 0x600000\0" \ + "onenand write 0x21008000 0xc00000 0x600000\0" \ "updateu=" \ "onenand erase 0x01560000 0x1eaa0000;" \ - "onenand write 0x32000000 0x1260000 0x8C0000\0" \ + "onenand write 0x22000000 0x1260000 0x8C0000\0" \ "bootk=" \ "run loaduimage;" \ - "bootm 0x30007FC0\0" \ + "bootm 0x20007FC0\0" \ "flashboot=" \ "set bootargs root=/dev/mtdblock${bootblock} " \ "rootfstype=${rootfstype} ${opts} " \ @@ -180,10 +180,10 @@ "tftpboot=" \ "set bootargs root=ubi0!rootfs rootfstype=ubifs " \ "${opts} ${lcdinfo} " CONFIG_COMMON_BOOT \ - "; tftp 0x30007FC0 uImage; bootm 0x30007FC0\0" \ + "; tftp 0x20007FC0 uImage; bootm 0x20007FC0\0" \ "ramboot=" \ "set bootargs " CONFIG_RAMDISK_BOOT \ - "initrd=0x33000000,8M ramdisk=8192\0" \ + "initrd=0x23000000,8M ramdisk=8192\0" \ "mmcboot=" \ "set bootargs root=/dev/mmcblk${mmcdev}p${mmcrootpart} " \ "rootfstype=${rootfstype} ${opts} ${lcdinfo} " \ @@ -194,7 +194,7 @@ "rootfstype=ext4\0" \ "console=" CONFIG_DEFAULT_CONSOLE \ "meminfo=mem=80M mem=256M@0x40000000 mem=128M@0x50000000\0" \ - "loaduimage=ext4load mmc ${mmcdev}:${mmcbootpart} 0x30007FC0 uImage\0" \ + "loaduimage=ext4load mmc ${mmcdev}:${mmcbootpart} 0x20007FC0 uImage\0" \ "mmcdev=0\0" \ "mmcbootpart=2\0" \ "mmcrootpart=5\0" \
participants (2)
-
Robert Baldyga
-
Simon Glass