blob: b2badab15eab25f82ca14057125d23e4a6bd8960 [file] [log] [blame]
Dennis Gilmore77c39402018-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 Prayogacc650662018-12-05 00:57:24 +08009#include <linux/sizes.h>
10
Dennis Gilmore77c39402018-06-11 19:39:53 -050011/*
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
Dennis Gilmore77c39402018-06-11 19:39:53 -050026/*
27 * SDIO/MMC Card Configuration
28 */
29#define CONFIG_SYS_MMC_BASE MVEBU_SDIO_BASE
30
31/* USB/EHCI configuration */
32#define CONFIG_EHCI_IS_TDI
33
34#define CONFIG_ENV_MIN_ENTRIES 128
35
36/*
37 * SATA/SCSI/AHCI configuration
38 */
39#define CONFIG_SCSI_AHCI_PLAT
40#define CONFIG_SYS_SCSI_MAX_SCSI_ID 2
41#define CONFIG_SYS_SCSI_MAX_LUN 2
42#define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \
43 CONFIG_SYS_SCSI_MAX_LUN)
44
Aditya Prayogacc650662018-12-05 00:57:24 +080045#ifdef CONFIG_MVEBU_SPL_BOOT_DEVICE_SPI
Aditya Prayogacc650662018-12-05 00:57:24 +080046/* Environment in SPI NOR flash */
47#define CONFIG_ENV_SECT_SIZE SZ_64K
48#define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE
49#define CONFIG_ENV_OFFSET SZ_1M
50#endif
51
52#ifdef CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC
Dennis Gilmore77c39402018-06-11 19:39:53 -050053/* Environment in MMC */
54#define CONFIG_SYS_MMC_ENV_DEV 0
55#define CONFIG_ENV_SECT_SIZE 0x200
Aditya Prayogad88b2ed2018-12-05 00:57:20 +080056#define CONFIG_ENV_SIZE 0x2000
57/* stay within first 1M */
58#define CONFIG_ENV_OFFSET (SZ_1M - CONFIG_ENV_SIZE)
Dennis Gilmore77c39402018-06-11 19:39:53 -050059#define CONFIG_ENV_ADDR CONFIG_ENV_OFFSET
Aditya Prayogacc650662018-12-05 00:57:24 +080060#endif
Dennis Gilmore77c39402018-06-11 19:39:53 -050061
62#define CONFIG_PHY_MARVELL /* there is a marvell phy */
63#define PHY_ANEG_TIMEOUT 8000 /* PHY needs a longer aneg time */
64
Dennis Gilmore77c39402018-06-11 19:39:53 -050065/* Keep device tree and initrd in lower memory so the kernel can access them */
66#define RELOCATION_LIMITS_ENV_SETTINGS \
67 "fdt_high=0x10000000\0" \
68 "initrd_high=0x10000000\0"
69
70/* SPL */
71/*
72 * Select the boot device here
73 *
74 * Currently supported are:
75 * SPL_BOOT_SPI_NOR_FLASH - Booting via SPI NOR flash
76 * SPL_BOOT_SDIO_MMC_CARD - Booting via SDIO/MMC card (partition 1)
77 */
78#define SPL_BOOT_SPI_NOR_FLASH 1
79#define SPL_BOOT_SDIO_MMC_CARD 2
Aditya Prayogacc650662018-12-05 00:57:24 +080080
81#ifdef CONFIG_MVEBU_SPL_BOOT_DEVICE_SPI
82#define CONFIG_SPL_BOOT_DEVICE SPL_BOOT_SPI_NOR_FLASH
83#endif
84#ifdef CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC
Dennis Gilmore77c39402018-06-11 19:39:53 -050085#define CONFIG_SPL_BOOT_DEVICE SPL_BOOT_SDIO_MMC_CARD
Aditya Prayogacc650662018-12-05 00:57:24 +080086#endif
Dennis Gilmore77c39402018-06-11 19:39:53 -050087
88/* Defines for SPL */
89#define CONFIG_SPL_SIZE (140 << 10)
90#define CONFIG_SPL_TEXT_BASE 0x40000030
91#define CONFIG_SPL_MAX_SIZE (CONFIG_SPL_SIZE - 0x0030)
92
93#define CONFIG_SPL_BSS_START_ADDR (0x40000000 + CONFIG_SPL_SIZE)
94#define CONFIG_SPL_BSS_MAX_SIZE (16 << 10)
95
96#ifdef CONFIG_SPL_BUILD
97#define CONFIG_SYS_MALLOC_SIMPLE
98#endif
99
100#define CONFIG_SPL_STACK (0x40000000 + ((192 - 16) << 10))
101#define CONFIG_SPL_BOOTROM_SAVE (CONFIG_SPL_STACK + 4)
102
103#if CONFIG_SPL_BOOT_DEVICE == SPL_BOOT_SPI_NOR_FLASH
104/* SPL related SPI defines */
Aditya Prayogacc650662018-12-05 00:57:24 +0800105#define CONFIG_SPL_SPI_FLASH_SUPPORT
106#define CONFIG_SPL_SPI_LOAD
107#define CONFIG_SPL_SPI_SUPPORT
Aditya Prayoga52d99642018-12-19 12:08:50 +0800108#define CONFIG_SYS_SPI_U_BOOT_OFFS 0x30000
Dennis Gilmore77c39402018-06-11 19:39:53 -0500109#define CONFIG_SYS_U_BOOT_OFFS CONFIG_SYS_SPI_U_BOOT_OFFS
110#endif
111
112#if CONFIG_SPL_BOOT_DEVICE == SPL_BOOT_SDIO_MMC_CARD
113/* SPL related MMC defines */
Aditya Prayogacc650662018-12-05 00:57:24 +0800114#define CONFIG_SPL_MMC_SUPPORT
Dennis Gilmore77c39402018-06-11 19:39:53 -0500115#define CONFIG_SYS_MMC_U_BOOT_OFFS (160 << 10)
116#define CONFIG_SYS_U_BOOT_OFFS CONFIG_SYS_MMC_U_BOOT_OFFS
117#ifdef CONFIG_SPL_BUILD
118#define CONFIG_FIXED_SDHCI_ALIGNED_BUFFER 0x00180000 /* in SDRAM */
119#endif
120#endif
121/*
122 * mv-common.h should be defined after CMD configs since it used them
123 * to enable certain macros
124 */
125#include "mv-common.h"
126
127/* Include the common distro boot environment */
128#ifndef CONFIG_SPL_BUILD
129
130#ifdef CONFIG_MMC
131#define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0)
132#else
133#define BOOT_TARGET_DEVICES_MMC(func)
134#endif
135
136#ifdef CONFIG_USB_STORAGE
137#define BOOT_TARGET_DEVICES_USB(func) func(USB, usb, 0)
138#else
139#define BOOT_TARGET_DEVICES_USB(func)
140#endif
141
142#ifdef CONFIG_SATA
143#define BOOT_TARGET_DEVICES_SATA(func) func(SATA, sata, 0)
144#else
145#define BOOT_TARGET_DEVICES_SATA(func)
146#endif
147
148#define BOOT_TARGET_DEVICES(func) \
149 BOOT_TARGET_DEVICES_MMC(func) \
150 BOOT_TARGET_DEVICES_USB(func) \
151 BOOT_TARGET_DEVICES_SATA(func) \
152 func(PXE, pxe, na) \
153 func(DHCP, dhcp, na)
154
155#define KERNEL_ADDR_R __stringify(0x800000)
156#define FDT_ADDR_R __stringify(0x100000)
157#define RAMDISK_ADDR_R __stringify(0x1800000)
158#define SCRIPT_ADDR_R __stringify(0x200000)
159#define PXEFILE_ADDR_R __stringify(0x300000)
160
161#define LOAD_ADDRESS_ENV_SETTINGS \
162 "kernel_addr_r=" KERNEL_ADDR_R "\0" \
163 "fdt_addr_r=" FDT_ADDR_R "\0" \
164 "ramdisk_addr_r=" RAMDISK_ADDR_R "\0" \
165 "scriptaddr=" SCRIPT_ADDR_R "\0" \
166 "pxefile_addr_r=" PXEFILE_ADDR_R "\0"
167
168#include <config_distro_bootcmd.h>
169
170#define CONFIG_EXTRA_ENV_SETTINGS \
171 RELOCATION_LIMITS_ENV_SETTINGS \
172 LOAD_ADDRESS_ENV_SETTINGS \
173 "fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
174 "console=ttyS0,115200\0" \
175 BOOTENV
176
177#endif /* CONFIG_SPL_BUILD */
178
179#endif /* _CONFIG_HELIOS4_H */