1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright (C) 2017 Marek Behun <marek.behun@nic.cz>
4 * Copyright (C) 2016 Tomas Hlavacek <tomas.hlavacek@nic.cz>
7 #ifndef _CONFIG_TURRIS_OMNIA_H
8 #define _CONFIG_TURRIS_OMNIA_H
11 * High Level Configuration Options (easy to change)
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
19 #define CONFIG_SYS_TCLK 250000000 /* 250MHz */
21 /* USB/EHCI configuration */
22 #define CONFIG_EHCI_IS_TDI
24 /* Environment in SPI NOR flash */
25 #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 */
29 #define PHY_ANEG_TIMEOUT 8000 /* PHY needs a longer aneg time */
32 #ifndef CONFIG_SPL_BUILD
33 #define CONFIG_PCI_SCAN_SHOW
36 /* 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"
42 #define CONFIG_SPL_SIZE (140 << 10)
43 #define CONFIG_SPL_MAX_SIZE (CONFIG_SPL_SIZE - 0x0030)
45 #define CONFIG_SPL_BSS_START_ADDR (0x40000000 + CONFIG_SPL_SIZE)
46 #define CONFIG_SPL_BSS_MAX_SIZE (16 << 10)
48 #ifdef CONFIG_SPL_BUILD
49 #define CONFIG_SYS_MALLOC_SIMPLE
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
56 #ifdef CONFIG_MVEBU_SPL_BOOT_DEVICE_SPI
57 /* SPL related SPI defines */
58 # define CONFIG_SYS_SPI_U_BOOT_OFFS 0x24000
59 # define CONFIG_SYS_U_BOOT_OFFS CONFIG_SYS_SPI_U_BOOT_OFFS
62 #ifdef CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC
63 /* 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 */
72 * mv-common.h should be defined after CMD configs since it used them
73 * to enable certain macros
75 #include "mv-common.h"
77 /* Include the common distro boot environment */
78 #ifndef CONFIG_SPL_BUILD
81 #define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0)
83 #define BOOT_TARGET_DEVICES_MMC(func)
86 #ifdef CONFIG_USB_STORAGE
87 #define BOOT_TARGET_DEVICES_USB(func) func(USB, usb, 0)
89 #define BOOT_TARGET_DEVICES_USB(func)
93 #define BOOT_TARGET_DEVICES_SCSI(func) func(SCSI, scsi, 0)
95 #define BOOT_TARGET_DEVICES_SCSI(func)
98 #define BOOT_TARGET_DEVICES(func) \
99 BOOT_TARGET_DEVICES_MMC(func) \
100 BOOT_TARGET_DEVICES_USB(func) \
101 BOOT_TARGET_DEVICES_SCSI(func) \
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)
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"
118 #include <config_distro_bootcmd.h>
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" \
127 #endif /* CONFIG_SPL_BUILD */
129 #endif /* _CONFIG_TURRIS_OMNIA_H */