2 * Copyright (C) 2014 Stefan Roese <sr@denx.de>
3 * Copyright (C) 2016 Mario Six <mario.six@gdsys.cc>
5 * SPDX-License-Identifier: GPL-2.0+
8 #ifndef _CONFIG_CONTROLCENTERDC_H
9 #define _CONFIG_CONTROLCENTERDC_H
12 * High Level Configuration Options (easy to change)
14 #define CONFIG_CUSTOMER_BOARD_SUPPORT
16 #define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */
17 #define CONFIG_BOARD_LATE_INIT
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
25 #define CONFIG_SYS_TCLK 250000000 /* 250MHz */
27 #define CONFIG_LOADADDR 1000000
30 * Commands configuration
32 #define CONFIG_CMD_I2C
33 #define CONFIG_CMD_SPI
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
41 * SDIO/MMC Card Configuration
43 #define CONFIG_SYS_MMC_BASE MVEBU_SDIO_BASE
46 * SATA/SCSI/AHCI configuration
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)
54 /* USB/EHCI configuration */
55 #define CONFIG_EHCI_IS_TDI
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 */
63 #define CONFIG_PHY_MARVELL /* there is a marvell phy */
64 #define PHY_ANEG_TIMEOUT 8000 /* PHY needs a longer aneg time */
67 #ifndef CONFIG_SPL_BUILD
69 #define CONFIG_PCI_MVEBU
70 #define CONFIG_PCI_PNP
71 #define CONFIG_PCI_SCAN_SHOW
75 * Software (bit-bang) MII driver configuration
77 #define CONFIG_BITBANGMII /* bit-bang MII PHY management */
78 #define CONFIG_BITBANGMII_MULTI
82 * Select the boot device here
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)
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
93 #define CONFIG_SPL_SIZE (160 << 10)
95 #if defined(CONFIG_SECURED_MODE_IMAGE)
96 #define CONFIG_SPL_TEXT_BASE 0x40002614
97 #define CONFIG_SPL_MAX_SIZE (CONFIG_SPL_SIZE - 0x2614)
99 #define CONFIG_SPL_TEXT_BASE 0x40000030
100 #define CONFIG_SPL_MAX_SIZE (CONFIG_SPL_SIZE - 0x30)
103 #define CONFIG_SPL_BSS_START_ADDR (0x40000000 + CONFIG_SPL_SIZE)
104 #define CONFIG_SPL_BSS_MAX_SIZE (16 << 10)
106 #ifdef CONFIG_SPL_BUILD
107 #define CONFIG_SYS_MALLOC_SIMPLE
110 #define CONFIG_SPL_STACK (0x40000000 + ((212 - 16) << 10))
111 #define CONFIG_SPL_BOOTROM_SAVE (CONFIG_SPL_STACK + 4)
113 #define CONFIG_SPL_LIBCOMMON_SUPPORT
114 #define CONFIG_SPL_LIBGENERIC_SUPPORT
115 #define CONFIG_SPL_I2C_SUPPORT
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
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 */
136 * Environment Configuration
138 #define CONFIG_ENV_OVERWRITE
140 #define CONFIG_BAUDRATE 115200
142 #define CONFIG_HOSTNAME "ccdc"
143 #define CONFIG_ROOTPATH "/opt/nfsroot"
144 #define CONFIG_BOOTFILE "ccdc.img"
146 #define CONFIG_PREBOOT /* enable preboot variable */
148 #define CONFIG_EXTRA_ENV_SETTINGS \
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" \
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;" \
166 " ext4load mmc ${mmcdev} ${keyprogram_addr} ${keyprogram_file};"\
167 " source ${keyprogram_addr}:script@1\0" \
168 "gpio1=gpio@22_25\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};" \
180 " gpio clear ${gpio1}; gpio set ${gpio2};" \
181 " fi; sleep 0.12; done\0"
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}"
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}"
197 #define CONFIG_BOOTCOMMAND \
198 "if env exists keyprogram; then;" \
199 " setenv keyprogram; run nfsboot;" \
204 * mv-common.h should be defined after CMD configs since it used them
205 * to enable certain macros
207 #include "mv-common.h"
209 #endif /* _CONFIG_CONTROLCENTERDC_H */