]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - include/configs/tx53.h
karo: fdt: fix panel-dpi support
[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 #define CONFIG_CMD_GPIO
29
30 /* LCD Logo and Splash screen support */
31 #ifdef CONFIG_LCD
32 #define CONFIG_SPLASH_SCREEN
33 #define CONFIG_SPLASH_SCREEN_ALIGN
34 #define CONFIG_VIDEO_IPUV3
35 #define CONFIG_IPUV3_CLK                200000000
36 #define CONFIG_LCD_LOGO
37 #define LCD_BPP                         LCD_COLOR32
38 #define CONFIG_CMD_BMP
39 #define CONFIG_VIDEO_BMP_RLE8
40 #endif /* CONFIG_LCD */
41
42 /*
43  * Memory configuration options
44  */
45 #ifndef CONFIG_SYS_SDRAM_SIZE
46 #define CONFIG_SYS_SDRAM_SIZE           (SZ_512M * CONFIG_NR_DRAM_BANKS)
47 #endif
48
49 #define PHYS_SDRAM_1                    0x70000000      /* Base address of bank 1 */
50 #define PHYS_SDRAM_1_SIZE               (CONFIG_SYS_SDRAM_SIZE / CONFIG_NR_DRAM_BANKS)
51 #if CONFIG_NR_DRAM_BANKS > 1
52 #define PHYS_SDRAM_2                    0xb0000000      /* Base address of bank 2 */
53 #define PHYS_SDRAM_2_SIZE               PHYS_SDRAM_1_SIZE
54 #endif
55 #define CONFIG_STACKSIZE                SZ_128K
56 #define CONFIG_SYS_MALLOC_LEN           SZ_8M
57 #define CONFIG_SYS_MEMTEST_START        PHYS_SDRAM_1    /* Memtest start address */
58 #define CONFIG_SYS_MEMTEST_END          (CONFIG_SYS_MEMTEST_START + SZ_4M)
59 #define CONFIG_SYS_SDRAM_CLK            400
60
61 /*
62  * U-Boot general configurations
63  */
64 #define CONFIG_SYS_LONGHELP
65 #define CONFIG_SYS_CBSIZE               2048    /* Console I/O buffer size */
66 #define CONFIG_SYS_PBSIZE \
67         (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
68                                                 /* Print buffer size */
69 #define CONFIG_SYS_MAXARGS              256     /* Max number of command args */
70 #define CONFIG_SYS_BARGSIZE             CONFIG_SYS_CBSIZE
71                                                 /* Boot argument buffer size */
72 #define CONFIG_VERSION_VARIABLE                 /* U-BOOT version */
73 #define CONFIG_AUTO_COMPLETE                    /* Command auto complete */
74 #define CONFIG_CMDLINE_EDITING                  /* Command history etc */
75
76 #define CONFIG_SYS_64BIT_VSPRINTF
77
78 /*
79  * Flattened Device Tree (FDT) support
80 */
81
82 /*
83  * Boot Linux
84  */
85 #define xstr(s)                         str(s)
86 #define str(s)                          #s
87 #define __pfx(x, s)                     (x##s)
88 #define _pfx(x, s)                      __pfx(x, s)
89
90 #define CONFIG_CMDLINE_TAG
91 #define CONFIG_SETUP_MEMORY_TAGS
92 #define CONFIG_BOOTDELAY                3
93 #define CONFIG_ZERO_BOOTDELAY_CHECK
94 #define CONFIG_SYS_AUTOLOAD             "no"
95 #define CONFIG_BOOTFILE                 "uImage"
96 #define CONFIG_BOOTARGS                 "init=/linuxrc console=ttymxc0,115200 ro debug panic=1"
97 #define CONFIG_BOOTCOMMAND              "run bootcmd_${boot_mode} bootm_cmd"
98 #define CONFIG_LOADADDR                 78000000
99 #define CONFIG_FDTADDR                  71000000
100 #define CONFIG_SYS_LOAD_ADDR            _pfx(0x, CONFIG_LOADADDR)
101 #define CONFIG_SYS_FDT_ADDR             _pfx(0x, CONFIG_FDTADDR)
102 #define CONFIG_U_BOOT_IMG_SIZE          SZ_1M
103 #ifndef CONFIG_SYS_LVDS_IF
104 #define DEFAULT_VIDEO_MODE              "VGA"
105 #else
106 #define DEFAULT_VIDEO_MODE              "HSD100PXN1"
107 #endif
108
109 /*
110  * Extra Environment Settings
111  */
112 #ifdef CONFIG_TX53_UBOOT_NOENV
113 #define CONFIG_EXTRA_ENV_SETTINGS                                       \
114         "autostart=no\0"                                                \
115         "autoload=no\0"                                                 \
116         "baseboard=stk5-v3\0"                                           \
117         "bootdelay=-1\0"                                                \
118         "fdtaddr=" xstr(CONFIG_FDTADDR) "\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"                           \
126         ";setenv bootargs ${bootargs}"                                  \
127         " root=/dev/mtdblock3 rootfstype=jffs2\0"                       \
128         "bootargs_mmc=run default_bootargs;setenv bootargs ${bootargs}" \
129         " root=/dev/mmcblk0p2 rootwait\0"                               \
130         "bootargs_nfs=run default_bootargs;setenv bootargs ${bootargs}" \
131         " root=/dev/nfs nfsroot=${nfs_server}:${nfsroot},nolock"        \
132         " ip=dhcp\0"                                                    \
133         "bootargs_ubifs=run default_bootargs"                           \
134         ";setenv bootargs ${bootargs}"                                  \
135         " ubi.mtd=rootfs root=ubi0:rootfs rootfstype=ubifs\0"           \
136         "bootcmd_jffs2=setenv autostart no;run bootargs_jffs2"          \
137         ";nboot linux\0"                                                \
138         "bootcmd_mmc=setenv autostart no;run bootargs_mmc"              \
139         ";fatload mmc 0 ${loadaddr} uImage\0"                           \
140         "bootcmd_nand=setenv autostart no;run bootargs_ubifs"           \
141         ";nboot linux\0"                                                \
142         "bootcmd_net=setenv autoload y"                                 \
143         ";setenv autostart n;run bootargs_nfs"                          \
144         ";dhcp\0"                                                       \
145         "bootm_cmd=bootm ${loadaddr} - ${fdtaddr}\0"                    \
146         "boot_mode=nand\0"                                              \
147         "cpu_clk=800\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=" DEFAULT_VIDEO_MODE "\0"
159 #endif /*  CONFIG_TX53_UBOOT_NOENV */
160
161 #define MTD_NAME                        "mxc_nand"
162 #define MTDIDS_DEFAULT                  "nand0=" MTD_NAME
163
164 /*
165  * Serial Driver
166  */
167 #define CONFIG_MXC_UART
168 #define CONFIG_MXC_UART_BASE            UART1_BASE
169 #define CONFIG_BAUDRATE                 115200          /* Default baud rate */
170 #define CONFIG_SYS_BAUDRATE_TABLE       { 9600, 19200, 38400, 57600, 115200, }
171 #define CONFIG_SYS_CONSOLE_INFO_QUIET
172
173 /*
174  * GPIO driver
175  */
176 #define CONFIG_MXC_GPIO
177
178 /*
179  * Ethernet Driver
180  */
181 #ifdef CONFIG_FEC_MXC
182 #define IMX_FEC_BASE                    FEC_BASE_ADDR
183 #define CONFIG_FEC_MXC_PHYADDR          0
184 #define CONFIG_FEC_XCV_TYPE             MII100
185 #endif
186
187 /*
188  * I2C Configs
189  */
190 #ifdef CONFIG_CMD_I2C
191 #define CONFIG_I2C_MXC
192 #define CONFIG_SYS_I2C_BASE             I2C1_BASE_ADDR
193 #define CONFIG_SYS_I2C_SPEED            400000
194 #define CONFIG_SYS_I2C_SLAVE            0x34
195 #endif
196
197 /*
198  * NAND flash driver
199  */
200 #ifdef CONFIG_CMD_NAND
201 #define CONFIG_MXC_NAND_REGS_BASE       NFC_BASE_ADDR_AXI
202 #define CONFIG_MXC_NAND_IP_REGS_BASE    NFC_BASE_ADDR
203 #define CONFIG_MXC_NAND_HWECC
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 #ifdef CONFIG_ENV_IS_IN_NAND
208 #define CONFIG_ENV_OVERWRITE
209 #define CONFIG_ENV_OFFSET               CONFIG_U_BOOT_IMG_SIZE
210 #define CONFIG_ENV_SIZE                 0x20000 /* 128 KiB */
211 #define CONFIG_ENV_RANGE                0x60000
212 #endif
213 #define CONFIG_SYS_NAND_BASE            0x00000000
214 #endif /* CONFIG_CMD_NAND */
215
216 /*
217  * MMC Driver
218  */
219 #ifdef CONFIG_FSL_ESDHC
220 #define CONFIG_SYS_FSL_ESDHC_ADDR       0
221
222 #define CONFIG_CMD_FAT
223 #define CONFIG_FAT_WRITE
224 #define CONFIG_CMD_EXT2
225
226 /*
227  * Environments on MMC
228  */
229 #ifdef CONFIG_ENV_IS_IN_MMC
230 #define CONFIG_SYS_MMC_ENV_DEV          0
231 #define CONFIG_ENV_OVERWRITE
232 /* Associated with the MMC layout defined in mmcops.c */
233 #define CONFIG_ENV_OFFSET               SZ_1K
234 #define CONFIG_ENV_SIZE                 (SZ_128K - CONFIG_ENV_OFFSET)
235 #define CONFIG_DYNAMIC_MMC_DEVNO
236 #endif /* CONFIG_ENV_IS_IN_MMC */
237 #endif /* CONFIG_CMD_MMC */
238
239 #ifdef CONFIG_ENV_OFFSET_REDUND
240 #define MTDPARTS_DEFAULT                "mtdparts=" MTD_NAME ":"        \
241         "1m(u-boot),"                                                   \
242         xstr(CONFIG_ENV_RANGE)                                          \
243         "(env),"                                                        \
244         xstr(CONFIG_ENV_RANGE)                                          \
245         "(env2),6m(linux),32m(rootfs),89344k(userfs),512k@0x7f00000(dtb),512k@0x7f80000(bbt)ro"
246 #else
247 #define MTDPARTS_DEFAULT                "mtdparts=" MTD_NAME ":"        \
248         "1m(u-boot),"                                                   \
249         xstr(CONFIG_ENV_RANGE)                                          \
250         "(env),6m(linux),32m(rootfs),89728k(userfs),512k@0x7f00000(dtb),512k@0x7f80000(bbt)ro"
251 #endif
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 #ifdef CONFIG_CMD_IIM
258 #define CONFIG_FSL_IIM
259 #endif
260
261 #endif /* __CONFIG_H */