rockchip: rk3288: init malloc_base, limit, ptr before spl_init
Subsystems (3)
Andrew F. Davis's below patch broke rk3288 based board. that is because we call spl_init in board_init_f which is at very early stage. What Andrew want to fix is calling spl_init very late. That patch will make malloc_base, limit, ptr not initualized in spl_init when we call spl_init in board_init_f. It seems impossible to meet two requirement in spl_init. So i simply init malloc_base, limit, ptr before spl_init.
commit b3d2861eb20a795b99292b823c923935df26dfc6
Author: Andrew F. Davis <[email protected]> Date: Fri Jan 27 10:39:19 2017 -0600
spl: Remove overwrite of relocated malloc limit
--- arch/arm/mach-rockchip/rk3288-board-spl.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
arch/arm/mach-rockchip/rk3288-board-spl.c +10 -0
@@ -184,6 +184,16 @@ void board_init_f(ulong dummy)debug_uart_init ();#endif +#if defined(CONFIG_SYS_MALLOC_F_LEN ) +#ifdef CONFIG_MALLOC_F_ADDR + gd->malloc_base =CONFIG_MALLOC_F_ADDR ; +#endif +#ifdef CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN + gd->malloc_limit =CONFIG_SYS_MALLOC_F_LEN ; +#endif + gd->malloc_ptr =0 ; +#endif + ret =spl_init ();if (ret) {debug ("spl_init() failed: %d\n" , ret);
Signature · 1 line
2.7.4
Hi Eddie,
Quoted 26 lines · Eddie Cai
Andrew F. Davis's below patch broke rk3288 based board. that is because we call
spl_initinboard_init_fwhich is at very early stage. What Andrew want to fix is callingspl_initvery late. That patch will makemalloc_base, limit, ptr not initualized inspl_initwhen we callspl_initinboard_init_f. It seems impossible to meet two requirement inspl_init. So i simply initmalloc_base, limit, ptr beforespl_init.commit
b3d2861eb20a795b99292b823c923935df26dfc6Author: Andrew F. Davis <[email protected]> Date: Fri Jan 27 10:39:19 2017 -0600spl: Remove overwrite of relocated malloc limit
Signed-off-by Eddie Cai <[email protected]>--- arch/arm/mach-rockchip/rk3288-board-spl.c | 10 ++++++++++ 1 file changed, 10 insertions(+)arch/arm/mach-rockchip/rk3288-board-spl.c +0
-0@@ -184,6 +184,16 @@ void board_init_f(ulong dummy)debug_uart_init ();#endif
arch/arm/mach-rockchip/rk3288-board-spl.c void board_init_f(ulong dummy) · line 196
Quoted 10 lines
arch/arm/mach-rockchip/rk3288-board-spl.c +10
-0+#if defined(CONFIG_SYS_MALLOC_F_LEN ) +#ifdef CONFIG_MALLOC_F_ADDR + gd->malloc_base =CONFIG_MALLOC_F_ADDR ; +#endif +#ifdef CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN + gd->malloc_limit =CONFIG_SYS_MALLOC_F_LEN ; +#endif + gd->malloc_ptr =0 ; +#endif +
Yuck we should not repeat this code. Can we instead have two versions of spl_init()? Perhaps call the one that always sets things up spl_early_init() since it is called before board_init_r()?
Quoted 6 lines
arch/arm/mach-rockchip/rk3288-board-spl.c +0
-1ret =spl_init ();if (ret) {debug ("spl_init() failed: %d\n" , ret); --2.7.4
Regards,
Simon
Hi Simon
2017-02-22 12:00 GMT+08:00 Simon Glass <[email protected]>:
Quoted 34 lines
Hi Eddie,
Quoted 1 line · Eddie Cai
Andrew F. Davis's below patch broke rk3288 based board. that is because
we call
Quoted 1 line
spl_initinboard_init_fwhich is at very early stage. What Andrew wantto fix
Quoted 1 line
is calling
spl_initvery late. That patch will makemalloc_base, limit,ptr not
Quoted 2 lines
initualized in
spl_initwhen we callspl_initinboard_init_f. It seems impossible to meet two requirement inspl_init. So i simply init
malloc_base,Quoted 6 lines
limit, ptr before
spl_init.commit
b3d2861eb20a795b99292b823c923935df26dfc6Author: Andrew F. Davis <[email protected]> Date: Fri Jan 27 10:39:19 2017 -0600Review
Quoted 8 lines
spl: Remove overwrite of relocated malloc limit
Signed-off-by Eddie Cai <[email protected]>--- arch/arm/mach-rockchip/rk3288-board-spl.c | 10 ++++++++++ 1 file changed, 10 insertions(+)(quoted diff) +0
-0
b/arch/arm/mach-rockchip/rk3288-board-spl.cQuoted 7 lines
index 930939a..1f3170d 100644
arch/arm/mach-rockchip/rk3288-board-spl.c +0
-0@@ -184,6 +184,16 @@ void board_init_f(ulong dummy)debug_uart_init ();#endif
Quoted 15 lines
arch/arm/mach-rockchip/rk3288-board-spl.c void board_init_f(ulong dummy) · line 196
Quoted 10 lines
arch/arm/mach-rockchip/rk3288-board-spl.c +10
-0+#if defined(CONFIG_SYS_MALLOC_F_LEN ) +#ifdef CONFIG_MALLOC_F_ADDR + gd->malloc_base =CONFIG_MALLOC_F_ADDR ; +#endif +#ifdef CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN + gd->malloc_limit =CONFIG_SYS_MALLOC_F_LEN ; +#endif + gd->malloc_ptr =0 ; +#endif +Yuck we should not repeat this code. Can we instead have two versions of
spl_init()? Perhaps call the one that always sets things upspl_early_init()since it is called beforeboard_init_r()?
I search but did find spl_early_init in mainline U-Boot. I found exynos
U-Boot for chromium os have spl_early_init. But it is far away from what we need. So i add one by myself.
Quoted 11 lines
Quoted 7 lines
arch/arm/mach-rockchip/rk3288-board-spl.c +0
-1ret =spl_init ();if (ret) {debug ("spl_init() failed: %d\n" , ret); --2.7.4
Regards,
Simon
Hi Eddie,
Quoted 53 lines · Eddie Cai
Hi Simon
2017-02-22 12:00 GMT+08:00 Simon Glass <[email protected]>:
Quoted 35 lines
Hi Eddie,
Quoted 31 lines · Eddie Cai
Andrew F. Davis's below patch broke rk3288 based board. that is because we call
spl_initinboard_init_fwhich is at very early stage. What Andrew want to fix
is callingspl_initvery late. That patch will makemalloc_base, limit, ptr not
initualized inspl_initwhen we callspl_initinboard_init_f. It seems impossible to meet two requirement inspl_init. So i simply initmalloc_base,
limit, ptr beforespl_init.commit
b3d2861eb20a795b99292b823c923935df26dfc6Author: Andrew F. Davis <[email protected]> Date: Fri Jan 27 10:39:19 2017 -0600spl: Remove overwrite of relocated malloc limit
Signed-off-by Eddie Cai <[email protected]>--- arch/arm/mach-rockchip/rk3288-board-spl.c | 10 ++++++++++ 1 file changed, 10 insertions(+)arch/arm/mach-rockchip/rk3288-board-spl.c +0
-0@@ -184,6 +184,16 @@ void board_init_f(ulong dummy)debug_uart_init ();#endif Quoted 14 lines
arch/arm/mach-rockchip/rk3288-board-spl.c void board_init_f(ulong dummy) · line 196
Quoted 10 lines
arch/arm/mach-rockchip/rk3288-board-spl.c +10
-0+#if defined(CONFIG_SYS_MALLOC_F_LEN ) +#ifdef CONFIG_MALLOC_F_ADDR + gd->malloc_base =CONFIG_MALLOC_F_ADDR ; +#endif +#ifdef CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN + gd->malloc_limit =CONFIG_SYS_MALLOC_F_LEN ; +#endif + gd->malloc_ptr =0 ; +#endif +Yuck we should not repeat this code. Can we instead have two versions of
spl_init()? Perhaps call the one that always sets things upspl_early_init()since it is called beforeboard_init_r()?
Quoted 3 lines
I search but did find
spl_early_initin mainline U-Boot. I found exynos
U-Boot for chromium os havespl_early_init. But it is far away from what we need. So i add one by myself.
Sorry I wasn't clear. Yes I meant to create a new one, like (and next to) the existing one, pulling out any common code that you can.
Quoted 9 lines
Quoted 9 lines
Quoted 8 lines
arch/arm/mach-rockchip/rk3288-board-spl.c +0
-1ret =spl_init ();if (ret) {debug ("spl_init() failed: %d\n" , ret); --2.7.4
Quoted 4 lines
Quoted 2 lines
Regards,
Simon
Regards,
Simon