[U-Boot] [PATCH] rockchip: rk3399: defconfig: add CONFIG_OF_EMBED support

Need to enablt CONFIG_OF_EMBED if we use separate uboot and dtb in FIT image for SPL loading.
Run make savedefconfig to make the options order correct.
Signed-off-by: Kever Yang kever.yang@rock-chips.com ---
configs/evb-rk3399_defconfig | 43 ++++++++++++++++++++----------------------- 1 file changed, 20 insertions(+), 23 deletions(-)
diff --git a/configs/evb-rk3399_defconfig b/configs/evb-rk3399_defconfig index 195a421..961fe8b 100644 --- a/configs/evb-rk3399_defconfig +++ b/configs/evb-rk3399_defconfig @@ -1,30 +1,37 @@ CONFIG_ARM=y CONFIG_ARCH_ROCKCHIP=y +CONFIG_SPL_LIBCOMMON_SUPPORT=y +CONFIG_SPL_LIBGENERIC_SUPPORT=y +CONFIG_SYS_MALLOC_F_LEN=0x4000 CONFIG_ROCKCHIP_RK3399=y +CONFIG_SPL_STACK_R_ADDR=0x80000 CONFIG_DEFAULT_DEVICE_TREE="rk3399-evb" CONFIG_FIT=y CONFIG_SPL_LOAD_FIT=y -CONFIG_SPL_OF_LIBFDT=y -CONFIG_SPL_ATF_SUPPORT=y -CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x200 -CONFIG_SPL_ATF_TEXT_BASE=0x00010000 # CONFIG_DISPLAY_CPUINFO is not set CONFIG_SPL_STACK_R=y -CONFIG_SPL_STACK_R_ADDR=0x80000 CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x4000 -CONFIG_SPL_LIBCOMMON_SUPPORT=y -CONFIG_SPL_LIBGENERIC_SUPPORT=y -CONFIG_SYS_MALLOC_F_LEN=0x4000 +CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x200 +CONFIG_SPL_ATF_SUPPORT=y +CONFIG_SPL_ATF_TEXT_BASE=0x00010000 +CONFIG_FASTBOOT=y +CONFIG_USB_FUNCTION_FASTBOOT=y +CONFIG_CMD_FASTBOOT=y +CONFIG_FASTBOOT_BUF_ADDR=0x00800800 +CONFIG_FASTBOOT_BUF_SIZE=0x08000000 +CONFIG_FASTBOOT_FLASH=y +CONFIG_FASTBOOT_FLASH_MMC_DEV=1 CONFIG_CMD_BOOTZ=y # CONFIG_CMD_IMLS is not set CONFIG_CMD_GPT=y CONFIG_CMD_MMC=y CONFIG_CMD_SF=y CONFIG_CMD_USB=y +CONFIG_CMD_USB_MASS_STORAGE=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_TIME=y -CONFIG_CMD_PXE=y CONFIG_SPL_OF_CONTROL=y +CONFIG_OF_EMBED=y CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" CONFIG_SPL_OF_PLATDATA=y CONFIG_REGMAP=y @@ -57,23 +64,13 @@ CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_EHCI_GENERIC=y -CONFIG_USB_STORAGE=y -CONFIG_USE_TINY_PRINTF=y -CONFIG_ERRNO_STR=y -CONFIG_USB_GADGET=y -CONFIG_USB_GADGET_DUALSPEED=y -CONFIG_USB_GADGET_VBUS_DRAW=0 CONFIG_USB_DWC3=y CONFIG_USB_DWC3_GADGET=y +CONFIG_USB_STORAGE=y +CONFIG_USB_GADGET=y CONFIG_USB_GADGET_DOWNLOAD=y CONFIG_G_DNL_MANUFACTURER="Rockchip" CONFIG_G_DNL_VENDOR_NUM=0x2207 CONFIG_G_DNL_PRODUCT_NUM=0x330a -CONFIG_FASTBOOT=y -CONFIG_CMD_FASTBOOT=y -CONFIG_USB_FUNCTION_FASTBOOT=y -CONFIG_FASTBOOT_FLASH=y -CONFIG_FASTBOOT_FLASH_MMC_DEV=1 -CONFIG_FASTBOOT_BUF_ADDR=0x00800800 -CONFIG_FASTBOOT_BUF_SIZE=0x08000000 -CONFIG_CMD_USB_MASS_STORAGE=y +CONFIG_USE_TINY_PRINTF=y +CONFIG_ERRNO_STR=y

Hi Kever,
On 7 April 2017 at 04:35, Kever Yang kever.yang@rock-chips.com wrote:
Need to enablt CONFIG_OF_EMBED if we use separate uboot and dtb in FIT image for SPL loading.
Can you please explain that a bit more? We shouldn't OF_EMBED in production code, only for debug/test.
Run make savedefconfig to make the options order correct.
Signed-off-by: Kever Yang kever.yang@rock-chips.com
configs/evb-rk3399_defconfig | 43 ++++++++++++++++++++----------------------- 1 file changed, 20 insertions(+), 23 deletions(-)
Regards, Simon

Hi Simon,
On 04/10/2017 03:28 AM, Simon Glass wrote:
Hi Kever,
On 7 April 2017 at 04:35, Kever Yang kever.yang@rock-chips.com wrote:
Need to enablt CONFIG_OF_EMBED if we use separate uboot and dtb in FIT image for SPL loading.
Can you please explain that a bit more? We shouldn't OF_EMBED in production code, only for debug/test.
When I test with latest code for SPL loading FIT which u-boot and dtb are separate, the U-Boot code can not find its dtb file. This issue is not happen when I test with code older than v2017.03, and with CONFIG_OF_EMBED, U-Boot can find dtb with latest code.
Maybe I need to do some debugging for root cause, please ignore this patch if this is not correct.
Thanks, - Kever
Run make savedefconfig to make the options order correct.
Signed-off-by: Kever Yang kever.yang@rock-chips.com
configs/evb-rk3399_defconfig | 43 ++++++++++++++++++++----------------------- 1 file changed, 20 insertions(+), 23 deletions(-)
Regards, Simon

Hi Kever,
On 9 April 2017 at 20:36, Kever Yang kever.yang@rock-chips.com wrote:
Hi Simon,
On 04/10/2017 03:28 AM, Simon Glass wrote:
Hi Kever,
On 7 April 2017 at 04:35, Kever Yang kever.yang@rock-chips.com wrote:
Need to enablt CONFIG_OF_EMBED if we use separate uboot and dtb in FIT image for SPL loading.
Can you please explain that a bit more? We shouldn't OF_EMBED in production code, only for debug/test.
When I test with latest code for SPL loading FIT which u-boot and dtb are separate, the U-Boot code can not find its dtb file. This issue is not happen when I test with code older than v2017.03, and with CONFIG_OF_EMBED, U-Boot can find dtb with latest code.
Maybe I need to do some debugging for root cause, please ignore this patch if this is not correct.
Yes this needs to be figured out. If you have the debug UART enabled you should be able to add debugging to fdtdec_setup() to see what is happening. Perhaps the DT is not word-aligned?
Regards, Simon
Thanks,
- Kever
Run make savedefconfig to make the options order correct.
Signed-off-by: Kever Yang kever.yang@rock-chips.com
configs/evb-rk3399_defconfig | 43 ++++++++++++++++++++----------------------- 1 file changed, 20 insertions(+), 23 deletions(-)
Regards, Simon

Hi Simon,
On 04/11/2017 09:55 PM, Simon Glass wrote:
Hi Kever,
On 9 April 2017 at 20:36, Kever Yang kever.yang@rock-chips.com wrote:
Hi Simon,
On 04/10/2017 03:28 AM, Simon Glass wrote:
Hi Kever,
On 7 April 2017 at 04:35, Kever Yang kever.yang@rock-chips.com wrote:
Need to enablt CONFIG_OF_EMBED if we use separate uboot and dtb in FIT image for SPL loading.
Can you please explain that a bit more? We shouldn't OF_EMBED in production code, only for debug/test.
When I test with latest code for SPL loading FIT which u-boot and dtb are separate, the U-Boot code can not find its dtb file. This issue is not happen when I test with code older than v2017.03, and with CONFIG_OF_EMBED, U-Boot can find dtb with latest code.
Maybe I need to do some debugging for root cause, please ignore this patch if this is not correct.
Yes this needs to be figured out. If you have the debug UART enabled you should be able to add debugging to fdtdec_setup() to see what is happening. Perhaps the DT is not word-aligned?
I find the root cause. I try to truncate the input image like uboot-no-dtb.bin and u-boot.dtb to block size 512, so the SPL get the image size is 512 aligned, but the fdtdec_setup() using the end of image address &_end which is not 512 aligned, and can not find available dtb.
I want to make the mkimage output header and input image aligned to 512 to reduce no necessary copy.
Thanks, - Kever
Regards, Simon
Thanks,
- Kever
Run make savedefconfig to make the options order correct.
Signed-off-by: Kever Yang kever.yang@rock-chips.com
configs/evb-rk3399_defconfig | 43 ++++++++++++++++++++----------------------- 1 file changed, 20 insertions(+), 23 deletions(-)
Regards, Simon

Hi Kever,
On 14 April 2017 at 01:59, Kever Yang kever.yang@rock-chips.com wrote:
Hi Simon,
On 04/11/2017 09:55 PM, Simon Glass wrote:
Hi Kever,
On 9 April 2017 at 20:36, Kever Yang kever.yang@rock-chips.com wrote:
Hi Simon,
On 04/10/2017 03:28 AM, Simon Glass wrote:
Hi Kever,
On 7 April 2017 at 04:35, Kever Yang kever.yang@rock-chips.com wrote:
Need to enablt CONFIG_OF_EMBED if we use separate uboot and dtb in FIT image for SPL loading.
Can you please explain that a bit more? We shouldn't OF_EMBED in production code, only for debug/test.
When I test with latest code for SPL loading FIT which u-boot and dtb are separate, the U-Boot code can not find its dtb file. This issue is not happen when I test with code older than v2017.03, and with CONFIG_OF_EMBED, U-Boot can find dtb with latest code.
Maybe I need to do some debugging for root cause, please ignore this patch if this is not correct.
Yes this needs to be figured out. If you have the debug UART enabled you should be able to add debugging to fdtdec_setup() to see what is happening. Perhaps the DT is not word-aligned?
I find the root cause. I try to truncate the input image like uboot-no-dtb.bin and u-boot.dtb to block size 512, so the SPL get the image size is 512 aligned, but the fdtdec_setup() using the end of image address &_end which is not 512 aligned, and can not find available dtb.
I want to make the mkimage output header and input image aligned to 512 to reduce no necessary copy.
I still don't really understand this. Can you not use u-boot.bin which includes both U-Boot and the DT? Then only the alignment of the whole file matters.
Instead of truncating you should pad - otherwise you lose data. But I suspect I just misunderstand what you mean.
Regards, Simon
participants (2)
-
Kever Yang
-
Simon Glass