ARM: zynq: Run distribution boot commands first
PATCH 1/2 ARM: zynq: Run distribution boot commands first
This patch is doing two things.
1. Exchanging order of boot commands. distro_bootcmd is run first followed by Xilinx boot command.
2. Remove CONFIG_BOOTCOMMAND from configs (and follow mainline) by creating Xilinx distribution bootcommand and wiring it as the last bootcommand.
QSPI, NAND distribution boot command will be added later.
---
configs/syzygy_hub_defconfig | 1 - configs/topic_miami_defconfig | 1 - configs/topic_miamilite_defconfig | 1 - configs/topic_miamiplus_defconfig | 1 - configs/zynq_cc108_defconfig | 1 - configs/zynq_dlc20_rev1_0_defconfig | 1 - configs/zynq_microzed_defconfig | 1 - configs/zynq_minized_defconfig | 1 - configs/zynq_picozed_defconfig | 1 - configs/zynq_z_turn_defconfig | 1 - configs/zynq_zc702_defconfig | 1 - configs/zynq_zc706_defconfig | 1 - configs/zynq_zc770_xm010_defconfig | 1 - configs/zynq_zc770_xm011_defconfig | 1 - configs/zynq_zc770_xm011_x16_defconfig | 1 - configs/zynq_zc770_xm012_defconfig | 1 - configs/zynq_zc770_xm013_defconfig | 1 - configs/zynq_zed_defconfig | 1 - configs/zynq_zybo_defconfig | 1 - configs/zynq_zybo_z7_defconfig | 1 - include/configs/zynq-common.h | 9 ++++++++- 21 files changed, 8 insertions(+), 21 deletions(-)
configs/syzygy_hub_defconfig +0 -1
@@ -13,7 +13,6 @@ CONFIG_FIT=y CONFIG_FIT_SIGNATURE=y CONFIG_FIT_VERBOSE=y CONFIG_IMAGE_FORMAT_LEGACY=y -CONFIG_BOOTCOMMAND="run $modeboot || run distro_bootcmd" CONFIG_SPL_STACK_R=y CONFIG_SPL_OS_BOOT=y CONFIG_SYS_PROMPT="Zynq> "
configs/topic_miami_defconfig +0 -1
@@ -11,7 +11,6 @@ CONFIG_BOOT_INIT_FILE="board/topic/zynq/zynq-topic-miami/ps7_regs.txt" CONFIG_DEBUG_UART=y CONFIG_DISTRO_DEFAULTS=y CONFIG_BOOTDELAY=0 -CONFIG_BOOTCOMMAND="run $modeboot || run distro_bootcmd" CONFIG_SPL_STACK_R=y CONFIG_SPL_SPI_LOAD=y CONFIG_SYS_PROMPT="zynq-uboot> "
configs/topic_miamilite_defconfig +0 -1
@@ -11,7 +11,6 @@ CONFIG_BOOT_INIT_FILE="board/topic/zynq/zynq-topic-miamilite/ps7_regs.txt" CONFIG_DEBUG_UART=y CONFIG_DISTRO_DEFAULTS=y CONFIG_BOOTDELAY=0 -CONFIG_BOOTCOMMAND="run $modeboot || run distro_bootcmd" CONFIG_SPL_STACK_R=y CONFIG_SPL_SPI_LOAD=y CONFIG_SYS_PROMPT="zynq-uboot> "
configs/topic_miamiplus_defconfig +0 -1
@@ -11,7 +11,6 @@ CONFIG_BOOT_INIT_FILE="board/topic/zynq/zynq-topic-miamiplus/ps7_regs.txt" CONFIG_DEBUG_UART=y CONFIG_DISTRO_DEFAULTS=y CONFIG_BOOTDELAY=0 -CONFIG_BOOTCOMMAND="run $modeboot || run distro_bootcmd" CONFIG_SPL_STACK_R=y CONFIG_SPL_SPI_LOAD=y CONFIG_SYS_PROMPT="zynq-uboot> "
configs/zynq_cc108_defconfig +0 -1
@@ -11,7 +11,6 @@ CONFIG_FIT=y CONFIG_FIT_SIGNATURE=y CONFIG_FIT_VERBOSE=y CONFIG_IMAGE_FORMAT_LEGACY=y -CONFIG_BOOTCOMMAND="run $modeboot || run distro_bootcmd" CONFIG_SPL_STACK_R=y CONFIG_SPL_SPI_LOAD=y CONFIG_SYS_PROMPT="Zynq> "
configs/zynq_dlc20_rev1_0_defconfig +0 -1
@@ -12,7 +12,6 @@ CONFIG_FIT=y CONFIG_FIT_SIGNATURE=y CONFIG_FIT_VERBOSE=y CONFIG_IMAGE_FORMAT_LEGACY=y -CONFIG_BOOTCOMMAND="run $modeboot || run distro_bootcmd" CONFIG_BOARD_EARLY_INIT_F=y CONFIG_SPL_STACK_R=y CONFIG_SPL_OS_BOOT=y
configs/zynq_microzed_defconfig +0 -1
@@ -8,7 +8,6 @@ CONFIG_FIT=y CONFIG_FIT_SIGNATURE=y CONFIG_FIT_VERBOSE=y CONFIG_IMAGE_FORMAT_LEGACY=y -CONFIG_BOOTCOMMAND="run $modeboot || run distro_bootcmd" CONFIG_SPL_STACK_R=y CONFIG_SPL_OS_BOOT=y CONFIG_SPL_SPI_LOAD=y
configs/zynq_minized_defconfig +0 -1
@@ -10,7 +10,6 @@ CONFIG_DISTRO_DEFAULTS=y CONFIG_FIT=y CONFIG_FIT_SIGNATURE=y CONFIG_FIT_VERBOSE=y -CONFIG_BOOTCOMMAND="run $modeboot || run distro_bootcmd" CONFIG_SPL_STACK_R=y CONFIG_SPL_OS_BOOT=y CONFIG_SYS_PROMPT="Zynq> "
configs/zynq_picozed_defconfig +0 -1
@@ -4,7 +4,6 @@ CONFIG_SYS_TEXT_BASE=0x4000000 CONFIG_SPL=y CONFIG_SPL_STACK_R_ADDR=0x200000 CONFIG_DISTRO_DEFAULTS=y -CONFIG_BOOTCOMMAND="run $modeboot || run distro_bootcmd" CONFIG_SPL_STACK_R=y CONFIG_SPL_OS_BOOT=y CONFIG_SYS_PROMPT="Zynq> "
configs/zynq_z_turn_defconfig +0 -1
@@ -11,7 +11,6 @@ CONFIG_FIT=y CONFIG_FIT_SIGNATURE=y CONFIG_FIT_VERBOSE=y CONFIG_IMAGE_FORMAT_LEGACY=y -CONFIG_BOOTCOMMAND="run $modeboot || run distro_bootcmd" CONFIG_SPL_STACK_R=y CONFIG_SPL_OS_BOOT=y CONFIG_SPL_SPI_LOAD=y
configs/zynq_zc702_defconfig +0 -1
@@ -12,7 +12,6 @@ CONFIG_FIT=y CONFIG_FIT_SIGNATURE=y CONFIG_FIT_VERBOSE=y CONFIG_IMAGE_FORMAT_LEGACY=y -CONFIG_BOOTCOMMAND="run $modeboot || run distro_bootcmd" CONFIG_SPL_STACK_R=y CONFIG_SPL_OS_BOOT=y CONFIG_SPL_SPI_LOAD=y
configs/zynq_zc706_defconfig +0 -1
@@ -14,7 +14,6 @@ CONFIG_FIT_VERBOSE=y CONFIG_SPL_FIT_PRINT=y CONFIG_SPL_LOAD_FIT=y CONFIG_IMAGE_FORMAT_LEGACY=y -CONFIG_BOOTCOMMAND="run $modeboot || run distro_bootcmd" CONFIG_SPL_STACK_R=y CONFIG_SPL_FPGA_SUPPORT=y CONFIG_SPL_OS_BOOT=y
configs/zynq_zc770_xm010_defconfig +0 -1
@@ -12,7 +12,6 @@ CONFIG_FIT=y CONFIG_FIT_SIGNATURE=y CONFIG_FIT_VERBOSE=y CONFIG_IMAGE_FORMAT_LEGACY=y -CONFIG_BOOTCOMMAND="run $modeboot || run distro_bootcmd" CONFIG_SPL_STACK_R=y CONFIG_SPL_OS_BOOT=y CONFIG_SPL_SPI_LOAD=y
configs/zynq_zc770_xm011_defconfig +0 -1
@@ -13,7 +13,6 @@ CONFIG_FIT=y CONFIG_FIT_SIGNATURE=y CONFIG_FIT_VERBOSE=y CONFIG_IMAGE_FORMAT_LEGACY=y -CONFIG_BOOTCOMMAND="run $modeboot || run distro_bootcmd" CONFIG_SPL_STACK_R=y CONFIG_SPL_OS_BOOT=y CONFIG_SYS_PROMPT="Zynq> "
configs/zynq_zc770_xm011_x16_defconfig +0 -1
@@ -13,7 +13,6 @@ CONFIG_FIT=y CONFIG_FIT_SIGNATURE=y CONFIG_FIT_VERBOSE=y CONFIG_IMAGE_FORMAT_LEGACY=y -CONFIG_BOOTCOMMAND="run $modeboot || run distro_bootcmd" CONFIG_SPL_STACK_R=y CONFIG_SPL_OS_BOOT=y CONFIG_SYS_PROMPT="Zynq> "
configs/zynq_zc770_xm012_defconfig +0 -1
@@ -10,7 +10,6 @@ CONFIG_FIT=y CONFIG_FIT_SIGNATURE=y CONFIG_FIT_VERBOSE=y CONFIG_IMAGE_FORMAT_LEGACY=y -CONFIG_BOOTCOMMAND="run $modeboot || run distro_bootcmd" CONFIG_SPL_STACK_R=y CONFIG_SPL_OS_BOOT=y CONFIG_SYS_PROMPT="Zynq> "
configs/zynq_zc770_xm013_defconfig +0 -1
@@ -10,7 +10,6 @@ CONFIG_FIT=y CONFIG_FIT_SIGNATURE=y CONFIG_FIT_VERBOSE=y CONFIG_IMAGE_FORMAT_LEGACY=y -CONFIG_BOOTCOMMAND="run $modeboot || run distro_bootcmd" CONFIG_SPL_STACK_R=y CONFIG_SPL_OS_BOOT=y CONFIG_SPL_SPI_LOAD=y
configs/zynq_zed_defconfig +0 -1
@@ -11,7 +11,6 @@ CONFIG_FIT=y CONFIG_FIT_SIGNATURE=y CONFIG_FIT_VERBOSE=y CONFIG_IMAGE_FORMAT_LEGACY=y -CONFIG_BOOTCOMMAND="run $modeboot || run distro_bootcmd" CONFIG_SPL_STACK_R=y CONFIG_SPL_OS_BOOT=y CONFIG_SPL_SPI_LOAD=y
configs/zynq_zybo_defconfig +0 -1
@@ -11,7 +11,6 @@ CONFIG_FIT=y CONFIG_FIT_SIGNATURE=y CONFIG_FIT_VERBOSE=y CONFIG_IMAGE_FORMAT_LEGACY=y -CONFIG_BOOTCOMMAND="run $modeboot || run distro_bootcmd" CONFIG_SPL_STACK_R=y CONFIG_SPL_OS_BOOT=y CONFIG_SPL_SPI_LOAD=y
configs/zynq_zybo_z7_defconfig +0 -1
@@ -11,7 +11,6 @@ CONFIG_FIT=y CONFIG_FIT_SIGNATURE=y CONFIG_FIT_VERBOSE=y CONFIG_IMAGE_FORMAT_LEGACY=y -CONFIG_BOOTCOMMAND="run $modeboot || run distro_bootcmd" CONFIG_SPL_STACK_R=y CONFIG_SPL_OS_BOOT=y CONFIG_SPL_SPI_LOAD=y
include/configs/zynq-common.h +8 -1
@@ -139,11 +139,18 @@#define BOOT_TARGET_DEVICES_DHCP (func)#endif +#define BOOTENV_DEV_XILINX (devtypeu, devtypel, instance) \ + "bootcmd_xilinx=run $modeboot\0" + +#define BOOTENV_DEV_NAME_XILINX (devtypeu, devtypel, instance) \ + "xilinx " +#define BOOT_TARGET_DEVICES (func) \ BOOT_TARGET_DEVICES_MMC(func) \ BOOT_TARGET_DEVICES_USB(func) \ BOOT_TARGET_DEVICES_PXE(func) \ - BOOT_TARGET_DEVICES_DHCP(func) + BOOT_TARGET_DEVICES_DHCP(func) \ + func(XILINX, xilinx, na)#include <config_distro_bootcmd.h> #endif /* CONFIG_SPL_BUILD */
Signature · 1 line
1.9.1
PATCH 2/2 arm64: zynqmp: Define distro boot commnads for qspi and nand
From: Siva Durga Prasad Paladugu <[email protected]>
This patch adds distro boot commands for qspi and nand. The distro boot commands now reads the script from flash offset of 63.5MB and executes it.
Setup default location via script_offset_f to 63.5MB to match the most xilinx reference boards. 512kB allocated space for script size (script_size_f) should be more than enough to cover custom boot logic.
---
include/configs/xilinx_zynqmp.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+)
include/configs/xilinx_zynqmp.h +32 -0
@@ -129,6 +129,8 @@"kernel_addr_r=0x18000000\0" \"scriptaddr=0x02000000\0" \"ramdisk_addr_r=0x02100000\0" \ +"script_offset_f=0x3e80000\0" \ + "script_size_f=0x80000\0" \#if defined(CONFIG_MMC_SDHCI_ZYNQ )# define BOOT_TARGET_DEVICES_MMC (func) func(MMC, mmc, 0) func(MMC, mmc, 1)
@@ -160,8 +162,38 @@# define BOOT_TARGET_DEVICES_DHCP (func)#endif +#if defined(CONFIG_ZYNQMP_GQSPI ) +# define BOOT_TARGET_DEVICES_QSPI (func) func(QSPI, qspi, 0) +#else +# define BOOT_TARGET_DEVICES_QSPI (func) +#endif + +#if defined(CONFIG_NAND_ARASAN ) +# define BOOT_TARGET_DEVICES_NAND (func) func(NAND, nand, 0) +#else +# define BOOT_TARGET_DEVICES_NAND (func) +#endif + +#define BOOTENV_DEV_QSPI (devtypeu, devtypel, instance) \ + "bootcmd_qspi0=sf probe 0 0 0 && " \ + "sf read $scriptaddr $script_offset_f $script_size_f && " \ + "source ${scriptaddr}; echo SCRIPT FAILED: continuing...;\0" + +#define BOOTENV_DEV_NAME_QSPI (devtypeu, devtypel, instance) \ + "qspi " + +#define BOOTENV_DEV_NAND (devtypeu, devtypel, instance) \ + "bootcmd_nand0= nand info && " \ + "nand read $scriptaddr $script_offset_f $script_size_f && " \ + "source ${scriptaddr}; echo SCRIPT FAILED: continuing...;\0" + +#define BOOTENV_DEV_NAME_NAND (devtypeu, devtypel, instance) \ + "nand " +#define BOOT_TARGET_DEVICES (func) \ BOOT_TARGET_DEVICES_MMC(func) \ + BOOT_TARGET_DEVICES_QSPI(func) \ + BOOT_TARGET_DEVICES_NAND(func) \ BOOT_TARGET_DEVICES_USB(func) \ BOOT_TARGET_DEVICES_SCSI(func) \ BOOT_TARGET_DEVICES_PXE(func) \
Signature · 1 line
1.9.1
PATCH 2/2 arm64: zynqmp: Define distro boot commnads for qspi and nand
Quoted 38 lines · Michal Simek
From: Siva Durga Prasad Paladugu <[email protected]>
This patch adds distro boot commands for qspi and nand. The distro boot commands now reads the script from flash offset of 63.5MB and executes it.
Setup default location via
script_offset_fto 63.5MB to match the most xilinx reference boards. 512kB allocated space for script size (script_size_f) should be more than enough to cover custom boot logic.Signed-off-by Siva Durga Prasad Paladugu <[email protected]>Signed-off-by Michal Simek <[email protected]>---
include/configs/xilinx_zynqmp.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+)include/configs/xilinx_zynqmp.h +6
-0@@ -129,6 +129,8 @@"kernel_addr_r=0x18000000\0" \"scriptaddr=0x02000000\0" \"ramdisk_addr_r=0x02100000\0" \ +"script_offset_f=0x3e80000\0" \ + "script_size_f=0x80000\0" \#if defined(CONFIG_MMC_SDHCI_ZYNQ )# define BOOT_TARGET_DEVICES_MMC (func) func(MMC, mmc, 0) func(MMC, mmc, 1)@@ -160,8 +162,38 @@# define BOOT_TARGET_DEVICES_DHCP (func)#endif +#if defined(CONFIG_ZYNQMP_GQSPI ) +# define BOOT_TARGET_DEVICES_QSPI (func) func(QSPI, qspi, 0) +#else +# define BOOT_TARGET_DEVICES_QSPI (func)
include/configs/xilinx_zynqmp.h line 178
Quoted 10 lines
include/configs/xilinx_zynqmp.h +10
-0+#endif + +#if defined(CONFIG_NAND_ARASAN ) +# define BOOT_TARGET_DEVICES_NAND (func) func(NAND, nand, 0) +#else +# define BOOT_TARGET_DEVICES_NAND (func) +#endif + +#define BOOTENV_DEV_QSPI (devtypeu, devtypel, instance) \ + "bootcmd_qspi0=sf probe 0 0 0 && " \
This
include/configs/xilinx_zynqmp.h line 186
Quoted 8 lines
include/configs/xilinx_zynqmp.h +8
-0+"sf read $scriptaddr $script_offset_f $script_size_f && " \ + "source ${scriptaddr}; echo SCRIPT FAILED: continuing...;\0" + +#define BOOTENV_DEV_NAME_QSPI (devtypeu, devtypel, instance) \ + "qspi " + +#define BOOTENV_DEV_NAND (devtypeu, devtypel, instance) \ + "bootcmd_nand0= nand info && " \
and this will emit errors if no device was found, right? That might be confusing for a user, if all he sees is a scary "device not found" message which simply only occurs because he doesn't have nand populated.
Alex
Quoted 14 lines
include/configs/xilinx_zynqmp.h +8
-0+"nand read $scriptaddr $script_offset_f $script_size_f && " \ + "source ${scriptaddr}; echo SCRIPT FAILED: continuing...;\0" + +#define BOOTENV_DEV_NAME_NAND (devtypeu, devtypel, instance) \ + "nand " +#define BOOT_TARGET_DEVICES (func) \ BOOT_TARGET_DEVICES_MMC(func) \ + BOOT_TARGET_DEVICES_QSPI(func) \ + BOOT_TARGET_DEVICES_NAND(func) \ BOOT_TARGET_DEVICES_USB(func) \ BOOT_TARGET_DEVICES_SCSI(func) \ BOOT_TARGET_DEVICES_PXE(func) \
PATCH 2/2 arm64: zynqmp: Define distro boot commnads for qspi and nand
Quoted 54 lines · Alexander Graf
Quoted 38 lines · Michal Simek
From: Siva Durga Prasad Paladugu <[email protected]>
This patch adds distro boot commands for qspi and nand. The distro boot commands now reads the script from flash offset of 63.5MB and executes it.
Setup default location via
script_offset_fto 63.5MB to match the most xilinx reference boards. 512kB allocated space for script size (script_size_f) should be more than enough to cover custom boot logic.Signed-off-by Siva Durga Prasad Paladugu <[email protected]>Signed-off-by Michal Simek <[email protected]>---
include/configs/xilinx_zynqmp.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+)include/configs/xilinx_zynqmp.h +6
-0@@ -129,6 +129,8 @@"kernel_addr_r=0x18000000\0" \"scriptaddr=0x02000000\0" \"ramdisk_addr_r=0x02100000\0" \ +"script_offset_f=0x3e80000\0" \ + "script_size_f=0x80000\0" \#if defined(CONFIG_MMC_SDHCI_ZYNQ )# define BOOT_TARGET_DEVICES_MMC (func) func(MMC, mmc, 0) func(MMC, mmc, 1)@@ -160,8 +162,38 @@# define BOOT_TARGET_DEVICES_DHCP (func)#endif +#if defined(CONFIG_ZYNQMP_GQSPI ) +# define BOOT_TARGET_DEVICES_QSPI (func) func(QSPI, qspi, 0) +#else +# define BOOT_TARGET_DEVICES_QSPI (func)include/configs/xilinx_zynqmp.h line 178
Quoted 10 lines
include/configs/xilinx_zynqmp.h +10
-0+#endif + +#if defined(CONFIG_NAND_ARASAN ) +# define BOOT_TARGET_DEVICES_NAND (func) func(NAND, nand, 0) +#else +# define BOOT_TARGET_DEVICES_NAND (func) +#endif + +#define BOOTENV_DEV_QSPI (devtypeu, devtypel, instance) \ + "bootcmd_qspi0=sf probe 0 0 0 && " \This
Quoted 12 lines
include/configs/xilinx_zynqmp.h line 186
Quoted 8 lines
include/configs/xilinx_zynqmp.h +8
-0+"sf read $scriptaddr $script_offset_f $script_size_f && " \ + "source ${scriptaddr}; echo SCRIPT FAILED: continuing...;\0" + +#define BOOTENV_DEV_NAME_QSPI (devtypeu, devtypel, instance) \ + "qspi " + +#define BOOTENV_DEV_NAND (devtypeu, devtypel, instance) \ + "bootcmd_nand0= nand info && " \and this will emit errors if no device was found, right? That might be confusing for a user, if all he sees is a scary "device not found" message which simply only occurs because he doesn't have nand populated.
As you see above it is enabled only when devices are enabled. For generic u-boot for all zynqmp targets it should be correct to emit error message that nand is not detected if it is not present on the board. :-)
All these boot modes will be tried if the first boot mode fails.
I don't think it is an issue to report that booting from flash fails if it is not detected and it shouldn't matter if flash is broken or it is not even on the board because simply booting from flash fails.
Thanks,
Michal
PATCH 2/2 arm64: zynqmp: Define distro boot commnads for qspi and nand
Quoted 68 lines · Michal Simek
Quoted 54 lines · Alexander Graf
Quoted 38 lines · Michal Simek
From: Siva Durga Prasad Paladugu <[email protected]>
This patch adds distro boot commands for qspi and nand. The distro boot commands now reads the script from flash offset of 63.5MB and executes it.
Setup default location via
script_offset_fto 63.5MB to match the most xilinx reference boards. 512kB allocated space for script size (script_size_f) should be more than enough to cover custom boot logic.Signed-off-by Siva Durga Prasad Paladugu <[email protected]>Signed-off-by Michal Simek <[email protected]>---
include/configs/xilinx_zynqmp.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+)include/configs/xilinx_zynqmp.h +6
-0@@ -129,6 +129,8 @@"kernel_addr_r=0x18000000\0" \"scriptaddr=0x02000000\0" \"ramdisk_addr_r=0x02100000\0" \ +"script_offset_f=0x3e80000\0" \ + "script_size_f=0x80000\0" \#if defined(CONFIG_MMC_SDHCI_ZYNQ )# define BOOT_TARGET_DEVICES_MMC (func) func(MMC, mmc, 0) func(MMC, mmc, 1)@@ -160,8 +162,38 @@# define BOOT_TARGET_DEVICES_DHCP (func)#endif +#if defined(CONFIG_ZYNQMP_GQSPI ) +# define BOOT_TARGET_DEVICES_QSPI (func) func(QSPI, qspi, 0) +#else +# define BOOT_TARGET_DEVICES_QSPI (func)include/configs/xilinx_zynqmp.h line 178
Quoted 10 lines
include/configs/xilinx_zynqmp.h +10
-0+#endif + +#if defined(CONFIG_NAND_ARASAN ) +# define BOOT_TARGET_DEVICES_NAND (func) func(NAND, nand, 0) +#else +# define BOOT_TARGET_DEVICES_NAND (func) +#endif + +#define BOOTENV_DEV_QSPI (devtypeu, devtypel, instance) \ + "bootcmd_qspi0=sf probe 0 0 0 && " \This
Quoted 12 lines
include/configs/xilinx_zynqmp.h line 186
Quoted 8 lines
include/configs/xilinx_zynqmp.h +8
-0+"sf read $scriptaddr $script_offset_f $script_size_f && " \ + "source ${scriptaddr}; echo SCRIPT FAILED: continuing...;\0" + +#define BOOTENV_DEV_NAME_QSPI (devtypeu, devtypel, instance) \ + "qspi " + +#define BOOTENV_DEV_NAND (devtypeu, devtypel, instance) \ + "bootcmd_nand0= nand info && " \and this will emit errors if no device was found, right? That might be confusing for a user, if all he sees is a scary "device not found" message which simply only occurs because he doesn't have nand populated.
Quoted 5 lines
As you see above it is enabled only when devices are enabled. For generic u-boot for all zynqmp targets it should be correct to emit error message that nand is not detected if it is not present on the board. :-)
All these boot modes will be tried if the first boot mode fails.
Well, it's conditional on whether the driver is available, not whether the board actually exposes a flash device, right?
So think about the generic case - one U-Boot binary for all targets. What are you going to do there? That needs to have all possible boot target devices enabled, but how do you know whether an actual QSPI chip is attached to the SPI controller?
I also think this problem is bigger than this patch, so don't take my comment as a nack. I'm just trying to raise that we should start to think about cases where "probe fails" is not an error and thus should not print an error message.
Alex
Quoted 7 lines
I don't think it is an issue to report that booting from flash fails if it is not detected and it shouldn't matter if flash is broken or it is not even on the board because simply booting from flash fails.
Thanks,
Michal
PATCH 2/2 arm64: zynqmp: Define distro boot commnads for qspi and nand
Quoted 77 lines · Alexander Graf
Quoted 68 lines · Michal Simek
Quoted 54 lines · Alexander Graf
Quoted 38 lines · Michal Simek
From: Siva Durga Prasad Paladugu <[email protected]>
This patch adds distro boot commands for qspi and nand. The distro boot commands now reads the script from flash offset of 63.5MB and executes it.
Setup default location via
script_offset_fto 63.5MB to match the most xilinx reference boards. 512kB allocated space for script size (script_size_f) should be more than enough to cover custom boot logic.Signed-off-by Siva Durga Prasad Paladugu <[email protected]>Signed-off-by Michal Simek <[email protected]>---
include/configs/xilinx_zynqmp.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+)include/configs/xilinx_zynqmp.h +6
-0@@ -129,6 +129,8 @@"kernel_addr_r=0x18000000\0" \"scriptaddr=0x02000000\0" \"ramdisk_addr_r=0x02100000\0" \ +"script_offset_f=0x3e80000\0" \ + "script_size_f=0x80000\0" \#if defined(CONFIG_MMC_SDHCI_ZYNQ )# define BOOT_TARGET_DEVICES_MMC (func) func(MMC, mmc, 0) func(MMC, mmc, 1)@@ -160,8 +162,38 @@# define BOOT_TARGET_DEVICES_DHCP (func)#endif +#if defined(CONFIG_ZYNQMP_GQSPI ) +# define BOOT_TARGET_DEVICES_QSPI (func) func(QSPI, qspi, 0) +#else +# define BOOT_TARGET_DEVICES_QSPI (func)include/configs/xilinx_zynqmp.h line 178
Quoted 10 lines
include/configs/xilinx_zynqmp.h +10
-0+#endif + +#if defined(CONFIG_NAND_ARASAN ) +# define BOOT_TARGET_DEVICES_NAND (func) func(NAND, nand, 0) +#else +# define BOOT_TARGET_DEVICES_NAND (func) +#endif + +#define BOOTENV_DEV_QSPI (devtypeu, devtypel, instance) \ + "bootcmd_qspi0=sf probe 0 0 0 && " \This
Quoted 12 lines
include/configs/xilinx_zynqmp.h line 186
Quoted 8 lines
include/configs/xilinx_zynqmp.h +8
-0+"sf read $scriptaddr $script_offset_f $script_size_f && " \ + "source ${scriptaddr}; echo SCRIPT FAILED: continuing...;\0" + +#define BOOTENV_DEV_NAME_QSPI (devtypeu, devtypel, instance) \ + "qspi " + +#define BOOTENV_DEV_NAND (devtypeu, devtypel, instance) \ + "bootcmd_nand0= nand info && " \and this will emit errors if no device was found, right? That might be confusing for a user, if all he sees is a scary "device not found" message which simply only occurs because he doesn't have nand populated.
Quoted 5 lines
As you see above it is enabled only when devices are enabled. For generic u-boot for all zynqmp targets it should be correct to emit error message that nand is not detected if it is not present on the board. :-)
All these boot modes will be tried if the first boot mode fails.
Quoted 7 lines
Well, it's conditional on whether the driver is available, not whether the board actually exposes a flash device, right?
So think about the generic case - one U-Boot binary for all targets. What are you going to do there? That needs to have all possible boot target devices enabled, but how do you know whether an actual QSPI chip is attached to the SPI controller?
yes - sure all devices needs to be enabled. You don't know that. You need to try to probe it and access it.
Quoted 5 lines
I also think this problem is bigger than this patch, so don't take my comment as a nack. I'm just trying to raise that we should start to think about cases where "probe fails" is not an error and thus should not print an error message.
What is the current behavior if you failed to access network or SD and images is on SATA which is the last (or different order).
I expect that scanning finds nothing.
Nand/qspi should be just behave the same.
Thanks,
Michal
PATCH 2/2 arm64: zynqmp: Define distro boot commnads for qspi and nand
Quoted 95 lines · Michal Simek
Quoted 77 lines · Alexander Graf
Quoted 68 lines · Michal Simek
Quoted 54 lines · Alexander Graf
Quoted 38 lines · Michal Simek
From: Siva Durga Prasad Paladugu <[email protected]>
This patch adds distro boot commands for qspi and nand. The distro boot commands now reads the script from flash offset of 63.5MB and executes it.
Setup default location via
script_offset_fto 63.5MB to match the most xilinx reference boards. 512kB allocated space for script size (script_size_f) should be more than enough to cover custom boot logic.Signed-off-by Siva Durga Prasad Paladugu <[email protected]>Signed-off-by Michal Simek <[email protected]>---
include/configs/xilinx_zynqmp.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+)include/configs/xilinx_zynqmp.h +6
-0@@ -129,6 +129,8 @@"kernel_addr_r=0x18000000\0" \"scriptaddr=0x02000000\0" \"ramdisk_addr_r=0x02100000\0" \ +"script_offset_f=0x3e80000\0" \ + "script_size_f=0x80000\0" \#if defined(CONFIG_MMC_SDHCI_ZYNQ )# define BOOT_TARGET_DEVICES_MMC (func) func(MMC, mmc, 0) func(MMC, mmc, 1)@@ -160,8 +162,38 @@# define BOOT_TARGET_DEVICES_DHCP (func)#endif +#if defined(CONFIG_ZYNQMP_GQSPI ) +# define BOOT_TARGET_DEVICES_QSPI (func) func(QSPI, qspi, 0) +#else +# define BOOT_TARGET_DEVICES_QSPI (func)include/configs/xilinx_zynqmp.h line 178
Quoted 10 lines
include/configs/xilinx_zynqmp.h +10
-0+#endif + +#if defined(CONFIG_NAND_ARASAN ) +# define BOOT_TARGET_DEVICES_NAND (func) func(NAND, nand, 0) +#else +# define BOOT_TARGET_DEVICES_NAND (func) +#endif + +#define BOOTENV_DEV_QSPI (devtypeu, devtypel, instance) \ + "bootcmd_qspi0=sf probe 0 0 0 && " \This
Quoted 12 lines
include/configs/xilinx_zynqmp.h line 186
Quoted 8 lines
include/configs/xilinx_zynqmp.h +8
-0+"sf read $scriptaddr $script_offset_f $script_size_f && " \ + "source ${scriptaddr}; echo SCRIPT FAILED: continuing...;\0" + +#define BOOTENV_DEV_NAME_QSPI (devtypeu, devtypel, instance) \ + "qspi " + +#define BOOTENV_DEV_NAND (devtypeu, devtypel, instance) \ + "bootcmd_nand0= nand info && " \and this will emit errors if no device was found, right? That might be confusing for a user, if all he sees is a scary "device not found" message which simply only occurs because he doesn't have nand populated.
Quoted 5 lines
As you see above it is enabled only when devices are enabled. For generic u-boot for all zynqmp targets it should be correct to emit error message that nand is not detected if it is not present on the board. :-)
All these boot modes will be tried if the first boot mode fails.Quoted 7 lines
Well, it's conditional on whether the driver is available, not whether the board actually exposes a flash device, right?
So think about the generic case - one U-Boot binary for all targets. What are you going to do there? That needs to have all possible boot target devices enabled, but how do you know whether an actual QSPI chip is attached to the SPI controller?
yes - sure all devices needs to be enabled. You don't know that. You need to try to probe it and access it.
Quoted 5 lines
I also think this problem is bigger than this patch, so don't take my comment as a nack. I'm just trying to raise that we should start to think about cases where "probe fails" is not an error and thus should not print an error message.
Quoted 4 lines
What is the current behavior if you failed to access network or SD and images is on SATA which is the last (or different order).
I expect that scanning finds nothing.
Nand/qspi should be just behave the same.
It depends on the target; some will just not complain if no device was found, others will.
It's a bigger task, let's defer it to later :)
Alex
PATCH 1/2 ARM: zynq: Run distribution boot commands first
In reply to Michal SimekQuoted 10 lines · Michal Simek
This patch is doing two things.
1. Exchanging order of boot commands.distro_bootcmdis run first followed by Xilinx boot command.
2. RemoveCONFIG_BOOTCOMMANDfrom configs (and follow mainline) by creating Xilinx distribution bootcommand and wiring it as the last bootcommand.QSPI, NAND distribution boot command will be added later.
Signed-off-by Michal Simek <[email protected]>
This means that boot order wise, users may try to boot from external devices before internal ones ($modeboot) now, correct? I'm not sure everyone will be happy about that. I definitely am, so
Alex
PATCH 1/2 ARM: zynq: Run distribution boot commands first
Quoted 12 lines · Alexander Graf
Quoted 9 lines · Michal Simek
This patch is doing two things.
1. Exchanging order of boot commands.distro_bootcmdis run first followed by Xilinx boot command.
2. RemoveCONFIG_BOOTCOMMANDfrom configs (and follow mainline) by creating Xilinx distribution bootcommand and wiring it as the last bootcommand.QSPI, NAND distribution boot command will be added later.
Quoted 7 lines
Quoted 1 line
Signed-off-by Michal Simek <[email protected]>This means that boot order wise, users may try to boot from external devices before internal ones ($modeboot) now, correct? I'm not sure everyone will be happy about that. I definitely am, so
Reviewed-by Alexander Graf <[email protected]>
I just got patches from DP to include qspi/nand similar to what was in 2/2 but for Zynq.
There shouldn't be any product affected because they should have all variables already saved.
M