1 /* 2 * Copyright (C) 2014 Stefan Roese <sr@denx.de> 3 * Copyright (C) 2016 Mario Six <mario.six@gdsys.cc> 4 * 5 * SPDX-License-Identifier: GPL-2.0+ 6 */ 7 8 #ifndef _CONFIG_CONTROLCENTERDC_H 9 #define _CONFIG_CONTROLCENTERDC_H 10 11 /* 12 * High Level Configuration Options (easy to change) 13 */ 14 #define CONFIG_CUSTOMER_BOARD_SUPPORT 15 16 #define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */ 17 #define CONFIG_BOARD_LATE_INIT 18 19 /* 20 * TEXT_BASE needs to be below 16MiB, since this area is scrubbed 21 * for DDR ECC byte filling in the SPL before loading the main 22 * U-Boot into it. 23 */ 24 25 #define CONFIG_SYS_TCLK 250000000 /* 250MHz */ 26 27 #define CONFIG_LOADADDR 1000000 28 29 /* 30 * Commands configuration 31 */ 32 #define CONFIG_CMD_I2C 33 #define CONFIG_CMD_SPI 34 35 /* SPI NOR flash default params, used by sf commands */ 36 #define CONFIG_SF_DEFAULT_BUS 1 37 #define CONFIG_SF_DEFAULT_SPEED 1000000 38 #define CONFIG_SF_DEFAULT_MODE SPI_MODE_3 39 40 /* 41 * SDIO/MMC Card Configuration 42 */ 43 #define CONFIG_SYS_MMC_BASE MVEBU_SDIO_BASE 44 45 /* 46 * SATA/SCSI/AHCI configuration 47 */ 48 #define CONFIG_SCSI_AHCI_PLAT 49 #define CONFIG_SYS_SCSI_MAX_SCSI_ID 2 50 #define CONFIG_SYS_SCSI_MAX_LUN 1 51 #define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \ 52 CONFIG_SYS_SCSI_MAX_LUN) 53 54 /* USB/EHCI configuration */ 55 #define CONFIG_EHCI_IS_TDI 56 57 /* Environment in SPI NOR flash */ 58 #define CONFIG_ENV_SPI_BUS 1 59 #define CONFIG_ENV_OFFSET (1 << 20) /* 1MiB in */ 60 #define CONFIG_ENV_SIZE (64 << 10) /* 64KiB */ 61 #define CONFIG_ENV_SECT_SIZE (256 << 10) /* 256KiB sectors */ 62 63 #define CONFIG_PHY_MARVELL /* there is a marvell phy */ 64 #define PHY_ANEG_TIMEOUT 8000 /* PHY needs a longer aneg time */ 65 66 /* PCIe support */ 67 #ifndef CONFIG_SPL_BUILD 68 #define CONFIG_PCI 69 #define CONFIG_PCI_MVEBU 70 #define CONFIG_PCI_PNP 71 #define CONFIG_PCI_SCAN_SHOW 72 #endif 73 74 /* 75 * Software (bit-bang) MII driver configuration 76 */ 77 #define CONFIG_BITBANGMII /* bit-bang MII PHY management */ 78 #define CONFIG_BITBANGMII_MULTI 79 80 /* SPL */ 81 /* 82 * Select the boot device here 83 * 84 * Currently supported are: 85 * SPL_BOOT_SPI_NOR_FLASH - Booting via SPI NOR flash 86 * SPL_BOOT_SDIO_MMC_CARD - Booting via SDIO/MMC card (partition 1) 87 */ 88 #define SPL_BOOT_SPI_NOR_FLASH 1 89 #define SPL_BOOT_SDIO_MMC_CARD 2 90 #define CONFIG_SPL_BOOT_DEVICE SPL_BOOT_SPI_NOR_FLASH 91 92 /* Defines for SPL */ 93 #define CONFIG_SPL_SIZE (160 << 10) 94 95 #if defined(CONFIG_SECURED_MODE_IMAGE) 96 #define CONFIG_SPL_TEXT_BASE 0x40002614 97 #define CONFIG_SPL_MAX_SIZE (CONFIG_SPL_SIZE - 0x2614) 98 #else 99 #define CONFIG_SPL_TEXT_BASE 0x40000030 100 #define CONFIG_SPL_MAX_SIZE (CONFIG_SPL_SIZE - 0x30) 101 #endif 102 103 #define CONFIG_SPL_BSS_START_ADDR (0x40000000 + CONFIG_SPL_SIZE) 104 #define CONFIG_SPL_BSS_MAX_SIZE (16 << 10) 105 106 #ifdef CONFIG_SPL_BUILD 107 #define CONFIG_SYS_MALLOC_SIMPLE 108 #endif 109 110 #define CONFIG_SPL_STACK (0x40000000 + ((212 - 16) << 10)) 111 #define CONFIG_SPL_BOOTROM_SAVE (CONFIG_SPL_STACK + 4) 112 113 #define CONFIG_SPL_LIBCOMMON_SUPPORT 114 #define CONFIG_SPL_LIBGENERIC_SUPPORT 115 #define CONFIG_SPL_I2C_SUPPORT 116 117 #if CONFIG_SPL_BOOT_DEVICE == SPL_BOOT_SPI_NOR_FLASH 118 /* SPL related SPI defines */ 119 #define CONFIG_SYS_SPI_U_BOOT_OFFS 0x30000 120 #define CONFIG_SYS_U_BOOT_OFFS CONFIG_SYS_SPI_U_BOOT_OFFS 121 #endif 122 123 #if CONFIG_SPL_BOOT_DEVICE == SPL_BOOT_SDIO_MMC_CARD 124 /* SPL related MMC defines */ 125 #define CONFIG_SPL_MMC_SUPPORT 126 #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION 1 127 #define CONFIG_SYS_MMC_U_BOOT_OFFS (168 << 10) 128 #define CONFIG_SYS_U_BOOT_OFFS CONFIG_SYS_MMC_U_BOOT_OFFS 129 #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR (CONFIG_SYS_U_BOOT_OFFS / 512) 130 #ifdef CONFIG_SPL_BUILD 131 #define CONFIG_FIXED_SDHCI_ALIGNED_BUFFER 0x00180000 /* in SDRAM */ 132 #endif 133 #endif 134 135 /* 136 * Environment Configuration 137 */ 138 #define CONFIG_ENV_OVERWRITE 139 140 #define CONFIG_BAUDRATE 115200 141 142 #define CONFIG_HOSTNAME "ccdc" 143 #define CONFIG_ROOTPATH "/opt/nfsroot" 144 #define CONFIG_BOOTFILE "ccdc.img" 145 146 #define CONFIG_PREBOOT /* enable preboot variable */ 147 148 #define CONFIG_EXTRA_ENV_SETTINGS \ 149 "netdev=eth1\0" \ 150 "consoledev=ttyS1\0" \ 151 "u-boot=u-boot.bin\0" \ 152 "bootfile_addr=1000000\0" \ 153 "keyprogram_addr=3000000\0" \ 154 "keyprogram_file=keyprogram.img\0" \ 155 "fdtfile=controlcenterdc.dtb\0" \ 156 "load=tftpboot ${loadaddr} ${u-boot}\0" \ 157 "mmcdev=0:2\0" \ 158 "update=sf probe 1:0;" \ 159 " sf erase 0 +${filesize};" \ 160 " sf write ${fileaddr} 0 ${filesize}\0" \ 161 "upd=run load update\0" \ 162 "fdt_high=0x10000000\0" \ 163 "initrd_high=0x10000000\0" \ 164 "loadkeyprogram=tpm flush_keys;" \ 165 " mmc rescan;" \ 166 " ext4load mmc ${mmcdev} ${keyprogram_addr} ${keyprogram_file};"\ 167 " source ${keyprogram_addr}:script@1\0" \ 168 "gpio1=gpio@22_25\0" \ 169 "gpio2=A29\0" \ 170 "blinkseq='0 0 0 0 2 0 2 2 3 1 3 1 0 0 2 2 3 1 3 3 2 0 2 2 3 1 1 1 " \ 171 "2 0 2 2 3 1 3 1 0 0 2 0 3 3 3 1 2 0 0 0 3 1 1 1 0 0 0 0'\0" \ 172 "bootfail=for i in ${blinkseq}; do" \ 173 " if test $i -eq 0; then" \ 174 " gpio clear ${gpio1}; gpio set ${gpio2};" \ 175 " elif test $i -eq 1; then" \ 176 " gpio clear ${gpio1}; gpio clear ${gpio2};" \ 177 " elif test $i -eq 2; then" \ 178 " gpio set ${gpio1}; gpio set ${gpio2};" \ 179 " else;" \ 180 " gpio clear ${gpio1}; gpio set ${gpio2};" \ 181 " fi; sleep 0.12; done\0" 182 183 #define CONFIG_NFSBOOTCOMMAND \ 184 "setenv bootargs root=/dev/nfs rw " \ 185 "nfsroot=${serverip}:${rootpath} " \ 186 "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:${netdev}:off " \ 187 "console=${consoledev},${baudrate} ${othbootargs}; " \ 188 "tftpboot ${bootfile_addr} ${bootfile}; " \ 189 "bootm ${bootfile_addr}" 190 191 #define CONFIG_MMCBOOTCOMMAND \ 192 "setenv bootargs root=/dev/mmcblk0p3 rw rootwait " \ 193 "console=${consoledev},${baudrate} ${othbootargs}; " \ 194 "ext2load mmc 0:2 ${bootfile_addr} ${bootfile}; " \ 195 "bootm ${bootfile_addr}" 196 197 #define CONFIG_BOOTCOMMAND \ 198 "if env exists keyprogram; then;" \ 199 " setenv keyprogram; run nfsboot;" \ 200 " fi;" \ 201 " run dobootfail" 202 203 /* 204 * mv-common.h should be defined after CMD configs since it used them 205 * to enable certain macros 206 */ 207 #include "mv-common.h" 208 209 #endif /* _CONFIG_CONTROLCENTERDC_H */ 210