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