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