blob: 8561a248c41398eb1b3daee8b42e451c07101b43 [file] [log] [blame]
Veli-Pekka Peltolac1393bb2012-07-09 03:14:50 +00001/*
2 * Copyright (C) 2012 Bluegiga Technologies Oy
3 *
4 * Authors:
5 * Veli-Pekka Peltola <veli-pekka.peltola@bluegiga.com>
6 * Lauri Hintsala <lauri.hintsala@bluegiga.com>
7 *
8 * Based on m28evk.h:
9 * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
10 * on behalf of DENX Software Engineering GmbH
11 *
Wolfgang Denk1a459662013-07-08 09:37:19 +020012 * SPDX-License-Identifier: GPL-2.0+
Veli-Pekka Peltolac1393bb2012-07-09 03:14:50 +000013 */
14#ifndef __CONFIG_H
15#define __CONFIG_H
16
Veli-Pekka Peltolac1393bb2012-07-09 03:14:50 +000017/* SoC configurations */
18#define CONFIG_MX28 /* i.MX28 SoC */
19#define CONFIG_MXS_GPIO /* GPIO control */
20#define CONFIG_SYS_HZ 1000 /* Ticks per second */
21
22#define MACH_TYPE_APX4DEVKIT 3712
23#define CONFIG_MACH_TYPE MACH_TYPE_APX4DEVKIT
24
Otavio Salvadore229d442012-08-18 07:25:26 +000025#include <asm/arch/regs-base.h>
26
Veli-Pekka Peltolac1393bb2012-07-09 03:14:50 +000027#define CONFIG_SYS_NO_FLASH
Veli-Pekka Peltolac1393bb2012-07-09 03:14:50 +000028#define CONFIG_BOARD_EARLY_INIT_F
29#define CONFIG_ARCH_CPU_INIT
30#define CONFIG_ARCH_MISC_INIT
31
32/* SPL */
33#define CONFIG_SPL
34#define CONFIG_SPL_NO_CPU_SUPPORT_CODE
Otavio Salvador3a0398d2012-08-05 09:05:29 +000035#define CONFIG_SPL_START_S_PATH "arch/arm/cpu/arm926ejs/mxs"
36#define CONFIG_SPL_LDSCRIPT "arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds"
Veli-Pekka Peltolac1393bb2012-07-09 03:14:50 +000037#define CONFIG_SPL_LIBCOMMON_SUPPORT
38#define CONFIG_SPL_LIBGENERIC_SUPPORT
39#define CONFIG_SPL_GPIO_SUPPORT
40
41/* U-Boot Commands */
42#include <config_cmd_default.h>
43#define CONFIG_DISPLAY_CPUINFO
44#define CONFIG_DOS_PARTITION
45
46#define CONFIG_CMD_CACHE
47#define CONFIG_CMD_DATE
48#define CONFIG_CMD_DHCP
49#define CONFIG_CMD_EXT2
50#define CONFIG_CMD_FAT
51#define CONFIG_CMD_I2C
52#define CONFIG_CMD_MII
53#define CONFIG_CMD_MMC
54#define CONFIG_CMD_NAND
55#define CONFIG_CMD_NET
56#define CONFIG_CMD_NFS
57#define CONFIG_CMD_PING
58#define CONFIG_CMD_SAVEENV
59#define CONFIG_CMD_USB
60
61/* Memory configurations */
62#define CONFIG_NR_DRAM_BANKS 1 /* 1 bank of DRAM */
63#define PHYS_SDRAM_1 0x40000000 /* Base address */
64#define PHYS_SDRAM_1_SIZE 0x20000000 /* Max 512 MB RAM */
65#define CONFIG_SYS_MALLOC_LEN 0x00400000 /* 4 MB for malloc */
66#define CONFIG_SYS_MEMTEST_START 0x40000000 /* Memtest start adr */
67#define CONFIG_SYS_MEMTEST_END 0x40400000 /* 4 MB RAM test */
68#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
69
70/* Point initial SP in SRAM so SPL can use it too. */
71#define CONFIG_SYS_INIT_RAM_ADDR 0x00000000
72#define CONFIG_SYS_INIT_RAM_SIZE (128 * 1024)
73
74#define CONFIG_SYS_INIT_SP_OFFSET \
75 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
76#define CONFIG_SYS_INIT_SP_ADDR \
77 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
78
79/*
80 * We need to sacrifice first 4 bytes of RAM here to avoid triggering some
81 * strange BUG in ROM corrupting first 4 bytes of RAM when loading U-Boot
82 * binary. In case there was more of this mess, 0x100 bytes are skipped.
83 */
84#define CONFIG_SYS_TEXT_BASE 0x40000100
85
86#define CONFIG_ENV_OVERWRITE
87
88/* U-Boot general configurations */
89#define CONFIG_SYS_LONGHELP
90#define CONFIG_SYS_PROMPT "=> "
91#define CONFIG_SYS_CBSIZE 1024 /* Console I/O buffer size */
92#define CONFIG_SYS_PBSIZE \
93 (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
94 /* Print buffer size */
95#define CONFIG_SYS_MAXARGS 32 /* Max number of command args */
96#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
97 /* Boot argument buffer size */
98#define CONFIG_VERSION_VARIABLE /* U-Boot version */
99#define CONFIG_AUTO_COMPLETE /* Command auto complete */
100#define CONFIG_CMDLINE_EDITING /* Command history etc. */
101#define CONFIG_SYS_HUSH_PARSER
102#define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
103#define CONFIG_OF_LIBFDT
104#define CONFIG_ENV_IS_IN_NAND
105
106/* Serial Driver */
107#define CONFIG_PL011_SERIAL
108#define CONFIG_PL011_CLOCK 24000000
109#define CONFIG_PL01x_PORTS { (void *)MXS_UARTDBG_BASE }
110#define CONFIG_CONS_INDEX 0
111#define CONFIG_BAUDRATE 115200 /* Default baud rate */
112#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
113
114/* DMA */
115#define CONFIG_APBH_DMA
116
117/* MMC Driver */
118#ifdef CONFIG_ENV_IS_IN_MMC
119#define CONFIG_ENV_OFFSET (256 * 1024)
120#define CONFIG_ENV_SIZE (16 * 1024)
121#define CONFIG_SYS_MMC_ENV_DEV 0
122#endif
123
124#ifdef CONFIG_CMD_MMC
125#define CONFIG_MMC
126#define CONFIG_GENERIC_MMC
Marek Vasut6dc71c82012-08-26 15:19:08 +0000127#define CONFIG_BOUNCE_BUFFER
Veli-Pekka Peltolac1393bb2012-07-09 03:14:50 +0000128#define CONFIG_MXS_MMC
129#endif
130
131/* NAND Driver */
132#ifdef CONFIG_ENV_IS_IN_NAND
133#define CONFIG_ENV_SECT_SIZE (128 * 1024)
134#define CONFIG_ENV_SIZE (128 * 1024)
135#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
136#define CONFIG_ENV_RANGE (384 * 1024)
137#define CONFIG_ENV_OFFSET 0x120000
138#define CONFIG_ENV_OFFSET_REDUND \
139 (CONFIG_ENV_OFFSET + CONFIG_ENV_RANGE)
140#endif
141
142#ifdef CONFIG_CMD_NAND
143#define CONFIG_NAND_MXS
144#define CONFIG_SYS_MAX_NAND_DEVICE 1
145#define CONFIG_SYS_NAND_BASE 0x60000000
146#define CONFIG_SYS_NAND_5_ADDR_CYCLE
147
148#define CONFIG_CMD_UBI
149#define CONFIG_CMD_UBIFS
150#define CONFIG_CMD_MTDPARTS
151#define CONFIG_RBTREE
152#define CONFIG_LZO
153#define CONFIG_MTD_DEVICE
154#define CONFIG_MTD_PARTITIONS
155#define MTDIDS_DEFAULT "nand0=gpmi-nand"
156#define MTDPARTS_DEFAULT \
157 "mtdparts=gpmi-nand:128k(bootstrap),1024k(boot),768k(env),-(root)"
158#else
159#define MTDPARTS_DEFAULT ""
160#endif
161
162/* Ethernet on SOC (FEC) */
163#ifdef CONFIG_CMD_NET
164#define CONFIG_NET_MULTI
165#define CONFIG_ETHPRIME "FEC"
166#define CONFIG_FEC_MXC
167#define CONFIG_FEC_MXC_PHYADDR 0
168#define IMX_FEC_BASE MXS_ENET0_BASE
169#define CONFIG_MII
Veli-Pekka Peltolac1393bb2012-07-09 03:14:50 +0000170#define CONFIG_FEC_XCV_TYPE RMII
171#endif
172
173/* USB */
174#ifdef CONFIG_CMD_USB
175#define CONFIG_USB_EHCI
176#define CONFIG_USB_EHCI_MXS
Marek Vasutafa87212013-02-23 02:43:02 +0000177#define CONFIG_EHCI_MXS_PORT1
178#define CONFIG_USB_MAX_CONTROLLER_COUNT 1
Veli-Pekka Peltolac1393bb2012-07-09 03:14:50 +0000179#define CONFIG_EHCI_IS_TDI
180#define CONFIG_USB_STORAGE
181#endif
182
183/* I2C */
184#ifdef CONFIG_CMD_I2C
185#define CONFIG_I2C_MXS
186#define CONFIG_HARD_I2C
187#define CONFIG_SYS_I2C_SPEED 400000
188#endif
189
190/* RTC */
191#if defined(CONFIG_CMD_DATE)
192#define CONFIG_RTC_PCF8563
193#define CONFIG_SYS_I2C_RTC_ADDR 0x51
194#endif
195
196/* Boot Linux */
197#define CONFIG_CMDLINE_TAG
198#define CONFIG_SETUP_MEMORY_TAGS
199#define CONFIG_BOOTDELAY 1
200#define CONFIG_BOOTFILE "uImage"
201#define CONFIG_BOOTCOMMAND "run bootcmd_nand"
202#define CONFIG_LOADADDR 0x41000000
203#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
204#define CONFIG_SERIAL_TAG
205#define CONFIG_REVISION_TAG
206
207/* Extra Environments */
208#define CONFIG_EXTRA_ENV_SETTINGS \
209 "mtdparts=" MTDPARTS_DEFAULT "\0" \
210 "verify=no\0" \
211 "bootcmd=run bootcmd_nand\0" \
212 "kernelargs=console=tty0 console=ttyAMA0,115200 consoleblank=0\0" \
213 "bootargs_nand=" \
214 "setenv bootargs ${kernelargs} ubi.mtd=3,2048 " \
215 "root=ubi0:rootfs rootfstype=ubifs ${mtdparts} rw\0" \
216 "bootcmd_nand=" \
217 "run bootargs_nand && ubi part root 2048 && " \
Joe Hershberger949a7712012-11-01 16:54:18 +0000218 "ubifsmount ubi:rootfs && ubifsload 41000000 boot/uImage && " \
Veli-Pekka Peltolac1393bb2012-07-09 03:14:50 +0000219 "bootm 41000000\0" \
220 "bootargs_mmc=" \
221 "setenv bootargs ${kernelargs} " \
222 "root=/dev/mmcblk0p2 rootwait ${mtdparts} rw\0" \
223 "bootcmd_mmc=" \
224 "run bootargs_mmc && mmc rescan && " \
225 "ext2load mmc 0:2 41000000 boot/uImage && bootm 41000000\0" \
226""
227
228#endif /* __CONFIG_H */