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> |
Simon Glass | fb64e36 | 2020-05-10 11:40:09 -0600 | [diff] [blame] | 10 | #include <linux/stringify.h> |
Aditya Prayoga | cc65066 | 2018-12-05 00:57:24 +0800 | [diff] [blame] | 11 | |
Dennis Gilmore | 77c3940 | 2018-06-11 19:39:53 -0500 | [diff] [blame] | 12 | /* |
| 13 | * High Level Configuration Options (easy to change) |
| 14 | */ |
| 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 | */ |
| 21 | #define CONFIG_SYS_TCLK 250000000 /* 250MHz */ |
| 22 | |
| 23 | /* |
Dennis Gilmore | 77c3940 | 2018-06-11 19:39:53 -0500 | [diff] [blame] | 24 | * SDIO/MMC Card Configuration |
| 25 | */ |
| 26 | #define CONFIG_SYS_MMC_BASE MVEBU_SDIO_BASE |
| 27 | |
| 28 | /* USB/EHCI configuration */ |
| 29 | #define CONFIG_EHCI_IS_TDI |
| 30 | |
| 31 | #define CONFIG_ENV_MIN_ENTRIES 128 |
| 32 | |
| 33 | /* |
| 34 | * SATA/SCSI/AHCI configuration |
| 35 | */ |
| 36 | #define CONFIG_SCSI_AHCI_PLAT |
| 37 | #define CONFIG_SYS_SCSI_MAX_SCSI_ID 2 |
| 38 | #define CONFIG_SYS_SCSI_MAX_LUN 2 |
| 39 | #define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \ |
| 40 | CONFIG_SYS_SCSI_MAX_LUN) |
| 41 | |
Aditya Prayoga | cc65066 | 2018-12-05 00:57:24 +0800 | [diff] [blame] | 42 | #ifdef CONFIG_MVEBU_SPL_BOOT_DEVICE_SPI |
Aditya Prayoga | cc65066 | 2018-12-05 00:57:24 +0800 | [diff] [blame] | 43 | /* Environment in SPI NOR flash */ |
Aditya Prayoga | cc65066 | 2018-12-05 00:57:24 +0800 | [diff] [blame] | 44 | #endif |
| 45 | |
| 46 | #ifdef CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC |
Dennis Gilmore | 77c3940 | 2018-06-11 19:39:53 -0500 | [diff] [blame] | 47 | /* Environment in MMC */ |
| 48 | #define CONFIG_SYS_MMC_ENV_DEV 0 |
Aditya Prayoga | d88b2ed | 2018-12-05 00:57:20 +0800 | [diff] [blame] | 49 | /* stay within first 1M */ |
Aditya Prayoga | cc65066 | 2018-12-05 00:57:24 +0800 | [diff] [blame] | 50 | #endif |
Dennis Gilmore | 77c3940 | 2018-06-11 19:39:53 -0500 | [diff] [blame] | 51 | |
Dennis Gilmore | 77c3940 | 2018-06-11 19:39:53 -0500 | [diff] [blame] | 52 | #define PHY_ANEG_TIMEOUT 8000 /* PHY needs a longer aneg time */ |
| 53 | |
Dennis Gilmore | 77c3940 | 2018-06-11 19:39:53 -0500 | [diff] [blame] | 54 | /* Keep device tree and initrd in lower memory so the kernel can access them */ |
| 55 | #define RELOCATION_LIMITS_ENV_SETTINGS \ |
| 56 | "fdt_high=0x10000000\0" \ |
| 57 | "initrd_high=0x10000000\0" |
| 58 | |
| 59 | /* SPL */ |
| 60 | /* |
| 61 | * Select the boot device here |
| 62 | * |
| 63 | * Currently supported are: |
| 64 | * SPL_BOOT_SPI_NOR_FLASH - Booting via SPI NOR flash |
| 65 | * SPL_BOOT_SDIO_MMC_CARD - Booting via SDIO/MMC card (partition 1) |
| 66 | */ |
| 67 | #define SPL_BOOT_SPI_NOR_FLASH 1 |
| 68 | #define SPL_BOOT_SDIO_MMC_CARD 2 |
Aditya Prayoga | cc65066 | 2018-12-05 00:57:24 +0800 | [diff] [blame] | 69 | |
| 70 | #ifdef CONFIG_MVEBU_SPL_BOOT_DEVICE_SPI |
| 71 | #define CONFIG_SPL_BOOT_DEVICE SPL_BOOT_SPI_NOR_FLASH |
| 72 | #endif |
| 73 | #ifdef CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC |
Dennis Gilmore | 77c3940 | 2018-06-11 19:39:53 -0500 | [diff] [blame] | 74 | #define CONFIG_SPL_BOOT_DEVICE SPL_BOOT_SDIO_MMC_CARD |
Aditya Prayoga | cc65066 | 2018-12-05 00:57:24 +0800 | [diff] [blame] | 75 | #endif |
Dennis Gilmore | 77c3940 | 2018-06-11 19:39:53 -0500 | [diff] [blame] | 76 | |
| 77 | /* Defines for SPL */ |
| 78 | #define CONFIG_SPL_SIZE (140 << 10) |
Dennis Gilmore | 77c3940 | 2018-06-11 19:39:53 -0500 | [diff] [blame] | 79 | #define CONFIG_SPL_MAX_SIZE (CONFIG_SPL_SIZE - 0x0030) |
| 80 | |
| 81 | #define CONFIG_SPL_BSS_START_ADDR (0x40000000 + CONFIG_SPL_SIZE) |
| 82 | #define CONFIG_SPL_BSS_MAX_SIZE (16 << 10) |
| 83 | |
| 84 | #ifdef CONFIG_SPL_BUILD |
| 85 | #define CONFIG_SYS_MALLOC_SIMPLE |
| 86 | #endif |
| 87 | |
| 88 | #define CONFIG_SPL_STACK (0x40000000 + ((192 - 16) << 10)) |
| 89 | #define CONFIG_SPL_BOOTROM_SAVE (CONFIG_SPL_STACK + 4) |
| 90 | |
| 91 | #if CONFIG_SPL_BOOT_DEVICE == SPL_BOOT_SPI_NOR_FLASH |
Dennis Gilmore | 77c3940 | 2018-06-11 19:39:53 -0500 | [diff] [blame] | 92 | #define CONFIG_SYS_U_BOOT_OFFS CONFIG_SYS_SPI_U_BOOT_OFFS |
| 93 | #endif |
| 94 | |
| 95 | #if CONFIG_SPL_BOOT_DEVICE == SPL_BOOT_SDIO_MMC_CARD |
| 96 | /* SPL related MMC defines */ |
Dennis Gilmore | 77c3940 | 2018-06-11 19:39:53 -0500 | [diff] [blame] | 97 | #define CONFIG_SYS_MMC_U_BOOT_OFFS (160 << 10) |
| 98 | #define CONFIG_SYS_U_BOOT_OFFS CONFIG_SYS_MMC_U_BOOT_OFFS |
| 99 | #ifdef CONFIG_SPL_BUILD |
| 100 | #define CONFIG_FIXED_SDHCI_ALIGNED_BUFFER 0x00180000 /* in SDRAM */ |
| 101 | #endif |
| 102 | #endif |
| 103 | /* |
| 104 | * mv-common.h should be defined after CMD configs since it used them |
| 105 | * to enable certain macros |
| 106 | */ |
| 107 | #include "mv-common.h" |
| 108 | |
| 109 | /* Include the common distro boot environment */ |
| 110 | #ifndef CONFIG_SPL_BUILD |
| 111 | |
| 112 | #ifdef CONFIG_MMC |
| 113 | #define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0) |
| 114 | #else |
| 115 | #define BOOT_TARGET_DEVICES_MMC(func) |
| 116 | #endif |
| 117 | |
| 118 | #ifdef CONFIG_USB_STORAGE |
| 119 | #define BOOT_TARGET_DEVICES_USB(func) func(USB, usb, 0) |
| 120 | #else |
| 121 | #define BOOT_TARGET_DEVICES_USB(func) |
| 122 | #endif |
| 123 | |
| 124 | #ifdef CONFIG_SATA |
| 125 | #define BOOT_TARGET_DEVICES_SATA(func) func(SATA, sata, 0) |
| 126 | #else |
| 127 | #define BOOT_TARGET_DEVICES_SATA(func) |
| 128 | #endif |
| 129 | |
| 130 | #define BOOT_TARGET_DEVICES(func) \ |
| 131 | BOOT_TARGET_DEVICES_MMC(func) \ |
| 132 | BOOT_TARGET_DEVICES_USB(func) \ |
| 133 | BOOT_TARGET_DEVICES_SATA(func) \ |
| 134 | func(PXE, pxe, na) \ |
| 135 | func(DHCP, dhcp, na) |
| 136 | |
| 137 | #define KERNEL_ADDR_R __stringify(0x800000) |
| 138 | #define FDT_ADDR_R __stringify(0x100000) |
| 139 | #define RAMDISK_ADDR_R __stringify(0x1800000) |
| 140 | #define SCRIPT_ADDR_R __stringify(0x200000) |
| 141 | #define PXEFILE_ADDR_R __stringify(0x300000) |
| 142 | |
| 143 | #define LOAD_ADDRESS_ENV_SETTINGS \ |
| 144 | "kernel_addr_r=" KERNEL_ADDR_R "\0" \ |
| 145 | "fdt_addr_r=" FDT_ADDR_R "\0" \ |
| 146 | "ramdisk_addr_r=" RAMDISK_ADDR_R "\0" \ |
| 147 | "scriptaddr=" SCRIPT_ADDR_R "\0" \ |
| 148 | "pxefile_addr_r=" PXEFILE_ADDR_R "\0" |
| 149 | |
| 150 | #include <config_distro_bootcmd.h> |
| 151 | |
| 152 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 153 | RELOCATION_LIMITS_ENV_SETTINGS \ |
| 154 | LOAD_ADDRESS_ENV_SETTINGS \ |
| 155 | "fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \ |
| 156 | "console=ttyS0,115200\0" \ |
| 157 | BOOTENV |
| 158 | |
| 159 | #endif /* CONFIG_SPL_BUILD */ |
| 160 | |
| 161 | #endif /* _CONFIG_HELIOS4_H */ |