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 378fbf678bSSoren Brinkmann #define CONFIG_SYS_INIT_SP_ADDR CONFIG_SYS_TEXT_BASE 3884c7204bSMichal Simek 3984c7204bSMichal Simek /* Generic Timer Definitions - setup in EL3. Setup by ATF for other cases */ 40713b6164SMichal Simek #if !defined(COUNTER_FREQUENCY) 41713b6164SMichal Simek # define COUNTER_FREQUENCY 100000000 42713b6164SMichal Simek #endif 4384c7204bSMichal Simek 4484c7204bSMichal Simek /* Size of malloc() pool */ 4516fa00a7SSiva Durga Prasad Paladugu #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 0x2000000) 4684c7204bSMichal Simek 4784c7204bSMichal Simek /* Serial setup */ 48b0d18beeSSiva Durga Prasad Paladugu #define CONFIG_ARM_DCC 49b0d18beeSSiva Durga Prasad Paladugu #define CONFIG_CPU_ARMV8 5084c7204bSMichal Simek #define CONFIG_ZYNQ_SERIAL 5184c7204bSMichal Simek 5284c7204bSMichal Simek #define CONFIG_CONS_INDEX 0 5384c7204bSMichal Simek #define CONFIG_BAUDRATE 115200 5484c7204bSMichal Simek #define CONFIG_SYS_BAUDRATE_TABLE \ 5584c7204bSMichal Simek { 4800, 9600, 19200, 38400, 57600, 115200 } 5684c7204bSMichal Simek 5784c7204bSMichal Simek /* Command line configuration */ 5884c7204bSMichal Simek #define CONFIG_CMD_ENV 5984c7204bSMichal Simek #define CONFIG_DOS_PARTITION 6007654ba1SMichal Simek #define CONFIG_EFI_PARTITION 61e6a9ed04SMichal Simek #ifndef CONFIG_SPL_BUILD 62a1207de0SMichal Simek # define CONFIG_ISO_PARTITION 63e6a9ed04SMichal Simek #endif 645cb24200SMichal Simek #define CONFIG_MP 6584c7204bSMichal Simek 66cb7ea820SMichal Simek /* BOOTP options */ 67cb7ea820SMichal Simek #define CONFIG_BOOTP_BOOTFILESIZE 68cb7ea820SMichal Simek #define CONFIG_BOOTP_BOOTPATH 69cb7ea820SMichal Simek #define CONFIG_BOOTP_GATEWAY 70cb7ea820SMichal Simek #define CONFIG_BOOTP_HOSTNAME 71cb7ea820SMichal Simek #define CONFIG_BOOTP_MAY_FAIL 72a1207de0SMichal Simek #define CONFIG_BOOTP_DNS 73a1207de0SMichal Simek #define CONFIG_BOOTP_PXE 74a1207de0SMichal Simek #define CONFIG_BOOTP_SUBNETMASK 75a1207de0SMichal Simek 76a1207de0SMichal Simek /* Diff from config_distro_defaults.h */ 77a1207de0SMichal Simek #define CONFIG_SUPPORT_RAW_INITRD 78d58fc12eSMichal Simek #if !defined(CONFIG_SPL_BUILD) 79a1207de0SMichal Simek #define CONFIG_ENV_VARS_UBOOT_CONFIG 80d58fc12eSMichal Simek #endif 81a1207de0SMichal Simek #define CONFIG_AUTO_COMPLETE 82a1207de0SMichal Simek 83ce0335f2SMichal Simek #if defined(CONFIG_ZYNQ_SDHCI) 8484c7204bSMichal Simek # define CONFIG_GENERIC_MMC 85926782cdSMichal Simek # define CONFIG_SUPPORT_EMMC_BOOT 86f3bd7280SMichal Simek # ifndef CONFIG_ZYNQ_SDHCI_MAX_FREQ 87f3bd7280SMichal Simek # define CONFIG_ZYNQ_SDHCI_MAX_FREQ 200000000 88f3bd7280SMichal Simek # endif 8946f68e68SMichal Simek #endif 9046f68e68SMichal Simek 9146f68e68SMichal Simek #if defined(CONFIG_ZYNQ_SDHCI) || defined(CONFIG_ZYNQMP_USB) 9284c7204bSMichal Simek # define CONFIG_FAT_WRITE 9384c7204bSMichal Simek #endif 9484c7204bSMichal Simek 9578cb965aSSiva Durga Prasad Paladugu #ifdef CONFIG_NAND_ARASAN 9678cb965aSSiva Durga Prasad Paladugu # define CONFIG_CMD_NAND_LOCK_UNLOCK 9778cb965aSSiva Durga Prasad Paladugu # define CONFIG_SYS_MAX_NAND_DEVICE 1 9878cb965aSSiva Durga Prasad Paladugu # define CONFIG_SYS_NAND_SELF_INIT 9978cb965aSSiva Durga Prasad Paladugu # define CONFIG_SYS_NAND_ONFI_DETECTION 10078cb965aSSiva Durga Prasad Paladugu # define CONFIG_MTD_DEVICE 10178cb965aSSiva Durga Prasad Paladugu #endif 10278cb965aSSiva Durga Prasad Paladugu 10384c7204bSMichal Simek /* Miscellaneous configurable options */ 10484c7204bSMichal Simek #define CONFIG_SYS_LOAD_ADDR 0x8000000 10584c7204bSMichal Simek 10616fa00a7SSiva Durga Prasad Paladugu #if defined(CONFIG_ZYNQMP_USB) 1070f676767SSiva Durga Prasad Paladugu #define CONFIG_SYS_USB_XHCI_MAX_ROOT_PORTS 2 1080f676767SSiva Durga Prasad Paladugu #define CONFIG_USB_XHCI_ZYNQMP 1090f676767SSiva Durga Prasad Paladugu 11016fa00a7SSiva Durga Prasad Paladugu #define CONFIG_SYS_DFU_DATA_BUF_SIZE 0x1800000 11116fa00a7SSiva Durga Prasad Paladugu #define DFU_DEFAULT_POLL_TIMEOUT 300 11216fa00a7SSiva Durga Prasad Paladugu #define CONFIG_USB_CABLE_CHECK 11316fa00a7SSiva Durga Prasad Paladugu #define CONFIG_CMD_THOR_DOWNLOAD 11416fa00a7SSiva Durga Prasad Paladugu #define CONFIG_USB_FUNCTION_THOR 11516fa00a7SSiva Durga Prasad Paladugu #define CONFIG_THOR_RESET_OFF 11616fa00a7SSiva Durga Prasad Paladugu #define DFU_ALT_INFO_RAM \ 11716fa00a7SSiva Durga Prasad Paladugu "dfu_ram_info=" \ 1180e43140bSSiva Durga Prasad Paladugu "setenv dfu_alt_info " \ 1191b19daf4SSiva Durga Prasad Paladugu "Image ram $kernel_addr $kernel_size\\\\;" \ 1201b19daf4SSiva Durga Prasad Paladugu "system.dtb ram $fdt_addr $fdt_size\0" \ 12116fa00a7SSiva Durga Prasad Paladugu "dfu_ram=run dfu_ram_info && dfu 0 ram 0\0" \ 12216fa00a7SSiva Durga Prasad Paladugu "thor_ram=run dfu_ram_info && thordown 0 ram 0\0" 12316fa00a7SSiva Durga Prasad Paladugu 12416fa00a7SSiva Durga Prasad Paladugu #define DFU_ALT_INFO \ 12516fa00a7SSiva Durga Prasad Paladugu DFU_ALT_INFO_RAM 12616fa00a7SSiva Durga Prasad Paladugu #endif 12716fa00a7SSiva Durga Prasad Paladugu 12816fa00a7SSiva Durga Prasad Paladugu #if !defined(DFU_ALT_INFO) 12916fa00a7SSiva Durga Prasad Paladugu # define DFU_ALT_INFO 13016fa00a7SSiva Durga Prasad Paladugu #endif 13116fa00a7SSiva Durga Prasad Paladugu 13284c7204bSMichal Simek #define CONFIG_BOARD_LATE_INIT 13384c7204bSMichal Simek 13484c7204bSMichal Simek /* Do not preserve environment */ 13584c7204bSMichal Simek #define CONFIG_ENV_IS_NOWHERE 1 136*936b0384SSiva Durga Prasad Paladugu #define CONFIG_ENV_SIZE 0x8000 13784c7204bSMichal Simek 13884c7204bSMichal Simek /* Monitor Command Prompt */ 13984c7204bSMichal Simek /* Console I/O Buffer Size */ 14084c7204bSMichal Simek #define CONFIG_SYS_CBSIZE 2048 14184c7204bSMichal Simek #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \ 14284c7204bSMichal Simek sizeof(CONFIG_SYS_PROMPT) + 16) 14384c7204bSMichal Simek #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE 14484c7204bSMichal Simek #define CONFIG_SYS_LONGHELP 14584c7204bSMichal Simek #define CONFIG_CMDLINE_EDITING 14684c7204bSMichal Simek #define CONFIG_SYS_MAXARGS 64 14784c7204bSMichal Simek 148cb7ea820SMichal Simek /* Ethernet driver */ 149596e5782SMichal Simek #if defined(CONFIG_ZYNQ_GEM) 150cb7ea820SMichal Simek # define CONFIG_NET_MULTI 151cb7ea820SMichal Simek # define CONFIG_MII 152cb7ea820SMichal Simek # define CONFIG_SYS_FAULT_ECHO_LINK_DOWN 153cb7ea820SMichal Simek # define CONFIG_PHY_MARVELL 154f96fe2c0SMichal Simek # define CONFIG_PHY_NATSEMI 155bf146325SMichal Simek # define CONFIG_PHY_TI 156c4c96f2bSMichal Simek # define CONFIG_PHY_GIGE 157a1a6af82SMichal Simek # define CONFIG_PHY_VITESSE 158a1a6af82SMichal Simek # define CONFIG_PHY_REALTEK 159e2928f32SSiva Durga Prasad Paladugu # define PHY_ANEG_TIMEOUT 20000 160cb7ea820SMichal Simek #endif 161cb7ea820SMichal Simek 1622594e03cSSiva Durga Prasad Paladugu /* I2C */ 1632594e03cSSiva Durga Prasad Paladugu #if defined(CONFIG_SYS_I2C_ZYNQ) 1642594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_I2C 1652594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_I2C_ZYNQ_SPEED 100000 1662594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_I2C_ZYNQ_SLAVE 0 1672594e03cSSiva Durga Prasad Paladugu #endif 1682594e03cSSiva Durga Prasad Paladugu 1692594e03cSSiva Durga Prasad Paladugu /* EEPROM */ 1702594e03cSSiva Durga Prasad Paladugu #ifdef CONFIG_ZYNQMP_EEPROM 1712594e03cSSiva Durga Prasad Paladugu # define CONFIG_CMD_EEPROM 1722594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2 1732594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_I2C_EEPROM_ADDR 0x54 1742594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 4 1752594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 5 1762594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_EEPROM_SIZE (64 * 1024) 1772594e03cSSiva Durga Prasad Paladugu #endif 1782594e03cSSiva Durga Prasad Paladugu 1790d169b8cSMichal Simek #ifdef CONFIG_SATA_CEVA 1806fe6f135SMichal Simek #define CONFIG_LIBATA 1816fe6f135SMichal Simek #define CONFIG_SCSI_AHCI 182679b994aSMichal Simek #define CONFIG_SYS_SCSI_MAX_SCSI_ID 2 1836fe6f135SMichal Simek #define CONFIG_SYS_SCSI_MAX_LUN 1 1846fe6f135SMichal Simek #define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \ 1856fe6f135SMichal Simek CONFIG_SYS_SCSI_MAX_LUN) 186c649e3c9SSimon Glass #define CONFIG_SCSI 1876fe6f135SMichal Simek #endif 1886fe6f135SMichal Simek 18984c7204bSMichal Simek #define CONFIG_SYS_BOOTM_LEN (60 * 1024 * 1024) 19084c7204bSMichal Simek 19184c7204bSMichal Simek #define CONFIG_CMD_UNZIP 19284c7204bSMichal Simek 19384c7204bSMichal Simek #define CONFIG_BOARD_EARLY_INIT_R 19484c7204bSMichal Simek #define CONFIG_CLOCKS 19584c7204bSMichal Simek 196b72894f1SMichal Simek #define ENV_MEM_LAYOUT_SETTINGS \ 197b72894f1SMichal Simek "fdt_high=10000000\0" \ 198b72894f1SMichal Simek "initrd_high=10000000\0" \ 199b72894f1SMichal Simek "fdt_addr_r=0x40000000\0" \ 200b72894f1SMichal Simek "pxefile_addr_r=0x10000000\0" \ 201b72894f1SMichal Simek "kernel_addr_r=0x18000000\0" \ 202b72894f1SMichal Simek "scriptaddr=0x02000000\0" \ 203b72894f1SMichal Simek "ramdisk_addr_r=0x02100000\0" \ 204b72894f1SMichal Simek 205b72894f1SMichal Simek #if defined(CONFIG_ZYNQ_SDHCI) 206b72894f1SMichal Simek # define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0) func(MMC, mmc, 1) 207b72894f1SMichal Simek #else 208b72894f1SMichal Simek # define BOOT_TARGET_DEVICES_MMC(func) 209b72894f1SMichal Simek #endif 210b72894f1SMichal Simek 211b72894f1SMichal Simek #if defined(CONFIG_SATA_CEVA) 212b72894f1SMichal Simek # define BOOT_TARGET_DEVICES_SCSI(func) func(SCSI, scsi, 0) 213b72894f1SMichal Simek #else 214b72894f1SMichal Simek # define BOOT_TARGET_DEVICES_SCSI(func) 215b72894f1SMichal Simek #endif 216b72894f1SMichal Simek 217b72894f1SMichal Simek #if defined(CONFIG_ZYNQMP_USB) 218b72894f1SMichal Simek # define BOOT_TARGET_DEVICES_USB(func) func(USB, usb, 0) func(USB, usb, 1) 219b72894f1SMichal Simek #else 220b72894f1SMichal Simek # define BOOT_TARGET_DEVICES_USB(func) 221b72894f1SMichal Simek #endif 222b72894f1SMichal Simek 223b72894f1SMichal Simek #define BOOT_TARGET_DEVICES(func) \ 224b72894f1SMichal Simek BOOT_TARGET_DEVICES_MMC(func) \ 225b72894f1SMichal Simek BOOT_TARGET_DEVICES_USB(func) \ 226b72894f1SMichal Simek BOOT_TARGET_DEVICES_SCSI(func) \ 227b72894f1SMichal Simek func(PXE, pxe, na) \ 228b72894f1SMichal Simek func(DHCP, dhcp, na) 229b72894f1SMichal Simek 230b72894f1SMichal Simek #include <config_distro_bootcmd.h> 231b72894f1SMichal Simek 232b72894f1SMichal Simek /* Initial environment variables */ 233b72894f1SMichal Simek #ifndef CONFIG_EXTRA_ENV_SETTINGS 234b72894f1SMichal Simek #define CONFIG_EXTRA_ENV_SETTINGS \ 235b72894f1SMichal Simek ENV_MEM_LAYOUT_SETTINGS \ 236b72894f1SMichal Simek BOOTENV \ 237b72894f1SMichal Simek DFU_ALT_INFO 238b72894f1SMichal Simek #endif 239b72894f1SMichal Simek 240d58fc12eSMichal Simek /* SPL can't handle all huge variables - define just DFU */ 241d58fc12eSMichal Simek #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_DFU_SUPPORT) 242d58fc12eSMichal Simek #undef CONFIG_EXTRA_ENV_SETTINGS 243d58fc12eSMichal Simek # define CONFIG_EXTRA_ENV_SETTINGS \ 244d58fc12eSMichal Simek "dfu_alt_info_ram=uboot.bin ram 0x8000000 0x1000000;" \ 245d58fc12eSMichal Simek "atf-uboot.ub ram 0x10000000 0x1000000;" \ 246d58fc12eSMichal Simek "Image ram 0x80000 0x3f80000;" \ 247d58fc12eSMichal Simek "system.dtb ram 0x4000000 0x100000\0" \ 248d58fc12eSMichal Simek "dfu_bufsiz=0x1000\0" 249d58fc12eSMichal Simek #endif 250d58fc12eSMichal Simek 251e6a9ed04SMichal Simek #define CONFIG_SPL_TEXT_BASE 0xfffc0000 2528fbf678bSSoren Brinkmann #define CONFIG_SPL_STACK 0xfffffffc 253d58fc12eSMichal Simek #define CONFIG_SPL_MAX_SIZE 0x40000 254e6a9ed04SMichal Simek 255e6a9ed04SMichal Simek /* Just random location in OCM */ 2568ed31f36SMichal Simek #define CONFIG_SPL_BSS_START_ADDR 0x0 2578ed31f36SMichal Simek #define CONFIG_SPL_BSS_MAX_SIZE 0x80000 258e6a9ed04SMichal Simek 259e6a9ed04SMichal Simek #define CONFIG_SPL_FRAMEWORK 260e6a9ed04SMichal Simek #define CONFIG_SPL_BOARD_INIT 261e6a9ed04SMichal Simek #define CONFIG_SPL_RAM_DEVICE 262e6a9ed04SMichal Simek 263e6a9ed04SMichal Simek /* u-boot is like dtb */ 264e6a9ed04SMichal Simek #define CONFIG_SPL_FS_LOAD_ARGS_NAME "u-boot.bin" 265e6a9ed04SMichal Simek #define CONFIG_SYS_SPL_ARGS_ADDR 0x8000000 266e6a9ed04SMichal Simek 267e6a9ed04SMichal Simek /* ATF is my kernel image */ 2681309f671SMichal Simek #define CONFIG_SPL_FS_LOAD_KERNEL_NAME "atf-uboot.ub" 269e6a9ed04SMichal Simek 270e6a9ed04SMichal Simek /* FIT load address for RAM boot */ 271e6a9ed04SMichal Simek #define CONFIG_SPL_LOAD_FIT_ADDRESS 0x10000000 272e6a9ed04SMichal Simek 273e6a9ed04SMichal Simek /* MMC support */ 274e6a9ed04SMichal Simek #ifdef CONFIG_ZYNQ_SDHCI 275e6a9ed04SMichal Simek # define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1 276e6a9ed04SMichal Simek # define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0 /* unused */ 277e6a9ed04SMichal Simek # define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS 0 /* unused */ 278e6a9ed04SMichal Simek # define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0 /* unused */ 279e6a9ed04SMichal Simek # define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img" 280e6a9ed04SMichal Simek #endif 281e6a9ed04SMichal Simek 282d58fc12eSMichal Simek #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_DFU_SUPPORT) 283d58fc12eSMichal Simek # undef CONFIG_CMD_BOOTD 284d58fc12eSMichal Simek # define CONFIG_SPL_ENV_SUPPORT 285d58fc12eSMichal Simek # define CONFIG_SPL_HASH_SUPPORT 286d58fc12eSMichal Simek # define CONFIG_ENV_MAX_ENTRIES 10 287d58fc12eSMichal Simek 288d58fc12eSMichal Simek # define CONFIG_SYS_SPL_MALLOC_START 0x20000000 289d58fc12eSMichal Simek # define CONFIG_SYS_SPL_MALLOC_SIZE 0x10000000 290d58fc12eSMichal Simek 291d58fc12eSMichal Simek #ifdef CONFIG_SPL_SYS_MALLOC_SIMPLE 292d58fc12eSMichal Simek # error "Disable CONFIG_SPL_SYS_MALLOC_SIMPLE. Full malloc needs to be used" 293d58fc12eSMichal Simek #endif 294d58fc12eSMichal Simek #endif 295d58fc12eSMichal Simek 29684c7204bSMichal Simek #endif /* __XILINX_ZYNQMP_H */ 297