blob: 1f0da1a4b3e463c853a2b848e8bcd0d735522522 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Michal Simek04b7e622015-01-15 10:01:51 +01002/*
3 * Configuration for Xilinx ZynqMP
4 * (C) Copyright 2014 - 2015 Xilinx, Inc.
5 * Michal Simek <michal.simek@xilinx.com>
6 *
7 * Based on Configuration for Versatile Express
Michal Simek04b7e622015-01-15 10:01:51 +01008 */
9
10#ifndef __XILINX_ZYNQMP_H
11#define __XILINX_ZYNQMP_H
12
Michal Simek04b7e622015-01-15 10:01:51 +010013/* #define CONFIG_ARMV8_SWITCH_TO_EL1 */
14
Michal Simek04b7e622015-01-15 10:01:51 +010015/* Generic Interrupt Controller Definitions */
Michal Simek04b7e622015-01-15 10:01:51 +010016#define GICD_BASE 0xF9010000
17#define GICC_BASE 0xF9020000
18
Soren Brinkmanne911cd02016-07-27 14:12:03 -070019#define CONFIG_SYS_INIT_SP_ADDR CONFIG_SYS_TEXT_BASE
Michal Simek04b7e622015-01-15 10:01:51 +010020
Michal Simek04b7e622015-01-15 10:01:51 +010021/* Generic Timer Definitions - setup in EL3. Setup by ATF for other cases */
Michal Simekd48a1702015-11-05 08:32:14 +010022#if !defined(COUNTER_FREQUENCY)
23# define COUNTER_FREQUENCY 100000000
24#endif
Michal Simek04b7e622015-01-15 10:01:51 +010025
Michal Simek04b7e622015-01-15 10:01:51 +010026/* Serial setup */
Michal Simek04b7e622015-01-15 10:01:51 +010027#define CONFIG_SYS_BAUDRATE_TABLE \
28 { 4800, 9600, 19200, 38400, 57600, 115200 }
29
Siva Durga Prasad Paladugu937ad762015-11-17 14:30:09 +053030#ifdef CONFIG_NAND_ARASAN
Siva Durga Prasad Paladugu937ad762015-11-17 14:30:09 +053031# define CONFIG_SYS_MAX_NAND_DEVICE 1
Siva Durga Prasad Paladugu937ad762015-11-17 14:30:09 +053032#endif
33
Michal Simek04b7e622015-01-15 10:01:51 +010034/* Miscellaneous configurable options */
Michal Simek04b7e622015-01-15 10:01:51 +010035
Siva Durga Prasad Paladuguba1f68e2015-08-04 13:03:26 +053036#if defined(CONFIG_ZYNQMP_USB)
Siva Durga Prasad Paladuguba1f68e2015-08-04 13:03:26 +053037#define DFU_DEFAULT_POLL_TIMEOUT 300
Siva Durga Prasad Paladuguba1f68e2015-08-04 13:03:26 +053038#define CONFIG_THOR_RESET_OFF
Siva Durga Prasad Paladugu82e7fb22016-05-12 10:54:41 +053039
40#ifndef CONFIG_SPL_BUILD
Siva Durga Prasad Paladugu82e7fb22016-05-12 10:54:41 +053041# define PARTS_DEFAULT \
42 "partitions=uuid_disk=${uuid_gpt_disk};" \
43 "name=""boot"",size=16M,uuid=${uuid_gpt_boot};" \
44 "name=""Linux"",size=-M,uuid=${uuid_gpt_Linux}\0"
45#endif
Siva Durga Prasad Paladuguba1f68e2015-08-04 13:03:26 +053046#endif
47
Siva Durga Prasad Paladugu82e7fb22016-05-12 10:54:41 +053048#if !defined(PARTS_DEFAULT)
49# define PARTS_DEFAULT
50#endif
51
Michal Simek04b7e622015-01-15 10:01:51 +010052/* Monitor Command Prompt */
53/* Console I/O Buffer Size */
54#define CONFIG_SYS_CBSIZE 2048
Michal Simek04b7e622015-01-15 10:01:51 +010055#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
Michal Simek04b7e622015-01-15 10:01:51 +010056#define CONFIG_SYS_MAXARGS 64
57
Michal Simekc68918e2015-07-23 12:03:55 +020058/* Ethernet driver */
Michal Simek3d7285f2015-11-30 14:34:52 +010059#if defined(CONFIG_ZYNQ_GEM)
Michal Simekc68918e2015-07-23 12:03:55 +020060# define CONFIG_SYS_FAULT_ECHO_LINK_DOWN
Siva Durga Prasad Paladugu73551042016-01-05 15:21:46 +053061# define PHY_ANEG_TIMEOUT 20000
Michal Simekc68918e2015-07-23 12:03:55 +020062#endif
63
Michal Simek04b7e622015-01-15 10:01:51 +010064#define CONFIG_SYS_BOOTM_LEN (60 * 1024 * 1024)
65
Michal Simek04b7e622015-01-15 10:01:51 +010066#define CONFIG_CLOCKS
67
Michal Simekecfb6dc2016-04-22 14:28:54 +020068#define ENV_MEM_LAYOUT_SETTINGS \
Michal Simekecfb6dc2016-04-22 14:28:54 +020069 "fdt_addr_r=0x40000000\0" \
Michal Simek23bbbbf2020-07-15 15:43:52 +020070 "fdt_size_r=0x400000\0" \
Michal Simekecfb6dc2016-04-22 14:28:54 +020071 "pxefile_addr_r=0x10000000\0" \
72 "kernel_addr_r=0x18000000\0" \
Michal Simek23bbbbf2020-07-15 15:43:52 +020073 "kernel_size_r=0x10000000\0" \
Raju Kumar Pothurajua51ca692021-07-12 20:19:04 +053074 "kernel_comp_addr_r=0x30000000\0" \
75 "kernel_comp_size=0x3C00000\0" \
Siva Durga Prasad Paladugu94643bf2019-06-25 17:41:08 +053076 "scriptaddr=0x20000000\0" \
Michal Simekecfb6dc2016-04-22 14:28:54 +020077 "ramdisk_addr_r=0x02100000\0" \
Siva Durga Prasad Paladugub541a3e2019-01-24 11:32:04 +053078 "script_size_f=0x80000\0" \
Michal Simekecfb6dc2016-04-22 14:28:54 +020079
Masahiro Yamada168c57d2017-01-30 19:46:51 +090080#if defined(CONFIG_MMC_SDHCI_ZYNQ)
Michal Simekecfb6dc2016-04-22 14:28:54 +020081# define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0) func(MMC, mmc, 1)
82#else
83# define BOOT_TARGET_DEVICES_MMC(func)
84#endif
85
86#if defined(CONFIG_SATA_CEVA)
87# define BOOT_TARGET_DEVICES_SCSI(func) func(SCSI, scsi, 0)
88#else
89# define BOOT_TARGET_DEVICES_SCSI(func)
90#endif
91
92#if defined(CONFIG_ZYNQMP_USB)
93# define BOOT_TARGET_DEVICES_USB(func) func(USB, usb, 0) func(USB, usb, 1)
94#else
95# define BOOT_TARGET_DEVICES_USB(func)
96#endif
97
Joe Hershberger8e8594f2018-04-13 15:26:40 -050098#if defined(CONFIG_CMD_PXE) && defined(CONFIG_CMD_DHCP)
Michal Simek5d232272018-03-28 15:20:48 +020099# define BOOT_TARGET_DEVICES_PXE(func) func(PXE, pxe, na)
100#else
101# define BOOT_TARGET_DEVICES_PXE(func)
102#endif
103
104#if defined(CONFIG_CMD_DHCP)
105# define BOOT_TARGET_DEVICES_DHCP(func) func(DHCP, dhcp, na)
106#else
107# define BOOT_TARGET_DEVICES_DHCP(func)
108#endif
109
Siva Durga Prasad Paladugub541a3e2019-01-24 11:32:04 +0530110#if defined(CONFIG_ZYNQMP_GQSPI)
111# define BOOT_TARGET_DEVICES_QSPI(func) func(QSPI, qspi, 0)
112#else
113# define BOOT_TARGET_DEVICES_QSPI(func)
114#endif
115
116#if defined(CONFIG_NAND_ARASAN)
117# define BOOT_TARGET_DEVICES_NAND(func) func(NAND, nand, 0)
118#else
119# define BOOT_TARGET_DEVICES_NAND(func)
120#endif
121
122#define BOOTENV_DEV_QSPI(devtypeu, devtypel, instance) \
123 "bootcmd_" #devtypel #instance "=sf probe " #instance " 0 0 && " \
124 "sf read $scriptaddr $script_offset_f $script_size_f && " \
Michal Simekf9647512020-04-20 09:17:53 +0200125 "echo QSPI: Trying to boot script at ${scriptaddr} && " \
126 "source ${scriptaddr}; echo QSPI: SCRIPT FAILED: continuing...;\0"
Siva Durga Prasad Paladugub541a3e2019-01-24 11:32:04 +0530127
128#define BOOTENV_DEV_NAME_QSPI(devtypeu, devtypel, instance) \
129 #devtypel #instance " "
130
131#define BOOTENV_DEV_NAND(devtypeu, devtypel, instance) \
132 "bootcmd_" #devtypel #instance "= nand info && " \
133 "nand read $scriptaddr $script_offset_f $script_size_f && " \
Michal Simekf9647512020-04-20 09:17:53 +0200134 "echo NAND: Trying to boot script at ${scriptaddr} && " \
135 "source ${scriptaddr}; echo NAND: SCRIPT FAILED: continuing...;\0"
Siva Durga Prasad Paladugub541a3e2019-01-24 11:32:04 +0530136
137#define BOOTENV_DEV_NAME_NAND(devtypeu, devtypel, instance) \
138 #devtypel #instance " "
139
Siva Durga Prasad Paladugu9c441702019-06-25 17:41:09 +0530140#define BOOT_TARGET_DEVICES_JTAG(func) func(JTAG, jtag, na)
141
142#define BOOTENV_DEV_JTAG(devtypeu, devtypel, instance) \
Michal Simekf9647512020-04-20 09:17:53 +0200143 "bootcmd_jtag=echo JTAG: Trying to boot script at ${scriptaddr} && " \
144 "source ${scriptaddr}; echo JTAG: SCRIPT FAILED: continuing...;\0"
Siva Durga Prasad Paladugu9c441702019-06-25 17:41:09 +0530145
146#define BOOTENV_DEV_NAME_JTAG(devtypeu, devtypel, instance) \
147 "jtag "
148
T Karthik Reddy9eee8e32021-03-24 23:37:57 -0600149#define BOOT_TARGET_DEVICES_USB_DFU(func) \
150 func(USB_DFU, usb_dfu, 0) func(USB_DFU, usb_dfu, 1)
151
152#define BOOTENV_DEV_USB_DFU(devtypeu, devtypel, instance) \
153 "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \
154 "$scriptaddr $script_size_f && " \
155 "dfu " #instance " ram " #instance " 60 && " \
156 "echo DFU" #instance ": Trying to boot script at ${scriptaddr} && " \
157 "source ${scriptaddr}; " \
158 "echo DFU" #instance ": SCRIPT FAILED: continuing...;\0"
159
160#define BOOTENV_DEV_NAME_USB_DFU(devtypeu, devtypel, instance) \
161 ""
162
163#define BOOT_TARGET_DEVICES_USB_THOR(func) \
164 func(USB_THOR, usb_thor, 0) func(USB_THOR, usb_thor, 1)
165
166#define BOOTENV_DEV_USB_THOR(devtypeu, devtypel, instance) \
167 "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \
168 "$scriptaddr $script_size_f && " \
169 "thordown " #instance " ram " #instance " && " \
170 "echo THOR" #instance ": Trying to boot script at ${scriptaddr} && " \
171 "source ${scriptaddr}; " \
172 "echo THOR" #instance ": SCRIPT FAILED: continuing...;\0"
173
174#define BOOTENV_DEV_NAME_USB_THOR(devtypeu, devtypel, instance) \
175 ""
176
Michal Simekecfb6dc2016-04-22 14:28:54 +0200177#define BOOT_TARGET_DEVICES(func) \
Siva Durga Prasad Paladugu9c441702019-06-25 17:41:09 +0530178 BOOT_TARGET_DEVICES_JTAG(func) \
Michal Simekecfb6dc2016-04-22 14:28:54 +0200179 BOOT_TARGET_DEVICES_MMC(func) \
Siva Durga Prasad Paladugub541a3e2019-01-24 11:32:04 +0530180 BOOT_TARGET_DEVICES_QSPI(func) \
181 BOOT_TARGET_DEVICES_NAND(func) \
T Karthik Reddy9eee8e32021-03-24 23:37:57 -0600182 BOOT_TARGET_DEVICES_USB_DFU(func) \
183 BOOT_TARGET_DEVICES_USB_THOR(func) \
Michal Simekecfb6dc2016-04-22 14:28:54 +0200184 BOOT_TARGET_DEVICES_USB(func) \
185 BOOT_TARGET_DEVICES_SCSI(func) \
Michal Simek5d232272018-03-28 15:20:48 +0200186 BOOT_TARGET_DEVICES_PXE(func) \
187 BOOT_TARGET_DEVICES_DHCP(func)
Michal Simekecfb6dc2016-04-22 14:28:54 +0200188
189#include <config_distro_bootcmd.h>
190
191/* Initial environment variables */
192#ifndef CONFIG_EXTRA_ENV_SETTINGS
193#define CONFIG_EXTRA_ENV_SETTINGS \
194 ENV_MEM_LAYOUT_SETTINGS \
Michal Simekfc3c7082021-03-25 09:55:30 +0100195 BOOTENV
Michal Simekecfb6dc2016-04-22 14:28:54 +0200196#endif
197
Michal Simek12398ea2016-08-19 14:14:52 +0200198/* SPL can't handle all huge variables - define just DFU */
Andrew F. Davis6d932e62019-01-17 13:43:02 -0600199#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_DFU)
Michal Simek12398ea2016-08-19 14:14:52 +0200200#undef CONFIG_EXTRA_ENV_SETTINGS
201# define CONFIG_EXTRA_ENV_SETTINGS \
202 "dfu_alt_info_ram=uboot.bin ram 0x8000000 0x1000000;" \
203 "atf-uboot.ub ram 0x10000000 0x1000000;" \
204 "Image ram 0x80000 0x3f80000;" \
205 "system.dtb ram 0x4000000 0x100000\0" \
206 "dfu_bufsiz=0x1000\0"
207#endif
208
Soren Brinkmanne911cd02016-07-27 14:12:03 -0700209#define CONFIG_SPL_STACK 0xfffffffc
Michal Simek12398ea2016-08-19 14:14:52 +0200210#define CONFIG_SPL_MAX_SIZE 0x40000
Michal Simek72536fd2015-11-20 13:17:22 +0100211
212/* Just random location in OCM */
Michal Simek89e1f762016-08-30 14:58:46 +0200213#define CONFIG_SPL_BSS_START_ADDR 0x0
214#define CONFIG_SPL_BSS_MAX_SIZE 0x80000
Michal Simek72536fd2015-11-20 13:17:22 +0100215
Michal Simek933b6f72017-01-16 12:07:33 +0100216#if defined(CONFIG_SPL_SPI_FLASH_SUPPORT)
Michal Simek933b6f72017-01-16 12:07:33 +0100217# define CONFIG_SYS_SPI_KERNEL_OFFS 0x80000
218# define CONFIG_SYS_SPI_ARGS_OFFS 0xa0000
219# define CONFIG_SYS_SPI_ARGS_SIZE 0xa0000
Hannes Schmelzer30d69e22019-08-22 15:41:43 +0200220#endif
Michal Simek933b6f72017-01-16 12:07:33 +0100221
Michal Simek72536fd2015-11-20 13:17:22 +0100222/* u-boot is like dtb */
223#define CONFIG_SPL_FS_LOAD_ARGS_NAME "u-boot.bin"
224#define CONFIG_SYS_SPL_ARGS_ADDR 0x8000000
225
226/* ATF is my kernel image */
Michal Simekf5140be2016-09-21 11:42:58 +0200227#define CONFIG_SPL_FS_LOAD_KERNEL_NAME "atf-uboot.ub"
Michal Simek72536fd2015-11-20 13:17:22 +0100228
Michal Simek72536fd2015-11-20 13:17:22 +0100229/* MMC support */
Masahiro Yamada168c57d2017-01-30 19:46:51 +0900230#ifdef CONFIG_MMC_SDHCI_ZYNQ
Michal Simek72536fd2015-11-20 13:17:22 +0100231# define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0 /* unused */
232# define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS 0 /* unused */
Michal Simeka7178b72019-10-02 15:55:57 +0200233# if defined(CONFIG_SPL_LOAD_FIT)
234# define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.itb"
235# else
236# define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
237# endif
Michal Simek72536fd2015-11-20 13:17:22 +0100238#endif
239
Andrew F. Davis6d932e62019-01-17 13:43:02 -0600240#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_DFU)
Alexandru Gagniuc97464ff2021-09-02 19:54:19 -0500241# define CONFIG_SPL_HASH
Michal Simek12398ea2016-08-19 14:14:52 +0200242# define CONFIG_ENV_MAX_ENTRIES 10
Michal Simek77316dd2017-12-01 14:34:03 +0100243#endif
Michal Simek12398ea2016-08-19 14:14:52 +0200244
Michal Simek77316dd2017-12-01 14:34:03 +0100245#define CONFIG_SYS_SPL_MALLOC_START 0x20000000
Ricardo Salveti177acd62021-07-06 20:43:01 -0300246#define CONFIG_SYS_SPL_MALLOC_SIZE 0x1000000
Michal Simek12398ea2016-08-19 14:14:52 +0200247
248#ifdef CONFIG_SPL_SYS_MALLOC_SIMPLE
249# error "Disable CONFIG_SPL_SYS_MALLOC_SIMPLE. Full malloc needs to be used"
250#endif
Michal Simek12398ea2016-08-19 14:14:52 +0200251
Michal Simek04b7e622015-01-15 10:01:51 +0100252#endif /* __XILINX_ZYNQMP_H */