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 /* Generic Interrupt Controller Definitions */ 1984c7204bSMichal Simek #define CONFIG_GICV2 2084c7204bSMichal Simek #define GICD_BASE 0xF9010000 2184c7204bSMichal Simek #define GICC_BASE 0xF9020000 2284c7204bSMichal Simek 23d759512fSMichal Simek #define CONFIG_SYS_ALT_MEMTEST 24d759512fSMichal Simek #define CONFIG_SYS_MEMTEST_SCRATCH 0xfffc0000 25d759512fSMichal Simek 268d59d7f6SMichal Simek #ifndef CONFIG_NR_DRAM_BANKS 278d59d7f6SMichal Simek # define CONFIG_NR_DRAM_BANKS 2 288d59d7f6SMichal Simek #endif 298d59d7f6SMichal Simek #define CONFIG_SYS_MEMTEST_START 0 308d59d7f6SMichal Simek #define CONFIG_SYS_MEMTEST_END 1000 3184c7204bSMichal Simek 328fbf678bSSoren Brinkmann #define CONFIG_SYS_INIT_SP_ADDR CONFIG_SYS_TEXT_BASE 3384c7204bSMichal Simek 3484c7204bSMichal Simek /* Generic Timer Definitions - setup in EL3. Setup by ATF for other cases */ 35713b6164SMichal Simek #if !defined(COUNTER_FREQUENCY) 36713b6164SMichal Simek # define COUNTER_FREQUENCY 100000000 37713b6164SMichal Simek #endif 3884c7204bSMichal Simek 3984c7204bSMichal Simek /* Size of malloc() pool */ 4016fa00a7SSiva Durga Prasad Paladugu #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 0x2000000) 4184c7204bSMichal Simek 4284c7204bSMichal Simek /* Serial setup */ 43b0d18beeSSiva Durga Prasad Paladugu #define CONFIG_ARM_DCC 44b0d18beeSSiva Durga Prasad Paladugu #define CONFIG_CPU_ARMV8 4584c7204bSMichal Simek #define CONFIG_ZYNQ_SERIAL 4684c7204bSMichal Simek 4784c7204bSMichal Simek #define CONFIG_CONS_INDEX 0 4884c7204bSMichal Simek #define CONFIG_SYS_BAUDRATE_TABLE \ 4984c7204bSMichal Simek { 4800, 9600, 19200, 38400, 57600, 115200 } 5084c7204bSMichal Simek 5184c7204bSMichal Simek /* Command line configuration */ 525cb24200SMichal Simek #define CONFIG_MP 5384c7204bSMichal Simek 54cb7ea820SMichal Simek /* BOOTP options */ 55cb7ea820SMichal Simek #define CONFIG_BOOTP_BOOTFILESIZE 56cb7ea820SMichal Simek #define CONFIG_BOOTP_BOOTPATH 57cb7ea820SMichal Simek #define CONFIG_BOOTP_GATEWAY 58cb7ea820SMichal Simek #define CONFIG_BOOTP_HOSTNAME 59cb7ea820SMichal Simek #define CONFIG_BOOTP_MAY_FAIL 60a1207de0SMichal Simek #define CONFIG_BOOTP_DNS 61a1207de0SMichal Simek #define CONFIG_BOOTP_PXE 62a1207de0SMichal Simek #define CONFIG_BOOTP_SUBNETMASK 63a1207de0SMichal Simek 64a1207de0SMichal Simek /* Diff from config_distro_defaults.h */ 65a1207de0SMichal Simek #define CONFIG_SUPPORT_RAW_INITRD 66d58fc12eSMichal Simek #if !defined(CONFIG_SPL_BUILD) 67a1207de0SMichal Simek #define CONFIG_ENV_VARS_UBOOT_CONFIG 68d58fc12eSMichal Simek #endif 69a1207de0SMichal Simek #define CONFIG_AUTO_COMPLETE 70a1207de0SMichal Simek 7108aa0334SMasahiro Yamada #if defined(CONFIG_MMC_SDHCI_ZYNQ) 72926782cdSMichal Simek # define CONFIG_SUPPORT_EMMC_BOOT 73f3bd7280SMichal Simek # ifndef CONFIG_ZYNQ_SDHCI_MAX_FREQ 74f3bd7280SMichal Simek # define CONFIG_ZYNQ_SDHCI_MAX_FREQ 200000000 75f3bd7280SMichal Simek # endif 766f09d343SSiva Durga Prasad Paladugu # define CONFIG_ENV_IS_IN_FAT 776f09d343SSiva Durga Prasad Paladugu # define FAT_ENV_DEVICE_AND_PART "0:auto" 786f09d343SSiva Durga Prasad Paladugu # define FAT_ENV_FILE "uboot.env" 796f09d343SSiva Durga Prasad Paladugu # define FAT_ENV_INTERFACE "mmc" 8046f68e68SMichal Simek #endif 8146f68e68SMichal Simek 8278cb965aSSiva Durga Prasad Paladugu #ifdef CONFIG_NAND_ARASAN 8378cb965aSSiva Durga Prasad Paladugu # define CONFIG_CMD_NAND_LOCK_UNLOCK 8478cb965aSSiva Durga Prasad Paladugu # define CONFIG_SYS_MAX_NAND_DEVICE 1 8578cb965aSSiva Durga Prasad Paladugu # define CONFIG_SYS_NAND_SELF_INIT 8678cb965aSSiva Durga Prasad Paladugu # define CONFIG_SYS_NAND_ONFI_DETECTION 8778cb965aSSiva Durga Prasad Paladugu # define CONFIG_MTD_DEVICE 8878cb965aSSiva Durga Prasad Paladugu #endif 8978cb965aSSiva Durga Prasad Paladugu 9084c7204bSMichal Simek /* Miscellaneous configurable options */ 9184c7204bSMichal Simek #define CONFIG_SYS_LOAD_ADDR 0x8000000 9284c7204bSMichal Simek 9316fa00a7SSiva Durga Prasad Paladugu #if defined(CONFIG_ZYNQMP_USB) 940f676767SSiva Durga Prasad Paladugu #define CONFIG_SYS_USB_XHCI_MAX_ROOT_PORTS 2 950f676767SSiva Durga Prasad Paladugu 9616fa00a7SSiva Durga Prasad Paladugu #define CONFIG_SYS_DFU_DATA_BUF_SIZE 0x1800000 9716fa00a7SSiva Durga Prasad Paladugu #define DFU_DEFAULT_POLL_TIMEOUT 300 9816fa00a7SSiva Durga Prasad Paladugu #define CONFIG_USB_CABLE_CHECK 9916fa00a7SSiva Durga Prasad Paladugu #define CONFIG_CMD_THOR_DOWNLOAD 10016fa00a7SSiva Durga Prasad Paladugu #define CONFIG_USB_FUNCTION_THOR 10116fa00a7SSiva Durga Prasad Paladugu #define CONFIG_THOR_RESET_OFF 10216fa00a7SSiva Durga Prasad Paladugu #define DFU_ALT_INFO_RAM \ 10316fa00a7SSiva Durga Prasad Paladugu "dfu_ram_info=" \ 1040e43140bSSiva Durga Prasad Paladugu "setenv dfu_alt_info " \ 1051b19daf4SSiva Durga Prasad Paladugu "Image ram $kernel_addr $kernel_size\\\\;" \ 1061b19daf4SSiva Durga Prasad Paladugu "system.dtb ram $fdt_addr $fdt_size\0" \ 10716fa00a7SSiva Durga Prasad Paladugu "dfu_ram=run dfu_ram_info && dfu 0 ram 0\0" \ 10816fa00a7SSiva Durga Prasad Paladugu "thor_ram=run dfu_ram_info && thordown 0 ram 0\0" 10916fa00a7SSiva Durga Prasad Paladugu 11016fa00a7SSiva Durga Prasad Paladugu #define DFU_ALT_INFO \ 11116fa00a7SSiva Durga Prasad Paladugu DFU_ALT_INFO_RAM 1125ce987feSSiva Durga Prasad Paladugu 1135ce987feSSiva Durga Prasad Paladugu #ifndef CONFIG_SPL_BUILD 1145ce987feSSiva Durga Prasad Paladugu # define CONFIG_USB_FUNCTION_FASTBOOT 1155ce987feSSiva Durga Prasad Paladugu # define CONFIG_CMD_FASTBOOT 1165ce987feSSiva Durga Prasad Paladugu # define CONFIG_ANDROID_BOOT_IMAGE 1175ce987feSSiva Durga Prasad Paladugu # define CONFIG_FASTBOOT_BUF_ADDR 0x100000 1185ce987feSSiva Durga Prasad Paladugu # define CONFIG_FASTBOOT_BUF_SIZE 0x6000000 1195ce987feSSiva Durga Prasad Paladugu # define CONFIG_FASTBOOT_FLASH 12008aa0334SMasahiro Yamada # ifdef CONFIG_MMC_SDHCI_ZYNQ 1215ce987feSSiva Durga Prasad Paladugu # define CONFIG_FASTBOOT_FLASH_MMC_DEV 0 1225ce987feSSiva Durga Prasad Paladugu # endif 1235ce987feSSiva Durga Prasad Paladugu 1245ce987feSSiva Durga Prasad Paladugu # define CONFIG_RANDOM_UUID 1255ce987feSSiva Durga Prasad Paladugu # define PARTS_DEFAULT \ 1265ce987feSSiva Durga Prasad Paladugu "partitions=uuid_disk=${uuid_gpt_disk};" \ 1275ce987feSSiva Durga Prasad Paladugu "name=""boot"",size=16M,uuid=${uuid_gpt_boot};" \ 1285ce987feSSiva Durga Prasad Paladugu "name=""Linux"",size=-M,uuid=${uuid_gpt_Linux}\0" 1295ce987feSSiva Durga Prasad Paladugu #endif 13016fa00a7SSiva Durga Prasad Paladugu #endif 13116fa00a7SSiva Durga Prasad Paladugu 13216fa00a7SSiva Durga Prasad Paladugu #if !defined(DFU_ALT_INFO) 13316fa00a7SSiva Durga Prasad Paladugu # define DFU_ALT_INFO 13416fa00a7SSiva Durga Prasad Paladugu #endif 13516fa00a7SSiva Durga Prasad Paladugu 1365ce987feSSiva Durga Prasad Paladugu #if !defined(PARTS_DEFAULT) 1375ce987feSSiva Durga Prasad Paladugu # define PARTS_DEFAULT 1385ce987feSSiva Durga Prasad Paladugu #endif 1395ce987feSSiva Durga Prasad Paladugu 14084c7204bSMichal Simek /* Do not preserve environment */ 1416f09d343SSiva Durga Prasad Paladugu #if !defined(CONFIG_ENV_IS_IN_FAT) 14284c7204bSMichal Simek #define CONFIG_ENV_IS_NOWHERE 1 1436f09d343SSiva Durga Prasad Paladugu #endif 144936b0384SSiva Durga Prasad Paladugu #define CONFIG_ENV_SIZE 0x8000 14584c7204bSMichal Simek 14684c7204bSMichal Simek /* Monitor Command Prompt */ 14784c7204bSMichal Simek /* Console I/O Buffer Size */ 14884c7204bSMichal Simek #define CONFIG_SYS_CBSIZE 2048 14984c7204bSMichal Simek #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \ 15084c7204bSMichal Simek sizeof(CONFIG_SYS_PROMPT) + 16) 15184c7204bSMichal Simek #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE 15284c7204bSMichal Simek #define CONFIG_SYS_LONGHELP 15384c7204bSMichal Simek #define CONFIG_CMDLINE_EDITING 15484c7204bSMichal Simek #define CONFIG_SYS_MAXARGS 64 15584c7204bSMichal Simek 156cb7ea820SMichal Simek /* Ethernet driver */ 157596e5782SMichal Simek #if defined(CONFIG_ZYNQ_GEM) 158cb7ea820SMichal Simek # define CONFIG_NET_MULTI 159cb7ea820SMichal Simek # define CONFIG_MII 160cb7ea820SMichal Simek # define CONFIG_SYS_FAULT_ECHO_LINK_DOWN 161cb7ea820SMichal Simek # define CONFIG_PHY_MARVELL 162f96fe2c0SMichal Simek # define CONFIG_PHY_NATSEMI 163bf146325SMichal Simek # define CONFIG_PHY_TI 164c4c96f2bSMichal Simek # define CONFIG_PHY_GIGE 165a1a6af82SMichal Simek # define CONFIG_PHY_VITESSE 166a1a6af82SMichal Simek # define CONFIG_PHY_REALTEK 167e2928f32SSiva Durga Prasad Paladugu # define PHY_ANEG_TIMEOUT 20000 168cb7ea820SMichal Simek #endif 169cb7ea820SMichal Simek 1702594e03cSSiva Durga Prasad Paladugu /* I2C */ 1712594e03cSSiva Durga Prasad Paladugu #if defined(CONFIG_SYS_I2C_ZYNQ) 1722594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_I2C 1732594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_I2C_ZYNQ_SPEED 100000 1742594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_I2C_ZYNQ_SLAVE 0 1752594e03cSSiva Durga Prasad Paladugu #endif 1762594e03cSSiva Durga Prasad Paladugu 1772594e03cSSiva Durga Prasad Paladugu /* EEPROM */ 1782594e03cSSiva Durga Prasad Paladugu #ifdef CONFIG_ZYNQMP_EEPROM 1792594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2 1802594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_I2C_EEPROM_ADDR 0x54 1812594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 4 1822594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 5 1832594e03cSSiva Durga Prasad Paladugu # define CONFIG_SYS_EEPROM_SIZE (64 * 1024) 1842594e03cSSiva Durga Prasad Paladugu #endif 1852594e03cSSiva Durga Prasad Paladugu 1860d169b8cSMichal Simek #ifdef CONFIG_SATA_CEVA 1876fe6f135SMichal Simek #define CONFIG_LIBATA 1886fe6f135SMichal Simek #define CONFIG_SCSI_AHCI 189679b994aSMichal Simek #define CONFIG_SYS_SCSI_MAX_SCSI_ID 2 1906fe6f135SMichal Simek #define CONFIG_SYS_SCSI_MAX_LUN 1 1916fe6f135SMichal Simek #define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \ 1926fe6f135SMichal Simek CONFIG_SYS_SCSI_MAX_LUN) 193c649e3c9SSimon Glass #define CONFIG_SCSI 1946fe6f135SMichal Simek #endif 1956fe6f135SMichal Simek 19684c7204bSMichal Simek #define CONFIG_SYS_BOOTM_LEN (60 * 1024 * 1024) 19784c7204bSMichal Simek 19884c7204bSMichal Simek #define CONFIG_BOARD_EARLY_INIT_R 19984c7204bSMichal Simek #define CONFIG_CLOCKS 20084c7204bSMichal Simek 201b72894f1SMichal Simek #define ENV_MEM_LAYOUT_SETTINGS \ 202b72894f1SMichal Simek "fdt_high=10000000\0" \ 203b72894f1SMichal Simek "initrd_high=10000000\0" \ 204b72894f1SMichal Simek "fdt_addr_r=0x40000000\0" \ 205b72894f1SMichal Simek "pxefile_addr_r=0x10000000\0" \ 206b72894f1SMichal Simek "kernel_addr_r=0x18000000\0" \ 207b72894f1SMichal Simek "scriptaddr=0x02000000\0" \ 208b72894f1SMichal Simek "ramdisk_addr_r=0x02100000\0" \ 209b72894f1SMichal Simek 21008aa0334SMasahiro Yamada #if defined(CONFIG_MMC_SDHCI_ZYNQ) 211b72894f1SMichal Simek # define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0) func(MMC, mmc, 1) 212b72894f1SMichal Simek #else 213b72894f1SMichal Simek # define BOOT_TARGET_DEVICES_MMC(func) 214b72894f1SMichal Simek #endif 215b72894f1SMichal Simek 216b72894f1SMichal Simek #if defined(CONFIG_SATA_CEVA) 217b72894f1SMichal Simek # define BOOT_TARGET_DEVICES_SCSI(func) func(SCSI, scsi, 0) 218b72894f1SMichal Simek #else 219b72894f1SMichal Simek # define BOOT_TARGET_DEVICES_SCSI(func) 220b72894f1SMichal Simek #endif 221b72894f1SMichal Simek 222b72894f1SMichal Simek #if defined(CONFIG_ZYNQMP_USB) 223b72894f1SMichal Simek # define BOOT_TARGET_DEVICES_USB(func) func(USB, usb, 0) func(USB, usb, 1) 224b72894f1SMichal Simek #else 225b72894f1SMichal Simek # define BOOT_TARGET_DEVICES_USB(func) 226b72894f1SMichal Simek #endif 227b72894f1SMichal Simek 228b72894f1SMichal Simek #define BOOT_TARGET_DEVICES(func) \ 229b72894f1SMichal Simek BOOT_TARGET_DEVICES_MMC(func) \ 230b72894f1SMichal Simek BOOT_TARGET_DEVICES_USB(func) \ 231b72894f1SMichal Simek BOOT_TARGET_DEVICES_SCSI(func) \ 232b72894f1SMichal Simek func(PXE, pxe, na) \ 233b72894f1SMichal Simek func(DHCP, dhcp, na) 234b72894f1SMichal Simek 235b72894f1SMichal Simek #include <config_distro_bootcmd.h> 236b72894f1SMichal Simek 237b72894f1SMichal Simek /* Initial environment variables */ 238b72894f1SMichal Simek #ifndef CONFIG_EXTRA_ENV_SETTINGS 239b72894f1SMichal Simek #define CONFIG_EXTRA_ENV_SETTINGS \ 240b72894f1SMichal Simek ENV_MEM_LAYOUT_SETTINGS \ 241b72894f1SMichal Simek BOOTENV \ 242b72894f1SMichal Simek DFU_ALT_INFO 243b72894f1SMichal Simek #endif 244b72894f1SMichal Simek 245d58fc12eSMichal Simek /* SPL can't handle all huge variables - define just DFU */ 246d58fc12eSMichal Simek #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_DFU_SUPPORT) 247d58fc12eSMichal Simek #undef CONFIG_EXTRA_ENV_SETTINGS 248d58fc12eSMichal Simek # define CONFIG_EXTRA_ENV_SETTINGS \ 249d58fc12eSMichal Simek "dfu_alt_info_ram=uboot.bin ram 0x8000000 0x1000000;" \ 250d58fc12eSMichal Simek "atf-uboot.ub ram 0x10000000 0x1000000;" \ 251d58fc12eSMichal Simek "Image ram 0x80000 0x3f80000;" \ 252d58fc12eSMichal Simek "system.dtb ram 0x4000000 0x100000\0" \ 253d58fc12eSMichal Simek "dfu_bufsiz=0x1000\0" 254d58fc12eSMichal Simek #endif 255d58fc12eSMichal Simek 256e6a9ed04SMichal Simek #define CONFIG_SPL_TEXT_BASE 0xfffc0000 2578fbf678bSSoren Brinkmann #define CONFIG_SPL_STACK 0xfffffffc 258d58fc12eSMichal Simek #define CONFIG_SPL_MAX_SIZE 0x40000 259e6a9ed04SMichal Simek 260e6a9ed04SMichal Simek /* Just random location in OCM */ 2618ed31f36SMichal Simek #define CONFIG_SPL_BSS_START_ADDR 0x0 2628ed31f36SMichal Simek #define CONFIG_SPL_BSS_MAX_SIZE 0x80000 263e6a9ed04SMichal Simek 264e6a9ed04SMichal Simek #define CONFIG_SPL_FRAMEWORK 265e6a9ed04SMichal Simek 266e6a9ed04SMichal Simek /* u-boot is like dtb */ 267e6a9ed04SMichal Simek #define CONFIG_SPL_FS_LOAD_ARGS_NAME "u-boot.bin" 268e6a9ed04SMichal Simek #define CONFIG_SYS_SPL_ARGS_ADDR 0x8000000 269e6a9ed04SMichal Simek 270e6a9ed04SMichal Simek /* ATF is my kernel image */ 2711309f671SMichal Simek #define CONFIG_SPL_FS_LOAD_KERNEL_NAME "atf-uboot.ub" 272e6a9ed04SMichal Simek 273e6a9ed04SMichal Simek /* FIT load address for RAM boot */ 274e6a9ed04SMichal Simek #define CONFIG_SPL_LOAD_FIT_ADDRESS 0x10000000 275e6a9ed04SMichal Simek 276e6a9ed04SMichal Simek /* MMC support */ 27708aa0334SMasahiro Yamada #ifdef CONFIG_MMC_SDHCI_ZYNQ 278e6a9ed04SMichal Simek # define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1 279e6a9ed04SMichal Simek # define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0 /* unused */ 280e6a9ed04SMichal Simek # define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS 0 /* unused */ 281e6a9ed04SMichal Simek # define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0 /* unused */ 282e6a9ed04SMichal Simek # define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img" 283e6a9ed04SMichal Simek #endif 284e6a9ed04SMichal Simek 285d58fc12eSMichal Simek #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_DFU_SUPPORT) 286d58fc12eSMichal Simek # undef CONFIG_CMD_BOOTD 287d58fc12eSMichal Simek # define CONFIG_SPL_ENV_SUPPORT 288d58fc12eSMichal Simek # define CONFIG_SPL_HASH_SUPPORT 289d58fc12eSMichal Simek # define CONFIG_ENV_MAX_ENTRIES 10 290d58fc12eSMichal Simek 291d58fc12eSMichal Simek # define CONFIG_SYS_SPL_MALLOC_START 0x20000000 292*6b104feaSMichal Simek # define CONFIG_SYS_SPL_MALLOC_SIZE 0x100000 293d58fc12eSMichal Simek 294d58fc12eSMichal Simek #ifdef CONFIG_SPL_SYS_MALLOC_SIMPLE 295d58fc12eSMichal Simek # error "Disable CONFIG_SPL_SYS_MALLOC_SIMPLE. Full malloc needs to be used" 296d58fc12eSMichal Simek #endif 297d58fc12eSMichal Simek #endif 298d58fc12eSMichal Simek 29984c7204bSMichal Simek #endif /* __XILINX_ZYNQMP_H */ 300