Marek Vasut | 78687b7 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com> |
| 3 | * on behalf of DENX Software Engineering GmbH |
| 4 | * |
Wolfgang Denk | bd8ec7e | 2013-10-07 13:07:26 +0200 | [diff] [blame] | 5 | * SPDX-License-Identifier: GPL-2.0+ |
Marek Vasut | 78687b7 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 6 | */ |
Marek Vasut | b51f8ae | 2013-06-16 15:39:02 +0200 | [diff] [blame] | 7 | #ifndef __CONFIGS_M28EVK_H__ |
| 8 | #define __CONFIGS_M28EVK_H__ |
Marek Vasut | 78687b7 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 9 | |
Marek Vasut | b51f8ae | 2013-06-16 15:39:02 +0200 | [diff] [blame] | 10 | /* System configurations */ |
| 11 | #define CONFIG_MX28 /* i.MX28 SoC */ |
Wolfgang Denk | bed617d | 2013-03-23 23:50:35 +0000 | [diff] [blame] | 12 | #define CONFIG_MACH_TYPE MACH_TYPE_M28EVK |
Marek Vasut | 78687b7 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 13 | |
Marek Vasut | eb0c701 | 2014-06-26 11:01:27 +0200 | [diff] [blame] | 14 | #define CONFIG_TIMESTAMP /* Print image info with timestamp */ |
| 15 | |
Marek Vasut | b51f8ae | 2013-06-16 15:39:02 +0200 | [diff] [blame] | 16 | /* U-Boot Commands */ |
Marek Vasut | eb0c701 | 2014-06-26 11:01:27 +0200 | [diff] [blame] | 17 | #define CONFIG_FAT_WRITE |
Marek Vasut | 78687b7 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 18 | |
Wolfgang Denk | bed617d | 2013-03-23 23:50:35 +0000 | [diff] [blame] | 19 | #define CONFIG_CMD_NAND |
Marek Vasut | e154c71 | 2013-07-07 20:20:26 +0200 | [diff] [blame] | 20 | #define CONFIG_CMD_NAND_TRIMFFS |
Marek Vasut | 78687b7 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 21 | |
Marek Vasut | b51f8ae | 2013-06-16 15:39:02 +0200 | [diff] [blame] | 22 | /* Memory configuration */ |
Wolfgang Denk | bed617d | 2013-03-23 23:50:35 +0000 | [diff] [blame] | 23 | #define CONFIG_NR_DRAM_BANKS 1 /* 1 bank of DRAM */ |
| 24 | #define PHYS_SDRAM_1 0x40000000 /* Base address */ |
| 25 | #define PHYS_SDRAM_1_SIZE 0x20000000 /* Max 512 MB RAM */ |
Wolfgang Denk | bed617d | 2013-03-23 23:50:35 +0000 | [diff] [blame] | 26 | #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1 |
Marek Vasut | 78687b7 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 27 | |
Marek Vasut | b51f8ae | 2013-06-16 15:39:02 +0200 | [diff] [blame] | 28 | /* Environment */ |
Wolfgang Denk | bed617d | 2013-03-23 23:50:35 +0000 | [diff] [blame] | 29 | #define CONFIG_ENV_SIZE (16 * 1024) |
Marek Vasut | b51f8ae | 2013-06-16 15:39:02 +0200 | [diff] [blame] | 30 | #define CONFIG_ENV_IS_IN_NAND |
Marek Vasut | 78687b7 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 31 | |
| 32 | /* Environment is in NAND */ |
Marek Vasut | b51f8ae | 2013-06-16 15:39:02 +0200 | [diff] [blame] | 33 | #if defined(CONFIG_CMD_NAND) && defined(CONFIG_ENV_IS_IN_NAND) |
Wolfgang Denk | bed617d | 2013-03-23 23:50:35 +0000 | [diff] [blame] | 34 | #define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE |
| 35 | #define CONFIG_ENV_SECT_SIZE (128 * 1024) |
Marek Vasut | 72d2dee | 2014-06-26 11:01:28 +0200 | [diff] [blame] | 36 | #define CONFIG_ENV_RANGE (4 * CONFIG_ENV_SECT_SIZE) |
| 37 | #define CONFIG_ENV_OFFSET (24 * CONFIG_ENV_SECT_SIZE) /* 3 MiB */ |
Wolfgang Denk | bed617d | 2013-03-23 23:50:35 +0000 | [diff] [blame] | 38 | #define CONFIG_ENV_OFFSET_REDUND \ |
Marek Vasut | 78687b7 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 39 | (CONFIG_ENV_OFFSET + CONFIG_ENV_RANGE) |
| 40 | |
Wolfgang Denk | bed617d | 2013-03-23 23:50:35 +0000 | [diff] [blame] | 41 | #define CONFIG_CMD_UBIFS |
| 42 | #define CONFIG_CMD_MTDPARTS |
| 43 | #define CONFIG_RBTREE |
| 44 | #define CONFIG_LZO |
| 45 | #define CONFIG_MTD_DEVICE |
| 46 | #define CONFIG_MTD_PARTITIONS |
| 47 | #define MTDIDS_DEFAULT "nand0=gpmi-nand" |
| 48 | #define MTDPARTS_DEFAULT \ |
Marek Vasut | 94be365 | 2012-08-28 15:12:48 +0000 | [diff] [blame] | 49 | "mtdparts=gpmi-nand:" \ |
Marek Vasut | 72d2dee | 2014-06-26 11:01:28 +0200 | [diff] [blame] | 50 | "3m(u-boot)," \ |
| 51 | "512k(env1)," \ |
| 52 | "512k(env2)," \ |
| 53 | "14m(boot)," \ |
| 54 | "238m(data)," \ |
| 55 | "-@4096k(UBI)" |
Marek Vasut | 173825c | 2011-12-31 18:28:22 +0000 | [diff] [blame] | 56 | #else |
Wolfgang Denk | bed617d | 2013-03-23 23:50:35 +0000 | [diff] [blame] | 57 | #define CONFIG_ENV_IS_NOWHERE |
Marek Vasut | 78687b7 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 58 | #endif |
| 59 | |
Marek Vasut | b51f8ae | 2013-06-16 15:39:02 +0200 | [diff] [blame] | 60 | /* FEC Ethernet on SoC */ |
| 61 | #ifdef CONFIG_CMD_NET |
Wolfgang Denk | bed617d | 2013-03-23 23:50:35 +0000 | [diff] [blame] | 62 | #define CONFIG_FEC_MXC |
Marek Vasut | 78687b7 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 63 | #endif |
| 64 | |
Marek Vasut | b51f8ae | 2013-06-16 15:39:02 +0200 | [diff] [blame] | 65 | /* RTC */ |
| 66 | #ifdef CONFIG_CMD_DATE |
Marek Vasut | 78687b7 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 67 | /* Use the internal RTC in the MXS chip */ |
Wolfgang Denk | bed617d | 2013-03-23 23:50:35 +0000 | [diff] [blame] | 68 | #define CONFIG_RTC_INTERNAL |
Marek Vasut | b51f8ae | 2013-06-16 15:39:02 +0200 | [diff] [blame] | 69 | #ifdef CONFIG_RTC_INTERNAL |
Wolfgang Denk | bed617d | 2013-03-23 23:50:35 +0000 | [diff] [blame] | 70 | #define CONFIG_RTC_MXS |
Marek Vasut | 78687b7 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 71 | #else |
Wolfgang Denk | bed617d | 2013-03-23 23:50:35 +0000 | [diff] [blame] | 72 | #define CONFIG_RTC_M41T62 |
| 73 | #define CONFIG_SYS_I2C_RTC_ADDR 0x68 |
| 74 | #define CONFIG_SYS_M41T11_BASE_YEAR 2000 |
Marek Vasut | 78687b7 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 75 | #endif |
| 76 | #endif |
| 77 | |
Marek Vasut | b51f8ae | 2013-06-16 15:39:02 +0200 | [diff] [blame] | 78 | /* USB */ |
| 79 | #ifdef CONFIG_CMD_USB |
Marek Vasut | 191a2ce | 2013-02-23 02:43:02 +0000 | [diff] [blame] | 80 | #define CONFIG_EHCI_MXS_PORT0 |
| 81 | #define CONFIG_EHCI_MXS_PORT1 |
| 82 | #define CONFIG_USB_MAX_CONTROLLER_COUNT 2 |
Marek Vasut | bf4362f | 2011-11-08 23:18:27 +0000 | [diff] [blame] | 83 | #endif |
| 84 | |
Marek Vasut | b51f8ae | 2013-06-16 15:39:02 +0200 | [diff] [blame] | 85 | /* SPI */ |
| 86 | #ifdef CONFIG_CMD_SPI |
Wolfgang Denk | bed617d | 2013-03-23 23:50:35 +0000 | [diff] [blame] | 87 | #define CONFIG_DEFAULT_SPI_BUS 2 |
| 88 | #define CONFIG_DEFAULT_SPI_CS 0 |
| 89 | #define CONFIG_DEFAULT_SPI_MODE SPI_MODE_0 |
Marek Vasut | 78687b7 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 90 | |
| 91 | /* SPI FLASH */ |
Marek Vasut | b51f8ae | 2013-06-16 15:39:02 +0200 | [diff] [blame] | 92 | #ifdef CONFIG_CMD_SF |
Wolfgang Denk | bed617d | 2013-03-23 23:50:35 +0000 | [diff] [blame] | 93 | #define CONFIG_SF_DEFAULT_BUS 2 |
| 94 | #define CONFIG_SF_DEFAULT_CS 0 |
| 95 | #define CONFIG_SF_DEFAULT_SPEED 40000000 |
| 96 | #define CONFIG_SF_DEFAULT_MODE SPI_MODE_0 |
Marek Vasut | 78687b7 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 97 | |
Wolfgang Denk | bed617d | 2013-03-23 23:50:35 +0000 | [diff] [blame] | 98 | #define CONFIG_ENV_SPI_BUS 2 |
| 99 | #define CONFIG_ENV_SPI_CS 0 |
| 100 | #define CONFIG_ENV_SPI_MAX_HZ 40000000 |
| 101 | #define CONFIG_ENV_SPI_MODE SPI_MODE_0 |
Marek Vasut | 78687b7 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 102 | #endif |
Marek Vasut | b51f8ae | 2013-06-16 15:39:02 +0200 | [diff] [blame] | 103 | |
Marek Vasut | 78687b7 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 104 | #endif |
| 105 | |
Marek Vasut | b51f8ae | 2013-06-16 15:39:02 +0200 | [diff] [blame] | 106 | /* LCD */ |
| 107 | #ifdef CONFIG_VIDEO |
Marek Vasut | 34ce0e1 | 2013-04-28 09:20:04 +0000 | [diff] [blame] | 108 | #define CONFIG_VIDEO_LOGO |
Marek Vasut | 34ce0e1 | 2013-04-28 09:20:04 +0000 | [diff] [blame] | 109 | #define CONFIG_SPLASH_SCREEN |
Marek Vasut | 34ce0e1 | 2013-04-28 09:20:04 +0000 | [diff] [blame] | 110 | #define CONFIG_BMP_16BPP |
| 111 | #define CONFIG_VIDEO_BMP_RLE8 |
| 112 | #define CONFIG_VIDEO_BMP_GZIP |
Marek Vasut | eb0c701 | 2014-06-26 11:01:27 +0200 | [diff] [blame] | 113 | #define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (2 << 20) |
Marek Vasut | 34ce0e1 | 2013-04-28 09:20:04 +0000 | [diff] [blame] | 114 | #endif |
| 115 | |
Marek Vasut | b51f8ae | 2013-06-16 15:39:02 +0200 | [diff] [blame] | 116 | /* Booting Linux */ |
Lothar Rubusch | 65af06e | 2014-06-26 11:01:29 +0200 | [diff] [blame] | 117 | #define CONFIG_BOOTFILE "fitImage" |
Wolfgang Denk | bed617d | 2013-03-23 23:50:35 +0000 | [diff] [blame] | 118 | #define CONFIG_BOOTARGS "console=ttyAMA0,115200n8 " |
Lothar Rubusch | 65af06e | 2014-06-26 11:01:29 +0200 | [diff] [blame] | 119 | #define CONFIG_BOOTCOMMAND "run mmc_mmc" |
Wolfgang Denk | bed617d | 2013-03-23 23:50:35 +0000 | [diff] [blame] | 120 | #define CONFIG_LOADADDR 0x42000000 |
| 121 | #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR |
Marek Vasut | 78687b7 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 122 | |
Marek Vasut | b51f8ae | 2013-06-16 15:39:02 +0200 | [diff] [blame] | 123 | /* Extra Environment */ |
Lothar Rubusch | 65af06e | 2014-06-26 11:01:29 +0200 | [diff] [blame] | 124 | #define CONFIG_PREBOOT "run try_bootscript" |
| 125 | #define CONFIG_HOSTNAME m28evk |
| 126 | |
Wolfgang Denk | bed617d | 2013-03-23 23:50:35 +0000 | [diff] [blame] | 127 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
Lothar Rubusch | 65af06e | 2014-06-26 11:01:29 +0200 | [diff] [blame] | 128 | "consdev=ttyAMA0\0" \ |
| 129 | "baudrate=115200\0" \ |
Marek Vasut | 04457b7 | 2014-10-12 00:00:50 +0200 | [diff] [blame] | 130 | "bootscript=boot.scr\0" \ |
Lothar Rubusch | 65af06e | 2014-06-26 11:01:29 +0200 | [diff] [blame] | 131 | "bootdev=/dev/mmcblk0p2\0" \ |
| 132 | "rootdev=/dev/mmcblk0p3\0" \ |
| 133 | "netdev=eth0\0" \ |
| 134 | "hostname=m28evk\0" \ |
| 135 | "rootpath=/opt/eldk-5.5/armv5te/rootfs-qte-sdk\0" \ |
| 136 | "kernel_addr_r=0x42000000\0" \ |
| 137 | "videomode=video=ctfb:x:800,y:480,depth:18,mode:0,pclk:30066," \ |
| 138 | "le:0,ri:256,up:0,lo:45,hs:1,vs:1,sync:100663296," \ |
| 139 | "vmode:0\0" \ |
Marek Vasut | 78687b7 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 140 | "update_nand_full_filename=u-boot.nand\0" \ |
| 141 | "update_nand_firmware_filename=u-boot.sb\0" \ |
Marek Vasut | f501386 | 2012-05-01 11:09:43 +0000 | [diff] [blame] | 142 | "update_sd_firmware_filename=u-boot.sd\0" \ |
Marek Vasut | 78687b7 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 143 | "update_nand_firmware_maxsz=0x100000\0" \ |
| 144 | "update_nand_stride=0x40\0" /* MX28 datasheet ch. 12.12 */ \ |
| 145 | "update_nand_count=0x4\0" /* MX28 datasheet ch. 12.12 */ \ |
| 146 | "update_nand_get_fcb_size=" /* Get size of FCB blocks */ \ |
| 147 | "nand device 0 ; " \ |
| 148 | "nand info ; " \ |
| 149 | "setexpr fcb_sz ${update_nand_stride} * ${update_nand_count};" \ |
| 150 | "setexpr update_nand_fcb ${fcb_sz} * ${nand_writesize}\0" \ |
| 151 | "update_nand_full=" /* Update FCB, DBBT and FW */ \ |
| 152 | "if tftp ${update_nand_full_filename} ; then " \ |
| 153 | "run update_nand_get_fcb_size ; " \ |
| 154 | "nand scrub -y 0x0 ${filesize} ; " \ |
Lothar Rubusch | 65af06e | 2014-06-26 11:01:29 +0200 | [diff] [blame] | 155 | "nand write.raw ${loadaddr} 0x0 ${fcb_sz} ; " \ |
Marek Vasut | 78687b7 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 156 | "setexpr update_off ${loadaddr} + ${update_nand_fcb} ; " \ |
| 157 | "setexpr update_sz ${filesize} - ${update_nand_fcb} ; " \ |
| 158 | "nand write ${update_off} ${update_nand_fcb} ${update_sz} ; " \ |
| 159 | "fi\0" \ |
| 160 | "update_nand_firmware=" /* Update only firmware */ \ |
| 161 | "if tftp ${update_nand_firmware_filename} ; then " \ |
| 162 | "run update_nand_get_fcb_size ; " \ |
| 163 | "setexpr fcb_sz ${update_nand_fcb} * 2 ; " /* FCB + DBBT */ \ |
| 164 | "setexpr fw_sz ${update_nand_firmware_maxsz} * 2 ; " \ |
| 165 | "setexpr fw_off ${fcb_sz} + ${update_nand_firmware_maxsz};" \ |
| 166 | "nand erase ${fcb_sz} ${fw_sz} ; " \ |
| 167 | "nand write ${loadaddr} ${fcb_sz} ${filesize} ; " \ |
| 168 | "nand write ${loadaddr} ${fw_off} ${filesize} ; " \ |
Marek Vasut | f501386 | 2012-05-01 11:09:43 +0000 | [diff] [blame] | 169 | "fi\0" \ |
| 170 | "update_sd_firmware=" /* Update the SD firmware partition */ \ |
| 171 | "if mmc rescan ; then " \ |
| 172 | "if tftp ${update_sd_firmware_filename} ; then " \ |
| 173 | "setexpr fw_sz ${filesize} / 0x200 ; " /* SD block size */ \ |
| 174 | "setexpr fw_sz ${fw_sz} + 1 ; " \ |
| 175 | "mmc write ${loadaddr} 0x800 ${fw_sz} ; " \ |
| 176 | "fi ; " \ |
Lothar Rubusch | 65af06e | 2014-06-26 11:01:29 +0200 | [diff] [blame] | 177 | "fi\0" \ |
| 178 | "addcons=" \ |
| 179 | "setenv bootargs ${bootargs} " \ |
| 180 | "console=${consdev},${baudrate}\0" \ |
| 181 | "addip=" \ |
| 182 | "setenv bootargs ${bootargs} " \ |
| 183 | "ip=${ipaddr}:${serverip}:${gatewayip}:" \ |
| 184 | "${netmask}:${hostname}:${netdev}:off\0" \ |
| 185 | "addmisc=" \ |
| 186 | "setenv bootargs ${bootargs} ${miscargs}\0" \ |
| 187 | "adddfltmtd=" \ |
| 188 | "if test \"x${mtdparts}\" == \"x\" ; then " \ |
| 189 | "mtdparts default ; " \ |
| 190 | "fi\0" \ |
| 191 | "addmtd=" \ |
| 192 | "run adddfltmtd ; " \ |
| 193 | "setenv bootargs ${bootargs} ${mtdparts}\0" \ |
| 194 | "addargs=run addcons addmtd addmisc\0" \ |
| 195 | "mmcload=" \ |
| 196 | "mmc rescan ; " \ |
Marek Vasut | bfbeff2 | 2014-09-23 13:18:20 +0200 | [diff] [blame] | 197 | "load mmc 0:2 ${kernel_addr_r} ${bootfile}\0" \ |
Lothar Rubusch | 65af06e | 2014-06-26 11:01:29 +0200 | [diff] [blame] | 198 | "ubiload=" \ |
| 199 | "ubi part UBI ; ubifsmount ubi0:rootfs ; " \ |
| 200 | "ubifsload ${kernel_addr_r} /boot/${bootfile}\0" \ |
| 201 | "netload=" \ |
| 202 | "tftp ${kernel_addr_r} ${hostname}/${bootfile}\0" \ |
| 203 | "miscargs=nohlt panic=1\0" \ |
| 204 | "mmcargs=setenv bootargs root=${rootdev} rw rootwait\0" \ |
| 205 | "ubiargs=" \ |
| 206 | "setenv bootargs ubi.mtd=5 " \ |
| 207 | "root=ubi0:rootfs rootfstype=ubifs\0" \ |
| 208 | "nfsargs=" \ |
| 209 | "setenv bootargs root=/dev/nfs rw " \ |
| 210 | "nfsroot=${serverip}:${rootpath},v3,tcp\0" \ |
| 211 | "mmc_mmc=" \ |
| 212 | "run mmcload mmcargs addargs ; " \ |
| 213 | "bootm ${kernel_addr_r}\0" \ |
| 214 | "mmc_ubi=" \ |
| 215 | "run mmcload ubiargs addargs ; " \ |
| 216 | "bootm ${kernel_addr_r}\0" \ |
| 217 | "mmc_nfs=" \ |
| 218 | "run mmcload nfsargs addip addargs ; " \ |
| 219 | "bootm ${kernel_addr_r}\0" \ |
| 220 | "ubi_mmc=" \ |
| 221 | "run ubiload mmcargs addargs ; " \ |
| 222 | "bootm ${kernel_addr_r}\0" \ |
| 223 | "ubi_ubi=" \ |
| 224 | "run ubiload ubiargs addargs ; " \ |
| 225 | "bootm ${kernel_addr_r}\0" \ |
| 226 | "ubi_nfs=" \ |
| 227 | "run ubiload nfsargs addip addargs ; " \ |
| 228 | "bootm ${kernel_addr_r}\0" \ |
| 229 | "net_mmc=" \ |
| 230 | "run netload mmcargs addargs ; " \ |
| 231 | "bootm ${kernel_addr_r}\0" \ |
| 232 | "net_ubi=" \ |
| 233 | "run netload ubiargs addargs ; " \ |
| 234 | "bootm ${kernel_addr_r}\0" \ |
| 235 | "net_nfs=" \ |
| 236 | "run netload nfsargs addip addargs ; " \ |
| 237 | "bootm ${kernel_addr_r}\0" \ |
| 238 | "try_bootscript=" \ |
| 239 | "mmc rescan;" \ |
Marek Vasut | eab2cb6 | 2014-09-23 13:18:18 +0200 | [diff] [blame] | 240 | "if test -e mmc 0:2 ${bootscript} ; then " \ |
Marek Vasut | bfbeff2 | 2014-09-23 13:18:20 +0200 | [diff] [blame] | 241 | "if load mmc 0:2 ${kernel_addr_r} ${bootscript};" \ |
Marek Vasut | a977f48 | 2014-09-25 21:14:16 +0200 | [diff] [blame] | 242 | "then ; " \ |
| 243 | "echo Running bootscript... ; " \ |
| 244 | "source ${kernel_addr_r} ; " \ |
Marek Vasut | eab2cb6 | 2014-09-23 13:18:18 +0200 | [diff] [blame] | 245 | "fi ; " \ |
Marek Vasut | 78687b7 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 246 | "fi\0" |
| 247 | |
Marek Vasut | b51f8ae | 2013-06-16 15:39:02 +0200 | [diff] [blame] | 248 | /* The rest of the configuration is shared */ |
| 249 | #include <configs/mxs.h> |
| 250 | |
| 251 | #endif /* __CONFIGS_M28EVK_H__ */ |