]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - include/configs/tx28.h
config: rename CONFIG_MX* to CONFIG_SOC_MX*
[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 #include <linux/sizes.h>
12 #include <asm/arch/regs-base.h>
13
14 /*
15  * Ka-Ro TX28 board - SoC configuration
16  */
17 #define CONFIG_MXS_GPIO                                 /* GPIO control */
18 #define CONFIG_SYS_HZ                   1000            /* Ticks per second */
19 #define PHYS_SDRAM_1_SIZE               CONFIG_SDRAM_SIZE
20 #ifdef CONFIG_TX28_S
21 #define TX28_MOD_SUFFIX                 "1"
22 #else
23 #define CONFIG_SYS_SPL_FIXED_BATT_SUPPLY
24 #define TX28_MOD_SUFFIX                 "0"
25 #endif
26 #define IRAM_BASE_ADDR                  0x00000000
27
28 #ifndef CONFIG_SPL_BUILD
29 #define CONFIG_SKIP_LOWLEVEL_INIT
30 #define CONFIG_SHOW_ACTIVITY
31 #define CONFIG_ARCH_CPU_INIT
32 #define CONFIG_ARCH_MISC_INIT           /* init vector table after relocation */
33 #define CONFIG_DISPLAY_CPUINFO
34 #define CONFIG_DISPLAY_BOARDINFO
35 #define CONFIG_BOARD_LATE_INIT
36 #define CONFIG_BOARD_EARLY_INIT_F
37 #define CONFIG_SYS_GENERIC_BOARD
38
39 /* LCD Logo and Splash screen support */
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_COLOR32
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            0x1             /* 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              256             /* 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
79 /*
80  * Flattened Device Tree (FDT) support
81 */
82 #ifdef CONFIG_OF_LIBFDT
83 #endif
84
85 /*
86  * Boot Linux
87  */
88 #define xstr(s)                         str(s)
89 #define str(s)                          #s
90 #define __pfx(x, s)                     (x##s)
91 #define _pfx(x, s)                      __pfx(x, s)
92
93 #define CONFIG_CMDLINE_TAG
94 #define CONFIG_SETUP_MEMORY_TAGS
95 #define CONFIG_BOOTDELAY                3
96 #define CONFIG_ZERO_BOOTDELAY_CHECK
97 #define CONFIG_SYS_AUTOLOAD             "no"
98 #define CONFIG_BOOTFILE                 "uImage"
99 #define CONFIG_BOOTARGS                 "init=/linuxrc console=ttyAMA0,115200 ro debug panic=1"
100 #define CONFIG_BOOTCOMMAND              "run bootcmd_${boot_mode} bootm_cmd"
101 #ifdef CONFIG_TX28_S
102 #define CONFIG_LOADADDR                 41000000
103 #else
104 #define CONFIG_LOADADDR                 43000000
105 #endif
106 #define CONFIG_FDTADDR                  41000000
107 #define CONFIG_SYS_LOAD_ADDR            _pfx(0x, CONFIG_LOADADDR)
108 #define CONFIG_SYS_FDT_ADDR             _pfx(0x, CONFIG_FDTADDR)
109 #define CONFIG_U_BOOT_IMG_SIZE          SZ_1M
110
111 /*
112  * Extra Environment Settings
113  */
114 #ifdef CONFIG_ENV_IS_NOWHERE
115 #define CONFIG_EXTRA_ENV_SETTINGS                                       \
116         "autostart=no\0"                                                \
117         "autoload=no\0"                                                 \
118         "bootdelay=-1\0"                                                \
119         "mtdids=" MTDIDS_DEFAULT "\0"                                   \
120         "mtdparts=" MTDPARTS_DEFAULT "\0"
121 #else
122 #define CONFIG_EXTRA_ENV_SETTINGS                                       \
123         "autostart=no\0"                                                \
124         "baseboard=stk5-v3\0"                                           \
125         "bootargs_jffs2=run default_bootargs;set bootargs ${bootargs}"  \
126         " root=/dev/mtdblock3 rootfstype=jffs2\0"                       \
127         "bootargs_mmc=run default_bootargs;set bootargs ${bootargs}"    \
128         " root=/dev/mmcblk0p3 rootwait\0"                               \
129         "bootargs_nfs=run default_bootargs;set bootargs ${bootargs}"    \
130         " root=/dev/nfs nfsroot=${nfs_server}:${nfsroot},nolock"        \
131         " ip=dhcp\0"                                                    \
132         "bootargs_ubifs=run default_bootargs;set bootargs ${bootargs}"  \
133         " ubi.mtd=rootfs root=ubi0:rootfs rootfstype=ubifs\0"           \
134         "bootcmd_jffs2=set autostart no;run bootargs_jffs2"             \
135         ";nboot linux\0"                                                \
136         "bootcmd_mmc=set autostart no;run bootargs_mmc"                 \
137         ";fatload mmc 0 ${loadaddr} uImage\0"                           \
138         "bootcmd_nand=set autostart no;run bootargs_ubifs;nboot linux\0"\
139         "bootcmd_net=set autoload y;set autostart n;run bootargs_nfs"   \
140         ";dhcp\0"                                                       \
141         "bootm_cmd=bootm ${loadaddr} - ${fdtaddr}\0"                    \
142         "boot_mode=nand\0"                                              \
143         "default_bootargs=set bootargs " CONFIG_BOOTARGS                \
144         " ${append_bootargs}\0"                                         \
145         "fdtaddr=" xstr(CONFIG_FDTADDR) "\0"                            \
146         "fdtsave=fdt resize;nand erase.part dtb"                        \
147         ";nand write ${fdtaddr} dtb ${fdtsize}\0"                       \
148         "mtdids=" MTDIDS_DEFAULT "\0"                                   \
149         "mtdparts=" MTDPARTS_DEFAULT "\0"                               \
150         "nfsroot=/tftpboot/rootfs\0"                                    \
151         "otg_mode=device\0"                                             \
152         "touchpanel=tsc2007\0"                                          \
153         "video_mode=VGA\0"
154 #endif /*  CONFIG_ENV_IS_NOWHERE */
155
156 #define MTD_NAME                        "gpmi-nand"
157 #define MTDIDS_DEFAULT                  "nand0=" MTD_NAME
158
159 /*
160  * Serial Driver
161  */
162 #define CONFIG_PL011_SERIAL
163 #define CONFIG_PL011_CLOCK              24000000
164 #define CONFIG_PL01x_PORTS      {       \
165         (void *)MXS_UARTDBG_BASE,       \
166         }
167 #define CONFIG_CONS_INDEX               0               /* do not change! */
168 #define CONFIG_BAUDRATE                 115200          /* Default baud rate */
169 #define CONFIG_SYS_BAUDRATE_TABLE       { 9600, 19200, 38400, 57600, 115200, }
170 #define CONFIG_SYS_CONSOLE_INFO_QUIET
171
172 /*
173  * Ethernet Driver
174  */
175 #ifdef CONFIG_FEC_MXC
176 /* This is required for the FEC driver to work with cache enabled */
177 #define CONFIG_SYS_ARM_CACHE_WRITETHROUGH
178 #define CONFIG_SYS_CACHELINE_SIZE       32
179
180 #ifdef CONFIG_FEC_MXC_PHYADDR
181 #define IMX_FEC_BASE                    MXS_ENET0_BASE
182 #endif
183
184 #define CONFIG_FEC_XCV_TYPE             RMII
185 #endif
186
187 #ifndef CONFIG_ENV_IS_NOWHERE
188 /* define one of the following options:
189 */
190 #endif
191 #define CONFIG_ENV_OVERWRITE
192
193 /*
194  * NAND flash driver
195  */
196 #ifdef CONFIG_NAND
197 #define CONFIG_SYS_NAND_BLOCK_SIZE      SZ_128K
198 #define CONFIG_NAND_MXS
199 #define CONFIG_APBH_DMA
200 #define CONFIG_APBH_DMA_BURST
201 #define CONFIG_APBH_DMA_BURST8
202 #define CONFIG_SYS_NAND_U_BOOT_OFFS     CONFIG_SYS_NAND_BLOCK_SIZE
203 #define CONFIG_SYS_MXS_DMA_CHANNEL      4
204 #define CONFIG_SYS_NAND_MAX_CHIPS       0x1
205 #define CONFIG_SYS_MAX_NAND_DEVICE      0x1
206 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
207 #define CONFIG_SYS_NAND_BASE            0x00000000
208 #else
209 #undef CONFIG_ENV_IS_IN_NAND
210 #endif /* CONFIG_CMD_NAND */
211
212 #ifdef CONFIG_ENV_IS_IN_NAND
213 #define CONFIG_ENV_OFFSET               (CONFIG_U_BOOT_IMG_SIZE + CONFIG_SYS_NAND_U_BOOT_OFFS)
214 #define CONFIG_ENV_SIZE                 SZ_128K
215 #define CONFIG_ENV_RANGE                (3 * CONFIG_SYS_NAND_BLOCK_SIZE)
216 #endif /* CONFIG_ENV_IS_IN_NAND */
217
218 #ifdef CONFIG_ENV_OFFSET_REDUND
219 #define CONFIG_SYS_ENV_PART_STR         xstr(CONFIG_SYS_ENV_PART_SIZE)  \
220         "(env),"                                                        \
221         xstr(CONFIG_SYS_ENV_PART_SIZE)                                  \
222         "(env2),"
223 #define CONFIG_SYS_USERFS_PART_STR      xstr(CONFIG_SYS_USERFS_PART_SIZE2) "(userfs)"
224 #else
225 #define CONFIG_SYS_ENV_PART_STR         xstr(CONFIG_SYS_ENV_PART_SIZE)  \
226         "(env),"
227 #define CONFIG_SYS_USERFS_PART_STR      xstr(CONFIG_SYS_USERFS_PART_SIZE) "(userfs)"
228 #endif /* CONFIG_ENV_OFFSET_REDUND */
229
230 /*
231  * MMC Driver
232  */
233 #ifdef CONFIG_CMD_MMC
234 #define CONFIG_MXS_MMC
235 #define CONFIG_BOUNCE_BUFFER
236
237 #define CONFIG_DOS_PARTITION
238 #define CONFIG_CMD_FAT
239 #define CONFIG_FAT_WRITE
240 #define CONFIG_CMD_EXT2
241
242 /*
243  * Environments on MMC
244  */
245 #ifdef CONFIG_ENV_IS_IN_MMC
246 #define CONFIG_SYS_MMC_ENV_DEV          0
247 /* Associated with the MMC layout defined in mmcops.c */
248 #define CONFIG_ENV_OFFSET               SZ_1K
249 #define CONFIG_ENV_SIZE                 (SZ_128K - CONFIG_ENV_OFFSET)
250 #define CONFIG_DYNAMIC_MMC_DEVNO
251 #endif /* CONFIG_ENV_IS_IN_MMC */
252 #else
253 #undef CONFIG_ENV_IS_IN_MMC
254 #endif /* CONFIG_CMD_MMC */
255
256 #ifdef CONFIG_ENV_IS_NOWHERE
257 #undef CONFIG_ENV_SIZE
258 #define CONFIG_ENV_SIZE                 SZ_4K
259 #endif
260
261 #define MTDPARTS_DEFAULT                "mtdparts=" MTD_NAME ":"        \
262         "1m@" xstr(CONFIG_SYS_NAND_U_BOOT_OFFS) "(u-boot),"             \
263         CONFIG_SYS_ENV_PART_STR                                         \
264         "6m(linux),32m(rootfs)," CONFIG_SYS_USERFS_PART_STR             \
265         ",512k@" xstr(CONFIG_SYS_NAND_DTB_OFFSET) "(dtb)"               \
266         ",512k@" xstr(CONFIG_SYS_NAND_BBT_OFFSET) "(bbt)ro"
267
268 #define CONFIG_SYS_SDRAM_BASE           PHYS_SDRAM_1
269 #define CONFIG_SYS_INIT_SP_ADDR         (CONFIG_SYS_SDRAM_BASE + 0x1000 - /* Fix this */ \
270                                         GENERATED_GBL_DATA_SIZE)
271
272 /* Defines for SPL */
273 #define CONFIG_SPL_START_S_PATH         "arch/arm/cpu/arm926ejs/mxs"
274 #define CONFIG_SPL_LDSCRIPT             "arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds"
275 #define CONFIG_SPL_LIBCOMMON_SUPPORT
276 #define CONFIG_SPL_LIBGENERIC_SUPPORT
277 #define CONFIG_SPL_SERIAL_SUPPORT
278 #define CONFIG_SPL_GPIO_SUPPORT
279 #define CONFIG_SYS_SPL_VDDD_VAL         1500
280 #define CONFIG_SYS_SPL_BATT_BO_LEVEL    2800
281 #define CONFIG_SYS_SPL_VDDMEM_VAL       0       /* VDDMEM is not utilized on TX28 */
282
283 #endif /* __CONFIGS_TX28_H */