]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - include/configs/tx6.h
karo: tx6: add missing '/' to MMC_ROOT_STR
[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                (CONFIG_SYS_SDRAM_CLK * 1000000 / 2)
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 /*
43  * Memory configuration options
44  */
45 #define CONFIG_NR_DRAM_BANKS            0x1             /* # of SDRAM banks */
46 #define PHYS_SDRAM_1                    0x10000000      /* Base address of bank 1 */
47 #ifdef CONFIG_SYS_SDRAM_BUS_WIDTH
48 #define PHYS_SDRAM_1_WIDTH              CONFIG_SYS_SDRAM_BUS_WIDTH
49 #else
50 #define PHYS_SDRAM_1_WIDTH              64
51 #endif
52 #define PHYS_SDRAM_1_SIZE               (SZ_512M / 32 * PHYS_SDRAM_1_WIDTH)
53 #ifdef CONFIG_MX6Q
54 #define CONFIG_SYS_SDRAM_CLK            528
55 #else
56 #define CONFIG_SYS_SDRAM_CLK            400
57 #endif
58 #define CONFIG_STACKSIZE                SZ_128K
59 #define CONFIG_SYS_MALLOC_LEN           SZ_8M
60 #define CONFIG_SYS_MEMTEST_START        PHYS_SDRAM_1    /* Memtest start address */
61 #define CONFIG_SYS_MEMTEST_END          (CONFIG_SYS_MEMTEST_START + SZ_4M)
62
63 /*
64  * U-Boot general configurations
65  */
66 #define CONFIG_SYS_LONGHELP
67 #if defined(CONFIG_MX6Q)
68 #define CONFIG_SYS_PROMPT               "TX6Q U-Boot > "
69 #elif defined(CONFIG_MX6DL)
70 #define CONFIG_SYS_PROMPT               "TX6DL U-Boot > "
71 #elif defined(CONFIG_MX6S)
72 #define CONFIG_SYS_PROMPT               "TX6S U-Boot > "
73 #else
74 #error Unsupported i.MX6 processor variant
75 #endif
76 #define CONFIG_SYS_CBSIZE               2048    /* Console I/O buffer size */
77 #define CONFIG_SYS_PBSIZE                                               \
78         (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
79                                                 /* Print buffer size */
80 #define CONFIG_SYS_MAXARGS              256     /* Max number of command args */
81 #define CONFIG_SYS_BARGSIZE             CONFIG_SYS_CBSIZE
82                                                 /* Boot argument buffer size */
83 #define CONFIG_VERSION_VARIABLE                 /* U-BOOT version */
84 #define CONFIG_AUTO_COMPLETE                    /* Command auto complete */
85 #define CONFIG_CMDLINE_EDITING                  /* Command history etc */
86
87 #define CONFIG_SYS_64BIT_VSPRINTF
88 #define CONFIG_SYS_NO_FLASH
89
90 /*
91  * Flattened Device Tree (FDT) support
92 */
93 #ifndef CONFIG_MFG
94 #define CONFIG_OF_LIBFDT
95 #ifdef CONFIG_OF_LIBFDT
96 #ifndef CONFIG_NO_NAND
97 #define CONFIG_FDT_FIXUP_PARTITIONS
98 #endif
99 #define CONFIG_OF_BOARD_SETUP
100 #endif /* CONFIG_OF_LIBFDT */
101 #endif /* CONFIG_MFG */
102
103 /*
104  * Boot Linux
105  */
106 #define xstr(s)                         str(s)
107 #define str(s)                          #s
108 #define __pfx(x, s)                     (x##s)
109 #define _pfx(x, s)                      __pfx(x, s)
110
111 #define CONFIG_CMDLINE_TAG
112 #define CONFIG_INITRD_TAG
113 #define CONFIG_SETUP_MEMORY_TAGS
114 #ifndef CONFIG_MFG
115 #define CONFIG_BOOTDELAY                1
116 #else
117 #define CONFIG_BOOTDELAY                0
118 #endif
119 #define CONFIG_ZERO_BOOTDELAY_CHECK
120 #define CONFIG_SYS_AUTOLOAD             "no"
121 #ifndef CONFIG_MFG
122 #define CONFIG_BOOTFILE                 "uImage"
123 #define CONFIG_BOOTARGS                 "init=/linuxrc console=ttymxc0,115200 ro debug panic=1"
124 #define CONFIG_BOOTCOMMAND              "run bootcmd_${boot_mode} bootm_cmd"
125 #else
126 #define CONFIG_BOOTCOMMAND              "env import " xstr(CONFIG_BOOTCMD_MFG_LOADADDR) ";run bootcmd_mfg"
127 #define CONFIG_BOOTCMD_MFG_LOADADDR     10500000
128 #define CONFIG_DELAY_ENVIRONMENT
129 #endif /* CONFIG_MFG */
130 #define CONFIG_LOADADDR                 18000000
131 #define CONFIG_FDTADDR                  11000000
132 #define CONFIG_SYS_LOAD_ADDR            _pfx(0x, CONFIG_LOADADDR)
133 #define CONFIG_SYS_FDT_ADDR             _pfx(0x, CONFIG_FDTADDR)
134 #define CONFIG_HW_WATCHDOG
135 #ifndef CONFIG_SYS_LVDS_IF
136 #define DEFAULT_VIDEO_MODE              "VGA"
137 #else
138 #define DEFAULT_VIDEO_MODE              "HSD100PXN1"
139 #endif
140
141 /*
142  * Extra Environments
143  */
144 #ifndef CONFIG_MFG
145 #ifdef CONFIG_ENV_IS_NOWHERE
146 #define CONFIG_EXTRA_ENV_SETTINGS                                       \
147         "autostart=no\0"                                                \
148         "autoload=no\0"                                                 \
149         "bootdelay=-1\0"                                                \
150         "fdtaddr=" xstr(CONFIG_FDTADDR) "\0"                            \
151         "mtdids=" MTDIDS_DEFAULT "\0"                                   \
152         "mtdparts=" MTDPARTS_DEFAULT "\0"
153 #else
154 #define CONFIG_EXTRA_ENV_SETTINGS                                       \
155         "autostart=no\0"                                                \
156         "baseboard=stk5-v3\0"                                           \
157         "bootargs_jffs2=run default_bootargs;set bootargs ${bootargs}"  \
158         " root=/dev/mtdblock3 rootfstype=jffs2\0"                       \
159         "bootargs_mmc=run default_bootargs;set bootargs ${bootargs}"    \
160         MMC_ROOT_STR                                                    \
161         "bootargs_nfs=run default_bootargs;set bootargs ${bootargs}"    \
162         " root=/dev/nfs nfsroot=${nfs_server}:${nfsroot},nolock"        \
163         " ip=dhcp\0"                                                    \
164         "bootargs_ubifs=run default_bootargs;set bootargs ${bootargs}"  \
165         " ubi.mtd=rootfs root=ubi0:rootfs rootfstype=ubifs\0"           \
166         "bootcmd_jffs2=set autostart no;run bootargs_jffs2"             \
167         ";nboot linux\0"                                                \
168         "bootcmd_mmc=set autostart no;run bootargs_mmc"                 \
169         ";fatload mmc 0 ${loadaddr} uImage\0"                           \
170         CONFIG_SYS_BOOT_CMD_NAND                                        \
171         "bootcmd_net=set autoload y;set autostart n;run bootargs_nfs"   \
172         ";dhcp\0"                                                       \
173         "bootm_cmd=bootm ${loadaddr} - ${fdtaddr}\0"                    \
174         "boot_mode=" CONFIG_SYS_DEFAULT_BOOT_MODE "\0"                  \
175         "cpu_clk=800\0"                                                 \
176         "default_bootargs=set bootargs " CONFIG_BOOTARGS                \
177         " ${append_bootargs}\0"                                         \
178         "fdtaddr=" xstr(CONFIG_FDTADDR) "\0"                            \
179         CONFIG_SYS_FDTSAVE_CMD                                          \
180         "mtdids=" MTDIDS_DEFAULT "\0"                                   \
181         "mtdparts=" MTDPARTS_DEFAULT "\0"                               \
182         "nfsroot=/tftpboot/rootfs\0"                                    \
183         "otg_mode=device\0"                                             \
184         ROOTPART_UUID_STR                                               \
185         "touchpanel=tsc2007\0"                                          \
186         "video_mode=" DEFAULT_VIDEO_MODE "\0"
187 #endif /*  CONFIG_ENV_IS_NOWHERE */
188 #endif /*  CONFIG_MFG */
189
190 #ifndef CONFIG_NO_NAND
191 #define CONFIG_SYS_DEFAULT_BOOT_MODE "nand"
192 #define CONFIG_SYS_BOOT_CMD_NAND                                        \
193         "bootcmd_nand=set autostart no;run bootargs_ubifs;nboot linux\0"
194 #define CONFIG_SYS_FDTSAVE_CMD                                          \
195         "fdtsave=fdt resize;nand erase.part dtb"                        \
196         ";nand write ${fdtaddr} dtb ${fdtsize}\0"
197 #define MTD_NAME                        "gpmi-nand"
198 #define MTDIDS_DEFAULT                  "nand0=" MTD_NAME
199 #define CONFIG_SYS_NAND_ONFI_DETECTION
200 #define MMC_ROOT_STR " root=/dev/mmcblk0p2 rootwait\0"
201 #define ROOTPART_UUID_STR ""
202 #else
203 #define CONFIG_SYS_DEFAULT_BOOT_MODE "mmc"
204 #define CONFIG_SYS_BOOT_CMD_NAND ""
205 #define CONFIG_SYS_FDTSAVE_CMD                                          \
206         "fdtsave=mmc open 0 1;mmc write ${fdtaddr} "                    \
207         xstr(CONFIG_SYS_DTB_BLKNO) " 80;mmc close 0 1\0"
208 #define MMC_ROOT_STR " root=PARTUUID=${rootpart_uuid} rootwait\0"
209 #define ROOTPART_UUID_STR "rootpart_uuid=0cc66cc0-02\0"
210 #define MTD_NAME                        ""
211 #define MTDIDS_DEFAULT                  ""
212 #define CONFIG_SUPPORT_EMMC_BOOT
213 #define CONFIG_MMC_BOOT_DEV             0
214 #endif
215
216 /*
217  * U-Boot Commands
218  */
219 #include <config_cmd_default.h>
220 #define CONFIG_CMD_CACHE
221 #define CONFIG_CMD_MMC
222 #ifndef CONFIG_NO_NAND
223 #define CONFIG_CMD_NAND
224 #define CONFIG_CMD_MTDPARTS
225 #endif
226 #define CONFIG_CMD_BOOTCE
227 #define CONFIG_CMD_BOOTZ
228 #define CONFIG_CMD_TIME
229 #define CONFIG_CMD_I2C
230 #define CONFIG_CMD_MEMTEST
231
232 /*
233  * Serial Driver
234  */
235 #define CONFIG_MXC_UART
236 #define CONFIG_MXC_UART_BASE            UART1_BASE
237 #define CONFIG_BAUDRATE                 115200          /* Default baud rate */
238 #define CONFIG_SYS_BAUDRATE_TABLE       { 9600, 19200, 38400, 57600, 115200, }
239 #define CONFIG_SYS_CONSOLE_INFO_QUIET
240
241 /*
242  * GPIO driver
243  */
244 #define CONFIG_MXC_GPIO
245
246 /*
247  * Ethernet Driver
248  */
249 #define CONFIG_FEC_MXC
250 #ifdef CONFIG_FEC_MXC
251 /* This is required for the FEC driver to work with cache enabled */
252 #define CONFIG_SYS_ARM_CACHE_WRITETHROUGH
253 #define CONFIG_SYS_CACHELINE_SIZE       64
254
255 #define IMX_FEC_BASE                    ENET_BASE_ADDR
256 #define CONFIG_FEC_MXC_PHYADDR          0
257 #define CONFIG_PHYLIB
258 #define CONFIG_PHY_SMSC
259 #define CONFIG_MII
260 #define CONFIG_FEC_XCV_TYPE             RMII
261 #define CONFIG_GET_FEC_MAC_ADDR_FROM_IIM
262 #define CONFIG_CMD_MII
263 #define CONFIG_CMD_DHCP
264 #define CONFIG_CMD_PING
265 /* Add for working with "strict" DHCP server */
266 #define CONFIG_BOOTP_SUBNETMASK
267 #define CONFIG_BOOTP_GATEWAY
268 #define CONFIG_BOOTP_DNS
269 #endif
270
271 /*
272  * I2C Configs
273  */
274 #ifdef CONFIG_CMD_I2C
275 #define CONFIG_HARD_I2C
276 #define CONFIG_I2C_MXC
277 #define CONFIG_SYS_I2C_BASE             I2C1_BASE_ADDR
278 #define CONFIG_SYS_I2C_MX6_PORT1
279 #define CONFIG_SYS_I2C_SPEED            400000
280 #if defined(CONFIG_TX6_REV)
281 #if CONFIG_TX6_REV == 0x1
282 #define CONFIG_SYS_I2C_SLAVE            0x3c
283 #define CONFIG_LTC3676
284 #elif CONFIG_TX6_REV == 0x2
285 #define CONFIG_SYS_I2C_SLAVE            0x32
286 #define CONFIG_RN5T618
287 #elif CONFIG_TX6_REV == 0x3
288 #define CONFIG_SYS_I2C_SLAVE            0x33
289 #define CONFIG_RN5T567
290 #else
291 #error Unsupported TX6 module revision
292 #endif
293 #endif /* CONFIG_TX6_REV */
294 /* autodetect which PMIC is present to derive TX6_REV */
295 #define CONFIG_LTC3676                  /* TX6_REV == 1 */
296 #define CONFIG_RN5T567                  /* TX6_REV == 3 */
297 #endif /* CONFIG_CMD_I2C */
298
299 #ifndef CONFIG_ENV_IS_NOWHERE
300 /* define one of the following options:
301 #define CONFIG_ENV_IS_IN_NAND
302 #define CONFIG_ENV_IS_IN_MMC
303 */
304 #define CONFIG_ENV_IS_IN_NAND
305 #endif
306 #define CONFIG_ENV_OVERWRITE
307
308 /*
309  * NAND flash driver
310  */
311 #ifndef CONFIG_NO_NAND
312 #define CONFIG_MTD_DEVICE
313 #if 0
314 #define CONFIG_MTD_DEBUG
315 #define CONFIG_MTD_DEBUG_VERBOSE        4
316 #endif
317 #define CONFIG_NAND_MXS
318 #define CONFIG_NAND_MXS_NO_BBM_SWAP
319 #define CONFIG_APBH_DMA
320 #define CONFIG_APBH_DMA_BURST
321 #define CONFIG_APBH_DMA_BURST8
322 #define CONFIG_CMD_NAND_TRIMFFS
323 #define CONFIG_SYS_MXS_DMA_CHANNEL      4
324 #define CONFIG_SYS_MAX_FLASH_BANKS      0x1
325 #define CONFIG_SYS_NAND_MAX_CHIPS       0x1
326 #define CONFIG_SYS_MAX_NAND_DEVICE      0x1
327 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
328 #define CONFIG_SYS_NAND_USE_FLASH_BBT
329 #define CONFIG_SYS_NAND_BASE            0x00000000
330 #define CONFIG_CMD_ROMUPDATE
331
332 #define CONFIG_ENV_OFFSET               (CONFIG_U_BOOT_IMG_SIZE + CONFIG_SYS_NAND_U_BOOT_OFFS)
333 #define CONFIG_ENV_SIZE                 SZ_128K
334 #define CONFIG_ENV_RANGE                (3 * CONFIG_SYS_NAND_BLOCK_SIZE)
335 #else
336 #undef CONFIG_ENV_IS_IN_NAND
337 #endif /* CONFIG_NO_NAND */
338
339 #ifdef CONFIG_ENV_OFFSET_REDUND
340 #define CONFIG_SYS_ENV_PART_STR         xstr(CONFIG_SYS_ENV_PART_SIZE)  \
341         "(env),"                                                        \
342         xstr(CONFIG_SYS_ENV_PART_SIZE)                                  \
343         "(env2),"
344 #define CONFIG_SYS_USERFS_PART_STR      xstr(CONFIG_SYS_USERFS_PART_SIZE) "(userfs)"
345 #else
346 #define CONFIG_SYS_ENV_PART_STR         xstr(CONFIG_SYS_ENV_PART_SIZE)  \
347         "(env),"
348 #define CONFIG_SYS_USERFS_PART_STR      xstr(CONFIG_SYS_USERFS_PART_SIZE2) "(userfs)"
349 #endif /* CONFIG_ENV_OFFSET_REDUND */
350
351 /*
352  * MMC Driver
353  */
354 #ifdef CONFIG_CMD_MMC
355 #define CONFIG_MMC
356 #define CONFIG_GENERIC_MMC
357 #define CONFIG_FSL_ESDHC
358 #define CONFIG_FSL_USDHC
359 #define CONFIG_SYS_FSL_ESDHC_ADDR       0
360
361 #define CONFIG_DOS_PARTITION
362 #define CONFIG_CMD_FAT
363 #define CONFIG_FAT_WRITE
364 #define CONFIG_CMD_EXT2
365
366 /*
367  * Environments on MMC
368  */
369 #ifdef CONFIG_ENV_IS_IN_MMC
370 #define CONFIG_SYS_MMC_ENV_DEV          0
371 #define CONFIG_SYS_MMC_ENV_PART         0x1
372 #define CONFIG_DYNAMIC_MMC_DEVNO
373 #endif /* CONFIG_ENV_IS_IN_MMC */
374 #else
375 #undef CONFIG_ENV_IS_IN_MMC
376 #endif /* CONFIG_CMD_MMC */
377
378 #ifdef CONFIG_ENV_IS_NOWHERE
379 #undef CONFIG_ENV_SIZE
380 #define CONFIG_ENV_SIZE                 SZ_4K
381 #endif
382
383 #ifndef CONFIG_NO_NAND
384 #define MTDPARTS_DEFAULT                "mtdparts=" MTD_NAME ":"        \
385         xstr(CONFIG_SYS_U_BOOT_PART_SIZE)                               \
386         "@" xstr(CONFIG_SYS_NAND_U_BOOT_OFFS)                           \
387         "(u-boot),"                                                     \
388         CONFIG_SYS_ENV_PART_STR                                         \
389         "6m(linux),32m(rootfs)," CONFIG_SYS_USERFS_PART_STR ","         \
390         xstr(CONFIG_SYS_DTB_PART_SIZE)                                  \
391         "@" xstr(CONFIG_SYS_NAND_DTB_OFFSET) "(dtb),"                   \
392         xstr(CONFIG_SYS_NAND_BBT_SIZE)                                  \
393         "@" xstr(CONFIG_SYS_NAND_BBT_OFFSET) "(bbt)ro"
394 #else
395 #define MTDPARTS_DEFAULT                ""
396 #endif
397
398 #define CONFIG_SYS_SDRAM_BASE           PHYS_SDRAM_1
399 #define CONFIG_SYS_INIT_SP_ADDR         (CONFIG_SYS_SDRAM_BASE + 0x1000 - /* Fix this */ \
400                                         GENERATED_GBL_DATA_SIZE)
401
402 #endif /* __CONFIG_H */