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