[U-Boot] [PATCH 0/2] Fix linux-rock booting on rockchip 3288

Booting on Rockchip 3288 broke in linux-rockchip as the defaults for the SPL relocation code made the heap start at a negative address (or really wrap around).
First patch reverts an old relocation workaround from me, which can be dropped since there is now proper support for relocating in the SPL. Second patch updates the configuration for RK3288 which fixes booting.
Sjoerd Simons (2): Revert "rockchip: Reconfigure the malloc based to point to system memory" rockchip: Explicitely set CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN
arch/arm/mach-rockchip/board-spl.c | 7 ------- configs/chromebook_jerry_defconfig | 1 + configs/firefly-rk3288_defconfig | 1 + 3 files changed, 2 insertions(+), 7 deletions(-)

This patch was merged shortly before the v2015.10 as a minimal fix for booting on rockchip. Now that the patch series from Hans to do the relocation in generic code has been merged it can be dropped.
This reverts commit b1f492ca9e0c090209824ff36456d4f131843190.
Signed-off-by: Sjoerd Simons sjoerd.simons@collabora.co.uk ---
arch/arm/mach-rockchip/board-spl.c | 7 ------- 1 file changed, 7 deletions(-)
diff --git a/arch/arm/mach-rockchip/board-spl.c b/arch/arm/mach-rockchip/board-spl.c index 28c3949..a241d96 100644 --- a/arch/arm/mach-rockchip/board-spl.c +++ b/arch/arm/mach-rockchip/board-spl.c @@ -217,13 +217,6 @@ void board_init_f(ulong dummy) debug("DRAM init failed: %d\n", ret); return; } - - /* - * Now that DRAM is initialized setup base pointer for simple malloc - * into RAM. - */ - gd->malloc_base = CONFIG_SPL_STACK_R_ADDR; - gd->malloc_ptr = 0; }
static int setup_led(void)

On 22 November 2015 at 00:21, Sjoerd Simons sjoerd.simons@collabora.co.uk wrote:
This patch was merged shortly before the v2015.10 as a minimal fix for booting on rockchip. Now that the patch series from Hans to do the relocation in generic code has been merged it can be dropped.
This reverts commit b1f492ca9e0c090209824ff36456d4f131843190.
Signed-off-by: Sjoerd Simons sjoerd.simons@collabora.co.uk
arch/arm/mach-rockchip/board-spl.c | 7 ------- 1 file changed, 7 deletions(-)
Acked-by: Simon Glass sjg@chromium.org

On 22 November 2015 at 08:11, Simon Glass sjg@chromium.org wrote:
On 22 November 2015 at 00:21, Sjoerd Simons sjoerd.simons@collabora.co.uk wrote:
This patch was merged shortly before the v2015.10 as a minimal fix for booting on rockchip. Now that the patch series from Hans to do the relocation in generic code has been merged it can be dropped.
This reverts commit b1f492ca9e0c090209824ff36456d4f131843190.
Signed-off-by: Sjoerd Simons sjoerd.simons@collabora.co.uk
arch/arm/mach-rockchip/board-spl.c | 7 ------- 1 file changed, 7 deletions(-)
Acked-by: Simon Glass sjg@chromium.org
Applied to u-boot-rockchip, thanks!

Now that u-boot relocates the malloc area in SPL to SDRAM, with the malloc area sitting below the SPL_STACK_R_ADDR the SPL_STACK_R_MALLOC_SIMPLE_LEN needs to be set explicitely for rockchip as its SPL_STACK_R_ADDR (512kb) is smaller then STACK_R_MALLOC_SIMPLE_LEN (1Mb).
Using the same value as SYS_MALLOC_F_LEN (8kb) is enough to load u-boot from SD card.
Signed-off-by: Sjoerd Simons sjoerd.simons@collabora.co.uk
---
configs/chromebook_jerry_defconfig | 1 + configs/firefly-rk3288_defconfig | 1 + 2 files changed, 2 insertions(+)
diff --git a/configs/chromebook_jerry_defconfig b/configs/chromebook_jerry_defconfig index e07a6e4..7424e09 100644 --- a/configs/chromebook_jerry_defconfig +++ b/configs/chromebook_jerry_defconfig @@ -4,6 +4,7 @@ CONFIG_SYS_MALLOC_F_LEN=0x2000 CONFIG_ROCKCHIP_RK3288=y CONFIG_TARGET_CHROMEBOOK_JERRY=y CONFIG_SPL_STACK_R_ADDR=0x80000 +CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000 CONFIG_DEFAULT_DEVICE_TREE="rk3288-jerry" CONFIG_SPL_STACK_R=y # CONFIG_CMD_IMLS is not set diff --git a/configs/firefly-rk3288_defconfig b/configs/firefly-rk3288_defconfig index 6f42377..09e48b9 100644 --- a/configs/firefly-rk3288_defconfig +++ b/configs/firefly-rk3288_defconfig @@ -4,6 +4,7 @@ CONFIG_SYS_MALLOC_F_LEN=0x2000 CONFIG_ROCKCHIP_RK3288=y CONFIG_TARGET_FIREFLY_RK3288=y CONFIG_SPL_STACK_R_ADDR=0x80000 +CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000 CONFIG_DEFAULT_DEVICE_TREE="rk3288-firefly" CONFIG_SPL_STACK_R=y # CONFIG_CMD_IMLS is not set

On 22 November 2015 at 00:21, Sjoerd Simons sjoerd.simons@collabora.co.uk wrote:
Now that u-boot relocates the malloc area in SPL to SDRAM, with the malloc area sitting below the SPL_STACK_R_ADDR the SPL_STACK_R_MALLOC_SIMPLE_LEN needs to be set explicitely for rockchip as its SPL_STACK_R_ADDR (512kb) is smaller then STACK_R_MALLOC_SIMPLE_LEN (1Mb).
Using the same value as SYS_MALLOC_F_LEN (8kb) is enough to load u-boot from SD card.
Signed-off-by: Sjoerd Simons sjoerd.simons@collabora.co.uk
configs/chromebook_jerry_defconfig | 1 + configs/firefly-rk3288_defconfig | 1 + 2 files changed, 2 insertions(+)
Explicitly (I can fix when applying if you like)
Acked-by: Simon Glass sjg@chromium.org

On Sun, 2015-11-22 at 09:11 -0700, Simon Glass wrote:
On 22 November 2015 at 00:21, Sjoerd Simons sjoerd.simons@collabora.co.uk wrote:
Now that u-boot relocates the malloc area in SPL to SDRAM, with the malloc area sitting below the SPL_STACK_R_ADDR the SPL_STACK_R_MALLOC_SIMPLE_LEN needs to be set explicitely for rockchip as its SPL_STACK_R_ADDR (512kb) is smaller then STACK_R_MALLOC_SIMPLE_LEN (1Mb).
Using the same value as SYS_MALLOC_F_LEN (8kb) is enough to load u- boot from SD card.
Signed-off-by: Sjoerd Simons sjoerd.simons@collabora.co.uk
configs/chromebook_jerry_defconfig | 1 + configs/firefly-rk3288_defconfig | 1 + 2 files changed, 2 insertions(+)
Explicitly (I can fix when applying if you like)
Acked-by: Simon Glass sjg@chromium.org
Yes please, saves doing another round :) Thanks!

On 23 November 2015 at 01:50, Sjoerd Simons sjoerd.simons@collabora.co.uk wrote:
On Sun, 2015-11-22 at 09:11 -0700, Simon Glass wrote:
On 22 November 2015 at 00:21, Sjoerd Simons sjoerd.simons@collabora.co.uk wrote:
Now that u-boot relocates the malloc area in SPL to SDRAM, with the malloc area sitting below the SPL_STACK_R_ADDR the SPL_STACK_R_MALLOC_SIMPLE_LEN needs to be set explicitely for rockchip as its SPL_STACK_R_ADDR (512kb) is smaller then STACK_R_MALLOC_SIMPLE_LEN (1Mb).
Using the same value as SYS_MALLOC_F_LEN (8kb) is enough to load u- boot from SD card.
Signed-off-by: Sjoerd Simons sjoerd.simons@collabora.co.uk
configs/chromebook_jerry_defconfig | 1 + configs/firefly-rk3288_defconfig | 1 + 2 files changed, 2 insertions(+)
Explicitly (I can fix when applying if you like)
Acked-by: Simon Glass sjg@chromium.org
Yes please, saves doing another round :) Thanks!
-- Sjoerd Simons Collabora Ltd.
Applied to u-boot-rockchip, thanks!
participants (2)
-
Simon Glass
-
Sjoerd Simons