rk3288: tinker/vyasa: Fixes for TPL/SPL boot
Subsystems (3)
cover rk3288: tinker/vyasa: Fixes for TPL/SPL boot
These boot failure as encounter even from v2019.07 release, I have seen them now due to some requirement on feature additions.
All these patches are fixing the respective TPL/SPL boot failures on tinker and vyasa rk3288 boards.
patch 3/7 make dram init available for TPL build, if TPL/SPL bootchain boards, so it is better to test this for SPL-alone rk3288 board before merging.
Any inputs?
Jagan.
Jagan Teki (6):
rockchip: rk3288: vyasa: Drop ROCKCHIP_BROM_HELPER selection
configs: vyasa-rk3288: Fix SPL_TEXT_BASE
ram: rk3288: Initialize dram for TPL builds
rockchip: spi-boot-order: Trival fix to newline missing
configs: tinker: Drop explicit SPL_TEXT
configs: tinker: Enable SDRAM, SPL stack
Michael Trimarchi (1):
rockchip: rk3288-tinker: Attach missing peripherals at SPL
arch/arm/dts/rk3288-tinker-u-boot.dtsi | 26 ++++++++++++++++++------- arch/arm/mach-rockchip/rk3288/Kconfig | 1 - arch/arm/mach-rockchip/spl-boot-order.c | 2 +- configs/tinker-rk3288_defconfig | 9 ++++++++- configs/vyasa-rk3288_defconfig | 1 - drivers/ram/rockchip/sdram_rk3288.c | 15 +++++++++----- 6 files changed, 38 insertions(+), 16 deletions(-)
Signature · 1 line
2.18.0.321.gffc6fa0e3
PATCH 1/7 rockchip: rk3288: vyasa: Drop ROCKCHIP_BROM_HELPER selection
ROCKCHIP_BROM_HELPER is selected as if TPL/SPL ROCKCHIP_BACK_TO_BROM has been defined, so drop the explicit enablement for vyasa board.
This change is supposed to missed during config move to other locations, and missed to drop the same.
--- arch/arm/mach-rockchip/rk3288/Kconfig | 1 - 1 file changed, 1 deletion(-)
arch/arm/mach-rockchip/rk3288/Kconfig +0 -1
@@ -104,7 +104,6 @@ config TARGET_POPMETAL_RK3288 config TARGET_VYASA_RK3288 bool "Vyasa-RK3288" select BOARD_LATE_INIT - select ROCKCHIP_BROM_HELPER select TPL help Vyasa is a RK3288-based development board with 2 USB ports,
Signature · 1 line
2.18.0.321.gffc6fa0e3
PATCH 1/7 rockchip: rk3288: vyasa: Drop ROCKCHIP_BROM_HELPER selection
Quoted 7 lines · Jagan Teki
ROCKCHIP_BROM_HELPERis selected as if TPL/SPLROCKCHIP_BACK_TO_BROMhas been defined, so drop the explicit enablement for vyasa board.This change is supposed to missed during config move to other locations, and missed to drop the same.
Signed-off-by Jagan Teki <[email protected]>
Thanks,
- Kever
Quoted 16 lines
--- arch/arm/mach-rockchip/rk3288/Kconfig | 1 - 1 file changed, 1 deletion(-)arch/arm/mach-rockchip/rk3288/Kconfig +0
-1@@ -104,7 +104,6 @@ config TARGET_POPMETAL_RK3288 config TARGET_VYASA_RK3288 bool "Vyasa-RK3288" select BOARD_LATE_INIT - select ROCKCHIP_BROM_HELPER select TPL help Vyasa is a RK3288-based development board with 2 USB ports,
PATCH 2/7 configs: vyasa-rk3288: Fix SPL_TEXT_BASE
In reply to Jagan TekiThe initial Vyasa-rk3288 TPL implementation is to reuse the SPL_TEXT_BASE for TPL and SPL as 0x0 and 0xff704000 respectively.
But the below commit implements the reverse way of using TEXT_BASE's like 0xff704000 for TPL and 0x0 for SPL and which indeed update the SPL_TEXT_BASE for vyasa-rk3288 board.
"rockchip: Kconfig: enable TPL support for rk3328"
(sha1: 3f47db0275e0f1c1e89d8f13f8b4cdc86b1038ca)
So, fix by dropping the legacy SPL_TEXT_BASE and it will reassign 0x0 by default based on Kconfig definition.
--- configs/vyasa-rk3288_defconfig | 1 - 1 file changed, 1 deletion(-)
configs/vyasa-rk3288_defconfig +0 -1
@@ -15,7 +15,6 @@ CONFIG_SILENT_CONSOLE=y CONFIG_DEFAULT_FDT_FILE="rk3288-vyasa.dtb" # CONFIG_DISPLAY_CPUINFO is not set CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_SPL_TEXT_BASE=0xff704000 CONFIG_SPL_STACK_R=y CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000 CONFIG_CMD_GPIO=y
Signature · 1 line
2.18.0.321.gffc6fa0e3
PATCH 2/7 configs: vyasa-rk3288: Fix SPL_TEXT_BASE
Quoted 9 lines · Jagan Teki
The initial Vyasa-rk3288 TPL implementation is to reuse the
SPL_TEXT_BASEfor TPL and SPL as0x0and0xff704000respectively.But the below commit implements the reverse way of using TEXT_BASE's like
0xff704000for TPL and0x0for SPL and which indeed update theSPL_TEXT_BASEfor vyasa-rk3288 board.
"rockchip:Kconfig: enable TPL support for rk3328"
(sha1:3f47db0275e0f1c1e89d8f13f8b4cdc86b1038ca)
Quoted 5 lines
So, fix by dropping the legacy
SPL_TEXT_BASEand it will reassign0x0by default based onKconfigdefinition.Reported-by Jagan Teki <[email protected]>Signed-off-by Jagan Teki <[email protected]>
Thanks,
- Kever
Quoted 16 lines
--- configs/vyasa-rk3288_defconfig | 1 - 1 file changed, 1 deletion(-)configs/vyasa-rk3288_defconfig +0
-1@@ -15,7 +15,6 @@ CONFIG_SILENT_CONSOLE=y CONFIG_DEFAULT_FDT_FILE="rk3288-vyasa.dtb" # CONFIG_DISPLAY_CPUINFO is not set CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_SPL_TEXT_BASE=0xff704000 CONFIG_SPL_STACK_R=y CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000 CONFIG_CMD_GPIO=y
PATCH 2/7 configs: vyasa-rk3288: Fix SPL_TEXT_BASE
In reply to Jagan TekiQuoted 9 lines · Jagan Teki
The initial Vyasa-rk3288 TPL implementation is to reuse the
SPL_TEXT_BASEfor TPL and SPL as0x0and0xff704000respectively.But the below commit implements the reverse way of using TEXT_BASE's like
0xff704000for TPL and0x0for SPL and which indeed update theSPL_TEXT_BASEfor vyasa-rk3288 board.
"rockchip:Kconfig: enable TPL support for rk3328"
(sha1:3f47db0275e0f1c1e89d8f13f8b4cdc86b1038ca)
Quoted 4 lines
So, fix by dropping the legacy
SPL_TEXT_BASEand it will reassign0x0by default based onKconfigdefinition.Reported-by Jagan Teki <[email protected]>
Why this tag is needed for yourself?
Thanks,
- Kever
Quoted 17 lines
Signed-off-by Jagan Teki <[email protected]>--- configs/vyasa-rk3288_defconfig | 1 - 1 file changed, 1 deletion(-)configs/vyasa-rk3288_defconfig +0
-1@@ -15,7 +15,6 @@ CONFIG_SILENT_CONSOLE=y CONFIG_DEFAULT_FDT_FILE="rk3288-vyasa.dtb" # CONFIG_DISPLAY_CPUINFO is not set CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_SPL_TEXT_BASE=0xff704000 CONFIG_SPL_STACK_R=y CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000 CONFIG_CMD_GPIO=y
PATCH 2/7 configs: vyasa-rk3288: Fix SPL_TEXT_BASE
Quoted 12 lines · Kever Yang
Quoted 9 lines · Jagan Teki
The initial Vyasa-rk3288 TPL implementation is to reuse the
SPL_TEXT_BASEfor TPL and SPL as0x0and0xff704000respectively.But the below commit implements the reverse way of using TEXT_BASE's like
0xff704000for TPL and0x0for SPL and which indeed update theSPL_TEXT_BASEfor vyasa-rk3288 board.
"rockchip:Kconfig: enable TPL support for rk3328"
(sha1:3f47db0275e0f1c1e89d8f13f8b4cdc86b1038ca)
Quoted 6 lines
Quoted 4 lines
So, fix by dropping the legacy
SPL_TEXT_BASEand it will reassign0x0by default based onKconfigdefinition.Reported-by Jagan Teki <[email protected]>Why this tag is needed for yourself?
Since, I have posted the bug on the mailing list.
PATCH 3/7 ram: rk3288: Initialize dram for TPL builds
In reply to Jagan TekiFew of the rk3288 boards like tinker, vyasa are using TPL, SPL bootchain so the dram initialization must needed during TPL stage. So add proper ifconstruct to satisfy both TPL, SPL and SPL-only bootchain boards.
This eventually fixing TPL to SPL handoff, otherwise missing dram initilaztion at TPL stage would leads to SPL hang.
--- drivers/ram/rockchip/sdram_rk3288.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
drivers/ram/rockchip/sdram_rk3288.c +10 -5
@@ -79,7 +79,8 @@ const int ddrconf_table[] = {#define DQS_GATE_TRAINING_ERROR_RANK0 (1 << 4)#define DQS_GATE_TRAINING_ERROR_RANK1 (2 << 4) -#ifdef CONFIG_SPL_BUILD +#if defined(CONFIG_TPL_BUILD ) || \ + (!defined(CONFIG_TPL ) && defined(CONFIG_SPL_BUILD ))static void copy_to_reg (u32 *dest,const u32 *src,u32 n) {int i;
@@ -1035,7 +1036,8 @@ static int conv_of_platdata(struct udevice *dev)static int rk3288_dmc_probe (struct udevice *dev) { -#ifdef CONFIG_SPL_BUILD +#if defined(CONFIG_TPL_BUILD ) || \ + (!defined(CONFIG_TPL ) && defined(CONFIG_SPL_BUILD ))struct rk3288_sdram_params *plat =dev_get_platdata (dev);struct udevice *dev_clk;struct regmap *map;
@@ -1044,7 +1046,8 @@ static int rk3288_dmc_probe(struct udevice *dev)struct dram_info *priv =dev_get_priv (dev); priv->pmu =syscon_get_first_range (ROCKCHIP_SYSCON_PMU ); -#ifdef CONFIG_SPL_BUILD +#if defined(CONFIG_TPL_BUILD ) || \ + (!defined(CONFIG_TPL ) && defined(CONFIG_SPL_BUILD ))#if CONFIG_IS_ENABLED (OF_PLATDATA ) ret =conv_of_platdata (dev);if (ret)
@@ -1111,12 +1114,14 @@ U_BOOT_DRIVER(dmc_rk3288) = { .id = UCLASS_RAM, .of_match = rk3288_dmc_ids, .ops = &rk3288_dmc_ops, -#ifdef CONFIG_SPL_BUILD +#if defined(CONFIG_TPL_BUILD) || \ + (!defined(CONFIG_TPL) && defined(CONFIG_SPL_BUILD)) .ofdata_to_platdata = rk3288_dmc_ofdata_to_platdata, #endif .probe = rk3288_dmc_probe, .priv_auto_alloc_size = sizeof(struct dram_info), -#ifdef CONFIG_SPL_BUILD +#if defined(CONFIG_TPL_BUILD) || \ + (!defined(CONFIG_TPL) && defined(CONFIG_SPL_BUILD)) .platdata_auto_alloc_size = sizeof(struct rk3288_sdram_params), #endif };
Signature · 1 line
2.18.0.321.gffc6fa0e3
PATCH 3/7 ram: rk3288: Initialize dram for TPL builds
Quoted 9 lines · Jagan Teki
Few of the rk3288 boards like tinker, vyasa are using TPL, SPL bootchain so the dram initialization must needed during TPL stage. So add proper ifconstruct to satisfy both TPL, SPL and SPL-only bootchain boards.
This eventually fixing TPL to SPL handoff, otherwise missing dram initilaztion at TPL stage would leads to SPL hang.
Signed-off-by Jagan Teki <[email protected]>
Thanks,
- Kever
Quoted 55 lines
--- drivers/ram/rockchip/sdram_rk3288.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)drivers/ram/rockchip/sdram_rk3288.c +10
-5@@ -79,7 +79,8 @@ const int ddrconf_table[] = {#define DQS_GATE_TRAINING_ERROR_RANK0 (1 << 4)#define DQS_GATE_TRAINING_ERROR_RANK1 (2 << 4) -#ifdef CONFIG_SPL_BUILD +#if defined(CONFIG_TPL_BUILD ) || \ + (!defined(CONFIG_TPL ) && defined(CONFIG_SPL_BUILD ))static void copy_to_reg (u32 *dest,const u32 *src,u32 n) {int i;@@ -1035,7 +1036,8 @@ static int conv_of_platdata(struct udevice *dev)static int rk3288_dmc_probe (struct udevice *dev) { -#ifdef CONFIG_SPL_BUILD +#if defined(CONFIG_TPL_BUILD ) || \ + (!defined(CONFIG_TPL ) && defined(CONFIG_SPL_BUILD ))struct rk3288_sdram_params *plat =dev_get_platdata (dev);struct udevice *dev_clk;struct regmap *map;@@ -1044,7 +1046,8 @@ static int rk3288_dmc_probe(struct udevice *dev)struct dram_info *priv =dev_get_priv (dev); priv->pmu =syscon_get_first_range (ROCKCHIP_SYSCON_PMU ); -#ifdef CONFIG_SPL_BUILD +#if defined(CONFIG_TPL_BUILD ) || \ + (!defined(CONFIG_TPL ) && defined(CONFIG_SPL_BUILD ))#if CONFIG_IS_ENABLED (OF_PLATDATA ) ret =conv_of_platdata (dev);if (ret)@@ -1111,12 +1114,14 @@ U_BOOT_DRIVER(dmc_rk3288) = { .id = UCLASS_RAM, .of_match = rk3288_dmc_ids, .ops = &rk3288_dmc_ops, -#ifdef CONFIG_SPL_BUILD +#if defined(CONFIG_TPL_BUILD) || \ + (!defined(CONFIG_TPL) && defined(CONFIG_SPL_BUILD)) .ofdata_to_platdata = rk3288_dmc_ofdata_to_platdata, #endif .probe = rk3288_dmc_probe, .priv_auto_alloc_size = sizeof(struct dram_info), -#ifdef CONFIG_SPL_BUILD +#if defined(CONFIG_TPL_BUILD) || \ + (!defined(CONFIG_TPL) && defined(CONFIG_SPL_BUILD)) .platdata_auto_alloc_size = sizeof(struct rk3288_sdram_params), #endif };
PATCH 4/7 rockchip: spi-boot-order: Trival fix to newline missing
In reply to Jagan Tekinewline \n was missed in fdt_path_offset, error loop.
--- arch/arm/mach-rockchip/spl-boot-order.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-rockchip/spl-boot-order.c +1 -1
@@ -134,7 +134,7 @@ void board_boot_order(u32 *spl_boot_list)/* Try to resolve the config item (or alias) as a path */ node =fdt_path_offset (blob, conf);if (node <0 ) { -debug ("%s: could not find %s in FDT" , __func__, conf); +debug ("%s: could not find %s in FDT\n" , __func__, conf);continue ; }
Signature · 1 line
2.18.0.321.gffc6fa0e3
PATCH 4/7 rockchip: spi-boot-order: Trival fix to newline missing
Quoted 3 lines · Jagan Teki
newline \n was missed in
fdt_path_offset, error loop.Signed-off-by Jagan Teki <[email protected]>
Thanks,
- Kever
Quoted 17 lines
--- arch/arm/mach-rockchip/spl-boot-order.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm/mach-rockchip/spl-boot-order.c +1
-1@@ -134,7 +134,7 @@ void board_boot_order(u32 *spl_boot_list)/* Try to resolve the config item (or alias) as a path */ node =fdt_path_offset (blob, conf);if (node <0 ) { -debug ("%s: could not find %s in FDT" , __func__, conf); +debug ("%s: could not find %s in FDT\n" , __func__, conf);continue ; }
PATCH 5/7 configs: tinker: Drop explicit SPL_TEXT
In reply to Jagan TekiSPL_TEXT_BASE is 0x0 by default, based on the kconfig definition move in below commit.
"configs: move CONFIG_SPL_TEXT_BASE to Kconfig"
(sha1: f89d6133eef2e068f9c33853b6584d7fcbfa9d2e)
So, don't define it explicitly.
--- configs/tinker-rk3288_defconfig | 1 - 1 file changed, 1 deletion(-)
configs/tinker-rk3288_defconfig +0 -1
@@ -15,7 +15,6 @@ CONFIG_CONSOLE_MUX=y CONFIG_DEFAULT_FDT_FILE="rk3288-tinker.dtb" # CONFIG_DISPLAY_CPUINFO is not set CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_SPL_TEXT_BASE=0 CONFIG_CMD_GPIO=y CONFIG_CMD_GPT=y CONFIG_CMD_I2C=y
Signature · 1 line
2.18.0.321.gffc6fa0e3
PATCH 5/7 configs: tinker: Drop explicit SPL_TEXT
Quoted 9 lines · Jagan Teki
SPL_TEXT_BASEis0x0by default, based on the kconfig definition move in below commit."configs: move
CONFIG_SPL_TEXT_BASEtoKconfig"
(sha1:f89d6133eef2e068f9c33853b6584d7fcbfa9d2e)So, don't define it explicitly.
Signed-off-by Jagan Teki <[email protected]>
Thanks,
- Kever
Quoted 16 lines
--- configs/tinker-rk3288_defconfig | 1 - 1 file changed, 1 deletion(-)configs/tinker-rk3288_defconfig +0
-1@@ -15,7 +15,6 @@ CONFIG_CONSOLE_MUX=y CONFIG_DEFAULT_FDT_FILE="rk3288-tinker.dtb" # CONFIG_DISPLAY_CPUINFO is not set CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_SPL_TEXT_BASE=0 CONFIG_CMD_GPIO=y CONFIG_CMD_GPT=y CONFIG_CMD_I2C=y
PATCH 6/7 configs: tinker: Enable SDRAM, SPL stack
In reply to Jagan TekiSPL sets up SDRAM while in its board_init_f() function, it is possible for the stack to move there before board_init_r() is reached.
So it is required to reserve the stack for SDRAM, with a proper location and size otherwise any operations during SPL handoff would leads to failure.
On, this particular context tinker-rk3288 SPL is failing to launch U-Boot proper on SDRAM due to lack of stack.
U-Boot SPL 2019.10-rc3-00297-g5ba8b12543 (Sep 12 2019 - 08:50:36 +0530) Trying to boot from MMC1
spl: mmc init failed with error: -110
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###
So, enable SPL_STACK_R_ADDR and it's related-config items for SDRAM, SPL stack to setup properly.
--- configs/tinker-rk3288_defconfig | 3 +++ 1 file changed, 3 insertions(+)
configs/tinker-rk3288_defconfig +3 -0
@@ -4,6 +4,7 @@ CONFIG_SYS_TEXT_BASE=0x01000000 CONFIG_ROCKCHIP_RK3288=y CONFIG_TARGET_TINKER_RK3288=y CONFIG_NR_DRAM_BANKS=1 +CONFIG_SPL_STACK_R_ADDR=0x80000 CONFIG_SPL_SIZE_LIMIT=307200 CONFIG_DEBUG_UART_BASE=0xff690000 CONFIG_DEBUG_UART_CLOCK=24000000
@@ -15,6 +16,8 @@ CONFIG_CONSOLE_MUX=y CONFIG_DEFAULT_FDT_FILE="rk3288-tinker.dtb" # CONFIG_DISPLAY_CPUINFO is not set CONFIG_DISPLAY_BOARDINFO_LATE=y +CONFIG_SPL_STACK_R=y +CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000 CONFIG_CMD_GPIO=y CONFIG_CMD_GPT=y CONFIG_CMD_I2C=y
Signature · 1 line
2.18.0.321.gffc6fa0e3
PATCH 6/7 configs: tinker: Enable SDRAM, SPL stack
Quoted 11 lines · Jagan Teki
SPL sets up SDRAM while in its
board_init_f()function, it is possible for the stack to move there beforeboard_init_r()is reached.So it is required to reserve the stack for SDRAM, with a proper location and size otherwise any operations during SPL handoff would leads to failure.
On, this particular context tinker-rk3288 SPL is failing to launch U-Boot proper on SDRAM due to lack of stack.
If no SPL_STACK_R, it should still use CONFIG_SPL_STACK when system init, right?
It sounds like this should not cause failure if there no one touch the CONFIG_SPL_STACK area.
Thanks,
- Kever
Quoted 37 lines
U-Boot SPL 2019.10-rc3-00297-g5ba8b12543 (Sep 12 2019 - 08:50:36 +0530) Trying to boot from MMC1
spl: mmc init failed with error: -110
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###So, enable
SPL_STACK_R_ADDRand it's related-config items for SDRAM, SPL stack to setup properly.Reported-by Jagan Teki <[email protected]>Signed-off-by Jagan Teki <[email protected]>--- configs/tinker-rk3288_defconfig | 3 +++ 1 file changed, 3 insertions(+)configs/tinker-rk3288_defconfig +3
-0@@ -4,6 +4,7 @@ CONFIG_SYS_TEXT_BASE=0x01000000 CONFIG_ROCKCHIP_RK3288=y CONFIG_TARGET_TINKER_RK3288=y CONFIG_NR_DRAM_BANKS=1 +CONFIG_SPL_STACK_R_ADDR=0x80000 CONFIG_SPL_SIZE_LIMIT=307200 CONFIG_DEBUG_UART_BASE=0xff690000 CONFIG_DEBUG_UART_CLOCK=24000000@@ -15,6 +16,8 @@ CONFIG_CONSOLE_MUX=y CONFIG_DEFAULT_FDT_FILE="rk3288-tinker.dtb" # CONFIG_DISPLAY_CPUINFO is not set CONFIG_DISPLAY_BOARDINFO_LATE=y +CONFIG_SPL_STACK_R=y +CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000 CONFIG_CMD_GPIO=y CONFIG_CMD_GPT=y CONFIG_CMD_I2C=y
PATCH 6/7 configs: tinker: Enable SDRAM, SPL stack
Quoted 11 lines · Kever Yang
Quoted 8 lines · Jagan Teki
SPL sets up SDRAM while in its
board_init_f()function, it is possible for the stack to move there beforeboard_init_r()is reached.So it is required to reserve the stack for SDRAM, with a proper location and size otherwise any operations during SPL handoff would leads to failure.
Quoted 6 lines
Quoted 3 lines
On, this particular context tinker-rk3288 SPL is failing to launch U-Boot proper on SDRAM due to lack of stack.
If no
SPL_STACK_R, it should still useCONFIG_SPL_STACKwhen system init, right?
SPL_STACK vs SPL_STTACK_R would be different in their usage former is used to setup the stack during early while calling board_init_f but the later used to setup the stack (with DRAM base) while calling board_init_r. if CONFIG_SPL_STACK_R is defined, then at this point the stack and global_data are relocated to below CONFIG_SPL_STACK_R_ADDR.
CONFIG_SPL_STACK_R_ADDR - 0x80000 (this would be as part of sdram map) CONFIG_SPL_STACK - 0xff718000 (this address where SDRAM not been used)
Since the issue, is due to launch U-Boot proper from mmc, the stack that SPL during that time was not set it up.
Quoted 3 lines
It sounds like this should not cause failure if there no one touch the
CONFIG_SPL_STACKarea.
I remember while implementing TPL, on vyasa I do take care of this STACK_R, so same been reused it for tinker.
PATCH 6/7 configs: tinker: Enable SDRAM, SPL stack
Quoted 22 lines · Jagan Teki
Quoted 10 lines · Kever Yang
Quoted 8 lines · Jagan Teki
SPL sets up SDRAM while in its
board_init_f()function, it is possible for the stack to move there beforeboard_init_r()is reached.So it is required to reserve the stack for SDRAM, with a proper location and size otherwise any operations during SPL handoff would leads to failure.
Quoted 5 lines
Quoted 3 lines
On, this particular context tinker-rk3288 SPL is failing to launch U-Boot proper on SDRAM due to lack of stack.
If no
SPL_STACK_R, it should still useCONFIG_SPL_STACKwhen system init, right?
SPL_STACKvsSPL_STTACK_Rwould be different in their usage former is used to setup the stack during early while callingboard_init_fbut the later used to setup the stack (with DRAM base) while callingboard_init_r. ifCONFIG_SPL_STACK_Ris defined, then at this point the stack andglobal_dataare relocated to belowCONFIG_SPL_STACK_R_ADDR.
Quoted 5 lines
CONFIG_SPL_STACK_R_ADDR-0x80000(this would be as part of sdram map)CONFIG_SPL_STACK-0xff718000(this address where SDRAM not been used)Since the issue, is due to launch U-Boot proper from mmc, the stack that SPL during that time was not set it up.
I think the root cause is: the master of emmc controller can no access SRAM, and the emmc init
driver needs to use memory based on CONFIG_SPL_STACK, if this is in SRAM, then the emmc driver
will init fail, and 'fifo-mode' can work around this issue. So the CONFIG_SPL_STACK_R is needed
for emmc/sd controller driver.
Thanks,
- Kever
Quoted 6 lines
Quoted 3 lines
It sounds like this should not cause failure if there no one touch the
CONFIG_SPL_STACKarea.I remember while implementing TPL, on vyasa I do take care of this
STACK_R, so same been reused it for tinker.
PATCH 6/7 configs: tinker: Enable SDRAM, SPL stack
Quoted 31 lines · Kever Yang
Quoted 22 lines · Jagan Teki
Quoted 10 lines · Kever Yang
Quoted 8 lines · Jagan Teki
SPL sets up SDRAM while in its
board_init_f()function, it is possible for the stack to move there beforeboard_init_r()is reached.So it is required to reserve the stack for SDRAM, with a proper location and size otherwise any operations during SPL handoff would leads to failure.
Quoted 5 lines
Quoted 3 lines
On, this particular context tinker-rk3288 SPL is failing to launch U-Boot proper on SDRAM due to lack of stack.
If no
SPL_STACK_R, it should still useCONFIG_SPL_STACKwhen system init, right?
SPL_STACKvsSPL_STTACK_Rwould be different in their usage former is used to setup the stack during early while callingboard_init_fbut the later used to setup the stack (with DRAM base) while callingboard_init_r. ifCONFIG_SPL_STACK_Ris defined, then at this point the stack andglobal_dataare relocated to belowCONFIG_SPL_STACK_R_ADDR.Quoted 5 lines
CONFIG_SPL_STACK_R_ADDR-0x80000(this would be as part of sdram map)CONFIG_SPL_STACK-0xff718000(this address where SDRAM not been used)Since the issue, is due to launch U-Boot proper from mmc, the stack that SPL during that time was not set it up.
Quoted 7 lines
I think the root cause is: the master of emmc controller can no access SRAM, and the emmc init
driver needs to use memory based onCONFIG_SPL_STACK, if this is in SRAM, then the emmc driver
will init fail, and 'fifo-mode' can work around this issue. So theCONFIG_SPL_STACK_Ris needed
for emmc/sd controller driver.
Not sure, because tinker-rk3288 doesn't have eMMC.
PATCH 6/7 configs: tinker: Enable SDRAM, SPL stack
In reply to Jagan TekiQuoted 18 lines · Jagan Teki
SPL sets up SDRAM while in its
board_init_f()function, it is possible for the stack to move there beforeboard_init_r()is reached.So it is required to reserve the stack for SDRAM, with a proper location and size otherwise any operations during SPL handoff would leads to failure.
On, this particular context tinker-rk3288 SPL is failing to launch U-Boot proper on SDRAM due to lack of stack.
U-Boot SPL 2019.10-rc3-00297-g5ba8b12543 (Sep 12 2019 - 08:50:36 +0530) Trying to boot from MMC1
spl: mmc init failed with error: -110
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###
Quoted 5 lines
So, enable
SPL_STACK_R_ADDRand it's related-config items for SDRAM, SPL stack to setup properly.Reported-by Jagan Teki <[email protected]>Signed-off-by Jagan Teki <[email protected]>
Thanks,
- Kever
Quoted 25 lines
--- configs/tinker-rk3288_defconfig | 3 +++ 1 file changed, 3 insertions(+)configs/tinker-rk3288_defconfig +3
-0@@ -4,6 +4,7 @@ CONFIG_SYS_TEXT_BASE=0x01000000 CONFIG_ROCKCHIP_RK3288=y CONFIG_TARGET_TINKER_RK3288=y CONFIG_NR_DRAM_BANKS=1 +CONFIG_SPL_STACK_R_ADDR=0x80000 CONFIG_SPL_SIZE_LIMIT=307200 CONFIG_DEBUG_UART_BASE=0xff690000 CONFIG_DEBUG_UART_CLOCK=24000000@@ -15,6 +16,8 @@ CONFIG_CONSOLE_MUX=y CONFIG_DEFAULT_FDT_FILE="rk3288-tinker.dtb" # CONFIG_DISPLAY_CPUINFO is not set CONFIG_DISPLAY_BOARDINFO_LATE=y +CONFIG_SPL_STACK_R=y +CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000 CONFIG_CMD_GPIO=y CONFIG_CMD_GPT=y CONFIG_CMD_I2C=y
PATCH 7/7 rockchip: rk3288-tinker: Attach missing peripherals at SPL
In reply to Jagan TekiFrom: Michael Trimarchi <[email protected]>
Tinker board needs to mux all the sdmmc gpio and activate the regulator connected to bank 7. Remove all the bank that are not in use and mark them as dm,spl so-that it would initialize at SPL.
--- arch/arm/dts/rk3288-tinker-u-boot.dtsi | 26 +++++++++++++++++++------- configs/tinker-rk3288_defconfig | 5 +++++ 2 files changed, 24 insertions(+), 7 deletions(-)
arch/arm/dts/rk3288-tinker-u-boot.dtsi +19 -7
@@ -13,20 +13,20 @@ u-boot,dm-pre-reloc; }; -&sdmmc { +&uart2_xfer { u-boot,dm-pre-reloc; }; -&emmc { - u-boot,dm-pre-reloc; +&sdmmc { + u-boot,dm-spl; }; -&gpio3 { - u-boot,dm-pre-reloc; +&gpio7 { + u-boot,dm-spl; }; -&gpio8 { - u-boot,dm-pre-reloc; +&vcc_sd { + u-boot,dm-spl; }; &pcfg_pull_none_drv_8ma {
@@ -37,10 +37,22 @@ u-boot,dm-spl; }; +&pcfg_pull_none { + u-boot,dm-spl; +}; + +&pcfg_pull_up { + u-boot,dm-spl; +}; + &sdmmc_bus4 { u-boot,dm-spl; }; +&sdmmc_cd { + u-boot,dm-spl; +}; + &sdmmc_clk { u-boot,dm-spl; };
configs/tinker-rk3288_defconfig +5 -0
@@ -49,7 +49,10 @@ CONFIG_FASTBOOT_FLASH=y CONFIG_FASTBOOT_FLASH_MMC_DEV=0 CONFIG_FASTBOOT_CMD_OEM_FORMAT=y CONFIG_ROCKCHIP_GPIO=y +CONFIG_SPL_GPIO_SUPPORT=y CONFIG_SYS_I2C_ROCKCHIP=y +CONFIG_SPL_I2C_SUPPORT=y +CONFIG_SPL_POWER_SUPPORT=y CONFIG_MISC=y CONFIG_I2C_EEPROM=y CONFIG_MMC_DW=y
@@ -64,7 +67,9 @@ CONFIG_SPL_PINCTRL=y CONFIG_DM_PMIC=y CONFIG_PMIC_RK8XX=y CONFIG_DM_REGULATOR_FIXED=y +CONFIG_SPL_DM_REGULATOR=y CONFIG_REGULATOR_RK8XX=y +CONFIG_SPL_DM_REGULATOR_FIXED=y CONFIG_PWM_ROCKCHIP=y CONFIG_RAM=y CONFIG_SPL_RAM=y
Signature · 1 line
2.18.0.321.gffc6fa0e3
PATCH 7/7 rockchip: rk3288-tinker: Attach missing peripherals at SPL
Quoted 1 line · Jagan Teki
From: Michael Trimarchi <[email protected]>
Thanks,
- Kever
Quoted 93 lines
Tinker board needs to mux all the sdmmc gpio and activate the regulator connected to bank 7. Remove all the bank that are not in use and mark them as dm,spl so-that it would initialize at SPL.
Signed-off-by Michael Trimarchi <[email protected]>Signed-off-by Jagan Teki <[email protected]>--- arch/arm/dts/rk3288-tinker-u-boot.dtsi | 26 +++++++++++++++++++------- configs/tinker-rk3288_defconfig | 5 +++++ 2 files changed, 24 insertions(+), 7 deletions(-)arch/arm/dts/rk3288-tinker-u-boot.dtsi +19
-7@@ -13,20 +13,20 @@ u-boot,dm-pre-reloc; }; -&sdmmc { +&uart2_xfer { u-boot,dm-pre-reloc; }; -&emmc { - u-boot,dm-pre-reloc; +&sdmmc { + u-boot,dm-spl; }; -&gpio3 { - u-boot,dm-pre-reloc; +&gpio7 { + u-boot,dm-spl; }; -&gpio8 { - u-boot,dm-pre-reloc; +&vcc_sd { + u-boot,dm-spl; }; &pcfg_pull_none_drv_8ma {@@ -37,10 +37,22 @@ u-boot,dm-spl; }; +&pcfg_pull_none { + u-boot,dm-spl; +}; + +&pcfg_pull_up { + u-boot,dm-spl; +}; + &sdmmc_bus4 { u-boot,dm-spl; }; +&sdmmc_cd { + u-boot,dm-spl; +}; + &sdmmc_clk { u-boot,dm-spl; };configs/tinker-rk3288_defconfig +5
-0@@ -49,7 +49,10 @@ CONFIG_FASTBOOT_FLASH=y CONFIG_FASTBOOT_FLASH_MMC_DEV=0 CONFIG_FASTBOOT_CMD_OEM_FORMAT=y CONFIG_ROCKCHIP_GPIO=y +CONFIG_SPL_GPIO_SUPPORT=y CONFIG_SYS_I2C_ROCKCHIP=y +CONFIG_SPL_I2C_SUPPORT=y +CONFIG_SPL_POWER_SUPPORT=y CONFIG_MISC=y CONFIG_I2C_EEPROM=y CONFIG_MMC_DW=y@@ -64,7 +67,9 @@ CONFIG_SPL_PINCTRL=y CONFIG_DM_PMIC=y CONFIG_PMIC_RK8XX=y CONFIG_DM_REGULATOR_FIXED=y +CONFIG_SPL_DM_REGULATOR=y CONFIG_REGULATOR_RK8XX=y +CONFIG_SPL_DM_REGULATOR_FIXED=y CONFIG_PWM_ROCKCHIP=y CONFIG_RAM=y CONFIG_SPL_RAM=y