184c7204bSMichal Simek /* 284c7204bSMichal Simek * Configuration for Xilinx ZynqMP 384c7204bSMichal Simek * (C) Copyright 2014 - 2015 Xilinx, Inc. 484c7204bSMichal Simek * Michal Simek <michal.simek@xilinx.com> 584c7204bSMichal Simek * 684c7204bSMichal Simek * Based on Configuration for Versatile Express 784c7204bSMichal Simek * 884c7204bSMichal Simek * SPDX-License-Identifier: GPL-2.0+ 984c7204bSMichal Simek */ 1084c7204bSMichal Simek 1184c7204bSMichal Simek #ifndef __XILINX_ZYNQMP_H 1284c7204bSMichal Simek #define __XILINX_ZYNQMP_H 1384c7204bSMichal Simek 1484c7204bSMichal Simek #define CONFIG_REMAKE_ELF 1584c7204bSMichal Simek 1684c7204bSMichal Simek /* #define CONFIG_ARMV8_SWITCH_TO_EL1 */ 1784c7204bSMichal Simek 1884c7204bSMichal Simek #define CONFIG_SYS_NO_FLASH 1984c7204bSMichal Simek 2084c7204bSMichal Simek /* Generic Interrupt Controller Definitions */ 2184c7204bSMichal Simek #define CONFIG_GICV2 2284c7204bSMichal Simek #define GICD_BASE 0xF9010000 2384c7204bSMichal Simek #define GICC_BASE 0xF9020000 2484c7204bSMichal Simek 25d759512fSMichal Simek #define CONFIG_SYS_ALT_MEMTEST 26d759512fSMichal Simek #define CONFIG_SYS_MEMTEST_SCRATCH 0xfffc0000 27d759512fSMichal Simek 288d59d7f6SMichal Simek #ifndef CONFIG_NR_DRAM_BANKS 298d59d7f6SMichal Simek # define CONFIG_NR_DRAM_BANKS 2 308d59d7f6SMichal Simek #endif 318d59d7f6SMichal Simek #define CONFIG_SYS_MEMTEST_START 0 328d59d7f6SMichal Simek #define CONFIG_SYS_MEMTEST_END 1000 3384c7204bSMichal Simek 3484c7204bSMichal Simek /* Have release address at the end of 256MB for now */ 3584c7204bSMichal Simek #define CPU_RELEASE_ADDR 0xFFFFFF0 3684c7204bSMichal Simek 3784c7204bSMichal Simek /* Cache Definitions */ 38222b2129SSiva Durga Prasad Paladugu #define CONFIG_SYS_CACHELINE_SIZE 64 3984c7204bSMichal Simek 4015c3eb53SMichal Simek #if !defined(CONFIG_IDENT_STRING) 4184c7204bSMichal Simek # define CONFIG_IDENT_STRING " Xilinx ZynqMP" 4215c3eb53SMichal Simek #endif 4384c7204bSMichal Simek 44*8fbf678bSSoren Brinkmann #define CONFIG_SYS_INIT_SP_ADDR CONFIG_SYS_TEXT_BASE 4584c7204bSMichal Simek 4684c7204bSMichal Simek /* Generic Timer Definitions - setup in EL3. Setup by ATF for other cases */ 47713b6164SMichal Simek #if !defined(COUNTER_FREQUENCY) 48713b6164SMichal Simek # define COUNTER_FREQUENCY 100000000 49713b6164SMichal Simek #endif 5084c7204bSMichal Simek 5184c7204bSMichal Simek /* Size of malloc() pool */ 5216fa00a7SSiva Durga Prasad Paladugu #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 0x2000000) 5384c7204bSMichal Simek 5484c7204bSMichal Simek /* Serial setup */ 55b0d18beeSSiva Durga Prasad Paladugu #define CONFIG_ARM_DCC 56b0d18beeSSiva Durga Prasad Paladugu #define CONFIG_CPU_ARMV8 5784c7204bSMichal Simek #define CONFIG_ZYNQ_SERIAL 5884c7204bSMichal Simek 5984c7204bSMichal Simek #define CONFIG_CONS_INDEX 0 6084c7204bSMichal Simek #define CONFIG_BAUDRATE 115200 6184c7204bSMichal Simek #define CONFIG_SYS_BAUDRATE_TABLE \ 6284c7204bSMichal Simek { 4800, 9600, 19200, 38400, 57600, 115200 } 6384c7204bSMichal Simek 6484c7204bSMichal Simek /* Command line configuration */ 6584c7204bSMichal Simek #define CONFIG_CMD_ENV 6684c7204bSMichal Simek #define CONFIG_DOS_PARTITION 6707654ba1SMichal Simek #define CONFIG_EFI_PARTITION 68e6a9ed04SMichal Simek #ifndef CONFIG_SPL_BUILD 69a1207de0SMichal Simek # define CONFIG_ISO_PARTITION 70e6a9ed04SMichal Simek #endif 715cb24200SMichal Simek #define CONFIG_MP 7284c7204bSMichal Simek 73cb7ea820SMichal Simek /* BOOTP options */ 74cb7ea820SMichal Simek #define CONFIG_BOOTP_BOOTFILESIZE 75cb7ea820SMichal Simek #define CONFIG_BOOTP_BOOTPATH 76cb7ea820SMichal Simek #define CONFIG_BOOTP_GATEWAY 77cb7ea820SMichal Simek #define CONFIG_BOOTP_HOSTNAME 78cb7ea820SMichal Simek #define CONFIG_BOOTP_MAY_FAIL 79a1207de0SMichal Simek #define CONFIG_BOOTP_DNS 80a1207de0SMichal Simek #define CONFIG_BOOTP_PXE 81a1207de0SMichal Simek #define CONFIG_BOOTP_SUBNETMASK 82a1207de0SMichal Simek 83a1207de0SMichal Simek /* Diff from config_distro_defaults.h */ 84a1207de0SMichal Simek #define CONFIG_SUPPORT_RAW_INITRD 85a1207de0SMichal Simek #define CONFIG_ENV_VARS_UBOOT_CONFIG 86a1207de0SMichal Simek #define CONFIG_AUTO_COMPLETE 87a1207de0SMichal Simek 88a1207de0SMichal Simek /* PXE */ 89a1207de0SMichal Simek #define CONFIG_CMD_PXE 90a1207de0SMichal Simek #define CONFIG_MENU 91cb7ea820SMichal Simek 92ce0335f2SMichal Simek #if defined(CONFIG_ZYNQ_SDHCI) 9384c7204bSMichal Simek # define CONFIG_MMC 9484c7204bSMichal Simek # define CONFIG_GENERIC_MMC 95926782cdSMichal Simek # define CONFIG_SUPPORT_EMMC_BOOT 9684c7204bSMichal Simek # define CONFIG_SDHCI 97f3bd7280SMichal Simek # ifndef CONFIG_ZYNQ_SDHCI_MAX_FREQ 98f3bd7280SMichal Simek # define CONFIG_ZYNQ_SDHCI_MAX_FREQ 200000000 99f3bd7280SMichal Simek # endif 10046f68e68SMichal Simek #endif 10146f68e68SMichal Simek 10246f68e68SMichal Simek #if defined(CONFIG_ZYNQ_SDHCI) || defined(CONFIG_ZYNQMP_USB) 10384c7204bSMichal Simek # define CONFIG_FAT_WRITE 10484c7204bSMichal Simek #endif 10584c7204bSMichal Simek 10678cb965aSSiva Durga Prasad Paladugu #ifdef CONFIG_NAND_ARASAN 10778cb965aSSiva Durga Prasad Paladugu # define CONFIG_CMD_NAND_LOCK_UNLOCK 10878cb965aSSiva Durga Prasad Paladugu # define CONFIG_SYS_MAX_NAND_DEVICE 1 10978cb965aSSiva Durga Prasad Paladugu # define CONFIG_SYS_NAND_SELF_INIT 11078cb965aSSiva Durga Prasad Paladugu # define CONFIG_SYS_NAND_ONFI_DETECTION 11178cb965aSSiva Durga Prasad Paladugu # define CONFIG_MTD_DEVICE 11278cb965aSSiva Durga Prasad Paladugu #endif 11378cb965aSSiva Durga Prasad Paladugu 11484c7204bSMichal Simek /* Miscellaneous configurable options */ 11584c7204bSMichal Simek #define CONFIG_SYS_LOAD_ADDR 0x8000000 11684c7204bSMichal Simek 11716fa00a7SSiva Durga Prasad Paladugu #if defined(CONFIG_ZYNQMP_USB) 1180f676767SSiva Durga Prasad Paladugu #define CONFIG_USB_MAX_CONTROLLER_COUNT 1 1190f676767SSiva Durga Prasad Paladugu #define CONFIG_SYS_USB_XHCI_MAX_ROOT_PORTS 2 1200f676767SSiva Durga Prasad Paladugu #define CONFIG_USB_XHCI_ZYNQMP 1210f676767SSiva Durga Prasad Paladugu 12216fa00a7SSiva Durga Prasad Paladugu #define CONFIG_SYS_DFU_DATA_BUF_SIZE 0x1800000 12316fa00a7SSiva Durga Prasad Paladugu #define DFU_DEFAULT_POLL_TIMEOUT 300 12416fa00a7SSiva Durga Prasad Paladugu #define CONFIG_USB_FUNCTION_DFU 12516fa00a7SSiva Durga Prasad Paladugu #define CONFIG_DFU_RAM 12616fa00a7SSiva Durga Prasad Paladugu #define CONFIG_USB_CABLE_CHECK 12716fa00a7SSiva Durga Prasad Paladugu #define CONFIG_CMD_THOR_DOWNLOAD 12816fa00a7SSiva Durga Prasad Paladugu #define CONFIG_USB_FUNCTION_THOR 12916fa00a7SSiva Durga Prasad Paladugu #define CONFIG_THOR_RESET_OFF 13016fa00a7SSiva Durga Prasad Paladugu #define DFU_ALT_INFO_RAM \ 13116fa00a7SSiva Durga Prasad Paladugu "dfu_ram_info=" \ 1320e43140bSSiva Durga Prasad Paladugu "setenv dfu_alt_info " \ 1331b19daf4SSiva Durga Prasad Paladugu "Image ram $kernel_addr $kernel_size\\\\;" \ 1341b19daf4SSiva Durga Prasad Paladugu "system.dtb ram $fdt_addr $fdt_size\0" \ 13516fa00a7SSiva Durga Prasad Paladugu "dfu_ram=run dfu_ram_info && dfu 0 ram 0\0" \ 13616fa00a7SSiva Durga Prasad Paladugu "thor_ram=run dfu_ram_info && thordown 0 ram 0\0" 13716fa00a7SSiva Durga Prasad Paladugu 13816fa00a7SSiva Durga Prasad Paladugu #define DFU_ALT_INFO \ 13916fa00a7SSiva Durga Prasad Paladugu DFU_ALT_INFO_RAM 14016fa00a7SSiva Durga Prasad Paladugu #endif 14116fa00a7SSiva Durga Prasad Paladugu 14216fa00a7SSiva Durga Prasad Paladugu #if !defined(DFU_ALT_INFO) 14316fa00a7SSiva Durga Prasad Paladugu # define DFU_ALT_INFO 14416fa00a7SSiva Durga Prasad Paladugu #endif 14516fa00a7SSiva Durga Prasad Paladugu 14684c7204bSMichal Simek 14784c7204bSMichal Simek #define CONFIG_BOARD_LATE_INIT 14884c7204bSMichal Simek 14984c7204bSMichal Simek /* Do not preserve environment */ 15084c7204bSMichal Simek #define CONFIG_ENV_IS_NOWHERE 1 15184c7204bSMichal Simek #define CONFIG_ENV_SIZE 0x1000 15284c7204bSMichal Simek 15384c7204bSMichal Simek /* Monitor Command Prompt */ 15484c7204bSMichal Simek /* Console I/O Buffer Size */ 15584c7204bSMichal Simek #define CONFIG_SYS_CBSIZE 2048 15684c7204bSMichal Simek #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \ 15784c7204bSMichal Simek sizeof(CONFIG_SYS_PROMPT) + 16) 15884c7204bSMichal Simek #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE 15984c7204bSMichal Simek #define CONFIG_SYS_LONGHELP 16084c7204bSMichal Simek #define CONFIG_CMDLINE_EDITING 16184c7204bSMichal Simek #define CONFIG_SYS_MAXARGS 64 16284c7204bSMichal Simek 163cb7ea820SMichal Simek /* Ethernet driver */ 164596e5782SMichal Simek #if defined(CONFIG_ZYNQ_GEM) 165cb7ea820SMichal Simek # define CONFIG_NET_MULTI 166cb7ea820SMichal Simek # define CONFIG_MII 167cb7ea820SMichal Simek # define CONFIG_SYS_FAULT_ECHO_LINK_DOWN 168cb7ea820SMichal Simek # define CONFIG_PHY_MARVELL 169f96fe2c0SMichal Simek # define CONFIG_PHY_NATSEMI 170bf146325SMichal Simek # define CONFIG_PHY_TI 171c4c96f2bSMichal Simek # define CONFIG_PHY_GIGE 172a1a6af82SMichal Simek # define CONFIG_PHY_VITESSE 173a1a6af82SMichal Simek # define CONFIG_PHY_REALTEK 174e2928f32SSiva Durga Prasad Paladugu # define PHY_ANEG_TIMEOUT 20000 175cb7ea820SMichal Simek #endif 176cb7ea820SMichal Simek 1772594e03cSSiva Durga Prasad Paladugu /* I2C */ 1782594e03cSSiva Durga Prasad Paladugu #if defined(CONFIG_SYS_I2C_ZYNQ) 1792594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_I2C 1802594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_I2C_ZYNQ_SPEED 100000 1812594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_I2C_ZYNQ_SLAVE 0 1822594e03cSSiva Durga Prasad Paladugu #endif 1832594e03cSSiva Durga Prasad Paladugu 1842594e03cSSiva Durga Prasad Paladugu /* EEPROM */ 1852594e03cSSiva Durga Prasad Paladugu #ifdef CONFIG_ZYNQMP_EEPROM 1862594e03cSSiva Durga Prasad Paladugu # define CONFIG_CMD_EEPROM 1872594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2 1882594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_I2C_EEPROM_ADDR 0x54 1892594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 4 1902594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 5 1912594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_EEPROM_SIZE (64 * 1024) 1922594e03cSSiva Durga Prasad Paladugu #endif 1932594e03cSSiva Durga Prasad Paladugu 1940d169b8cSMichal Simek #ifdef CONFIG_SATA_CEVA 1950d169b8cSMichal Simek #define CONFIG_AHCI 1966fe6f135SMichal Simek #define CONFIG_LIBATA 1976fe6f135SMichal Simek #define CONFIG_SCSI_AHCI 1986fe6f135SMichal Simek #define CONFIG_SCSI_AHCI_PLAT 199679b994aSMichal Simek #define CONFIG_SYS_SCSI_MAX_SCSI_ID 2 2006fe6f135SMichal Simek #define CONFIG_SYS_SCSI_MAX_LUN 1 2016fe6f135SMichal Simek #define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \ 2026fe6f135SMichal Simek CONFIG_SYS_SCSI_MAX_LUN) 203c649e3c9SSimon Glass #define CONFIG_SCSI 2046fe6f135SMichal Simek #endif 2056fe6f135SMichal Simek 20684c7204bSMichal Simek #define CONFIG_SYS_BOOTM_LEN (60 * 1024 * 1024) 20784c7204bSMichal Simek 20884c7204bSMichal Simek #define CONFIG_CMD_BOOTI 20984c7204bSMichal Simek #define CONFIG_CMD_UNZIP 21084c7204bSMichal Simek 21184c7204bSMichal Simek #define CONFIG_BOARD_EARLY_INIT_R 21284c7204bSMichal Simek #define CONFIG_CLOCKS 21384c7204bSMichal Simek 214b72894f1SMichal Simek #define ENV_MEM_LAYOUT_SETTINGS \ 215b72894f1SMichal Simek "fdt_high=10000000\0" \ 216b72894f1SMichal Simek "initrd_high=10000000\0" \ 217b72894f1SMichal Simek "fdt_addr_r=0x40000000\0" \ 218b72894f1SMichal Simek "pxefile_addr_r=0x10000000\0" \ 219b72894f1SMichal Simek "kernel_addr_r=0x18000000\0" \ 220b72894f1SMichal Simek "scriptaddr=0x02000000\0" \ 221b72894f1SMichal Simek "ramdisk_addr_r=0x02100000\0" \ 222b72894f1SMichal Simek 223b72894f1SMichal Simek #if defined(CONFIG_ZYNQ_SDHCI) 224b72894f1SMichal Simek # define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0) func(MMC, mmc, 1) 225b72894f1SMichal Simek #else 226b72894f1SMichal Simek # define BOOT_TARGET_DEVICES_MMC(func) 227b72894f1SMichal Simek #endif 228b72894f1SMichal Simek 229b72894f1SMichal Simek #if defined(CONFIG_SATA_CEVA) 230b72894f1SMichal Simek # define BOOT_TARGET_DEVICES_SCSI(func) func(SCSI, scsi, 0) 231b72894f1SMichal Simek #else 232b72894f1SMichal Simek # define BOOT_TARGET_DEVICES_SCSI(func) 233b72894f1SMichal Simek #endif 234b72894f1SMichal Simek 235b72894f1SMichal Simek #if defined(CONFIG_ZYNQMP_USB) 236b72894f1SMichal Simek # define BOOT_TARGET_DEVICES_USB(func) func(USB, usb, 0) func(USB, usb, 1) 237b72894f1SMichal Simek #else 238b72894f1SMichal Simek # define BOOT_TARGET_DEVICES_USB(func) 239b72894f1SMichal Simek #endif 240b72894f1SMichal Simek 241b72894f1SMichal Simek #define BOOT_TARGET_DEVICES(func) \ 242b72894f1SMichal Simek BOOT_TARGET_DEVICES_MMC(func) \ 243b72894f1SMichal Simek BOOT_TARGET_DEVICES_USB(func) \ 244b72894f1SMichal Simek BOOT_TARGET_DEVICES_SCSI(func) \ 245b72894f1SMichal Simek func(PXE, pxe, na) \ 246b72894f1SMichal Simek func(DHCP, dhcp, na) 247b72894f1SMichal Simek 248b72894f1SMichal Simek #include <config_distro_bootcmd.h> 249b72894f1SMichal Simek 250b72894f1SMichal Simek /* Initial environment variables */ 251b72894f1SMichal Simek #ifndef CONFIG_EXTRA_ENV_SETTINGS 252b72894f1SMichal Simek #define CONFIG_EXTRA_ENV_SETTINGS \ 253b72894f1SMichal Simek ENV_MEM_LAYOUT_SETTINGS \ 254b72894f1SMichal Simek BOOTENV \ 255b72894f1SMichal Simek DFU_ALT_INFO 256b72894f1SMichal Simek #endif 257b72894f1SMichal Simek 258e6a9ed04SMichal Simek #define CONFIG_SPL_TEXT_BASE 0xfffc0000 259*8fbf678bSSoren Brinkmann #define CONFIG_SPL_STACK 0xfffffffc 260e6a9ed04SMichal Simek #define CONFIG_SPL_MAX_SIZE 0x20000 261e6a9ed04SMichal Simek 262e6a9ed04SMichal Simek /* Just random location in OCM */ 263e6a9ed04SMichal Simek #define CONFIG_SPL_BSS_START_ADDR 0x1000000 264e6a9ed04SMichal Simek #define CONFIG_SPL_BSS_MAX_SIZE 0x2000000 265e6a9ed04SMichal Simek 266e6a9ed04SMichal Simek #define CONFIG_SPL_FRAMEWORK 267e6a9ed04SMichal Simek #define CONFIG_SPL_LIBCOMMON_SUPPORT 268e6a9ed04SMichal Simek #define CONFIG_SPL_LIBGENERIC_SUPPORT 269e6a9ed04SMichal Simek #define CONFIG_SPL_SERIAL_SUPPORT 270e6a9ed04SMichal Simek #define CONFIG_SPL_BOARD_INIT 271e6a9ed04SMichal Simek #define CONFIG_SPL_RAM_DEVICE 272e6a9ed04SMichal Simek 273e6a9ed04SMichal Simek #define CONFIG_SPL_OS_BOOT 274e6a9ed04SMichal Simek /* u-boot is like dtb */ 275e6a9ed04SMichal Simek #define CONFIG_SPL_FS_LOAD_ARGS_NAME "u-boot.bin" 276e6a9ed04SMichal Simek #define CONFIG_SYS_SPL_ARGS_ADDR 0x8000000 277e6a9ed04SMichal Simek 278e6a9ed04SMichal Simek /* ATF is my kernel image */ 279e6a9ed04SMichal Simek #define CONFIG_SPL_FS_LOAD_KERNEL_NAME "atf.ub" 280e6a9ed04SMichal Simek 281e6a9ed04SMichal Simek /* FIT load address for RAM boot */ 282e6a9ed04SMichal Simek #define CONFIG_SPL_LOAD_FIT_ADDRESS 0x10000000 283e6a9ed04SMichal Simek 284e6a9ed04SMichal Simek /* MMC support */ 285e6a9ed04SMichal Simek #ifdef CONFIG_ZYNQ_SDHCI 286e6a9ed04SMichal Simek # define CONFIG_SPL_MMC_SUPPORT 287e6a9ed04SMichal Simek # define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1 288e6a9ed04SMichal Simek # define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0 /* unused */ 289e6a9ed04SMichal Simek # define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS 0 /* unused */ 290e6a9ed04SMichal Simek # define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0 /* unused */ 291e6a9ed04SMichal Simek # define CONFIG_SPL_LIBDISK_SUPPORT 292e6a9ed04SMichal Simek # define CONFIG_SPL_FAT_SUPPORT 293e6a9ed04SMichal Simek # define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img" 294e6a9ed04SMichal Simek #endif 295e6a9ed04SMichal Simek 29684c7204bSMichal Simek #endif /* __XILINX_ZYNQMP_H */ 297