2 * Copyright (C) 2012 <LW@KARO-electronics.de>
4 * SPDX-License-Identifier: GPL-2.0
11 #include <asm/sizes.h>
12 #include <asm/arch/imx-regs.h>
15 * Ka-Ro TX6 board - SoC configuration
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
28 /* LCD Logo and Splash screen support */
31 #define CONFIG_SPLASH_SCREEN
32 #define CONFIG_SPLASH_SCREEN_ALIGN
33 #define CONFIG_VIDEO_IPUV3
34 #define CONFIG_IPUV3_CLK (CONFIG_SYS_SDRAM_CLK * 1000000 / 2)
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 */
43 * Memory configuration options
45 #define CONFIG_NR_DRAM_BANKS 0x1 /* # 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
50 #define PHYS_SDRAM_1_WIDTH 64
52 #define PHYS_SDRAM_1_SIZE (SZ_512M / 32 * PHYS_SDRAM_1_WIDTH)
54 #define CONFIG_SYS_SDRAM_CLK 528
56 #define CONFIG_SYS_SDRAM_CLK 400
58 #define CONFIG_STACKSIZE SZ_128K
59 #define CONFIG_SYS_MALLOC_LEN SZ_8M
60 #define CONFIG_SYS_MEMTEST_START PHYS_SDRAM_1 /* Memtest start address */
61 #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + SZ_4M)
64 * U-Boot general configurations
66 #define CONFIG_SYS_LONGHELP
67 #if defined(CONFIG_MX6Q)
68 #define CONFIG_SYS_PROMPT "TX6Q U-Boot > "
69 #elif defined(CONFIG_MX6DL)
70 #define CONFIG_SYS_PROMPT "TX6DL U-Boot > "
71 #elif defined(CONFIG_MX6S)
72 #define CONFIG_SYS_PROMPT "TX6S U-Boot > "
74 #error Unsupported i.MX6 processor variant
76 #define CONFIG_SYS_CBSIZE 2048 /* Console I/O buffer size */
77 #define CONFIG_SYS_PBSIZE \
78 (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
79 /* Print buffer size */
80 #define CONFIG_SYS_MAXARGS 256 /* Max number of command args */
81 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
82 /* Boot argument buffer size */
83 #define CONFIG_VERSION_VARIABLE /* U-BOOT version */
84 #define CONFIG_AUTO_COMPLETE /* Command auto complete */
85 #define CONFIG_CMDLINE_EDITING /* Command history etc */
87 #define CONFIG_SYS_64BIT_VSPRINTF
88 #define CONFIG_SYS_NO_FLASH
91 * Flattened Device Tree (FDT) support
93 #define CONFIG_OF_LIBFDT
94 #ifdef CONFIG_OF_LIBFDT
95 #ifndef CONFIG_NO_NAND
96 #define CONFIG_FDT_FIXUP_PARTITIONS
98 #define CONFIG_OF_BOARD_SETUP
99 #endif /* CONFIG_OF_LIBFDT */
104 #define xstr(s) str(s)
106 #define __pfx(x, s) (x##s)
107 #define _pfx(x, s) __pfx(x, s)
109 #define CONFIG_CMDLINE_TAG
110 #define CONFIG_INITRD_TAG
111 #define CONFIG_SETUP_MEMORY_TAGS
113 #define CONFIG_BOOTDELAY 1
115 #define CONFIG_BOOTDELAY 0
117 #define CONFIG_ZERO_BOOTDELAY_CHECK
118 #define CONFIG_SYS_AUTOLOAD "no"
119 #define CONFIG_BOOTFILE "uImage"
120 #define CONFIG_BOOTARGS "init=/linuxrc console=ttymxc0,115200 ro debug panic=1"
121 #define DEFAULT_BOOTCMD "run bootcmd_${boot_mode} bootm_cmd"
123 #define CONFIG_BOOTCOMMAND DEFAULT_BOOTCMD
125 #define CONFIG_BOOTCOMMAND "set bootcmd '" DEFAULT_BOOTCMD "';" \
126 "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_FDTADDR 11000000
132 #define CONFIG_SYS_LOAD_ADDR _pfx(0x, CONFIG_LOADADDR)
133 #define CONFIG_SYS_FDT_ADDR _pfx(0x, CONFIG_FDTADDR)
134 #define CONFIG_HW_WATCHDOG
135 #ifndef CONFIG_SYS_LVDS_IF
136 #define DEFAULT_VIDEO_MODE "VGA"
138 #define DEFAULT_VIDEO_MODE "HSD100PXN1"
144 #ifdef CONFIG_ENV_IS_NOWHERE
145 #define CONFIG_EXTRA_ENV_SETTINGS \
149 "fdtaddr=" xstr(CONFIG_FDTADDR) "\0" \
150 "mtdids=" MTDIDS_DEFAULT "\0" \
151 "mtdparts=" MTDPARTS_DEFAULT "\0"
153 #define CONFIG_EXTRA_ENV_SETTINGS \
155 "baseboard=stk5-v3\0" \
156 "bootargs_jffs2=run default_bootargs;set bootargs ${bootargs}" \
157 " root=/dev/mtdblock3 rootfstype=jffs2\0" \
158 "bootargs_mmc=run default_bootargs;set bootargs ${bootargs}" \
160 "bootargs_nfs=run default_bootargs;set bootargs ${bootargs}" \
161 " root=/dev/nfs nfsroot=${nfs_server}:${nfsroot},nolock" \
163 "bootargs_ubifs=run default_bootargs;set bootargs ${bootargs}" \
164 " ubi.mtd=rootfs root=ubi0:rootfs rootfstype=ubifs\0" \
165 "bootcmd_jffs2=set autostart no;run bootargs_jffs2" \
167 "bootcmd_mmc=set autostart no;run bootargs_mmc" \
168 ";fatload mmc 0 ${loadaddr} uImage\0" \
169 CONFIG_SYS_BOOT_CMD_NAND \
170 "bootcmd_net=set autoload y;set autostart n;run bootargs_nfs" \
172 "bootm_cmd=bootm ${loadaddr} - ${fdtaddr}\0" \
173 "boot_mode=" CONFIG_SYS_DEFAULT_BOOT_MODE "\0" \
175 "default_bootargs=set bootargs " CONFIG_BOOTARGS \
176 " ${append_bootargs}\0" \
177 "fdtaddr=" xstr(CONFIG_FDTADDR) "\0" \
178 CONFIG_SYS_FDTSAVE_CMD \
179 "mtdids=" MTDIDS_DEFAULT "\0" \
180 "mtdparts=" MTDPARTS_DEFAULT "\0" \
181 "nfsroot=/tftpboot/rootfs\0" \
182 "otg_mode=device\0" \
184 "touchpanel=tsc2007\0" \
185 "video_mode=" DEFAULT_VIDEO_MODE "\0"
186 #endif /* CONFIG_ENV_IS_NOWHERE */
188 #ifndef CONFIG_NO_NAND
189 #define CONFIG_SYS_DEFAULT_BOOT_MODE "nand"
190 #define CONFIG_SYS_BOOT_CMD_NAND \
191 "bootcmd_nand=set autostart no;run bootargs_ubifs;nboot linux\0"
192 #define CONFIG_SYS_FDTSAVE_CMD \
193 "fdtsave=fdt resize;nand erase.part dtb" \
194 ";nand write ${fdtaddr} dtb ${fdtsize}\0"
195 #define MTD_NAME "gpmi-nand"
196 #define MTDIDS_DEFAULT "nand0=" MTD_NAME
197 #define CONFIG_SYS_NAND_ONFI_DETECTION
198 #define MMC_ROOT_STR " root=/dev/mmcblk0p2 rootwait\0"
199 #define ROOTPART_UUID_STR ""
201 #define CONFIG_SYS_DEFAULT_BOOT_MODE "mmc"
202 #define CONFIG_SYS_BOOT_CMD_NAND ""
203 #define CONFIG_SYS_FDTSAVE_CMD \
204 "fdtsave=mmc open 0 1;mmc write ${fdtaddr} " \
205 xstr(CONFIG_SYS_DTB_BLKNO) " 80;mmc close 0 1\0"
206 #define MMC_ROOT_STR " root=PARTUUID=${rootpart_uuid} rootwait\0"
207 #define ROOTPART_UUID_STR "rootpart_uuid=0cc66cc0-02\0"
209 #define MTDIDS_DEFAULT ""
210 #define CONFIG_SUPPORT_EMMC_BOOT
211 #define CONFIG_MMC_BOOT_DEV 0
217 #include <config_cmd_default.h>
218 #define CONFIG_CMD_CACHE
219 #define CONFIG_CMD_MMC
220 #ifndef CONFIG_NO_NAND
221 #define CONFIG_CMD_NAND
222 #define CONFIG_CMD_MTDPARTS
224 #define CONFIG_CMD_BOOTCE
225 #define CONFIG_CMD_BOOTZ
226 #define CONFIG_CMD_TIME
227 #define CONFIG_CMD_I2C
228 #define CONFIG_CMD_MEMTEST
233 #define CONFIG_MXC_UART
234 #define CONFIG_MXC_UART_BASE UART1_BASE
235 #define CONFIG_BAUDRATE 115200 /* Default baud rate */
236 #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, }
237 #define CONFIG_SYS_CONSOLE_INFO_QUIET
242 #define CONFIG_MXC_GPIO
247 #define CONFIG_FEC_MXC
248 #ifdef CONFIG_FEC_MXC
249 /* This is required for the FEC driver to work with cache enabled */
250 #define CONFIG_SYS_ARM_CACHE_WRITETHROUGH
251 #define CONFIG_SYS_CACHELINE_SIZE 64
253 #define IMX_FEC_BASE ENET_BASE_ADDR
254 #define CONFIG_FEC_MXC_PHYADDR 0
255 #define CONFIG_PHYLIB
256 #define CONFIG_PHY_SMSC
258 #define CONFIG_FEC_XCV_TYPE RMII
259 #define CONFIG_GET_FEC_MAC_ADDR_FROM_IIM
260 #define CONFIG_CMD_MII
261 #define CONFIG_CMD_DHCP
262 #define CONFIG_CMD_PING
263 /* Add for working with "strict" DHCP server */
264 #define CONFIG_BOOTP_SUBNETMASK
265 #define CONFIG_BOOTP_GATEWAY
266 #define CONFIG_BOOTP_DNS
272 #ifdef CONFIG_CMD_I2C
273 #define CONFIG_HARD_I2C
274 #define CONFIG_I2C_MXC
275 #define CONFIG_SYS_I2C_BASE I2C1_BASE_ADDR
276 #define CONFIG_SYS_I2C_MX6_PORT1
277 #define CONFIG_SYS_I2C_SPEED 400000
278 #if defined(CONFIG_TX6_REV)
279 #if CONFIG_TX6_REV == 0x1
280 #define CONFIG_SYS_I2C_SLAVE 0x3c
281 #define CONFIG_LTC3676
282 #elif CONFIG_TX6_REV == 0x2
283 #define CONFIG_SYS_I2C_SLAVE 0x32
284 #define CONFIG_RN5T618
285 #elif CONFIG_TX6_REV == 0x3
286 #define CONFIG_SYS_I2C_SLAVE 0x33
287 #define CONFIG_RN5T567
289 #error Unsupported TX6 module revision
291 #endif /* CONFIG_TX6_REV */
292 /* autodetect which PMIC is present to derive TX6_REV */
293 #define CONFIG_LTC3676 /* TX6_REV == 1 */
294 #define CONFIG_RN5T567 /* TX6_REV == 3 */
295 #endif /* CONFIG_CMD_I2C */
297 #ifndef CONFIG_ENV_IS_NOWHERE
298 /* define one of the following options:
299 #define CONFIG_ENV_IS_IN_NAND
300 #define CONFIG_ENV_IS_IN_MMC
302 #define CONFIG_ENV_IS_IN_NAND
304 #define CONFIG_ENV_OVERWRITE
309 #ifndef CONFIG_NO_NAND
310 #define CONFIG_MTD_DEVICE
312 #define CONFIG_MTD_DEBUG
313 #define CONFIG_MTD_DEBUG_VERBOSE 4
315 #define CONFIG_NAND_MXS
316 #define CONFIG_NAND_MXS_NO_BBM_SWAP
317 #define CONFIG_APBH_DMA
318 #define CONFIG_APBH_DMA_BURST
319 #define CONFIG_APBH_DMA_BURST8
320 #define CONFIG_CMD_NAND_TRIMFFS
321 #define CONFIG_SYS_MXS_DMA_CHANNEL 4
322 #define CONFIG_SYS_MAX_FLASH_BANKS 0x1
323 #define CONFIG_SYS_NAND_MAX_CHIPS 0x1
324 #define CONFIG_SYS_MAX_NAND_DEVICE 0x1
325 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
326 #define CONFIG_SYS_NAND_USE_FLASH_BBT
327 #define CONFIG_SYS_NAND_BASE 0x00000000
328 #define CONFIG_CMD_ROMUPDATE
330 #define CONFIG_ENV_OFFSET (CONFIG_U_BOOT_IMG_SIZE + CONFIG_SYS_NAND_U_BOOT_OFFS)
331 #define CONFIG_ENV_SIZE SZ_128K
332 #define CONFIG_ENV_RANGE (3 * CONFIG_SYS_NAND_BLOCK_SIZE)
334 #undef CONFIG_ENV_IS_IN_NAND
335 #endif /* CONFIG_NO_NAND */
337 #ifdef CONFIG_ENV_OFFSET_REDUND
338 #define CONFIG_SYS_ENV_PART_STR xstr(CONFIG_SYS_ENV_PART_SIZE) \
340 xstr(CONFIG_SYS_ENV_PART_SIZE) \
342 #define CONFIG_SYS_USERFS_PART_STR xstr(CONFIG_SYS_USERFS_PART_SIZE) "(userfs)"
344 #define CONFIG_SYS_ENV_PART_STR xstr(CONFIG_SYS_ENV_PART_SIZE) \
346 #define CONFIG_SYS_USERFS_PART_STR xstr(CONFIG_SYS_USERFS_PART_SIZE2) "(userfs)"
347 #endif /* CONFIG_ENV_OFFSET_REDUND */
352 #ifdef CONFIG_CMD_MMC
354 #define CONFIG_GENERIC_MMC
355 #define CONFIG_FSL_ESDHC
356 #define CONFIG_FSL_USDHC
357 #define CONFIG_SYS_FSL_ESDHC_ADDR 0
359 #define CONFIG_DOS_PARTITION
360 #define CONFIG_CMD_FAT
361 #define CONFIG_FAT_WRITE
362 #define CONFIG_CMD_EXT2
365 * Environments on MMC
367 #ifdef CONFIG_ENV_IS_IN_MMC
368 #define CONFIG_SYS_MMC_ENV_DEV 0
369 #define CONFIG_SYS_MMC_ENV_PART 0x1
370 #define CONFIG_DYNAMIC_MMC_DEVNO
371 #endif /* CONFIG_ENV_IS_IN_MMC */
373 #undef CONFIG_ENV_IS_IN_MMC
374 #endif /* CONFIG_CMD_MMC */
376 #ifdef CONFIG_ENV_IS_NOWHERE
377 #undef CONFIG_ENV_SIZE
378 #define CONFIG_ENV_SIZE SZ_4K
381 #ifndef CONFIG_NO_NAND
382 #define MTDPARTS_DEFAULT "mtdparts=" MTD_NAME ":" \
383 xstr(CONFIG_SYS_U_BOOT_PART_SIZE) \
384 "@" xstr(CONFIG_SYS_NAND_U_BOOT_OFFS) \
386 CONFIG_SYS_ENV_PART_STR \
387 "6m(linux),32m(rootfs)," CONFIG_SYS_USERFS_PART_STR "," \
388 xstr(CONFIG_SYS_DTB_PART_SIZE) \
389 "@" xstr(CONFIG_SYS_NAND_DTB_OFFSET) "(dtb)," \
390 xstr(CONFIG_SYS_NAND_BBT_SIZE) \
391 "@" xstr(CONFIG_SYS_NAND_BBT_OFFSET) "(bbt)ro"
393 #define MTDPARTS_DEFAULT ""
396 #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
397 #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE + 0x1000 - /* Fix this */ \
398 GENERATED_GBL_DATA_SIZE)
400 #endif /* __CONFIG_H */