]>
Commit | Line | Data |
---|---|---|
83d290c5 | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
b6ee860b MB |
2 | /* |
3 | * Copyright (C) 2017 Marek Behun <marek.behun@nic.cz> | |
4 | * Copyright (C) 2016 Tomas Hlavacek <tomas.hlavacek@nic.cz> | |
b6ee860b MB |
5 | */ |
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 | ||
b6ee860b MB |
14 | /* |
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 | */ | |
b6ee860b | 19 | |
b6ee860b | 20 | /* Environment in SPI NOR flash */ |
b6ee860b | 21 | |
b6ee860b MB |
22 | #define PHY_ANEG_TIMEOUT 8000 /* PHY needs a longer aneg time */ |
23 | ||
b6ee860b MB |
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" | |
28 | ||
29 | /* Defines for SPL */ | |
b6ee860b | 30 | #define CONFIG_SPL_SIZE (140 << 10) |
b6ee860b MB |
31 | |
32 | #define CONFIG_SPL_BSS_START_ADDR (0x40000000 + CONFIG_SPL_SIZE) | |
33 | #define CONFIG_SPL_BSS_MAX_SIZE (16 << 10) | |
34 | ||
b6ee860b MB |
35 | #define CONFIG_SPL_STACK (0x40000000 + ((192 - 16) << 10)) |
36 | #define CONFIG_SPL_BOOTROM_SAVE (CONFIG_SPL_STACK + 4) | |
b6ee860b | 37 | |
ad105f5f | 38 | #ifdef CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC |
b6ee860b | 39 | /* SPL related MMC defines */ |
b6ee860b MB |
40 | # ifdef CONFIG_SPL_BUILD |
41 | # define CONFIG_FIXED_SDHCI_ALIGNED_BUFFER 0x00180000 /* in SDRAM */ | |
42 | # endif | |
43 | #endif | |
44 | ||
45 | /* | |
46 | * mv-common.h should be defined after CMD configs since it used them | |
47 | * to enable certain macros | |
48 | */ | |
49 | #include "mv-common.h" | |
50 | ||
51 | /* Include the common distro boot environment */ | |
52 | #ifndef CONFIG_SPL_BUILD | |
b6ee860b | 53 | |
b6ee860b | 54 | #define BOOT_TARGET_DEVICES(func) \ |
9efc5b7a | 55 | func(MMC, mmc, 0) \ |
0ddc1e5a | 56 | func(NVME, nvme, 0) \ |
9efc5b7a T |
57 | func(SCSI, scsi, 0) \ |
58 | func(USB, usb, 0) \ | |
b6ee860b MB |
59 | func(PXE, pxe, na) \ |
60 | func(DHCP, dhcp, na) | |
61 | ||
62 | #define KERNEL_ADDR_R __stringify(0x1000000) | |
63 | #define FDT_ADDR_R __stringify(0x2000000) | |
64 | #define RAMDISK_ADDR_R __stringify(0x2200000) | |
65 | #define SCRIPT_ADDR_R __stringify(0x1800000) | |
66 | #define PXEFILE_ADDR_R __stringify(0x1900000) | |
67 | ||
68 | #define LOAD_ADDRESS_ENV_SETTINGS \ | |
69 | "kernel_addr_r=" KERNEL_ADDR_R "\0" \ | |
70 | "fdt_addr_r=" FDT_ADDR_R "\0" \ | |
71 | "ramdisk_addr_r=" RAMDISK_ADDR_R "\0" \ | |
72 | "scriptaddr=" SCRIPT_ADDR_R "\0" \ | |
73 | "pxefile_addr_r=" PXEFILE_ADDR_R "\0" | |
74 | ||
75 | #include <config_distro_bootcmd.h> | |
76 | ||
176c3e77 MB |
77 | /* |
78 | * The factory reset bootcommand on Omnia first sets all the front LEDs to green | |
79 | * and then tries to load the rescue image from SPI flash memory and boot it | |
80 | */ | |
81 | #define TURRIS_OMNIA_BOOTCMD_RESCUE \ | |
82 | "i2c dev 2; " \ | |
83 | "i2c mw 0x2a.1 0x3 0x1c 1; " \ | |
84 | "i2c mw 0x2a.1 0x4 0x1c 1; " \ | |
85 | "mw.l 0x01000000 0x00ff000c; " \ | |
86 | "i2c write 0x01000000 0x2a.1 0x5 4 -s; " \ | |
87 | "setenv bootargs \"earlyprintk console=ttyS0,115200" \ | |
88 | " omniarescue=$omnia_reset rescue_mode=$omnia_reset\"; " \ | |
89 | "sf probe; " \ | |
90 | "sf read 0x1000000 0x100000 0x700000; " \ | |
91 | "lzmadec 0x1000000 0x1700000; " \ | |
92 | "if gpio input gpio@71_4; then " \ | |
93 | "bootm 0x1700000#sfp; " \ | |
94 | "else " \ | |
95 | "bootm 0x1700000; " \ | |
96 | "fi; " \ | |
97 | "bootz 0x1000000" | |
98 | ||
b6ee860b MB |
99 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
100 | RELOCATION_LIMITS_ENV_SETTINGS \ | |
101 | LOAD_ADDRESS_ENV_SETTINGS \ | |
102 | "fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \ | |
103 | "console=ttyS0,115200\0" \ | |
176c3e77 | 104 | "bootcmd_rescue=" TURRIS_OMNIA_BOOTCMD_RESCUE "\0" \ |
b6ee860b MB |
105 | BOOTENV |
106 | ||
107 | #endif /* CONFIG_SPL_BUILD */ | |
108 | ||
109 | #endif /* _CONFIG_TURRIS_OMNIA_H */ |