]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - include/configs/tx53.h
karo: config: enable CONFIG_GENERIC_BOARD
[karo-tx-uboot.git] / include / configs / tx53.h
1 /*
2  * Copyright (C) 2012-2014 <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_MX53                     /* must be defined before including imx-regs.h */
12
13 #include <linux/sizes.h>
14 #include <asm/arch/imx-regs.h>
15
16 /*
17  * Ka-Ro TX53 board - SoC configuration
18  */
19 #define CONFIG_SYS_MX5_IOMUX_V3
20 #define CONFIG_MXC_GPIO                 /* GPIO control */
21 #define CONFIG_SYS_MX5_HCLK             24000000
22 #define CONFIG_SYS_DDR_CLKSEL           0
23 #define CONFIG_SYS_HZ                   1000    /* Ticks per second */
24 #define CONFIG_SHOW_ACTIVITY
25 #define CONFIG_DISPLAY_BOARDINFO
26 #define CONFIG_BOARD_LATE_INIT
27 #define CONFIG_BOARD_EARLY_INIT_F
28 #define CONFIG_SYS_GENERIC_BOARD
29
30 /* LCD Logo and Splash screen support */
31 #define CONFIG_LCD
32 #ifdef CONFIG_LCD
33 #define CONFIG_SPLASH_SCREEN
34 #define CONFIG_SPLASH_SCREEN_ALIGN
35 #define CONFIG_VIDEO_IPUV3
36 #define CONFIG_IPUV3_CLK                200000000
37 #define CONFIG_LCD_LOGO
38 #define LCD_BPP                         LCD_COLOR32
39 #define CONFIG_CMD_BMP
40 #define CONFIG_VIDEO_BMP_RLE8
41 #endif /* CONFIG_LCD */
42
43 /*
44  * Memory configuration options
45  */
46 #ifndef CONFIG_SYS_SDRAM_SIZE
47 #define CONFIG_SYS_SDRAM_SIZE           (SZ_512M * CONFIG_NR_DRAM_BANKS)
48 #endif
49
50 #define PHYS_SDRAM_1                    0x70000000      /* Base address of bank 1 */
51 #define PHYS_SDRAM_1_SIZE               (CONFIG_SYS_SDRAM_SIZE / CONFIG_NR_DRAM_BANKS)
52 #if CONFIG_NR_DRAM_BANKS > 1
53 #define PHYS_SDRAM_2                    0xb0000000      /* Base address of bank 2 */
54 #define PHYS_SDRAM_2_SIZE               PHYS_SDRAM_1_SIZE
55 #endif
56 #define CONFIG_STACKSIZE                SZ_128K
57 #define CONFIG_SYS_MALLOC_LEN           SZ_8M
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 #define CONFIG_SYS_SDRAM_CLK            400
61
62 /*
63  * U-Boot general configurations
64  */
65 #define CONFIG_SYS_LONGHELP
66 #define CONFIG_SYS_PROMPT               "TX53 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
80 /*
81  * Flattened Device Tree (FDT) support
82 */
83
84 /*
85  * Boot Linux
86  */
87 #define xstr(s)                         str(s)
88 #define str(s)                          #s
89 #define __pfx(x, s)                     (x##s)
90 #define _pfx(x, s)                      __pfx(x, s)
91
92 #define CONFIG_CMDLINE_TAG
93 #define CONFIG_SETUP_MEMORY_TAGS
94 #define CONFIG_BOOTDELAY                3
95 #define CONFIG_ZERO_BOOTDELAY_CHECK
96 #define CONFIG_SYS_AUTOLOAD             "no"
97 #define CONFIG_BOOTFILE                 "uImage"
98 #define CONFIG_BOOTARGS                 "init=/linuxrc console=ttymxc0,115200 ro debug panic=1"
99 #define CONFIG_BOOTCOMMAND              "run bootcmd_${boot_mode} bootm_cmd"
100 #define CONFIG_LOADADDR                 78000000
101 #define CONFIG_FDTADDR                  71000000
102 #define CONFIG_SYS_LOAD_ADDR            _pfx(0x, CONFIG_LOADADDR)
103 #define CONFIG_SYS_FDT_ADDR             _pfx(0x, CONFIG_FDTADDR)
104 #define CONFIG_U_BOOT_IMG_SIZE          SZ_1M
105 #ifndef CONFIG_SYS_LVDS_IF
106 #define DEFAULT_VIDEO_MODE              "VGA"
107 #else
108 #define DEFAULT_VIDEO_MODE              "HSD100PXN1"
109 #endif
110
111 /*
112  * Extra Environment Settings
113  */
114 #define CONFIG_EXTRA_ENV_SETTINGS                                       \
115         "autostart=no\0"                                                \
116         "baseboard=stk5-v3\0"                                           \
117         "bootargs_jffs2=run default_bootargs;set bootargs ${bootargs}"  \
118         " root=/dev/mtdblock3 rootfstype=jffs2\0"                       \
119         "bootargs_mmc=run default_bootargs;set bootargs ${bootargs}"    \
120         " root=/dev/mmcblk0p2 rootwait\0"                               \
121         "bootargs_nfs=run default_bootargs;set bootargs ${bootargs}"    \
122         " root=/dev/nfs nfsroot=${nfs_server}:${nfsroot},nolock"        \
123         " ip=dhcp\0"                                                    \
124         "bootargs_ubifs=run default_bootargs;set bootargs ${bootargs}"  \
125         " ubi.mtd=rootfs root=ubi0:rootfs rootfstype=ubifs\0"           \
126         "bootcmd_jffs2=set autostart no;run bootargs_jffs2"             \
127         ";nboot linux\0"                                                \
128         "bootcmd_mmc=set autostart no;run bootargs_mmc"                 \
129         ";fatload mmc 0 ${loadaddr} uImage\0"                           \
130         "bootcmd_nand=set autostart no;run bootargs_ubifs"              \
131         ";nboot linux\0"                                                \
132         "bootcmd_net=set autoload y;set autostart n;run bootargs_nfs"   \
133         ";dhcp\0"                                                       \
134         "bootm_cmd=bootm ${loadaddr} - ${fdtaddr}\0"                    \
135         "boot_mode=nand\0"                                              \
136         "cpu_clk=800\0"                                                 \
137         "default_bootargs=set bootargs " CONFIG_BOOTARGS                \
138         " ${append_bootargs}\0"                                         \
139         "fdtaddr=" xstr(CONFIG_FDTADDR) "\0"                            \
140         "fdtsave=fdt resize;nand erase.part dtb"                        \
141         ";nand write ${fdtaddr} dtb ${fdtsize}\0"                       \
142         "mtdids=" MTDIDS_DEFAULT "\0"                                   \
143         "mtdparts=" MTDPARTS_DEFAULT "\0"                               \
144         "nfsroot=/tftpboot/rootfs\0"                                    \
145         "otg_mode=device\0"                                             \
146         "touchpanel=tsc2007\0"                                          \
147         "video_mode=" DEFAULT_VIDEO_MODE "\0"
148
149 #define MTD_NAME                        "mxc_nand"
150 #define MTDIDS_DEFAULT                  "nand0=" MTD_NAME
151
152 /*
153  * U-Boot Commands
154  */
155 #include <config_cmd_default.h>
156
157 /*
158  * Serial Driver
159  */
160 #define CONFIG_MXC_UART
161 #define CONFIG_MXC_UART_BASE            UART1_BASE
162 #define CONFIG_BAUDRATE                 115200          /* Default baud rate */
163 #define CONFIG_SYS_BAUDRATE_TABLE       { 9600, 19200, 38400, 57600, 115200, }
164 #define CONFIG_SYS_CONSOLE_INFO_QUIET
165
166 /*
167  * GPIO driver
168  */
169 #define CONFIG_MXC_GPIO
170
171 /*
172  * Ethernet Driver
173  */
174 #ifdef CONFIG_FEC_MXC
175 #define IMX_FEC_BASE                    FEC_BASE_ADDR
176 #define CONFIG_FEC_MXC_PHYADDR          0
177 #define CONFIG_FEC_XCV_TYPE             MII100
178 #define CONFIG_CMD_MII
179 /* Add for working with "strict" DHCP server */
180 #define CONFIG_BOOTP_SUBNETMASK
181 #define CONFIG_BOOTP_GATEWAY
182 #define CONFIG_BOOTP_DNS
183 #endif
184
185 /*
186  * I2C Configs
187  */
188 #ifdef CONFIG_CMD_I2C
189 #define CONFIG_I2C_MXC
190 #define CONFIG_SYS_I2C_BASE             I2C1_BASE_ADDR
191 #define CONFIG_SYS_I2C_SPEED            400000
192 #define CONFIG_SYS_I2C_SLAVE            0x34
193 #endif
194
195 /*
196  * NAND flash driver
197  */
198 #ifdef CONFIG_CMD_NAND
199 #define CONFIG_MXC_NAND_REGS_BASE       NFC_BASE_ADDR_AXI
200 #define CONFIG_MXC_NAND_IP_REGS_BASE    NFC_BASE_ADDR
201 #define CONFIG_MXC_NAND_HWECC
202 #define CONFIG_SYS_NAND_MAX_CHIPS       0x1
203 #define CONFIG_SYS_MAX_NAND_DEVICE      0x1
204 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
205 #ifdef CONFIG_ENV_IS_IN_NAND
206 #define CONFIG_ENV_OVERWRITE
207 #define CONFIG_ENV_OFFSET               CONFIG_U_BOOT_IMG_SIZE
208 #define CONFIG_ENV_SIZE                 0x20000 /* 128 KiB */
209 #define CONFIG_ENV_RANGE                0x60000
210 #endif
211 #define CONFIG_SYS_NAND_BASE            0x00000000
212 #endif /* CONFIG_CMD_NAND */
213
214 /*
215  * MMC Driver
216  */
217 #ifdef CONFIG_FSL_ESDHC
218 #define CONFIG_SYS_FSL_ESDHC_ADDR       0
219
220 #define CONFIG_CMD_FAT
221 #define CONFIG_FAT_WRITE
222 #define CONFIG_CMD_EXT2
223
224 /*
225  * Environments on MMC
226  */
227 #ifdef CONFIG_ENV_IS_IN_MMC
228 #define CONFIG_SYS_MMC_ENV_DEV          0
229 #define CONFIG_ENV_OVERWRITE
230 /* Associated with the MMC layout defined in mmcops.c */
231 #define CONFIG_ENV_OFFSET               SZ_1K
232 #define CONFIG_ENV_SIZE                 (SZ_128K - CONFIG_ENV_OFFSET)
233 #define CONFIG_DYNAMIC_MMC_DEVNO
234 #endif /* CONFIG_ENV_IS_IN_MMC */
235 #endif /* CONFIG_CMD_MMC */
236
237 #ifdef CONFIG_ENV_OFFSET_REDUND
238 #define MTDPARTS_DEFAULT                "mtdparts=" MTD_NAME ":"        \
239         "1m(u-boot),"                                                   \
240         xstr(CONFIG_ENV_RANGE)                                          \
241         "(env),"                                                        \
242         xstr(CONFIG_ENV_RANGE)                                          \
243         "(env2),6m(linux),32m(rootfs),89344k(userfs),512k@0x7f00000(dtb),512k@0x7f80000(bbt)ro"
244 #else
245 #define MTDPARTS_DEFAULT                "mtdparts=" MTD_NAME ":"        \
246         "1m(u-boot),"                                                   \
247         xstr(CONFIG_ENV_RANGE)                                          \
248         "(env),6m(linux),32m(rootfs),89728k(userfs),512k@0x7f00000(dtb),512k@0x7f80000(bbt)ro"
249 #endif
250
251 #define CONFIG_SYS_SDRAM_BASE           PHYS_SDRAM_1
252 #define CONFIG_SYS_INIT_SP_ADDR         (CONFIG_SYS_SDRAM_BASE + 0x1000 - /* Fix this */ \
253                                         GENERATED_GBL_DATA_SIZE)
254
255 #ifdef CONFIG_CMD_IIM
256 #define CONFIG_FSL_IIM
257 #endif
258
259 #endif /* __CONFIG_H */