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