blob: 035a9325b3c4beb59497589411b377390fdc0ffe [file] [log] [blame]
Tapani Utriainen550e3752013-12-04 09:27:33 +01001/*
2 * Configuration settings for the TechNexion TAO-3530 SOM
3 * equipped on Thunder baseboard.
4 *
5 * Edward Lin <linuxfae@technexion.com>
6 * Tapani Utriainen <linuxfae@technexion.com>
7 *
Stefan Roesea9f52492013-12-04 09:27:34 +01008 * Copyright (C) 2013 Stefan Roese <sr@denx.de>
9 *
Tapani Utriainen550e3752013-12-04 09:27:33 +010010 * SPDX-License-Identifier: GPL-2.0+
11 */
12
13#ifndef __CONFIG_H
14#define __CONFIG_H
15
16/*
17 * High Level Configuration Options
18 */
Tapani Utriainen550e3752013-12-04 09:27:33 +010019#define CONFIG_OMAP /* in a TI OMAP core */
Tapani Utriainen550e3752013-12-04 09:27:33 +010020
21#define CONFIG_OMAP_GPIO
Tapani Utriainen550e3752013-12-04 09:27:33 +010022
Tapani Utriainen550e3752013-12-04 09:27:33 +010023#define CONFIG_SDRC /* Has an SDRC controller */
24
25#include <asm/arch/cpu.h> /* get chip and board defs */
Nishanth Menon987ec582015-03-09 17:12:04 -050026#include <asm/arch/omap.h>
Tapani Utriainen550e3752013-12-04 09:27:33 +010027
Tapani Utriainen550e3752013-12-04 09:27:33 +010028/* Clock Defines */
29#define V_OSCK 26000000 /* Clock output from T2 */
30#define V_SCLK (V_OSCK >> 1)
31
32#define CONFIG_MISC_INIT_R
33
Tapani Utriainen550e3752013-12-04 09:27:33 +010034#define CONFIG_CMDLINE_TAG
35#define CONFIG_SETUP_MEMORY_TAGS
36#define CONFIG_INITRD_TAG
37#define CONFIG_REVISION_TAG
38
39/*
40 * Size of malloc() pool
41 */
42#define CONFIG_SYS_MALLOC_LEN (4 << 20)
43#define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB sector */
44
45/*
46 * Hardware drivers
47 */
48
49/*
50 * NS16550 Configuration
51 */
52#define V_NS16550_CLK 48000000 /* 48MHz (APLL96/2) */
53
Tapani Utriainen550e3752013-12-04 09:27:33 +010054#define CONFIG_SYS_NS16550_SERIAL
55#define CONFIG_SYS_NS16550_REG_SIZE (-4)
56#define CONFIG_SYS_NS16550_CLK V_NS16550_CLK
57
58/*
59 * select serial console configuration
60 */
61#define CONFIG_CONS_INDEX 3
62#define CONFIG_SYS_NS16550_COM3 OMAP34XX_UART3
63
64/* allow to overwrite serial and ethaddr */
65#define CONFIG_ENV_OVERWRITE
Tapani Utriainen550e3752013-12-04 09:27:33 +010066
Stefan Roese36481de2014-02-14 09:47:17 +010067/* GPIO banks */
68#define CONFIG_OMAP3_GPIO_2 /* GPIO32 ..63 is in GPIO bank 2 */
69#define CONFIG_OMAP3_GPIO_3 /* GPIO64 ..95 is in GPIO bank 3 */
70#define CONFIG_OMAP3_GPIO_4 /* GPIO96 ..127 is in GPIO bank 4 */
71#define CONFIG_OMAP3_GPIO_5 /* GPIO128..159 is in GPIO bank 5 */
72#define CONFIG_OMAP3_GPIO_6 /* GPIO160..191 is in GPIO bank 6 */
73
Tapani Utriainen550e3752013-12-04 09:27:33 +010074/* commands to include */
Tapani Utriainen550e3752013-12-04 09:27:33 +010075#define CONFIG_CMD_MTDPARTS /* Enable MTD parts commands */
76#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */
77#define MTDIDS_DEFAULT "nand0=nand"
78#define MTDPARTS_DEFAULT "mtdparts=nand:512k(x-loader),"\
79 "1920k(u-boot),128k(u-boot-env),"\
80 "4m(kernel),-(fs)"
81
Tapani Utriainen550e3752013-12-04 09:27:33 +010082#define CONFIG_CMD_NAND /* NAND support */
Tapani Utriainen550e3752013-12-04 09:27:33 +010083
Tapani Utriainen550e3752013-12-04 09:27:33 +010084#define CONFIG_SYS_I2C
85#define CONFIG_SYS_I2C_OMAP34XX
86#define CONFIG_SYS_OMAP24_I2C_SPEED 100000
87#define CONFIG_SYS_OMAP24_I2C_SLAVE 1
88#define CONFIG_I2C_MULTI_BUS
89
90/*
91 * TWL4030
92 */
93#define CONFIG_TWL4030_POWER
94#define CONFIG_TWL4030_LED
95
96/*
97 * Board NAND Info.
98 */
Tapani Utriainen550e3752013-12-04 09:27:33 +010099#define CONFIG_NAND_OMAP_GPMC
100#define CONFIG_SYS_NAND_ADDR NAND_BASE /* physical address */
101 /* to access nand */
102#define CONFIG_SYS_NAND_BASE NAND_BASE /* physical address */
103 /* to access nand at */
104 /* CS0 */
Tapani Utriainen550e3752013-12-04 09:27:33 +0100105
106#define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of NAND */
107 /* devices */
Stefano Babic55f1b392015-07-26 15:18:15 +0200108#define CONFIG_SYS_NAND_BUSWIDTH_16BIT
Tapani Utriainen550e3752013-12-04 09:27:33 +0100109/* Environment information */
Tapani Utriainen550e3752013-12-04 09:27:33 +0100110
111#define CONFIG_EXTRA_ENV_SETTINGS \
112 "loadaddr=0x82000000\0" \
113 "console=ttyO2,115200n8\0" \
114 "mpurate=600\0" \
115 "dvi_mode=omapfb.mode=dvi:1280x720-24@60\0" \
116 "tv_mode=omapfb.mode=tv:ntsc\0" \
117 "video_mode=omapdss.def_disp=lcd vram=6M omapfb.vram=0:2M,1:2M,2:2M\0" \
118 "lcd_mode=omapfb.mode=lcd:800x480@60 \0" \
119 "extra_options= \0" \
Tapani Utriainen550e3752013-12-04 09:27:33 +0100120 "mmcdev=0\0" \
121 "mmcroot=/dev/mmcblk0p2 rw\0" \
122 "mmcrootfstype=ext3 rootwait\0" \
123 "nandroot=ubi0:rootfs ubi.mtd=4\0" \
124 "nandrootfstype=ubifs\0" \
125 "mmcargs=setenv bootargs console=${console} " \
Tapani Utriainen550e3752013-12-04 09:27:33 +0100126 "mpurate=${mpurate} " \
127 "${video_mode} " \
128 "root=${mmcroot} " \
129 "rootfstype=${mmcrootfstype} " \
130 "${extra_options}\0" \
131 "nandargs=setenv bootargs console=${console} " \
Tapani Utriainen550e3752013-12-04 09:27:33 +0100132 "mpurate=${mpurate} " \
133 "${video_mode} " \
134 "${network_setting} " \
135 "root=${nandroot} " \
136 "rootfstype=${nandrootfstype} "\
137 "${extra_options}\0" \
138 "loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
139 "bootscript=echo Running bootscript from mmc ...; " \
140 "source ${loadaddr}\0" \
141 "loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
142 "mmcboot=echo Booting from mmc ...; " \
143 "run mmcargs; " \
144 "bootm ${loadaddr}\0" \
145 "nandboot=echo Booting from nand ...; " \
146 "run nandargs; " \
147 "nand read ${loadaddr} 280000 400000; " \
148 "bootm ${loadaddr}\0" \
149
150#define CONFIG_BOOTCOMMAND \
151 "if mmc rescan ${mmcdev}; then " \
152 "if run loadbootscript; then " \
153 "run bootscript; " \
154 "else " \
155 "if run loaduimage; then " \
156 "run mmcboot; " \
157 "else run nandboot; " \
158 "fi; " \
159 "fi; " \
160 "else run nandboot; fi"
161
162/*
163 * Miscellaneous configurable options
164 */
165#define CONFIG_SYS_LONGHELP /* undef to save memory */
Tapani Utriainen550e3752013-12-04 09:27:33 +0100166#define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
167
168/* turn on command-line edit/hist/auto */
169#define CONFIG_CMDLINE_EDITING
170#define CONFIG_COMMAND_HISTORY
171#define CONFIG_AUTO_COMPLETE
172
173/* Print Buffer Size */
174#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \
175 sizeof(CONFIG_SYS_PROMPT) + 16)
176#define CONFIG_SYS_MAXARGS 16 /* max number of command args */
177/* Boot Argument Buffer Size */
178#define CONFIG_SYS_BARGSIZE (CONFIG_SYS_CBSIZE)
179
180#define CONFIG_SYS_ALT_MEMTEST 1
181#define CONFIG_SYS_MEMTEST_START (0x82000000) /* memtest */
182 /* defaults */
183#define CONFIG_SYS_MEMTEST_END (0x83FFFFFF) /* 64MB */
184#define CONFIG_SYS_MEMTEST_SCRATCH (0x81000000) /* dummy address */
185
186#define CONFIG_SYS_LOAD_ADDR (OMAP34XX_SDRC_CS0) /* default */
187 /* load address */
188#define CONFIG_SYS_TEXT_BASE 0x80008000
189
190/*
191 * OMAP3 has 12 GP timers, they can be driven by the system clock
192 * (12/13/16.8/19.2/38.4MHz) or by 32KHz clock. We use 13MHz (V_SCLK).
193 * This rate is divided by a local divisor.
194 */
195#define CONFIG_SYS_TIMERBASE (OMAP34XX_GPT2)
196#define CONFIG_SYS_PTV 2 /* Divisor: 2^(PTV+1) => 8 */
197
198/*
199 * Stack sizes
200 *
201 * The stack sizes are set up in start.S using the settings below
202 */
203#define CONFIG_STACKSIZE (128 << 10) /* regular stack 128 KiB */
204
205/*
206 * Physical Memory Map
207 */
208#define CONFIG_NR_DRAM_BANKS 2 /* CS1 may or may not be populated */
209#define PHYS_SDRAM_1 OMAP34XX_SDRC_CS0
210#define PHYS_SDRAM_1_SIZE (32 << 20) /* at least 32 MiB */
211#define PHYS_SDRAM_2 OMAP34XX_SDRC_CS1
212
213/*
214 * FLASH and environment organization
215 */
216
217/* **** PISMO SUPPORT *** */
Tapani Utriainen550e3752013-12-04 09:27:33 +0100218#define CONFIG_SYS_MONITOR_LEN (256 << 10) /* Reserve 2 sectors */
pekon gupta222a3112014-07-18 17:59:41 +0530219#define CONFIG_SYS_FLASH_BASE NAND_BASE
Tapani Utriainen550e3752013-12-04 09:27:33 +0100220
221/* Monitor at start of flash */
222#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE
223#define CONFIG_SYS_ONENAND_BASE ONENAND_MAP
224
225#define CONFIG_ENV_IS_IN_NAND 1
226#define ONENAND_ENV_OFFSET 0x260000 /* environment starts here */
227#define SMNAND_ENV_OFFSET 0x260000 /* environment starts here */
228
229#define CONFIG_SYS_ENV_SECT_SIZE (128 << 10)
230#define CONFIG_ENV_OFFSET SMNAND_ENV_OFFSET
231#define CONFIG_ENV_ADDR CONFIG_ENV_OFFSET
232
233#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
234#define CONFIG_SYS_INIT_RAM_ADDR 0x4020f800
235#define CONFIG_SYS_INIT_RAM_SIZE 0x800
236#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \
237 CONFIG_SYS_INIT_RAM_SIZE - \
238 GENERATED_GBL_DATA_SIZE)
239
240#define CONFIG_OMAP3_SPI
241
242/*
243 * USB
244 *
245 * Currently only EHCI is enabled, the MUSB OTG controller
246 * is not enabled.
247 */
248
249/* USB EHCI */
Tapani Utriainen550e3752013-12-04 09:27:33 +0100250#define CONFIG_USB_EHCI
251#define CONFIG_USB_EHCI_OMAP
252#define CONFIG_OMAP_EHCI_PHY1_RESET_GPIO 162
253
254#define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 3
255#define CONFIG_USB_HOST_ETHER
256#define CONFIG_USB_ETHER_SMSC95XX
257
258#define CONFIG_USB_ETHER
259#define CONFIG_USB_ETHER_RNDIS
Tapani Utriainen550e3752013-12-04 09:27:33 +0100260
Stefan Roesea9f52492013-12-04 09:27:34 +0100261/* Defines for SPL */
Stefan Roesea9f52492013-12-04 09:27:34 +0100262#define CONFIG_SPL_FRAMEWORK
263#define CONFIG_SPL_NAND_SIMPLE
264
Paul Kocialkowskie2ccdf82014-11-08 23:14:55 +0100265#define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1
Guillaume GARDET205b4f32014-10-15 17:53:11 +0200266#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
Stefan Roesea9f52492013-12-04 09:27:34 +0100267
268#define CONFIG_SPL_BOARD_INIT
Stefan Roesea9f52492013-12-04 09:27:34 +0100269#define CONFIG_SPL_NAND_BASE
270#define CONFIG_SPL_NAND_DRIVERS
271#define CONFIG_SPL_NAND_ECC
Stefan Roesea9f52492013-12-04 09:27:34 +0100272#define CONFIG_SPL_OMAP3_ID_NAND
Tom Rini983e3702016-11-07 21:34:54 -0500273#define CONFIG_SPL_LDSCRIPT "arch/arm/mach-omap2/u-boot-spl.lds"
Stefan Roesea9f52492013-12-04 09:27:34 +0100274
275/* NAND boot config */
276#define CONFIG_SYS_NAND_5_ADDR_CYCLE
277#define CONFIG_SYS_NAND_PAGE_COUNT 64
278#define CONFIG_SYS_NAND_PAGE_SIZE 2048
279#define CONFIG_SYS_NAND_OOBSIZE 64
280#define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
281#define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
282/*
283 * Use the ECC/OOB layout from omap_gpmc.h that matches your chip:
284 * SP vs LP, 8bit vs 16bit: GPMC_NAND_HW_ECC_LAYOUT
285 */
286#define CONFIG_SYS_NAND_ECCPOS { 2, 3, 4, 5, 6, 7, 8, 9, \
287 10, 11, 12, 13 }
288#define CONFIG_SYS_NAND_ECCSIZE 512
289#define CONFIG_SYS_NAND_ECCBYTES 3
290#define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_HAM1_CODE_HW
291
292#define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE
293#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000
294
295#define CONFIG_SPL_TEXT_BASE 0x40200800
Tom Rinifa2f81b2016-08-26 13:30:43 -0400296#define CONFIG_SPL_MAX_SIZE (SRAM_SCRATCH_SPACE_ADDR - \
297 CONFIG_SPL_TEXT_BASE)
Stefan Roesea9f52492013-12-04 09:27:34 +0100298
299/*
300 * Use 0x80008000 as TEXT_BASE here for compatibility reasons with the
301 * older x-loader implementations. And move the BSS area so that it
302 * doesn't overlap with TEXT_BASE.
303 */
304#define CONFIG_SYS_TEXT_BASE 0x80008000
305#define CONFIG_SPL_BSS_START_ADDR 0x80100000
306#define CONFIG_SPL_BSS_MAX_SIZE 0x80000 /* 512 KB */
307
308#define CONFIG_SYS_SPL_MALLOC_START 0x80208000
309#define CONFIG_SYS_SPL_MALLOC_SIZE 0x100000
310
Tapani Utriainen550e3752013-12-04 09:27:33 +0100311#endif /* __CONFIG_H */