]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - include/configs/tx53.h
Merge branch 'tx53-bugfix' into uboot-merge
[karo-tx-uboot.git] / include / configs / tx53.h
1 /*
2  * Copyright (C) 2012-2014 <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 #define CONFIG_MX53                     /* must be set before including imx-regs.h */
12
13 #include <asm/sizes.h>
14 #include <asm/arch/imx-regs.h>
15
16 /*
17  * Ka-Ro TX53 board - SoC configuration
18  */
19 #define CONFIG_TX53                     /* TX53 SoM */
20 #define CONFIG_SYS_MX5_IOMUX_V3
21 #define CONFIG_MXC_GPIO                 /* GPIO control */
22 #define CONFIG_SYS_MX5_HCLK             24000000
23 #define CONFIG_SYS_DDR_CLKSEL           0
24 #define CONFIG_SYS_HZ                   1000    /* Ticks per second */
25 #define CONFIG_SHOW_ACTIVITY
26 #define CONFIG_DISPLAY_BOARDINFO
27 #define CONFIG_BOARD_LATE_INIT
28 #define CONFIG_BOARD_EARLY_INIT_F
29
30 /* LCD Logo and Splash screen support */
31 #define CONFIG_LCD
32 #ifdef CONFIG_LCD
33 #define CONFIG_SPLASH_SCREEN
34 #define CONFIG_SPLASH_SCREEN_ALIGN
35 #define CONFIG_VIDEO_IPUV3
36 #define CONFIG_IPUV3_CLK                200000000
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
43 /*
44  * Memory configuration options
45  */
46 #define PHYS_SDRAM_1                    0x70000000      /* Base address of bank 1 */
47 #define PHYS_SDRAM_1_SIZE               SZ_512M
48 #if CONFIG_NR_DRAM_BANKS > 1
49 #define PHYS_SDRAM_2                    0xb0000000      /* Base address of bank 2 */
50 #define PHYS_SDRAM_2_SIZE               SZ_512M
51 #define TX53_MOD_SUFFIX                 "1"
52 #else
53 #define TX53_MOD_SUFFIX                 "0"
54 #endif
55 #define CONFIG_STACKSIZE                SZ_128K
56 #define CONFIG_SYS_MALLOC_LEN           SZ_8M
57 #define CONFIG_SYS_MEMTEST_START        PHYS_SDRAM_1    /* Memtest start address */
58 #define CONFIG_SYS_MEMTEST_END          (CONFIG_SYS_MEMTEST_START + SZ_4M)
59 #define CONFIG_SYS_SDRAM_CLK            400
60
61 /*
62  * U-Boot general configurations
63  */
64 #define CONFIG_SYS_LONGHELP
65 #define CONFIG_SYS_PROMPT               "TX53 U-Boot > "
66 #define CONFIG_SYS_CBSIZE               2048    /* Console I/O buffer size */
67 #define CONFIG_SYS_PBSIZE \
68         (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
69                                                 /* Print buffer size */
70 #define CONFIG_SYS_MAXARGS              256     /* Max number of command args */
71 #define CONFIG_SYS_BARGSIZE             CONFIG_SYS_CBSIZE
72                                                 /* Boot argument buffer size */
73 #define CONFIG_VERSION_VARIABLE                 /* U-BOOT version */
74 #define CONFIG_AUTO_COMPLETE                    /* Command auto complete */
75 #define CONFIG_CMDLINE_EDITING                  /* Command history etc */
76
77 #define CONFIG_SYS_64BIT_VSPRINTF
78 #define CONFIG_SYS_NO_FLASH
79
80 /*
81  * Flattened Device Tree (FDT) support
82 */
83 #define CONFIG_OF_LIBFDT
84 #define CONFIG_OF_BOARD_SETUP
85
86 /*
87  * Boot Linux
88  */
89 #define xstr(s)                         str(s)
90 #define str(s)                          #s
91 #define __pfx(x, s)                     (x##s)
92 #define _pfx(x, s)                      __pfx(x, s)
93
94 #define CONFIG_CMDLINE_TAG
95 #define CONFIG_SETUP_MEMORY_TAGS
96 #define CONFIG_BOOTDELAY                3
97 #define CONFIG_ZERO_BOOTDELAY_CHECK
98 #define CONFIG_SYS_AUTOLOAD             "no"
99 #define CONFIG_BOOTFILE                 "uImage"
100 #define CONFIG_BOOTARGS                 "init=/linuxrc console=ttymxc0,115200 ro debug panic=1"
101 #define CONFIG_BOOTCOMMAND              "run bootcmd_${boot_mode} bootm_cmd"
102 #define CONFIG_LOADADDR                 78000000
103 #define CONFIG_FDTADDR                  70001000
104 #define CONFIG_SYS_LOAD_ADDR            _pfx(0x, CONFIG_LOADADDR)
105 #define CONFIG_SYS_FDT_ADDR             _pfx(0x, CONFIG_FDTADDR)
106 #define CONFIG_U_BOOT_IMG_SIZE          SZ_1M
107 #define CONFIG_HW_WATCHDOG
108
109 /*
110  * Extra Environment Settings
111  */
112 #define CONFIG_EXTRA_ENV_SETTINGS                                       \
113         "autostart=no\0"                                                \
114         "baseboard=stk5-v3\0"                                           \
115         "bootargs_jffs2=run default_bootargs;set bootargs ${bootargs}"  \
116         " root=/dev/mtdblock3 rootfstype=jffs2\0"                       \
117         "bootargs_mmc=run default_bootargs;set bootargs ${bootargs}"    \
118         " root=/dev/mmcblk0p2 rootwait\0"                               \
119         "bootargs_nfs=run default_bootargs;set bootargs ${bootargs}"    \
120         " root=/dev/nfs nfsroot=${nfs_server}:${nfsroot},nolock"        \
121         " ip=dhcp\0"                                                    \
122         "bootargs_ubifs=run default_bootargs;set bootargs ${bootargs}"  \
123         " ubi.mtd=rootfs root=ubi0:rootfs rootfstype=ubifs\0"           \
124         "bootcmd_jffs2=set autostart no;run bootargs_jffs2"             \
125         ";nboot linux\0"                                                \
126         "bootcmd_mmc=set autostart no;run bootargs_mmc"                 \
127         ";fatload mmc 0 ${loadaddr} uImage\0"                           \
128         "bootcmd_nand=set autostart no;run bootargs_ubifs"              \
129         ";nboot linux\0"                                                \
130         "bootcmd_net=set autoload y;set autostart n;run bootargs_nfs"   \
131         ";dhcp\0"                                                       \
132         "bootm_cmd=bootm ${loadaddr} - ${fdtaddr}\0"                    \
133         "boot_mode=nand\0"                                              \
134         "cpu_clk=800\0"                                                 \
135         "default_bootargs=set bootargs " CONFIG_BOOTARGS                \
136         " ${append_bootargs}\0"                                         \
137         "fdtaddr=" xstr(CONFIG_FDTADDR) "\0"                            \
138         "fdtsave=fdt resize;nand erase.part dtb"                        \
139         ";nand write ${fdtaddr} dtb ${fdtsize}\0"                       \
140         "mtdids=" MTDIDS_DEFAULT "\0"                                   \
141         "mtdparts=" MTDPARTS_DEFAULT "\0"                               \
142         "nfsroot=/tftpboot/rootfs\0"                                    \
143         "otg_mode=device\0"                                             \
144         "touchpanel=tsc2007\0"                                          \
145         "video_mode=VGA\0"
146
147 #define MTD_NAME                        "mxc_nand"
148 #define MTDIDS_DEFAULT                  "nand0=" MTD_NAME
149 #define CONFIG_FDT_FIXUP_PARTITIONS
150
151 /*
152  * U-Boot Commands
153  */
154 #include <config_cmd_default.h>
155 #define CONFIG_CMD_CACHE
156 #define CONFIG_CMD_MMC
157 #define CONFIG_CMD_NAND
158 #define CONFIG_CMD_MTDPARTS
159 #define CONFIG_CMD_BOOTCE
160 #define CONFIG_CMD_TIME
161 #define CONFIG_CMD_I2C
162 #define CONFIG_CMD_MEMTEST
163
164 /*
165  * Serial Driver
166  */
167 #define CONFIG_MXC_UART
168 #define CONFIG_MXC_UART_BASE            UART1_BASE
169 #define CONFIG_BAUDRATE                 115200          /* Default baud rate */
170 #define CONFIG_SYS_BAUDRATE_TABLE       { 9600, 19200, 38400, 57600, 115200, }
171 #define CONFIG_SYS_CONSOLE_INFO_QUIET
172
173 /*
174  * GPIO driver
175  */
176 #define CONFIG_MXC_GPIO
177
178 /*
179  * Ethernet Driver
180  */
181 #define CONFIG_FEC_MXC
182 #ifdef CONFIG_FEC_MXC
183 #define IMX_FEC_BASE                    FEC_BASE_ADDR
184 #define CONFIG_FEC_MXC_PHYADDR          0
185 #define CONFIG_PHYLIB
186 #define CONFIG_PHY_SMSC
187 #define CONFIG_MII
188 #define CONFIG_FEC_XCV_TYPE             MII100
189 #define CONFIG_GET_FEC_MAC_ADDR_FROM_IIM
190 #define CONFIG_CMD_MII
191 #define CONFIG_CMD_DHCP
192 #define CONFIG_CMD_PING
193 /* Add for working with "strict" DHCP server */
194 #define CONFIG_BOOTP_SUBNETMASK
195 #define CONFIG_BOOTP_GATEWAY
196 #define CONFIG_BOOTP_DNS
197 #endif
198
199 /*
200  * I2C Configs
201  */
202 #ifdef CONFIG_CMD_I2C
203 #define CONFIG_HARD_I2C
204 #define CONFIG_I2C_MXC
205 #define CONFIG_SYS_I2C_BASE             I2C1_BASE_ADDR
206 #define CONFIG_SYS_I2C_MX6_PORT1
207 #define CONFIG_SYS_I2C_SPEED            400000
208 #define CONFIG_SYS_I2C_SLAVE            0x34
209 #endif
210
211 /*
212  * NAND flash driver
213  */
214 #ifdef CONFIG_CMD_NAND
215 #define CONFIG_MTD_DEVICE
216 #define CONFIG_ENV_IS_IN_NAND
217 #define CONFIG_NAND_MXC
218 #define CONFIG_MXC_NAND_REGS_BASE       NFC_BASE_ADDR_AXI
219 #define CONFIG_MXC_NAND_IP_REGS_BASE    NFC_BASE_ADDR
220 #define CONFIG_MXC_NAND_HWECC
221 #define CONFIG_CMD_NAND_TRIMFFS
222 #define CONFIG_SYS_NAND_MAX_CHIPS       1
223 #define CONFIG_SYS_MAX_NAND_DEVICE      1
224 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
225 #define CONFIG_SYS_NAND_USE_FLASH_BBT
226 #ifdef CONFIG_ENV_IS_IN_NAND
227 #define CONFIG_ENV_OVERWRITE
228 #define CONFIG_ENV_OFFSET               CONFIG_U_BOOT_IMG_SIZE
229 #define CONFIG_ENV_SIZE                 0x20000 /* 128 KiB */
230 #define CONFIG_ENV_RANGE                0x60000
231 #endif
232 #define CONFIG_SYS_NAND_BASE            0x00000000
233 #define CONFIG_CMD_ROMUPDATE
234 #endif /* CONFIG_CMD_NAND */
235
236 /*
237  * MMC Driver
238  */
239 #ifdef CONFIG_CMD_MMC
240 #ifndef CONFIG_ENV_IS_IN_NAND
241 #define CONFIG_ENV_IS_IN_MMC
242 #endif
243 #define CONFIG_MMC
244 #define CONFIG_GENERIC_MMC
245 #define CONFIG_FSL_ESDHC
246 #define CONFIG_SYS_FSL_ESDHC_ADDR       0
247
248 #define CONFIG_DOS_PARTITION
249 #define CONFIG_CMD_FAT
250 #define CONFIG_FAT_WRITE
251 #define CONFIG_CMD_EXT2
252
253 /*
254  * Environments on MMC
255  */
256 #ifdef CONFIG_ENV_IS_IN_MMC
257 #define CONFIG_SYS_MMC_ENV_DEV          0
258 #define CONFIG_ENV_OVERWRITE
259 /* Associated with the MMC layout defined in mmcops.c */
260 #define CONFIG_ENV_OFFSET               SZ_1K
261 #define CONFIG_ENV_SIZE                 (SZ_128K - CONFIG_ENV_OFFSET)
262 #define CONFIG_DYNAMIC_MMC_DEVNO
263 #endif /* CONFIG_ENV_IS_IN_MMC */
264 #endif /* CONFIG_CMD_MMC */
265
266 #ifdef CONFIG_ENV_OFFSET_REDUND
267 #define MTDPARTS_DEFAULT                "mtdparts=" MTD_NAME ":"        \
268         "1m(u-boot),"                                                   \
269         xstr(CONFIG_ENV_RANGE)                                          \
270         "(env),"                                                        \
271         xstr(CONFIG_ENV_RANGE)                                          \
272         "(env2),6m(linux),32m(rootfs),89344k(userfs),512k@0x7f00000(dtb),512k@0x7f80000(bbt)ro"
273 #else
274 #define MTDPARTS_DEFAULT                "mtdparts=" MTD_NAME ":"        \
275         "1m(u-boot),"                                                   \
276         xstr(CONFIG_ENV_RANGE)                                          \
277         "(env),6m(linux),32m(rootfs),89728k(userfs),512k@0x7f00000(dtb),512k@0x7f80000(bbt)ro"
278 #endif
279
280 #define CONFIG_SYS_SDRAM_BASE           PHYS_SDRAM_1
281 #define CONFIG_SYS_INIT_SP_ADDR         (CONFIG_SYS_SDRAM_BASE + 0x1000 - /* Fix this */ \
282                                         GENERATED_GBL_DATA_SIZE)
283
284 #ifdef CONFIG_CMD_IIM
285 #define CONFIG_FSL_IIM
286 #endif
287
288 #endif /* __CONFIG_H */