[U-Boot] [PATCH 1/3] spl: set SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR to 0x4000 for rockchip

Rockchip use a 'loader2' partition for U-Boot, so u-boot.bin or u-boot.itb load by SPL need to locate at0x4000. Detail here: http://opensource.rock-chips.com/wiki_Boot_option
Signed-off-by: Kever Yang kever.yang@rock-chips.com ---
common/spl/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/common/spl/Kconfig b/common/spl/Kconfig index 0bd8370..e987c07 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -142,11 +142,12 @@ config SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR default 0x50 if ARCH_SUNXI default 0x75 if ARCH_DAVINCI default 0x8a if ARCH_MX6 - default 0x100 if ARCH_ROCKCHIP || ARCH_UNIPHIER + default 0x100 if ARCH_UNIPHIER default 0x140 if ARCH_MVEBU default 0x200 if ARCH_SOCFPGA || ARCH_AT91 default 0x300 if ARCH_ZYNQ || ARCH_KEYSTONE || OMAP34XX || OMAP44XX || \ OMAP54XX || AM33XX || AM43XX + default 0x4000 if ARCH_ROCKCHIP help Address on the MMC to load U-Boot from, when the MMC is being used in raw mode. Units: MMC sectors (1 sector = 512 bytes).

Update rockchip U-Boot location to 0x4000/16384.
Signed-off-by: Kever Yang kever.yang@rock-chips.com ---
doc/README.rockchip | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/doc/README.rockchip b/doc/README.rockchip index 4b7be0b..9d5af3d 100644 --- a/doc/README.rockchip +++ b/doc/README.rockchip @@ -99,13 +99,13 @@ To write an image that boots from an SD card (assumed to be /dev/sdc): ./firefly-rk3288/tools/mkimage -n rk3288 -T rksd -d \ firefly-rk3288/spl/u-boot-spl-dtb.bin out && \ sudo dd if=out of=/dev/sdc seek=64 && \ - sudo dd if=firefly-rk3288/u-boot-dtb.img of=/dev/sdc seek=256 + sudo dd if=firefly-rk3288/u-boot-dtb.img of=/dev/sdc seek=16384
This puts the Rockchip header and SPL image first and then places the U-Boot -image at block 256 (i.e. 128KB from the start of the SD card). This +image at block 16384 (i.e. 4MB from the start of the SD card). This corresponds with this setting in U-Boot:
- #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 256 + #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x4000
Put this SD (or micro-SD) card into your board and reset it. You should see something like:

On 2 Nov 2017, at 08:16, Kever Yang kever.yang@rock-chips.com wrote:
Update rockchip U-Boot location to 0x4000/16384.
Signed-off-by: Kever Yang kever.yang@rock-chips.com
doc/README.rockchip | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/doc/README.rockchip b/doc/README.rockchip index 4b7be0b..9d5af3d 100644 --- a/doc/README.rockchip +++ b/doc/README.rockchip @@ -99,13 +99,13 @@ To write an image that boots from an SD card (assumed to be /dev/sdc): ./firefly-rk3288/tools/mkimage -n rk3288 -T rksd -d \ firefly-rk3288/spl/u-boot-spl-dtb.bin out && \ sudo dd if=out of=/dev/sdc seek=64 && \
- sudo dd if=firefly-rk3288/u-boot-dtb.img of=/dev/sdc seek=256
- sudo dd if=firefly-rk3288/u-boot-dtb.img of=/dev/sdc seek=16384
This puts the Rockchip header and SPL image first and then places the U-Boot -image at block 256 (i.e. 128KB from the start of the SD card). This +image at block 16384 (i.e. 4MB from the start of the SD card). This corresponds with this setting in U-Boot:
- #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 256
- #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x4000
Could you use 'u-boot,spl-payload-offset’ to provide this info to U-Boot or is there a strong reason to hard-code this?
Put this SD (or micro-SD) card into your board and reset it. You should see something like: -- 1.9.1

On 11/03/2017 05:42 PM, Dr. Philipp Tomsich wrote:
On 2 Nov 2017, at 08:16, Kever Yang kever.yang@rock-chips.com wrote:
Update rockchip U-Boot location to 0x4000/16384.
Signed-off-by: Kever Yang kever.yang@rock-chips.com
doc/README.rockchip | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/doc/README.rockchip b/doc/README.rockchip index 4b7be0b..9d5af3d 100644 --- a/doc/README.rockchip +++ b/doc/README.rockchip @@ -99,13 +99,13 @@ To write an image that boots from an SD card (assumed to be /dev/sdc): ./firefly-rk3288/tools/mkimage -n rk3288 -T rksd -d \ firefly-rk3288/spl/u-boot-spl-dtb.bin out && \ sudo dd if=out of=/dev/sdc seek=64 && \
- sudo dd if=firefly-rk3288/u-boot-dtb.img of=/dev/sdc seek=256
- sudo dd if=firefly-rk3288/u-boot-dtb.img of=/dev/sdc seek=16384
This puts the Rockchip header and SPL image first and then places the U-Boot -image at block 256 (i.e. 128KB from the start of the SD card). This +image at block 16384 (i.e. 4MB from the start of the SD card). This corresponds with this setting in U-Boot:
- #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 256
- #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x4000
Could you use 'u-boot,spl-payload-offset’ to provide this info to U-Boot or is there a strong reason to hard-code this?
Because it's simple enough for use.
To be honest, I didn't notice there is a DTS node for spl-payload-offset, the reason is like env offset. And I didn't see a good reason to move this to DTS: - Almost all the SoCs using the macro define in header file or default value in Kconfig, using dts is not popular way; - I don't think we need to add a node for each SoC dtsi, we only need one MACRO define in common header and use it directly instead of parse it from different SoC dtsi; - kernel dtsi file does not have the 'u-boot,spl-payload-offset' node, that means we have to add them in dtsi for each soc when we add one soc support, I think most people do not have idea about this, why don't we make it easier?
Thanks, - Kever
Put this SD (or micro-SD) card into your board and reset it. You should see something like: -- 1.9.1

Update rockchip U-Boot location to 0x4000/16384.
Signed-off-by: Kever Yang kever.yang@rock-chips.com
doc/README.rockchip | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Acked-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com

Update rockchip U-Boot location to 0x4000/16384.
Signed-off-by: Kever Yang kever.yang@rock-chips.com Acked-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com
doc/README.rockchip | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Reviewed-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com

Update rockchip U-Boot location to 0x4000/16384.
Signed-off-by: Kever Yang kever.yang@rock-chips.com Acked-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com Reviewed-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com
doc/README.rockchip | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Applied to u-boot-rockchip, thanks!

Use default value 0x4000 for SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR instead of define a new one.
Signed-off-by: Kever Yang kever.yang@rock-chips.com ---
configs/evb-rk3399_defconfig | 1 - configs/firefly-rk3399_defconfig | 1 - 2 files changed, 2 deletions(-)
diff --git a/configs/evb-rk3399_defconfig b/configs/evb-rk3399_defconfig index 7a0bd4a..a6c5b82 100644 --- a/configs/evb-rk3399_defconfig +++ b/configs/evb-rk3399_defconfig @@ -12,7 +12,6 @@ CONFIG_SPL_LOAD_FIT=y # CONFIG_DISPLAY_CPUINFO is not set CONFIG_SPL_STACK_R=y CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x4000 -CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x200 CONFIG_CMD_BOOTZ=y # CONFIG_CMD_IMLS is not set CONFIG_CMD_GPT=y diff --git a/configs/firefly-rk3399_defconfig b/configs/firefly-rk3399_defconfig index 94b9209..c942072 100644 --- a/configs/firefly-rk3399_defconfig +++ b/configs/firefly-rk3399_defconfig @@ -12,7 +12,6 @@ CONFIG_SPL_LOAD_FIT=y # CONFIG_DISPLAY_CPUINFO is not set CONFIG_SPL_STACK_R=y CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x4000 -CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x200 CONFIG_SPL_ATF_SUPPORT=y CONFIG_SPL_ATF_TEXT_BASE=0x00010000 CONFIG_CMD_BOOTZ=y

Use default value 0x4000 for SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR instead of define a new one.
Signed-off-by: Kever Yang kever.yang@rock-chips.com
configs/evb-rk3399_defconfig | 1 - configs/firefly-rk3399_defconfig | 1 - 2 files changed, 2 deletions(-)
Acked-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com

Use default value 0x4000 for SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR instead of define a new one.
Signed-off-by: Kever Yang kever.yang@rock-chips.com Acked-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com
configs/evb-rk3399_defconfig | 1 - configs/firefly-rk3399_defconfig | 1 - 2 files changed, 2 deletions(-)
Reviewed-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com

Use default value 0x4000 for SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR instead of define a new one.
Signed-off-by: Kever Yang kever.yang@rock-chips.com Acked-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com Reviewed-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com
configs/evb-rk3399_defconfig | 1 - configs/firefly-rk3399_defconfig | 1 - 2 files changed, 2 deletions(-)
Applied to u-boot-rockchip, thanks!

On Thu, Nov 2, 2017 at 12:46 PM, Kever Yang kever.yang@rock-chips.com wrote:
Rockchip use a 'loader2' partition for U-Boot, so u-boot.bin or u-boot.itb load by SPL need to locate at0x4000. Detail here: http://opensource.rock-chips.com/wiki_Boot_option
Sorry, I'm not clear is this because of arm64 itb? and we should have 16320 sectors in between SPL and U-Boot which is huge isn't it?
thanks!

Hi Jegan,
On 11/02/2017 03:32 PM, Jagan Teki wrote:
On Thu, Nov 2, 2017 at 12:46 PM, Kever Yang kever.yang@rock-chips.com wrote:
Rockchip use a 'loader2' partition for U-Boot, so u-boot.bin or u-boot.itb load by SPL need to locate at0x4000. Detail here: http://opensource.rock-chips.com/wiki_Boot_option
Sorry, I'm not clear is this because of arm64 itb? and we should have 16320 sectors in between SPL and U-Boot which is huge isn't it?
No, this is nothing to do with arm64 itb. You can over write this in your board if you use a different partition table from Rockchip one.
We use 0x4000 because we have use this value for many years for U-Boot image, no matter it's uboot.img or u-boot.bin or u-boot.itb, I think it's better to sync this value for all Rockchip plaltform including Linux and Android OS in all SoCs.
Thanks, - Kever
thanks!

On 06-Nov-2017 3:37 PM, "Kever Yang" kever.yang@rock-chips.com wrote:
Hi Jegan,
On 11/02/2017 03:32 PM, Jagan Teki wrote:
On Thu, Nov 2, 2017 at 12:46 PM, Kever Yang kever.yang@rock-chips.com wrote:
Rockchip use a 'loader2' partition for U-Boot, so u-boot.bin or u-boot.itb load by SPL need to locate at0x4000. Detail here: http://opensource.rock-chips.com/wiki_Boot_option
Sorry, I'm not clear is this because of arm64 itb? and we should have 16320 sectors in between SPL and U-Boot which is huge isn't it?
No, this is nothing to do with arm64 itb. You can over write this in your board if you use a different partition table from Rockchip one.
We use 0x4000 because we have use this value for many years for U-Boot image, no matter it's uboot.img or u-boot.bin or u-boot.itb, I think it's better to sync this value for all Rockchip plaltform including Linux and Android OS in all SoCs.
Sorry, this I didn't understand we left 8M between SPL and U-Boot. What exactly the use case I never observed any issue case like this.
Can you please elaborate, I understand I can override this but what to know because generally falcon configuration itself start just from 2M

On 11/07/2017 01:42 AM, Jagan Teki wrote:
On 06-Nov-2017 3:37 PM, "Kever Yang" <kever.yang@rock-chips.com mailto:kever.yang@rock-chips.com> wrote:
Hi Jegan, On 11/02/2017 03:32 PM, Jagan Teki wrote: On Thu, Nov 2, 2017 at 12:46 PM, Kever Yang <kever.yang@rock-chips.com <mailto:kever.yang@rock-chips.com>> wrote: Rockchip use a 'loader2' partition for U-Boot, so u-boot.bin or u-boot.itb load by SPL need to locate at0x4000. Detail here: http://opensource.rock-chips.com/wiki_Boot_option <http://opensource.rock-chips.com/wiki_Boot_option> Sorry, I'm not clear is this because of arm64 itb? and we should have 16320 sectors in between SPL and U-Boot which is huge isn't it? No, this is nothing to do with arm64 itb. You can over write this in your board if you use a different partition table from Rockchip one. We use 0x4000 because we have use this value for many years for U-Boot image, no matter it's uboot.img or u-boot.bin or u-boot.itb, I think it's better to sync this value for all Rockchip plaltform including Linux and Android OS in all SoCs.
Sorry, this I didn't understand we left 8M between SPL and U-Boot. What exactly the use case I never observed any issue case like this.
Here is something more detail: http://opensource.rock-chips.com/wiki_Partitions
Rockchip have Android first, and then Linux, so we want to make the partitions before kernel/system can be compatible.
Thanks, - Kever
Can you please elaborate, I understand I can override this but what to know because generally falcon configuration itself start just from 2M

Rockchip use a 'loader2' partition for U-Boot, so u-boot.bin or u-boot.itb load by SPL need to locate at0x4000. Detail here: http://opensource.rock-chips.com/wiki_Boot_option
Signed-off-by: Kever Yang kever.yang@rock-chips.com
common/spl/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Acked-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com

Rockchip use a 'loader2' partition for U-Boot, so u-boot.bin or u-boot.itb load by SPL need to locate at0x4000. Detail here: http://opensource.rock-chips.com/wiki_Boot_option
Signed-off-by: Kever Yang kever.yang@rock-chips.com Acked-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com
common/spl/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Reviewed-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com

Rockchip use a 'loader2' partition for U-Boot, so u-boot.bin or u-boot.itb load by SPL need to locate at0x4000. Detail here: http://opensource.rock-chips.com/wiki_Boot_option
Signed-off-by: Kever Yang kever.yang@rock-chips.com Acked-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com Reviewed-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com
common/spl/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Applied to u-boot-rockchip, thanks!
participants (4)
-
Dr. Philipp Tomsich
-
Jagan Teki
-
Kever Yang
-
Philipp Tomsich