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