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
20 /* Environment in SPI NOR flash */
22 #define PHY_ANEG_TIMEOUT 8000 /* PHY needs a longer aneg time */
24 /* Keep device tree and initrd in lower memory so the kernel can access them */
25 #define RELOCATION_LIMITS_ENV_SETTINGS \
26 "fdt_high=0x10000000\0" \
27 "initrd_high=0x10000000\0"
30 #define CONFIG_SPL_SIZE (140 << 10)
32 #ifdef CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC
33 /* SPL related MMC defines */
34 # ifdef CONFIG_SPL_BUILD
35 # define CONFIG_FIXED_SDHCI_ALIGNED_BUFFER 0x00180000 /* in SDRAM */
40 * mv-common.h should be defined after CMD configs since it used them
41 * to enable certain macros
43 #include "mv-common.h"
45 /* Include the common distro boot environment */
46 #ifndef CONFIG_SPL_BUILD
48 #define BOOT_TARGET_DEVICES(func) \
56 #define KERNEL_ADDR_R __stringify(0x1000000)
57 #define FDT_ADDR_R __stringify(0x2000000)
58 #define RAMDISK_ADDR_R __stringify(0x2200000)
59 #define SCRIPT_ADDR_R __stringify(0x1800000)
60 #define PXEFILE_ADDR_R __stringify(0x1900000)
62 #define LOAD_ADDRESS_ENV_SETTINGS \
63 "kernel_addr_r=" KERNEL_ADDR_R "\0" \
64 "fdt_addr_r=" FDT_ADDR_R "\0" \
65 "ramdisk_addr_r=" RAMDISK_ADDR_R "\0" \
66 "scriptaddr=" SCRIPT_ADDR_R "\0" \
67 "pxefile_addr_r=" PXEFILE_ADDR_R "\0"
69 #include <config_distro_bootcmd.h>
72 * The factory reset bootcommand on Omnia first sets all the front LEDs to green
73 * and then tries to load the rescue image from SPI flash memory and boot it
75 #define TURRIS_OMNIA_BOOTCMD_RESCUE \
77 "i2c mw 0x2a.1 0x3 0x1c 1; " \
78 "i2c mw 0x2a.1 0x4 0x1c 1; " \
79 "mw.l 0x01000000 0x00ff000c; " \
80 "i2c write 0x01000000 0x2a.1 0x5 4 -s; " \
81 "setenv bootargs \"earlyprintk console=ttyS0,115200" \
82 " omniarescue=$omnia_reset rescue_mode=$omnia_reset\"; " \
84 "sf read 0x1000000 0x100000 0x700000; " \
85 "lzmadec 0x1000000 0x1700000; " \
86 "if gpio input gpio@71_4; then " \
87 "bootm 0x1700000#sfp; " \
93 #define CONFIG_EXTRA_ENV_SETTINGS \
94 RELOCATION_LIMITS_ENV_SETTINGS \
95 LOAD_ADDRESS_ENV_SETTINGS \
96 "fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
97 "console=ttyS0,115200\0" \
98 "bootcmd_rescue=" TURRIS_OMNIA_BOOTCMD_RESCUE "\0" \
101 #endif /* CONFIG_SPL_BUILD */
103 #endif /* _CONFIG_TURRIS_OMNIA_H */