Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Marek Behún | 09e16b8 | 2017-06-09 19:28:45 +0200 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2017 Marek Behun <marek.behun@nic.cz> |
| 4 | * Copyright (C) 2016 Tomas Hlavacek <tomas.hlavacek@nic.cz> |
Marek Behún | 09e16b8 | 2017-06-09 19:28:45 +0200 | [diff] [blame] | 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 | |
Marek Behún | 09e16b8 | 2017-06-09 19:28:45 +0200 | [diff] [blame] | 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 | */ |
Marek Behún | 09e16b8 | 2017-06-09 19:28:45 +0200 | [diff] [blame] | 19 | #define CONFIG_SYS_TCLK 250000000 /* 250MHz */ |
| 20 | |
Marek Behún | 09e16b8 | 2017-06-09 19:28:45 +0200 | [diff] [blame] | 21 | /* USB/EHCI configuration */ |
| 22 | #define CONFIG_EHCI_IS_TDI |
| 23 | |
| 24 | /* Environment in SPI NOR flash */ |
Marek Behún | 09e16b8 | 2017-06-09 19:28:45 +0200 | [diff] [blame] | 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 | |
Marek Behún | 09e16b8 | 2017-06-09 19:28:45 +0200 | [diff] [blame] | 29 | #define PHY_ANEG_TIMEOUT 8000 /* PHY needs a longer aneg time */ |
| 30 | |
| 31 | /* PCIe support */ |
| 32 | #ifndef CONFIG_SPL_BUILD |
Marek Behún | 09e16b8 | 2017-06-09 19:28:45 +0200 | [diff] [blame] | 33 | #define CONFIG_PCI_SCAN_SHOW |
| 34 | #endif |
| 35 | |
Marek Behún | 09e16b8 | 2017-06-09 19:28:45 +0200 | [diff] [blame] | 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 */ |
Marek Behún | 09e16b8 | 2017-06-09 19:28:45 +0200 | [diff] [blame] | 42 | #define CONFIG_SPL_SIZE (140 << 10) |
Marek Behún | 09e16b8 | 2017-06-09 19:28:45 +0200 | [diff] [blame] | 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 | |
Baruch Siach | 8d196a4 | 2018-06-18 21:56:24 +0300 | [diff] [blame] | 56 | #ifdef CONFIG_MVEBU_SPL_BOOT_DEVICE_SPI |
Marek Behún | 09e16b8 | 2017-06-09 19:28:45 +0200 | [diff] [blame] | 57 | /* SPL related SPI defines */ |
Marek Behún | 09e16b8 | 2017-06-09 19:28:45 +0200 | [diff] [blame] | 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 | |
Baruch Siach | 8d196a4 | 2018-06-18 21:56:24 +0300 | [diff] [blame] | 62 | #ifdef CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC |
Marek Behún | 09e16b8 | 2017-06-09 19:28:45 +0200 | [diff] [blame] | 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 |
Marek Behún | 09e16b8 | 2017-06-09 19:28:45 +0200 | [diff] [blame] | 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 | |
Marek Behún | bd2ab87 | 2019-05-02 16:53:29 +0200 | [diff] [blame] | 92 | #ifdef CONFIG_SCSI |
| 93 | #define BOOT_TARGET_DEVICES_SCSI(func) func(SCSI, scsi, 0) |
| 94 | #else |
| 95 | #define BOOT_TARGET_DEVICES_SCSI(func) |
| 96 | #endif |
| 97 | |
Marek Behún | 09e16b8 | 2017-06-09 19:28:45 +0200 | [diff] [blame] | 98 | #define BOOT_TARGET_DEVICES(func) \ |
| 99 | BOOT_TARGET_DEVICES_MMC(func) \ |
| 100 | BOOT_TARGET_DEVICES_USB(func) \ |
Marek Behún | bd2ab87 | 2019-05-02 16:53:29 +0200 | [diff] [blame] | 101 | BOOT_TARGET_DEVICES_SCSI(func) \ |
Marek Behún | 09e16b8 | 2017-06-09 19:28:45 +0200 | [diff] [blame] | 102 | func(PXE, pxe, na) \ |
| 103 | func(DHCP, dhcp, na) |
| 104 | |
| 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) |
| 110 | |
| 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" |
| 117 | |
| 118 | #include <config_distro_bootcmd.h> |
| 119 | |
| 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" \ |
Marek Behún | b59ca00 | 2019-05-24 14:57:48 +0200 | [diff] [blame^] | 125 | "ethact=ethernet@34000\0" \ |
Marek Behún | 09e16b8 | 2017-06-09 19:28:45 +0200 | [diff] [blame] | 126 | BOOTENV |
| 127 | |
| 128 | #endif /* CONFIG_SPL_BUILD */ |
| 129 | |
| 130 | #endif /* _CONFIG_TURRIS_OMNIA_H */ |