]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - include/configs/tx48.h
f3f8f8f78929785c1213a0d40e5240994470b41d
[karo-tx-uboot.git] / include / configs / tx48.h
1 /*
2  * tx48.h
3  *
4  * Copyright (C) 2012-2014 Lothar Waßmann <LW@KARO-electronics.de>
5  *
6  * based on: am335x_evm
7  * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
8  *
9  * SPDX-License-Identifier:      GPL-2.0
10  *
11  */
12
13 #ifndef __CONFIG_H
14 #define __CONFIG_H
15
16 #define CONFIG_AM33XX                   /* must be set before including omap.h */
17
18 #include <linux/sizes.h>
19 #include <asm/arch/omap.h>
20
21 /*
22  * Ka-Ro TX48 board - SoC configuration
23  */
24 #define CONFIG_OMAP
25 #define CONFIG_AM33XX_GPIO
26 #define CONFIG_SYS_HZ                   1000    /* Ticks per second */
27
28 #ifndef CONFIG_SPL_BUILD
29 #define CONFIG_SKIP_LOWLEVEL_INIT
30 #define CONFIG_SHOW_ACTIVITY
31 #define CONFIG_DISPLAY_CPUINFO
32 #define CONFIG_DISPLAY_BOARDINFO
33 #define CONFIG_BOARD_LATE_INIT
34 #define CONFIG_SYS_GENERIC_BOARD
35
36 /* LCD Logo and Splash screen support */
37 #define CONFIG_LCD
38 #ifdef CONFIG_LCD
39 #define CONFIG_VIDEO_DA8XX
40 #define CONFIG_SPLASH_SCREEN
41 #define CONFIG_SPLASH_SCREEN_ALIGN
42 #define CONFIG_AM335X_LCD
43 #define DAVINCI_LCD_CNTL_BASE           0x4830e000
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 #endif /* CONFIG_SPL_BUILD */
50
51 /* Clock Defines */
52 #define V_OSCK                          24000000  /* Clock output from T2 */
53 #define V_SCLK                          V_OSCK
54
55 /*
56  * Memory configuration options
57  */
58 #define CONFIG_SYS_SDRAM_DDR3
59 #define CONFIG_NR_DRAM_BANKS            0x1             /* '1' would be converted to 'y' by define2mk.sed */
60 #define PHYS_SDRAM_1                    0x80000000      /* SDRAM Bank #1 */
61 #define CONFIG_MAX_RAM_BANK_SIZE        SZ_1G
62
63 #define CONFIG_STACKSIZE                SZ_64K
64 #define CONFIG_SYS_MALLOC_LEN           SZ_4M
65
66 #define CONFIG_SYS_MEMTEST_START        (PHYS_SDRAM_1 + SZ_64M)
67 #define CONFIG_SYS_MEMTEST_END          (CONFIG_SYS_MEMTEST_START + SZ_8M)
68
69 #define CONFIG_SYS_CACHELINE_SIZE       64
70
71 /*
72  * U-Boot general configurations
73  */
74 #define CONFIG_SYS_LONGHELP
75 #define CONFIG_SYS_PROMPT               "TX48 U-Boot > "
76 #define CONFIG_SYS_CBSIZE               2048    /* Console I/O buffer size */
77 #define CONFIG_SYS_PBSIZE \
78         (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
79                                                 /* Print buffer size */
80 #define CONFIG_SYS_MAXARGS              256     /* Max number of command args */
81 #define CONFIG_SYS_BARGSIZE             CONFIG_SYS_CBSIZE
82                                                 /* Boot argument buffer size */
83 #define CONFIG_VERSION_VARIABLE                 /* U-BOOT version */
84 #define CONFIG_AUTO_COMPLETE                    /* Command auto complete */
85 #define CONFIG_CMDLINE_EDITING                  /* Command history etc */
86
87 #define CONFIG_SYS_64BIT_VSPRINTF
88
89 /*
90  * Flattened Device Tree (FDT) support
91 */
92
93 /*
94  * Boot Linux
95  */
96 #define xstr(s)                         str(s)
97 #define str(s)                          #s
98 #define __pfx(x, s)                     (x##s)
99 #define _pfx(x, s)                      __pfx(x, s)
100
101 #define CONFIG_CMDLINE_TAG
102 #define CONFIG_SETUP_MEMORY_TAGS
103 #define CONFIG_BOOTDELAY                3
104 #define CONFIG_ZERO_BOOTDELAY_CHECK
105 #define CONFIG_SYS_AUTOLOAD             "no"
106 #define CONFIG_BOOTFILE                 "uImage"
107 #define CONFIG_BOOTARGS                 "init=/linuxrc console=ttyO0,115200 ro debug panic=1"
108 #define CONFIG_BOOTCOMMAND              "run bootcmd_${boot_mode} bootm_cmd"
109 #define CONFIG_LOADADDR                 83000000
110 #define CONFIG_FDTADDR                  81000000
111 #define CONFIG_SYS_LOAD_ADDR            _pfx(0x, CONFIG_LOADADDR)
112 #define CONFIG_SYS_FDT_ADDR             _pfx(0x, CONFIG_FDTADDR)
113 #define CONFIG_U_BOOT_IMG_SIZE          SZ_1M
114
115 /*
116  * Extra Environment Settings
117  */
118 #define CONFIG_SYS_CPU_CLK_STR          xstr(CONFIG_SYS_MPU_CLK)
119
120 #define CONFIG_EXTRA_ENV_SETTINGS                                       \
121         "autostart=no\0"                                                \
122         "baseboard=stk5-v3\0"                                           \
123         "bootargs_jffs2=run default_bootargs;set bootargs ${bootargs}"  \
124         " root=/dev/mtdblock4 rootfstype=jffs2\0"                       \
125         "bootargs_mmc=run default_bootargs;set bootargs ${bootargs}"    \
126         " root=/dev/mmcblk0p2 rootwait\0"                               \
127         "bootargs_nfs=run default_bootargs;set bootargs ${bootargs}"    \
128         " root=/dev/nfs nfsroot=${nfs_server}:${nfsroot},nolock"        \
129         " ip=dhcp\0"                                                    \
130         "bootargs_ubifs=run default_bootargs;set bootargs ${bootargs}"  \
131         " ubi.mtd=rootfs root=ubi0:rootfs rootfstype=ubifs\0"           \
132         "bootcmd_jffs2=set autostart no;run bootargs_jffs2"             \
133         ";nboot linux\0"                                                \
134         "bootcmd_mmc=set autostart no;run bootargs_mmc"                 \
135         ";fatload mmc 0 ${loadaddr} uImage\0"                           \
136         "bootcmd_nand=set autostart no;run bootargs_ubifs"              \
137         ";nboot linux\0"                                                \
138         "bootcmd_net=set autoload y;set autostart n;run bootargs_nfs"   \
139         ";dhcp\0"                                                       \
140         "bootm_cmd=bootm ${loadaddr} - ${fdtaddr}\0"                    \
141         "boot_mode=nand\0"                                              \
142         "cpu_clk=" CONFIG_SYS_CPU_CLK_STR "\0"                          \
143         "default_bootargs=set bootargs " CONFIG_BOOTARGS                \
144         " ${append_bootargs}\0"                                         \
145         "fdtaddr=" xstr(CONFIG_FDTADDR) "\0"                            \
146         "fdtsave=fdt resize;nand erase.part dtb"                        \
147         ";nand write ${fdtaddr} dtb ${fdtsize}\0"                       \
148         "mtdids=" MTDIDS_DEFAULT "\0"                                   \
149         "mtdparts=" MTDPARTS_DEFAULT "\0"                               \
150         "nfsroot=/tftpboot/rootfs\0"                                    \
151         "otg_mode=device\0"                                             \
152         "touchpanel=tsc2007\0"                                          \
153         "video_mode=VGA\0"
154
155 #define MTD_NAME                        "omap2-nand.0"
156 #define MTDIDS_DEFAULT                  "nand0=" MTD_NAME
157
158 /*
159  * U-Boot Commands
160  */
161 #include <config_cmd_default.h>
162
163 /*
164  * Serial Driver
165  */
166 #define CONFIG_SYS_NS16550
167 #define CONFIG_SYS_NS16550_SERIAL
168 #define CONFIG_SYS_NS16550_MEM32
169 #define CONFIG_SYS_NS16550_REG_SIZE     (-4)
170 #define CONFIG_SYS_NS16550_CLK          48000000
171 #define CONFIG_SYS_NS16550_COM1         0x44e09000      /* UART0 */
172 #define CONFIG_SYS_NS16550_COM2         0x48022000      /* UART1 */
173 #define CONFIG_SYS_NS16550_COM6         0x481aa000      /* UART5 */
174
175 #define CONFIG_SYS_NS16550_COM3         0x481aa000      /* UART2 */
176 #define CONFIG_SYS_NS16550_COM4         0x481aa000      /* UART3 */
177 #define CONFIG_SYS_NS16550_COM5         0x481aa000      /* UART4 */
178 #define CONFIG_CONS_INDEX               1               /* one based! */
179 #define CONFIG_BAUDRATE                 115200          /* Default baud rate */
180 #define CONFIG_SYS_BAUDRATE_TABLE       { 9600, 19200, 38400, 57600, 115200, }
181 #define CONFIG_SYS_CONSOLE_INFO_QUIET
182
183 /*
184  * Ethernet Driver
185  */
186 #ifdef CONFIG_CMD_NET
187 #define CONFIG_DRIVER_TI_CPSW
188 #define CONFIG_PHY_GIGE
189 #define CONFIG_CMD_MII
190 /* Add for working with "strict" DHCP server */
191 #define CONFIG_BOOTP_SUBNETMASK
192 #define CONFIG_BOOTP_GATEWAY
193 #define CONFIG_BOOTP_DNS
194 #define CONFIG_BOOTP_DNS2
195 #endif
196
197 /*
198  * NAND flash driver
199  */
200 #ifdef CONFIG_NAND
201 #define CONFIG_NAND_OMAP_GPMC
202 #ifndef CONFIG_SPL_BUILD
203 #define CONFIG_SYS_GPMC_PREFETCH_ENABLE
204 #endif
205 #define GPMC_NAND_ECC_LP_x8_LAYOUT
206 #define GPMC_NAND_HW_ECC_LAYOUT_KERNEL  GPMC_NAND_HW_ECC_LAYOUT
207 #define CONFIG_SYS_NAND_U_BOOT_OFFS     0x20000
208 #define CONFIG_SYS_NAND_PAGE_SIZE       2048
209 #define CONFIG_SYS_NAND_OOBSIZE         64
210 #define CONFIG_SYS_NAND_ECCSIZE         512
211 #define CONFIG_SYS_NAND_ECCBYTES        14
212 #define CONFIG_SYS_NAND_MAX_CHIPS       0x1
213 #define CONFIG_SYS_NAND_MAXBAD          20 /* Max. number of bad blocks guaranteed by manufacturer */
214 #define CONFIG_SYS_MAX_NAND_DEVICE      0x1
215 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
216 #ifdef CONFIG_ENV_IS_IN_NAND
217 #define CONFIG_ENV_OVERWRITE
218 #define CONFIG_ENV_OFFSET               (CONFIG_U_BOOT_IMG_SIZE + CONFIG_SYS_NAND_U_BOOT_OFFS)
219 #define CONFIG_ENV_SIZE                 SZ_128K
220 #define CONFIG_ENV_RANGE                0x60000
221 #endif /* CONFIG_ENV_IS_IN_NAND */
222 #define CONFIG_SYS_NAND_BASE            0x00100000
223 #define CONFIG_SYS_NAND_SIZE            SZ_128M
224 #define NAND_BASE                       CONFIG_SYS_NAND_BASE
225 #endif /* CONFIG_CMD_NAND */
226
227 /*
228  * MMC Driver
229  */
230 #ifdef CONFIG_CMD_MMC
231 #define CONFIG_OMAP_HSMMC
232 #define CONFIG_OMAP_MMC_DEV_1
233
234 #define CONFIG_CMD_FAT
235 #define CONFIG_FAT_WRITE
236 #define CONFIG_CMD_EXT2
237
238 /*
239  * Environments on MMC
240  */
241 #ifdef CONFIG_ENV_IS_IN_MMC
242 #define CONFIG_SYS_MMC_ENV_DEV          0
243 #define CONFIG_ENV_OVERWRITE
244 /* Associated with the MMC layout defined in mmcops.c */
245 #define CONFIG_ENV_OFFSET               SZ_1K
246 #define CONFIG_ENV_SIZE                 (SZ_128K - CONFIG_ENV_OFFSET)
247 #define CONFIG_DYNAMIC_MMC_DEVNO
248 #endif /* CONFIG_ENV_IS_IN_MMC */
249 #endif /* CONFIG_CMD_MMC */
250
251 #ifdef CONFIG_ENV_IS_NOWHERE
252 #define CONFIG_ENV_SIZE                 SZ_4K
253 #endif
254
255 #ifdef CONFIG_ENV_OFFSET_REDUND
256 #define MTDPARTS_DEFAULT                "mtdparts=" MTD_NAME ":"        \
257         "128k(u-boot-spl),"                                             \
258         "1m(u-boot),"                                                   \
259         xstr(CONFIG_ENV_RANGE)                                          \
260         "(env),"                                                        \
261         xstr(CONFIG_ENV_RANGE)                                          \
262         "(env2),6m(linux),32m(rootfs),89216k(userfs),512k@0x7f00000(dtb),512k@0x7f80000(bbt)ro"
263 #else
264 #define MTDPARTS_DEFAULT                "mtdparts=" MTD_NAME ":"        \
265         "128k(u-boot-spl),"                                             \
266         "1m(u-boot),"                                                   \
267         xstr(CONFIG_ENV_RANGE)                                          \
268         "(env),6m(linux),32m(rootfs),89600k(userfs),512k@0x7f00000(dtb),512k@0x7f80000(bbt)ro"
269 #endif
270
271 #define CONFIG_SYS_SDRAM_BASE           PHYS_SDRAM_1
272 #define SRAM0_SIZE                      SZ_64K
273 #define OCMC_SRAM_BASE                  0x40300000
274 #define CONFIG_SPL_STACK                (OCMC_SRAM_BASE + 0xb800)
275 #define CONFIG_SYS_INIT_SP_ADDR         (PHYS_SDRAM_1 + SZ_32K)
276
277  /* Platform/Board specific defs */
278 #define CONFIG_SYS_TIMERBASE            0x48040000      /* Use Timer2 */
279 #define CONFIG_SYS_PTV                  2       /* Divisor: 2^(PTV+1) => 8 */
280
281 /* Defines for SPL */
282 #define CONFIG_SPL_FRAMEWORK
283 #define CONFIG_SPL_MAX_SIZE             (SRAM_SCRATCH_SPACE_ADDR - CONFIG_SPL_TEXT_BASE)
284 #define CONFIG_SPL_GPIO_SUPPORT
285 #ifdef CONFIG_NAND_OMAP_GPMC
286 #define CONFIG_SPL_NAND_SUPPORT
287 #define CONFIG_SPL_NAND_DRIVERS
288 #define CONFIG_SPL_NAND_BASE
289 #define CONFIG_SPL_NAND_ECC
290 #define CONFIG_SPL_NAND_AM33XX_BCH
291 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
292 #define CONFIG_SYS_NAND_PAGE_COUNT      (CONFIG_SYS_NAND_BLOCK_SIZE /   \
293                                         CONFIG_SYS_NAND_PAGE_SIZE)
294 #define CONFIG_SYS_NAND_BLOCK_SIZE      SZ_128K
295 #define CONFIG_SYS_NAND_BAD_BLOCK_POS   NAND_LARGE_BADBLOCK_POS
296 #define CONFIG_SYS_NAND_ECCPOS          { 2, 3, 4, 5, 6, 7, 8, 9, \
297                                          10, 11, 12, 13, 14, 15, 16, 17, \
298                                          18, 19, 20, 21, 22, 23, 24, 25, \
299                                          26, 27, 28, 29, 30, 31, 32, 33, \
300                                          34, 35, 36, 37, 38, 39, 40, 41, \
301                                          42, 43, 44, 45, 46, 47, 48, 49, \
302                                          50, 51, 52, 53, 54, 55, 56, 57, }
303 #endif
304
305 #define CONFIG_SPL_BSS_START_ADDR       PHYS_SDRAM_1
306 #define CONFIG_SPL_BSS_MAX_SIZE         SZ_512K
307
308 #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x60000 */
309
310 #define CONFIG_SPL_LIBCOMMON_SUPPORT
311 #define CONFIG_SPL_LIBGENERIC_SUPPORT
312 #define CONFIG_SPL_SERIAL_SUPPORT
313 #define CONFIG_SPL_YMODEM_SUPPORT
314 #define CONFIG_SPL_LDSCRIPT             "$(CPUDIR)/omap-common/u-boot-spl.lds"
315
316 /*
317  * 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM
318  * 64 bytes before this address should be set aside for u-boot.img's
319  * header. That is 0x800FFFC0--0x80100000 should not be used for any
320  * other needs.
321  */
322 #define CONFIG_SYS_SPL_MALLOC_START     (PHYS_SDRAM_1 + SZ_2M + SZ_32K)
323 #define CONFIG_SYS_SPL_MALLOC_SIZE      SZ_1M
324
325 #endif  /* __CONFIG_H */