arm: mvebu: turris_omnia: move I2C dependencies to Kconfig
[platform/kernel/u-boot.git] / include / configs / turris_omnia.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright (C) 2017 Marek Behun <marek.behun@nic.cz>
4  * Copyright (C) 2016 Tomas Hlavacek <tomas.hlavacek@nic.cz>
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 /*
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  */
19 #define CONFIG_SYS_TCLK         250000000       /* 250MHz */
20
21 /* USB/EHCI configuration */
22 #define CONFIG_EHCI_IS_TDI
23
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 */
28
29 #define PHY_ANEG_TIMEOUT        8000    /* PHY needs a longer aneg time */
30
31 /* PCIe support */
32 #ifndef CONFIG_SPL_BUILD
33 #define CONFIG_PCI_SCAN_SHOW
34 #endif
35
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"
40
41 /* Defines for SPL */
42 #define CONFIG_SPL_SIZE                 (140 << 10)
43 #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
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
60 #endif
61
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 */
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
79
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
92 #define BOOT_TARGET_DEVICES(func) \
93         BOOT_TARGET_DEVICES_MMC(func) \
94         BOOT_TARGET_DEVICES_USB(func) \
95         func(PXE, pxe, na) \
96         func(DHCP, dhcp, na)
97
98 #define KERNEL_ADDR_R   __stringify(0x1000000)
99 #define FDT_ADDR_R      __stringify(0x2000000)
100 #define RAMDISK_ADDR_R  __stringify(0x2200000)
101 #define SCRIPT_ADDR_R   __stringify(0x1800000)
102 #define PXEFILE_ADDR_R  __stringify(0x1900000)
103
104 #define LOAD_ADDRESS_ENV_SETTINGS \
105         "kernel_addr_r=" KERNEL_ADDR_R "\0" \
106         "fdt_addr_r=" FDT_ADDR_R "\0" \
107         "ramdisk_addr_r=" RAMDISK_ADDR_R "\0" \
108         "scriptaddr=" SCRIPT_ADDR_R "\0" \
109         "pxefile_addr_r=" PXEFILE_ADDR_R "\0"
110
111 #include <config_distro_bootcmd.h>
112
113 #define CONFIG_EXTRA_ENV_SETTINGS \
114         RELOCATION_LIMITS_ENV_SETTINGS \
115         LOAD_ADDRESS_ENV_SETTINGS \
116         "fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
117         "console=ttyS0,115200\0" \
118         BOOTENV
119
120 #endif /* CONFIG_SPL_BUILD */
121
122 #endif /* _CONFIG_TURRIS_OMNIA_H */