blob: 94bedd6d253379a24ba92e93d225644a403b2251 [file] [log] [blame]
Marek Vasut189e35b2013-01-12 07:11:11 +00001/*
2 * Copyright (C) 2013 Marek Vasut <marex@denx.de>
3 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02004 * SPDX-License-Identifier: GPL-2.0+
Marek Vasut189e35b2013-01-12 07:11:11 +00005 */
6#ifndef __MX23_OLINUXINO_CONFIG_H__
7#define __MX23_OLINUXINO_CONFIG_H__
8
Otavio Salvadorfcc76892013-02-23 02:43:09 +00009#include <asm/arch/iomux-mx23.h>
10
Marek Vasut189e35b2013-01-12 07:11:11 +000011/*
12 * SoC configurations
13 */
Otavio Salvador9ffb9dc2013-03-24 16:17:33 +000014#define CONFIG_MX23 /* i.MX23 SoC */
15#define CONFIG_MXS_GPIO /* GPIO control */
16#define CONFIG_SYS_HZ 1000 /* Ticks per second */
Marek Vasut189e35b2013-01-12 07:11:11 +000017
Otavio Salvador9ffb9dc2013-03-24 16:17:33 +000018#define CONFIG_MACH_TYPE 4105
Marek Vasut189e35b2013-01-12 07:11:11 +000019
20#include <asm/arch/regs-base.h>
21
Otavio Salvador9ffb9dc2013-03-24 16:17:33 +000022#define CONFIG_SYS_NO_FLASH
23#define CONFIG_BOARD_EARLY_INIT_F
24#define CONFIG_ARCH_MISC_INIT
Marek Vasut189e35b2013-01-12 07:11:11 +000025
26/*
27 * SPL
28 */
Otavio Salvador9ffb9dc2013-03-24 16:17:33 +000029#define CONFIG_SPL
30#define CONFIG_SPL_NO_CPU_SUPPORT_CODE
31#define CONFIG_SPL_START_S_PATH "arch/arm/cpu/arm926ejs/mxs"
32#define CONFIG_SPL_LDSCRIPT "arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds"
33#define CONFIG_SPL_LIBCOMMON_SUPPORT
34#define CONFIG_SPL_LIBGENERIC_SUPPORT
35#define CONFIG_SPL_GPIO_SUPPORT
Marek Vasut189e35b2013-01-12 07:11:11 +000036
37/*
38 * U-Boot Commands
39 */
40#include <config_cmd_default.h>
Otavio Salvador9ffb9dc2013-03-24 16:17:33 +000041#define CONFIG_DISPLAY_CPUINFO
42#define CONFIG_DOS_PARTITION
Marek Vasut189e35b2013-01-12 07:11:11 +000043
Otavio Salvador9ffb9dc2013-03-24 16:17:33 +000044#define CONFIG_CMD_CACHE
45#define CONFIG_CMD_DHCP
46#define CONFIG_CMD_EXT2
47#define CONFIG_CMD_FAT
48#define CONFIG_CMD_GPIO
49#define CONFIG_CMD_LED
50#define CONFIG_CMD_MMC
51#define CONFIG_CMD_NET
52#define CONFIG_CMD_USB
Marek Vasut189e35b2013-01-12 07:11:11 +000053
54/*
55 * Memory configurations
56 */
Otavio Salvador9ffb9dc2013-03-24 16:17:33 +000057#define CONFIG_NR_DRAM_BANKS 1 /* 1 bank of DRAM */
58#define PHYS_SDRAM_1 0x40000000 /* Base address */
59#define PHYS_SDRAM_1_SIZE 0x08000000 /* Max 128 MB RAM */
60#define CONFIG_SYS_MALLOC_LEN 0x00400000 /* 4 MB for malloc */
61#define CONFIG_SYS_GBL_DATA_SIZE 128 /* Initial data */
62#define CONFIG_SYS_MEMTEST_START 0x40000000 /* Memtest start adr */
63#define CONFIG_SYS_MEMTEST_END 0x40400000 /* 4 MB RAM test */
64#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
Marek Vasut189e35b2013-01-12 07:11:11 +000065/* Point initial SP in SRAM so SPL can use it too. */
66
67#define CONFIG_SYS_INIT_RAM_ADDR 0x00000000
68#define CONFIG_SYS_INIT_RAM_SIZE (128 * 1024)
69
70#define CONFIG_SYS_INIT_SP_OFFSET \
71 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
72#define CONFIG_SYS_INIT_SP_ADDR \
73 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
74/*
75 * We need to sacrifice first 4 bytes of RAM here to avoid triggering some
76 * strange BUG in ROM corrupting first 4 bytes of RAM when loading U-Boot
77 * binary. In case there was more of this mess, 0x100 bytes are skipped.
78 */
Otavio Salvador9ffb9dc2013-03-24 16:17:33 +000079#define CONFIG_SYS_TEXT_BASE 0x40000100
Marek Vasut189e35b2013-01-12 07:11:11 +000080
81/*
82 * U-Boot general configurations
83 */
Otavio Salvador9ffb9dc2013-03-24 16:17:33 +000084#define CONFIG_SYS_LONGHELP
85#define CONFIG_SYS_PROMPT "=> "
86#define CONFIG_SYS_CBSIZE 1024 /* Console I/O buffer size */
87#define CONFIG_SYS_PBSIZE \
Marek Vasut189e35b2013-01-12 07:11:11 +000088 (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
89 /* Print buffer size */
Otavio Salvador9ffb9dc2013-03-24 16:17:33 +000090#define CONFIG_SYS_MAXARGS 32 /* Max number of command args */
91#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
Marek Vasut189e35b2013-01-12 07:11:11 +000092 /* Boot argument buffer size */
Otavio Salvador9ffb9dc2013-03-24 16:17:33 +000093#define CONFIG_VERSION_VARIABLE /* U-BOOT version */
94#define CONFIG_AUTO_COMPLETE /* Command auto complete */
95#define CONFIG_CMDLINE_EDITING /* Command history etc */
96#define CONFIG_SYS_HUSH_PARSER
Marek Vasut189e35b2013-01-12 07:11:11 +000097
98/*
99 * Serial Driver
100 */
Otavio Salvador9ffb9dc2013-03-24 16:17:33 +0000101#define CONFIG_PL011_SERIAL
102#define CONFIG_PL011_CLOCK 24000000
103#define CONFIG_PL01x_PORTS { (void *)MXS_UARTDBG_BASE }
104#define CONFIG_CONS_INDEX 0
105#define CONFIG_BAUDRATE 115200 /* Default baud rate */
Marek Vasut189e35b2013-01-12 07:11:11 +0000106
107/*
Otavio Salvadorfcc76892013-02-23 02:43:09 +0000108 * Status LED
109 */
Otavio Salvador9ffb9dc2013-03-24 16:17:33 +0000110#define CONFIG_STATUS_LED
111#define CONFIG_GPIO_LED
112#define CONFIG_BOARD_SPECIFIC_LED
113#define STATUS_LED_BOOT 0
114#define STATUS_LED_BIT MX23_PAD_SSP1_DETECT__GPIO_2_1
115#define STATUS_LED_STATE STATUS_LED_ON
116#define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2)
Otavio Salvadorfcc76892013-02-23 02:43:09 +0000117
118/*
Marek Vasut73f2b032013-01-22 15:01:05 +0000119 * MMC Driver
120 */
Otavio Salvador9ffb9dc2013-03-24 16:17:33 +0000121#ifdef CONFIG_CMD_MMC
Marek Vasut73f2b032013-01-22 15:01:05 +0000122#define CONFIG_MMC
123#define CONFIG_BOUNCE_BUFFER
124#define CONFIG_GENERIC_MMC
125#define CONFIG_MXS_MMC
126#endif
127
128/*
Marek Vasut189e35b2013-01-12 07:11:11 +0000129 * APBH DMA
130 */
131#define CONFIG_APBH_DMA
132
Otavio Salvador801fa152013-03-02 05:17:29 +0000133/* USB */
Otavio Salvador9ffb9dc2013-03-24 16:17:33 +0000134#ifdef CONFIG_CMD_USB
135#define CONFIG_USB_EHCI
136#define CONFIG_USB_EHCI_MXS
137#define CONFIG_EHCI_MXS_PORT0
138#define CONFIG_USB_MAX_CONTROLLER_COUNT 1
139#define CONFIG_EHCI_IS_TDI
140#define CONFIG_USB_STORAGE
Otavio Salvador801fa152013-03-02 05:17:29 +0000141#endif
142
Otavio Salvador64396712013-03-02 05:17:30 +0000143/* Ethernet */
Otavio Salvador9ffb9dc2013-03-24 16:17:33 +0000144#ifdef CONFIG_CMD_NET
145#define CONFIG_USB_HOST_ETHER
146#define CONFIG_USB_ETHER_SMSC95XX
Otavio Salvador64396712013-03-02 05:17:30 +0000147#endif
148
Marek Vasut189e35b2013-01-12 07:11:11 +0000149/*
Marek Vasut189e35b2013-01-12 07:11:11 +0000150 * Boot Linux
151 */
Otavio Salvador9ffb9dc2013-03-24 16:17:33 +0000152#define CONFIG_CMDLINE_TAG
153#define CONFIG_SETUP_MEMORY_TAGS
154#define CONFIG_BOOTDELAY 3
155#define CONFIG_BOOTFILE "uImage"
156#define CONFIG_LOADADDR 0x42000000
157#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
158#define CONFIG_OF_LIBFDT
Marek Vasut189e35b2013-01-12 07:11:11 +0000159
Otavio Salvadora4d9b3e2013-01-23 10:30:33 +0000160/*
161 * Environment
162 */
Otavio Salvador9ffb9dc2013-03-24 16:17:33 +0000163#define CONFIG_ENV_IS_IN_MMC
164#define CONFIG_ENV_OVERWRITE
165#ifdef CONFIG_ENV_IS_IN_MMC
166#define CONFIG_ENV_OFFSET (256 * 1024)
167#define CONFIG_ENV_SIZE (16 * 1024)
168#define CONFIG_SYS_MMC_ENV_DEV 0
Otavio Salvadora4d9b3e2013-01-23 10:30:33 +0000169#endif
170
171/*
172 * Extra Environments
173 */
174#define CONFIG_EXTRA_ENV_SETTINGS \
175 "update_sd_firmware_filename=u-boot.sd\0" \
176 "update_sd_firmware=" /* Update the SD firmware partition */ \
177 "if mmc rescan ; then " \
178 "if tftp ${update_sd_firmware_filename} ; then " \
179 "setexpr fw_sz ${filesize} / 0x200 ; " /* SD block size */ \
180 "setexpr fw_sz ${fw_sz} + 1 ; " \
181 "mmc write ${loadaddr} 0x800 ${fw_sz} ; " \
182 "fi ; " \
183 "fi\0" \
184 "script=boot.scr\0" \
185 "uimage=uImage\0" \
186 "console=ttyAMA0\0" \
187 "fdt_file=imx23-olinuxino.dtb\0" \
188 "fdt_addr=0x41000000\0" \
189 "boot_fdt=try\0" \
Otavio Salvador64396712013-03-02 05:17:30 +0000190 "ip_dyn=yes\0" \
Otavio Salvadora4d9b3e2013-01-23 10:30:33 +0000191 "mmcdev=0\0" \
192 "mmcpart=2\0" \
193 "mmcroot=/dev/mmcblk0p3 rw rootwait\0" \
194 "mmcargs=setenv bootargs console=${console},${baudrate} " \
195 "root=${mmcroot}\0" \
196 "loadbootscript=" \
197 "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
198 "bootscript=echo Running bootscript from mmc ...; " \
199 "source\0" \
200 "loaduimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \
201 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
202 "mmcboot=echo Booting from mmc ...; " \
203 "run mmcargs; " \
204 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
205 "if run loadfdt; then " \
206 "bootm ${loadaddr} - ${fdt_addr}; " \
207 "else " \
208 "if test ${boot_fdt} = try; then " \
209 "bootm; " \
210 "else " \
211 "echo WARN: Cannot load the DT; " \
212 "fi; " \
213 "fi; " \
214 "else " \
215 "bootm; " \
Otavio Salvador64396712013-03-02 05:17:30 +0000216 "fi;\0" \
Alexandre Pereira da Silva54109362013-03-25 18:23:45 +0000217 "netargs=setenv bootargs console=${console},${baudrate} " \
Otavio Salvador64396712013-03-02 05:17:30 +0000218 "root=/dev/nfs " \
219 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
220 "netboot=echo Booting from net ...; " \
221 "usb start; " \
222 "run netargs; " \
223 "if test ${ip_dyn} = yes; then " \
224 "setenv get_cmd dhcp; " \
225 "else " \
226 "setenv get_cmd tftp; " \
227 "fi; " \
228 "${get_cmd} ${uimage}; " \
229 "if test ${boot_fdt} = yes; then " \
230 "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
231 "bootm ${loadaddr} - ${fdt_addr}; " \
232 "else " \
233 "if test ${boot_fdt} = try; then " \
234 "bootm; " \
235 "else " \
236 "echo WARN: Cannot load the DT; " \
237 "fi;" \
238 "fi; " \
239 "else " \
240 "bootm; " \
Otavio Salvadora4d9b3e2013-01-23 10:30:33 +0000241 "fi;\0"
242
243#define CONFIG_BOOTCOMMAND \
244 "mmc dev ${mmcdev}; if mmc rescan; then " \
245 "if run loadbootscript; then " \
246 "run bootscript; " \
247 "else " \
248 "if run loaduimage; then " \
249 "run mmcboot; " \
Otavio Salvador64396712013-03-02 05:17:30 +0000250 "else run netboot; " \
Otavio Salvadora4d9b3e2013-01-23 10:30:33 +0000251 "fi; " \
252 "fi; " \
Otavio Salvador64396712013-03-02 05:17:30 +0000253 "else run netboot; fi"
Otavio Salvadora4d9b3e2013-01-23 10:30:33 +0000254
Marek Vasut189e35b2013-01-12 07:11:11 +0000255#endif /* __MX23_OLINUXINO_CONFIG_H__ */