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>
10 #include <linux/stringify.h>
13 * High Level Configuration Options (easy to change)
17 * TEXT_BASE needs to be below 16MiB, since this area is scrubbed
18 * for DDR ECC byte filling in the SPL before loading the main
21 #define CONFIG_SYS_TCLK 250000000 /* 250MHz */
24 * SDIO/MMC Card Configuration
26 #define CONFIG_SYS_MMC_BASE MVEBU_SDIO_BASE
28 /* USB/EHCI configuration */
29 #define CONFIG_EHCI_IS_TDI
31 #define CONFIG_ENV_MIN_ENTRIES 128
34 * SATA/SCSI/AHCI configuration
36 #define CONFIG_SCSI_AHCI_PLAT
37 #define CONFIG_SYS_SCSI_MAX_SCSI_ID 2
38 #define CONFIG_SYS_SCSI_MAX_LUN 2
39 #define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \
40 CONFIG_SYS_SCSI_MAX_LUN)
42 #ifdef CONFIG_MVEBU_SPL_BOOT_DEVICE_SPI
43 /* Environment in SPI NOR flash */
46 #ifdef CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC
47 /* Environment in MMC */
48 #define CONFIG_SYS_MMC_ENV_DEV 0
49 /* stay within first 1M */
52 #define PHY_ANEG_TIMEOUT 8000 /* PHY needs a longer aneg time */
54 /* Keep device tree and initrd in lower memory so the kernel can access them */
55 #define RELOCATION_LIMITS_ENV_SETTINGS \
56 "fdt_high=0x10000000\0" \
57 "initrd_high=0x10000000\0"
61 * Select the boot device here
63 * Currently supported are:
64 * SPL_BOOT_SPI_NOR_FLASH - Booting via SPI NOR flash
65 * SPL_BOOT_SDIO_MMC_CARD - Booting via SDIO/MMC card (partition 1)
67 #define SPL_BOOT_SPI_NOR_FLASH 1
68 #define SPL_BOOT_SDIO_MMC_CARD 2
70 #ifdef CONFIG_MVEBU_SPL_BOOT_DEVICE_SPI
71 #define CONFIG_SPL_BOOT_DEVICE SPL_BOOT_SPI_NOR_FLASH
73 #ifdef CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC
74 #define CONFIG_SPL_BOOT_DEVICE SPL_BOOT_SDIO_MMC_CARD
78 #define CONFIG_SPL_SIZE (140 << 10)
79 #define CONFIG_SPL_MAX_SIZE (CONFIG_SPL_SIZE - 0x0030)
81 #define CONFIG_SPL_BSS_START_ADDR (0x40000000 + CONFIG_SPL_SIZE)
82 #define CONFIG_SPL_BSS_MAX_SIZE (16 << 10)
84 #ifdef CONFIG_SPL_BUILD
85 #define CONFIG_SYS_MALLOC_SIMPLE
88 #define CONFIG_SPL_STACK (0x40000000 + ((192 - 16) << 10))
89 #define CONFIG_SPL_BOOTROM_SAVE (CONFIG_SPL_STACK + 4)
91 #if CONFIG_SPL_BOOT_DEVICE == SPL_BOOT_SPI_NOR_FLASH
92 #define CONFIG_SYS_U_BOOT_OFFS CONFIG_SYS_SPI_U_BOOT_OFFS
95 #if CONFIG_SPL_BOOT_DEVICE == SPL_BOOT_SDIO_MMC_CARD
96 /* SPL related MMC defines */
97 #define CONFIG_SYS_MMC_U_BOOT_OFFS (160 << 10)
98 #define CONFIG_SYS_U_BOOT_OFFS CONFIG_SYS_MMC_U_BOOT_OFFS
99 #ifdef CONFIG_SPL_BUILD
100 #define CONFIG_FIXED_SDHCI_ALIGNED_BUFFER 0x00180000 /* in SDRAM */
104 * mv-common.h should be defined after CMD configs since it used them
105 * to enable certain macros
107 #include "mv-common.h"
109 /* Include the common distro boot environment */
110 #ifndef CONFIG_SPL_BUILD
113 #define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0)
115 #define BOOT_TARGET_DEVICES_MMC(func)
118 #ifdef CONFIG_USB_STORAGE
119 #define BOOT_TARGET_DEVICES_USB(func) func(USB, usb, 0)
121 #define BOOT_TARGET_DEVICES_USB(func)
125 #define BOOT_TARGET_DEVICES_SATA(func) func(SATA, sata, 0)
127 #define BOOT_TARGET_DEVICES_SATA(func)
130 #define BOOT_TARGET_DEVICES(func) \
131 BOOT_TARGET_DEVICES_MMC(func) \
132 BOOT_TARGET_DEVICES_USB(func) \
133 BOOT_TARGET_DEVICES_SATA(func) \
137 #define KERNEL_ADDR_R __stringify(0x800000)
138 #define FDT_ADDR_R __stringify(0x100000)
139 #define RAMDISK_ADDR_R __stringify(0x1800000)
140 #define SCRIPT_ADDR_R __stringify(0x200000)
141 #define PXEFILE_ADDR_R __stringify(0x300000)
143 #define LOAD_ADDRESS_ENV_SETTINGS \
144 "kernel_addr_r=" KERNEL_ADDR_R "\0" \
145 "fdt_addr_r=" FDT_ADDR_R "\0" \
146 "ramdisk_addr_r=" RAMDISK_ADDR_R "\0" \
147 "scriptaddr=" SCRIPT_ADDR_R "\0" \
148 "pxefile_addr_r=" PXEFILE_ADDR_R "\0"
150 #include <config_distro_bootcmd.h>
152 #define CONFIG_EXTRA_ENV_SETTINGS \
153 RELOCATION_LIMITS_ENV_SETTINGS \
154 LOAD_ADDRESS_ENV_SETTINGS \
155 "fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
156 "console=ttyS0,115200\0" \
159 #endif /* CONFIG_SPL_BUILD */
161 #endif /* _CONFIG_HELIOS4_H */