blob: 31e2e78b62e62a913cd524456f1d271290f0ab69 [file] [log] [blame]
Dennis Gilmoreae28a5f2018-06-11 19:39:53 -05001/* 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
Aditya Prayoga8d7d97e2018-12-05 00:57:24 +08009#include <linux/sizes.h>
Simon Glass1af3c7f2020-05-10 11:40:09 -060010#include <linux/stringify.h>
Aditya Prayoga8d7d97e2018-12-05 00:57:24 +080011
Dennis Gilmoreae28a5f2018-06-11 19:39:53 -050012/*
13 * High Level Configuration Options (easy to change)
14 */
15
16/*
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
19 * U-Boot into it.
20 */
21#define CONFIG_SYS_TCLK 250000000 /* 250MHz */
22
23/*
Dennis Gilmoreae28a5f2018-06-11 19:39:53 -050024 * SDIO/MMC Card Configuration
25 */
26#define CONFIG_SYS_MMC_BASE MVEBU_SDIO_BASE
27
28/* USB/EHCI configuration */
29#define CONFIG_EHCI_IS_TDI
30
31#define CONFIG_ENV_MIN_ENTRIES 128
32
33/*
34 * SATA/SCSI/AHCI configuration
35 */
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)
41
Aditya Prayoga8d7d97e2018-12-05 00:57:24 +080042#ifdef CONFIG_MVEBU_SPL_BOOT_DEVICE_SPI
Aditya Prayoga8d7d97e2018-12-05 00:57:24 +080043/* Environment in SPI NOR flash */
Aditya Prayoga8d7d97e2018-12-05 00:57:24 +080044#endif
45
46#ifdef CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC
Dennis Gilmoreae28a5f2018-06-11 19:39:53 -050047/* Environment in MMC */
48#define CONFIG_SYS_MMC_ENV_DEV 0
Aditya Prayogaa134d682018-12-05 00:57:20 +080049/* stay within first 1M */
Aditya Prayoga8d7d97e2018-12-05 00:57:24 +080050#endif
Dennis Gilmoreae28a5f2018-06-11 19:39:53 -050051
Dennis Gilmoreae28a5f2018-06-11 19:39:53 -050052#define PHY_ANEG_TIMEOUT 8000 /* PHY needs a longer aneg time */
53
Dennis Gilmoreae28a5f2018-06-11 19:39:53 -050054/* 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"
58
59/* SPL */
60/*
61 * Select the boot device here
62 *
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)
66 */
67#define SPL_BOOT_SPI_NOR_FLASH 1
68#define SPL_BOOT_SDIO_MMC_CARD 2
Aditya Prayoga8d7d97e2018-12-05 00:57:24 +080069
70#ifdef CONFIG_MVEBU_SPL_BOOT_DEVICE_SPI
71#define CONFIG_SPL_BOOT_DEVICE SPL_BOOT_SPI_NOR_FLASH
72#endif
73#ifdef CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC
Dennis Gilmoreae28a5f2018-06-11 19:39:53 -050074#define CONFIG_SPL_BOOT_DEVICE SPL_BOOT_SDIO_MMC_CARD
Aditya Prayoga8d7d97e2018-12-05 00:57:24 +080075#endif
Dennis Gilmoreae28a5f2018-06-11 19:39:53 -050076
77/* Defines for SPL */
78#define CONFIG_SPL_SIZE (140 << 10)
Dennis Gilmoreae28a5f2018-06-11 19:39:53 -050079#define CONFIG_SPL_MAX_SIZE (CONFIG_SPL_SIZE - 0x0030)
80
81#define CONFIG_SPL_BSS_START_ADDR (0x40000000 + CONFIG_SPL_SIZE)
82#define CONFIG_SPL_BSS_MAX_SIZE (16 << 10)
83
84#ifdef CONFIG_SPL_BUILD
85#define CONFIG_SYS_MALLOC_SIMPLE
86#endif
87
88#define CONFIG_SPL_STACK (0x40000000 + ((192 - 16) << 10))
89#define CONFIG_SPL_BOOTROM_SAVE (CONFIG_SPL_STACK + 4)
90
91#if CONFIG_SPL_BOOT_DEVICE == SPL_BOOT_SPI_NOR_FLASH
Dennis Gilmoreae28a5f2018-06-11 19:39:53 -050092#define CONFIG_SYS_U_BOOT_OFFS CONFIG_SYS_SPI_U_BOOT_OFFS
93#endif
94
95#if CONFIG_SPL_BOOT_DEVICE == SPL_BOOT_SDIO_MMC_CARD
96/* SPL related MMC defines */
Dennis Gilmoreae28a5f2018-06-11 19:39:53 -050097#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 */
101#endif
102#endif
103/*
104 * mv-common.h should be defined after CMD configs since it used them
105 * to enable certain macros
106 */
107#include "mv-common.h"
108
109/* Include the common distro boot environment */
110#ifndef CONFIG_SPL_BUILD
111
112#ifdef CONFIG_MMC
113#define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0)
114#else
115#define BOOT_TARGET_DEVICES_MMC(func)
116#endif
117
118#ifdef CONFIG_USB_STORAGE
119#define BOOT_TARGET_DEVICES_USB(func) func(USB, usb, 0)
120#else
121#define BOOT_TARGET_DEVICES_USB(func)
122#endif
123
124#ifdef CONFIG_SATA
125#define BOOT_TARGET_DEVICES_SATA(func) func(SATA, sata, 0)
126#else
127#define BOOT_TARGET_DEVICES_SATA(func)
128#endif
129
130#define BOOT_TARGET_DEVICES(func) \
131 BOOT_TARGET_DEVICES_MMC(func) \
132 BOOT_TARGET_DEVICES_USB(func) \
133 BOOT_TARGET_DEVICES_SATA(func) \
134 func(PXE, pxe, na) \
135 func(DHCP, dhcp, na)
136
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)
142
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"
149
150#include <config_distro_bootcmd.h>
151
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" \
157 BOOTENV
158
159#endif /* CONFIG_SPL_BUILD */
160
161#endif /* _CONFIG_HELIOS4_H */