481cad5523141001d410d9ad198d9f360d5babbb
[platform/kernel/u-boot.git] / include / configs / omap3_cairo.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Configuration settings for the QUIPOS Cairo board.
4  *
5  * Copyright (C) DENX GmbH
6  *
7  * Author :
8  *      Albert ARIBAUD <albert.aribaud@3adev.fr>
9  *
10  * Derived from EVM  code by
11  *      Manikandan Pillai <mani.pillai@ti.com>
12  * Itself derived from Beagle Board and 3430 SDP code by
13  *      Richard Woodruff <r-woodruff2@ti.com>
14  *      Syed Mohammed Khasim <khasim@ti.com>
15  *
16  * Also derived from include/configs/omap3_beagle.h
17  */
18
19 #ifndef __OMAP3_CAIRO_CONFIG_H
20 #define __OMAP3_CAIRO_CONFIG_H
21
22 /*
23  * 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM
24  * 64 bytes before this address should be set aside for u-boot.img's
25  * header. That is 0x800FFFC0--0x80100000 should not be used for any
26  * other needs.  We use this rather than the inherited defines from
27  * ti_armv7_common.h for backwards compatibility.
28  */
29 #define CONFIG_SYS_UBOOT_START          CONFIG_SYS_TEXT_BASE
30 #define CONFIG_SPL_BSS_START_ADDR       0x80000000
31 #define CONFIG_SPL_BSS_MAX_SIZE         (512 << 10)     /* 512 KB */
32 #define CONFIG_SYS_SPL_MALLOC_START     0x80208000
33 #define CONFIG_SYS_SPL_MALLOC_SIZE      0x100000
34
35 #include <configs/ti_omap3_common.h>
36
37 #define CONFIG_REVISION_TAG             1
38 #define CONFIG_ENV_OVERWRITE
39
40 /* Enable Multi Bus support for I2C */
41 #define CONFIG_I2C_MULTI_BUS            1
42
43 /* Probe all devices */
44 #define CONFIG_SYS_I2C_NOPROBES         { {0x0, 0x0} }
45
46 /*
47  * TWL4030
48  */
49 #define CONFIG_TWL4030_LED              1
50
51 /*
52  * Board NAND Info.
53  */
54 #define CONFIG_SYS_MAX_NAND_DEVICE      1               /* Max number of NAND */
55                                                         /* devices */
56 #define CONFIG_EXTRA_ENV_SETTINGS \
57         "machid=ffffffff\0" \
58         "fdt_high=0x87000000\0" \
59         "baudrate=115200\0" \
60         "fec_addr=00:50:C2:7E:90:F0\0" \
61         "netmask=255.255.255.0\0" \
62         "ipaddr=192.168.2.9\0" \
63         "gateway=192.168.2.1\0" \
64         "serverip=192.168.2.10\0" \
65         "nfshost=192.168.2.10\0" \
66         "stdin=serial\0" \
67         "stdout=serial\0" \
68         "stderr=serial\0" \
69         "bootargs_mmc_ramdisk=mem=128M " \
70                 "console=ttyO1,115200n8 " \
71                 "root=/dev/ram0 rw " \
72                 "initrd=0x81600000,16M " \
73                 "mpurate=600 ramdisk_size=16384 omapfb.rotate=1 " \
74                 "omapfb.rotate_type=1 omap_vout.vid1_static_vrfb_alloc=y\0" \
75         "mmcboot=mmc init; " \
76                 "fatload mmc 0 0x80000000 uImage; " \
77                 "fatload mmc 0 0x81600000 ramdisk.gz; " \
78                 "setenv bootargs ${bootargs_mmc_ramdisk}; " \
79                 "bootm 0x80000000\0" \
80         "bootargs_nfs=mem=99M console=ttyO0,115200n8 noinitrd rw ip=dhcp " \
81         "root=/dev/nfs " \
82         "nfsroot=192.168.2.10:/home/spiid/workdir/Quipos/rootfs,nolock " \
83         "mpurate=600 omapfb.rotate=1 omapfb.rotate_type=1 " \
84         "omap_vout.vid1_static_vrfb_alloc=y\0" \
85         "boot_nfs=run get_kernel; setenv bootargs ${bootargs_nfs}; " \
86         "bootm 0x80000000\0" \
87         "bootargs_nand=mem=128M console=ttyO1,115200n8 noinitrd " \
88         "root=/dev/mtdblock4 rw rootfstype=jffs2 mpurate=600 " \
89         "omap_vout.vid1_static_vrfb_alloc=y omapfb.rotate=1 " \
90         "omapfb.rotate_type=1\0" \
91         "boot_nand=nand read.i 0x80000000 280000 300000; setenv " \
92         "bootargs ${bootargs_nand}; bootm 0x80000000\0" \
93         "ledorange=i2c dev 1; i2c mw 60 00 00 1; i2c mw 60 14 FF 1; " \
94         "i2c mw 60 15 FF 1; i2c mw 60 16 FF 1; i2c mw 60 17 FF 1; " \
95         "i2c mw 60 09 10 1; i2c mw 60 06 10 1\0" \
96         "ledgreen=i2c dev 1; i2c mw 60 00 00 1; i2c mw 60 14 FF 1; " \
97         "i2c mw 60 15 FF 1; i2c mw 60 16 FF 1; i2c mw 60 17 FF 1; i2c " \
98         "mw 60 09 00 1; i2c mw 60 06 10 1\0" \
99         "ledoff=i2c dev 1; i2c mw 60 00 00 1; i2c mw 60 14 FF 1; " \
100         "i2c mw 60 15 FF 1; i2c mw 60 16 FF 1; i2c mw 60 17 FF 1; " \
101         "i2c mw 60 09 00 1; i2c mw 60 06 0 1\0" \
102         "ledred=i2c dev 1; i2c mw 60 00 00 1; i2c mw 60 14 FF 1; " \
103         "i2c mw 60 15 FF 1; i2c mw 60 16 FF 1; i2c mw 60 17 FF 1; " \
104         "i2c mw 60 09 10 1; i2c mw 60 06 0 1\0" \
105         "flash_xloader=mw.b 0x81600000 0xff 0x20000; " \
106                 "nand erase 0 20000; " \
107                 "fatload mmc 0 0x81600000 MLO; " \
108                 "nandecc hw; " \
109                 "nand write.i 0x81600000 0 20000;\0" \
110         "flash_uboot=mw.b 0x81600000 0xff 0x40000; " \
111                 "nand erase 80000 40000; " \
112                 "fatload mmc 0 0x81600000 u-boot.bin; " \
113                 "nandecc sw; " \
114                 "nand write.i 0x81600000 80000 40000;\0" \
115         "flash_kernel=mw.b 0x81600000 0xff 0x300000; " \
116                 "nand erase 280000 300000; " \
117                 "fatload mmc 0 0x81600000 uImage; " \
118                 "nandecc sw; " \
119                 "nand write.i 0x81600000 280000 300000;\0" \
120         "flash_rootfs=fatload mmc 0 0x81600000 rootfs.jffs2; " \
121                 "nandecc sw; " \
122                 "nand write.jffs2 0x680000 0xFF ${filesize}; " \
123                 "nand erase 680000 ${filesize}; " \
124                 "nand write.jffs2 81600000 680000 ${filesize};\0" \
125         "flash_scrub=nand scrub; " \
126                 "run flash_xloader; " \
127                 "run flash_uboot; " \
128                 "run flash_kernel; " \
129                 "run flash_rootfs;\0" \
130         "flash_all=run ledred; " \
131                 "nand erase.chip; " \
132                 "run ledorange; " \
133                 "run flash_xloader; " \
134                 "run flash_uboot; " \
135                 "run flash_kernel; " \
136                 "run flash_rootfs; " \
137                 "run ledgreen; " \
138                 "run boot_nand; \0" \
139
140 #define CONFIG_BOOTCOMMAND \
141         "if fatload mmc 0 0x81600000 MLO; then run flash_all; " \
142         "else run boot_nand; fi"
143
144 /*
145  * OMAP3 has 12 GP timers, they can be driven by the system clock
146  * (12/13/16.8/19.2/38.4MHz) or by 32KHz clock. We use 13MHz (V_SCLK).
147  * This rate is divided by a local divisor.
148  */
149 #define CONFIG_SYS_PTV                  2       /* Divisor: 2^(PTV+1) => 8 */
150
151 /*-----------------------------------------------------------------------
152  * FLASH and environment organization
153  */
154
155 /* **** PISMO SUPPORT *** */
156 #if defined(CONFIG_CMD_NAND)
157 #define CONFIG_SYS_FLASH_BASE           NAND_BASE
158 #endif
159
160 /* Monitor at start of flash */
161 #define CONFIG_SYS_MONITOR_BASE         CONFIG_SYS_FLASH_BASE
162 #define CONFIG_SYS_ONENAND_BASE         ONENAND_MAP
163
164 #define CONFIG_ENV_SIZE                 (128 << 10)     /* 128 KiB */
165 #define ONENAND_ENV_OFFSET              0x260000 /* environment starts here */
166
167 #define CONFIG_SYS_ENV_SECT_SIZE        (128 << 10)     /* 128 KiB */
168 #define CONFIG_ENV_OFFSET               0x260000
169 #define CONFIG_ENV_ADDR                 0x260000
170
171 /* Defines for SPL */
172
173 /* NAND boot config */
174 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
175 #define CONFIG_SYS_NAND_PAGE_COUNT      64
176 #define CONFIG_SYS_NAND_PAGE_SIZE       2048
177 #define CONFIG_SYS_NAND_OOBSIZE         64
178 #define CONFIG_SYS_NAND_BLOCK_SIZE      (128*1024)
179 #define CONFIG_SYS_NAND_BAD_BLOCK_POS   0
180 #define CONFIG_SYS_NAND_ECCPOS          {2, 3, 4, 5, 6, 7, 8, 9,\
181                                                 10, 11, 12, 13}
182 #define CONFIG_SYS_NAND_ECCSIZE         512
183 #define CONFIG_SYS_NAND_ECCBYTES        3
184 #define CONFIG_NAND_OMAP_ECCSCHEME      OMAP_ECC_HAM1_CODE_HW
185 #define CONFIG_SYS_NAND_U_BOOT_OFFS     0x80000
186 /* NAND: SPL falcon mode configs */
187 #ifdef CONFIG_SPL_OS_BOOT
188 #define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x280000
189 #endif
190
191 /* env defaults */
192 #define CONFIG_BOOTFILE                 "uImage"
193
194 /* Override OMAP3 common serial console configuration from UART3
195  * to UART2.
196  *
197  * Attention: for UART2, special MUX settings (MUX_DEFAULT(), MCBSP3)
198  * are needed and peripheral clocks for UART2 must be enabled in
199  * function per_clocks_enable().
200  */
201 #ifdef CONFIG_SPL_BUILD
202 #undef CONFIG_SERIAL3
203 #define CONFIG_SERIAL2
204 #endif
205
206 /* Provide the MACH_TYPE value the vendor kernel requires */
207 #define CONFIG_MACH_TYPE        3063
208
209 /*-----------------------------------------------------------------------
210  * FLASH and environment organization
211  */
212
213 /* **** PISMO SUPPORT *** */
214
215 #define CONFIG_SYS_MAX_FLASH_SECT       520     /* max number of sectors */
216                                                 /* on one chip */
217 #define CONFIG_SYS_MAX_FLASH_BANKS      2       /* max number of flash banks */
218
219 /*-----------------------------------------------------------------------
220  * CFI FLASH driver setup
221  */
222 /* timeout values are in ticks */
223 #define CONFIG_SYS_FLASH_ERASE_TOUT     (100 * CONFIG_SYS_HZ)
224 #define CONFIG_SYS_FLASH_WRITE_TOUT     (100 * CONFIG_SYS_HZ)
225
226 /* Flash banks JFFS2 should use */
227 #define CONFIG_SYS_MAX_MTD_BANKS        (CONFIG_SYS_MAX_FLASH_BANKS + \
228                                         CONFIG_SYS_MAX_NAND_DEVICE)
229 #define CONFIG_SYS_JFFS2_MEM_NAND
230 /* use flash_info[2] */
231 #define CONFIG_SYS_JFFS2_FIRST_BANK     CONFIG_SYS_MAX_FLASH_BANKS
232 #define CONFIG_SYS_JFFS2_NUM_BANKS      1
233
234 #endif /* __OMAP3_CAIRO_CONFIG_H */