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