]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - include/configs/tx6.h
karo: tx6: restructure boot related env settings
[karo-tx-uboot.git] / include / configs / tx6.h
1 /*
2  * Copyright (C) 2012 <LW@KARO-electronics.de>
3  *
4  * SPDX-License-Identifier:      GPL-2.0
5  *
6  */
7
8 #ifndef __CONFIG_H
9 #define __CONFIG_H
10
11 #include <asm/sizes.h>
12 #include <asm/arch/imx-regs.h>
13
14 /*
15  * Ka-Ro TX6 board - SoC configuration
16  */
17 #define CONFIG_MX6
18 #define CONFIG_SYS_MX6_HCLK             24000000
19 #define CONFIG_SYS_MX6_CLK32            32768
20 #define CONFIG_SYS_HZ                   1000            /* Ticks per second */
21 #define CONFIG_SHOW_ACTIVITY
22 #define CONFIG_ARCH_CPU_INIT
23 #define CONFIG_DISPLAY_BOARDINFO
24 #define CONFIG_BOARD_LATE_INIT
25 #define CONFIG_BOARD_EARLY_INIT_F
26
27 #ifndef CONFIG_MFG
28 /* LCD Logo and Splash screen support */
29 #define CONFIG_LCD
30 #ifdef CONFIG_LCD
31 #define CONFIG_SPLASH_SCREEN
32 #define CONFIG_SPLASH_SCREEN_ALIGN
33 #define CONFIG_VIDEO_IPUV3
34 #define CONFIG_IPUV3_CLK                266000000
35 #define CONFIG_LCD_LOGO
36 #define LCD_BPP                         LCD_COLOR24
37 #define CONFIG_CMD_BMP
38 #define CONFIG_VIDEO_BMP_RLE8
39 #endif /* CONFIG_LCD */
40 #endif /* CONFIG_MFG */
41
42 #ifdef CONFIG_SYS_LVDS_IF
43 #define is_lvds()                       1
44 #else
45 #define is_lvds()                       0
46 #endif
47
48 /*
49  * Memory configuration options
50  */
51 #define CONFIG_NR_DRAM_BANKS            1               /* # of SDRAM banks */
52 #define PHYS_SDRAM_1                    0x10000000      /* Base address of bank 1 */
53 #ifdef CONFIG_SYS_SDRAM_BUS_WIDTH
54 #define PHYS_SDRAM_1_WIDTH              CONFIG_SYS_SDRAM_BUS_WIDTH
55 #else
56 #define PHYS_SDRAM_1_WIDTH              64
57 #endif
58 #define PHYS_SDRAM_1_SIZE               (SZ_512M * (PHYS_SDRAM_1_WIDTH / 32))
59
60 #ifdef CONFIG_MX6Q
61 #define CONFIG_SYS_SDRAM_CLK            528
62 #else
63 #define CONFIG_SYS_SDRAM_CLK            400
64 #endif
65 #define CONFIG_STACKSIZE                SZ_128K
66 #define CONFIG_SYS_MALLOC_LEN           SZ_8M
67 #define CONFIG_SYS_MEMTEST_START        PHYS_SDRAM_1    /* Memtest start address */
68 #define CONFIG_SYS_MEMTEST_END          (CONFIG_SYS_MEMTEST_START + SZ_4M)
69
70 /*
71  * U-Boot general configurations
72  */
73 #define CONFIG_SYS_LONGHELP
74 #ifdef CONFIG_MX6Q
75 #define CONFIG_SYS_PROMPT               "TX6Q U-Boot > "
76 #else
77 #define CONFIG_SYS_PROMPT               "TX6DL U-Boot > "
78 #endif
79 #define CONFIG_SYS_CBSIZE               2048            /* Console I/O buffer size */
80 #define CONFIG_SYS_PBSIZE               (CONFIG_SYS_CBSIZE + \
81                                 sizeof(CONFIG_SYS_PROMPT) + 16) /* Print buffer size */
82 #define CONFIG_SYS_MAXARGS              64              /* Max number of command args */
83 #define CONFIG_SYS_BARGSIZE             CONFIG_SYS_CBSIZE
84                                         /* Boot argument buffer size */
85 #define CONFIG_VERSION_VARIABLE         /* U-BOOT version */
86 #define CONFIG_AUTO_COMPLETE            /* Command auto complete */
87 #define CONFIG_CMDLINE_EDITING          /* Command history etc */
88
89 #define CONFIG_SYS_64BIT_VSPRINTF
90 #define CONFIG_SYS_NO_FLASH
91
92 /*
93  * Flattened Device Tree (FDT) support
94 */
95 #ifndef CONFIG_MFG
96 #define CONFIG_OF_LIBFDT
97 #ifdef CONFIG_OF_LIBFDT
98 #define CONFIG_FDT_FIXUP_PARTITIONS
99 #define CONFIG_OF_BOARD_SETUP
100 #ifdef CONFIG_MX6Q
101 #define CONFIG_DEFAULT_DEVICE_TREE      tx6q
102 #define CONFIG_ARCH_DEVICE_TREE         mx6q
103 #else
104 #define CONFIG_DEFAULT_DEVICE_TREE      tx6dl
105 #define CONFIG_ARCH_DEVICE_TREE         mx6dl
106 #endif
107 #define CONFIG_SYS_FDT_ADDR             (PHYS_SDRAM_1 + SZ_16M)
108 #endif /* CONFIG_OF_LIBFDT */
109 #endif /* CONFIG_MFG */
110
111 /*
112  * Boot Linux
113  */
114 #define xstr(s)                         str(s)
115 #define str(s)                          #s
116 #define __pfx(x, s)                     (x##s)
117 #define _pfx(x, s)                      __pfx(x, s)
118
119 #define CONFIG_CMDLINE_TAG
120 #define CONFIG_INITRD_TAG
121 #define CONFIG_SETUP_MEMORY_TAGS
122 #define CONFIG_SERIAL_TAG
123 #ifndef CONFIG_MFG
124 #define CONFIG_BOOTDELAY                1
125 #else
126 #define CONFIG_BOOTDELAY                0
127 #endif
128 #define CONFIG_ZERO_BOOTDELAY_CHECK
129 #define CONFIG_SYS_AUTOLOAD             "no"
130 #ifndef CONFIG_MFG
131 #define CONFIG_BOOTFILE                 "uImage"
132 #define CONFIG_BOOTARGS                 "init=/linuxrc console=ttymxc0,115200 ro debug panic=1"
133 #define CONFIG_BOOTCOMMAND              "run bootcmd_${boot_mode} bootm_cmd"
134 #else
135 #define CONFIG_BOOTCOMMAND              "env import " xstr(CONFIG_BOOTCMD_MFG_LOADADDR) ";run bootcmd_mfg"
136 #define CONFIG_BOOTCMD_MFG_LOADADDR     10500000
137 #define CONFIG_DELAY_ENVIRONMENT
138 #endif /* CONFIG_MFG */
139 #define CONFIG_LOADADDR                 18000000
140 #define CONFIG_SYS_LOAD_ADDR            _pfx(0x, CONFIG_LOADADDR)
141 #define CONFIG_IMX_WATCHDOG
142 #define CONFIG_WATCHDOG_TIMEOUT_MSECS   3000
143
144 /*
145  * Extra Environments
146  */
147 #ifndef CONFIG_MFG
148 #ifdef CONFIG_ENV_IS_NOWHERE
149 #define CONFIG_EXTRA_ENV_SETTINGS                                       \
150         "autostart=no\0"                                                \
151         "autoload=no\0"                                                 \
152         "bootdelay=-1\0"                                                \
153         "fdtaddr=11000000\0"                                            \
154         "mtdids=" MTDIDS_DEFAULT "\0"                                   \
155         "mtdparts=" MTDPARTS_DEFAULT "\0"
156 #else
157 #define CONFIG_EXTRA_ENV_SETTINGS                                       \
158         "autostart=no\0"                                                \
159         "baseboard=stk5-v3\0"                                           \
160         "bootargs_jffs2=run default_bootargs;set bootargs ${bootargs}"  \
161         " root=/dev/mtdblock3 rootfstype=jffs2\0"                       \
162         "bootargs_mmc=run default_bootargs;set bootargs ${bootargs}"    \
163         " root=/dev/mmcblk0p2 rootwait\0"                               \
164         "bootargs_nfs=run default_bootargs;set bootargs ${bootargs}"    \
165         " root=/dev/nfs nfsroot=${nfs_server}:${nfsroot},nolock"        \
166         " ip=dhcp\0"                                                    \
167         "bootargs_ubifs=run default_bootargs;set bootargs ${bootargs}"  \
168         " ubi.mtd=rootfs root=ubi0:rootfs rootfstype=ubifs\0"           \
169         "bootcmd_jffs2=set autostart no;run bootargs_jffs2"             \
170         ";nboot linux\0"                                                \
171         "bootcmd_mmc=set autostart no;run bootargs_mmc"                 \
172         ";fatload mmc 0 ${loadaddr} uImage\0"                           \
173         "bootcmd_nand=set autostart no;run bootargs_ubifs"              \
174         ";nboot linux\0"                                                \
175         "bootcmd_net=set autoload y;set autostart n;run bootargs_nfs"   \
176         ";dhcp\0"                                                       \
177         "bootm_cmd=bootm ${loadaddr} - ${fdtaddr}\0"                    \
178         "boot_mode=nand\0"                                              \
179         "cpu_clk=800\0"                                                 \
180         "default_bootargs=set bootargs " CONFIG_BOOTARGS                \
181         " ${append_bootargs}\0"                                         \
182         "fdtaddr=11000000\0"                                            \
183         "fdtsave=nand erase.part dtb"                                   \
184         ";nand write ${fdtaddr} dtb ${fdtsize}\0"                       \
185         "mtdids=" MTDIDS_DEFAULT "\0"                                   \
186         "mtdparts=" MTDPARTS_DEFAULT "\0"                               \
187         "nfsroot=/tftpboot/rootfs\0"                                    \
188         "otg_mode=device\0"                                             \
189         "touchpanel=tsc2007\0"                                          \
190         "video_mode=VGA\0"
191 #endif /*  CONFIG_ENV_IS_NOWHERE */
192 #endif /*  CONFIG_MFG */
193
194 #define MTD_NAME                        "gpmi-nand"
195 #define MTDIDS_DEFAULT                  "nand0=" MTD_NAME
196 #define CONFIG_SYS_NAND_ONFI_DETECTION
197
198 /*
199  * U-Boot Commands
200  */
201 #include <config_cmd_default.h>
202 #define CONFIG_CMD_CACHE
203 #define CONFIG_CMD_MMC
204 #define CONFIG_CMD_NAND
205 #define CONFIG_CMD_MTDPARTS
206 #define CONFIG_CMD_BOOTCE
207 #define CONFIG_CMD_TIME
208 #define CONFIG_CMD_I2C
209 #define CONFIG_CMD_MEMTEST
210
211 /*
212  * Serial Driver
213  */
214 #define CONFIG_MXC_UART
215 #define CONFIG_MXC_UART_BASE            UART1_BASE
216 #define CONFIG_BAUDRATE                 115200          /* Default baud rate */
217 #define CONFIG_SYS_BAUDRATE_TABLE       { 9600, 19200, 38400, 57600, 115200, }
218 #define CONFIG_SYS_CONSOLE_INFO_QUIET
219
220 /*
221  * GPIO driver
222  */
223 #define CONFIG_MXC_GPIO
224
225 /*
226  * Ethernet Driver
227  */
228 #define CONFIG_FEC_MXC
229 #ifdef CONFIG_FEC_MXC
230 /* This is required for the FEC driver to work with cache enabled */
231 #define CONFIG_SYS_ARM_CACHE_WRITETHROUGH
232 #define CONFIG_SYS_CACHELINE_SIZE       64
233
234 #define IMX_FEC_BASE                    ENET_BASE_ADDR
235 #define CONFIG_FEC_MXC_PHYADDR          0
236 #define CONFIG_PHYLIB
237 #define CONFIG_PHY_SMSC
238 #define CONFIG_MII
239 #define CONFIG_FEC_XCV_TYPE             RMII
240 #define CONFIG_GET_FEC_MAC_ADDR_FROM_IIM
241 #define CONFIG_CMD_MII
242 #define CONFIG_CMD_DHCP
243 #define CONFIG_CMD_PING
244 /* Add for working with "strict" DHCP server */
245 #define CONFIG_BOOTP_SUBNETMASK
246 #define CONFIG_BOOTP_GATEWAY
247 #define CONFIG_BOOTP_DNS
248 #endif
249
250 /*
251  * I2C Configs
252  */
253 #ifdef CONFIG_CMD_I2C
254 #define CONFIG_HARD_I2C
255 #define CONFIG_I2C_MXC
256 #define CONFIG_SYS_I2C_BASE             I2C1_BASE_ADDR
257 #define CONFIG_SYS_I2C_MX6_PORT1
258 #define CONFIG_SYS_I2C_SPEED            400000
259 #define CONFIG_SYS_I2C_SLAVE            0x3c
260 #endif
261
262 #ifndef CONFIG_ENV_IS_NOWHERE
263 /* define one of the following options:
264 #define CONFIG_ENV_IS_IN_NAND
265 #define CONFIG_ENV_IS_IN_MMC
266 */
267 #define CONFIG_ENV_IS_IN_NAND
268 #endif
269 #define CONFIG_ENV_OVERWRITE
270
271 /*
272  * NAND flash driver
273  */
274 #ifdef CONFIG_CMD_NAND
275 #define CONFIG_MTD_DEVICE
276 #if 0
277 #define CONFIG_MTD_DEBUG
278 #define CONFIG_MTD_DEBUG_VERBOSE        4
279 #endif
280 #define CONFIG_NAND_MXS
281 #define CONFIG_NAND_MXS_NO_BBM_SWAP
282 #define CONFIG_APBH_DMA
283 #define CONFIG_APBH_DMA_BURST
284 #define CONFIG_APBH_DMA_BURST8
285 #define CONFIG_CMD_NAND_TRIMFFS
286 #define CONFIG_SYS_MXS_DMA_CHANNEL      4
287 #define CONFIG_SYS_MAX_FLASH_BANKS      1
288 #define CONFIG_SYS_NAND_MAX_CHIPS       1
289 #define CONFIG_SYS_MAX_NAND_DEVICE      1
290 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
291 #define CONFIG_SYS_NAND_USE_FLASH_BBT
292 #define CONFIG_SYS_NAND_BASE            0x00000000
293 #define CONFIG_CMD_ROMUPDATE
294 #else
295 #undef CONFIG_ENV_IS_IN_NAND
296 #endif /* CONFIG_CMD_NAND */
297
298 #define CONFIG_ENV_OFFSET               (CONFIG_U_BOOT_IMG_SIZE + CONFIG_SYS_NAND_U_BOOT_OFFS)
299 #define CONFIG_ENV_SIZE                 SZ_128K
300 #define CONFIG_ENV_RANGE                (3 * CONFIG_SYS_NAND_BLOCK_SIZE)
301 #ifdef CONFIG_ENV_OFFSET_REDUND
302 #define CONFIG_SYS_ENV_PART_STR         xstr(CONFIG_SYS_ENV_PART_SIZE)  \
303         "(env),"                                                        \
304         xstr(CONFIG_SYS_ENV_PART_SIZE)                                  \
305         "(env2),"
306 #define CONFIG_SYS_USERFS_PART_STR      xstr(CONFIG_SYS_USERFS_PART_SIZE) "(userfs)"
307 #else
308 #define CONFIG_SYS_ENV_PART_STR         xstr(CONFIG_SYS_ENV_PART_SIZE)  \
309         "(env),"
310 #define CONFIG_SYS_USERFS_PART_STR      xstr(CONFIG_SYS_USERFS_PART_SIZE2) "(userfs)"
311 #endif /* CONFIG_ENV_OFFSET_REDUND */
312
313 /*
314  * MMC Driver
315  */
316 #ifdef CONFIG_CMD_MMC
317 #define CONFIG_MMC
318 #define CONFIG_GENERIC_MMC
319 #define CONFIG_FSL_ESDHC
320 #define CONFIG_FSL_USDHC
321 #define CONFIG_SYS_FSL_ESDHC_ADDR       0
322 #define CONFIG_SYS_FSL_ESDHC_NUM        2
323
324 #define CONFIG_DOS_PARTITION
325 #define CONFIG_CMD_FAT
326 #define CONFIG_CMD_EXT2
327
328 /*
329  * Environments on MMC
330  */
331 #ifdef CONFIG_ENV_IS_IN_MMC
332 #define CONFIG_SYS_MMC_ENV_DEV          0
333 #undef CONFIG_ENV_OFFSET
334 #undef CONFIG_ENV_SIZE
335 /* Associated with the MMC layout defined in mmcops.c */
336 #define CONFIG_ENV_OFFSET               SZ_1K
337 #define CONFIG_ENV_SIZE                 (SZ_128K - CONFIG_ENV_OFFSET)
338 #define CONFIG_DYNAMIC_MMC_DEVNO
339 #endif /* CONFIG_ENV_IS_IN_MMC */
340 #else
341 #undef CONFIG_ENV_IS_IN_MMC
342 #endif /* CONFIG_CMD_MMC */
343
344 #ifdef CONFIG_ENV_IS_NOWHERE
345 #undef CONFIG_ENV_SIZE
346 #define CONFIG_ENV_SIZE                 SZ_4K
347 #endif
348
349 #define MTDPARTS_DEFAULT                "mtdparts=" MTD_NAME ":"        \
350         xstr(CONFIG_SYS_U_BOOT_PART_SIZE)                               \
351         "@" xstr(CONFIG_SYS_NAND_U_BOOT_OFFS)                           \
352         "(u-boot),"                                                     \
353         CONFIG_SYS_ENV_PART_STR                                         \
354         "4m(linux),32m(rootfs)," CONFIG_SYS_USERFS_PART_STR ","         \
355         xstr(CONFIG_SYS_DTB_PART_SIZE)                                  \
356         "(dtb),"                                                        \
357         xstr(CONFIG_SYS_NAND_BBT_SIZE)                                  \
358         "@" xstr(CONFIG_SYS_NAND_BBT_OFFSET) "(bbt)ro"
359
360 #define CONFIG_SYS_SDRAM_BASE           PHYS_SDRAM_1
361 #define CONFIG_SYS_INIT_SP_ADDR         (CONFIG_SYS_SDRAM_BASE + 0x1000 - /* Fix this */ \
362                                         GENERATED_GBL_DATA_SIZE)
363
364 #endif /* __CONFIG_H */