]>
Commit | Line | Data |
---|---|---|
83d290c5 | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
84c7204b MS |
2 | /* |
3 | * Configuration for Xilinx ZynqMP | |
4 | * (C) Copyright 2014 - 2015 Xilinx, Inc. | |
5 | * Michal Simek <[email protected]> | |
6 | * | |
7 | * Based on Configuration for Versatile Express | |
84c7204b MS |
8 | */ |
9 | ||
10 | #ifndef __XILINX_ZYNQMP_H | |
11 | #define __XILINX_ZYNQMP_H | |
12 | ||
84c7204b | 13 | /* Generic Interrupt Controller Definitions */ |
84c7204b MS |
14 | #define GICD_BASE 0xF9010000 |
15 | #define GICC_BASE 0xF9020000 | |
16 | ||
84c7204b | 17 | /* Serial setup */ |
84c7204b MS |
18 | #define CONFIG_SYS_BAUDRATE_TABLE \ |
19 | { 4800, 9600, 19200, 38400, 57600, 115200 } | |
20 | ||
741ef867 SG |
21 | /* GUIDs for capsule updatable firmware images */ |
22 | #define XILINX_BOOT_IMAGE_GUID \ | |
23 | EFI_GUID(0xde6066e8, 0x0256, 0x4fad, 0x82, 0x38, \ | |
24 | 0xe4, 0x06, 0xe2, 0x74, 0xc4, 0xcf) | |
25 | ||
26 | #define XILINX_UBOOT_IMAGE_GUID \ | |
27 | EFI_GUID(0xcf9ecfd4, 0x938b, 0x41c5, 0x85, 0x51, \ | |
28 | 0x1f, 0x88, 0x3a, 0xb7, 0xdc, 0x18) | |
29 | ||
78cb965a | 30 | #ifdef CONFIG_NAND_ARASAN |
78cb965a | 31 | # define CONFIG_SYS_MAX_NAND_DEVICE 1 |
78cb965a SDPP |
32 | #endif |
33 | ||
84c7204b | 34 | /* Miscellaneous configurable options */ |
84c7204b | 35 | |
16fa00a7 | 36 | #if defined(CONFIG_ZYNQMP_USB) |
16fa00a7 | 37 | #define DFU_DEFAULT_POLL_TIMEOUT 300 |
16fa00a7 | 38 | #define CONFIG_THOR_RESET_OFF |
5ce987fe | 39 | |
5ce987fe SDPP |
40 | # define PARTS_DEFAULT \ |
41 | "partitions=uuid_disk=${uuid_gpt_disk};" \ | |
42 | "name=""boot"",size=16M,uuid=${uuid_gpt_boot};" \ | |
43 | "name=""Linux"",size=-M,uuid=${uuid_gpt_Linux}\0" | |
44 | #endif | |
16fa00a7 | 45 | |
5ce987fe SDPP |
46 | #if !defined(PARTS_DEFAULT) |
47 | # define PARTS_DEFAULT | |
48 | #endif | |
49 | ||
84c7204b | 50 | /* Console I/O Buffer Size */ |
84c7204b | 51 | |
cb7ea820 | 52 | /* Ethernet driver */ |
596e5782 | 53 | #if defined(CONFIG_ZYNQ_GEM) |
e2928f32 | 54 | # define PHY_ANEG_TIMEOUT 20000 |
cb7ea820 MS |
55 | #endif |
56 | ||
cf5ed341 | 57 | #define CONFIG_SYS_BOOTM_LEN (100 * 1024 * 1024) |
84c7204b | 58 | |
b72894f1 | 59 | #define ENV_MEM_LAYOUT_SETTINGS \ |
b72894f1 | 60 | "fdt_addr_r=0x40000000\0" \ |
9643000e | 61 | "fdt_size_r=0x400000\0" \ |
b72894f1 MS |
62 | "pxefile_addr_r=0x10000000\0" \ |
63 | "kernel_addr_r=0x18000000\0" \ | |
9643000e | 64 | "kernel_size_r=0x10000000\0" \ |
3965d13f RKP |
65 | "kernel_comp_addr_r=0x30000000\0" \ |
66 | "kernel_comp_size=0x3C00000\0" \ | |
81764f53 | 67 | "scriptaddr=0x20000000\0" \ |
b72894f1 | 68 | "ramdisk_addr_r=0x02100000\0" \ |
ad78d264 | 69 | "script_size_f=0x80000\0" \ |
b72894f1 | 70 | |
08aa0334 | 71 | #if defined(CONFIG_MMC_SDHCI_ZYNQ) |
b72894f1 MS |
72 | # define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0) func(MMC, mmc, 1) |
73 | #else | |
74 | # define BOOT_TARGET_DEVICES_MMC(func) | |
75 | #endif | |
76 | ||
77 | #if defined(CONFIG_SATA_CEVA) | |
78 | # define BOOT_TARGET_DEVICES_SCSI(func) func(SCSI, scsi, 0) | |
79 | #else | |
80 | # define BOOT_TARGET_DEVICES_SCSI(func) | |
81 | #endif | |
82 | ||
83 | #if defined(CONFIG_ZYNQMP_USB) | |
84 | # define BOOT_TARGET_DEVICES_USB(func) func(USB, usb, 0) func(USB, usb, 1) | |
85 | #else | |
86 | # define BOOT_TARGET_DEVICES_USB(func) | |
87 | #endif | |
88 | ||
86271b3f | 89 | #if defined(CONFIG_CMD_PXE) && defined(CONFIG_CMD_DHCP) |
1a82f59b MS |
90 | # define BOOT_TARGET_DEVICES_PXE(func) func(PXE, pxe, na) |
91 | #else | |
92 | # define BOOT_TARGET_DEVICES_PXE(func) | |
93 | #endif | |
94 | ||
95 | #if defined(CONFIG_CMD_DHCP) | |
96 | # define BOOT_TARGET_DEVICES_DHCP(func) func(DHCP, dhcp, na) | |
97 | #else | |
98 | # define BOOT_TARGET_DEVICES_DHCP(func) | |
99 | #endif | |
100 | ||
ad78d264 SDPP |
101 | #if defined(CONFIG_ZYNQMP_GQSPI) |
102 | # define BOOT_TARGET_DEVICES_QSPI(func) func(QSPI, qspi, 0) | |
103 | #else | |
104 | # define BOOT_TARGET_DEVICES_QSPI(func) | |
105 | #endif | |
106 | ||
107 | #if defined(CONFIG_NAND_ARASAN) | |
108 | # define BOOT_TARGET_DEVICES_NAND(func) func(NAND, nand, 0) | |
109 | #else | |
110 | # define BOOT_TARGET_DEVICES_NAND(func) | |
111 | #endif | |
112 | ||
113 | #define BOOTENV_DEV_QSPI(devtypeu, devtypel, instance) \ | |
114 | "bootcmd_" #devtypel #instance "=sf probe " #instance " 0 0 && " \ | |
115 | "sf read $scriptaddr $script_offset_f $script_size_f && " \ | |
19d13045 MS |
116 | "echo QSPI: Trying to boot script at ${scriptaddr} && " \ |
117 | "source ${scriptaddr}; echo QSPI: SCRIPT FAILED: continuing...;\0" | |
ad78d264 SDPP |
118 | |
119 | #define BOOTENV_DEV_NAME_QSPI(devtypeu, devtypel, instance) \ | |
120 | #devtypel #instance " " | |
121 | ||
122 | #define BOOTENV_DEV_NAND(devtypeu, devtypel, instance) \ | |
123 | "bootcmd_" #devtypel #instance "= nand info && " \ | |
124 | "nand read $scriptaddr $script_offset_f $script_size_f && " \ | |
19d13045 MS |
125 | "echo NAND: Trying to boot script at ${scriptaddr} && " \ |
126 | "source ${scriptaddr}; echo NAND: SCRIPT FAILED: continuing...;\0" | |
ad78d264 SDPP |
127 | |
128 | #define BOOTENV_DEV_NAME_NAND(devtypeu, devtypel, instance) \ | |
129 | #devtypel #instance " " | |
130 | ||
5d2274c0 SDPP |
131 | #define BOOT_TARGET_DEVICES_JTAG(func) func(JTAG, jtag, na) |
132 | ||
133 | #define BOOTENV_DEV_JTAG(devtypeu, devtypel, instance) \ | |
19d13045 MS |
134 | "bootcmd_jtag=echo JTAG: Trying to boot script at ${scriptaddr} && " \ |
135 | "source ${scriptaddr}; echo JTAG: SCRIPT FAILED: continuing...;\0" | |
5d2274c0 SDPP |
136 | |
137 | #define BOOTENV_DEV_NAME_JTAG(devtypeu, devtypel, instance) \ | |
138 | "jtag " | |
139 | ||
ef1be3e3 KR |
140 | #define BOOT_TARGET_DEVICES_USB_DFU(func) \ |
141 | func(USB_DFU, usb_dfu, 0) func(USB_DFU, usb_dfu, 1) | |
142 | ||
143 | #define BOOTENV_DEV_USB_DFU(devtypeu, devtypel, instance) \ | |
144 | "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \ | |
145 | "$scriptaddr $script_size_f && " \ | |
146 | "dfu " #instance " ram " #instance " 60 && " \ | |
147 | "echo DFU" #instance ": Trying to boot script at ${scriptaddr} && " \ | |
148 | "source ${scriptaddr}; " \ | |
149 | "echo DFU" #instance ": SCRIPT FAILED: continuing...;\0" | |
150 | ||
151 | #define BOOTENV_DEV_NAME_USB_DFU(devtypeu, devtypel, instance) \ | |
152 | "" | |
153 | ||
154 | #define BOOT_TARGET_DEVICES_USB_THOR(func) \ | |
155 | func(USB_THOR, usb_thor, 0) func(USB_THOR, usb_thor, 1) | |
156 | ||
157 | #define BOOTENV_DEV_USB_THOR(devtypeu, devtypel, instance) \ | |
158 | "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \ | |
159 | "$scriptaddr $script_size_f && " \ | |
160 | "thordown " #instance " ram " #instance " && " \ | |
161 | "echo THOR" #instance ": Trying to boot script at ${scriptaddr} && " \ | |
162 | "source ${scriptaddr}; " \ | |
163 | "echo THOR" #instance ": SCRIPT FAILED: continuing...;\0" | |
164 | ||
165 | #define BOOTENV_DEV_NAME_USB_THOR(devtypeu, devtypel, instance) \ | |
166 | "" | |
167 | ||
b72894f1 | 168 | #define BOOT_TARGET_DEVICES(func) \ |
5d2274c0 | 169 | BOOT_TARGET_DEVICES_JTAG(func) \ |
b72894f1 | 170 | BOOT_TARGET_DEVICES_MMC(func) \ |
ad78d264 SDPP |
171 | BOOT_TARGET_DEVICES_QSPI(func) \ |
172 | BOOT_TARGET_DEVICES_NAND(func) \ | |
ef1be3e3 KR |
173 | BOOT_TARGET_DEVICES_USB_DFU(func) \ |
174 | BOOT_TARGET_DEVICES_USB_THOR(func) \ | |
b72894f1 MS |
175 | BOOT_TARGET_DEVICES_USB(func) \ |
176 | BOOT_TARGET_DEVICES_SCSI(func) \ | |
1a82f59b MS |
177 | BOOT_TARGET_DEVICES_PXE(func) \ |
178 | BOOT_TARGET_DEVICES_DHCP(func) | |
b72894f1 MS |
179 | |
180 | #include <config_distro_bootcmd.h> | |
181 | ||
182 | /* Initial environment variables */ | |
183 | #ifndef CONFIG_EXTRA_ENV_SETTINGS | |
184 | #define CONFIG_EXTRA_ENV_SETTINGS \ | |
185 | ENV_MEM_LAYOUT_SETTINGS \ | |
1e967b53 | 186 | BOOTENV |
b72894f1 MS |
187 | #endif |
188 | ||
d58fc12e | 189 | /* SPL can't handle all huge variables - define just DFU */ |
6536ca4d | 190 | #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_DFU) |
d58fc12e MS |
191 | #undef CONFIG_EXTRA_ENV_SETTINGS |
192 | # define CONFIG_EXTRA_ENV_SETTINGS \ | |
193 | "dfu_alt_info_ram=uboot.bin ram 0x8000000 0x1000000;" \ | |
194 | "atf-uboot.ub ram 0x10000000 0x1000000;" \ | |
195 | "Image ram 0x80000 0x3f80000;" \ | |
196 | "system.dtb ram 0x4000000 0x100000\0" \ | |
197 | "dfu_bufsiz=0x1000\0" | |
198 | #endif | |
199 | ||
24124abe | 200 | #if defined(CONFIG_SPL_SPI_FLASH_SUPPORT) |
24124abe MS |
201 | # define CONFIG_SYS_SPI_KERNEL_OFFS 0x80000 |
202 | # define CONFIG_SYS_SPI_ARGS_OFFS 0xa0000 | |
203 | # define CONFIG_SYS_SPI_ARGS_SIZE 0xa0000 | |
abf9e5d0 | 204 | #endif |
24124abe | 205 | |
e6a9ed04 | 206 | /* u-boot is like dtb */ |
e6a9ed04 MS |
207 | |
208 | /* ATF is my kernel image */ | |
e6a9ed04 | 209 | |
6536ca4d | 210 | #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_DFU) |
07212096 | 211 | # define CONFIG_SPL_HASH |
d58fc12e | 212 | # define CONFIG_ENV_MAX_ENTRIES 10 |
b45c17c7 | 213 | #endif |
d58fc12e | 214 | |
d58fc12e MS |
215 | #ifdef CONFIG_SPL_SYS_MALLOC_SIMPLE |
216 | # error "Disable CONFIG_SPL_SYS_MALLOC_SIMPLE. Full malloc needs to be used" | |
217 | #endif | |
d58fc12e | 218 | |
84c7204b | 219 | #endif /* __XILINX_ZYNQMP_H */ |