blob: 018f54428bccc94cf066be59477ea622abeedbf3 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Marek Behún09e16b82017-06-09 19:28:45 +02002/*
3 * Copyright (C) 2017 Marek Behun <marek.behun@nic.cz>
4 * Copyright (C) 2016 Tomas Hlavacek <tomas.hlavacek@nic.cz>
Marek Behún09e16b82017-06-09 19:28:45 +02005 */
6
7#ifndef _CONFIG_TURRIS_OMNIA_H
8#define _CONFIG_TURRIS_OMNIA_H
9
10/*
11 * High Level Configuration Options (easy to change)
12 */
13
Marek Behún09e16b82017-06-09 19:28:45 +020014/*
15 * TEXT_BASE needs to be below 16MiB, since this area is scrubbed
16 * for DDR ECC byte filling in the SPL before loading the main
17 * U-Boot into it.
18 */
Marek Behún09e16b82017-06-09 19:28:45 +020019#define CONFIG_SYS_TCLK 250000000 /* 250MHz */
20
Marek Behún09e16b82017-06-09 19:28:45 +020021/* USB/EHCI configuration */
22#define CONFIG_EHCI_IS_TDI
23
24/* Environment in SPI NOR flash */
Marek Behún09e16b82017-06-09 19:28:45 +020025#define CONFIG_ENV_OFFSET (3*(1 << 18)) /* 768KiB in */
26#define CONFIG_ENV_SIZE (64 << 10) /* 64KiB */
27#define CONFIG_ENV_SECT_SIZE (256 << 10) /* 256KiB sectors */
28
Marek Behún09e16b82017-06-09 19:28:45 +020029#define PHY_ANEG_TIMEOUT 8000 /* PHY needs a longer aneg time */
30
31/* PCIe support */
32#ifndef CONFIG_SPL_BUILD
Marek Behún09e16b82017-06-09 19:28:45 +020033#define CONFIG_PCI_SCAN_SHOW
34#endif
35
Marek Behún09e16b82017-06-09 19:28:45 +020036/* Keep device tree and initrd in lower memory so the kernel can access them */
37#define RELOCATION_LIMITS_ENV_SETTINGS \
38 "fdt_high=0x10000000\0" \
39 "initrd_high=0x10000000\0"
40
41/* Defines for SPL */
Marek Behún09e16b82017-06-09 19:28:45 +020042#define CONFIG_SPL_SIZE (140 << 10)
Marek Behún09e16b82017-06-09 19:28:45 +020043#define CONFIG_SPL_MAX_SIZE (CONFIG_SPL_SIZE - 0x0030)
44
45#define CONFIG_SPL_BSS_START_ADDR (0x40000000 + CONFIG_SPL_SIZE)
46#define CONFIG_SPL_BSS_MAX_SIZE (16 << 10)
47
48#ifdef CONFIG_SPL_BUILD
49#define CONFIG_SYS_MALLOC_SIMPLE
50#endif
51
52#define CONFIG_SPL_STACK (0x40000000 + ((192 - 16) << 10))
53#define CONFIG_SPL_BOOTROM_SAVE (CONFIG_SPL_STACK + 4)
54#define CONFIG_SPL_DRIVERS_MISC_SUPPORT
55
Baruch Siach8d196a42018-06-18 21:56:24 +030056#ifdef CONFIG_MVEBU_SPL_BOOT_DEVICE_SPI
Marek Behún09e16b82017-06-09 19:28:45 +020057/* SPL related SPI defines */
Marek Behún09e16b82017-06-09 19:28:45 +020058# define CONFIG_SYS_SPI_U_BOOT_OFFS 0x24000
59# define CONFIG_SYS_U_BOOT_OFFS CONFIG_SYS_SPI_U_BOOT_OFFS
60#endif
61
Baruch Siach8d196a42018-06-18 21:56:24 +030062#ifdef CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC
Marek Behún09e16b82017-06-09 19:28:45 +020063/* SPL related MMC defines */
64# define CONFIG_SYS_MMC_U_BOOT_OFFS (160 << 10)
65# define CONFIG_SYS_U_BOOT_OFFS CONFIG_SYS_MMC_U_BOOT_OFFS
66# ifdef CONFIG_SPL_BUILD
67# define CONFIG_FIXED_SDHCI_ALIGNED_BUFFER 0x00180000 /* in SDRAM */
68# endif
69#endif
70
71/*
72 * mv-common.h should be defined after CMD configs since it used them
73 * to enable certain macros
74 */
75#include "mv-common.h"
76
77/* Include the common distro boot environment */
78#ifndef CONFIG_SPL_BUILD
Marek Behún09e16b82017-06-09 19:28:45 +020079
80#ifdef CONFIG_MMC
81#define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0)
82#else
83#define BOOT_TARGET_DEVICES_MMC(func)
84#endif
85
86#ifdef CONFIG_USB_STORAGE
87#define BOOT_TARGET_DEVICES_USB(func) func(USB, usb, 0)
88#else
89#define BOOT_TARGET_DEVICES_USB(func)
90#endif
91
Marek Behúnbd2ab872019-05-02 16:53:29 +020092#ifdef CONFIG_SCSI
93#define BOOT_TARGET_DEVICES_SCSI(func) func(SCSI, scsi, 0)
94#else
95#define BOOT_TARGET_DEVICES_SCSI(func)
96#endif
97
Marek Behún09e16b82017-06-09 19:28:45 +020098#define BOOT_TARGET_DEVICES(func) \
99 BOOT_TARGET_DEVICES_MMC(func) \
100 BOOT_TARGET_DEVICES_USB(func) \
Marek Behúnbd2ab872019-05-02 16:53:29 +0200101 BOOT_TARGET_DEVICES_SCSI(func) \
Marek Behún09e16b82017-06-09 19:28:45 +0200102 func(PXE, pxe, na) \
103 func(DHCP, dhcp, na)
104
105#define KERNEL_ADDR_R __stringify(0x1000000)
106#define FDT_ADDR_R __stringify(0x2000000)
107#define RAMDISK_ADDR_R __stringify(0x2200000)
108#define SCRIPT_ADDR_R __stringify(0x1800000)
109#define PXEFILE_ADDR_R __stringify(0x1900000)
110
111#define LOAD_ADDRESS_ENV_SETTINGS \
112 "kernel_addr_r=" KERNEL_ADDR_R "\0" \
113 "fdt_addr_r=" FDT_ADDR_R "\0" \
114 "ramdisk_addr_r=" RAMDISK_ADDR_R "\0" \
115 "scriptaddr=" SCRIPT_ADDR_R "\0" \
116 "pxefile_addr_r=" PXEFILE_ADDR_R "\0"
117
118#include <config_distro_bootcmd.h>
119
120#define CONFIG_EXTRA_ENV_SETTINGS \
121 RELOCATION_LIMITS_ENV_SETTINGS \
122 LOAD_ADDRESS_ENV_SETTINGS \
123 "fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
124 "console=ttyS0,115200\0" \
125 BOOTENV
126
127#endif /* CONFIG_SPL_BUILD */
128
129#endif /* _CONFIG_TURRIS_OMNIA_H */