]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - include/configs/tx28.h
5976ef8558ef25fc34dd975bd383d8f5c28d87f4
[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/kconfig.h>
12 #include <linux/sizes.h>
13 #include <asm/arch/regs-base.h>
14
15 /*
16  * Ka-Ro TX28 board - SoC configuration
17  */
18 #define CONFIG_MXS_GPIO                                 /* GPIO control */
19 #define CONFIG_SYS_HZ                   1000            /* Ticks per second */
20 #define PHYS_SDRAM_1_SIZE               CONFIG_SYS_SDRAM_SIZE
21 #ifdef CONFIG_TX28_S
22 #define TX28_MOD_SUFFIX                 "1"
23 #else
24 #define CONFIG_SYS_SPL_FIXED_BATT_SUPPLY
25 #define TX28_MOD_SUFFIX                 "0"
26 #endif
27 #define IRAM_BASE_ADDR                  0x00000000
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 #define CONFIG_SYS_GENERIC_BOARD
39
40 /* LCD Logo and Splash screen support */
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_COLOR32
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            0x1             /* 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_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                  40800000
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_TX28_UBOOT_NOENV
115 #define CONFIG_EXTRA_ENV_SETTINGS                                       \
116         "autostart=no\0"                                                \
117         "autoload=no\0"                                                 \
118         "baseboard=stk5-v3\0"                                           \
119         "bootdelay=-1\0"                                                \
120         "fdtaddr=" xstr(CONFIG_FDTADDR) "\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_jffs2=run default_bootargs"                           \
128         ";setenv bootargs ${bootargs}"                                  \
129         " root=/dev/mtdblock3 rootfstype=jffs2\0"                       \
130         "bootargs_mmc=run default_bootargs;setenv bootargs ${bootargs}" \
131         " root=/dev/mmcblk0p3 rootwait\0"                               \
132         "bootargs_nfs=run default_bootargs;setenv bootargs ${bootargs}" \
133         " root=/dev/nfs nfsroot=${nfs_server}:${nfsroot},nolock"        \
134         " ip=dhcp\0"                                                    \
135         "bootargs_ubifs=run default_bootargs"                           \
136         ";setenv bootargs ${bootargs}"                                  \
137         " ubi.mtd=rootfs root=ubi0:rootfs rootfstype=ubifs\0"           \
138         "bootcmd_jffs2=setenv autostart no;run bootargs_jffs2"          \
139         ";nboot linux\0"                                                \
140         "bootcmd_mmc=setenv autostart no;run bootargs_mmc"              \
141         ";fatload mmc 0 ${loadaddr} uImage\0"                           \
142         "bootcmd_nand=setenv autostart no;run bootargs_ubifs"           \
143         ";nboot linux\0"                                                \
144         "bootcmd_net=setenv autoload y;setenv autostart n"              \
145         ";run bootargs_nfs"                                             \
146         ";dhcp\0"                                                       \
147         "bootm_cmd=bootm ${loadaddr} - ${fdtaddr}\0"                    \
148         "boot_mode=nand\0"                                              \
149         "default_bootargs=setenv bootargs " CONFIG_BOOTARGS             \
150         " ${append_bootargs}\0"                                         \
151         "fdtaddr=" xstr(CONFIG_FDTADDR) "\0"                            \
152         "fdtsave=fdt resize;nand erase.part dtb"                        \
153         ";nand write ${fdtaddr} dtb ${fdtsize}\0"                       \
154         "mtdids=" MTDIDS_DEFAULT "\0"                                   \
155         "mtdparts=" MTDPARTS_DEFAULT "\0"                               \
156         "nfsroot=/tftpboot/rootfs\0"                                    \
157         "otg_mode=device\0"                                             \
158         "touchpanel=tsc2007\0"                                          \
159         "video_mode=VGA\0"
160 #endif /*  CONFIG_ENV_IS_NOWHERE */
161
162 #define MTD_NAME                        "gpmi-nand"
163 #define MTDIDS_DEFAULT                  "nand0=" MTD_NAME
164
165 /*
166  * Serial Driver
167  */
168 #define CONFIG_PL011_SERIAL
169 #define CONFIG_PL011_CLOCK              24000000
170 #define CONFIG_PL01x_PORTS      {       \
171         (void *)MXS_UARTDBG_BASE,       \
172         }
173 #define CONFIG_CONS_INDEX               0               /* do not change! */
174 #define CONFIG_BAUDRATE                 115200          /* Default baud rate */
175 #define CONFIG_SYS_BAUDRATE_TABLE       { 9600, 19200, 38400, 57600, 115200, }
176 #define CONFIG_SYS_CONSOLE_INFO_QUIET
177
178 /*
179  * Ethernet Driver
180  */
181 #ifdef CONFIG_FEC_MXC
182 /* This is required for the FEC driver to work with cache enabled */
183 #define CONFIG_SYS_ARM_CACHE_WRITETHROUGH
184 #define CONFIG_SYS_CACHELINE_SIZE       32
185
186 #ifdef CONFIG_TX28_S
187 #define CONFIG_FEC_MXC_PHYADDR          0
188 #define IMX_FEC_BASE                    MXS_ENET0_BASE
189 #endif
190
191 #define CONFIG_FEC_XCV_TYPE             RMII
192 #endif
193
194 /*
195  * NAND flash driver
196  */
197 #ifdef CONFIG_NAND
198 #define CONFIG_SYS_NAND_BLOCK_SIZE      SZ_128K
199 #define CONFIG_SYS_NAND_U_BOOT_OFFS     CONFIG_SYS_NAND_BLOCK_SIZE
200 #define CONFIG_SYS_MXS_DMA_CHANNEL      4
201 #define CONFIG_SYS_NAND_MAX_CHIPS       0x1
202 #define CONFIG_SYS_MAX_NAND_DEVICE      0x1
203 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
204 #define CONFIG_SYS_NAND_BASE            0x00000000
205 #endif /* CONFIG_NAND */
206
207 #define CONFIG_ENV_OVERWRITE
208
209 #ifdef CONFIG_ENV_IS_IN_NAND
210 #define CONFIG_ENV_OFFSET               (CONFIG_U_BOOT_IMG_SIZE + CONFIG_SYS_NAND_U_BOOT_OFFS)
211 #define CONFIG_ENV_SIZE                 SZ_128K
212 #define CONFIG_ENV_RANGE                (3 * CONFIG_SYS_NAND_BLOCK_SIZE)
213 #endif /* CONFIG_ENV_IS_IN_NAND */
214
215 #ifdef CONFIG_ENV_OFFSET_REDUND
216 #define CONFIG_SYS_ENV_PART_STR         xstr(CONFIG_SYS_ENV_PART_SIZE)  \
217         "(env),"                                                        \
218         xstr(CONFIG_SYS_ENV_PART_SIZE)                                  \
219         "(env2),"
220 #define CONFIG_SYS_USERFS_PART_STR      xstr(CONFIG_SYS_USERFS_PART_SIZE2) "(userfs)"
221 #else
222 #define CONFIG_SYS_ENV_PART_STR         xstr(CONFIG_SYS_ENV_PART_SIZE)  \
223         "(env),"
224 #define CONFIG_SYS_USERFS_PART_STR      xstr(CONFIG_SYS_USERFS_PART_SIZE) "(userfs)"
225 #endif /* CONFIG_ENV_OFFSET_REDUND */
226
227 /*
228  * MMC Driver
229  */
230 #ifdef CONFIG_MXS_MMC
231 #ifdef CONFIG_CMD_MMC
232 #define CONFIG_CMD_FAT
233 #define CONFIG_FAT_WRITE
234 #define CONFIG_CMD_EXT2
235 #endif
236
237 /*
238  * Environments on MMC
239  */
240 #ifdef CONFIG_ENV_IS_IN_MMC
241 #define CONFIG_SYS_MMC_ENV_DEV          0
242 /* Associated with the MMC layout defined in mmcops.c */
243 #define CONFIG_ENV_OFFSET               SZ_1K
244 #define CONFIG_ENV_SIZE                 (SZ_128K - CONFIG_ENV_OFFSET)
245 #define CONFIG_DYNAMIC_MMC_DEVNO
246 #endif /* CONFIG_ENV_IS_IN_MMC */
247 #endif /* CONFIG_MXS_MMC */
248
249 #define MTDPARTS_DEFAULT                "mtdparts=" MTD_NAME ":"        \
250         "1m@" xstr(CONFIG_SYS_NAND_U_BOOT_OFFS) "(u-boot),"             \
251         CONFIG_SYS_ENV_PART_STR                                         \
252         "6m(linux),32m(rootfs)," CONFIG_SYS_USERFS_PART_STR             \
253         ",512k@" xstr(CONFIG_SYS_NAND_DTB_OFFSET) "(dtb)"               \
254         ",512k@" xstr(CONFIG_SYS_NAND_BBT_OFFSET) "(bbt)ro"
255
256 #define CONFIG_SYS_SDRAM_BASE           PHYS_SDRAM_1
257 #define CONFIG_SYS_INIT_SP_ADDR         (CONFIG_SYS_SDRAM_BASE + 0x1000 - /* Fix this */ \
258                                         GENERATED_GBL_DATA_SIZE)
259
260 /* Defines for SPL */
261 #define CONFIG_SPL_START_S_PATH         "arch/arm/cpu/arm926ejs/mxs"
262 #define CONFIG_SPL_LDSCRIPT             "arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds"
263 #define CONFIG_SPL_LIBCOMMON_SUPPORT
264 #define CONFIG_SPL_LIBGENERIC_SUPPORT
265 #define CONFIG_SPL_SERIAL_SUPPORT
266 #define CONFIG_SPL_GPIO_SUPPORT
267 #define CONFIG_SYS_SPL_VDDD_VAL         1500
268 #define CONFIG_SYS_SPL_BATT_BO_LEVEL    2400
269 #define CONFIG_SYS_SPL_VDDA_BO_VAL      100
270 #define CONFIG_SYS_SPL_VDDMEM_VAL       0       /* VDDMEM is not utilized on TX28 */
271
272 #endif /* __CONFIG_H */