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