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