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