1ae28a5f8SDennis Gilmore /* SPDX-License-Identifier: GPL-2.0+ */ 2ae28a5f8SDennis Gilmore /* 3ae28a5f8SDennis Gilmore * Copyright (C) 2018 Dennis Gilmore <dgilmore@redhat.com> 4ae28a5f8SDennis Gilmore */ 5ae28a5f8SDennis Gilmore 6ae28a5f8SDennis Gilmore #ifndef _CONFIG_HELIOS4_H 7ae28a5f8SDennis Gilmore #define _CONFIG_HELIOS4_H 8ae28a5f8SDennis Gilmore 98d7d97e2SAditya Prayoga #include <linux/sizes.h> 108d7d97e2SAditya Prayoga 11ae28a5f8SDennis Gilmore /* 12ae28a5f8SDennis Gilmore * High Level Configuration Options (easy to change) 13ae28a5f8SDennis Gilmore */ 14ae28a5f8SDennis Gilmore 15ae28a5f8SDennis Gilmore /* 16ae28a5f8SDennis Gilmore * TEXT_BASE needs to be below 16MiB, since this area is scrubbed 17ae28a5f8SDennis Gilmore * for DDR ECC byte filling in the SPL before loading the main 18ae28a5f8SDennis Gilmore * U-Boot into it. 19ae28a5f8SDennis Gilmore */ 20ae28a5f8SDennis Gilmore #define CONFIG_SYS_TCLK 250000000 /* 250MHz */ 21ae28a5f8SDennis Gilmore 22ae28a5f8SDennis Gilmore /* 23ae28a5f8SDennis Gilmore * Commands configuration 24ae28a5f8SDennis Gilmore */ 25ae28a5f8SDennis Gilmore 26ae28a5f8SDennis Gilmore /* SPI NOR flash default params, used by sf commands */ 27ae28a5f8SDennis Gilmore 28ae28a5f8SDennis Gilmore /* 29ae28a5f8SDennis Gilmore * SDIO/MMC Card Configuration 30ae28a5f8SDennis Gilmore */ 31ae28a5f8SDennis Gilmore #define CONFIG_SYS_MMC_BASE MVEBU_SDIO_BASE 32ae28a5f8SDennis Gilmore 33ae28a5f8SDennis Gilmore /* USB/EHCI configuration */ 34ae28a5f8SDennis Gilmore #define CONFIG_EHCI_IS_TDI 35ae28a5f8SDennis Gilmore 36ae28a5f8SDennis Gilmore #define CONFIG_ENV_MIN_ENTRIES 128 37ae28a5f8SDennis Gilmore 38ae28a5f8SDennis Gilmore /* 39ae28a5f8SDennis Gilmore * SATA/SCSI/AHCI configuration 40ae28a5f8SDennis Gilmore */ 41ae28a5f8SDennis Gilmore #define CONFIG_SCSI_AHCI_PLAT 42ae28a5f8SDennis Gilmore #define CONFIG_SYS_SCSI_MAX_SCSI_ID 2 43ae28a5f8SDennis Gilmore #define CONFIG_SYS_SCSI_MAX_LUN 2 44ae28a5f8SDennis Gilmore #define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \ 45ae28a5f8SDennis Gilmore CONFIG_SYS_SCSI_MAX_LUN) 46ae28a5f8SDennis Gilmore 478d7d97e2SAditya Prayoga #ifdef CONFIG_MVEBU_SPL_BOOT_DEVICE_SPI 488d7d97e2SAditya Prayoga /* Environment in SPI NOR flash */ 498d7d97e2SAditya Prayoga #define CONFIG_ENV_SECT_SIZE SZ_64K 508d7d97e2SAditya Prayoga #define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE 518d7d97e2SAditya Prayoga #define CONFIG_ENV_OFFSET SZ_1M 528d7d97e2SAditya Prayoga #endif 538d7d97e2SAditya Prayoga 548d7d97e2SAditya Prayoga #ifdef CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC 55ae28a5f8SDennis Gilmore /* Environment in MMC */ 56ae28a5f8SDennis Gilmore #define CONFIG_SYS_MMC_ENV_DEV 0 57ae28a5f8SDennis Gilmore #define CONFIG_ENV_SECT_SIZE 0x200 58a134d680SAditya Prayoga #define CONFIG_ENV_SIZE 0x2000 59a134d680SAditya Prayoga /* stay within first 1M */ 60a134d680SAditya Prayoga #define CONFIG_ENV_OFFSET (SZ_1M - CONFIG_ENV_SIZE) 61ae28a5f8SDennis Gilmore #define CONFIG_ENV_ADDR CONFIG_ENV_OFFSET 628d7d97e2SAditya Prayoga #endif 63ae28a5f8SDennis Gilmore 64ae28a5f8SDennis Gilmore #define CONFIG_PHY_MARVELL /* there is a marvell phy */ 65ae28a5f8SDennis Gilmore #define PHY_ANEG_TIMEOUT 8000 /* PHY needs a longer aneg time */ 66ae28a5f8SDennis Gilmore 67ae28a5f8SDennis Gilmore /* Keep device tree and initrd in lower memory so the kernel can access them */ 68ae28a5f8SDennis Gilmore #define RELOCATION_LIMITS_ENV_SETTINGS \ 69ae28a5f8SDennis Gilmore "fdt_high=0x10000000\0" \ 70ae28a5f8SDennis Gilmore "initrd_high=0x10000000\0" 71ae28a5f8SDennis Gilmore 72ae28a5f8SDennis Gilmore /* SPL */ 73ae28a5f8SDennis Gilmore /* 74ae28a5f8SDennis Gilmore * Select the boot device here 75ae28a5f8SDennis Gilmore * 76ae28a5f8SDennis Gilmore * Currently supported are: 77ae28a5f8SDennis Gilmore * SPL_BOOT_SPI_NOR_FLASH - Booting via SPI NOR flash 78ae28a5f8SDennis Gilmore * SPL_BOOT_SDIO_MMC_CARD - Booting via SDIO/MMC card (partition 1) 79ae28a5f8SDennis Gilmore */ 80ae28a5f8SDennis Gilmore #define SPL_BOOT_SPI_NOR_FLASH 1 81ae28a5f8SDennis Gilmore #define SPL_BOOT_SDIO_MMC_CARD 2 828d7d97e2SAditya Prayoga 838d7d97e2SAditya Prayoga #ifdef CONFIG_MVEBU_SPL_BOOT_DEVICE_SPI 848d7d97e2SAditya Prayoga #define CONFIG_SPL_BOOT_DEVICE SPL_BOOT_SPI_NOR_FLASH 858d7d97e2SAditya Prayoga #endif 868d7d97e2SAditya Prayoga #ifdef CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC 87ae28a5f8SDennis Gilmore #define CONFIG_SPL_BOOT_DEVICE SPL_BOOT_SDIO_MMC_CARD 888d7d97e2SAditya Prayoga #endif 89ae28a5f8SDennis Gilmore 90ae28a5f8SDennis Gilmore /* Defines for SPL */ 91ae28a5f8SDennis Gilmore #define CONFIG_SPL_SIZE (140 << 10) 92ae28a5f8SDennis Gilmore #define CONFIG_SPL_TEXT_BASE 0x40000030 93ae28a5f8SDennis Gilmore #define CONFIG_SPL_MAX_SIZE (CONFIG_SPL_SIZE - 0x0030) 94ae28a5f8SDennis Gilmore 95ae28a5f8SDennis Gilmore #define CONFIG_SPL_BSS_START_ADDR (0x40000000 + CONFIG_SPL_SIZE) 96ae28a5f8SDennis Gilmore #define CONFIG_SPL_BSS_MAX_SIZE (16 << 10) 97ae28a5f8SDennis Gilmore 98ae28a5f8SDennis Gilmore #ifdef CONFIG_SPL_BUILD 99ae28a5f8SDennis Gilmore #define CONFIG_SYS_MALLOC_SIMPLE 100ae28a5f8SDennis Gilmore #endif 101ae28a5f8SDennis Gilmore 102ae28a5f8SDennis Gilmore #define CONFIG_SPL_STACK (0x40000000 + ((192 - 16) << 10)) 103ae28a5f8SDennis Gilmore #define CONFIG_SPL_BOOTROM_SAVE (CONFIG_SPL_STACK + 4) 104ae28a5f8SDennis Gilmore 105ae28a5f8SDennis Gilmore #if CONFIG_SPL_BOOT_DEVICE == SPL_BOOT_SPI_NOR_FLASH 106ae28a5f8SDennis Gilmore /* SPL related SPI defines */ 1078d7d97e2SAditya Prayoga #define CONFIG_SPL_SPI_FLASH_SUPPORT 1088d7d97e2SAditya Prayoga #define CONFIG_SPL_SPI_LOAD 1098d7d97e2SAditya Prayoga #define CONFIG_SPL_SPI_SUPPORT 110*7a147220SAditya Prayoga #define CONFIG_SYS_SPI_U_BOOT_OFFS 0x30000 111ae28a5f8SDennis Gilmore #define CONFIG_SYS_U_BOOT_OFFS CONFIG_SYS_SPI_U_BOOT_OFFS 112ae28a5f8SDennis Gilmore #endif 113ae28a5f8SDennis Gilmore 114ae28a5f8SDennis Gilmore #if CONFIG_SPL_BOOT_DEVICE == SPL_BOOT_SDIO_MMC_CARD 115ae28a5f8SDennis Gilmore /* SPL related MMC defines */ 1168d7d97e2SAditya Prayoga #define CONFIG_SPL_MMC_SUPPORT 117ae28a5f8SDennis Gilmore #define CONFIG_SYS_MMC_U_BOOT_OFFS (160 << 10) 118ae28a5f8SDennis Gilmore #define CONFIG_SYS_U_BOOT_OFFS CONFIG_SYS_MMC_U_BOOT_OFFS 119ae28a5f8SDennis Gilmore #ifdef CONFIG_SPL_BUILD 120ae28a5f8SDennis Gilmore #define CONFIG_FIXED_SDHCI_ALIGNED_BUFFER 0x00180000 /* in SDRAM */ 121ae28a5f8SDennis Gilmore #endif 122ae28a5f8SDennis Gilmore #endif 123ae28a5f8SDennis Gilmore /* 124ae28a5f8SDennis Gilmore * mv-common.h should be defined after CMD configs since it used them 125ae28a5f8SDennis Gilmore * to enable certain macros 126ae28a5f8SDennis Gilmore */ 127ae28a5f8SDennis Gilmore #include "mv-common.h" 128ae28a5f8SDennis Gilmore 129ae28a5f8SDennis Gilmore /* Include the common distro boot environment */ 130ae28a5f8SDennis Gilmore #ifndef CONFIG_SPL_BUILD 131ae28a5f8SDennis Gilmore 132ae28a5f8SDennis Gilmore #ifdef CONFIG_MMC 133ae28a5f8SDennis Gilmore #define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0) 134ae28a5f8SDennis Gilmore #else 135ae28a5f8SDennis Gilmore #define BOOT_TARGET_DEVICES_MMC(func) 136ae28a5f8SDennis Gilmore #endif 137ae28a5f8SDennis Gilmore 138ae28a5f8SDennis Gilmore #ifdef CONFIG_USB_STORAGE 139ae28a5f8SDennis Gilmore #define BOOT_TARGET_DEVICES_USB(func) func(USB, usb, 0) 140ae28a5f8SDennis Gilmore #else 141ae28a5f8SDennis Gilmore #define BOOT_TARGET_DEVICES_USB(func) 142ae28a5f8SDennis Gilmore #endif 143ae28a5f8SDennis Gilmore 144ae28a5f8SDennis Gilmore #ifdef CONFIG_SATA 145ae28a5f8SDennis Gilmore #define BOOT_TARGET_DEVICES_SATA(func) func(SATA, sata, 0) 146ae28a5f8SDennis Gilmore #else 147ae28a5f8SDennis Gilmore #define BOOT_TARGET_DEVICES_SATA(func) 148ae28a5f8SDennis Gilmore #endif 149ae28a5f8SDennis Gilmore 150ae28a5f8SDennis Gilmore #define BOOT_TARGET_DEVICES(func) \ 151ae28a5f8SDennis Gilmore BOOT_TARGET_DEVICES_MMC(func) \ 152ae28a5f8SDennis Gilmore BOOT_TARGET_DEVICES_USB(func) \ 153ae28a5f8SDennis Gilmore BOOT_TARGET_DEVICES_SATA(func) \ 154ae28a5f8SDennis Gilmore func(PXE, pxe, na) \ 155ae28a5f8SDennis Gilmore func(DHCP, dhcp, na) 156ae28a5f8SDennis Gilmore 157ae28a5f8SDennis Gilmore #define KERNEL_ADDR_R __stringify(0x800000) 158ae28a5f8SDennis Gilmore #define FDT_ADDR_R __stringify(0x100000) 159ae28a5f8SDennis Gilmore #define RAMDISK_ADDR_R __stringify(0x1800000) 160ae28a5f8SDennis Gilmore #define SCRIPT_ADDR_R __stringify(0x200000) 161ae28a5f8SDennis Gilmore #define PXEFILE_ADDR_R __stringify(0x300000) 162ae28a5f8SDennis Gilmore 163ae28a5f8SDennis Gilmore #define LOAD_ADDRESS_ENV_SETTINGS \ 164ae28a5f8SDennis Gilmore "kernel_addr_r=" KERNEL_ADDR_R "\0" \ 165ae28a5f8SDennis Gilmore "fdt_addr_r=" FDT_ADDR_R "\0" \ 166ae28a5f8SDennis Gilmore "ramdisk_addr_r=" RAMDISK_ADDR_R "\0" \ 167ae28a5f8SDennis Gilmore "scriptaddr=" SCRIPT_ADDR_R "\0" \ 168ae28a5f8SDennis Gilmore "pxefile_addr_r=" PXEFILE_ADDR_R "\0" 169ae28a5f8SDennis Gilmore 170ae28a5f8SDennis Gilmore #include <config_distro_bootcmd.h> 171ae28a5f8SDennis Gilmore 172ae28a5f8SDennis Gilmore #define CONFIG_EXTRA_ENV_SETTINGS \ 173ae28a5f8SDennis Gilmore RELOCATION_LIMITS_ENV_SETTINGS \ 174ae28a5f8SDennis Gilmore LOAD_ADDRESS_ENV_SETTINGS \ 175ae28a5f8SDennis Gilmore "fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \ 176ae28a5f8SDennis Gilmore "console=ttyS0,115200\0" \ 177ae28a5f8SDennis Gilmore BOOTENV 178ae28a5f8SDennis Gilmore 179ae28a5f8SDennis Gilmore #endif /* CONFIG_SPL_BUILD */ 180ae28a5f8SDennis Gilmore 181ae28a5f8SDennis Gilmore #endif /* _CONFIG_HELIOS4_H */ 182