blob: 10ccc3bc375e99a9cb3fb7895f4e5d0c4b50ce65 [file] [log] [blame]
Marek Vasut78687b72011-11-08 23:18:20 +00001/*
2 * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
3 * on behalf of DENX Software Engineering GmbH
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of
8 * the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
18 * MA 02111-1307 USA
19 */
Otavio Salvadorbbcf3bf2012-05-12 13:40:15 +000020#ifndef __M28EVK_CONFIG_H__
21#define __M28EVK_CONFIG_H__
Marek Vasut78687b72011-11-08 23:18:20 +000022
Marek Vasut78687b72011-11-08 23:18:20 +000023/*
24 * SoC configurations
25 */
Wolfgang Denkbed617d2013-03-23 23:50:35 +000026#define CONFIG_MX28 /* i.MX28 SoC */
27#define CONFIG_MXS_GPIO /* GPIO control */
28#define CONFIG_SYS_HZ 1000 /* Ticks per second */
Marek Vasut78687b72011-11-08 23:18:20 +000029
30/*
31 * Define M28EVK machine type by hand until it lands in mach-types
32 */
Wolfgang Denkbed617d2013-03-23 23:50:35 +000033#define MACH_TYPE_M28EVK 3613
Marek Vasut78687b72011-11-08 23:18:20 +000034
Wolfgang Denkbed617d2013-03-23 23:50:35 +000035#define CONFIG_MACH_TYPE MACH_TYPE_M28EVK
Marek Vasut78687b72011-11-08 23:18:20 +000036
Otavio Salvadorc6152242012-08-18 07:25:26 +000037#include <asm/arch/regs-base.h>
38
Wolfgang Denkbed617d2013-03-23 23:50:35 +000039#define CONFIG_SYS_NO_FLASH
40#define CONFIG_BOARD_EARLY_INIT_F
41#define CONFIG_ARCH_MISC_INIT
Marek Vasut78687b72011-11-08 23:18:20 +000042
43/*
Marek Vasut926227e2011-11-08 23:18:21 +000044 * SPL
45 */
Wolfgang Denkbed617d2013-03-23 23:50:35 +000046#define CONFIG_SPL
47#define CONFIG_SPL_NO_CPU_SUPPORT_CODE
48#define CONFIG_SPL_START_S_PATH "arch/arm/cpu/arm926ejs/mxs"
49#define CONFIG_SPL_LDSCRIPT "arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds"
50#define CONFIG_SPL_LIBCOMMON_SUPPORT
51#define CONFIG_SPL_LIBGENERIC_SUPPORT
52#define CONFIG_SPL_GPIO_SUPPORT
Marek Vasut926227e2011-11-08 23:18:21 +000053
54/*
Marek Vasut78687b72011-11-08 23:18:20 +000055 * U-Boot Commands
56 */
57#include <config_cmd_default.h>
Wolfgang Denkbed617d2013-03-23 23:50:35 +000058#define CONFIG_DISPLAY_CPUINFO
59#define CONFIG_DOS_PARTITION
Marek Vasut78687b72011-11-08 23:18:20 +000060
Wolfgang Denkbed617d2013-03-23 23:50:35 +000061#define CONFIG_CMD_CACHE
62#define CONFIG_CMD_DATE
63#define CONFIG_CMD_DHCP
64#define CONFIG_CMD_EEPROM
65#define CONFIG_CMD_EXT2
66#define CONFIG_CMD_FAT
67#define CONFIG_CMD_GPIO
Wolfgang Denkcc1c9e72013-03-23 23:50:36 +000068#define CONFIG_CMD_GREPENV
Wolfgang Denkbed617d2013-03-23 23:50:35 +000069#define CONFIG_CMD_I2C
70#define CONFIG_CMD_MII
71#define CONFIG_CMD_MMC
72#define CONFIG_CMD_NAND
Marek Vasute154c712013-07-07 20:20:26 +020073#define CONFIG_CMD_NAND_TRIMFFS
Wolfgang Denkbed617d2013-03-23 23:50:35 +000074#define CONFIG_CMD_NET
75#define CONFIG_CMD_NFS
76#define CONFIG_CMD_PING
77#define CONFIG_CMD_SETEXPR
78#define CONFIG_CMD_SF
79#define CONFIG_CMD_SPI
80#define CONFIG_CMD_USB
Marek Vasut34ce0e12013-04-28 09:20:04 +000081#define CONFIG_VIDEO
Marek Vasut78687b72011-11-08 23:18:20 +000082
Wolfgang Denkcc1c9e72013-03-23 23:50:36 +000083#define CONFIG_REGEX /* Enable regular expression support */
84
Marek Vasut78687b72011-11-08 23:18:20 +000085/*
86 * Memory configurations
87 */
Wolfgang Denkbed617d2013-03-23 23:50:35 +000088#define CONFIG_NR_DRAM_BANKS 1 /* 1 bank of DRAM */
89#define PHYS_SDRAM_1 0x40000000 /* Base address */
90#define PHYS_SDRAM_1_SIZE 0x20000000 /* Max 512 MB RAM */
91#define CONFIG_SYS_MALLOC_LEN 0x00400000 /* 4 MB for malloc */
92#define CONFIG_SYS_GBL_DATA_SIZE 128 /* Initial data */
93#define CONFIG_SYS_MEMTEST_START 0x40000000 /* Memtest start adr */
94#define CONFIG_SYS_MEMTEST_END 0x40400000 /* 4 MB RAM test */
95#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
Marek Vasut78687b72011-11-08 23:18:20 +000096/* Point initial SP in SRAM so SPL can use it too. */
Fabio Estevam7c88c642011-12-29 03:35:38 +000097
Marek Vasutce696722012-04-01 18:21:34 +000098#define CONFIG_SYS_INIT_RAM_ADDR 0x00000000
Fabio Estevam7c88c642011-12-29 03:35:38 +000099#define CONFIG_SYS_INIT_RAM_SIZE (128 * 1024)
100
101#define CONFIG_SYS_INIT_SP_OFFSET \
102 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
103#define CONFIG_SYS_INIT_SP_ADDR \
104 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
Marek Vasut78687b72011-11-08 23:18:20 +0000105/*
106 * We need to sacrifice first 4 bytes of RAM here to avoid triggering some
107 * strange BUG in ROM corrupting first 4 bytes of RAM when loading U-Boot
108 * binary. In case there was more of this mess, 0x100 bytes are skipped.
109 */
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000110#define CONFIG_SYS_TEXT_BASE 0x40000100
Marek Vasut78687b72011-11-08 23:18:20 +0000111
112/*
113 * U-Boot general configurations
114 */
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000115#define CONFIG_SYS_LONGHELP
116#define CONFIG_SYS_PROMPT "=> "
117#define CONFIG_SYS_CBSIZE 1024 /* Console I/O buffer size */
118#define CONFIG_SYS_PBSIZE \
Marek Vasut78687b72011-11-08 23:18:20 +0000119 (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
120 /* Print buffer size */
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000121#define CONFIG_SYS_MAXARGS 32 /* Max number of command args */
122#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
Marek Vasut78687b72011-11-08 23:18:20 +0000123 /* Boot argument buffer size */
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000124#define CONFIG_VERSION_VARIABLE /* U-BOOT version */
125#define CONFIG_AUTO_COMPLETE /* Command auto complete */
126#define CONFIG_CMDLINE_EDITING /* Command history etc */
127#define CONFIG_SYS_HUSH_PARSER
Marek Vasut78687b72011-11-08 23:18:20 +0000128
129/*
130 * Serial Driver
131 */
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000132#define CONFIG_PL011_SERIAL
133#define CONFIG_PL011_CLOCK 24000000
134#define CONFIG_PL01x_PORTS { (void *)MXS_UARTDBG_BASE }
135#define CONFIG_CONS_INDEX 0
136#define CONFIG_BAUDRATE 115200 /* Default baud rate */
Marek Vasut78687b72011-11-08 23:18:20 +0000137
138/*
139 * MMC Driver
140 */
141#ifdef CONFIG_CMD_MMC
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000142#define CONFIG_MMC
143#define CONFIG_BOUNCE_BUFFER
144#define CONFIG_GENERIC_MMC
145#define CONFIG_MXS_MMC
Marek Vasut78687b72011-11-08 23:18:20 +0000146#endif
147
148/*
Marek Vasut20a23bc2012-04-08 17:09:06 +0000149 * APBH DMA
150 */
151#define CONFIG_APBH_DMA
152
153/*
Marek Vasut78687b72011-11-08 23:18:20 +0000154 * NAND
155 */
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000156#define CONFIG_ENV_SIZE (16 * 1024)
Marek Vasut78687b72011-11-08 23:18:20 +0000157#ifdef CONFIG_CMD_NAND
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000158#define CONFIG_NAND_MXS
159#define CONFIG_SYS_MAX_NAND_DEVICE 1
160#define CONFIG_SYS_NAND_BASE 0x60000000
161#define CONFIG_SYS_NAND_5_ADDR_CYCLE
Marek Vasut78687b72011-11-08 23:18:20 +0000162
163/* Environment is in NAND */
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000164#define CONFIG_ENV_IS_IN_NAND
165#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
166#define CONFIG_ENV_SECT_SIZE (128 * 1024)
167#define CONFIG_ENV_RANGE (512 * 1024)
168#define CONFIG_ENV_OFFSET 0x300000
169#define CONFIG_ENV_OFFSET_REDUND \
Marek Vasut78687b72011-11-08 23:18:20 +0000170 (CONFIG_ENV_OFFSET + CONFIG_ENV_RANGE)
171
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000172#define CONFIG_CMD_UBI
173#define CONFIG_CMD_UBIFS
174#define CONFIG_CMD_MTDPARTS
175#define CONFIG_RBTREE
176#define CONFIG_LZO
177#define CONFIG_MTD_DEVICE
178#define CONFIG_MTD_PARTITIONS
179#define MTDIDS_DEFAULT "nand0=gpmi-nand"
180#define MTDPARTS_DEFAULT \
Marek Vasut94be3652012-08-28 15:12:48 +0000181 "mtdparts=gpmi-nand:" \
Marek Vasut78687b72011-11-08 23:18:20 +0000182 "3m(bootloader)ro," \
183 "512k(environment)," \
184 "512k(redundant-environment)," \
185 "4m(kernel)," \
Marek Vasut57e6c422012-12-25 15:08:40 +0000186 "128k(fdt)," \
187 "8m(ramdisk)," \
Marek Vasut78687b72011-11-08 23:18:20 +0000188 "-(filesystem)"
Marek Vasut173825c2011-12-31 18:28:22 +0000189#else
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000190#define CONFIG_ENV_IS_NOWHERE
Marek Vasut78687b72011-11-08 23:18:20 +0000191#endif
192
193/*
194 * Ethernet on SOC (FEC)
195 */
196#ifdef CONFIG_CMD_NET
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000197#define CONFIG_ETHPRIME "FEC0"
198#define CONFIG_FEC_MXC
199#define CONFIG_MII
200#define CONFIG_FEC_XCV_TYPE RMII
Marek Vasut78687b72011-11-08 23:18:20 +0000201#endif
202
203/*
204 * I2C
205 */
206#ifdef CONFIG_CMD_I2C
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000207#define CONFIG_I2C_MXS
208#define CONFIG_HARD_I2C
209#define CONFIG_SYS_I2C_SPEED 400000
Marek Vasut78687b72011-11-08 23:18:20 +0000210#endif
211
212/*
213 * EEPROM
214 */
215#ifdef CONFIG_CMD_EEPROM
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000216#define CONFIG_SYS_I2C_MULTI_EEPROMS
217#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
Marek Vasut78687b72011-11-08 23:18:20 +0000218#endif
219
220/*
221 * RTC
222 */
223#ifdef CONFIG_CMD_DATE
224/* Use the internal RTC in the MXS chip */
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000225#define CONFIG_RTC_INTERNAL
Marek Vasut78687b72011-11-08 23:18:20 +0000226#ifdef CONFIG_RTC_INTERNAL
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000227#define CONFIG_RTC_MXS
Marek Vasut78687b72011-11-08 23:18:20 +0000228#else
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000229#define CONFIG_RTC_M41T62
230#define CONFIG_SYS_I2C_RTC_ADDR 0x68
231#define CONFIG_SYS_M41T11_BASE_YEAR 2000
Marek Vasut78687b72011-11-08 23:18:20 +0000232#endif
233#endif
234
235/*
Marek Vasutbf4362f2011-11-08 23:18:27 +0000236 * USB
237 */
238#ifdef CONFIG_CMD_USB
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000239#define CONFIG_USB_EHCI
240#define CONFIG_USB_EHCI_MXS
Marek Vasut191a2ce2013-02-23 02:43:02 +0000241#define CONFIG_EHCI_MXS_PORT0
242#define CONFIG_EHCI_MXS_PORT1
243#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000244#define CONFIG_EHCI_IS_TDI
245#define CONFIG_USB_STORAGE
Marek Vasutbf4362f2011-11-08 23:18:27 +0000246#endif
247
248/*
Marek Vasut78687b72011-11-08 23:18:20 +0000249 * SPI
250 */
251#ifdef CONFIG_CMD_SPI
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000252#define CONFIG_HARD_SPI
253#define CONFIG_MXS_SPI
254#define CONFIG_SPI_HALF_DUPLEX
255#define CONFIG_DEFAULT_SPI_BUS 2
256#define CONFIG_DEFAULT_SPI_CS 0
257#define CONFIG_DEFAULT_SPI_MODE SPI_MODE_0
Marek Vasut78687b72011-11-08 23:18:20 +0000258
259/* SPI FLASH */
260#ifdef CONFIG_CMD_SF
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000261#define CONFIG_SPI_FLASH
262#define CONFIG_SPI_FLASH_STMICRO
263#define CONFIG_SF_DEFAULT_BUS 2
264#define CONFIG_SF_DEFAULT_CS 0
265#define CONFIG_SF_DEFAULT_SPEED 40000000
266#define CONFIG_SF_DEFAULT_MODE SPI_MODE_0
Marek Vasut78687b72011-11-08 23:18:20 +0000267
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000268#define CONFIG_ENV_SPI_BUS 2
269#define CONFIG_ENV_SPI_CS 0
270#define CONFIG_ENV_SPI_MAX_HZ 40000000
271#define CONFIG_ENV_SPI_MODE SPI_MODE_0
Marek Vasut78687b72011-11-08 23:18:20 +0000272#endif
273#endif
274
275/*
Marek Vasut34ce0e12013-04-28 09:20:04 +0000276 * LCD
277 */
278#ifdef CONFIG_VIDEO
279#define CONFIG_CFB_CONSOLE
280#define CONFIG_VIDEO_MXS
281#define CONFIG_VIDEO_LOGO
282#define CONFIG_VIDEO_SW_CURSOR
283#define CONFIG_VGA_AS_SINGLE_DEVICE
284#define CONFIG_SYS_CONSOLE_IS_IN_ENV
285#define CONFIG_SPLASH_SCREEN
286#define CONFIG_CMD_BMP
287#define CONFIG_BMP_16BPP
288#define CONFIG_VIDEO_BMP_RLE8
289#define CONFIG_VIDEO_BMP_GZIP
290#define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (512 << 10)
291#endif
292
293/*
Marek Vasut78687b72011-11-08 23:18:20 +0000294 * Boot Linux
295 */
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000296#define CONFIG_CMDLINE_TAG
297#define CONFIG_SETUP_MEMORY_TAGS
298#define CONFIG_BOOTDELAY 3
299#define CONFIG_BOOTFILE "uImage"
300#define CONFIG_BOOTARGS "console=ttyAMA0,115200n8 "
301#define CONFIG_BOOTCOMMAND "run bootcmd_net"
302#define CONFIG_LOADADDR 0x42000000
303#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
304#define CONFIG_OF_LIBFDT
Marek Vasut78687b72011-11-08 23:18:20 +0000305
306/*
307 * Extra Environments
308 */
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000309#define CONFIG_EXTRA_ENV_SETTINGS \
Marek Vasut78687b72011-11-08 23:18:20 +0000310 "update_nand_full_filename=u-boot.nand\0" \
311 "update_nand_firmware_filename=u-boot.sb\0" \
Marek Vasutf5013862012-05-01 11:09:43 +0000312 "update_sd_firmware_filename=u-boot.sd\0" \
Marek Vasut78687b72011-11-08 23:18:20 +0000313 "update_nand_firmware_maxsz=0x100000\0" \
314 "update_nand_stride=0x40\0" /* MX28 datasheet ch. 12.12 */ \
315 "update_nand_count=0x4\0" /* MX28 datasheet ch. 12.12 */ \
316 "update_nand_get_fcb_size=" /* Get size of FCB blocks */ \
317 "nand device 0 ; " \
318 "nand info ; " \
319 "setexpr fcb_sz ${update_nand_stride} * ${update_nand_count};" \
320 "setexpr update_nand_fcb ${fcb_sz} * ${nand_writesize}\0" \
321 "update_nand_full=" /* Update FCB, DBBT and FW */ \
322 "if tftp ${update_nand_full_filename} ; then " \
323 "run update_nand_get_fcb_size ; " \
324 "nand scrub -y 0x0 ${filesize} ; " \
Eric Benard1a068192012-12-11 11:36:21 +0000325 "nand write.raw ${loadaddr} 0x0 ${fcb_sz} ; " \
Marek Vasut78687b72011-11-08 23:18:20 +0000326 "setexpr update_off ${loadaddr} + ${update_nand_fcb} ; " \
327 "setexpr update_sz ${filesize} - ${update_nand_fcb} ; " \
328 "nand write ${update_off} ${update_nand_fcb} ${update_sz} ; " \
329 "fi\0" \
330 "update_nand_firmware=" /* Update only firmware */ \
331 "if tftp ${update_nand_firmware_filename} ; then " \
332 "run update_nand_get_fcb_size ; " \
333 "setexpr fcb_sz ${update_nand_fcb} * 2 ; " /* FCB + DBBT */ \
334 "setexpr fw_sz ${update_nand_firmware_maxsz} * 2 ; " \
335 "setexpr fw_off ${fcb_sz} + ${update_nand_firmware_maxsz};" \
336 "nand erase ${fcb_sz} ${fw_sz} ; " \
337 "nand write ${loadaddr} ${fcb_sz} ${filesize} ; " \
338 "nand write ${loadaddr} ${fw_off} ${filesize} ; " \
Marek Vasutf5013862012-05-01 11:09:43 +0000339 "fi\0" \
340 "update_sd_firmware=" /* Update the SD firmware partition */ \
341 "if mmc rescan ; then " \
342 "if tftp ${update_sd_firmware_filename} ; then " \
343 "setexpr fw_sz ${filesize} / 0x200 ; " /* SD block size */ \
344 "setexpr fw_sz ${fw_sz} + 1 ; " \
345 "mmc write ${loadaddr} 0x800 ${fw_sz} ; " \
346 "fi ; " \
Marek Vasut78687b72011-11-08 23:18:20 +0000347 "fi\0"
348
Otavio Salvadorbbcf3bf2012-05-12 13:40:15 +0000349#endif /* __M28EVK_CONFIG_H__ */