]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - include/configs/tx28.h
karo: cleanup after merge of v2015.10-rc2
[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         "bootdelay=-1\0"                                                \
119         "fdtaddr=" xstr(CONFIG_FDTADDR) "\0"                            \
120         "mtdids=" MTDIDS_DEFAULT "\0"                                   \
121         "mtdparts=" MTDPARTS_DEFAULT "\0"
122 #else
123 #define CONFIG_EXTRA_ENV_SETTINGS                                       \
124         "autostart=no\0"                                                \
125         "baseboard=stk5-v3\0"                                           \
126         "bootargs_jffs2=run default_bootargs"                           \
127         ";setenv bootargs ${bootargs}"                                  \
128         " root=/dev/mtdblock3 rootfstype=jffs2\0"                       \
129         "bootargs_mmc=run default_bootargs;setenv bootargs ${bootargs}" \
130         " root=/dev/mmcblk0p3 rootwait\0"                               \
131         "bootargs_nfs=run default_bootargs;setenv bootargs ${bootargs}" \
132         " root=/dev/nfs nfsroot=${nfs_server}:${nfsroot},nolock"        \
133         " ip=dhcp\0"                                                    \
134         "bootargs_ubifs=run default_bootargs"                           \
135         ";setenv bootargs ${bootargs}"                                  \
136         " ubi.mtd=rootfs root=ubi0:rootfs rootfstype=ubifs\0"           \
137         "bootcmd_jffs2=setenv autostart no;run bootargs_jffs2"          \
138         ";nboot linux\0"                                                \
139         "bootcmd_mmc=setenv autostart no;run bootargs_mmc"              \
140         ";fatload mmc 0 ${loadaddr} uImage\0"                           \
141         "bootcmd_nand=setenv autostart no;run bootargs_ubifs"           \
142         ";nboot linux\0"                                                \
143         "bootcmd_net=setenv autoload y;setenv autostart n"              \
144         ";run bootargs_nfs"                                             \
145         ";dhcp\0"                                                       \
146         "bootm_cmd=bootm ${loadaddr} - ${fdtaddr}\0"                    \
147         "boot_mode=nand\0"                                              \
148         "default_bootargs=setenv 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  * Serial Driver
166  */
167 #define CONFIG_PL011_SERIAL
168 #define CONFIG_PL011_CLOCK              24000000
169 #define CONFIG_PL01x_PORTS      {       \
170         (void *)MXS_UARTDBG_BASE,       \
171         }
172 #define CONFIG_CONS_INDEX               0               /* do not change! */
173 #define CONFIG_BAUDRATE                 115200          /* Default baud rate */
174 #define CONFIG_SYS_BAUDRATE_TABLE       { 9600, 19200, 38400, 57600, 115200, }
175 #define CONFIG_SYS_CONSOLE_INFO_QUIET
176
177 /*
178  * Ethernet Driver
179  */
180 #ifdef CONFIG_FEC_MXC
181 /* This is required for the FEC driver to work with cache enabled */
182 #define CONFIG_SYS_ARM_CACHE_WRITETHROUGH
183 #define CONFIG_SYS_CACHELINE_SIZE       32
184
185 #ifdef CONFIG_FEC_MXC_PHYADDR
186 #define IMX_FEC_BASE                    MXS_ENET0_BASE
187 #endif
188
189 #define CONFIG_FEC_XCV_TYPE             RMII
190 #endif
191
192 /*
193  * NAND flash driver
194  */
195 #ifdef CONFIG_NAND
196 #define CONFIG_SYS_NAND_BLOCK_SIZE      SZ_128K
197 #define CONFIG_SYS_NAND_U_BOOT_OFFS     CONFIG_SYS_NAND_BLOCK_SIZE
198 #define CONFIG_SYS_MXS_DMA_CHANNEL      4
199 #define CONFIG_SYS_NAND_MAX_CHIPS       0x1
200 #define CONFIG_SYS_MAX_NAND_DEVICE      0x1
201 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
202 #define CONFIG_SYS_NAND_BASE            0x00000000
203 #endif /* CONFIG_CMD_NAND */
204
205 #ifdef CONFIG_ENV_IS_IN_NAND
206 #define CONFIG_ENV_OFFSET               (CONFIG_U_BOOT_IMG_SIZE + CONFIG_SYS_NAND_U_BOOT_OFFS)
207 #define CONFIG_ENV_SIZE                 SZ_128K
208 #define CONFIG_ENV_RANGE                (3 * CONFIG_SYS_NAND_BLOCK_SIZE)
209 #endif /* CONFIG_ENV_IS_IN_NAND */
210
211 #ifdef CONFIG_ENV_OFFSET_REDUND
212 #define CONFIG_SYS_ENV_PART_STR         xstr(CONFIG_SYS_ENV_PART_SIZE)  \
213         "(env),"                                                        \
214         xstr(CONFIG_SYS_ENV_PART_SIZE)                                  \
215         "(env2),"
216 #define CONFIG_SYS_USERFS_PART_STR      xstr(CONFIG_SYS_USERFS_PART_SIZE2) "(userfs)"
217 #else
218 #define CONFIG_SYS_ENV_PART_STR         xstr(CONFIG_SYS_ENV_PART_SIZE)  \
219         "(env),"
220 #define CONFIG_SYS_USERFS_PART_STR      xstr(CONFIG_SYS_USERFS_PART_SIZE) "(userfs)"
221 #endif /* CONFIG_ENV_OFFSET_REDUND */
222
223 /*
224  * MMC Driver
225  */
226 #ifdef CONFIG_MXS_MMC
227 #ifdef CONFIG_CMD_MMC
228 #define CONFIG_CMD_FAT
229 #define CONFIG_FAT_WRITE
230 #define CONFIG_CMD_EXT2
231 #endif
232
233 /*
234  * Environments on MMC
235  */
236 #ifdef CONFIG_ENV_IS_IN_MMC
237 #define CONFIG_SYS_MMC_ENV_DEV          0
238 #define CONFIG_ENV_OVERWRITE
239 /* Associated with the MMC layout defined in mmcops.c */
240 #define CONFIG_ENV_OFFSET               SZ_1K
241 #define CONFIG_ENV_SIZE                 (SZ_128K - CONFIG_ENV_OFFSET)
242 #define CONFIG_DYNAMIC_MMC_DEVNO
243 #endif /* CONFIG_ENV_IS_IN_MMC */
244 #endif /* CONFIG_MXS_MMC */
245
246 #define MTDPARTS_DEFAULT                "mtdparts=" MTD_NAME ":"        \
247         "1m@" xstr(CONFIG_SYS_NAND_U_BOOT_OFFS) "(u-boot),"             \
248         CONFIG_SYS_ENV_PART_STR                                         \
249         "6m(linux),32m(rootfs)," CONFIG_SYS_USERFS_PART_STR             \
250         ",512k@" xstr(CONFIG_SYS_NAND_DTB_OFFSET) "(dtb)"               \
251         ",512k@" xstr(CONFIG_SYS_NAND_BBT_OFFSET) "(bbt)ro"
252
253 #define CONFIG_SYS_SDRAM_BASE           PHYS_SDRAM_1
254 #define CONFIG_SYS_INIT_SP_ADDR         (CONFIG_SYS_SDRAM_BASE + 0x1000 - /* Fix this */ \
255                                         GENERATED_GBL_DATA_SIZE)
256
257 /* Defines for SPL */
258 #define CONFIG_SPL_START_S_PATH         "arch/arm/cpu/arm926ejs/mxs"
259 #define CONFIG_SPL_LDSCRIPT             "arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds"
260 #define CONFIG_SPL_LIBCOMMON_SUPPORT
261 #define CONFIG_SPL_LIBGENERIC_SUPPORT
262 #define CONFIG_SPL_SERIAL_SUPPORT
263 #define CONFIG_SPL_GPIO_SUPPORT
264 #define CONFIG_SYS_SPL_VDDD_VAL         1500
265 #define CONFIG_SYS_SPL_BATT_BO_LEVEL    2400
266 #define CONFIG_SYS_SPL_VDDA_BO_VAL      100
267 #define CONFIG_SYS_SPL_VDDMEM_VAL       0       /* VDDMEM is not utilized on TX28 */
268
269 #endif /* __CONFIG_H */