Marek Vasut | fc10272 | 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 | 3765b3e | 2013-10-07 13:07:26 +0200 | [diff] [blame] | 5 | * SPDX-License-Identifier: GPL-2.0+ |
Marek Vasut | fc10272 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 6 | */ |
Marek Vasut | 5434caf | 2013-06-16 15:39:02 +0200 | [diff] [blame] | 7 | #ifndef __CONFIGS_M28EVK_H__ |
| 8 | #define __CONFIGS_M28EVK_H__ |
Marek Vasut | fc10272 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 9 | |
Marek Vasut | 5434caf | 2013-06-16 15:39:02 +0200 | [diff] [blame] | 10 | /* System configurations */ |
Wolfgang Denk | 5f71bca | 2013-03-23 23:50:35 +0000 | [diff] [blame] | 11 | #define CONFIG_MX28 /* i.MX28 SoC */ |
Wolfgang Denk | 5f71bca | 2013-03-23 23:50:35 +0000 | [diff] [blame] | 12 | #define MACH_TYPE_M28EVK 3613 |
Wolfgang Denk | 5f71bca | 2013-03-23 23:50:35 +0000 | [diff] [blame] | 13 | #define CONFIG_MACH_TYPE MACH_TYPE_M28EVK |
Marek Vasut | fc10272 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 14 | |
Marek Vasut | 5434caf | 2013-06-16 15:39:02 +0200 | [diff] [blame] | 15 | /* U-Boot Commands */ |
Wolfgang Denk | 5f71bca | 2013-03-23 23:50:35 +0000 | [diff] [blame] | 16 | #define CONFIG_SYS_NO_FLASH |
Marek Vasut | fc10272 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 17 | #include <config_cmd_default.h> |
Wolfgang Denk | 5f71bca | 2013-03-23 23:50:35 +0000 | [diff] [blame] | 18 | #define CONFIG_DISPLAY_CPUINFO |
| 19 | #define CONFIG_DOS_PARTITION |
Marek Vasut | fc10272 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 20 | |
Wolfgang Denk | 5f71bca | 2013-03-23 23:50:35 +0000 | [diff] [blame] | 21 | #define CONFIG_CMD_CACHE |
| 22 | #define CONFIG_CMD_DATE |
| 23 | #define CONFIG_CMD_DHCP |
| 24 | #define CONFIG_CMD_EEPROM |
| 25 | #define CONFIG_CMD_EXT2 |
| 26 | #define CONFIG_CMD_FAT |
| 27 | #define CONFIG_CMD_GPIO |
Wolfgang Denk | ee747a2 | 2013-03-23 23:50:36 +0000 | [diff] [blame] | 28 | #define CONFIG_CMD_GREPENV |
Wolfgang Denk | 5f71bca | 2013-03-23 23:50:35 +0000 | [diff] [blame] | 29 | #define CONFIG_CMD_I2C |
| 30 | #define CONFIG_CMD_MII |
| 31 | #define CONFIG_CMD_MMC |
| 32 | #define CONFIG_CMD_NAND |
Marek Vasut | 32cc24d | 2013-07-07 20:20:26 +0200 | [diff] [blame] | 33 | #define CONFIG_CMD_NAND_TRIMFFS |
Wolfgang Denk | 5f71bca | 2013-03-23 23:50:35 +0000 | [diff] [blame] | 34 | #define CONFIG_CMD_NET |
| 35 | #define CONFIG_CMD_NFS |
| 36 | #define CONFIG_CMD_PING |
| 37 | #define CONFIG_CMD_SETEXPR |
| 38 | #define CONFIG_CMD_SF |
| 39 | #define CONFIG_CMD_SPI |
| 40 | #define CONFIG_CMD_USB |
Marek Vasut | d782c1f | 2013-04-28 09:20:04 +0000 | [diff] [blame] | 41 | #define CONFIG_VIDEO |
Marek Vasut | fc10272 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 42 | |
Wolfgang Denk | ee747a2 | 2013-03-23 23:50:36 +0000 | [diff] [blame] | 43 | #define CONFIG_REGEX /* Enable regular expression support */ |
| 44 | |
Marek Vasut | 5434caf | 2013-06-16 15:39:02 +0200 | [diff] [blame] | 45 | /* Memory configuration */ |
Wolfgang Denk | 5f71bca | 2013-03-23 23:50:35 +0000 | [diff] [blame] | 46 | #define CONFIG_NR_DRAM_BANKS 1 /* 1 bank of DRAM */ |
| 47 | #define PHYS_SDRAM_1 0x40000000 /* Base address */ |
| 48 | #define PHYS_SDRAM_1_SIZE 0x20000000 /* Max 512 MB RAM */ |
Wolfgang Denk | 5f71bca | 2013-03-23 23:50:35 +0000 | [diff] [blame] | 49 | #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1 |
Fabio Estevam | 1084606 | 2011-12-29 03:35:38 +0000 | [diff] [blame] | 50 | |
Marek Vasut | 5434caf | 2013-06-16 15:39:02 +0200 | [diff] [blame] | 51 | /* Environment */ |
Wolfgang Denk | 5f71bca | 2013-03-23 23:50:35 +0000 | [diff] [blame] | 52 | #define CONFIG_ENV_SIZE (16 * 1024) |
Marek Vasut | 5434caf | 2013-06-16 15:39:02 +0200 | [diff] [blame] | 53 | #define CONFIG_ENV_IS_IN_NAND |
Marek Vasut | fc10272 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 54 | |
| 55 | /* Environment is in NAND */ |
Marek Vasut | 5434caf | 2013-06-16 15:39:02 +0200 | [diff] [blame] | 56 | #if defined(CONFIG_CMD_NAND) && defined(CONFIG_ENV_IS_IN_NAND) |
Wolfgang Denk | 5f71bca | 2013-03-23 23:50:35 +0000 | [diff] [blame] | 57 | #define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE |
| 58 | #define CONFIG_ENV_SECT_SIZE (128 * 1024) |
| 59 | #define CONFIG_ENV_RANGE (512 * 1024) |
| 60 | #define CONFIG_ENV_OFFSET 0x300000 |
| 61 | #define CONFIG_ENV_OFFSET_REDUND \ |
Marek Vasut | fc10272 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 62 | (CONFIG_ENV_OFFSET + CONFIG_ENV_RANGE) |
| 63 | |
Wolfgang Denk | 5f71bca | 2013-03-23 23:50:35 +0000 | [diff] [blame] | 64 | #define CONFIG_CMD_UBI |
| 65 | #define CONFIG_CMD_UBIFS |
| 66 | #define CONFIG_CMD_MTDPARTS |
| 67 | #define CONFIG_RBTREE |
| 68 | #define CONFIG_LZO |
| 69 | #define CONFIG_MTD_DEVICE |
| 70 | #define CONFIG_MTD_PARTITIONS |
| 71 | #define MTDIDS_DEFAULT "nand0=gpmi-nand" |
| 72 | #define MTDPARTS_DEFAULT \ |
Marek Vasut | c16ecb0 | 2012-08-28 15:12:48 +0000 | [diff] [blame] | 73 | "mtdparts=gpmi-nand:" \ |
Marek Vasut | fc10272 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 74 | "3m(bootloader)ro," \ |
| 75 | "512k(environment)," \ |
| 76 | "512k(redundant-environment)," \ |
| 77 | "4m(kernel)," \ |
Marek Vasut | 1f75b54 | 2012-12-25 15:08:40 +0000 | [diff] [blame] | 78 | "128k(fdt)," \ |
| 79 | "8m(ramdisk)," \ |
Marek Vasut | fc10272 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 80 | "-(filesystem)" |
Marek Vasut | c660a54 | 2011-12-31 18:28:22 +0000 | [diff] [blame] | 81 | #else |
Wolfgang Denk | 5f71bca | 2013-03-23 23:50:35 +0000 | [diff] [blame] | 82 | #define CONFIG_ENV_IS_NOWHERE |
Marek Vasut | fc10272 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 83 | #endif |
| 84 | |
Marek Vasut | 5434caf | 2013-06-16 15:39:02 +0200 | [diff] [blame] | 85 | /* FEC Ethernet on SoC */ |
| 86 | #ifdef CONFIG_CMD_NET |
Wolfgang Denk | 5f71bca | 2013-03-23 23:50:35 +0000 | [diff] [blame] | 87 | #define CONFIG_FEC_MXC |
Marek Vasut | fc10272 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 88 | #endif |
| 89 | |
Marek Vasut | 5434caf | 2013-06-16 15:39:02 +0200 | [diff] [blame] | 90 | /* EEPROM */ |
| 91 | #ifdef CONFIG_CMD_EEPROM |
Wolfgang Denk | 5f71bca | 2013-03-23 23:50:35 +0000 | [diff] [blame] | 92 | #define CONFIG_SYS_I2C_MULTI_EEPROMS |
| 93 | #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2 |
Marek Vasut | fc10272 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 94 | #endif |
| 95 | |
Marek Vasut | 5434caf | 2013-06-16 15:39:02 +0200 | [diff] [blame] | 96 | /* RTC */ |
| 97 | #ifdef CONFIG_CMD_DATE |
Marek Vasut | fc10272 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 98 | /* Use the internal RTC in the MXS chip */ |
Wolfgang Denk | 5f71bca | 2013-03-23 23:50:35 +0000 | [diff] [blame] | 99 | #define CONFIG_RTC_INTERNAL |
Marek Vasut | 5434caf | 2013-06-16 15:39:02 +0200 | [diff] [blame] | 100 | #ifdef CONFIG_RTC_INTERNAL |
Wolfgang Denk | 5f71bca | 2013-03-23 23:50:35 +0000 | [diff] [blame] | 101 | #define CONFIG_RTC_MXS |
Marek Vasut | fc10272 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 102 | #else |
Wolfgang Denk | 5f71bca | 2013-03-23 23:50:35 +0000 | [diff] [blame] | 103 | #define CONFIG_RTC_M41T62 |
| 104 | #define CONFIG_SYS_I2C_RTC_ADDR 0x68 |
| 105 | #define CONFIG_SYS_M41T11_BASE_YEAR 2000 |
Marek Vasut | fc10272 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 106 | #endif |
| 107 | #endif |
| 108 | |
Marek Vasut | 5434caf | 2013-06-16 15:39:02 +0200 | [diff] [blame] | 109 | /* USB */ |
| 110 | #ifdef CONFIG_CMD_USB |
Marek Vasut | afa8721 | 2013-02-23 02:43:02 +0000 | [diff] [blame] | 111 | #define CONFIG_EHCI_MXS_PORT0 |
| 112 | #define CONFIG_EHCI_MXS_PORT1 |
| 113 | #define CONFIG_USB_MAX_CONTROLLER_COUNT 2 |
Wolfgang Denk | 5f71bca | 2013-03-23 23:50:35 +0000 | [diff] [blame] | 114 | #define CONFIG_USB_STORAGE |
Marek Vasut | 8f59bc1 | 2011-11-08 23:18:27 +0000 | [diff] [blame] | 115 | #endif |
| 116 | |
Marek Vasut | 5434caf | 2013-06-16 15:39:02 +0200 | [diff] [blame] | 117 | /* SPI */ |
| 118 | #ifdef CONFIG_CMD_SPI |
Wolfgang Denk | 5f71bca | 2013-03-23 23:50:35 +0000 | [diff] [blame] | 119 | #define CONFIG_DEFAULT_SPI_BUS 2 |
| 120 | #define CONFIG_DEFAULT_SPI_CS 0 |
| 121 | #define CONFIG_DEFAULT_SPI_MODE SPI_MODE_0 |
Marek Vasut | fc10272 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 122 | |
| 123 | /* SPI FLASH */ |
Marek Vasut | 5434caf | 2013-06-16 15:39:02 +0200 | [diff] [blame] | 124 | #ifdef CONFIG_CMD_SF |
Wolfgang Denk | 5f71bca | 2013-03-23 23:50:35 +0000 | [diff] [blame] | 125 | #define CONFIG_SPI_FLASH |
| 126 | #define CONFIG_SPI_FLASH_STMICRO |
| 127 | #define CONFIG_SF_DEFAULT_BUS 2 |
| 128 | #define CONFIG_SF_DEFAULT_CS 0 |
| 129 | #define CONFIG_SF_DEFAULT_SPEED 40000000 |
| 130 | #define CONFIG_SF_DEFAULT_MODE SPI_MODE_0 |
Marek Vasut | fc10272 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 131 | |
Wolfgang Denk | 5f71bca | 2013-03-23 23:50:35 +0000 | [diff] [blame] | 132 | #define CONFIG_ENV_SPI_BUS 2 |
| 133 | #define CONFIG_ENV_SPI_CS 0 |
| 134 | #define CONFIG_ENV_SPI_MAX_HZ 40000000 |
| 135 | #define CONFIG_ENV_SPI_MODE SPI_MODE_0 |
Marek Vasut | fc10272 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 136 | #endif |
Marek Vasut | 5434caf | 2013-06-16 15:39:02 +0200 | [diff] [blame] | 137 | |
Marek Vasut | fc10272 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 138 | #endif |
| 139 | |
Marek Vasut | 5434caf | 2013-06-16 15:39:02 +0200 | [diff] [blame] | 140 | /* LCD */ |
| 141 | #ifdef CONFIG_VIDEO |
Marek Vasut | d782c1f | 2013-04-28 09:20:04 +0000 | [diff] [blame] | 142 | #define CONFIG_VIDEO_LOGO |
Marek Vasut | d782c1f | 2013-04-28 09:20:04 +0000 | [diff] [blame] | 143 | #define CONFIG_SPLASH_SCREEN |
| 144 | #define CONFIG_CMD_BMP |
| 145 | #define CONFIG_BMP_16BPP |
| 146 | #define CONFIG_VIDEO_BMP_RLE8 |
| 147 | #define CONFIG_VIDEO_BMP_GZIP |
| 148 | #define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (512 << 10) |
| 149 | #endif |
| 150 | |
Marek Vasut | 5434caf | 2013-06-16 15:39:02 +0200 | [diff] [blame] | 151 | /* Booting Linux */ |
Wolfgang Denk | 5f71bca | 2013-03-23 23:50:35 +0000 | [diff] [blame] | 152 | #define CONFIG_BOOTDELAY 3 |
| 153 | #define CONFIG_BOOTFILE "uImage" |
| 154 | #define CONFIG_BOOTARGS "console=ttyAMA0,115200n8 " |
| 155 | #define CONFIG_BOOTCOMMAND "run bootcmd_net" |
| 156 | #define CONFIG_LOADADDR 0x42000000 |
| 157 | #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR |
Marek Vasut | fc10272 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 158 | |
Marek Vasut | 5434caf | 2013-06-16 15:39:02 +0200 | [diff] [blame] | 159 | /* Extra Environment */ |
Wolfgang Denk | 5f71bca | 2013-03-23 23:50:35 +0000 | [diff] [blame] | 160 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
Marek Vasut | fc10272 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 161 | "update_nand_full_filename=u-boot.nand\0" \ |
| 162 | "update_nand_firmware_filename=u-boot.sb\0" \ |
Marek Vasut | 9a0f98d | 2012-05-01 11:09:43 +0000 | [diff] [blame] | 163 | "update_sd_firmware_filename=u-boot.sd\0" \ |
Marek Vasut | fc10272 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 164 | "update_nand_firmware_maxsz=0x100000\0" \ |
| 165 | "update_nand_stride=0x40\0" /* MX28 datasheet ch. 12.12 */ \ |
| 166 | "update_nand_count=0x4\0" /* MX28 datasheet ch. 12.12 */ \ |
| 167 | "update_nand_get_fcb_size=" /* Get size of FCB blocks */ \ |
| 168 | "nand device 0 ; " \ |
| 169 | "nand info ; " \ |
| 170 | "setexpr fcb_sz ${update_nand_stride} * ${update_nand_count};" \ |
| 171 | "setexpr update_nand_fcb ${fcb_sz} * ${nand_writesize}\0" \ |
| 172 | "update_nand_full=" /* Update FCB, DBBT and FW */ \ |
| 173 | "if tftp ${update_nand_full_filename} ; then " \ |
| 174 | "run update_nand_get_fcb_size ; " \ |
| 175 | "nand scrub -y 0x0 ${filesize} ; " \ |
Eric Benard | 71779d5 | 2012-12-11 11:36:21 +0000 | [diff] [blame] | 176 | "nand write.raw ${loadaddr} 0x0 ${fcb_sz} ; " \ |
Marek Vasut | fc10272 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 177 | "setexpr update_off ${loadaddr} + ${update_nand_fcb} ; " \ |
| 178 | "setexpr update_sz ${filesize} - ${update_nand_fcb} ; " \ |
| 179 | "nand write ${update_off} ${update_nand_fcb} ${update_sz} ; " \ |
| 180 | "fi\0" \ |
| 181 | "update_nand_firmware=" /* Update only firmware */ \ |
| 182 | "if tftp ${update_nand_firmware_filename} ; then " \ |
| 183 | "run update_nand_get_fcb_size ; " \ |
| 184 | "setexpr fcb_sz ${update_nand_fcb} * 2 ; " /* FCB + DBBT */ \ |
| 185 | "setexpr fw_sz ${update_nand_firmware_maxsz} * 2 ; " \ |
| 186 | "setexpr fw_off ${fcb_sz} + ${update_nand_firmware_maxsz};" \ |
| 187 | "nand erase ${fcb_sz} ${fw_sz} ; " \ |
| 188 | "nand write ${loadaddr} ${fcb_sz} ${filesize} ; " \ |
| 189 | "nand write ${loadaddr} ${fw_off} ${filesize} ; " \ |
Marek Vasut | 9a0f98d | 2012-05-01 11:09:43 +0000 | [diff] [blame] | 190 | "fi\0" \ |
| 191 | "update_sd_firmware=" /* Update the SD firmware partition */ \ |
| 192 | "if mmc rescan ; then " \ |
| 193 | "if tftp ${update_sd_firmware_filename} ; then " \ |
| 194 | "setexpr fw_sz ${filesize} / 0x200 ; " /* SD block size */ \ |
| 195 | "setexpr fw_sz ${fw_sz} + 1 ; " \ |
| 196 | "mmc write ${loadaddr} 0x800 ${fw_sz} ; " \ |
| 197 | "fi ; " \ |
Marek Vasut | fc10272 | 2011-11-08 23:18:20 +0000 | [diff] [blame] | 198 | "fi\0" |
| 199 | |
Marek Vasut | 5434caf | 2013-06-16 15:39:02 +0200 | [diff] [blame] | 200 | /* The rest of the configuration is shared */ |
| 201 | #include <configs/mxs.h> |
| 202 | |
| 203 | #endif /* __CONFIGS_M28EVK_H__ */ |