]>
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 | ||
14 | #define CONFIG_MISC_INIT_R | |
b6ee860b MB |
15 | |
16 | /* | |
17 | * TEXT_BASE needs to be below 16MiB, since this area is scrubbed | |
18 | * for DDR ECC byte filling in the SPL before loading the main | |
19 | * U-Boot into it. | |
20 | */ | |
b6ee860b MB |
21 | #define CONFIG_SYS_TCLK 250000000 /* 250MHz */ |
22 | ||
23 | /* | |
24 | * Commands configuration | |
25 | */ | |
b6ee860b MB |
26 | |
27 | /* I2C support */ | |
28 | #define CONFIG_DM_I2C | |
29 | #define CONFIG_I2C_MUX | |
30 | #define CONFIG_I2C_MUX_PCA954x | |
31 | #define CONFIG_SPL_I2C_MUX | |
32 | #define CONFIG_SYS_I2C_MVTWSI | |
33 | ||
34 | /* Watchdog support */ | |
35 | #if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_WDT_ORION) | |
36 | # define CONFIG_WATCHDOG | |
37 | #endif | |
38 | ||
39 | /* SPI NOR flash default params, used by sf commands */ | |
40 | #define CONFIG_SF_DEFAULT_SPEED 1000000 | |
41 | #define CONFIG_SF_DEFAULT_MODE SPI_MODE_3 | |
42 | #define CONFIG_SPI_FLASH | |
43 | #define CONFIG_SPI_FLASH_SPANSION | |
44 | ||
45 | /* | |
46 | * SDIO/MMC Card Configuration | |
47 | */ | |
48 | #define CONFIG_SYS_MMC_BASE MVEBU_SDIO_BASE | |
49 | ||
50 | /* | |
51 | * SATA/SCSI/AHCI configuration | |
52 | */ | |
b6ee860b MB |
53 | #define CONFIG_SCSI_AHCI_PLAT |
54 | #define CONFIG_SYS_SCSI_MAX_SCSI_ID 2 | |
55 | #define CONFIG_SYS_SCSI_MAX_LUN 1 | |
56 | #define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \ | |
57 | CONFIG_SYS_SCSI_MAX_LUN) | |
58 | ||
b6ee860b MB |
59 | /* USB/EHCI configuration */ |
60 | #define CONFIG_EHCI_IS_TDI | |
61 | ||
62 | /* Environment in SPI NOR flash */ | |
b6ee860b MB |
63 | #define CONFIG_ENV_OFFSET (3*(1 << 18)) /* 768KiB in */ |
64 | #define CONFIG_ENV_SIZE (64 << 10) /* 64KiB */ | |
65 | #define CONFIG_ENV_SECT_SIZE (256 << 10) /* 256KiB sectors */ | |
66 | ||
67 | #define CONFIG_PHY_MARVELL /* there is a marvell phy */ | |
68 | #define PHY_ANEG_TIMEOUT 8000 /* PHY needs a longer aneg time */ | |
69 | ||
70 | /* PCIe support */ | |
71 | #ifndef CONFIG_SPL_BUILD | |
72 | #define CONFIG_PCI_MVEBU | |
73 | #define CONFIG_PCI_SCAN_SHOW | |
74 | #endif | |
75 | ||
b6ee860b MB |
76 | /* Keep device tree and initrd in lower memory so the kernel can access them */ |
77 | #define RELOCATION_LIMITS_ENV_SETTINGS \ | |
78 | "fdt_high=0x10000000\0" \ | |
79 | "initrd_high=0x10000000\0" | |
80 | ||
81 | /* Defines for SPL */ | |
b6ee860b MB |
82 | #define CONFIG_SPL_SIZE (140 << 10) |
83 | #define CONFIG_SPL_TEXT_BASE 0x40000030 | |
84 | #define CONFIG_SPL_MAX_SIZE (CONFIG_SPL_SIZE - 0x0030) | |
85 | ||
86 | #define CONFIG_SPL_BSS_START_ADDR (0x40000000 + CONFIG_SPL_SIZE) | |
87 | #define CONFIG_SPL_BSS_MAX_SIZE (16 << 10) | |
88 | ||
89 | #ifdef CONFIG_SPL_BUILD | |
90 | #define CONFIG_SYS_MALLOC_SIMPLE | |
91 | #endif | |
92 | ||
93 | #define CONFIG_SPL_STACK (0x40000000 + ((192 - 16) << 10)) | |
94 | #define CONFIG_SPL_BOOTROM_SAVE (CONFIG_SPL_STACK + 4) | |
95 | #define CONFIG_SPL_DRIVERS_MISC_SUPPORT | |
96 | ||
97 | #ifdef CONFIG_TURRIS_OMNIA_SPL_BOOT_DEVICE_SPI | |
98 | /* SPL related SPI defines */ | |
b6ee860b MB |
99 | # define CONFIG_SYS_SPI_U_BOOT_OFFS 0x24000 |
100 | # define CONFIG_SYS_U_BOOT_OFFS CONFIG_SYS_SPI_U_BOOT_OFFS | |
101 | #endif | |
102 | ||
103 | #ifdef CONFIG_TURRIS_OMNIA_SPL_BOOT_DEVICE_MMC | |
104 | /* SPL related MMC defines */ | |
105 | # define CONFIG_SYS_MMC_U_BOOT_OFFS (160 << 10) | |
106 | # define CONFIG_SYS_U_BOOT_OFFS CONFIG_SYS_MMC_U_BOOT_OFFS | |
107 | # ifdef CONFIG_SPL_BUILD | |
108 | # define CONFIG_FIXED_SDHCI_ALIGNED_BUFFER 0x00180000 /* in SDRAM */ | |
109 | # endif | |
110 | #endif | |
111 | ||
112 | /* | |
113 | * mv-common.h should be defined after CMD configs since it used them | |
114 | * to enable certain macros | |
115 | */ | |
116 | #include "mv-common.h" | |
117 | ||
118 | /* Include the common distro boot environment */ | |
119 | #ifndef CONFIG_SPL_BUILD | |
b6ee860b MB |
120 | |
121 | #ifdef CONFIG_MMC | |
122 | #define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0) | |
123 | #else | |
124 | #define BOOT_TARGET_DEVICES_MMC(func) | |
125 | #endif | |
126 | ||
127 | #ifdef CONFIG_USB_STORAGE | |
128 | #define BOOT_TARGET_DEVICES_USB(func) func(USB, usb, 0) | |
129 | #else | |
130 | #define BOOT_TARGET_DEVICES_USB(func) | |
131 | #endif | |
132 | ||
133 | #define BOOT_TARGET_DEVICES(func) \ | |
134 | BOOT_TARGET_DEVICES_MMC(func) \ | |
135 | BOOT_TARGET_DEVICES_USB(func) \ | |
136 | func(PXE, pxe, na) \ | |
137 | func(DHCP, dhcp, na) | |
138 | ||
139 | #define KERNEL_ADDR_R __stringify(0x1000000) | |
140 | #define FDT_ADDR_R __stringify(0x2000000) | |
141 | #define RAMDISK_ADDR_R __stringify(0x2200000) | |
142 | #define SCRIPT_ADDR_R __stringify(0x1800000) | |
143 | #define PXEFILE_ADDR_R __stringify(0x1900000) | |
144 | ||
145 | #define LOAD_ADDRESS_ENV_SETTINGS \ | |
146 | "kernel_addr_r=" KERNEL_ADDR_R "\0" \ | |
147 | "fdt_addr_r=" FDT_ADDR_R "\0" \ | |
148 | "ramdisk_addr_r=" RAMDISK_ADDR_R "\0" \ | |
149 | "scriptaddr=" SCRIPT_ADDR_R "\0" \ | |
150 | "pxefile_addr_r=" PXEFILE_ADDR_R "\0" | |
151 | ||
152 | #include <config_distro_bootcmd.h> | |
153 | ||
154 | #define CONFIG_EXTRA_ENV_SETTINGS \ | |
155 | RELOCATION_LIMITS_ENV_SETTINGS \ | |
156 | LOAD_ADDRESS_ENV_SETTINGS \ | |
157 | "fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \ | |
158 | "console=ttyS0,115200\0" \ | |
159 | BOOTENV | |
160 | ||
161 | #endif /* CONFIG_SPL_BUILD */ | |
162 | ||
163 | #endif /* _CONFIG_TURRIS_OMNIA_H */ |