From 52b36fd155c3c860f094272627c466ba4a4f4e26 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Fri, 1 Dec 2017 13:50:33 +0100 Subject: arm: zynq: Fix SPL SD boot mode This patch is fixing two issues: 1. Insufficient stack size for fat fs buffers 2. Insufficient space in malloc area Tested on zc702 and zc706. Signed-off-by: Michal Simek --- include/configs/zynq-common.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'include/configs') diff --git a/include/configs/zynq-common.h b/include/configs/zynq-common.h index 7247c903075..b10cb3f5722 100644 --- a/include/configs/zynq-common.h +++ b/include/configs/zynq-common.h @@ -344,12 +344,9 @@ /* 3 * 64kB blocks of OCM - one is on the top because of bootrom */ #define CONFIG_SPL_MAX_SIZE 0x30000 -/* The highest 64k OCM address */ -#define OCM_HIGH_ADDR 0xffff0000 - /* On the top of OCM space */ -#define CONFIG_SYS_SPL_MALLOC_START OCM_HIGH_ADDR -#define CONFIG_SYS_SPL_MALLOC_SIZE 0x2000 +#define CONFIG_SYS_SPL_MALLOC_START CONFIG_SPL_STACK_R_ADDR +#define CONFIG_SYS_SPL_MALLOC_SIZE 0x2000000 /* * SPL stack position - and stack goes down -- cgit v1.3.1 From 6ee28cb953e1b0e57f34a97c33eb94bd1550b455 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Mon, 6 Feb 2017 14:34:01 +0100 Subject: arm64: zynqmp: Do not perform reset in case of panic Do not perform reset when panic happens because in the next reset panic happens again and logs are overflood by the same errors. This can be enabled by default and reset can be performed via watchdog. Signed-off-by: Michal Simek --- include/configs/xilinx_zynqmp.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/configs') diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h index 57fee6a4c8a..940244d9320 100644 --- a/include/configs/xilinx_zynqmp.h +++ b/include/configs/xilinx_zynqmp.h @@ -126,6 +126,7 @@ #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE #define CONFIG_SYS_LONGHELP #define CONFIG_CMDLINE_EDITING +#define CONFIG_PANIC_HANG #define CONFIG_SYS_MAXARGS 64 /* Ethernet driver */ -- cgit v1.3.1 From b45c17c7232e6ba463e6e258cf5fc0b6805f3b33 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Fri, 1 Dec 2017 14:34:03 +0100 Subject: arm64: zynqmp: Do not use SPL_SYS_MALLOC_SIMPLE allocator This was caused by: "fs/fat: Reduce stack usage" (sha1:2460098cffacd18729262e3ed36656e6943783ed) which converted fat code to use malloc. But simple malloc is not freeing space that's why full malloc implementation is needed. Malloc space is added to RAM. Signed-off-by: Michal Simek --- configs/xilinx_zynqmp_ep_defconfig | 1 - configs/xilinx_zynqmp_zc1751_xm015_dc1_defconfig | 1 - configs/xilinx_zynqmp_zc1751_xm016_dc2_defconfig | 1 - configs/xilinx_zynqmp_zc1751_xm018_dc4_defconfig | 1 - configs/xilinx_zynqmp_zc1751_xm019_dc5_defconfig | 1 - configs/xilinx_zynqmp_zcu102_rev1_0_defconfig | 1 - configs/xilinx_zynqmp_zcu102_revA_defconfig | 1 - configs/xilinx_zynqmp_zcu102_revB_defconfig | 1 - include/configs/xilinx_zynqmp.h | 6 +++--- 9 files changed, 3 insertions(+), 11 deletions(-) (limited to 'include/configs') diff --git a/configs/xilinx_zynqmp_ep_defconfig b/configs/xilinx_zynqmp_ep_defconfig index ee9528caec7..9743ecfe266 100644 --- a/configs/xilinx_zynqmp_ep_defconfig +++ b/configs/xilinx_zynqmp_ep_defconfig @@ -14,7 +14,6 @@ CONFIG_SPL_LOAD_FIT=y # CONFIG_DISPLAY_CPUINFO is not set # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_SPL=y -CONFIG_SPL_SYS_MALLOC_SIMPLE=y CONFIG_SPL_OS_BOOT=y CONFIG_SYS_PROMPT="ZynqMP> " CONFIG_FASTBOOT=y diff --git a/configs/xilinx_zynqmp_zc1751_xm015_dc1_defconfig b/configs/xilinx_zynqmp_zc1751_xm015_dc1_defconfig index beb24346baa..6067ab48e81 100644 --- a/configs/xilinx_zynqmp_zc1751_xm015_dc1_defconfig +++ b/configs/xilinx_zynqmp_zc1751_xm015_dc1_defconfig @@ -15,7 +15,6 @@ CONFIG_SPL_LOAD_FIT=y # CONFIG_DISPLAY_CPUINFO is not set # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_SPL=y -CONFIG_SPL_SYS_MALLOC_SIMPLE=y CONFIG_SPL_OS_BOOT=y CONFIG_SYS_PROMPT="ZynqMP> " CONFIG_FASTBOOT=y diff --git a/configs/xilinx_zynqmp_zc1751_xm016_dc2_defconfig b/configs/xilinx_zynqmp_zc1751_xm016_dc2_defconfig index 8c8201dfbb5..2acc1eba295 100644 --- a/configs/xilinx_zynqmp_zc1751_xm016_dc2_defconfig +++ b/configs/xilinx_zynqmp_zc1751_xm016_dc2_defconfig @@ -16,7 +16,6 @@ CONFIG_SPL_LOAD_FIT=y # CONFIG_DISPLAY_CPUINFO is not set # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_SPL=y -CONFIG_SPL_SYS_MALLOC_SIMPLE=y CONFIG_SPL_OS_BOOT=y CONFIG_SYS_PROMPT="ZynqMP> " CONFIG_FASTBOOT=y diff --git a/configs/xilinx_zynqmp_zc1751_xm018_dc4_defconfig b/configs/xilinx_zynqmp_zc1751_xm018_dc4_defconfig index 34365c8cfe8..35dce719b19 100644 --- a/configs/xilinx_zynqmp_zc1751_xm018_dc4_defconfig +++ b/configs/xilinx_zynqmp_zc1751_xm018_dc4_defconfig @@ -12,7 +12,6 @@ CONFIG_SPL_LOAD_FIT=y # CONFIG_DISPLAY_CPUINFO is not set # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_SPL=y -CONFIG_SPL_SYS_MALLOC_SIMPLE=y CONFIG_SPL_OS_BOOT=y CONFIG_SYS_PROMPT="ZynqMP> " CONFIG_CMD_MEMTEST=y diff --git a/configs/xilinx_zynqmp_zc1751_xm019_dc5_defconfig b/configs/xilinx_zynqmp_zc1751_xm019_dc5_defconfig index a9e7a879de4..2124d6b23c4 100644 --- a/configs/xilinx_zynqmp_zc1751_xm019_dc5_defconfig +++ b/configs/xilinx_zynqmp_zc1751_xm019_dc5_defconfig @@ -13,7 +13,6 @@ CONFIG_SPL_LOAD_FIT=y # CONFIG_DISPLAY_CPUINFO is not set # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_SPL=y -CONFIG_SPL_SYS_MALLOC_SIMPLE=y CONFIG_SPL_OS_BOOT=y CONFIG_SYS_PROMPT="ZynqMP> " CONFIG_CMD_MEMTEST=y diff --git a/configs/xilinx_zynqmp_zcu102_rev1_0_defconfig b/configs/xilinx_zynqmp_zcu102_rev1_0_defconfig index 158dc7ed8c6..56b826cd51e 100644 --- a/configs/xilinx_zynqmp_zcu102_rev1_0_defconfig +++ b/configs/xilinx_zynqmp_zcu102_rev1_0_defconfig @@ -15,7 +15,6 @@ CONFIG_SPL_LOAD_FIT=y # CONFIG_DISPLAY_CPUINFO is not set # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_SPL=y -CONFIG_SPL_SYS_MALLOC_SIMPLE=y CONFIG_SPL_OS_BOOT=y CONFIG_SYS_PROMPT="ZynqMP> " CONFIG_FASTBOOT=y diff --git a/configs/xilinx_zynqmp_zcu102_revA_defconfig b/configs/xilinx_zynqmp_zcu102_revA_defconfig index 01e956cbc93..8eaac57abc2 100644 --- a/configs/xilinx_zynqmp_zcu102_revA_defconfig +++ b/configs/xilinx_zynqmp_zcu102_revA_defconfig @@ -15,7 +15,6 @@ CONFIG_SPL_LOAD_FIT=y # CONFIG_DISPLAY_CPUINFO is not set # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_SPL=y -CONFIG_SPL_SYS_MALLOC_SIMPLE=y CONFIG_SPL_OS_BOOT=y CONFIG_SYS_PROMPT="ZynqMP> " CONFIG_FASTBOOT=y diff --git a/configs/xilinx_zynqmp_zcu102_revB_defconfig b/configs/xilinx_zynqmp_zcu102_revB_defconfig index ab2f0a830a0..7015d6d86df 100644 --- a/configs/xilinx_zynqmp_zcu102_revB_defconfig +++ b/configs/xilinx_zynqmp_zcu102_revB_defconfig @@ -15,7 +15,6 @@ CONFIG_SPL_LOAD_FIT=y # CONFIG_DISPLAY_CPUINFO is not set # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_SPL=y -CONFIG_SPL_SYS_MALLOC_SIMPLE=y CONFIG_SPL_OS_BOOT=y CONFIG_SYS_PROMPT="ZynqMP> " CONFIG_FASTBOOT=y diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h index 940244d9320..1013885238a 100644 --- a/include/configs/xilinx_zynqmp.h +++ b/include/configs/xilinx_zynqmp.h @@ -258,14 +258,14 @@ # define CONFIG_SPL_ENV_SUPPORT # define CONFIG_SPL_HASH_SUPPORT # define CONFIG_ENV_MAX_ENTRIES 10 +#endif -# define CONFIG_SYS_SPL_MALLOC_START 0x20000000 -# define CONFIG_SYS_SPL_MALLOC_SIZE 0x100000 +#define CONFIG_SYS_SPL_MALLOC_START 0x20000000 +#define CONFIG_SYS_SPL_MALLOC_SIZE 0x100000 #ifdef CONFIG_SPL_SYS_MALLOC_SIMPLE # error "Disable CONFIG_SPL_SYS_MALLOC_SIMPLE. Full malloc needs to be used" #endif -#endif #define CONFIG_BOARD_EARLY_INIT_F -- cgit v1.3.1 From 24124abe06d39ea52afa34828c1e55bdde5d8b56 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Mon, 16 Jan 2017 12:07:33 +0100 Subject: arm64: zynqmp: Add support for generic QSPI boot This patch is enabling support for SPL QSPI boot. First of all it is necessary to generate atf-spi.ub which is different format than atf-uboot.ub (this can be made as legacy image too) ADDR=`arm-xilinx-linux-gnueabi-readelf -a bl31.elf | grep "Entry point address" | cut -d ':' -f 2 | sed -e 's/^[ \t]*//'` aarch64-linux-gnu-objcopy -O binary bl31.elf bl31.bin ./tools/mkimage -f auto -A arm64 -T firmware -C none -O u-boot -a $ADDR -e $ADDR -n "atf1" -E -b arch/arm/dts/zynqmp-zcu102.dtb -d bl31.bin atf-uboot.ub ./tools/mkimage -A arm64 -T firmware -C none -O u-boot -a $ADDR -e $ADDR -n "atf-for-qspi" -E -d bl31.bin atf-spi.ub This patch is using this QSPI layout with offsets: 0 boot.bin 512k atf-ub 640k u-boot.bin 1280k u-boot.img Which corresponding by writing these images(read from MMC) mmcinfo sf probe load mmc 0 10000000 boot.bin sf erase 0 +$filesize sf write 10000000 0 $filesize load mmc 0 10000000 atf-spi.ub sf erase 0x80000 +$filesize sf write 10000000 0x80000 $filesize load mmc 0 10000000 u-boot.bin sf erase 0xa0000 +$filesize sf write 10000000 0xa0000 $filesize load mmc 0 10000000 u-boot.img sf erase 0x140000 +$filesize sf write 10000000 0x140000 $filesize For testing u-boot running in EL3 you can break atf-spi.ub like this: sf probe sf erase 0x80000 +4 Then u-boot.img is executed. Signed-off-by: Michal Simek --- arch/arm/dts/zynqmp.dtsi | 1 + include/configs/xilinx_zynqmp.h | 9 +++++++++ 2 files changed, 10 insertions(+) (limited to 'include/configs') diff --git a/arch/arm/dts/zynqmp.dtsi b/arch/arm/dts/zynqmp.dtsi index 1cf535b964b..5bdab611645 100644 --- a/arch/arm/dts/zynqmp.dtsi +++ b/arch/arm/dts/zynqmp.dtsi @@ -804,6 +804,7 @@ }; qspi: spi@ff0f0000 { + u-boot,dm-pre-reloc; compatible = "xlnx,zynqmp-qspi-1.0"; status = "disabled"; clock-names = "ref_clk", "pclk"; diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h index 1013885238a..9997fd09598 100644 --- a/include/configs/xilinx_zynqmp.h +++ b/include/configs/xilinx_zynqmp.h @@ -234,6 +234,15 @@ #define CONFIG_SPL_FRAMEWORK +#if defined(CONFIG_SPL_SPI_FLASH_SUPPORT) +# define CONFIG_SPL_SPI_LOAD +# define CONFIG_SYS_SPI_KERNEL_OFFS 0x80000 +# define CONFIG_SYS_SPI_ARGS_OFFS 0xa0000 +# define CONFIG_SYS_SPI_ARGS_SIZE 0xa0000 + +# define CONFIG_SYS_SPI_U_BOOT_OFFS 0x170000 +#endif + /* u-boot is like dtb */ #define CONFIG_SPL_FS_LOAD_ARGS_NAME "u-boot.bin" #define CONFIG_SYS_SPL_ARGS_ADDR 0x8000000 -- cgit v1.3.1