From 8b93a92f6d089c8b3a055c8d89492e73137490b7 Mon Sep 17 00:00:00 2001 From: Goldschmidt Simon Date: Fri, 10 Nov 2017 14:17:41 +0000 Subject: fpga: allow programming fpga from FIT image for all FPGA drivers This drops the limit that fpga is only loaded from FIT images for Xilinx. This is done by moving the 'partial' check from 'common/image.c' to 'drivers/fpga/xilinx.c' (the only driver supporting partial images yet) and supplies a weak default implementation in 'drivers/fpga/fpga.c'. Signed-off-by: Simon Goldschmidt Tested-by: Michal Simek (On zcu102) Signed-off-by: Michal Simek --- include/fpga.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/fpga.h b/include/fpga.h index d768fb1417..4d6da790b7 100644 --- a/include/fpga.h +++ b/include/fpga.h @@ -54,6 +54,7 @@ void fpga_init(void); int fpga_add(fpga_type devtype, void *desc); int fpga_count(void); const fpga_desc *const fpga_get_desc(int devnum); +int fpga_is_partial_data(int devnum, size_t img_len); int fpga_load(int devnum, const void *buf, size_t bsize, bitstream_type bstype); int fpga_fsload(int devnum, const void *buf, size_t size, -- cgit v1.2.1 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') diff --git a/include/configs/zynq-common.h b/include/configs/zynq-common.h index 7247c90307..b10cb3f572 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.2.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') diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h index 57fee6a4c8..940244d932 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.2.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 --- include/configs/xilinx_zynqmp.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h index 940244d932..1013885238 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.2.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 --- include/configs/xilinx_zynqmp.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h index 1013885238..9997fd0959 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.2.1