1if ARCH_MVEBU
2
3config HAVE_MVEBU_EFUSE
4	bool
5
6config ARMADA_32BIT
7	bool
8	select BOARD_EARLY_INIT_F
9	select CPU_V7A
10	select SPL_DM if SPL
11	select SPL_DM_SEQ_ALIAS if SPL
12	select SPL_OF_CONTROL if SPL
13	select SPL_SKIP_LOWLEVEL_INIT if SPL
14	select SPL_SIMPLE_BUS if SPL
15	select SUPPORT_SPL
16	select SYS_L2_PL310 if !SYS_L2CACHE_OFF
17	select TRANSLATION_OFFSET
18	select TOOLS_KWBIMAGE if SPL
19	select SPL_SYS_NO_VECTOR_TABLE if SPL
20	select ARCH_VERY_EARLY_INIT
21	select ARMADA_32BIT_SYSCON_RESET if DM_RESET && PCI_MVEBU
22	select ARMADA_32BIT_SYSCON_SYSRESET if SYSRESET
23
24# ARMv7 SoCs...
25config ARMADA_375
26	bool
27	select ARMADA_32BIT
28
29config ARMADA_38X
30	bool
31	select ARMADA_32BIT
32	select HAVE_MVEBU_EFUSE
33
34config ARMADA_38X_HS_IMPEDANCE_THRESH
35	hex  "Armada 38x USB 2.0 High-Speed Impedance Threshold (0x0 - 0x7)"
36	depends on ARMADA_38X
37	default 0x6
38	range 0x0 0x7
39
40config ARMADA_XP
41	bool
42	select ARMADA_32BIT
43
44# ARMv8 SoCs...
45config ARMADA_3700
46	bool
47	select ARM64
48	select HAVE_MVEBU_EFUSE
49
50# Armada 7K and 8K are very similar - use only one Kconfig symbol for both
51config ARMADA_8K
52	bool
53	select ARM64
54
55config ALLEYCAT_5
56	bool
57	select ARM64
58
59# Armada PLL frequency (used for NAND clock generation)
60config SYS_MVEBU_PLL_CLOCK
61	int
62	default "2000000000" if ARMADA_XP || ARMADA_3700 || ARMADA_8K || ARMADA_MSYS
63	default "1000000000" if ARMADA_38X || ARMADA_375
64
65# Armada XP/38x SoC types...
66config MV78230
67	bool
68	select ARMADA_XP
69
70config MV78260
71	bool
72	select ARMADA_XP
73	imply CMD_SATA
74
75config MV78460
76	bool
77	select ARMADA_XP
78
79config ARMADA_MSYS
80	bool
81	select ARMADA_32BIT
82
83config 98DX4251
84	bool
85	select ARMADA_MSYS
86
87config 98DX3336
88	bool
89	select ARMADA_MSYS
90
91config 98DX3236
92	bool
93	select ARMADA_MSYS
94
95config 88F6820
96	bool
97	select ARMADA_38X
98
99config CUSTOMER_BOARD_SUPPORT
100	bool
101
102config DDR4
103	bool "Support Marvell DDR4 Training driver"
104
105choice
106	prompt "Armada XP/375/38x/3700/7K/8K/Alleycat-5 board select"
107	optional
108
109config TARGET_CLEARFOG
110	bool "Support ClearFog"
111	select 88F6820
112	select BOARD_LATE_INIT
113	select OF_BOARD_SETUP
114
115config TARGET_HELIOS4
116	bool "Support Helios4"
117	select 88F6820
118
119config TARGET_MVEBU_ARMADA_37XX
120	bool "Support Armada 37xx platforms"
121	select ARMADA_3700
122	imply SCSI
123
124config TARGET_DB_88F6720
125	bool "Support DB-88F6720 Armada 375"
126	select ARMADA_375
127
128config TARGET_DB_88F6820_GP
129	bool "Support DB-88F6820-GP"
130	select 88F6820
131
132config TARGET_DB_88F6820_AMC
133	bool "Support DB-88F6820-AMC"
134	select 88F6820
135
136config TARGET_TURRIS_OMNIA
137	bool "Support Turris Omnia"
138	select 88F6820
139	select BOARD_LATE_INIT
140	select DM_I2C
141	select I2C_MUX
142	select I2C_MUX_PCA954x
143	select SPL_DRIVERS_MISC
144	select SPL_I2C_MUX
145	select SPL_SYS_MALLOC_SIMPLE
146	select SYS_I2C_MVTWSI
147	select ATSHA204A
148
149config TARGET_TURRIS_MOX
150	bool "Support CZ.NIC's Turris Mox / RIPE Atlas Probe"
151	select ARMADA_3700
152	select BOARD_TYPES
153	select ENV_IS_IN_MMC
154	select ENV_IS_IN_SPI_FLASH
155	select MULTI_DTB_FIT
156
157config TARGET_MVEBU_ARMADA_8K
158	bool "Support Armada 7k/8k platforms"
159	select ARMADA_8K
160	select BOARD_LATE_INIT
161	imply SCSI
162
163config TARGET_MVEBU_ALLEYCAT5
164	bool "Support AlleyCat 5 platforms"
165	select ALLEYCAT_5
166
167config TARGET_OCTEONTX2_CN913x
168	bool "Support CN913x platforms"
169	select ARMADA_8K
170	imply BOARD_EARLY_INIT_R
171	select BOARD_LATE_INIT
172	imply SCSI
173
174config TARGET_DB_MV784MP_GP
175	bool "Support db-mv784mp-gp"
176	select BOARD_ECC_SUPPORT
177	select MV78460
178
179config TARGET_DS116
180	bool "Support Synology DS116"
181	select 88F6820
182
183config TARGET_DS414
184	bool "Support Synology DS414"
185	select MV78230
186
187config TARGET_MAXBCM
188	bool "Support maxbcm"
189	select BOARD_ECC_SUPPORT
190	select MV78460
191
192config TARGET_N2350
193	bool "Support Thecus N2350"
194	select 88F6820
195	select DDR4
196
197config TARGET_THEADORABLE
198	bool "Support theadorable Armada XP"
199	select BOARD_LATE_INIT if USB
200	select MV78260
201	imply CMD_SATA
202
203config TARGET_CONTROLCENTERDC
204	bool "Support CONTROLCENTERDC"
205	select 88F6820
206	select CUSTOMER_BOARD_SUPPORT
207
208config TARGET_X530
209	bool "Support Allied Telesis x530"
210	select 88F6820
211
212config TARGET_X240
213	bool "Support Allied Telesis x240"
214	select ALLEYCAT_5
215
216config TARGET_DB_XC3_24G4XG
217	bool "Support DB-XC3-24G4XG"
218	select 98DX3336
219
220config TARGET_CRS3XX_98DX3236
221	bool "Support CRS3XX-98DX3236"
222	select 98DX3236
223
224endchoice
225
226choice
227	prompt "DDR bus width"
228	default DDR_64BIT
229	depends on ARMADA_XP
230
231config DDR_64BIT
232	bool "64bit bus width"
233
234config DDR_32BIT
235	bool "32bit bus width"
236
237endchoice
238
239config DDR_LOG_LEVEL
240	int "DDR training code log level"
241	depends on ARMADA_XP
242	default 0
243	range 0 3
244	help
245	  Amount of information provided on error while running the DDR
246	  training code.  At level 0, provides an error code in a case of
247	  failure, RL, WL errors and other algorithm failure.  At level 1,
248	  provides the D-Unit setup (SPD/Static configuration).  At level 2,
249	  provides the windows margin as a results of DQS centeralization.
250	  At level 3, rovides the windows margin of each DQ as a results of
251	  DQS centeralization.
252
253config DDR_RESET_ON_TRAINING_FAILURE
254	bool "Reset the board on DDR training failure instead of hanging"
255	depends on ARMADA_38X || ARMADA_XP
256	help
257	  If DDR training fails in SPL, reset the board instead of hanging.
258	  Some boards are known to fail DDR training occasionally and an
259	  immediate reset may be preferable to waiting until the board is
260	  reset by watchdog (if there even is one).
261
262	  Note that if booting via UART and the DDR training fails, the
263	  device will still hang - it doesn't make sense to reset the board
264	  in such a case.
265
266config BOARD_ECC_SUPPORT
267	bool
268
269config SYS_BOARD
270	default "clearfog" if TARGET_CLEARFOG
271	default "helios4" if TARGET_HELIOS4
272	default "mvebu_armada-37xx" if TARGET_MVEBU_ARMADA_37XX
273	default "db-88f6720" if TARGET_DB_88F6720
274	default "db-88f6820-gp" if TARGET_DB_88F6820_GP
275	default "db-88f6820-amc" if TARGET_DB_88F6820_AMC
276	default "turris_omnia" if TARGET_TURRIS_OMNIA
277	default "turris_mox" if TARGET_TURRIS_MOX
278	default "mvebu_armada-8k" if TARGET_MVEBU_ARMADA_8K
279	default "octeontx2_cn913x" if TARGET_OCTEONTX2_CN913x
280	default "db-mv784mp-gp" if TARGET_DB_MV784MP_GP
281	default "ds116" if TARGET_DS116
282	default "ds414" if TARGET_DS414
283	default "maxbcm" if TARGET_MAXBCM
284	default "n2350" if TARGET_N2350
285	default "theadorable" if TARGET_THEADORABLE
286	default "a38x" if TARGET_CONTROLCENTERDC
287	default "x530" if TARGET_X530
288	default "x240" if TARGET_X240
289	default "db-xc3-24g4xg" if TARGET_DB_XC3_24G4XG
290	default "crs3xx-98dx3236" if TARGET_CRS3XX_98DX3236
291	default "mvebu_alleycat-5" if TARGET_MVEBU_ALLEYCAT5
292
293config SYS_CONFIG_NAME
294	default "clearfog" if TARGET_CLEARFOG
295	default "helios4" if TARGET_HELIOS4
296	default "mvebu_armada-37xx" if TARGET_MVEBU_ARMADA_37XX
297	default "db-88f6720" if TARGET_DB_88F6720
298	default "db-88f6820-gp" if TARGET_DB_88F6820_GP
299	default "db-88f6820-amc" if TARGET_DB_88F6820_AMC
300	default "mvebu_armada-8k" if TARGET_MVEBU_ARMADA_8K
301	default "mvebu_armada-8k" if TARGET_OCTEONTX2_CN913x
302	default "db-mv784mp-gp" if TARGET_DB_MV784MP_GP
303	default "ds116" if TARGET_DS116
304	default "ds414" if TARGET_DS414
305	default "maxbcm" if TARGET_MAXBCM
306	default "n2350" if TARGET_N2350
307	default "theadorable" if TARGET_THEADORABLE
308	default "turris_omnia" if TARGET_TURRIS_OMNIA
309	default "turris_mox" if TARGET_TURRIS_MOX
310	default "controlcenterdc" if TARGET_CONTROLCENTERDC
311	default "x530" if TARGET_X530
312	default "x240" if TARGET_X240
313	default "db-xc3-24g4xg" if TARGET_DB_XC3_24G4XG
314	default "crs3xx-98dx3236" if TARGET_CRS3XX_98DX3236
315	default "mvebu_alleycat-5" if TARGET_MVEBU_ALLEYCAT5
316
317config SYS_VENDOR
318	default "Marvell" if TARGET_DB_MV784MP_GP
319	default "Marvell" if TARGET_MVEBU_ARMADA_37XX
320	default "Marvell" if TARGET_DB_88F6720
321	default "Marvell" if TARGET_DB_88F6820_GP
322	default "Marvell" if TARGET_DB_88F6820_AMC
323	default "Marvell" if TARGET_MVEBU_ARMADA_8K
324	default "Marvell" if TARGET_OCTEONTX2_CN913x
325	default "Marvell" if TARGET_DB_XC3_24G4XG
326	default "Marvell" if TARGET_MVEBU_DB_88F7040
327	default "solidrun" if TARGET_CLEARFOG
328	default "kobol" if TARGET_HELIOS4
329	default "Synology" if TARGET_DS116
330	default "Synology" if TARGET_DS414
331	default "thecus" if TARGET_N2350
332	default "CZ.NIC" if TARGET_TURRIS_OMNIA
333	default "CZ.NIC" if TARGET_TURRIS_MOX
334	default "gdsys" if TARGET_CONTROLCENTERDC
335	default "alliedtelesis" if TARGET_X530
336	default "alliedtelesis" if TARGET_X240
337	default "mikrotik" if TARGET_CRS3XX_98DX3236
338	default "Marvell" if TARGET_MVEBU_ALLEYCAT5
339
340config SYS_SOC
341	default "mvebu"
342
343choice
344	prompt "Boot method"
345	depends on SPL
346
347config MVEBU_SPL_BOOT_DEVICE_SPI
348	bool "NOR flash (SPI or parallel)"
349	imply ENV_IS_IN_SPI_FLASH
350	imply SPL_DM_SPI
351	imply SPL_SPI_FLASH_SUPPORT
352	imply SPL_SPI_LOAD
353	imply SPL_SPI
354	select SPL_BOOTROM_SUPPORT
355
356config MVEBU_SPL_BOOT_DEVICE_NAND
357	bool "NAND flash (SPI or parallel)"
358	select MTD_RAW_NAND
359	select SPL_BOOTROM_SUPPORT
360
361config MVEBU_SPL_BOOT_DEVICE_MMC
362	bool "eMMC or SD card"
363	imply ENV_IS_IN_MMC
364	# GPIO needed for eMMC/SD card presence detection
365	imply SPL_DM_GPIO
366	imply SPL_DM_MMC
367	imply SPL_GPIO
368	imply SPL_LIBDISK_SUPPORT
369	imply SPL_MMC
370	select SUPPORT_EMMC_BOOT if SPL_MMC
371	select SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR if SPL_MMC
372	select SPL_BOOTROM_SUPPORT
373
374config MVEBU_SPL_BOOT_DEVICE_SATA
375	bool "SATA"
376	imply SPL_SATA
377	imply SPL_LIBDISK_SUPPORT
378	select SPL_BOOTROM_SUPPORT
379
380config MVEBU_SPL_BOOT_DEVICE_PEX
381	bool "PCI Express"
382	select SPL_BOOTROM_SUPPORT
383
384config MVEBU_SPL_BOOT_DEVICE_UART
385	bool "UART"
386	select SPL_BOOTROM_SUPPORT
387
388endchoice
389
390config MVEBU_SPL_NAND_BADBLK_LOCATION
391	hex "NAND Bad block indicator location"
392	depends on MVEBU_SPL_BOOT_DEVICE_NAND
393	range 0x0 0x1
394	help
395	  Value 0x0 = SLC flash = BBI at page 0 or page 1
396	  Value 0x1 = MLC flash = BBI at last page in the block
397
398config MVEBU_SPL_SATA_BLKSZ
399	int "SATA block size"
400	depends on MVEBU_SPL_BOOT_DEVICE_SATA
401	range 512 32768
402	default 512
403	help
404	  Block size of the SATA disk in bytes.
405	  Typically 512 bytes for majority of disks
406	  and 4096 bytes for 4K Native disks.
407
408config MVEBU_EFUSE
409	bool "Enable eFuse support"
410	depends on HAVE_MVEBU_EFUSE
411	help
412	  Enable support for reading and writing eFuses on mvebu SoCs.
413
414config MVEBU_EFUSE_FAKE
415	bool "Fake eFuse access (dry run)"
416	depends on MVEBU_EFUSE
417	help
418	  This enables a "dry run" mode where eFuses are not really programmed.
419	  Instead the eFuse accesses are emulated by writing to and reading
420	  from a memory block.
421	  This is can be used for testing prog scripts.
422
423config MVEBU_EFUSE_VHV_GPIO
424	string "VHV_Enable GPIO name for eFuse programming"
425	depends on MVEBU_EFUSE && !ARMADA_3700
426	help
427	  The eFuse programing (burning) phase requires supplying 1.8V to the
428	  device on the VHV power pin, while for normal operation the VHV power
429	  rail must be left unconnected. See Marvell AN-389: ARMADA VHV Power
430	  document (Doc. No. MV-S302545-00 Rev. C, August 2, 2016) for details.
431	  .
432	  This specify VHV_Enable GPIO name used in U-Boot for enabling VHV power.
433
434config MVEBU_EFUSE_VHV_GPIO_ACTIVE_LOW
435	bool "VHV_Enable GPIO is Active Low"
436	depends on MVEBU_EFUSE_VHV_GPIO != ""
437
438config SECURED_MODE_IMAGE
439	bool "Build image for trusted boot"
440	default false
441	depends on 88F6820
442	help
443	  Build an image that employs the ARMADA SoC's trusted boot framework
444	  for securely booting images.
445
446config SECURED_MODE_CSK_INDEX
447	int "Index of active CSK"
448	default 0
449	depends on SECURED_MODE_IMAGE
450
451config SF_DEFAULT_SPEED
452	int "Default speed for SPI flash in Hz"
453	default 10000000
454	depends on MVEBU_SPL_BOOT_DEVICE_SPI
455
456config SF_DEFAULT_MODE
457	hex "Default mode for SPI flash"
458	default 0x0
459	depends on MVEBU_SPL_BOOT_DEVICE_SPI
460
461config ARMADA_32BIT_SYSCON
462	bool
463	depends on ARMADA_32BIT
464	select REGMAP
465	select SYSCON
466
467config ARMADA_32BIT_SYSCON_RESET
468	bool "Support Armada XP/375/38x/39x reset controller"
469	depends on ARMADA_32BIT
470	depends on DM_RESET
471	select ARMADA_32BIT_SYSCON
472	help
473	  Build support for Armada XP/375/38x/39x reset controller. This is
474	  needed for PCIe support.
475
476config ARMADA_32BIT_SYSCON_SYSRESET
477	bool "Support Armada XP/375/38x/39x sysreset via driver model"
478	depends on ARMADA_32BIT
479	depends on SYSRESET
480	select ARMADA_32BIT_SYSCON
481	help
482	  Build support for Armada XP/375/38x/39x system reset via driver model.
483
484source "board/solidrun/clearfog/Kconfig"
485source "board/kobol/helios4/Kconfig"
486
487endif
488