Dennis Gilmore | 77c3940 | 2018-06-11 19:39:53 -0500 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
| 2 | /* |
| 3 | * Copyright (C) 2018 Dennis Gilmore <dgilmore@redhat.com> |
| 4 | */ |
| 5 | |
| 6 | #ifndef _CONFIG_HELIOS4_H |
| 7 | #define _CONFIG_HELIOS4_H |
| 8 | |
Aditya Prayoga | cc65066 | 2018-12-05 00:57:24 +0800 | [diff] [blame] | 9 | #include <linux/sizes.h> |
| 10 | |
Dennis Gilmore | 77c3940 | 2018-06-11 19:39:53 -0500 | [diff] [blame] | 11 | /* |
| 12 | * High Level Configuration Options (easy to change) |
| 13 | */ |
| 14 | |
| 15 | /* |
| 16 | * TEXT_BASE needs to be below 16MiB, since this area is scrubbed |
| 17 | * for DDR ECC byte filling in the SPL before loading the main |
| 18 | * U-Boot into it. |
| 19 | */ |
| 20 | #define CONFIG_SYS_TCLK 250000000 /* 250MHz */ |
| 21 | |
| 22 | /* |
| 23 | * Commands configuration |
| 24 | */ |
| 25 | |
Dennis Gilmore | 77c3940 | 2018-06-11 19:39:53 -0500 | [diff] [blame] | 26 | /* |
| 27 | * SDIO/MMC Card Configuration |
| 28 | */ |
| 29 | #define CONFIG_SYS_MMC_BASE MVEBU_SDIO_BASE |
| 30 | |
| 31 | /* USB/EHCI configuration */ |
| 32 | #define CONFIG_EHCI_IS_TDI |
| 33 | |
| 34 | #define CONFIG_ENV_MIN_ENTRIES 128 |
| 35 | |
| 36 | /* |
| 37 | * SATA/SCSI/AHCI configuration |
| 38 | */ |
| 39 | #define CONFIG_SCSI_AHCI_PLAT |
| 40 | #define CONFIG_SYS_SCSI_MAX_SCSI_ID 2 |
| 41 | #define CONFIG_SYS_SCSI_MAX_LUN 2 |
| 42 | #define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \ |
| 43 | CONFIG_SYS_SCSI_MAX_LUN) |
| 44 | |
Aditya Prayoga | cc65066 | 2018-12-05 00:57:24 +0800 | [diff] [blame] | 45 | #ifdef CONFIG_MVEBU_SPL_BOOT_DEVICE_SPI |
Aditya Prayoga | cc65066 | 2018-12-05 00:57:24 +0800 | [diff] [blame] | 46 | /* Environment in SPI NOR flash */ |
Aditya Prayoga | cc65066 | 2018-12-05 00:57:24 +0800 | [diff] [blame] | 47 | #endif |
| 48 | |
| 49 | #ifdef CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC |
Dennis Gilmore | 77c3940 | 2018-06-11 19:39:53 -0500 | [diff] [blame] | 50 | /* Environment in MMC */ |
| 51 | #define CONFIG_SYS_MMC_ENV_DEV 0 |
Aditya Prayoga | d88b2ed | 2018-12-05 00:57:20 +0800 | [diff] [blame] | 52 | /* stay within first 1M */ |
Aditya Prayoga | cc65066 | 2018-12-05 00:57:24 +0800 | [diff] [blame] | 53 | #endif |
Dennis Gilmore | 77c3940 | 2018-06-11 19:39:53 -0500 | [diff] [blame] | 54 | |
| 55 | #define CONFIG_PHY_MARVELL /* there is a marvell phy */ |
| 56 | #define PHY_ANEG_TIMEOUT 8000 /* PHY needs a longer aneg time */ |
| 57 | |
Dennis Gilmore | 77c3940 | 2018-06-11 19:39:53 -0500 | [diff] [blame] | 58 | /* Keep device tree and initrd in lower memory so the kernel can access them */ |
| 59 | #define RELOCATION_LIMITS_ENV_SETTINGS \ |
| 60 | "fdt_high=0x10000000\0" \ |
| 61 | "initrd_high=0x10000000\0" |
| 62 | |
| 63 | /* SPL */ |
| 64 | /* |
| 65 | * Select the boot device here |
| 66 | * |
| 67 | * Currently supported are: |
| 68 | * SPL_BOOT_SPI_NOR_FLASH - Booting via SPI NOR flash |
| 69 | * SPL_BOOT_SDIO_MMC_CARD - Booting via SDIO/MMC card (partition 1) |
| 70 | */ |
| 71 | #define SPL_BOOT_SPI_NOR_FLASH 1 |
| 72 | #define SPL_BOOT_SDIO_MMC_CARD 2 |
Aditya Prayoga | cc65066 | 2018-12-05 00:57:24 +0800 | [diff] [blame] | 73 | |
| 74 | #ifdef CONFIG_MVEBU_SPL_BOOT_DEVICE_SPI |
| 75 | #define CONFIG_SPL_BOOT_DEVICE SPL_BOOT_SPI_NOR_FLASH |
| 76 | #endif |
| 77 | #ifdef CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC |
Dennis Gilmore | 77c3940 | 2018-06-11 19:39:53 -0500 | [diff] [blame] | 78 | #define CONFIG_SPL_BOOT_DEVICE SPL_BOOT_SDIO_MMC_CARD |
Aditya Prayoga | cc65066 | 2018-12-05 00:57:24 +0800 | [diff] [blame] | 79 | #endif |
Dennis Gilmore | 77c3940 | 2018-06-11 19:39:53 -0500 | [diff] [blame] | 80 | |
| 81 | /* Defines for SPL */ |
| 82 | #define CONFIG_SPL_SIZE (140 << 10) |
Dennis Gilmore | 77c3940 | 2018-06-11 19:39:53 -0500 | [diff] [blame] | 83 | #define CONFIG_SPL_MAX_SIZE (CONFIG_SPL_SIZE - 0x0030) |
| 84 | |
| 85 | #define CONFIG_SPL_BSS_START_ADDR (0x40000000 + CONFIG_SPL_SIZE) |
| 86 | #define CONFIG_SPL_BSS_MAX_SIZE (16 << 10) |
| 87 | |
| 88 | #ifdef CONFIG_SPL_BUILD |
| 89 | #define CONFIG_SYS_MALLOC_SIMPLE |
| 90 | #endif |
| 91 | |
| 92 | #define CONFIG_SPL_STACK (0x40000000 + ((192 - 16) << 10)) |
| 93 | #define CONFIG_SPL_BOOTROM_SAVE (CONFIG_SPL_STACK + 4) |
| 94 | |
| 95 | #if CONFIG_SPL_BOOT_DEVICE == SPL_BOOT_SPI_NOR_FLASH |
| 96 | /* SPL related SPI defines */ |
Aditya Prayoga | cc65066 | 2018-12-05 00:57:24 +0800 | [diff] [blame] | 97 | #define CONFIG_SPL_SPI_FLASH_SUPPORT |
| 98 | #define CONFIG_SPL_SPI_LOAD |
| 99 | #define CONFIG_SPL_SPI_SUPPORT |
Dennis Gilmore | 77c3940 | 2018-06-11 19:39:53 -0500 | [diff] [blame] | 100 | #define CONFIG_SYS_U_BOOT_OFFS CONFIG_SYS_SPI_U_BOOT_OFFS |
| 101 | #endif |
| 102 | |
| 103 | #if CONFIG_SPL_BOOT_DEVICE == SPL_BOOT_SDIO_MMC_CARD |
| 104 | /* SPL related MMC defines */ |
Aditya Prayoga | cc65066 | 2018-12-05 00:57:24 +0800 | [diff] [blame] | 105 | #define CONFIG_SPL_MMC_SUPPORT |
Dennis Gilmore | 77c3940 | 2018-06-11 19:39:53 -0500 | [diff] [blame] | 106 | #define CONFIG_SYS_MMC_U_BOOT_OFFS (160 << 10) |
| 107 | #define CONFIG_SYS_U_BOOT_OFFS CONFIG_SYS_MMC_U_BOOT_OFFS |
| 108 | #ifdef CONFIG_SPL_BUILD |
| 109 | #define CONFIG_FIXED_SDHCI_ALIGNED_BUFFER 0x00180000 /* in SDRAM */ |
| 110 | #endif |
| 111 | #endif |
| 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 |
| 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 | #ifdef CONFIG_SATA |
| 134 | #define BOOT_TARGET_DEVICES_SATA(func) func(SATA, sata, 0) |
| 135 | #else |
| 136 | #define BOOT_TARGET_DEVICES_SATA(func) |
| 137 | #endif |
| 138 | |
| 139 | #define BOOT_TARGET_DEVICES(func) \ |
| 140 | BOOT_TARGET_DEVICES_MMC(func) \ |
| 141 | BOOT_TARGET_DEVICES_USB(func) \ |
| 142 | BOOT_TARGET_DEVICES_SATA(func) \ |
| 143 | func(PXE, pxe, na) \ |
| 144 | func(DHCP, dhcp, na) |
| 145 | |
| 146 | #define KERNEL_ADDR_R __stringify(0x800000) |
| 147 | #define FDT_ADDR_R __stringify(0x100000) |
| 148 | #define RAMDISK_ADDR_R __stringify(0x1800000) |
| 149 | #define SCRIPT_ADDR_R __stringify(0x200000) |
| 150 | #define PXEFILE_ADDR_R __stringify(0x300000) |
| 151 | |
| 152 | #define LOAD_ADDRESS_ENV_SETTINGS \ |
| 153 | "kernel_addr_r=" KERNEL_ADDR_R "\0" \ |
| 154 | "fdt_addr_r=" FDT_ADDR_R "\0" \ |
| 155 | "ramdisk_addr_r=" RAMDISK_ADDR_R "\0" \ |
| 156 | "scriptaddr=" SCRIPT_ADDR_R "\0" \ |
| 157 | "pxefile_addr_r=" PXEFILE_ADDR_R "\0" |
| 158 | |
| 159 | #include <config_distro_bootcmd.h> |
| 160 | |
| 161 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 162 | RELOCATION_LIMITS_ENV_SETTINGS \ |
| 163 | LOAD_ADDRESS_ENV_SETTINGS \ |
| 164 | "fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \ |
| 165 | "console=ttyS0,115200\0" \ |
| 166 | BOOTENV |
| 167 | |
| 168 | #endif /* CONFIG_SPL_BUILD */ |
| 169 | |
| 170 | #endif /* _CONFIG_HELIOS4_H */ |