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_SIZE (64 << 10) /* 64KiB */ |
Marek Behún | d3c9239 | 2019-05-24 14:57:50 +0200 | [diff] [blame] | 26 | #define CONFIG_ENV_OFFSET ((1 << 20) - CONFIG_ENV_SIZE) |
| 27 | #define CONFIG_ENV_SECT_SIZE (64 << 10) /* 64KiB */ |
Marek Behún | 09e16b8 | 2017-06-09 19:28:45 +0200 | [diff] [blame] | 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 | |
Marek Behún | 09e16b8 | 2017-06-09 19:28:45 +0200 | [diff] [blame] | 31 | /* Keep device tree and initrd in lower memory so the kernel can access them */ |
| 32 | #define RELOCATION_LIMITS_ENV_SETTINGS \ |
| 33 | "fdt_high=0x10000000\0" \ |
| 34 | "initrd_high=0x10000000\0" |
| 35 | |
| 36 | /* Defines for SPL */ |
Marek Behún | 09e16b8 | 2017-06-09 19:28:45 +0200 | [diff] [blame] | 37 | #define CONFIG_SPL_SIZE (140 << 10) |
Marek Behún | 09e16b8 | 2017-06-09 19:28:45 +0200 | [diff] [blame] | 38 | #define CONFIG_SPL_MAX_SIZE (CONFIG_SPL_SIZE - 0x0030) |
| 39 | |
| 40 | #define CONFIG_SPL_BSS_START_ADDR (0x40000000 + CONFIG_SPL_SIZE) |
| 41 | #define CONFIG_SPL_BSS_MAX_SIZE (16 << 10) |
| 42 | |
| 43 | #ifdef CONFIG_SPL_BUILD |
| 44 | #define CONFIG_SYS_MALLOC_SIMPLE |
| 45 | #endif |
| 46 | |
| 47 | #define CONFIG_SPL_STACK (0x40000000 + ((192 - 16) << 10)) |
| 48 | #define CONFIG_SPL_BOOTROM_SAVE (CONFIG_SPL_STACK + 4) |
| 49 | #define CONFIG_SPL_DRIVERS_MISC_SUPPORT |
| 50 | |
Baruch Siach | 8d196a4 | 2018-06-18 21:56:24 +0300 | [diff] [blame] | 51 | #ifdef CONFIG_MVEBU_SPL_BOOT_DEVICE_SPI |
Marek Behún | 09e16b8 | 2017-06-09 19:28:45 +0200 | [diff] [blame] | 52 | /* SPL related SPI defines */ |
Marek Behún | 09e16b8 | 2017-06-09 19:28:45 +0200 | [diff] [blame] | 53 | # define CONFIG_SYS_SPI_U_BOOT_OFFS 0x24000 |
| 54 | # define CONFIG_SYS_U_BOOT_OFFS CONFIG_SYS_SPI_U_BOOT_OFFS |
| 55 | #endif |
| 56 | |
Baruch Siach | 8d196a4 | 2018-06-18 21:56:24 +0300 | [diff] [blame] | 57 | #ifdef CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC |
Marek Behún | 09e16b8 | 2017-06-09 19:28:45 +0200 | [diff] [blame] | 58 | /* SPL related MMC defines */ |
| 59 | # define CONFIG_SYS_MMC_U_BOOT_OFFS (160 << 10) |
| 60 | # define CONFIG_SYS_U_BOOT_OFFS CONFIG_SYS_MMC_U_BOOT_OFFS |
| 61 | # ifdef CONFIG_SPL_BUILD |
| 62 | # define CONFIG_FIXED_SDHCI_ALIGNED_BUFFER 0x00180000 /* in SDRAM */ |
| 63 | # endif |
| 64 | #endif |
| 65 | |
| 66 | /* |
| 67 | * mv-common.h should be defined after CMD configs since it used them |
| 68 | * to enable certain macros |
| 69 | */ |
| 70 | #include "mv-common.h" |
| 71 | |
| 72 | /* Include the common distro boot environment */ |
| 73 | #ifndef CONFIG_SPL_BUILD |
Marek Behún | 09e16b8 | 2017-06-09 19:28:45 +0200 | [diff] [blame] | 74 | |
| 75 | #ifdef CONFIG_MMC |
| 76 | #define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0) |
| 77 | #else |
| 78 | #define BOOT_TARGET_DEVICES_MMC(func) |
| 79 | #endif |
| 80 | |
| 81 | #ifdef CONFIG_USB_STORAGE |
| 82 | #define BOOT_TARGET_DEVICES_USB(func) func(USB, usb, 0) |
| 83 | #else |
| 84 | #define BOOT_TARGET_DEVICES_USB(func) |
| 85 | #endif |
| 86 | |
Marek Behún | bd2ab87 | 2019-05-02 16:53:29 +0200 | [diff] [blame] | 87 | #ifdef CONFIG_SCSI |
| 88 | #define BOOT_TARGET_DEVICES_SCSI(func) func(SCSI, scsi, 0) |
| 89 | #else |
| 90 | #define BOOT_TARGET_DEVICES_SCSI(func) |
| 91 | #endif |
| 92 | |
Marek Behún | 09e16b8 | 2017-06-09 19:28:45 +0200 | [diff] [blame] | 93 | #define BOOT_TARGET_DEVICES(func) \ |
| 94 | BOOT_TARGET_DEVICES_MMC(func) \ |
Marek Behún | bd2ab87 | 2019-05-02 16:53:29 +0200 | [diff] [blame] | 95 | BOOT_TARGET_DEVICES_SCSI(func) \ |
Marek Behún | 8d3c06f | 2019-05-24 14:57:52 +0200 | [diff] [blame^] | 96 | BOOT_TARGET_DEVICES_USB(func) \ |
Marek Behún | 09e16b8 | 2017-06-09 19:28:45 +0200 | [diff] [blame] | 97 | func(PXE, pxe, na) \ |
| 98 | func(DHCP, dhcp, na) |
| 99 | |
| 100 | #define KERNEL_ADDR_R __stringify(0x1000000) |
| 101 | #define FDT_ADDR_R __stringify(0x2000000) |
| 102 | #define RAMDISK_ADDR_R __stringify(0x2200000) |
| 103 | #define SCRIPT_ADDR_R __stringify(0x1800000) |
| 104 | #define PXEFILE_ADDR_R __stringify(0x1900000) |
| 105 | |
| 106 | #define LOAD_ADDRESS_ENV_SETTINGS \ |
| 107 | "kernel_addr_r=" KERNEL_ADDR_R "\0" \ |
| 108 | "fdt_addr_r=" FDT_ADDR_R "\0" \ |
| 109 | "ramdisk_addr_r=" RAMDISK_ADDR_R "\0" \ |
| 110 | "scriptaddr=" SCRIPT_ADDR_R "\0" \ |
| 111 | "pxefile_addr_r=" PXEFILE_ADDR_R "\0" |
| 112 | |
| 113 | #include <config_distro_bootcmd.h> |
| 114 | |
| 115 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 116 | RELOCATION_LIMITS_ENV_SETTINGS \ |
| 117 | LOAD_ADDRESS_ENV_SETTINGS \ |
| 118 | "fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \ |
| 119 | "console=ttyS0,115200\0" \ |
Marek Behún | b59ca00 | 2019-05-24 14:57:48 +0200 | [diff] [blame] | 120 | "ethact=ethernet@34000\0" \ |
Marek Behún | 09e16b8 | 2017-06-09 19:28:45 +0200 | [diff] [blame] | 121 | BOOTENV |
| 122 | |
| 123 | #endif /* CONFIG_SPL_BUILD */ |
| 124 | |
| 125 | #endif /* _CONFIG_TURRIS_OMNIA_H */ |