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