dts: karo: remove embedded FDT
[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_DISPLAY_CPUINFO
34 #define CONFIG_DISPLAY_BOARDINFO
35 #define CONFIG_BOARD_LATE_INIT
36 #define CONFIG_BOARD_EARLY_INIT_F
37
38 /* LCD Logo and Splash screen support */
39 #define CONFIG_LCD
40 #ifdef CONFIG_LCD
41 #define CONFIG_SPLASH_SCREEN
42 #define CONFIG_SPLASH_SCREEN_ALIGN
43 #define CONFIG_VIDEO_MXS
44 #define CONFIG_LCD_LOGO
45 #define LCD_BPP                         LCD_COLOR24
46 #define CONFIG_CMD_BMP
47 #define CONFIG_VIDEO_BMP_RLE8
48 #endif /* CONFIG_LCD */
49 #endif /* CONFIG_SPL_BUILD */
50
51 /*
52  * Memory configuration options
53  */
54 #define CONFIG_NR_DRAM_BANKS            1               /* 1 bank of SDRAM */
55 #define PHYS_SDRAM_1                    0x40000000      /* SDRAM Bank #1 */
56 #define CONFIG_STACKSIZE                SZ_64K
57 #define CONFIG_SYS_MALLOC_LEN           SZ_4M
58 #define CONFIG_SYS_MEMTEST_START        PHYS_SDRAM_1    /* Memtest start address */
59 #define CONFIG_SYS_MEMTEST_END          (CONFIG_SYS_MEMTEST_START + SZ_4M)
60
61 /*
62  * U-Boot general configurations
63  */
64 #define CONFIG_SYS_LONGHELP
65 #define CONFIG_SYS_PROMPT               "TX28 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              64              /* 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 #ifdef CONFIG_OF_LIBFDT
85 #define CONFIG_FDT_FIXUP_PARTITIONS
86 #define CONFIG_OF_BOARD_SETUP
87 #define CONFIG_DEFAULT_DEVICE_TREE      tx28
88 #define CONFIG_ARCH_DEVICE_TREE         mx28
89 #define CONFIG_SYS_FDT_ADDR             (PHYS_SDRAM_1 + SZ_16M)
90 #endif
91
92 /*
93  * Boot Linux
94  */
95 #define xstr(s) str(s)
96 #define str(s)  #s
97 #define __pfx(x, s)                     (x##s)
98 #define _pfx(x, s)                      __pfx(x, s)
99
100 #define CONFIG_CMDLINE_TAG
101 #define CONFIG_SETUP_MEMORY_TAGS
102 #define CONFIG_BOOTDELAY                3
103 #define CONFIG_ZERO_BOOTDELAY_CHECK
104 #define CONFIG_SYS_AUTOLOAD             "no"
105 #define CONFIG_BOOTFILE                 "uImage"
106 #define CONFIG_BOOTARGS                 "console=ttyAMA0,115200 ro debug panic=1"
107 #define CONFIG_BOOTCOMMAND              "run bootcmd_nand"
108 #define CONFIG_LOADADDR                 43000000
109 #define CONFIG_SYS_LOAD_ADDR            _pfx(0x, CONFIG_LOADADDR)
110 #define CONFIG_U_BOOT_IMG_SIZE          SZ_1M
111
112 /*
113  * Extra Environments
114  */
115 #ifdef CONFIG_ENV_IS_NOWHERE
116 #define CONFIG_EXTRA_ENV_SETTINGS                                       \
117         "autostart=no\0"                                                \
118         "autoload=no\0"                                                 \
119         "bootdelay=-1\0"                                                \
120         "fdtaddr=11000000\0"                                            \
121         "mtdids=" MTDIDS_DEFAULT "\0"                                   \
122         "mtdparts=" MTDPARTS_DEFAULT "\0"
123 #else
124 #define CONFIG_EXTRA_ENV_SETTINGS                                       \
125         "autostart=no\0"                                                \
126         "baseboard=stk5-v3\0"                                           \
127         "bootargs_mmc=run default_bootargs;set bootargs ${bootargs}"    \
128         " root=/dev/mmcblk0p3 rootwait\0"                               \
129         "bootargs_nand=run default_bootargs;set bootargs ${bootargs}"   \
130         " root=/dev/mtdblock3 rootfstype=jffs2\0"                       \
131         "bootargs_nfs=run default_bootargs;set bootargs ${bootargs}"    \
132         " root=/dev/nfs ip=dhcp nfsroot=${nfs_server}:${nfsroot},nolock\0"\
133         "bootcmd_mmc=set autostart no;run bootargs_mmc;"                \
134         "fatload mmc 0 ${loadaddr} uImage;run bootm_cmd\0"              \
135         "bootcmd_nand=set autostart no;run bootargs_nand;"              \
136         "nboot linux;run bootm_cmd\0"                                   \
137         "bootcmd_net=set autostart no;run bootargs_nfs;dhcp;"           \
138         "run bootm_cmd\0"                                               \
139         "bootm_cmd=bootm ${loadaddr} - ${fdtaddr}\0"                    \
140         "default_bootargs=set bootargs " CONFIG_BOOTARGS                \
141         " mxsfb.mode=${video_mode} ${append_bootargs}\0"                \
142         "fdtaddr=41000000\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 #endif /*  CONFIG_ENV_IS_NOWHERE */
150
151 #define MTD_NAME                        "gpmi-nand"
152 #define MTDIDS_DEFAULT                  "nand0=" MTD_NAME
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_MEMTEST
165
166 /*
167  * Serial Driver
168  */
169 #define CONFIG_PL011_SERIAL
170 #define CONFIG_PL011_CLOCK              24000000
171 #define CONFIG_PL01x_PORTS      {       \
172         (void *)MXS_UARTDBG_BASE,       \
173         }
174 #define CONFIG_CONS_INDEX               0               /* do not change! */
175 #define CONFIG_BAUDRATE                 115200          /* Default baud rate */
176 #define CONFIG_SYS_BAUDRATE_TABLE       { 9600, 19200, 38400, 57600, 115200, }
177 #define CONFIG_SYS_CONSOLE_INFO_QUIET
178
179 /*
180  * Ethernet Driver
181  */
182 #define CONFIG_FEC_MXC
183 #ifdef CONFIG_FEC_MXC
184 /* This is required for the FEC driver to work with cache enabled */
185 #define CONFIG_SYS_ARM_CACHE_WRITETHROUGH
186 #define CONFIG_SYS_CACHELINE_SIZE       32
187
188 #ifndef CONFIG_TX28_S
189 #define CONFIG_FEC_MXC_MULTI
190 #else
191 #define IMX_FEC_BASE                    MXS_ENET0_BASE
192 #define CONFIG_FEC_MXC_PHYADDR          0x00
193 #endif
194
195 #define CONFIG_PHY_SMSC
196 #define CONFIG_PHYLIB
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 #define CONFIG_BOOTP_RANDOM_ID
209 #endif
210
211 #ifndef CONFIG_ENV_IS_NOWHERE
212 /* define one of the following options:
213 #define CONFIG_ENV_IS_IN_NAND
214 #define CONFIG_ENV_IS_IN_MMC
215 */
216 #define CONFIG_ENV_IS_IN_NAND
217 #endif
218 #define CONFIG_ENV_OVERWRITE
219
220 /*
221  * NAND flash driver
222  */
223 #ifdef CONFIG_CMD_NAND
224 #define CONFIG_MTD_DEVICE
225 #define CONFIG_NAND_MXS
226 #define CONFIG_APBH_DMA
227 #define CONFIG_APBH_DMA_BURST
228 #define CONFIG_APBH_DMA_BURST8
229 #define CONFIG_SYS_NAND_U_BOOT_OFFS     0x20000
230 #define CONFIG_CMD_NAND_TRIMFFS
231 #define CONFIG_SYS_MXS_DMA_CHANNEL      4
232 #define CONFIG_SYS_MAX_FLASH_SECT       1024
233 #define CONFIG_SYS_MAX_FLASH_BANKS      1
234 #define CONFIG_SYS_NAND_MAX_CHIPS       1
235 #define CONFIG_SYS_MAX_NAND_DEVICE      1
236 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
237 #define CONFIG_SYS_NAND_USE_FLASH_BBT
238 #define CONFIG_SYS_NAND_BASE            0x00000000
239 #define CONFIG_CMD_ROMUPDATE
240 #else
241 #undef CONFIG_ENV_IS_IN_NAND
242 #endif /* CONFIG_CMD_NAND */
243
244 #define CONFIG_ENV_OFFSET               (CONFIG_U_BOOT_IMG_SIZE + CONFIG_SYS_NAND_U_BOOT_OFFS)
245 #define CONFIG_ENV_SIZE                 SZ_128K
246 #define CONFIG_ENV_RANGE                0x60000
247 #ifdef CONFIG_ENV_OFFSET_REDUND
248 #define CONFIG_SYS_ENV_PART_STR         xstr(CONFIG_ENV_RANGE)          \
249         "(env),"                                                        \
250         xstr(CONFIG_ENV_RANGE)                                          \
251         "(env2),"
252 #define CONFIG_SYS_USERFS_PART_STR      "107904k(userfs)"
253 #else
254 #define CONFIG_SYS_ENV_PART_STR         xstr(CONFIG_ENV_RANGE)          \
255         "(env),"
256 #define CONFIG_SYS_USERFS_PART_STR      "108288k(userfs)"
257 #endif /* CONFIG_ENV_OFFSET_REDUND */
258
259 /*
260  * MMC Driver
261  */
262 #ifdef CONFIG_CMD_MMC
263 #define CONFIG_MMC
264 #define CONFIG_GENERIC_MMC
265 #define CONFIG_MXS_MMC
266 #define CONFIG_BOUNCE_BUFFER
267
268 #define CONFIG_DOS_PARTITION
269 #define CONFIG_CMD_FAT
270 #define CONFIG_CMD_EXT2
271
272 /*
273  * Environments on MMC
274  */
275 #ifdef CONFIG_ENV_IS_IN_MMC
276 #define CONFIG_SYS_MMC_ENV_DEV          0
277 #undef CONFIG_ENV_OFFSET
278 #undef CONFIG_ENV_SIZE
279 /* Associated with the MMC layout defined in mmcops.c */
280 #define CONFIG_ENV_OFFSET               SZ_1K
281 #define CONFIG_ENV_SIZE                 (SZ_128K - CONFIG_ENV_OFFSET)
282 #define CONFIG_DYNAMIC_MMC_DEVNO
283 #endif /* CONFIG_ENV_IS_IN_MMC */
284 #else
285 #undef CONFIG_ENV_IS_IN_MMC
286 #endif /* CONFIG_CMD_MMC */
287
288 #ifdef CONFIG_ENV_IS_NOWHERE
289 #undef CONFIG_ENV_SIZE
290 #define CONFIG_ENV_SIZE                 SZ_4K
291 #endif
292
293 #define MTDPARTS_DEFAULT                "mtdparts=" MTD_NAME ":"        \
294         "1m@" xstr(CONFIG_SYS_NAND_U_BOOT_OFFS) "(u-boot),"             \
295         CONFIG_SYS_ENV_PART_STR                                         \
296         "4m(linux),16m(rootfs),"                                        \
297         CONFIG_SYS_USERFS_PART_STR ",256k(dtb),512k@0x7f80000(bbt)ro"
298
299 #define CONFIG_SYS_SDRAM_BASE           PHYS_SDRAM_1
300 #define CONFIG_SYS_INIT_SP_ADDR         (CONFIG_SYS_SDRAM_BASE + 0x1000 - /* Fix this */ \
301                                         GENERATED_GBL_DATA_SIZE)
302
303 /* Defines for SPL */
304 #define CONFIG_SPL
305 #define CONFIG_SPL_NO_CPU_SUPPORT_CODE
306 #define CONFIG_SPL_START_S_PATH "arch/arm/cpu/arm926ejs/mxs"
307 #define CONFIG_SPL_LDSCRIPT     "arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds"
308 #define CONFIG_SPL_LIBCOMMON_SUPPORT
309 #define CONFIG_SPL_LIBGENERIC_SUPPORT
310 #define CONFIG_SPL_SERIAL_SUPPORT
311 #define CONFIG_SPL_GPIO_SUPPORT
312 #define CONFIG_SYS_SPL_VDDD_VAL         1500
313 #define CONFIG_SYS_SPL_BATT_BO_LEVEL    2800
314 #define CONFIG_SYS_SPL_VDDMEM_VAL       0       /* VDDMEM is not utilized on TX28 */
315
316 #endif /* __CONFIGS_TX28_H */