blob: 38ad7f4d8f6524735793af6644711dd616fe1c3d [file] [log] [blame]
Marek Vasut64a93862013-01-12 07:11:11 +00001/*
2 * Copyright (C) 2013 Marek Vasut <marex@denx.de>
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of
7 * the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
17 * MA 02111-1307 USA
18 */
19#ifndef __MX23_OLINUXINO_CONFIG_H__
20#define __MX23_OLINUXINO_CONFIG_H__
21
Otavio Salvador36c7c922013-02-23 02:43:09 +000022#include <asm/arch/iomux-mx23.h>
23
Marek Vasut64a93862013-01-12 07:11:11 +000024/*
25 * SoC configurations
26 */
Otavio Salvador2feae932013-03-24 16:17:33 +000027#define CONFIG_MX23 /* i.MX23 SoC */
28#define CONFIG_MXS_GPIO /* GPIO control */
29#define CONFIG_SYS_HZ 1000 /* Ticks per second */
Marek Vasut64a93862013-01-12 07:11:11 +000030
Otavio Salvador2feae932013-03-24 16:17:33 +000031#define CONFIG_MACH_TYPE 4105
Marek Vasut64a93862013-01-12 07:11:11 +000032
33#include <asm/arch/regs-base.h>
34
Otavio Salvador2feae932013-03-24 16:17:33 +000035#define CONFIG_SYS_NO_FLASH
36#define CONFIG_BOARD_EARLY_INIT_F
37#define CONFIG_ARCH_MISC_INIT
Marek Vasut64a93862013-01-12 07:11:11 +000038
39/*
40 * SPL
41 */
Otavio Salvador2feae932013-03-24 16:17:33 +000042#define CONFIG_SPL
43#define CONFIG_SPL_NO_CPU_SUPPORT_CODE
44#define CONFIG_SPL_START_S_PATH "arch/arm/cpu/arm926ejs/mxs"
45#define CONFIG_SPL_LDSCRIPT "arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds"
46#define CONFIG_SPL_LIBCOMMON_SUPPORT
47#define CONFIG_SPL_LIBGENERIC_SUPPORT
48#define CONFIG_SPL_GPIO_SUPPORT
Marek Vasut64a93862013-01-12 07:11:11 +000049
50/*
51 * U-Boot Commands
52 */
53#include <config_cmd_default.h>
Otavio Salvador2feae932013-03-24 16:17:33 +000054#define CONFIG_DISPLAY_CPUINFO
55#define CONFIG_DOS_PARTITION
Marek Vasut64a93862013-01-12 07:11:11 +000056
Otavio Salvador2feae932013-03-24 16:17:33 +000057#define CONFIG_CMD_CACHE
58#define CONFIG_CMD_DHCP
59#define CONFIG_CMD_EXT2
60#define CONFIG_CMD_FAT
61#define CONFIG_CMD_GPIO
62#define CONFIG_CMD_LED
63#define CONFIG_CMD_MMC
64#define CONFIG_CMD_NET
65#define CONFIG_CMD_USB
Marek Vasut64a93862013-01-12 07:11:11 +000066
67/*
68 * Memory configurations
69 */
Otavio Salvador2feae932013-03-24 16:17:33 +000070#define CONFIG_NR_DRAM_BANKS 1 /* 1 bank of DRAM */
71#define PHYS_SDRAM_1 0x40000000 /* Base address */
72#define PHYS_SDRAM_1_SIZE 0x08000000 /* Max 128 MB RAM */
73#define CONFIG_SYS_MALLOC_LEN 0x00400000 /* 4 MB for malloc */
74#define CONFIG_SYS_GBL_DATA_SIZE 128 /* Initial data */
75#define CONFIG_SYS_MEMTEST_START 0x40000000 /* Memtest start adr */
76#define CONFIG_SYS_MEMTEST_END 0x40400000 /* 4 MB RAM test */
77#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
Marek Vasut64a93862013-01-12 07:11:11 +000078/* Point initial SP in SRAM so SPL can use it too. */
79
80#define CONFIG_SYS_INIT_RAM_ADDR 0x00000000
81#define CONFIG_SYS_INIT_RAM_SIZE (128 * 1024)
82
83#define CONFIG_SYS_INIT_SP_OFFSET \
84 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
85#define CONFIG_SYS_INIT_SP_ADDR \
86 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
87/*
88 * We need to sacrifice first 4 bytes of RAM here to avoid triggering some
89 * strange BUG in ROM corrupting first 4 bytes of RAM when loading U-Boot
90 * binary. In case there was more of this mess, 0x100 bytes are skipped.
91 */
Otavio Salvador2feae932013-03-24 16:17:33 +000092#define CONFIG_SYS_TEXT_BASE 0x40000100
Marek Vasut64a93862013-01-12 07:11:11 +000093
94/*
95 * U-Boot general configurations
96 */
Otavio Salvador2feae932013-03-24 16:17:33 +000097#define CONFIG_SYS_LONGHELP
98#define CONFIG_SYS_PROMPT "=> "
99#define CONFIG_SYS_CBSIZE 1024 /* Console I/O buffer size */
100#define CONFIG_SYS_PBSIZE \
Marek Vasut64a93862013-01-12 07:11:11 +0000101 (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
102 /* Print buffer size */
Otavio Salvador2feae932013-03-24 16:17:33 +0000103#define CONFIG_SYS_MAXARGS 32 /* Max number of command args */
104#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
Marek Vasut64a93862013-01-12 07:11:11 +0000105 /* Boot argument buffer size */
Otavio Salvador2feae932013-03-24 16:17:33 +0000106#define CONFIG_VERSION_VARIABLE /* U-BOOT version */
107#define CONFIG_AUTO_COMPLETE /* Command auto complete */
108#define CONFIG_CMDLINE_EDITING /* Command history etc */
109#define CONFIG_SYS_HUSH_PARSER
Marek Vasut64a93862013-01-12 07:11:11 +0000110
111/*
112 * Serial Driver
113 */
Otavio Salvador2feae932013-03-24 16:17:33 +0000114#define CONFIG_PL011_SERIAL
115#define CONFIG_PL011_CLOCK 24000000
116#define CONFIG_PL01x_PORTS { (void *)MXS_UARTDBG_BASE }
117#define CONFIG_CONS_INDEX 0
118#define CONFIG_BAUDRATE 115200 /* Default baud rate */
Marek Vasut64a93862013-01-12 07:11:11 +0000119
120/*
Otavio Salvador36c7c922013-02-23 02:43:09 +0000121 * Status LED
122 */
Otavio Salvador2feae932013-03-24 16:17:33 +0000123#define CONFIG_STATUS_LED
124#define CONFIG_GPIO_LED
125#define CONFIG_BOARD_SPECIFIC_LED
126#define STATUS_LED_BOOT 0
127#define STATUS_LED_BIT MX23_PAD_SSP1_DETECT__GPIO_2_1
128#define STATUS_LED_STATE STATUS_LED_ON
129#define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2)
Otavio Salvador36c7c922013-02-23 02:43:09 +0000130
131/*
Marek Vasut13b1ebd2013-01-22 15:01:05 +0000132 * MMC Driver
133 */
Otavio Salvador2feae932013-03-24 16:17:33 +0000134#ifdef CONFIG_CMD_MMC
Marek Vasut13b1ebd2013-01-22 15:01:05 +0000135#define CONFIG_MMC
136#define CONFIG_BOUNCE_BUFFER
137#define CONFIG_GENERIC_MMC
138#define CONFIG_MXS_MMC
139#endif
140
141/*
Marek Vasut64a93862013-01-12 07:11:11 +0000142 * APBH DMA
143 */
144#define CONFIG_APBH_DMA
145
Otavio Salvadorebe1d172013-03-02 05:17:29 +0000146/* USB */
Otavio Salvador2feae932013-03-24 16:17:33 +0000147#ifdef CONFIG_CMD_USB
148#define CONFIG_USB_EHCI
149#define CONFIG_USB_EHCI_MXS
150#define CONFIG_EHCI_MXS_PORT0
151#define CONFIG_USB_MAX_CONTROLLER_COUNT 1
152#define CONFIG_EHCI_IS_TDI
153#define CONFIG_USB_STORAGE
Otavio Salvadorebe1d172013-03-02 05:17:29 +0000154#endif
155
Otavio Salvadorb8bd75a2013-03-02 05:17:30 +0000156/* Ethernet */
Otavio Salvador2feae932013-03-24 16:17:33 +0000157#ifdef CONFIG_CMD_NET
158#define CONFIG_USB_HOST_ETHER
159#define CONFIG_USB_ETHER_SMSC95XX
Otavio Salvadorb8bd75a2013-03-02 05:17:30 +0000160#endif
161
Marek Vasut64a93862013-01-12 07:11:11 +0000162/*
Marek Vasut64a93862013-01-12 07:11:11 +0000163 * Boot Linux
164 */
Otavio Salvador2feae932013-03-24 16:17:33 +0000165#define CONFIG_CMDLINE_TAG
166#define CONFIG_SETUP_MEMORY_TAGS
167#define CONFIG_BOOTDELAY 3
168#define CONFIG_BOOTFILE "uImage"
169#define CONFIG_LOADADDR 0x42000000
170#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
171#define CONFIG_OF_LIBFDT
Marek Vasut64a93862013-01-12 07:11:11 +0000172
Otavio Salvador38fc15d2013-01-23 10:30:33 +0000173/*
174 * Environment
175 */
Otavio Salvador2feae932013-03-24 16:17:33 +0000176#define CONFIG_ENV_IS_IN_MMC
177#define CONFIG_ENV_OVERWRITE
178#ifdef CONFIG_ENV_IS_IN_MMC
179#define CONFIG_ENV_OFFSET (256 * 1024)
180#define CONFIG_ENV_SIZE (16 * 1024)
181#define CONFIG_SYS_MMC_ENV_DEV 0
Otavio Salvador38fc15d2013-01-23 10:30:33 +0000182#endif
183
184/*
185 * Extra Environments
186 */
187#define CONFIG_EXTRA_ENV_SETTINGS \
188 "update_sd_firmware_filename=u-boot.sd\0" \
189 "update_sd_firmware=" /* Update the SD firmware partition */ \
190 "if mmc rescan ; then " \
191 "if tftp ${update_sd_firmware_filename} ; then " \
192 "setexpr fw_sz ${filesize} / 0x200 ; " /* SD block size */ \
193 "setexpr fw_sz ${fw_sz} + 1 ; " \
194 "mmc write ${loadaddr} 0x800 ${fw_sz} ; " \
195 "fi ; " \
196 "fi\0" \
197 "script=boot.scr\0" \
198 "uimage=uImage\0" \
199 "console=ttyAMA0\0" \
200 "fdt_file=imx23-olinuxino.dtb\0" \
201 "fdt_addr=0x41000000\0" \
202 "boot_fdt=try\0" \
Otavio Salvadorb8bd75a2013-03-02 05:17:30 +0000203 "ip_dyn=yes\0" \
Otavio Salvador38fc15d2013-01-23 10:30:33 +0000204 "mmcdev=0\0" \
205 "mmcpart=2\0" \
206 "mmcroot=/dev/mmcblk0p3 rw rootwait\0" \
207 "mmcargs=setenv bootargs console=${console},${baudrate} " \
208 "root=${mmcroot}\0" \
209 "loadbootscript=" \
210 "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
211 "bootscript=echo Running bootscript from mmc ...; " \
212 "source\0" \
213 "loaduimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \
214 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
215 "mmcboot=echo Booting from mmc ...; " \
216 "run mmcargs; " \
217 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
218 "if run loadfdt; then " \
219 "bootm ${loadaddr} - ${fdt_addr}; " \
220 "else " \
221 "if test ${boot_fdt} = try; then " \
222 "bootm; " \
223 "else " \
224 "echo WARN: Cannot load the DT; " \
225 "fi; " \
226 "fi; " \
227 "else " \
228 "bootm; " \
Otavio Salvadorb8bd75a2013-03-02 05:17:30 +0000229 "fi;\0" \
Alexandre Pereira da Silva50cea2442013-03-25 18:23:45 +0000230 "netargs=setenv bootargs console=${console},${baudrate} " \
Otavio Salvadorb8bd75a2013-03-02 05:17:30 +0000231 "root=/dev/nfs " \
232 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
233 "netboot=echo Booting from net ...; " \
234 "usb start; " \
235 "run netargs; " \
236 "if test ${ip_dyn} = yes; then " \
237 "setenv get_cmd dhcp; " \
238 "else " \
239 "setenv get_cmd tftp; " \
240 "fi; " \
241 "${get_cmd} ${uimage}; " \
242 "if test ${boot_fdt} = yes; then " \
243 "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
244 "bootm ${loadaddr} - ${fdt_addr}; " \
245 "else " \
246 "if test ${boot_fdt} = try; then " \
247 "bootm; " \
248 "else " \
249 "echo WARN: Cannot load the DT; " \
250 "fi;" \
251 "fi; " \
252 "else " \
253 "bootm; " \
Otavio Salvador38fc15d2013-01-23 10:30:33 +0000254 "fi;\0"
255
256#define CONFIG_BOOTCOMMAND \
257 "mmc dev ${mmcdev}; if mmc rescan; then " \
258 "if run loadbootscript; then " \
259 "run bootscript; " \
260 "else " \
261 "if run loaduimage; then " \
262 "run mmcboot; " \
Otavio Salvadorb8bd75a2013-03-02 05:17:30 +0000263 "else run netboot; " \
Otavio Salvador38fc15d2013-01-23 10:30:33 +0000264 "fi; " \
265 "fi; " \
Otavio Salvadorb8bd75a2013-03-02 05:17:30 +0000266 "else run netboot; fi"
Otavio Salvador38fc15d2013-01-23 10:30:33 +0000267
Marek Vasut64a93862013-01-12 07:11:11 +0000268#endif /* __MX23_OLINUXINO_CONFIG_H__ */