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