xref: /openbmc/u-boot/include/configs/helios4.h (revision ae28a5f830936ca285ec65d3f5f70fdcef95ab92)
1*ae28a5f8SDennis Gilmore /* SPDX-License-Identifier: GPL-2.0+ */
2*ae28a5f8SDennis Gilmore /*
3*ae28a5f8SDennis Gilmore  * Copyright (C) 2018 Dennis Gilmore <dgilmore@redhat.com>
4*ae28a5f8SDennis Gilmore  */
5*ae28a5f8SDennis Gilmore 
6*ae28a5f8SDennis Gilmore #ifndef _CONFIG_HELIOS4_H
7*ae28a5f8SDennis Gilmore #define _CONFIG_HELIOS4_H
8*ae28a5f8SDennis Gilmore 
9*ae28a5f8SDennis Gilmore /*
10*ae28a5f8SDennis Gilmore  * High Level Configuration Options (easy to change)
11*ae28a5f8SDennis Gilmore  */
12*ae28a5f8SDennis Gilmore 
13*ae28a5f8SDennis Gilmore /*
14*ae28a5f8SDennis Gilmore  * TEXT_BASE needs to be below 16MiB, since this area is scrubbed
15*ae28a5f8SDennis Gilmore  * for DDR ECC byte filling in the SPL before loading the main
16*ae28a5f8SDennis Gilmore  * U-Boot into it.
17*ae28a5f8SDennis Gilmore  */
18*ae28a5f8SDennis Gilmore #define CONFIG_SYS_TCLK		250000000	/* 250MHz */
19*ae28a5f8SDennis Gilmore 
20*ae28a5f8SDennis Gilmore /*
21*ae28a5f8SDennis Gilmore  * Commands configuration
22*ae28a5f8SDennis Gilmore  */
23*ae28a5f8SDennis Gilmore 
24*ae28a5f8SDennis Gilmore /* SPI NOR flash default params, used by sf commands */
25*ae28a5f8SDennis Gilmore #define CONFIG_SF_DEFAULT_BUS		1
26*ae28a5f8SDennis Gilmore 
27*ae28a5f8SDennis Gilmore /*
28*ae28a5f8SDennis Gilmore  * SDIO/MMC Card Configuration
29*ae28a5f8SDennis Gilmore  */
30*ae28a5f8SDennis Gilmore #define CONFIG_SYS_MMC_BASE		MVEBU_SDIO_BASE
31*ae28a5f8SDennis Gilmore 
32*ae28a5f8SDennis Gilmore /* USB/EHCI configuration */
33*ae28a5f8SDennis Gilmore #define CONFIG_EHCI_IS_TDI
34*ae28a5f8SDennis Gilmore 
35*ae28a5f8SDennis Gilmore #define CONFIG_ENV_MIN_ENTRIES		128
36*ae28a5f8SDennis Gilmore 
37*ae28a5f8SDennis Gilmore /*
38*ae28a5f8SDennis Gilmore  * SATA/SCSI/AHCI configuration
39*ae28a5f8SDennis Gilmore  */
40*ae28a5f8SDennis Gilmore #define CONFIG_SCSI_AHCI_PLAT
41*ae28a5f8SDennis Gilmore #define CONFIG_SYS_SCSI_MAX_SCSI_ID     2
42*ae28a5f8SDennis Gilmore #define CONFIG_SYS_SCSI_MAX_LUN         2
43*ae28a5f8SDennis Gilmore #define CONFIG_SYS_SCSI_MAX_DEVICE      (CONFIG_SYS_SCSI_MAX_SCSI_ID * \
44*ae28a5f8SDennis Gilmore 					CONFIG_SYS_SCSI_MAX_LUN)
45*ae28a5f8SDennis Gilmore 
46*ae28a5f8SDennis Gilmore /* Environment in MMC */
47*ae28a5f8SDennis Gilmore #define CONFIG_SYS_MMC_ENV_DEV		0
48*ae28a5f8SDennis Gilmore #define CONFIG_ENV_SECT_SIZE		0x200
49*ae28a5f8SDennis Gilmore #define CONFIG_ENV_SIZE			0x10000
50*ae28a5f8SDennis Gilmore /*
51*ae28a5f8SDennis Gilmore  * For SD - reserve 1 LBA for MBR + 1M for u-boot image. The MMC/eMMC
52*ae28a5f8SDennis Gilmore  * boot image starts @ LBA-0.
53*ae28a5f8SDennis Gilmore  * As result in MMC/eMMC case it will be a 1 sector gap between u-boot
54*ae28a5f8SDennis Gilmore  * image and environment
55*ae28a5f8SDennis Gilmore  */
56*ae28a5f8SDennis Gilmore #define CONFIG_ENV_OFFSET		0xf0000
57*ae28a5f8SDennis Gilmore #define CONFIG_ENV_ADDR			CONFIG_ENV_OFFSET
58*ae28a5f8SDennis Gilmore 
59*ae28a5f8SDennis Gilmore #define CONFIG_PHY_MARVELL		/* there is a marvell phy */
60*ae28a5f8SDennis Gilmore #define PHY_ANEG_TIMEOUT	8000	/* PHY needs a longer aneg time */
61*ae28a5f8SDennis Gilmore 
62*ae28a5f8SDennis Gilmore /* PCIe support */
63*ae28a5f8SDennis Gilmore #ifndef CONFIG_SPL_BUILD
64*ae28a5f8SDennis Gilmore #define CONFIG_PCI_MVEBU
65*ae28a5f8SDennis Gilmore #define CONFIG_PCI_SCAN_SHOW
66*ae28a5f8SDennis Gilmore #endif
67*ae28a5f8SDennis Gilmore 
68*ae28a5f8SDennis Gilmore /* Keep device tree and initrd in lower memory so the kernel can access them */
69*ae28a5f8SDennis Gilmore #define RELOCATION_LIMITS_ENV_SETTINGS	\
70*ae28a5f8SDennis Gilmore 	"fdt_high=0x10000000\0"		\
71*ae28a5f8SDennis Gilmore 	"initrd_high=0x10000000\0"
72*ae28a5f8SDennis Gilmore 
73*ae28a5f8SDennis Gilmore /* SPL */
74*ae28a5f8SDennis Gilmore /*
75*ae28a5f8SDennis Gilmore  * Select the boot device here
76*ae28a5f8SDennis Gilmore  *
77*ae28a5f8SDennis Gilmore  * Currently supported are:
78*ae28a5f8SDennis Gilmore  * SPL_BOOT_SPI_NOR_FLASH	- Booting via SPI NOR flash
79*ae28a5f8SDennis Gilmore  * SPL_BOOT_SDIO_MMC_CARD	- Booting via SDIO/MMC card (partition 1)
80*ae28a5f8SDennis Gilmore  */
81*ae28a5f8SDennis Gilmore #define SPL_BOOT_SPI_NOR_FLASH		1
82*ae28a5f8SDennis Gilmore #define SPL_BOOT_SDIO_MMC_CARD		2
83*ae28a5f8SDennis Gilmore #define CONFIG_SPL_BOOT_DEVICE		SPL_BOOT_SDIO_MMC_CARD
84*ae28a5f8SDennis Gilmore 
85*ae28a5f8SDennis Gilmore /* Defines for SPL */
86*ae28a5f8SDennis Gilmore #define CONFIG_SPL_SIZE			(140 << 10)
87*ae28a5f8SDennis Gilmore #define CONFIG_SPL_TEXT_BASE		0x40000030
88*ae28a5f8SDennis Gilmore #define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - 0x0030)
89*ae28a5f8SDennis Gilmore 
90*ae28a5f8SDennis Gilmore #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + CONFIG_SPL_SIZE)
91*ae28a5f8SDennis Gilmore #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
92*ae28a5f8SDennis Gilmore 
93*ae28a5f8SDennis Gilmore #ifdef CONFIG_SPL_BUILD
94*ae28a5f8SDennis Gilmore #define CONFIG_SYS_MALLOC_SIMPLE
95*ae28a5f8SDennis Gilmore #endif
96*ae28a5f8SDennis Gilmore 
97*ae28a5f8SDennis Gilmore #define CONFIG_SPL_STACK		(0x40000000 + ((192 - 16) << 10))
98*ae28a5f8SDennis Gilmore #define CONFIG_SPL_BOOTROM_SAVE		(CONFIG_SPL_STACK + 4)
99*ae28a5f8SDennis Gilmore 
100*ae28a5f8SDennis Gilmore #if CONFIG_SPL_BOOT_DEVICE == SPL_BOOT_SPI_NOR_FLASH
101*ae28a5f8SDennis Gilmore /* SPL related SPI defines */
102*ae28a5f8SDennis Gilmore #define CONFIG_SYS_SPI_U_BOOT_OFFS	0x20000
103*ae28a5f8SDennis Gilmore #define CONFIG_SYS_U_BOOT_OFFS		CONFIG_SYS_SPI_U_BOOT_OFFS
104*ae28a5f8SDennis Gilmore #endif
105*ae28a5f8SDennis Gilmore 
106*ae28a5f8SDennis Gilmore #if CONFIG_SPL_BOOT_DEVICE == SPL_BOOT_SDIO_MMC_CARD
107*ae28a5f8SDennis Gilmore /* SPL related MMC defines */
108*ae28a5f8SDennis Gilmore #define CONFIG_SYS_MMC_U_BOOT_OFFS		(160 << 10)
109*ae28a5f8SDennis Gilmore #define CONFIG_SYS_U_BOOT_OFFS			CONFIG_SYS_MMC_U_BOOT_OFFS
110*ae28a5f8SDennis Gilmore #ifdef CONFIG_SPL_BUILD
111*ae28a5f8SDennis Gilmore #define CONFIG_FIXED_SDHCI_ALIGNED_BUFFER	0x00180000	/* in SDRAM */
112*ae28a5f8SDennis Gilmore #endif
113*ae28a5f8SDennis Gilmore #endif
114*ae28a5f8SDennis Gilmore /*
115*ae28a5f8SDennis Gilmore  * mv-common.h should be defined after CMD configs since it used them
116*ae28a5f8SDennis Gilmore  * to enable certain macros
117*ae28a5f8SDennis Gilmore  */
118*ae28a5f8SDennis Gilmore #include "mv-common.h"
119*ae28a5f8SDennis Gilmore 
120*ae28a5f8SDennis Gilmore /* Include the common distro boot environment */
121*ae28a5f8SDennis Gilmore #ifndef CONFIG_SPL_BUILD
122*ae28a5f8SDennis Gilmore 
123*ae28a5f8SDennis Gilmore #ifdef CONFIG_MMC
124*ae28a5f8SDennis Gilmore #define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0)
125*ae28a5f8SDennis Gilmore #else
126*ae28a5f8SDennis Gilmore #define BOOT_TARGET_DEVICES_MMC(func)
127*ae28a5f8SDennis Gilmore #endif
128*ae28a5f8SDennis Gilmore 
129*ae28a5f8SDennis Gilmore #ifdef CONFIG_USB_STORAGE
130*ae28a5f8SDennis Gilmore #define BOOT_TARGET_DEVICES_USB(func) func(USB, usb, 0)
131*ae28a5f8SDennis Gilmore #else
132*ae28a5f8SDennis Gilmore #define BOOT_TARGET_DEVICES_USB(func)
133*ae28a5f8SDennis Gilmore #endif
134*ae28a5f8SDennis Gilmore 
135*ae28a5f8SDennis Gilmore #ifdef CONFIG_SATA
136*ae28a5f8SDennis Gilmore #define BOOT_TARGET_DEVICES_SATA(func) func(SATA, sata, 0)
137*ae28a5f8SDennis Gilmore #else
138*ae28a5f8SDennis Gilmore #define BOOT_TARGET_DEVICES_SATA(func)
139*ae28a5f8SDennis Gilmore #endif
140*ae28a5f8SDennis Gilmore 
141*ae28a5f8SDennis Gilmore #define BOOT_TARGET_DEVICES(func) \
142*ae28a5f8SDennis Gilmore 	BOOT_TARGET_DEVICES_MMC(func) \
143*ae28a5f8SDennis Gilmore 	BOOT_TARGET_DEVICES_USB(func) \
144*ae28a5f8SDennis Gilmore 	BOOT_TARGET_DEVICES_SATA(func) \
145*ae28a5f8SDennis Gilmore 	func(PXE, pxe, na) \
146*ae28a5f8SDennis Gilmore 	func(DHCP, dhcp, na)
147*ae28a5f8SDennis Gilmore 
148*ae28a5f8SDennis Gilmore #define KERNEL_ADDR_R	__stringify(0x800000)
149*ae28a5f8SDennis Gilmore #define FDT_ADDR_R	__stringify(0x100000)
150*ae28a5f8SDennis Gilmore #define RAMDISK_ADDR_R	__stringify(0x1800000)
151*ae28a5f8SDennis Gilmore #define SCRIPT_ADDR_R	__stringify(0x200000)
152*ae28a5f8SDennis Gilmore #define PXEFILE_ADDR_R	__stringify(0x300000)
153*ae28a5f8SDennis Gilmore 
154*ae28a5f8SDennis Gilmore #define LOAD_ADDRESS_ENV_SETTINGS \
155*ae28a5f8SDennis Gilmore 	"kernel_addr_r=" KERNEL_ADDR_R "\0" \
156*ae28a5f8SDennis Gilmore 	"fdt_addr_r=" FDT_ADDR_R "\0" \
157*ae28a5f8SDennis Gilmore 	"ramdisk_addr_r=" RAMDISK_ADDR_R "\0" \
158*ae28a5f8SDennis Gilmore 	"scriptaddr=" SCRIPT_ADDR_R "\0" \
159*ae28a5f8SDennis Gilmore 	"pxefile_addr_r=" PXEFILE_ADDR_R "\0"
160*ae28a5f8SDennis Gilmore 
161*ae28a5f8SDennis Gilmore #include <config_distro_bootcmd.h>
162*ae28a5f8SDennis Gilmore 
163*ae28a5f8SDennis Gilmore #define CONFIG_EXTRA_ENV_SETTINGS \
164*ae28a5f8SDennis Gilmore 	RELOCATION_LIMITS_ENV_SETTINGS \
165*ae28a5f8SDennis Gilmore 	LOAD_ADDRESS_ENV_SETTINGS \
166*ae28a5f8SDennis Gilmore 	"fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
167*ae28a5f8SDennis Gilmore 	"console=ttyS0,115200\0" \
168*ae28a5f8SDennis Gilmore 	BOOTENV
169*ae28a5f8SDennis Gilmore 
170*ae28a5f8SDennis Gilmore #endif /* CONFIG_SPL_BUILD */
171*ae28a5f8SDennis Gilmore 
172*ae28a5f8SDennis Gilmore #endif /* _CONFIG_HELIOS4_H */
173