From 064b144ca332942487a9ab6de0a892987b4307ef Mon Sep 17 00:00:00 2001 From: Nathan Rossi Date: Fri, 4 Nov 2016 21:56:53 +1000 Subject: u-boot-xlnx: For ZynqMP setup auto-boot for JTAG loading When booting a ZynqMP machine configured to boot from JTAG, setup U-Boot to attempt to automatically load the kernel, rootfs and device tree from default memory locations. This enables auto-booting for QEMU allowing for a completely automated boot up when using qemu-xilinx. Note the patch in this change is not acceptable for upstreaming in its current form. The upstream maintainer would however accept a similar change that uses FIT instead of individual components. Signed-off-by: Nathan Rossi Reviewed-by: Alistair Francis --- ...xilinx_zynqmp.h-Auto-boot-in-JTAG-if-imag.patch | 48 ++++++++++++++++++++++ recipes-bsp/u-boot/u-boot-xlnx_2016.4.bb | 1 + 2 files changed, 49 insertions(+) create mode 100644 recipes-bsp/u-boot/u-boot-xlnx/arm-zynqmp-xilinx_zynqmp.h-Auto-boot-in-JTAG-if-imag.patch diff --git a/recipes-bsp/u-boot/u-boot-xlnx/arm-zynqmp-xilinx_zynqmp.h-Auto-boot-in-JTAG-if-imag.patch b/recipes-bsp/u-boot/u-boot-xlnx/arm-zynqmp-xilinx_zynqmp.h-Auto-boot-in-JTAG-if-imag.patch new file mode 100644 index 00000000..08a0a205 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot-xlnx/arm-zynqmp-xilinx_zynqmp.h-Auto-boot-in-JTAG-if-imag.patch @@ -0,0 +1,48 @@ +From 9d44bd18191a56331273beb7c26b18afe154c82c Mon Sep 17 00:00:00 2001 +From: Nathan Rossi +Date: Fri, 4 Nov 2016 21:33:14 +1000 +Subject: [PATCH] arm: zynqmp: xilinx_zynqmp.h: Auto boot in JTAG if images in + memory + +Add a command that checks if the Kernel image (in aarch64 Image format) +and optionally a rootfs is in memory and automatically boot these images +if in JTAG boot mode. + +This allows for simpler boot automation in JTAG boot environments +(including QEMU) where manual interaction would otherwise be required. + +Signed-off-by: Nathan Rossi +Upstream-Status: Denied [Upstream prefers FIT instead] +--- + include/configs/xilinx_zynqmp.h | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h +index 4714b3317d..0441f3f24f 100644 +--- a/include/configs/xilinx_zynqmp.h ++++ b/include/configs/xilinx_zynqmp.h +@@ -246,8 +246,10 @@ + "run xen_prepare_dt_qemu && " \ + "tftpb 6000000 xen.ub && tftpb 0x1000000 image.ub && " \ + "bootm 6000000 0x1000000 $fdt_addr\0" \ +- "jtagboot=tftpboot 80000 Image && tftpboot $fdt_addr system.dtb && " \ +- "tftpboot 6000000 rootfs.cpio.ub && booti 80000 6000000 $fdt_addr\0" \ ++ "jtagmemboot=if itest.w *0x80038 == 0x644d5241; then if iminfo 0x6000000; then booti 0x80000 0x6000000 $fdt_addr; else booti 0x80000 - $fdt_addr; fi; fi\0" \ ++ "jtagboot=run jtagmemboot && " \ ++ "tftpboot 80000 Image && tftpboot $fdt_addr system.dtb && " \ ++ "tftpboot 6000000 rootfs.cpio.ub && booti 80000 6000000 $fdt_addr\0" \ + "nosmp=setenv bootargs $bootargs maxcpus=1\0" \ + "nfsroot=setenv bootargs $bootargs root=/dev/nfs nfsroot=$serverip:/mnt/sata,tcp ip=$ipaddr:$serverip:$serverip:255.255.255.0:zynqmp:eth0:off rw\0" \ + "sdroot0=setenv bootargs $bootargs root=/dev/mmcblk0p2 rw rootwait\0" \ +@@ -269,7 +271,7 @@ + + /* Do not preserve environment */ + #define CONFIG_ENV_IS_NOWHERE 1 +-#define CONFIG_ENV_SIZE 0x1000 ++#define CONFIG_ENV_SIZE 0x2000 + + /* Monitor Command Prompt */ + /* Console I/O Buffer Size */ +-- +2.11.0 + diff --git a/recipes-bsp/u-boot/u-boot-xlnx_2016.4.bb b/recipes-bsp/u-boot/u-boot-xlnx_2016.4.bb index fc5b45b1..5f385376 100644 --- a/recipes-bsp/u-boot/u-boot-xlnx_2016.4.bb +++ b/recipes-bsp/u-boot/u-boot-xlnx_2016.4.bb @@ -12,6 +12,7 @@ SRC_URI_append = " \ file://0001-fdt-add-memory-bank-decoding-functions-for-board-set.patch \ file://0002-ARM-zynq-Replace-board-specific-with-generic-memory-.patch \ file://0003-ARM64-zynqmp-Replace-board-specific-with-generic-mem.patch \ + file://arm-zynqmp-xilinx_zynqmp.h-Auto-boot-in-JTAG-if-imag.patch \ " SRC_URI_append_kc705-microblazeel = " file://microblaze-kc705-Convert-microblaze-generic-to-k.patch" -- cgit v1.2.3-54-g00ecf