183d290c5STom Rini /* SPDX-License-Identifier: GPL-2.0+ */ 20299c90fSStefan Roese /* 30299c90fSStefan Roese * Copyright (C) 2015 Stefan Roese <sr@denx.de> 40299c90fSStefan Roese */ 50299c90fSStefan Roese 60299c90fSStefan Roese #ifndef _CONFIG_CLEARFOG_H 70299c90fSStefan Roese #define _CONFIG_CLEARFOG_H 80299c90fSStefan Roese 90299c90fSStefan Roese /* 100299c90fSStefan Roese * High Level Configuration Options (easy to change) 110299c90fSStefan Roese */ 120299c90fSStefan Roese 130299c90fSStefan Roese /* 140299c90fSStefan Roese * TEXT_BASE needs to be below 16MiB, since this area is scrubbed 150299c90fSStefan Roese * for DDR ECC byte filling in the SPL before loading the main 160299c90fSStefan Roese * U-Boot into it. 170299c90fSStefan Roese */ 180299c90fSStefan Roese #define CONFIG_SYS_TCLK 250000000 /* 250MHz */ 190299c90fSStefan Roese 200299c90fSStefan Roese /* 210299c90fSStefan Roese * Commands configuration 220299c90fSStefan Roese */ 230299c90fSStefan Roese 240299c90fSStefan Roese /* SPI NOR flash default params, used by sf commands */ 250299c90fSStefan Roese 260299c90fSStefan Roese /* 270299c90fSStefan Roese * SDIO/MMC Card Configuration 280299c90fSStefan Roese */ 290299c90fSStefan Roese #define CONFIG_SYS_MMC_BASE MVEBU_SDIO_BASE 300299c90fSStefan Roese 31*e32ac371SBaruch Siach #ifdef CONFIG_CMD_MMC 32*e32ac371SBaruch Siach #define CONFIG_SUPPORT_EMMC_BOOT 33*e32ac371SBaruch Siach #endif 34*e32ac371SBaruch Siach 350299c90fSStefan Roese /* USB/EHCI configuration */ 360299c90fSStefan Roese #define CONFIG_EHCI_IS_TDI 370299c90fSStefan Roese 380299c90fSStefan Roese #define CONFIG_ENV_MIN_ENTRIES 128 390299c90fSStefan Roese 400299c90fSStefan Roese /* Environment in MMC */ 410299c90fSStefan Roese #define CONFIG_SYS_MMC_ENV_DEV 0 420299c90fSStefan Roese #define CONFIG_ENV_SECT_SIZE 0x200 430299c90fSStefan Roese #define CONFIG_ENV_SIZE 0x10000 440299c90fSStefan Roese /* 450299c90fSStefan Roese * For SD - reserve 1 LBA for MBR + 1M for u-boot image. The MMC/eMMC 460299c90fSStefan Roese * boot image starts @ LBA-0. 470299c90fSStefan Roese * As result in MMC/eMMC case it will be a 1 sector gap between u-boot 480299c90fSStefan Roese * image and environment 490299c90fSStefan Roese */ 500299c90fSStefan Roese #define CONFIG_ENV_OFFSET 0xf0000 510299c90fSStefan Roese #define CONFIG_ENV_ADDR CONFIG_ENV_OFFSET 520299c90fSStefan Roese 530299c90fSStefan Roese #define PHY_ANEG_TIMEOUT 8000 /* PHY needs a longer aneg time */ 540299c90fSStefan Roese 550299c90fSStefan Roese /* PCIe support */ 560299c90fSStefan Roese #ifndef CONFIG_SPL_BUILD 570299c90fSStefan Roese #define CONFIG_PCI_SCAN_SHOW 580299c90fSStefan Roese #endif 590299c90fSStefan Roese 60d6db446fSJon Nettleton /* SATA support */ 61d6db446fSJon Nettleton #ifdef CONFIG_SCSI 62d6db446fSJon Nettleton #define CONFIG_SCSI_AHCI_PLAT 63d6db446fSJon Nettleton #define CONFIG_SYS_SCSI_MAX_SCSI_ID 1 64d6db446fSJon Nettleton #define CONFIG_SYS_SCSI_MAX_LUN 1 65d6db446fSJon Nettleton #define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \ 66d6db446fSJon Nettleton CONFIG_SYS_SCSI_MAX_LUN) 67d6db446fSJon Nettleton #endif 68d6db446fSJon Nettleton 690299c90fSStefan Roese /* Keep device tree and initrd in lower memory so the kernel can access them */ 70f3d9ec2aSPatrick Wildt #define RELOCATION_LIMITS_ENV_SETTINGS \ 710299c90fSStefan Roese "fdt_high=0x10000000\0" \ 720299c90fSStefan Roese "initrd_high=0x10000000\0" 730299c90fSStefan Roese 740299c90fSStefan Roese /* SPL */ 750299c90fSStefan Roese 760299c90fSStefan Roese /* Defines for SPL */ 770299c90fSStefan Roese #define CONFIG_SPL_SIZE (140 << 10) 780299c90fSStefan Roese #define CONFIG_SPL_TEXT_BASE 0x40000030 790299c90fSStefan Roese #define CONFIG_SPL_MAX_SIZE (CONFIG_SPL_SIZE - 0x0030) 800299c90fSStefan Roese 810299c90fSStefan Roese #define CONFIG_SPL_BSS_START_ADDR (0x40000000 + CONFIG_SPL_SIZE) 820299c90fSStefan Roese #define CONFIG_SPL_BSS_MAX_SIZE (16 << 10) 830299c90fSStefan Roese 840299c90fSStefan Roese #ifdef CONFIG_SPL_BUILD 850299c90fSStefan Roese #define CONFIG_SYS_MALLOC_SIMPLE 860299c90fSStefan Roese #endif 870299c90fSStefan Roese 880299c90fSStefan Roese #define CONFIG_SPL_STACK (0x40000000 + ((192 - 16) << 10)) 890299c90fSStefan Roese #define CONFIG_SPL_BOOTROM_SAVE (CONFIG_SPL_STACK + 4) 900299c90fSStefan Roese 914fe3f1bfSBaruch Siach #if defined(CONFIG_MVEBU_SPL_BOOT_DEVICE_SPI) 920299c90fSStefan Roese /* SPL related SPI defines */ 930299c90fSStefan Roese #define CONFIG_SYS_SPI_U_BOOT_OFFS 0x20000 940299c90fSStefan Roese #define CONFIG_SYS_U_BOOT_OFFS CONFIG_SYS_SPI_U_BOOT_OFFS 954fe3f1bfSBaruch Siach #elif defined(CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC) 960299c90fSStefan Roese /* SPL related MMC defines */ 970299c90fSStefan Roese #define CONFIG_SYS_MMC_U_BOOT_OFFS (160 << 10) 980299c90fSStefan Roese #define CONFIG_SYS_U_BOOT_OFFS CONFIG_SYS_MMC_U_BOOT_OFFS 990299c90fSStefan Roese #ifdef CONFIG_SPL_BUILD 1000299c90fSStefan Roese #define CONFIG_FIXED_SDHCI_ALIGNED_BUFFER 0x00180000 /* in SDRAM */ 1010299c90fSStefan Roese #endif 1020299c90fSStefan Roese #endif 1030299c90fSStefan Roese 1040299c90fSStefan Roese /* 1050299c90fSStefan Roese * mv-common.h should be defined after CMD configs since it used them 1060299c90fSStefan Roese * to enable certain macros 1070299c90fSStefan Roese */ 1080299c90fSStefan Roese #include "mv-common.h" 1090299c90fSStefan Roese 110f3d9ec2aSPatrick Wildt /* Include the common distro boot environment */ 111f3d9ec2aSPatrick Wildt #ifndef CONFIG_SPL_BUILD 112f3d9ec2aSPatrick Wildt 113f3d9ec2aSPatrick Wildt #ifdef CONFIG_MMC 114f3d9ec2aSPatrick Wildt #define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0) 115f3d9ec2aSPatrick Wildt #else 116f3d9ec2aSPatrick Wildt #define BOOT_TARGET_DEVICES_MMC(func) 117f3d9ec2aSPatrick Wildt #endif 118f3d9ec2aSPatrick Wildt 119f3d9ec2aSPatrick Wildt #ifdef CONFIG_USB_STORAGE 120f3d9ec2aSPatrick Wildt #define BOOT_TARGET_DEVICES_USB(func) func(USB, usb, 0) 121f3d9ec2aSPatrick Wildt #else 122f3d9ec2aSPatrick Wildt #define BOOT_TARGET_DEVICES_USB(func) 123f3d9ec2aSPatrick Wildt #endif 124f3d9ec2aSPatrick Wildt 125f3d9ec2aSPatrick Wildt #define BOOT_TARGET_DEVICES(func) \ 126f3d9ec2aSPatrick Wildt BOOT_TARGET_DEVICES_MMC(func) \ 127f3d9ec2aSPatrick Wildt BOOT_TARGET_DEVICES_USB(func) \ 128f3d9ec2aSPatrick Wildt func(PXE, pxe, na) \ 129f3d9ec2aSPatrick Wildt func(DHCP, dhcp, na) 130f3d9ec2aSPatrick Wildt 131f3d9ec2aSPatrick Wildt #define KERNEL_ADDR_R __stringify(0x800000) 132f3d9ec2aSPatrick Wildt #define FDT_ADDR_R __stringify(0x100000) 133f3d9ec2aSPatrick Wildt #define RAMDISK_ADDR_R __stringify(0x1800000) 134f3d9ec2aSPatrick Wildt #define SCRIPT_ADDR_R __stringify(0x200000) 135f3d9ec2aSPatrick Wildt #define PXEFILE_ADDR_R __stringify(0x300000) 136f3d9ec2aSPatrick Wildt 137f3d9ec2aSPatrick Wildt #define LOAD_ADDRESS_ENV_SETTINGS \ 138f3d9ec2aSPatrick Wildt "kernel_addr_r=" KERNEL_ADDR_R "\0" \ 139f3d9ec2aSPatrick Wildt "fdt_addr_r=" FDT_ADDR_R "\0" \ 140f3d9ec2aSPatrick Wildt "ramdisk_addr_r=" RAMDISK_ADDR_R "\0" \ 141f3d9ec2aSPatrick Wildt "scriptaddr=" SCRIPT_ADDR_R "\0" \ 142f3d9ec2aSPatrick Wildt "pxefile_addr_r=" PXEFILE_ADDR_R "\0" 143f3d9ec2aSPatrick Wildt 144f3d9ec2aSPatrick Wildt #include <config_distro_bootcmd.h> 145f3d9ec2aSPatrick Wildt 146f3d9ec2aSPatrick Wildt #define CONFIG_EXTRA_ENV_SETTINGS \ 147f3d9ec2aSPatrick Wildt RELOCATION_LIMITS_ENV_SETTINGS \ 148f3d9ec2aSPatrick Wildt LOAD_ADDRESS_ENV_SETTINGS \ 149f3d9ec2aSPatrick Wildt "fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \ 150f3d9ec2aSPatrick Wildt "console=ttyS0,115200\0" \ 151f3d9ec2aSPatrick Wildt BOOTENV 152f3d9ec2aSPatrick Wildt 153f3d9ec2aSPatrick Wildt #endif /* CONFIG_SPL_BUILD */ 154f3d9ec2aSPatrick Wildt 1550299c90fSStefan Roese #endif /* _CONFIG_CLEARFOG_H */ 156