1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright (C) 2018 Dennis Gilmore <dgilmore@redhat.com>
6 #ifndef _CONFIG_HELIOS4_H
7 #define _CONFIG_HELIOS4_H
9 #include <linux/sizes.h>
12 * High Level Configuration Options (easy to change)
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
20 #define CONFIG_SYS_TCLK 250000000 /* 250MHz */
23 * Commands configuration
26 /* SPI NOR flash default params, used by sf commands */
29 * SDIO/MMC Card Configuration
31 #define CONFIG_SYS_MMC_BASE MVEBU_SDIO_BASE
33 /* USB/EHCI configuration */
34 #define CONFIG_EHCI_IS_TDI
36 #define CONFIG_ENV_MIN_ENTRIES 128
39 * SATA/SCSI/AHCI configuration
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)
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
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
64 #define CONFIG_PHY_MARVELL /* there is a marvell phy */
65 #define PHY_ANEG_TIMEOUT 8000 /* PHY needs a longer aneg time */
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"
74 * Select the boot device here
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)
80 #define SPL_BOOT_SPI_NOR_FLASH 1
81 #define SPL_BOOT_SDIO_MMC_CARD 2
83 #ifdef CONFIG_MVEBU_SPL_BOOT_DEVICE_SPI
84 #define CONFIG_SPL_BOOT_DEVICE SPL_BOOT_SPI_NOR_FLASH
86 #ifdef CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC
87 #define CONFIG_SPL_BOOT_DEVICE SPL_BOOT_SDIO_MMC_CARD
91 #define CONFIG_SPL_SIZE (140 << 10)
92 #define CONFIG_SPL_TEXT_BASE 0x40000030
93 #define CONFIG_SPL_MAX_SIZE (CONFIG_SPL_SIZE - 0x0030)
95 #define CONFIG_SPL_BSS_START_ADDR (0x40000000 + CONFIG_SPL_SIZE)
96 #define CONFIG_SPL_BSS_MAX_SIZE (16 << 10)
98 #ifdef CONFIG_SPL_BUILD
99 #define CONFIG_SYS_MALLOC_SIMPLE
102 #define CONFIG_SPL_STACK (0x40000000 + ((192 - 16) << 10))
103 #define CONFIG_SPL_BOOTROM_SAVE (CONFIG_SPL_STACK + 4)
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
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 */
124 * mv-common.h should be defined after CMD configs since it used them
125 * to enable certain macros
127 #include "mv-common.h"
129 /* Include the common distro boot environment */
130 #ifndef CONFIG_SPL_BUILD
133 #define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0)
135 #define BOOT_TARGET_DEVICES_MMC(func)
138 #ifdef CONFIG_USB_STORAGE
139 #define BOOT_TARGET_DEVICES_USB(func) func(USB, usb, 0)
141 #define BOOT_TARGET_DEVICES_USB(func)
145 #define BOOT_TARGET_DEVICES_SATA(func) func(SATA, sata, 0)
147 #define BOOT_TARGET_DEVICES_SATA(func)
150 #define BOOT_TARGET_DEVICES(func) \
151 BOOT_TARGET_DEVICES_MMC(func) \
152 BOOT_TARGET_DEVICES_USB(func) \
153 BOOT_TARGET_DEVICES_SATA(func) \
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)
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"
170 #include <config_distro_bootcmd.h>
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" \
179 #endif /* CONFIG_SPL_BUILD */
181 #endif /* _CONFIG_HELIOS4_H */