]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - include/configs/tx28.h
mxs: tx28: add support for TX28-40x2 (with 256 MiB SDRAM)
[karo-tx-uboot.git] / include / configs / tx28.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 __CONFIGS_TX28_H
14 #define __CONFIGS_TX28_H
15
16 #include <asm/sizes.h>
17 #include <asm/arch/regs-base.h>
18
19 /*
20  * Ka-Ro TX28 board - SoC configuration
21  */
22 #define CONFIG_MX28                                     /* i.MX28 SoC */
23 #define CONFIG_MXS_GPIO                                 /* GPIO control */
24 #define CONFIG_SYS_HZ                   1000            /* Ticks per second */
25 #define PHYS_SDRAM_1_SIZE               CONFIG_SDRAM_SIZE
26 #ifdef CONFIG_TX28_S
27 #define TX28_MOD_SUFFIX                 "1"
28 #else
29 #define CONFIG_SYS_SPL_FIXED_BATT_SUPPLY
30 #define TX28_MOD_SUFFIX                 "0"
31 #endif
32
33 #ifndef CONFIG_SPL_BUILD
34 #define CONFIG_SKIP_LOWLEVEL_INIT
35 #define CONFIG_SHOW_ACTIVITY
36 #define CONFIG_ARCH_CPU_INIT
37 #define CONFIG_DISPLAY_CPUINFO
38 #define CONFIG_BOARD_LATE_INIT
39 #define CONFIG_BOARD_EARLY_INIT_F
40
41 /* LCD Logo and Splash screen support */
42 #define CONFIG_LCD
43 #ifdef CONFIG_LCD
44 #define CONFIG_SPLASH_SCREEN
45 #define CONFIG_SPLASH_SCREEN_ALIGN
46 #define CONFIG_VIDEO_MXS
47 #define CONFIG_LCD_LOGO
48 #define LCD_BPP                         LCD_COLOR24
49 #define CONFIG_CMD_BMP
50 #define CONFIG_VIDEO_BMP_RLE8
51 #endif /* CONFIG_LCD */
52 #endif /* CONFIG_SPL_BUILD */
53
54 /*
55  * Memory configuration options
56  */
57 #define CONFIG_NR_DRAM_BANKS            1               /* 1 bank of SDRAM */
58 #define PHYS_SDRAM_1                    0x40000000      /* SDRAM Bank #1 */
59 #define CONFIG_STACKSIZE                SZ_64K
60 #define CONFIG_SYS_MALLOC_LEN           SZ_4M
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 #define CONFIG_SYS_PROMPT               "TX28 U-Boot > "
69 #define CONFIG_SYS_CBSIZE               2048            /* Console I/O buffer size */
70 #define CONFIG_SYS_PBSIZE \
71         (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
72                                                         /* Print buffer size */
73 #define CONFIG_SYS_MAXARGS              64              /* Max number of command args */
74 #define CONFIG_SYS_BARGSIZE             CONFIG_SYS_CBSIZE
75                                         /* Boot argument buffer size */
76 #define CONFIG_VERSION_VARIABLE         /* U-BOOT version */
77 #define CONFIG_AUTO_COMPLETE            /* Command auto complete */
78 #define CONFIG_CMDLINE_EDITING          /* Command history etc */
79
80 #define CONFIG_SYS_64BIT_VSPRINTF
81 #define CONFIG_SYS_NO_FLASH
82
83 /*
84  * Flattened Device Tree (FDT) support
85 */
86 #define CONFIG_OF_LIBFDT
87 #ifdef CONFIG_OF_LIBFDT
88 #define CONFIG_FDT_FIXUP_PARTITIONS
89 #define CONFIG_OF_EMBED
90 #define CONFIG_OF_BOARD_SETUP
91 #define CONFIG_DEFAULT_DEVICE_TREE      tx28
92 #define CONFIG_ARCH_DEVICE_TREE         mx28
93 #define CONFIG_SYS_FDT_ADDR             (PHYS_SDRAM_1 + SZ_16M)
94 #endif
95
96 /*
97  * Boot Linux
98  */
99 #define xstr(s) str(s)
100 #define str(s)  #s
101 #define __pfx(x, s)                     (x##s)
102 #define _pfx(x, s)                      __pfx(x, s)
103
104 #define CONFIG_CMDLINE_TAG
105 #define CONFIG_SETUP_MEMORY_TAGS
106 #define CONFIG_BOOTDELAY                3
107 #define CONFIG_ZERO_BOOTDELAY_CHECK
108 #define CONFIG_SYS_AUTOLOAD             "no"
109 #define CONFIG_BOOTFILE                 "uImage"
110 #define CONFIG_BOOTARGS                 "console=ttyAMA0,115200 ro debug panic=1"
111 #define CONFIG_BOOTCOMMAND              "run bootcmd_nand"
112 #define CONFIG_LOADADDR                 43000000
113 #define CONFIG_SYS_LOAD_ADDR            _pfx(0x, CONFIG_LOADADDR)
114 #define CONFIG_U_BOOT_IMG_SIZE          SZ_1M
115
116 /*
117  * Extra Environments
118  */
119 #ifdef CONFIG_ENV_IS_NOWHERE
120 #define CONFIG_EXTRA_ENV_SETTINGS                                       \
121         "autostart=no\0"                                                \
122         "autoload=no\0"                                                 \
123         "bootdelay=-1\0"                                                \
124         "fdtaddr=11000000\0"                                            \
125         "mtdids=" MTDIDS_DEFAULT "\0"                                   \
126         "mtdparts=" MTDPARTS_DEFAULT "\0"
127 #else
128 #define CONFIG_EXTRA_ENV_SETTINGS                                       \
129         "autostart=no\0"                                                \
130         "baseboard=stk5-v3\0"                                           \
131         "bootargs_mmc=run default_bootargs;set bootargs ${bootargs}"    \
132         " root=/dev/mmcblk0p3 rootwait\0"                               \
133         "bootargs_nand=run default_bootargs;set bootargs ${bootargs}"   \
134         " root=/dev/mtdblock3 rootfstype=jffs2\0"                       \
135         "bootargs_nfs=run default_bootargs;set bootargs ${bootargs}"    \
136         " root=/dev/nfs ip=dhcp nfsroot=${serverip}:${nfsroot},nolock\0"\
137         "bootcmd_mmc=set autostart no;run bootargs_mmc;"                \
138         "fatload mmc 0 ${loadaddr} uImage;run bootm_cmd\0"              \
139         "bootcmd_nand=set autostart no;run bootargs_nand;"              \
140         "nboot linux;run bootm_cmd\0"                                   \
141         "bootcmd_net=set autostart no;run bootargs_nfs;dhcp;"           \
142         "run bootm_cmd\0"                                               \
143         "bootm_cmd=fdt boardsetup;bootm ${loadaddr} - ${fdtaddr}\0"     \
144         "default_bootargs=set bootargs " CONFIG_BOOTARGS                \
145         " mxsfb.mode=${video_mode} ${append_bootargs}\0"                \
146         "fdtaddr=41000000\0"                                            \
147         "mtdids=" MTDIDS_DEFAULT "\0"                                   \
148         "mtdparts=" MTDPARTS_DEFAULT "\0"                               \
149         "nfsroot=/tftpboot/rootfs\0"                                    \
150         "otg_mode=device\0"                                             \
151         "touchpanel=tsc2007\0"                                          \
152         "video_mode=VGA\0"
153 #endif /*  CONFIG_ENV_IS_NOWHERE */
154
155 #define MTD_NAME                        "gpmi-nand"
156 #define MTDIDS_DEFAULT                  "nand0=" MTD_NAME
157
158 /*
159  * U-Boot Commands
160  */
161 #include <config_cmd_default.h>
162 #define CONFIG_CMD_CACHE
163 #define CONFIG_CMD_MMC
164 #define CONFIG_CMD_NAND
165 #define CONFIG_CMD_MTDPARTS
166 #define CONFIG_CMD_BOOTCE
167 #define CONFIG_CMD_TIME
168
169 /*
170  * Serial Driver
171  */
172 #define CONFIG_PL011_SERIAL
173 #define CONFIG_PL011_CLOCK              24000000
174 #define CONFIG_PL01x_PORTS      {       \
175         (void *)MXS_UARTDBG_BASE,       \
176         }
177 #define CONFIG_CONS_INDEX               0               /* do not change! */
178 #define CONFIG_BAUDRATE                 115200          /* Default baud rate */
179 #define CONFIG_SYS_BAUDRATE_TABLE       { 9600, 19200, 38400, 57600, 115200, }
180 #define CONFIG_SYS_CONSOLE_INFO_QUIET
181
182 /*
183  * Ethernet Driver
184  */
185 #define CONFIG_FEC_MXC
186 #ifdef CONFIG_FEC_MXC
187 /* This is required for the FEC driver to work with cache enabled */
188 #define CONFIG_SYS_ARM_CACHE_WRITETHROUGH
189
190 #ifndef CONFIG_TX28_S
191 #define CONFIG_FEC_MXC_MULTI
192 #else
193 #define IMX_FEC_BASE                    MXS_ENET0_BASE
194 #define CONFIG_FEC_MXC_PHYADDR          0x00
195 #endif
196
197 #define CONFIG_MII
198 #define CONFIG_FEC_XCV_TYPE             RMII
199 #define CONFIG_GET_FEC_MAC_ADDR_FROM_IIM
200 #define CONFIG_NET_MULTI
201 #define CONFIG_CMD_MII
202 #define CONFIG_CMD_DHCP
203 #define CONFIG_CMD_PING
204 /* Add for working with "strict" DHCP server */
205 #define CONFIG_BOOTP_SUBNETMASK
206 #define CONFIG_BOOTP_GATEWAY
207 #define CONFIG_BOOTP_DNS
208 #endif
209
210 #ifndef CONFIG_ENV_IS_NOWHERE
211 /* define one of the following options:
212 #define CONFIG_ENV_IS_IN_NAND
213 #define CONFIG_ENV_IS_IN_MMC
214 */
215 #define CONFIG_ENV_IS_IN_NAND
216 #endif
217 #define CONFIG_ENV_OVERWRITE
218
219 /*
220  * NAND flash driver
221  */
222 #ifdef CONFIG_CMD_NAND
223 #define CONFIG_MTD_DEVICE
224 #define CONFIG_NAND_MXS
225 #define CONFIG_APBH_DMA
226 #define CONFIG_APBH_DMA_BURST
227 #define CONFIG_APBH_DMA_BURST8
228 #define CONFIG_SYS_NAND_U_BOOT_OFFS     0x20000
229 #define CONFIG_CMD_NAND_TRIMFFS
230 #define CONFIG_SYS_MXS_DMA_CHANNEL      4
231 #define CONFIG_SYS_MAX_FLASH_SECT       1024
232 #define CONFIG_SYS_MAX_FLASH_BANKS      1
233 #define CONFIG_SYS_NAND_MAX_CHIPS       1
234 #define CONFIG_SYS_MAX_NAND_DEVICE      1
235 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
236 #define CONFIG_SYS_NAND_USE_FLASH_BBT
237 #define CONFIG_SYS_NAND_BASE            0x00000000
238 #define CONFIG_CMD_ROMUPDATE
239 #else
240 #undef CONFIG_ENV_IS_IN_NAND
241 #endif /* CONFIG_CMD_NAND */
242
243 #define CONFIG_ENV_OFFSET               (CONFIG_U_BOOT_IMG_SIZE + CONFIG_SYS_NAND_U_BOOT_OFFS)
244 #define CONFIG_ENV_SIZE                 SZ_128K
245 #define CONFIG_ENV_RANGE                0x60000
246 #ifdef CONFIG_ENV_OFFSET_REDUND
247 #define CONFIG_SYS_ENV_PART_STR         xstr(CONFIG_ENV_RANGE)          \
248         "(env),"                                                        \
249         xstr(CONFIG_ENV_RANGE)                                          \
250         "(env2),"
251 #define CONFIG_SYS_USERFS_PART_STR      "107904k(userfs)"
252 #else
253 #define CONFIG_SYS_ENV_PART_STR         xstr(CONFIG_ENV_RANGE)          \
254         "(env),"
255 #define CONFIG_SYS_USERFS_PART_STR      "108288k(userfs)"
256 #endif /* CONFIG_ENV_OFFSET_REDUND */
257
258 /*
259  * MMC Driver
260  */
261 #ifdef CONFIG_CMD_MMC
262 #define CONFIG_MMC
263 #define CONFIG_GENERIC_MMC
264 #define CONFIG_MXS_MMC
265 #define CONFIG_BOUNCE_BUFFER
266
267 #define CONFIG_DOS_PARTITION
268 #define CONFIG_CMD_FAT
269 #define CONFIG_CMD_EXT2
270
271 /*
272  * Environments on MMC
273  */
274 #ifdef CONFIG_ENV_IS_IN_MMC
275 #define CONFIG_SYS_MMC_ENV_DEV          0
276 #undef CONFIG_ENV_OFFSET
277 #undef CONFIG_ENV_SIZE
278 /* Associated with the MMC layout defined in mmcops.c */
279 #define CONFIG_ENV_OFFSET               SZ_1K
280 #define CONFIG_ENV_SIZE                 (SZ_128K - CONFIG_ENV_OFFSET)
281 #define CONFIG_DYNAMIC_MMC_DEVNO
282 #endif /* CONFIG_ENV_IS_IN_MMC */
283 #else
284 #undef CONFIG_ENV_IS_IN_MMC
285 #endif /* CONFIG_CMD_MMC */
286
287 #ifdef CONFIG_ENV_IS_NOWHERE
288 #undef CONFIG_ENV_SIZE
289 #define CONFIG_ENV_SIZE                 SZ_4K
290 #endif
291
292 #define MTDPARTS_DEFAULT                "mtdparts=" MTD_NAME ":"        \
293         "1m@" xstr(CONFIG_SYS_NAND_U_BOOT_OFFS) "(u-boot),"             \
294         CONFIG_SYS_ENV_PART_STR                                         \
295         "4m(linux),16m(rootfs),"                                        \
296         CONFIG_SYS_USERFS_PART_STR ",256k(dtb),512k@0x7f80000(bbt)ro"
297
298 #define CONFIG_SYS_SDRAM_BASE           PHYS_SDRAM_1
299 #define CONFIG_SYS_INIT_SP_ADDR         (CONFIG_SYS_SDRAM_BASE + 0x1000 - /* Fix this */ \
300                                         GENERATED_GBL_DATA_SIZE)
301
302 /* Defines for SPL */
303 #define CONFIG_SPL
304 #define CONFIG_SPL_NO_CPU_SUPPORT_CODE
305 #define CONFIG_SPL_START_S_PATH "arch/arm/cpu/arm926ejs/mxs"
306 #define CONFIG_SPL_LDSCRIPT     "arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds"
307 #define CONFIG_SPL_LIBCOMMON_SUPPORT
308 #define CONFIG_SPL_LIBGENERIC_SUPPORT
309 #define CONFIG_SPL_SERIAL_SUPPORT
310 #define CONFIG_SPL_GPIO_SUPPORT
311 #define CONFIG_SYS_SPL_VDDD_VAL         1500
312 #define CONFIG_SYS_SPL_BATT_BO_LEVEL    2800
313 #define CONFIG_SYS_SPL_VDDMEM_VAL       0       /* VDDMEM is not utilized on TX28 */
314
315 #endif /* __CONFIGS_TX28_H */