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