4 * specific parts for B&R T-Series Motherboard
6 * Copyright (C) 2013 Hannes Petermaier <oe5hpm@oevsv.at> -
7 * Bernecker & Rainer Industrieelektronik GmbH - http://www.br-automation.com
9 * SPDX-License-Identifier: GPL-2.0+
12 #ifndef __CONFIG_TSERIES_H__
13 #define __CONFIG_TSERIES_H__
15 #include <configs/bur_am335x_common.h>
16 /* ------------------------------------------------------------------------- */
17 #define CONFIG_AM335X_LCD
19 #define CONFIG_LCD_NOSTDOUT
20 #define CONFIG_SYS_WHITE_ON_BLACK
21 #define LCD_BPP LCD_COLOR32
23 #define CONFIG_HW_WATCHDOG
24 #define CONFIG_OMAP_WATCHDOG
25 #define CONFIG_SPL_WATCHDOG_SUPPORT
26 /* Bootcount using the RTC block */
27 #define CONFIG_SYS_BOOTCOUNT_ADDR 0x44E3E000
28 #define CONFIG_BOOTCOUNT_LIMIT
29 #define CONFIG_BOOTCOUNT_AM33XX
31 #define V_OSCK 26000000 /* Clock output from T2 */
32 #define V_SCLK (V_OSCK)
34 #define CONFIG_POWER_TPS65217
36 /* Support both device trees and ATAGs. */
37 #define CONFIG_OF_LIBFDT
38 #define CONFIG_USE_FDT /* use fdt within board code */
39 #define CONFIG_OF_BOARD_SETUP
40 #define CONFIG_CMDLINE_TAG
41 #define CONFIG_SETUP_MEMORY_TAGS
42 #define CONFIG_INITRD_TAG
43 #define CONFIG_CMD_BOOTZ
44 /*#define CONFIG_MACH_TYPE 3589*/
45 #define CONFIG_MACH_TYPE 0xFFFFFFFF /* TODO: check with kernel*/
48 #if defined(CONFIG_EMMC_BOOT)
50 #define CONFIG_GENERIC_MMC
51 #define CONFIG_OMAP_HSMMC
52 #define CONFIG_CMD_MMC
53 #define CONFIG_SUPPORT_EMMC_BOOT
54 /* RAW SD card / eMMC locations. */
55 #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /*addr. 0x60000 */
56 #define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x200 /* 256 KB */
57 #define CONFIG_SPL_MMC_SUPPORT
58 #endif /* CONFIG_EMMC_BOOT */
61 * When we have SPI or NAND flash we expect to be making use of mtdparts,
62 * both for ease of use in U-Boot and for passing information on to
65 #if defined(CONFIG_SPI_BOOT) || defined(CONFIG_NAND)
66 #define CONFIG_MTD_DEVICE /* Required for mtdparts */
67 #define CONFIG_CMD_MTDPARTS
68 #endif /* CONFIG_SPI_BOOT, ... */
70 #undef CONFIG_SPL_OS_BOOT
71 #ifdef CONFIG_SPL_OS_BOOT
72 #define CONFIG_SYS_SPL_ARGS_ADDR 0x80F80000
74 /* RAW SD card / eMMC */
75 #define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0x900 /* address 0x120000 */
76 #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0x80 /* address 0x10000 */
77 #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS 0x80 /* 64KiB */
81 #define CONFIG_CMD_SPL_NAND_OFS 0x080000 /* end of u-boot */
82 #define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x140000
83 #define CONFIG_CMD_SPL_WRITE_SIZE 0x2000
84 #endif /* CONFIG_NAND */
85 #endif /* CONFIG_SPL_OS_BOOT */
88 #define CONFIG_SPL_NAND_AM33XX_BCH /* OMAP4 and later ELM support */
89 #define CONFIG_SPL_NAND_SUPPORT
90 #define CONFIG_SPL_NAND_BASE
91 #define CONFIG_SPL_NAND_DRIVERS
92 #define CONFIG_SPL_NAND_ECC
93 #define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE
94 #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000
95 #endif /* CONFIG_NAND */
97 /* Always 128 KiB env size */
98 #define CONFIG_ENV_SIZE (128 << 10)
102 "mtdids=" MTDIDS_DEFAULT "\0" \
103 "mtdparts=" MTDPARTS_DEFAULT "\0" \
104 "nandargs=setenv bootargs console=${console} " \
106 "root=${nandroot} " \
107 "rootfstype=${nandrootfstype}\0" \
108 "nandroot=ubi0:rootfs rw ubi.mtd=8,2048\0" \
109 "nandrootfstype=ubifs rootwait=1\0" \
110 "nandimgsize=0x500000\0" \
111 "nandboot=echo Booting from nand ...; " \
113 "nand read ${loadaddr} kernel ${nandimgsize}; " \
114 "bootz ${loadaddr}\0"
117 #endif /* CONFIG_NAND */
124 #endif /* CONFIG_MMC */
126 #ifndef CONFIG_SPL_BUILD
127 #define CONFIG_EXTRA_ENV_SETTINGS \
129 "loadaddr=0x80200000\0" \
130 "bootfile=zImage\0" \
131 "console=ttyO0,115200n8\0" \
133 "rootpath=/tftpboot/tseries/rootfs-small\0" \
135 "netargs=setenv bootargs console=${console} " \
138 "nfsroot=${serverip}:${rootpath},${nfsopts} rw " \
140 "netboot=echo Booting from network ...; " \
141 "setenv autoload no; " \
143 "tftp ${loadaddr} ${bootfile}; " \
145 "bootm ${loadaddr}\0" \
146 "usbupdate=echo Updating UBOOT from USB-Stick ...; " \
148 "fatload usb 0 0x80000000 updateubootusb.img; " \
150 "netupdate=echo Updating UBOOT from Network (TFTP) ...; " \
151 "setenv autoload 0; " \
153 "tftp 0x80000000 updateUBOOT.img;" \
157 #endif /* !CONFIG_SPL_BUILD*/
159 #define CONFIG_BOOTCOMMAND \
161 #define CONFIG_BOOTDELAY 1 /* TODO: für release auf 0 setzen */
165 * GPMC block. We support 1 device and the physical address to
166 * access CS0 at is 0x8000000.
168 #define CONFIG_SYS_MAX_NAND_DEVICE 1
169 #define CONFIG_SYS_NAND_BASE 0x8000000
170 #define CONFIG_NAND_OMAP_GPMC
171 #define CONFIG_CMD_NAND
172 /* don't change OMAP_ELM, ECCSCHEME. ROM code only supports this */
173 #define CONFIG_NAND_OMAP_ELM
174 #define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW
175 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
176 #define CONFIG_SYS_NAND_BLOCK_SIZE (128*1024)
177 #define CONFIG_SYS_NAND_PAGE_SIZE 2048
178 #define CONFIG_SYS_NAND_PAGE_COUNT (CONFIG_SYS_NAND_BLOCK_SIZE / \
179 CONFIG_SYS_NAND_PAGE_SIZE)
180 #define CONFIG_SYS_NAND_OOBSIZE 64
181 #define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
182 #define CONFIG_SYS_NAND_ECCPOS {2, 3, 4, 5, 6, 7, 8, 9, \
183 10, 11, 12, 13, 14, 15, 16, 17, \
184 18, 19, 20, 21, 22, 23, 24, 25, \
185 26, 27, 28, 29, 30, 31, 32, 33, \
186 34, 35, 36, 37, 38, 39, 40, 41, \
187 42, 43, 44, 45, 46, 47, 48, 49, \
188 50, 51, 52, 53, 54, 55, 56, 57, }
190 #define CONFIG_SYS_NAND_ECCSIZE 512
191 #define CONFIG_SYS_NAND_ECCBYTES 14
193 #define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE
194 #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000
196 #define MTDIDS_DEFAULT "nand0=omap2-nand.0"
197 #define MTDPARTS_DEFAULT "mtdparts=omap2-nand.0:" \
199 "128k(SPL.backup1)," \
200 "128k(SPL.backup2)," \
201 "128k(SPL.backup3)," \
203 "128k(u-boot-spl-os)," \
204 "128k(u-boot-env)," \
207 #endif /* CONFIG_NAND */
209 /* USB configuration */
210 #define CONFIG_USB_MUSB_DSPS
211 #define CONFIG_ARCH_MISC_INIT
212 #define CONFIG_MUSB_PIO_ONLY
213 #define CONFIG_MUSB_DISABLE_BULK_COMBINE_SPLIT
214 /* attention! not only for gadget, enables also highspeed in hostmode */
215 #define CONFIG_USB_GADGET_DUALSPEED
216 #define CONFIG_MUSB_HOST
217 #define CONFIG_AM335X_USB0
218 #define CONFIG_AM335X_USB0_MODE MUSB_HOST
219 #define CONFIG_AM335X_USB1
220 #define CONFIG_AM335X_USB1_MODE MUSB_HOST
222 #ifdef CONFIG_MUSB_HOST
223 #define CONFIG_CMD_USB
224 #define CONFIG_USB_STORAGE
225 #endif /* CONFIG_MUSB_HOST */
227 #if defined(CONFIG_SPI_BOOT)
230 #define CONFIG_OMAP3_SPI
231 #define CONFIG_CMD_SPI
232 #define CONFIG_CMD_SF
233 #define CONFIG_SPI_FLASH
234 #define CONFIG_SPI_FLASH_STMICRO
235 #define CONFIG_SF_DEFAULT_SPEED 24000000
237 #define CONFIG_SPL_SPI_SUPPORT
238 #define CONFIG_SPL_SPI_FLASH_SUPPORT
239 #define CONFIG_SPL_SPI_LOAD
240 #define CONFIG_SYS_SPI_U_BOOT_OFFS 0x20000
241 #undef CONFIG_ENV_IS_NOWHERE
242 #define CONFIG_ENV_IS_IN_SPI_FLASH
243 #define CONFIG_SYS_REDUNDAND_ENVIRONMENT
244 #define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED
245 #define CONFIG_ENV_SECT_SIZE (4 << 10) /* 4 KB sectors */
246 #define CONFIG_ENV_OFFSET (768 << 10) /* 768 KiB in */
247 #define CONFIG_ENV_OFFSET_REDUND (896 << 10) /* 896 KiB in */
249 #elif defined(CONFIG_EMMC_BOOT)
250 #undef CONFIG_ENV_IS_NOWHERE
251 #define CONFIG_ENV_IS_IN_MMC
252 #define CONFIG_SYS_MMC_ENV_DEV 0
253 #define CONFIG_SYS_MMC_ENV_PART 2
254 #define CONFIG_ENV_OFFSET 0x40000 /* TODO: Adresse definieren */
255 #define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
256 #define CONFIG_SYS_REDUNDAND_ENVIRONMENT
258 #elif defined(CONFIG_NAND)
259 /* No NAND env support in SPL */
260 #ifdef CONFIG_SPL_BUILD
261 #define CONFIG_ENV_IS_NOWHERE
263 #define CONFIG_ENV_IS_IN_NAND
265 #define CONFIG_ENV_OFFSET 0x120000 /* TODO: Adresse definieren */
266 #define CONFIG_SYS_ENV_SECT_SIZE CONFIG_ENV_SIZE
268 #error "no storage for Environment defined!"
271 * Common filesystems support. When we have removable storage we
272 * enabled a number of useful commands and support.
274 #if defined(CONFIG_MMC) || defined(CONFIG_USB_STORAGE)
275 #define CONFIG_DOS_PARTITION
276 #define CONFIG_CMD_FAT
277 #define CONFIG_FAT_WRITE
278 #define CONFIG_FS_EXT4
279 #define CONFIG_EXT4_WRITE
280 #define CONFIG_CMD_EXT4
281 #define CONFIG_CMD_EXT4_WRITE
282 #define CONFIG_CMD_FS_GENERIC
283 #endif /* CONFIG_MMC, ... */
285 #endif /* ! __CONFIG_TSERIES_H__ */