]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
arm64: versal: Define distro boot commnads for qspi ospi and mmc
authorSiva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Thu, 31 Jan 2019 11:58:13 +0000 (17:28 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Wed, 27 Feb 2019 07:53:05 +0000 (08:53 +0100)
This patch adds distro boot commands for qspi, ospi and mmc.
The distro boot commands now reads the script from flash offset
of 63.5MB  for qspi and ospi and executes it. For mmc its same
as generic distro boot command. As either one of the qspi or ospi can
exist on hardware, defined a single distroboot command as xspi
that works for both.

Setup default location via script_offset_f to 63.5MB to match the most
xilinx reference boards for qspi, ospi for now.
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 <siva.durga.paladugu@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
include/configs/xilinx_versal.h

index ce548adcd4147cbc713dca78fcb2785df0f5b444..1cc30a2a758fe7a8bd1856ceddc8f699f131776f 100644 (file)
        "pxefile_addr_r=0x10000000\0" \
        "kernel_addr_r=0x18000000\0" \
        "scriptaddr=0x02000000\0" \
-       "ramdisk_addr_r=0x02100000\0"
+       "ramdisk_addr_r=0x02100000\0" \
+       "script_offset_f=0x3f80000\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)
+#else
+# define BOOT_TARGET_DEVICES_MMC(func)
+#endif
+
+#if defined(CONFIG_ZYNQMP_GQSPI) || defined(CONFIG_CADENCE_OSPI_VERSAL)
+# define BOOT_TARGET_DEVICES_XSPI(func)        func(XSPI, xspi, 0)
+#else
+# define BOOT_TARGET_DEVICES_XSPI(func)
+#endif
+
+#define BOOTENV_DEV_XSPI(devtypeu, devtypel, instance) \
+       "bootcmd_xspi0=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_XSPI(devtypeu, devtypel, instance) \
+       "xspi "
 
 #define BOOT_TARGET_DEVICES(func) \
+       BOOT_TARGET_DEVICES_MMC(func) \
+       BOOT_TARGET_DEVICES_XSPI(func) \
        func(PXE, pxe, na) \
        func(DHCP, dhcp, na)