From 7f307d93ed147fc831425189463d92e50d5c7566 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Thu, 14 Apr 2016 06:52:26 +0900 Subject: ARM: zynq: load u-boot.img whether CONFIG_OF_SEPARATE is defined or not Since commit ad1ecd2063da ("fdt: Build a U-Boot binary without device tree"), u-boot-dtb.img is identical to u-boot.img, so SPL can always load u-boot.img whether CONFIG_OF_SEPARATE is defined or not. Signed-off-by: Masahiro Yamada Signed-off-by: Michal Simek --- include/configs/zynq-common.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'include') diff --git a/include/configs/zynq-common.h b/include/configs/zynq-common.h index a3e4aecb57..82ece0df2d 100644 --- a/include/configs/zynq-common.h +++ b/include/configs/zynq-common.h @@ -315,11 +315,7 @@ #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1 #define CONFIG_SPL_LIBDISK_SUPPORT #define CONFIG_SPL_FAT_SUPPORT -#ifdef CONFIG_OF_SEPARATE -# define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot-dtb.img" -#else -# define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img" -#endif +#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img" #endif /* Disable dcache for SPL just for sure */ -- cgit v1.2.1 From a1207de0e6d6526e470361fac42f2c077b43a0ad Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Fri, 22 Apr 2016 14:28:17 +0200 Subject: ARM64: zynqmp: Enable missing distro default options Enable all options which distros requires. Signed-off-by: Michal Simek --- include/configs/xilinx_zynqmp.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'include') diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h index 6b8e3ea865..f41a2cbaa2 100644 --- a/include/configs/xilinx_zynqmp.h +++ b/include/configs/xilinx_zynqmp.h @@ -65,6 +65,7 @@ #define CONFIG_CMD_ENV #define CONFIG_DOS_PARTITION #define CONFIG_EFI_PARTITION +#define CONFIG_ISO_PARTITION #define CONFIG_MP /* BOOTP options */ @@ -74,6 +75,19 @@ #define CONFIG_BOOTP_HOSTNAME #define CONFIG_BOOTP_MAY_FAIL #define CONFIG_BOOTP_SERVERIP +#define CONFIG_BOOTP_DNS +#define CONFIG_BOOTP_PXE +#define CONFIG_BOOTP_SUBNETMASK +#define CONFIG_BOOTP_PXE_CLIENTARCH 0x100 + +/* Diff from config_distro_defaults.h */ +#define CONFIG_SUPPORT_RAW_INITRD +#define CONFIG_ENV_VARS_UBOOT_CONFIG +#define CONFIG_AUTO_COMPLETE + +/* PXE */ +#define CONFIG_CMD_PXE +#define CONFIG_MENU #if defined(CONFIG_ZYNQ_SDHCI) # define CONFIG_MMC -- cgit v1.2.1 From 6919b4bf36357463b419c4b848b5778d7ba0874e Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Fri, 22 Apr 2016 11:48:49 +0200 Subject: ARM64: zynqmp: Add support for reading MAC from eeprom Add support for on board eeprom with programmed MAC for using in u-boot to have uniq address for every board. Most of the time uniq MAC address is on a label on the board. If address is not programmed use these command to program it. On zcu102: ZynqMP> mm.b 0 00000000: 00 ? 00 00000001: a0 ? 0a 00000002: 35 ? 35 00000003: 02 ? 02 00000004: 00 ? ef 00000005: 00 ? 67 00000006: 00 ? q i2c dev 5 i2c write 0 54 20 6 i2c md 54 20 Signed-off-by: Michal Simek --- include/configs/xilinx_zynqmp_zcu102.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/configs/xilinx_zynqmp_zcu102.h b/include/configs/xilinx_zynqmp_zcu102.h index 30db2e4532..81079fe7d8 100644 --- a/include/configs/xilinx_zynqmp_zcu102.h +++ b/include/configs/xilinx_zynqmp_zcu102.h @@ -48,6 +48,12 @@ #define CONFIG_IDENT_STRING " Xilinx ZynqMP ZCU102" +#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 +#define CONFIG_CMD_EEPROM +#define CONFIG_ZYNQ_EEPROM_BUS 5 +#define CONFIG_ZYNQ_GEM_EEPROM_ADDR 0x54 +#define CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET 0x20 + #define CONFIG_KERNEL_FDT_OFST_SIZE \ "kernel_offset=0x180000\0" \ "fdt_offset=0x100000\0" \ -- cgit v1.2.1 From 926782cdf8be8769ae2f9a40ec7a62af1b91ac77 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Tue, 26 Apr 2016 16:03:42 +0200 Subject: ARM64: zynqmp: Enable eMMC boot partitions commands Enable some additional features of the eMMC boot partitions. 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 f41a2cbaa2..e36dde61dd 100644 --- a/include/configs/xilinx_zynqmp.h +++ b/include/configs/xilinx_zynqmp.h @@ -92,6 +92,7 @@ #if defined(CONFIG_ZYNQ_SDHCI) # define CONFIG_MMC # define CONFIG_GENERIC_MMC +# define CONFIG_SUPPORT_EMMC_BOOT # define CONFIG_SDHCI # ifndef CONFIG_ZYNQ_SDHCI_MAX_FREQ # define CONFIG_ZYNQ_SDHCI_MAX_FREQ 200000000 -- cgit v1.2.1 From 013642c2d4a652878a4e7583fe125ea76582ce55 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Fri, 29 Apr 2016 13:04:02 +0200 Subject: ARM64: zynqmp: Remove CONFIG_PREBOOT CONFIG_PREBOOT variable is breaking ./test/py framework. Remove it. Signed-off-by: Michal Simek --- include/configs/xilinx_zynqmp.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h index e36dde61dd..e6c38a5819 100644 --- a/include/configs/xilinx_zynqmp.h +++ b/include/configs/xilinx_zynqmp.h @@ -159,7 +159,6 @@ "booti $kernel_addr - $fdt_addr\0" \ DFU_ALT_INFO -#define CONFIG_PREBOOT "run bootargs" #define CONFIG_BOOTCOMMAND "run $modeboot" #define CONFIG_BOOTDELAY 3 -- cgit v1.2.1 From 3a3b9147892cb47f96dff1075f1494dca17b6eaf Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Tue, 10 May 2016 07:54:20 +0200 Subject: spl: Introduce new function spl_board_prepare_for_boot Call this function before passing control from SPL. For fpga case it is necessary to enable for example level shifters when bitstream is programmed. Signed-off-by: Michal Simek Reviewed-by: Simon Glass --- include/spl.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/spl.h b/include/spl.h index 7edfab46dc..335b76a1b1 100644 --- a/include/spl.h +++ b/include/spl.h @@ -58,6 +58,7 @@ u32 spl_boot_mode(void); void spl_set_header_raw_uboot(void); int spl_parse_image_header(const struct image_header *header); void spl_board_prepare_for_linux(void); +void spl_board_prepare_for_boot(void); void __noreturn jump_to_image_linux(void *arg); int spl_start_uboot(void); void spl_display_print(void); -- cgit v1.2.1 From 27640fda55bf998d1eb5109b3410bf62e445e191 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Tue, 10 May 2016 09:50:35 +0200 Subject: ARM64: zynqmp: Enable option to overwrite default variables Enable overwriting variables out of main config file. Signed-off-by: Michal Simek --- include/configs/xilinx_zynqmp.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h index e6c38a5819..1a1892dff6 100644 --- a/include/configs/xilinx_zynqmp.h +++ b/include/configs/xilinx_zynqmp.h @@ -148,6 +148,7 @@ #endif /* Initial environment variables */ +#ifndef CONFIG_EXTRA_ENV_SETTINGS #define CONFIG_EXTRA_ENV_SETTINGS \ "kernel_addr=0x80000\0" \ "fdt_addr=0x7000000\0" \ @@ -158,6 +159,7 @@ "load mmc $sdbootdev:$partid $kernel_addr Image && " \ "booti $kernel_addr - $fdt_addr\0" \ DFU_ALT_INFO +#endif #define CONFIG_BOOTCOMMAND "run $modeboot" #define CONFIG_BOOTDELAY 3 -- cgit v1.2.1 From d9b58b303120fb8fe0b7c9799e2b7682da4bec16 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Wed, 27 Apr 2016 14:03:29 +0200 Subject: tools: zynqmpimage: Add Xilinx ZynqMP boot header generation Add support for the zynqmpimage to mkimage. Only basic functionality is supported without encryption and register initialization with one partition which is filled by U-Boot SPL. For more detail information look at Xilinx ZynqMP TRM. Signed-off-by: Michal Simek Reviewed-by: Simon Glass --- include/image.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/image.h b/include/image.h index f9ee5649c5..a8488f2b39 100644 --- a/include/image.h +++ b/include/image.h @@ -246,8 +246,9 @@ struct lmb; #define IH_TYPE_RKSD 24 /* Rockchip SD card */ #define IH_TYPE_RKSPI 25 /* Rockchip SPI image */ #define IH_TYPE_ZYNQIMAGE 26 /* Xilinx Zynq Boot Image */ +#define IH_TYPE_ZYNQMPIMAGE 27 /* Xilinx ZynqMP Boot Image */ -#define IH_TYPE_COUNT 27 /* Number of image types */ +#define IH_TYPE_COUNT 28 /* Number of image types */ /* * Compression Types -- cgit v1.2.1 From e6a9ed04e78cf87ec97e306fa4e7a1669ef98df6 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Fri, 20 Nov 2015 13:17:22 +0100 Subject: ARM64: zynqmp: Add SPL support support Support RAM and MMC boot mode in SPL also with SPL_FIT images. In MMC boot mode two boot options are available: 1) Boot flow with ATF(EL3) and full U-Boot(EL2): aarch64-linux-gnu-objcopy -O binary bl31.elf bl31.bin mkimage -A arm64 -O linux -T kernel -C none -a 0xfffe5000 -e 0xfffe5000 -d bl31.bin atf.ub cp spl/boot.bin cp atf.ub cp u-boot.bin 2) Boot flow with full U-Boot(EL3): cp spl/boot.bin cp u-boot*.img 3) emmc boot mode dd if=/dev/zero of=sd.img bs=1024 count=1024 parted sd.img mktable msdos parted sd.img mkpart p fat32 0% 100% kpartx -a sd.img mkfs.vfat /dev/mapper/loop0p1 mount /dev/mapper/loop0p1 /mnt/ cp spl/boot.bin /mnt cp u-boot.img /mnt cp u-boot.bin /mnt cp atf.ub /mnt umount /dev/mapper/loop0p1 kpartx -d sd.img cp sd.img /tftpboot/ and program it via u-boot tftpb 10000 sd.img mmcinfo mmc write 10000 0 $filesize mmc rescan mmc part ls mmc 0 psu_init() function contains low level SoC setup generated for every HW design by Xilinx design tools. xil_io.h is only supporting file to fix all dependencies from tools. The same solution was used on Xilinx Zynq. The patch also change CONFIG_SYS_INIT_SP_ADDR to the end of OCM which stays at the same location all the time. Bootrom expects starting address to be at 0xfffc0000 that's why this address is SPL_TEXT_BASE. Signed-off-by: Michal Simek --- include/configs/xilinx_zynqmp.h | 43 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h index 1a1892dff6..b2fa164f65 100644 --- a/include/configs/xilinx_zynqmp.h +++ b/include/configs/xilinx_zynqmp.h @@ -41,7 +41,7 @@ # define CONFIG_IDENT_STRING " Xilinx ZynqMP" #endif -#define CONFIG_SYS_INIT_SP_ADDR CONFIG_SYS_TEXT_BASE +#define CONFIG_SYS_INIT_SP_ADDR 0xfffffffc /* Generic Timer Definitions - setup in EL3. Setup by ATF for other cases */ #if !defined(COUNTER_FREQUENCY) @@ -65,7 +65,9 @@ #define CONFIG_CMD_ENV #define CONFIG_DOS_PARTITION #define CONFIG_EFI_PARTITION -#define CONFIG_ISO_PARTITION +#ifndef CONFIG_SPL_BUILD +# define CONFIG_ISO_PARTITION +#endif #define CONFIG_MP /* BOOTP options */ @@ -228,4 +230,41 @@ #define CONFIG_BOARD_EARLY_INIT_R #define CONFIG_CLOCKS +#define CONFIG_SPL_TEXT_BASE 0xfffc0000 +#define CONFIG_SPL_MAX_SIZE 0x20000 + +/* Just random location in OCM */ +#define CONFIG_SPL_BSS_START_ADDR 0x1000000 +#define CONFIG_SPL_BSS_MAX_SIZE 0x2000000 + +#define CONFIG_SPL_FRAMEWORK +#define CONFIG_SPL_LIBCOMMON_SUPPORT +#define CONFIG_SPL_LIBGENERIC_SUPPORT +#define CONFIG_SPL_SERIAL_SUPPORT +#define CONFIG_SPL_BOARD_INIT +#define CONFIG_SPL_RAM_DEVICE + +#define CONFIG_SPL_OS_BOOT +/* u-boot is like dtb */ +#define CONFIG_SPL_FS_LOAD_ARGS_NAME "u-boot.bin" +#define CONFIG_SYS_SPL_ARGS_ADDR 0x8000000 + +/* ATF is my kernel image */ +#define CONFIG_SPL_FS_LOAD_KERNEL_NAME "atf.ub" + +/* FIT load address for RAM boot */ +#define CONFIG_SPL_LOAD_FIT_ADDRESS 0x10000000 + +/* MMC support */ +#ifdef CONFIG_ZYNQ_SDHCI +# define CONFIG_SPL_MMC_SUPPORT +# define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1 +# define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0 /* unused */ +# define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS 0 /* unused */ +# define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0 /* unused */ +# define CONFIG_SPL_LIBDISK_SUPPORT +# define CONFIG_SPL_FAT_SUPPORT +# define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img" +#endif + #endif /* __XILINX_ZYNQMP_H */ -- cgit v1.2.1 From ed0cea7c5271cbfd37089f3a6392ba383eda06f7 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Tue, 17 May 2016 13:58:44 +0200 Subject: mkimage: Report information about fpga Add FIT_FPGA_PROP that user can identify an optional entry for fpga. Signed-off-by: Michal Simek Reviewed-by: Simon Glass --- include/image.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/image.h b/include/image.h index a8488f2b39..e2a90ca202 100644 --- a/include/image.h +++ b/include/image.h @@ -247,8 +247,9 @@ struct lmb; #define IH_TYPE_RKSPI 25 /* Rockchip SPI image */ #define IH_TYPE_ZYNQIMAGE 26 /* Xilinx Zynq Boot Image */ #define IH_TYPE_ZYNQMPIMAGE 27 /* Xilinx ZynqMP Boot Image */ +#define IH_TYPE_FPGA 28 /* FPGA Image */ -#define IH_TYPE_COUNT 28 /* Number of image types */ +#define IH_TYPE_COUNT 29 /* Number of image types */ /* * Compression Types @@ -810,6 +811,7 @@ int bootz_setup(ulong image, ulong *start, ulong *end); #define FIT_LOADABLE_PROP "loadables" #define FIT_DEFAULT_PROP "default" #define FIT_SETUP_PROP "setup" +#define FIT_FPGA_PROP "fpga" #define FIT_MAX_HASH_LEN HASH_MAX_DIGEST_SIZE -- cgit v1.2.1 From 62afc601883e788f3f22291202d5b2a23c1a8b06 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Tue, 17 May 2016 14:03:50 +0200 Subject: image: Add boot_get_fpga() to load fpga with bootm Add function boot_get_fpga() which find and load bitstream to programmable logic if fpga entry is present. Function is supported on Xilinx devices for full and partial bitstreams in BIN and BIT format. Signed-off-by: Michal Simek Remove additional blankline in image.h --- include/bootstage.h | 1 + include/image.h | 2 ++ 2 files changed, 3 insertions(+) (limited to 'include') diff --git a/include/bootstage.h b/include/bootstage.h index 97653602d3..0880a680b9 100644 --- a/include/bootstage.h +++ b/include/bootstage.h @@ -198,6 +198,7 @@ enum bootstage_id { BOOTSTAGE_ID_ACCUM_SCSI, BOOTSTAGE_ID_ACCUM_SPI, BOOTSTAGE_ID_ACCUM_DECOMP, + BOOTSTAGE_ID_FPGA_INIT, /* a few spare for the user, from here */ BOOTSTAGE_ID_USER, diff --git a/include/image.h b/include/image.h index e2a90ca202..a8f6bd16f6 100644 --- a/include/image.h +++ b/include/image.h @@ -496,6 +496,8 @@ int genimg_get_format(const void *img_addr); int genimg_has_config(bootm_headers_t *images); ulong genimg_get_image(ulong img_addr); +int boot_get_fpga(int argc, char * const argv[], bootm_headers_t *images, + uint8_t arch, const ulong *ld_start, ulong * const ld_len); int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images, uint8_t arch, ulong *rd_start, ulong *rd_end); -- cgit v1.2.1