Commit 90e97ab31e0208a3f8483872df212a1af8070897

Authored by Siva Durga Prasad Paladugu
Committed by Michal Simek
1 parent f3976cc61f

arm: zynq: Define distro boot commnads for qspi, nand and nor

This patch adds distro boot commands for qspi, nand and nor.
The distro boot commands now reads the script from flash offset
of 15.75MB and executes it.

Setup default location via script_offset_f to 15.75MB to match the most
xilinx reference boards for qspi, nand and set the same using
script_offset_nor to 0xE2EC0000 for nor.
256kB 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>

Showing 1 changed file with 48 additions and 0 deletions Side-by-side Diff

include/configs/zynq-common.h
... ... @@ -153,14 +153,58 @@
153 153 #define BOOT_TARGET_DEVICES_DHCP(func)
154 154 #endif
155 155  
  156 +#if defined(CONFIG_ZYNQ_QSPI)
  157 +# define BOOT_TARGET_DEVICES_QSPI(func) func(QSPI, qspi, na)
  158 +#else
  159 +# define BOOT_TARGET_DEVICES_QSPI(func)
  160 +#endif
  161 +
  162 +#if defined(CONFIG_NAND_ZYNQ)
  163 +# define BOOT_TARGET_DEVICES_NAND(func) func(NAND, nand, na)
  164 +#else
  165 +# define BOOT_TARGET_DEVICES_NAND(func)
  166 +#endif
  167 +
  168 +#if defined(CONFIG_MTD_NOR_FLASH)
  169 +# define BOOT_TARGET_DEVICES_NOR(func) func(NOR, nor, na)
  170 +#else
  171 +# define BOOT_TARGET_DEVICES_NOR(func)
  172 +#endif
  173 +
156 174 #define BOOTENV_DEV_XILINX(devtypeu, devtypel, instance) \
157 175 "bootcmd_xilinx=run $modeboot\0"
158 176  
159 177 #define BOOTENV_DEV_NAME_XILINX(devtypeu, devtypel, instance) \
160 178 "xilinx "
161 179  
  180 +#define BOOTENV_DEV_QSPI(devtypeu, devtypel, instance) \
  181 + "bootcmd_qspi=sf probe 0 0 0 && " \
  182 + "sf read $scriptaddr $script_offset_f $script_size_f && " \
  183 + "source ${scriptaddr}; echo SCRIPT FAILED: continuing...;\0"
  184 +
  185 +#define BOOTENV_DEV_NAME_QSPI(devtypeu, devtypel, instance) \
  186 + "qspi "
  187 +
  188 +#define BOOTENV_DEV_NAND(devtypeu, devtypel, instance) \
  189 + "bootcmd_nand=nand info && " \
  190 + "nand read $scriptaddr $script_offset_f $script_size_f && " \
  191 + "source ${scriptaddr}; echo SCRIPT FAILED: continuing...;\0"
  192 +
  193 +#define BOOTENV_DEV_NAME_NAND(devtypeu, devtypel, instance) \
  194 + "nand "
  195 +
  196 +#define BOOTENV_DEV_NOR(devtypeu, devtypel, instance) \
  197 + "bootcmd_nor=cp.b $scropt_offset_nor $scriptaddr $script_size_f && " \
  198 + "source ${scriptaddr}; echo SCRIPT FAILED: continuing...;\0"
  199 +
  200 +#define BOOTENV_DEV_NAME_NOR(devtypeu, devtypel, instance) \
  201 + "nor "
  202 +
162 203 #define BOOT_TARGET_DEVICES(func) \
163 204 BOOT_TARGET_DEVICES_MMC(func) \
  205 + BOOT_TARGET_DEVICES_QSPI(func) \
  206 + BOOT_TARGET_DEVICES_NAND(func) \
  207 + BOOT_TARGET_DEVICES_NOR(func) \
164 208 BOOT_TARGET_DEVICES_USB(func) \
165 209 BOOT_TARGET_DEVICES_PXE(func) \
166 210 BOOT_TARGET_DEVICES_DHCP(func) \
... ... @@ -179,6 +223,10 @@
179 223 "nor_flash_off=0xE2100000\0" \
180 224 "fdt_high=0x20000000\0" \
181 225 "initrd_high=0x20000000\0" \
  226 + "scriptaddr=0x20000\0" \
  227 + "script_offser_nor=0xE2FC0000\0" \
  228 + "script_offset_f=0xFC0000\0" \
  229 + "script_size_f=0x40000\0" \
182 230 "loadbootenv_addr=0x2000000\0" \
183 231 "fdt_addr_r=0x1f00000\0" \
184 232 "pxefile_addr_r=0x2000000\0" \