]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - include/configs/tx51.h
config: rename CONFIG_MX* to CONFIG_SOC_MX*
[karo-tx-uboot.git] / include / configs / tx51.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
12 #include <linux/sizes.h>
13 #include <asm/arch/imx-regs.h>
14
15 /*
16  * Ka-Ro TX51 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 #if CONFIG_SYS_CPU_CLK == 600
30 #define TX51_MOD_PREFIX                 "6"
31 #elif CONFIG_SYS_CPU_CLK == 800
32 #define TX51_MOD_PREFIX                 "8"
33 #define CONFIG_MX51_PLL_ERRATA
34 #else
35 #error Invalid CPU clock
36 #endif
37
38 /* LCD Logo and Splash screen support */
39 #ifdef CONFIG_LCD
40 #define CONFIG_SPLASH_SCREEN
41 #define CONFIG_SPLASH_SCREEN_ALIGN
42 #define CONFIG_VIDEO_IPUV3
43 #define CONFIG_IPUV3_CLK                133000000
44 #define CONFIG_LCD_LOGO
45 #define LCD_BPP                         LCD_COLOR32
46 #define CONFIG_CMD_BMP
47 #define CONFIG_VIDEO_BMP_RLE8
48 #endif /* CONFIG_LCD */
49
50 /*
51  * Memory configuration options
52  */
53 #define PHYS_SDRAM_1                    0x90000000      /* Base address of bank 1 */
54 #define PHYS_SDRAM_1_SIZE               SZ_128M
55 #if CONFIG_NR_DRAM_BANKS > 1
56 #define PHYS_SDRAM_2                    0x98000000      /* Base address of bank 2 */
57 #define PHYS_SDRAM_2_SIZE               SZ_128M
58 #endif
59 #define CONFIG_STACKSIZE                SZ_128K
60 #define CONFIG_SYS_MALLOC_LEN           SZ_8M
61 #define CONFIG_SYS_MEMTEST_START        PHYS_SDRAM_1    /* Memtest start address */
62 #define CONFIG_SYS_MEMTEST_END          (PHYS_SDRAM_1 + SZ_4M)  /* 4 MB RAM test */
63 #define CONFIG_SYS_SDRAM_CLK            166
64 #define CONFIG_SYS_CLKTL_CBCDR          0x01e35100
65
66 /*
67  * U-Boot general configurations
68  */
69 #define CONFIG_SYS_LONGHELP
70 #define CONFIG_SYS_PROMPT               "TX51 U-Boot > "
71 #define CONFIG_SYS_CBSIZE               2048    /* Console I/O buffer size */
72 #define CONFIG_SYS_PBSIZE \
73         (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
74                                                 /* Print buffer size */
75 #define CONFIG_SYS_MAXARGS              256     /* Max number of command args */
76 #define CONFIG_SYS_BARGSIZE             CONFIG_SYS_CBSIZE
77                                                 /* Boot argument buffer size */
78 #define CONFIG_VERSION_VARIABLE                 /* U-BOOT version */
79 #define CONFIG_AUTO_COMPLETE                    /* Command auto complete */
80 #define CONFIG_CMDLINE_EDITING                  /* Command history etc */
81
82 #define CONFIG_SYS_64BIT_VSPRINTF
83
84 /*
85  * Flattened Device Tree (FDT) support
86 */
87
88 /*
89  * Boot Linux
90  */
91 #define xstr(s)                         str(s)
92 #define str(s)                          #s
93 #define __pfx(x, s)                     (x##s)
94 #define _pfx(x, s)                      __pfx(x, s)
95
96 #define CONFIG_CMDLINE_TAG
97 #define CONFIG_SETUP_MEMORY_TAGS
98 #define CONFIG_BOOTDELAY                3
99 #define CONFIG_ZERO_BOOTDELAY_CHECK
100 #define CONFIG_SYS_AUTOLOAD             "no"
101 #define CONFIG_BOOTFILE                 "uImage"
102 #define CONFIG_BOOTARGS                 "init=/linuxrc console=ttymxc0,115200 ro debug panic=1"
103 #define CONFIG_BOOTCOMMAND              "run bootcmd_${boot_mode} bootm_cmd"
104 #define CONFIG_LOADADDR                 94000000
105 #define CONFIG_FDTADDR                  91000000
106 #define CONFIG_SYS_LOAD_ADDR            _pfx(0x, CONFIG_LOADADDR)
107 #define CONFIG_SYS_FDT_ADDR             _pfx(0x, CONFIG_FDTADDR)
108 #define CONFIG_U_BOOT_IMG_SIZE          SZ_1M
109
110 /*
111  * Extra Environment Settings
112  */
113 #define CONFIG_SYS_CPU_CLK_STR          xstr(CONFIG_SYS_CPU_CLK)
114
115 #define CONFIG_EXTRA_ENV_SETTINGS                                       \
116         "autostart=no\0"                                                \
117         "baseboard=stk5-v3\0"                                           \
118         "bootargs_jffs2=run default_bootargs;set bootargs ${bootargs}"  \
119         " root=/dev/mtdblock3 rootfstype=jffs2\0"                       \
120         "bootargs_mmc=run default_bootargs;set bootargs ${bootargs}"    \
121         " root=/dev/mmcblk0p2 rootwait\0"                               \
122         "bootargs_nfs=run default_bootargs;set bootargs ${bootargs}"    \
123         " root=/dev/nfs nfsroot=${nfs_server}:${nfsroot},nolock"        \
124         " ip=dhcp\0"                                                    \
125         "bootargs_ubifs=run default_bootargs;set bootargs ${bootargs}"  \
126         " ubi.mtd=rootfs root=ubi0:rootfs rootfstype=ubifs\0"           \
127         "bootcmd_jffs2=set autostart no;run bootargs_jffs2"             \
128         ";nboot linux\0"                                                \
129         "bootcmd_mmc=set autostart no;run bootargs_mmc"                 \
130         ";fatload mmc 0 ${loadaddr} uImage\0"                           \
131         "bootcmd_nand=set autostart no;run bootargs_ubifs"              \
132         ";nboot linux\0"                                                \
133         "bootcmd_net=set autoload y;set autostart n;run bootargs_nfs"   \
134         ";dhcp\0"                                                       \
135         "bootm_cmd=bootm ${loadaddr} - ${fdtaddr}\0"                    \
136         "boot_mode=nand\0"                                              \
137         "cpu_clk=" CONFIG_SYS_CPU_CLK_STR "\0"                          \
138         "default_bootargs=set bootargs " CONFIG_BOOTARGS                \
139         " ${append_bootargs}\0"                                         \
140         "fdtaddr=" xstr(CONFIG_FDTADDR) "\0"                            \
141         "fdtsave=fdt resize;nand erase.part dtb"                        \
142         ";nand write ${fdtaddr} dtb ${fdtsize}\0"                       \
143         "mtdids=" MTDIDS_DEFAULT "\0"                                   \
144         "mtdparts=" MTDPARTS_DEFAULT "\0"                               \
145         "nfsroot=/tftpboot/rootfs\0"                                    \
146         "otg_mode=device\0"                                             \
147         "touchpanel=tsc2007\0"                                          \
148         "video_mode=VGA\0"
149
150 #define MTD_NAME                        "mxc_nand"
151 #define MTDIDS_DEFAULT                  "nand0=" MTD_NAME
152
153 /*
154  * Serial Driver
155  */
156 #define CONFIG_MXC_UART
157 #define CONFIG_MXC_UART_BASE            UART1_BASE
158 #define CONFIG_MXC_GPIO
159 #define CONFIG_BAUDRATE                 115200          /* Default baud rate */
160 #define CONFIG_SYS_BAUDRATE_TABLE       { 9600, 19200, 38400, 57600, 115200, }
161 #define CONFIG_SYS_CONSOLE_INFO_QUIET
162
163 /*
164  * Ethernet Driver
165  */
166 #ifdef CONFIG_FEC_MXC
167 #define IMX_FEC_BASE                    FEC_BASE_ADDR
168 #define CONFIG_FEC_XCV_TYPE             MII100
169 #endif
170
171 /*
172  * NAND flash driver
173  */
174 #ifdef CONFIG_CMD_NAND
175 #define CONFIG_MXC_NAND_REGS_BASE       NFC_BASE_ADDR_AXI
176 #define CONFIG_MXC_NAND_IP_REGS_BASE    NFC_BASE_ADDR
177 #define CONFIG_MXC_NAND_HWECC
178 #define CONFIG_SYS_NAND_MAX_CHIPS       0x1
179 #define CONFIG_SYS_MAX_NAND_DEVICE      0x1
180 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
181 #ifdef CONFIG_ENV_IS_IN_NAND
182 #define CONFIG_ENV_OVERWRITE
183 #define CONFIG_ENV_OFFSET               CONFIG_U_BOOT_IMG_SIZE
184 #define CONFIG_ENV_SIZE                 0x20000 /* 128 KiB */
185 #define CONFIG_ENV_RANGE                0x60000
186 #endif
187 #define CONFIG_SYS_NAND_BASE            0x00000000
188 #endif /* CONFIG_CMD_NAND */
189
190 /*
191  * MMC Driver
192  */
193 #ifdef CONFIG_CMD_MMC
194 #ifndef CONFIG_ENV_IS_IN_NAND
195 #endif
196 #define CONFIG_SYS_FSL_ESDHC_ADDR       0
197
198 #define CONFIG_CMD_FAT
199 #define CONFIG_FAT_WRITE
200 #define CONFIG_CMD_EXT2
201
202 /*
203  * Environments on MMC
204  */
205 #ifdef CONFIG_ENV_IS_IN_MMC
206 #define CONFIG_SYS_MMC_ENV_DEV          0
207 #define CONFIG_ENV_OVERWRITE
208 /* Associated with the MMC layout defined in mmcops.c */
209 #define CONFIG_ENV_OFFSET               SZ_1K
210 #define CONFIG_ENV_SIZE                 (SZ_128K - CONFIG_ENV_OFFSET)
211 #define CONFIG_DYNAMIC_MMC_DEVNO
212 #endif /* CONFIG_ENV_IS_IN_MMC */
213 #endif /* CONFIG_CMD_MMC */
214
215 #ifdef CONFIG_ENV_OFFSET_REDUND
216 #define MTDPARTS_DEFAULT                "mtdparts=" MTD_NAME ":"        \
217         "1m(u-boot),"                                                   \
218         xstr(CONFIG_ENV_RANGE)                                          \
219         "(env),"                                                        \
220         xstr(CONFIG_ENV_RANGE)                                          \
221         "(env2),6m(linux),32m(rootfs),89344k(userfs),512k@0x7f00000(dtb),512k@0x7f80000(bbt)ro"
222 #else
223 #define MTDPARTS_DEFAULT                "mtdparts=" MTD_NAME ":"        \
224         "1m(u-boot),"                                                   \
225         xstr(CONFIG_ENV_RANGE)                                          \
226         "(env),6m(linux),32m(rootfs),89728k(userfs),512k@0x7f00000(dtb),512k@0x7f80000(bbt)ro"
227 #endif
228
229 #define CONFIG_SYS_SDRAM_BASE           PHYS_SDRAM_1
230 #define CONFIG_SYS_INIT_SP_ADDR         (CONFIG_SYS_SDRAM_BASE + 0x1000 - /* Fix this */ \
231                                         GENERATED_GBL_DATA_SIZE)
232
233 #ifdef CONFIG_CMD_IIM
234 #define CONFIG_FSL_IIM
235 #endif
236
237 #endif /* __CONFIG_H */