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 | |
Stefan Roese | 7f2b1ec | 2014-12-10 10:15:23 +0100 | [diff] [blame] | 10 | /* SPL */ |
| 11 | #define CONFIG_SPL_NAND_SUPPORT |
| 12 | #define CONFIG_SPL_MMC_SUPPORT |
| 13 | |
| 14 | /* Location in NAND to read U-Boot from */ |
| 15 | #define CONFIG_SYS_NAND_U_BOOT_OFFS (14 * 1024 * 1024) |
| 16 | |
| 17 | #include "imx6_spl.h" /* common IMX6 SPL configuration */ |
| 18 | #include "mx6_common.h" |
Stefan Roese | 7f2b1ec | 2014-12-10 10:15:23 +0100 | [diff] [blame] | 19 | |
| 20 | /* |
| 21 | * Console configuration |
| 22 | */ |
| 23 | |
Stefan Roese | 7f2b1ec | 2014-12-10 10:15:23 +0100 | [diff] [blame] | 24 | #define CONFIG_CMD_BMODE |
| 25 | #define CONFIG_CMD_DHCP |
Stefan Roese | 7f2b1ec | 2014-12-10 10:15:23 +0100 | [diff] [blame] | 26 | #define CONFIG_CMD_FUSE |
Stefan Roese | 7f2b1ec | 2014-12-10 10:15:23 +0100 | [diff] [blame] | 27 | #define CONFIG_CMD_I2C |
Stefan Roese | 7f2b1ec | 2014-12-10 10:15:23 +0100 | [diff] [blame] | 28 | #define CONFIG_CMD_MII |
Stefan Roese | 7f2b1ec | 2014-12-10 10:15:23 +0100 | [diff] [blame] | 29 | #define CONFIG_CMD_MTDPARTS |
| 30 | #define CONFIG_CMD_NAND |
| 31 | #define CONFIG_CMD_NAND_TRIMFFS |
Stefan Roese | 7f2b1ec | 2014-12-10 10:15:23 +0100 | [diff] [blame] | 32 | #define CONFIG_CMD_PING |
| 33 | #define CONFIG_CMD_TIME |
| 34 | #define CONFIG_CMD_UBI |
| 35 | #define CONFIG_CMD_UBIFS |
| 36 | #define CONFIG_CMD_USB |
| 37 | |
| 38 | /* |
| 39 | * Hardware configuration |
| 40 | */ |
| 41 | |
Stefan Roese | 7f2b1ec | 2014-12-10 10:15:23 +0100 | [diff] [blame] | 42 | /* UART config */ |
| 43 | #define CONFIG_MXC_UART |
| 44 | #define CONFIG_MXC_UART_BASE UART1_BASE |
Stefan Roese | 7f2b1ec | 2014-12-10 10:15:23 +0100 | [diff] [blame] | 45 | |
| 46 | /* I2C config */ |
| 47 | #define CONFIG_SYS_I2C |
| 48 | #define CONFIG_SYS_I2C_MXC |
York Sun | f1a5216 | 2015-03-20 10:20:40 -0700 | [diff] [blame] | 49 | #define CONFIG_SYS_I2C_MXC_I2C3 /* enable I2C bus 3 */ |
Stefan Roese | 7f2b1ec | 2014-12-10 10:15:23 +0100 | [diff] [blame] | 50 | #define CONFIG_SYS_I2C_SPEED 100000 |
| 51 | |
| 52 | /* MMC config */ |
Stefan Roese | 7f2b1ec | 2014-12-10 10:15:23 +0100 | [diff] [blame] | 53 | #define CONFIG_SYS_FSL_ESDHC_ADDR 0 |
| 54 | #define CONFIG_SYS_FSL_USDHC_NUM 1 |
Stefan Roese | 7f2b1ec | 2014-12-10 10:15:23 +0100 | [diff] [blame] | 55 | |
| 56 | /* Ethernet config */ |
| 57 | #define CONFIG_FEC_MXC |
| 58 | #define CONFIG_MII |
| 59 | #define IMX_FEC_BASE ENET_BASE_ADDR |
| 60 | |
| 61 | #define CONFIG_PHYLIB |
| 62 | |
| 63 | /* USB config */ |
| 64 | #define CONFIG_USB_EHCI |
| 65 | #define CONFIG_USB_EHCI_MX6 |
| 66 | #define CONFIG_USB_STORAGE |
| 67 | #define CONFIG_MXC_USB_PORT 1 |
| 68 | #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) |
| 69 | #define CONFIG_MXC_USB_FLAGS 0 |
| 70 | |
| 71 | /* Memory config */ |
| 72 | #define CONFIG_NR_DRAM_BANKS 1 |
| 73 | #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR |
| 74 | #ifndef PHYS_SDRAM_SIZE |
| 75 | #define PHYS_SDRAM_SIZE (1024 << 20) |
| 76 | #endif |
| 77 | |
| 78 | #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM |
| 79 | #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR |
| 80 | #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE |
| 81 | |
| 82 | #define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - \ |
| 83 | GENERATED_GBL_DATA_SIZE) |
| 84 | #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \ |
| 85 | CONFIG_SYS_INIT_SP_OFFSET) |
| 86 | |
| 87 | #define CONFIG_SYS_MALLOC_LEN (16 * 1024 * 1024) |
| 88 | |
Stefan Roese | 7f2b1ec | 2014-12-10 10:15:23 +0100 | [diff] [blame] | 89 | #ifdef CONFIG_CMD_NAND |
| 90 | |
| 91 | /* NAND config */ |
| 92 | #define CONFIG_NAND_MXS |
| 93 | #ifndef CONFIG_SYS_NAND_MAX_CHIPS |
| 94 | #define CONFIG_SYS_NAND_MAX_CHIPS 2 |
| 95 | #endif |
| 96 | #define CONFIG_SYS_MAX_NAND_DEVICE 1 |
| 97 | #define CONFIG_SYS_NAND_BASE 0x40000000 |
| 98 | #define CONFIG_SYS_NAND_5_ADDR_CYCLE |
| 99 | #define CONFIG_SYS_NAND_ONFI_DETECTION |
| 100 | |
| 101 | /* DMA config, needed for GPMI/MXS NAND support */ |
| 102 | #define CONFIG_APBH_DMA |
| 103 | #define CONFIG_APBH_DMA_BURST |
| 104 | #define CONFIG_APBH_DMA_BURST8 |
| 105 | |
| 106 | /* Fuse support */ |
| 107 | #define CONFIG_MXC_OCOTP |
| 108 | |
| 109 | /* Environment in NAND */ |
| 110 | #define CONFIG_ENV_IS_IN_NAND |
| 111 | #define CONFIG_ENV_OFFSET (16 << 20) |
| 112 | #define CONFIG_ENV_SECT_SIZE (128 << 10) |
| 113 | #define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE |
| 114 | #define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + (512 << 10)) |
| 115 | #define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE |
| 116 | |
| 117 | #else /* CONFIG_CMD_NAND */ |
| 118 | |
| 119 | /* Environment in MMC */ |
| 120 | #define CONFIG_ENV_SIZE (8 << 10) |
| 121 | #define CONFIG_ENV_IS_IN_MMC |
| 122 | #define CONFIG_ENV_OFFSET (6 * 64 * 1024) |
| 123 | #define CONFIG_SYS_MMC_ENV_DEV 0 |
| 124 | |
| 125 | #endif /* CONFIG_CMD_NAND */ |
| 126 | |
| 127 | /* |
| 128 | * U-Boot configuration |
| 129 | */ |
| 130 | |
Stefan Roese | 7f2b1ec | 2014-12-10 10:15:23 +0100 | [diff] [blame] | 131 | /* Board startup config */ |
| 132 | #define CONFIG_BOARD_EARLY_INIT_F |
| 133 | #define CONFIG_MISC_INIT_R |
| 134 | |
Stefan Roese | 7f2b1ec | 2014-12-10 10:15:23 +0100 | [diff] [blame] | 135 | #define CONFIG_SYS_MEMTEST_START PHYS_SDRAM |
| 136 | #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + \ |
| 137 | PHYS_SDRAM_SIZE - (12 << 20)) |
| 138 | |
Stefan Roese | 7f2b1ec | 2014-12-10 10:15:23 +0100 | [diff] [blame] | 139 | #define CONFIG_BOOTCOMMAND "run bootubi_scr" |
| 140 | |
| 141 | /* Miscellaneous configurable options */ |
Stefan Roese | 7f2b1ec | 2014-12-10 10:15:23 +0100 | [diff] [blame] | 142 | #define CONFIG_PREBOOT |
| 143 | |
Stefan Roese | 7f2b1ec | 2014-12-10 10:15:23 +0100 | [diff] [blame] | 144 | /* Print Buffer Size */ |
| 145 | #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \ |
| 146 | sizeof(CONFIG_SYS_PROMPT) + 16) |
Stefan Roese | 7f2b1ec | 2014-12-10 10:15:23 +0100 | [diff] [blame] | 147 | |
Stefan Roese | 7f2b1ec | 2014-12-10 10:15:23 +0100 | [diff] [blame] | 148 | /* MTD/UBI/UBIFS config */ |
| 149 | #define CONFIG_LZO |
| 150 | #define CONFIG_MTD_DEVICE |
| 151 | #define CONFIG_MTD_PARTITIONS |
| 152 | #define CONFIG_RBTREE |
| 153 | |
| 154 | #if (CONFIG_SYS_NAND_MAX_CHIPS == 1) |
| 155 | #define MTDIDS_DEFAULT "nand0=gpmi-nand" |
| 156 | #define MTDPARTS_DEFAULT "mtdparts=gpmi-nand:14M(spl),2M(uboot)," \ |
| 157 | "512k(env1),512k(env2),-(ubi)" |
| 158 | #elif (CONFIG_SYS_NAND_MAX_CHIPS == 2) |
| 159 | #define MTDIDS_DEFAULT "nand0=gpmi-nand" |
| 160 | #define MTDPARTS_DEFAULT "mtdparts=gpmi-nand:14M(spl),2M(uboot)," \ |
| 161 | "512k(env1),512k(env2),495M(ubi0)," \ |
| 162 | "14M(res0),2M(res1)," \ |
| 163 | "512k(res2),512k(res3),-(ubi1)" |
| 164 | #endif |
| 165 | |
Stefan Roese | 7f2b1ec | 2014-12-10 10:15:23 +0100 | [diff] [blame] | 166 | /* |
| 167 | * Environment configuration |
| 168 | */ |
| 169 | |
| 170 | #if (CONFIG_SYS_NAND_MAX_CHIPS == 1) |
| 171 | #define CONFIG_COMMON_ENV_UBI \ |
| 172 | "setubipartition=env set ubipartition ubi\0" \ |
| 173 | "setubirfs=env set ubirfs $ubipartition:rootfs$boot_vol\0" |
| 174 | #elif (CONFIG_SYS_NAND_MAX_CHIPS == 2) |
| 175 | #define CONFIG_COMMON_ENV_UBI \ |
| 176 | "setubipartition=env set ubipartition ubi$boot_vol\0" \ |
| 177 | "setubirfs=env set ubirfs ubi0:rootfs\0" |
| 178 | #endif |
| 179 | |
| 180 | #define CONFIG_COMMON_ENV_MISC \ |
| 181 | "user=user\0" \ |
| 182 | "project="CONFIG_PLATINUM_PROJECT"\0" \ |
| 183 | "uimage=uImage\0" \ |
| 184 | "dtb="CONFIG_PLATINUM_CPU"-platinum-"CONFIG_PLATINUM_PROJECT".dtb\0" \ |
| 185 | "serverip=serverip\0" \ |
| 186 | "memaddrlinux=0x10800000\0" \ |
| 187 | "memaddrsrc=0x11000000\0" \ |
| 188 | "memaddrdtb=0x12000000\0" \ |
| 189 | "console=ttymxc0\0" \ |
| 190 | "baudrate=115200\0" \ |
| 191 | "boot_scr=boot.uboot\0" \ |
| 192 | "boot_vol=0\0" \ |
| 193 | "mtdids="MTDIDS_DEFAULT"\0" \ |
| 194 | "mtdparts="MTDPARTS_DEFAULT"\0" \ |
| 195 | "mmcfs=ext2\0" \ |
| 196 | "mmcrootpart=1\0" \ |
| 197 | \ |
| 198 | "setnfspath=env set nfspath /home/nfs/$user/$project/root\0" \ |
| 199 | "settftpfilelinux=env set tftpfilelinux $user/$project/$uimage\0" \ |
| 200 | "settftpfiledtb=env set tftpfiledtb $user/$project/$dtb\0" \ |
| 201 | "setubifilelinux=env set ubifilelinux boot/$uimage\0" \ |
| 202 | "setubipfiledtb=env set ubifiledtb boot/$dtb\0" \ |
| 203 | "setmmcrootdev=env set mmcrootdev /dev/mmcblk0p$mmcrootpart\0" \ |
| 204 | "setmmcfilelinux=env set mmcfilelinux /boot/$uimage\0" \ |
| 205 | "setmmcfiledtb=env set mmcfiledtb /boot/$dtb\0" \ |
| 206 | \ |
| 207 | "loadtftpkernel=dhcp $memaddrlinux $tftpfilelinux\0" \ |
| 208 | "loadtftpdtb=dhcp $memaddrdtb $tftpfiledtb\0" \ |
| 209 | "loadubikernel=ubifsload $memaddrlinux $ubifilelinux\0" \ |
| 210 | "loadubidtb=ubifsload $memaddrdtb $ubifiledtb\0" \ |
| 211 | "loadmmckernel=${mmcfs}load mmc 0:$mmcrootpart $memaddrlinux " \ |
| 212 | "$mmcfilelinux\0" \ |
| 213 | "loadmmcdtb=${mmcfs}load mmc 0:$mmcrootpart $memaddrdtb " \ |
| 214 | "$mmcfiledtb\0" \ |
| 215 | \ |
| 216 | "ubipart=ubi part $ubipartition\0" \ |
| 217 | "ubimount=ubifsmount $ubirfs\0" \ |
| 218 | \ |
| 219 | "setbootargscommon=env set bootargs $bootargs " \ |
| 220 | "console=$console,$baudrate enable_wait_mode=off\0" \ |
| 221 | "setbootargsmtd=env set bootargs $bootargs $mtdparts\0" \ |
| 222 | "setbootargsdhcp=env set bootargs $bootargs ip=dhcp\0" \ |
| 223 | "setbootargsubirfs=env set bootargs $bootargs " \ |
| 224 | "ubi.mtd=$ubipartition root=$ubirfs rootfstype=ubifs\0" \ |
| 225 | "setbootargsnfsrfs=env set bootargs $bootargs root=/dev/nfs " \ |
| 226 | "nfsroot=$serverip:$nfspath,v3,tcp\0" \ |
| 227 | "setbootargsmmcrfs=env set bootargs $bootargs " \ |
| 228 | "root=$mmcrootdev rootwait rw\0" \ |
| 229 | \ |
| 230 | "bootnet=run settftpfilelinux settftpfiledtb setnfspath " \ |
| 231 | "setbootargscommon setbootargsmtd setbootargsdhcp " \ |
| 232 | "setbootargsnfsrfs;" \ |
| 233 | "run loadtftpkernel loadtftpdtb;" \ |
| 234 | "bootm $memaddrlinux - $memaddrdtb\0" \ |
| 235 | "bootnet_ubirfs=run settftpfilelinux settftpfiledtb;" \ |
| 236 | "run setubipartition setubirfs;" \ |
| 237 | "run setbootargscommon setbootargsmtd " \ |
| 238 | "setbootargsubirfs;" \ |
| 239 | "run loadtftpkernel loadtftpdtb;" \ |
| 240 | "bootm $memaddrlinux - $memaddrdtb\0" \ |
| 241 | "bootubi=run setubipartition setubirfs setubifilelinux " \ |
| 242 | "setubipfiledtb;" \ |
| 243 | "run setbootargscommon setbootargsmtd " \ |
| 244 | "setbootargsubirfs;" \ |
| 245 | "run ubipart ubimount loadubikernel loadubidtb;" \ |
| 246 | "bootm $memaddrlinux - $memaddrdtb\0" \ |
| 247 | "bootubi_scr=run setubipartition setubirfs;" \ |
| 248 | "run ubipart ubimount;" \ |
| 249 | "if ubifsload ${memaddrsrc} boot/${boot_scr}; " \ |
| 250 | "then source ${memaddrsrc}; else run bootubi; fi\0" \ |
| 251 | "bootmmc=run setmmcrootdev setmmcfilelinux setmmcfiledtb " \ |
| 252 | "setbootargscommon setbootargsmmcrfs;" \ |
| 253 | "run loadmmckernel loadmmcdtb;" \ |
| 254 | "bootm $memaddrlinux - $memaddrdtb\0" \ |
| 255 | \ |
| 256 | "bootcmd="CONFIG_BOOTCOMMAND"\0" |
| 257 | |
| 258 | #define CONFIG_COMMON_ENV_SETTINGS CONFIG_COMMON_ENV_MISC \ |
| 259 | CONFIG_COMMON_ENV_UBI |
| 260 | #endif /* __PLATINUM_CONFIG_H__ */ |