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