]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - include/configs/tx6q.h
7bdd1847b5511c01b88aa539828f5b927463317e
[karo-tx-uboot.git] / include / configs / tx6q.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 __TX6Q_H
14 #define __TX6Q_H
15
16 #include <asm/sizes.h>
17
18 /*
19  * Ka-Ro TX6Q board - SoC configuration
20  */
21 #define CONFIG_MX6Q
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 #define PHYS_SDRAM_1_SIZE               SZ_1G
53 #define CONFIG_STACKSIZE                SZ_128K
54 #define CONFIG_SYS_MALLOC_LEN           SZ_8M
55 #define CONFIG_SYS_MEMTEST_START        PHYS_SDRAM_1    /* Memtest start address */
56 #define CONFIG_SYS_MEMTEST_END          (CONFIG_SYS_MEMTEST_START + SZ_4M)
57 #define CONFIG_SYS_SDRAM_CLK            528
58
59 /*
60  * U-Boot general configurations
61  */
62 #define CONFIG_SYS_LONGHELP
63 #define CONFIG_SYS_PROMPT               "TX6Q U-Boot > "
64 #define CONFIG_SYS_CBSIZE               2048            /* Console I/O buffer size */
65 #define CONFIG_SYS_PBSIZE               (CONFIG_SYS_CBSIZE + \
66                                 sizeof(CONFIG_SYS_PROMPT) + 16) /* Print buffer size */
67 #define CONFIG_SYS_MAXARGS              64              /* Max number of command args */
68 #define CONFIG_SYS_BARGSIZE             CONFIG_SYS_CBSIZE
69                                         /* Boot argument buffer size */
70 #define CONFIG_VERSION_VARIABLE         /* U-BOOT version */
71 #define CONFIG_AUTO_COMPLETE            /* Command auto complete */
72 #define CONFIG_CMDLINE_EDITING          /* Command history etc */
73
74 #define CONFIG_SYS_64BIT_VSPRINTF
75 #define CONFIG_SYS_NO_FLASH
76
77 /*
78  * Flattened Device Tree (FDT) support
79 */
80 #ifndef CONFIG_MFG
81 #define CONFIG_OF_LIBFDT
82 #ifdef CONFIG_OF_LIBFDT
83 #define CONFIG_FDT_FIXUP_PARTITIONS
84 #define CONFIG_OF_EMBED
85 #define CONFIG_OF_BOARD_SETUP
86 #define CONFIG_DEFAULT_DEVICE_TREE      tx6q
87 #define CONFIG_ARCH_DEVICE_TREE         mx6q
88 #define CONFIG_SYS_FDT_ADDR             (PHYS_SDRAM_1 + SZ_16M)
89 #endif /* CONFIG_OF_LIBFDT */
90 #endif /* CONFIG_MFG */
91
92 /*
93  * Boot Linux
94  */
95 #define xstr(s) str(s)
96 #define str(s)  #s
97 #define __pfx(x, s)                     (x##s)
98 #define _pfx(x, s)                      __pfx(x, s)
99
100 #define CONFIG_CMDLINE_TAG
101 #define CONFIG_INITRD_TAG
102 #define CONFIG_SETUP_MEMORY_TAGS
103 #define CONFIG_SERIAL_TAG
104 #ifndef CONFIG_MFG
105 #define CONFIG_BOOTDELAY                1
106 #else
107 #define CONFIG_BOOTDELAY                0
108 #endif
109 #define CONFIG_ZERO_BOOTDELAY_CHECK
110 #define CONFIG_SYS_AUTOLOAD             "no"
111 #ifndef CONFIG_MFG
112 #define CONFIG_BOOTFILE                 "uImage"
113 #define CONFIG_BOOTARGS                 "console=ttymxc0,115200 ro debug panic=1"
114 #define CONFIG_BOOTCOMMAND              "run bootcmd_nand"
115 #else
116 #define CONFIG_BOOTCOMMAND              "env import " xstr(CONFIG_BOOTCMD_MFG_LOADADDR) ";run bootcmd_mfg"
117 #define CONFIG_BOOTCMD_MFG_LOADADDR     10500000
118 #define CONFIG_DELAY_ENVIRONMENT
119 #endif /* CONFIG_MFG */
120 #define CONFIG_LOADADDR                 18000000
121 #define CONFIG_SYS_LOAD_ADDR            _pfx(0x, CONFIG_LOADADDR)
122 #define CONFIG_U_BOOT_IMG_SIZE          SZ_1M
123 #define CONFIG_IMX_WATCHDOG
124 #define CONFIG_WATCHDOG_TIMEOUT_MSECS   3000
125
126 /*
127  * Extra Environments
128  */
129 #ifndef CONFIG_MFG
130 #define CONFIG_EXTRA_ENV_SETTINGS                                       \
131         "autostart=no\0"                                                \
132         "baseboard=stk5-v3\0"                                           \
133         "bootargs_mmc=run default_bootargs;set bootargs ${bootargs}"    \
134         " root=/dev/mmcblk0p3 rootwait\0"                               \
135         "bootargs_nand=run default_bootargs;set bootargs ${bootargs}"   \
136         " root=/dev/mtdblock3 rootfstype=jffs2\0"                       \
137         "bootargs_nfs=run default_bootargs;set bootargs ${bootargs}"    \
138         " root=/dev/nfs ip=dhcp nfsroot=${serverip}:${nfsroot},nolock\0"\
139         "bootcmd_mmc=set autostart no;run bootargs_mmc;"                \
140         "fatload mmc 0 ${loadaddr} uImage;run bootm_cmd\0"              \
141         "bootcmd_nand=set autostart no;run bootargs_nand;"              \
142         "nboot linux;run bootm_cmd\0"                                   \
143         "bootcmd_net=set autostart no;run bootargs_nfs;dhcp;"           \
144         "run bootm_cmd\0"                                               \
145         "bootm_cmd=fdt boardsetup;bootm ${loadaddr} - ${fdtaddr}\0"     \
146         "cpu_clk=800\0"                                                 \
147         "default_bootargs=set bootargs " CONFIG_BOOTARGS                \
148         " video=${video_mode} ${append_bootargs}\0"                     \
149         "fdtaddr=11000000\0"                                            \
150         "mtdids=" MTDIDS_DEFAULT "\0"                                   \
151         "mtdparts=" MTDPARTS_DEFAULT "\0"                               \
152         "nfsroot=/tftpboot/rootfs\0"                                    \
153         "otg_mode=device\0"                                             \
154         "touchpanel=tsc2007\0"                                          \
155         "video_mode=VGA-1:640x480MR-24@60\0"
156 #endif
157
158 #define MTD_NAME                        "gpmi-nand"
159 #define MTDIDS_DEFAULT                  "nand0=" MTD_NAME
160 #define CONFIG_SYS_NAND_ONFI_DETECTION
161
162 /*
163  * U-Boot Commands
164  */
165 #include <config_cmd_default.h>
166 #define CONFIG_CMD_CACHE
167 #define CONFIG_CMD_MMC
168 #define CONFIG_CMD_NAND
169 #define CONFIG_CMD_MTDPARTS
170 #define CONFIG_CMD_BOOTCE
171 #define CONFIG_CMD_TIME
172 #define CONFIG_CMD_I2C
173
174 /*
175  * Serial Driver
176  */
177 #define CONFIG_MXC_UART
178 #define CONFIG_MXC_UART_BASE            UART1_BASE
179 #define CONFIG_BAUDRATE                 115200          /* Default baud rate */
180 #define CONFIG_SYS_BAUDRATE_TABLE       { 9600, 19200, 38400, 57600, 115200, }
181 #define CONFIG_SYS_CONSOLE_INFO_QUIET
182
183 /*
184  * GPIO driver
185  */
186 #define CONFIG_MXC_GPIO
187
188 /*
189  * Ethernet Driver
190  */
191 #define CONFIG_FEC_MXC
192 #ifdef CONFIG_FEC_MXC
193 /* This is required for the FEC driver to work with cache enabled */
194 #define CONFIG_SYS_ARM_CACHE_WRITETHROUGH
195
196 #define IMX_FEC_BASE                    ENET_BASE_ADDR
197 #define CONFIG_FEC_MXC_PHYADDR          0
198 #define CONFIG_PHYLIB
199 #define CONFIG_PHY_SMSC
200 #define CONFIG_MII
201 #define CONFIG_FEC_XCV_TYPE             RMII
202 #define CONFIG_GET_FEC_MAC_ADDR_FROM_IIM
203 #define CONFIG_CMD_MII
204 #define CONFIG_CMD_DHCP
205 #define CONFIG_CMD_PING
206 /* Add for working with "strict" DHCP server */
207 #define CONFIG_BOOTP_SUBNETMASK
208 #define CONFIG_BOOTP_GATEWAY
209 #define CONFIG_BOOTP_DNS
210 #endif
211
212 /*
213  * I2C Configs
214  */
215 #ifdef CONFIG_CMD_I2C
216 #define CONFIG_HARD_I2C                 1
217 #define CONFIG_I2C_MXC                  1
218 #define CONFIG_SYS_I2C_BASE             I2C1_BASE_ADDR
219 #define CONFIG_SYS_I2C_MX6_PORT1
220 #define CONFIG_SYS_I2C_SPEED            10000
221 #define CONFIG_SYS_I2C_SLAVE            0x3c
222 #define CONFIG_MX6_INTER_LDO_BYPASS     0
223 #endif
224
225 /* define one of the following options:
226 #define CONFIG_ENV_IS_IN_NAND
227 #define CONFIG_ENV_IS_IN_MMC
228 #define CONFIG_ENV_IS_NOWHERE
229 */
230 #define CONFIG_ENV_IS_IN_NAND
231
232 /*
233  * NAND flash driver
234  */
235 #ifdef CONFIG_CMD_NAND
236 #define CONFIG_MTD_DEVICE
237 #if 0
238 #define CONFIG_MTD_DEBUG
239 #define CONFIG_MTD_DEBUG_VERBOSE        4
240 #endif
241 #define CONFIG_NAND_MXS
242 #define CONFIG_NAND_PAGE_SIZE           2048
243 #define CONFIG_NAND_OOB_SIZE            64
244 #define CONFIG_NAND_PAGES_PER_BLOCK     64
245 #define CONFIG_APBH_DMA
246 #define CONFIG_APBH_DMA_BURST
247 #define CONFIG_APBH_DMA_BURST8
248 #define CONFIG_SYS_NAND_U_BOOT_OFFS     0x20000
249 #define CONFIG_CMD_NAND_TRIMFFS
250 #define CONFIG_SYS_MXS_DMA_CHANNEL      4
251 #define CONFIG_SYS_MAX_FLASH_SECT       1024
252 #define CONFIG_SYS_MAX_FLASH_BANKS      1
253 #define CONFIG_SYS_NAND_MAX_CHIPS       1
254 #define CONFIG_SYS_MAX_NAND_DEVICE      1
255 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
256 #define CONFIG_SYS_NAND_USE_FLASH_BBT
257 #define CONFIG_SYS_NAND_BASE            0x00000000
258 #define CONFIG_CMD_ROMUPDATE
259 #else
260 #undef CONFIG_ENV_IS_IN_NAND
261 #endif /* CONFIG_CMD_NAND */
262
263 #ifdef CONFIG_ENV_IS_IN_NAND
264 #define CONFIG_ENV_OVERWRITE
265 #define CONFIG_ENV_OFFSET               (CONFIG_U_BOOT_IMG_SIZE + CONFIG_SYS_NAND_U_BOOT_OFFS)
266 #define CONFIG_ENV_SIZE                 SZ_128K
267 #define CONFIG_ENV_RANGE                0x60000
268 #ifdef CONFIG_ENV_OFFSET_REDUND
269 #define CONFIG_SYS_ENV_PART_STR         xstr(CONFIG_ENV_RANGE)          \
270         "(env),"                                                        \
271         xstr(CONFIG_ENV_RANGE)                                          \
272         "(env2),"
273 #define CONFIG_SYS_USERFS_PART_STR      "91520k(userfs)"
274 #else
275 #define CONFIG_SYS_ENV_PART_STR         xstr(CONFIG_ENV_RANGE)          \
276         "(env),"
277 #define CONFIG_SYS_USERFS_PART_STR      "91904k(userfs)"
278 #endif /* CONFIG_ENV_OFFSET_REDUND */
279 #else
280 #define CONFIG_SYS_ENV_PART_STR         /* no env partition in NAND */
281 #define CONFIG_SYS_USERFS_PART_STR      "92288k(userfs)"
282 #endif /* CONFIG_ENV_IS_IN_NAND */
283
284 /*
285  * MMC Driver
286  */
287 #ifdef CONFIG_CMD_MMC
288 #define CONFIG_MMC
289 #define CONFIG_GENERIC_MMC
290 #define CONFIG_FSL_ESDHC
291 #define CONFIG_FSL_USDHC
292 #define CONFIG_SYS_FSL_ESDHC_ADDR       0
293 #define CONFIG_SYS_FSL_ESDHC_NUM        2
294
295 #define CONFIG_DOS_PARTITION
296 #define CONFIG_CMD_FAT
297 #define CONFIG_CMD_EXT2
298
299 /*
300  * Environments on MMC
301  */
302 #ifdef CONFIG_ENV_IS_IN_MMC
303 #define CONFIG_SYS_MMC_ENV_DEV          0
304 #define CONFIG_ENV_OVERWRITE
305 /* Associated with the MMC layout defined in mmcops.c */
306 #define CONFIG_ENV_OFFSET               SZ_1K
307 #define CONFIG_ENV_SIZE                 (SZ_128K - CONFIG_ENV_OFFSET)
308 #define CONFIG_DYNAMIC_MMC_DEVNO
309 #endif /* CONFIG_ENV_IS_IN_MMC */
310 #else
311 #undef CONFIG_ENV_IS_IN_MMC
312 #endif /* CONFIG_CMD_MMC */
313
314 #ifdef CONFIG_ENV_IS_NOWHERE
315 #define CONFIG_ENV_SIZE                 SZ_4K
316 #endif
317
318 #define MTDPARTS_DEFAULT                "mtdparts=" MTD_NAME ":"        \
319         "1m@" xstr(CONFIG_SYS_NAND_U_BOOT_OFFS) "(u-boot),"             \
320         CONFIG_SYS_ENV_PART_STR                                         \
321         "4m(linux),32m(rootfs),256k(dtb),"                              \
322         CONFIG_SYS_USERFS_PART_STR ",512k@0x7f80000(bbt)ro"
323
324 #define CONFIG_SYS_SDRAM_BASE           PHYS_SDRAM_1
325 #define CONFIG_SYS_INIT_SP_ADDR         (CONFIG_SYS_SDRAM_BASE + 0x1000 - /* Fix this */ \
326                                         GENERATED_GBL_DATA_SIZE)
327
328 #ifdef CONFIG_CMD_IIM
329 #define CONFIG_IMX_IIM
330 #endif
331
332 #endif /* __CONFIG_H */