1 /* 2 * Copyright (C) 2014, Barco (www.barco.com) 3 * 4 * SPDX-License-Identifier: GPL-2.0+ 5 */ 6 7 #ifndef __PLATINUM_CONFIG_H__ 8 #define __PLATINUM_CONFIG_H__ 9 10 #define CONFIG_SYS_GENERIC_BOARD 11 12 /* SPL */ 13 #define CONFIG_SPL_NAND_SUPPORT 14 #define CONFIG_SPL_MMC_SUPPORT 15 16 /* Location in NAND to read U-Boot from */ 17 #define CONFIG_SYS_NAND_U_BOOT_OFFS (14 * 1024 * 1024) 18 19 #include "imx6_spl.h" /* common IMX6 SPL configuration */ 20 #include "mx6_common.h" 21 #include <asm/arch/imx-regs.h> 22 #include <asm/imx-common/gpio.h> 23 24 /* 25 * Console configuration 26 */ 27 28 #include <config_cmd_default.h> 29 #define CONFIG_CMD_BMODE 30 #define CONFIG_CMD_DHCP 31 #define CONFIG_CMD_EXT2 32 #define CONFIG_CMD_FAT 33 #define CONFIG_CMD_FUSE 34 #define CONFIG_CMD_GPIO 35 #define CONFIG_CMD_I2C 36 #undef CONFIG_CMD_IMLS 37 #define CONFIG_CMD_MII 38 #define CONFIG_CMD_MMC 39 #define CONFIG_CMD_MTDPARTS 40 #define CONFIG_CMD_NAND 41 #define CONFIG_CMD_NAND_TRIMFFS 42 #define CONFIG_CMD_NET 43 #define CONFIG_CMD_PING 44 #define CONFIG_CMD_TIME 45 #define CONFIG_CMD_UBI 46 #define CONFIG_CMD_UBIFS 47 #define CONFIG_CMD_USB 48 49 /* 50 * Hardware configuration 51 */ 52 53 /* GPIO config */ 54 #define CONFIG_MXC_GPIO 55 56 /* UART config */ 57 #define CONFIG_MXC_UART 58 #define CONFIG_MXC_UART_BASE UART1_BASE 59 #define CONFIG_BAUDRATE 115200 60 #define CONFIG_CONS_INDEX 1 61 62 /* I2C config */ 63 #define CONFIG_SYS_I2C 64 #define CONFIG_SYS_I2C_MXC 65 #define CONFIG_SYS_I2C_MXC_I2C3 /* enable I2C bus 3 */ 66 #define CONFIG_SYS_I2C_SPEED 100000 67 68 /* MMC config */ 69 #define CONFIG_FSL_ESDHC 70 #define CONFIG_FSL_USDHC 71 #define CONFIG_SYS_FSL_ESDHC_ADDR 0 72 #define CONFIG_SYS_FSL_USDHC_NUM 1 73 #define CONFIG_MMC 74 #define CONFIG_GENERIC_MMC 75 #define CONFIG_BOUNCE_BUFFER 76 #define CONFIG_DOS_PARTITION 77 78 /* Ethernet config */ 79 #define CONFIG_FEC_MXC 80 #define CONFIG_MII 81 #define IMX_FEC_BASE ENET_BASE_ADDR 82 83 #define CONFIG_PHYLIB 84 85 /* USB config */ 86 #define CONFIG_USB_EHCI 87 #define CONFIG_USB_EHCI_MX6 88 #define CONFIG_USB_STORAGE 89 #define CONFIG_MXC_USB_PORT 1 90 #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) 91 #define CONFIG_MXC_USB_FLAGS 0 92 93 /* Memory config */ 94 #define CONFIG_NR_DRAM_BANKS 1 95 #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR 96 #ifndef PHYS_SDRAM_SIZE 97 #define PHYS_SDRAM_SIZE (1024 << 20) 98 #endif 99 100 #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM 101 #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR 102 #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE 103 104 #define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - \ 105 GENERATED_GBL_DATA_SIZE) 106 #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \ 107 CONFIG_SYS_INIT_SP_OFFSET) 108 109 #define CONFIG_SYS_MALLOC_LEN (16 * 1024 * 1024) 110 111 /* FLASH and environment organization */ 112 #define CONFIG_SYS_NO_FLASH 113 114 #ifdef CONFIG_CMD_NAND 115 116 /* NAND config */ 117 #define CONFIG_NAND_MXS 118 #ifndef CONFIG_SYS_NAND_MAX_CHIPS 119 #define CONFIG_SYS_NAND_MAX_CHIPS 2 120 #endif 121 #define CONFIG_SYS_MAX_NAND_DEVICE 1 122 #define CONFIG_SYS_NAND_BASE 0x40000000 123 #define CONFIG_SYS_NAND_5_ADDR_CYCLE 124 #define CONFIG_SYS_NAND_ONFI_DETECTION 125 126 /* DMA config, needed for GPMI/MXS NAND support */ 127 #define CONFIG_APBH_DMA 128 #define CONFIG_APBH_DMA_BURST 129 #define CONFIG_APBH_DMA_BURST8 130 131 /* Fuse support */ 132 #define CONFIG_MXC_OCOTP 133 134 /* Environment in NAND */ 135 #define CONFIG_ENV_IS_IN_NAND 136 #define CONFIG_ENV_OFFSET (16 << 20) 137 #define CONFIG_ENV_SECT_SIZE (128 << 10) 138 #define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE 139 #define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + (512 << 10)) 140 #define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE 141 142 #else /* CONFIG_CMD_NAND */ 143 144 /* Environment in MMC */ 145 #define CONFIG_ENV_SIZE (8 << 10) 146 #define CONFIG_ENV_IS_IN_MMC 147 #define CONFIG_ENV_OFFSET (6 * 64 * 1024) 148 #define CONFIG_SYS_MMC_ENV_DEV 0 149 150 #endif /* CONFIG_CMD_NAND */ 151 152 /* 153 * U-Boot configuration 154 */ 155 156 /* Console boot messages */ 157 #define CONFIG_DISPLAY_CPUINFO 158 #define CONFIG_DISPLAY_BOARDINFO 159 160 /* Tag config */ 161 #define CONFIG_CMDLINE_TAG 162 #define CONFIG_SETUP_MEMORY_TAGS 163 #define CONFIG_INITRD_TAG 164 #define CONFIG_REVISION_TAG 165 166 /* Board startup config */ 167 #define CONFIG_BOARD_EARLY_INIT_F 168 #define CONFIG_MISC_INIT_R 169 170 /* allow to overwrite serial and ethaddr */ 171 #define CONFIG_ENV_OVERWRITE 172 173 /* Device tree support */ 174 #define CONFIG_OF_LIBFDT 175 176 #define CONFIG_LOADADDR 0x12000000 177 #define CONFIG_SYS_TEXT_BASE 0x17800000 178 179 #define CONFIG_SYS_MEMTEST_START PHYS_SDRAM 180 #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + \ 181 PHYS_SDRAM_SIZE - (12 << 20)) 182 183 #define CONFIG_BOOTDELAY 3 184 #define CONFIG_BOOTCOMMAND "run bootubi_scr" 185 186 /* Miscellaneous configurable options */ 187 #define CONFIG_SYS_LONGHELP 188 #define CONFIG_SYS_HUSH_PARSER 189 190 #define CONFIG_AUTO_COMPLETE 191 #define CONFIG_CMDLINE_EDITING 192 #define CONFIG_PREBOOT 193 194 #define CONFIG_SYS_CBSIZE 256 195 196 /* Print Buffer Size */ 197 #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \ 198 sizeof(CONFIG_SYS_PROMPT) + 16) 199 #define CONFIG_SYS_MAXARGS 16 200 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE 201 202 #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR 203 204 /* MTD/UBI/UBIFS config */ 205 #define CONFIG_LZO 206 #define CONFIG_MTD_DEVICE 207 #define CONFIG_MTD_PARTITIONS 208 #define CONFIG_RBTREE 209 210 #if (CONFIG_SYS_NAND_MAX_CHIPS == 1) 211 #define MTDIDS_DEFAULT "nand0=gpmi-nand" 212 #define MTDPARTS_DEFAULT "mtdparts=gpmi-nand:14M(spl),2M(uboot)," \ 213 "512k(env1),512k(env2),-(ubi)" 214 #elif (CONFIG_SYS_NAND_MAX_CHIPS == 2) 215 #define MTDIDS_DEFAULT "nand0=gpmi-nand" 216 #define MTDPARTS_DEFAULT "mtdparts=gpmi-nand:14M(spl),2M(uboot)," \ 217 "512k(env1),512k(env2),495M(ubi0)," \ 218 "14M(res0),2M(res1)," \ 219 "512k(res2),512k(res3),-(ubi1)" 220 #endif 221 222 #ifndef CONFIG_SYS_DCACHE_OFF 223 #define CONFIG_CMD_CACHE 224 #endif 225 226 /* 227 * Environment configuration 228 */ 229 230 #if (CONFIG_SYS_NAND_MAX_CHIPS == 1) 231 #define CONFIG_COMMON_ENV_UBI \ 232 "setubipartition=env set ubipartition ubi\0" \ 233 "setubirfs=env set ubirfs $ubipartition:rootfs$boot_vol\0" 234 #elif (CONFIG_SYS_NAND_MAX_CHIPS == 2) 235 #define CONFIG_COMMON_ENV_UBI \ 236 "setubipartition=env set ubipartition ubi$boot_vol\0" \ 237 "setubirfs=env set ubirfs ubi0:rootfs\0" 238 #endif 239 240 #define CONFIG_COMMON_ENV_MISC \ 241 "user=user\0" \ 242 "project="CONFIG_PLATINUM_PROJECT"\0" \ 243 "uimage=uImage\0" \ 244 "dtb="CONFIG_PLATINUM_CPU"-platinum-"CONFIG_PLATINUM_PROJECT".dtb\0" \ 245 "serverip=serverip\0" \ 246 "memaddrlinux=0x10800000\0" \ 247 "memaddrsrc=0x11000000\0" \ 248 "memaddrdtb=0x12000000\0" \ 249 "console=ttymxc0\0" \ 250 "baudrate=115200\0" \ 251 "boot_scr=boot.uboot\0" \ 252 "boot_vol=0\0" \ 253 "mtdids="MTDIDS_DEFAULT"\0" \ 254 "mtdparts="MTDPARTS_DEFAULT"\0" \ 255 "mmcfs=ext2\0" \ 256 "mmcrootpart=1\0" \ 257 \ 258 "setnfspath=env set nfspath /home/nfs/$user/$project/root\0" \ 259 "settftpfilelinux=env set tftpfilelinux $user/$project/$uimage\0" \ 260 "settftpfiledtb=env set tftpfiledtb $user/$project/$dtb\0" \ 261 "setubifilelinux=env set ubifilelinux boot/$uimage\0" \ 262 "setubipfiledtb=env set ubifiledtb boot/$dtb\0" \ 263 "setmmcrootdev=env set mmcrootdev /dev/mmcblk0p$mmcrootpart\0" \ 264 "setmmcfilelinux=env set mmcfilelinux /boot/$uimage\0" \ 265 "setmmcfiledtb=env set mmcfiledtb /boot/$dtb\0" \ 266 \ 267 "loadtftpkernel=dhcp $memaddrlinux $tftpfilelinux\0" \ 268 "loadtftpdtb=dhcp $memaddrdtb $tftpfiledtb\0" \ 269 "loadubikernel=ubifsload $memaddrlinux $ubifilelinux\0" \ 270 "loadubidtb=ubifsload $memaddrdtb $ubifiledtb\0" \ 271 "loadmmckernel=${mmcfs}load mmc 0:$mmcrootpart $memaddrlinux " \ 272 "$mmcfilelinux\0" \ 273 "loadmmcdtb=${mmcfs}load mmc 0:$mmcrootpart $memaddrdtb " \ 274 "$mmcfiledtb\0" \ 275 \ 276 "ubipart=ubi part $ubipartition\0" \ 277 "ubimount=ubifsmount $ubirfs\0" \ 278 \ 279 "setbootargscommon=env set bootargs $bootargs " \ 280 "console=$console,$baudrate enable_wait_mode=off\0" \ 281 "setbootargsmtd=env set bootargs $bootargs $mtdparts\0" \ 282 "setbootargsdhcp=env set bootargs $bootargs ip=dhcp\0" \ 283 "setbootargsubirfs=env set bootargs $bootargs " \ 284 "ubi.mtd=$ubipartition root=$ubirfs rootfstype=ubifs\0" \ 285 "setbootargsnfsrfs=env set bootargs $bootargs root=/dev/nfs " \ 286 "nfsroot=$serverip:$nfspath,v3,tcp\0" \ 287 "setbootargsmmcrfs=env set bootargs $bootargs " \ 288 "root=$mmcrootdev rootwait rw\0" \ 289 \ 290 "bootnet=run settftpfilelinux settftpfiledtb setnfspath " \ 291 "setbootargscommon setbootargsmtd setbootargsdhcp " \ 292 "setbootargsnfsrfs;" \ 293 "run loadtftpkernel loadtftpdtb;" \ 294 "bootm $memaddrlinux - $memaddrdtb\0" \ 295 "bootnet_ubirfs=run settftpfilelinux settftpfiledtb;" \ 296 "run setubipartition setubirfs;" \ 297 "run setbootargscommon setbootargsmtd " \ 298 "setbootargsubirfs;" \ 299 "run loadtftpkernel loadtftpdtb;" \ 300 "bootm $memaddrlinux - $memaddrdtb\0" \ 301 "bootubi=run setubipartition setubirfs setubifilelinux " \ 302 "setubipfiledtb;" \ 303 "run setbootargscommon setbootargsmtd " \ 304 "setbootargsubirfs;" \ 305 "run ubipart ubimount loadubikernel loadubidtb;" \ 306 "bootm $memaddrlinux - $memaddrdtb\0" \ 307 "bootubi_scr=run setubipartition setubirfs;" \ 308 "run ubipart ubimount;" \ 309 "if ubifsload ${memaddrsrc} boot/${boot_scr}; " \ 310 "then source ${memaddrsrc}; else run bootubi; fi\0" \ 311 "bootmmc=run setmmcrootdev setmmcfilelinux setmmcfiledtb " \ 312 "setbootargscommon setbootargsmmcrfs;" \ 313 "run loadmmckernel loadmmcdtb;" \ 314 "bootm $memaddrlinux - $memaddrdtb\0" \ 315 \ 316 "bootcmd="CONFIG_BOOTCOMMAND"\0" 317 318 #define CONFIG_COMMON_ENV_SETTINGS CONFIG_COMMON_ENV_MISC \ 319 CONFIG_COMMON_ENV_UBI 320 #endif /* __PLATINUM_CONFIG_H__ */ 321