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