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
24 #define V_OSCK 26000000 /* Clock output from T2 */
25 #define V_SCLK (V_OSCK)
27 #define CONFIG_POWER_TPS65217
29 /* Support both device trees and ATAGs. */
30 #define CONFIG_OF_LIBFDT
31 #define CONFIG_USE_FDT /* use fdt within board code */
32 #define CONFIG_OF_BOARD_SETUP
33 #define CONFIG_CMDLINE_TAG
34 #define CONFIG_SETUP_MEMORY_TAGS
35 #define CONFIG_INITRD_TAG
36 #define CONFIG_CMD_BOOTZ
37 /*#define CONFIG_MACH_TYPE 3589*/
38 #define CONFIG_MACH_TYPE 0xFFFFFFFF /* TODO: check with kernel*/
41 #if defined(CONFIG_EMMC_BOOT)
43 #define CONFIG_GENERIC_MMC
44 #define CONFIG_OMAP_HSMMC
45 #define CONFIG_CMD_MMC
46 #define CONFIG_SUPPORT_EMMC_BOOT
47 /* RAW SD card / eMMC locations. */
48 #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /*addr. 0x60000 */
49 #define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x200 /* 256 KB */
50 #define CONFIG_SPL_MMC_SUPPORT
51 #endif /* CONFIG_EMMC_BOOT */
54 * When we have SPI or NAND flash we expect to be making use of mtdparts,
55 * both for ease of use in U-Boot and for passing information on to
58 #if defined(CONFIG_SPI_BOOT) || defined(CONFIG_NAND)
59 #define CONFIG_MTD_DEVICE /* Required for mtdparts */
60 #define CONFIG_CMD_MTDPARTS
61 #endif /* CONFIG_SPI_BOOT, ... */
63 #undef CONFIG_SPL_OS_BOOT
64 #ifdef CONFIG_SPL_OS_BOOT
65 #define CONFIG_SYS_SPL_ARGS_ADDR 0x80F80000
67 /* RAW SD card / eMMC */
68 #define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0x900 /* address 0x120000 */
69 #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0x80 /* address 0x10000 */
70 #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS 0x80 /* 64KiB */
74 #define CONFIG_CMD_SPL_NAND_OFS 0x080000 /* end of u-boot */
75 #define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x140000
76 #define CONFIG_CMD_SPL_WRITE_SIZE 0x2000
77 #endif /* CONFIG_NAND */
78 #endif /* CONFIG_SPL_OS_BOOT */
81 #define CONFIG_SPL_NAND_AM33XX_BCH /* OMAP4 and later ELM support */
82 #define CONFIG_SPL_NAND_SUPPORT
83 #define CONFIG_SPL_NAND_BASE
84 #define CONFIG_SPL_NAND_DRIVERS
85 #define CONFIG_SPL_NAND_ECC
86 #define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE
87 #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000
88 #endif /* CONFIG_NAND */
90 /* Always 128 KiB env size */
91 #define CONFIG_ENV_SIZE (128 << 10)
95 "mtdids=" MTDIDS_DEFAULT "\0" \
96 "mtdparts=" MTDPARTS_DEFAULT "\0" \
97 "nandargs=setenv bootargs console=${console} " \
100 "rootfstype=${nandrootfstype}\0" \
101 "nandroot=ubi0:rootfs rw ubi.mtd=8,2048\0" \
102 "nandrootfstype=ubifs rootwait=1\0" \
103 "nandimgsize=0x500000\0" \
104 "nandboot=echo Booting from nand ...; " \
106 "nand read ${loadaddr} kernel ${nandimgsize}; " \
107 "bootz ${loadaddr}\0"
110 #endif /* CONFIG_NAND */
117 #endif /* CONFIG_MMC */
119 #ifndef CONFIG_SPL_BUILD
120 #define CONFIG_EXTRA_ENV_SETTINGS \
122 "loadaddr=0x80200000\0" \
123 "bootfile=zImage\0" \
124 "console=ttyO0,115200n8\0" \
126 "rootpath=/tftpboot/tseries/rootfs-small\0" \
128 "netargs=setenv bootargs console=${console} " \
131 "nfsroot=${serverip}:${rootpath},${nfsopts} rw " \
133 "netboot=echo Booting from network ...; " \
134 "setenv autoload no; " \
136 "tftp ${loadaddr} ${bootfile}; " \
138 "bootm ${loadaddr}\0" \
139 "usbupdate=echo Updating UBOOT from USB-Stick ...; " \
141 "fatload usb 0 0x80000000 updateubootusb.img; " \
143 "netupdate=echo Updating UBOOT from Network (TFTP) ...; " \
144 "setenv autoload 0; " \
146 "tftp 0x80000000 updateUBOOT.img;" \
150 #endif /* !CONFIG_SPL_BUILD*/
152 #define CONFIG_BOOTCOMMAND \
154 #define CONFIG_BOOTDELAY 1 /* TODO: für release auf 0 setzen */
158 * GPMC block. We support 1 device and the physical address to
159 * access CS0 at is 0x8000000.
161 #define CONFIG_SYS_MAX_NAND_DEVICE 1
162 #define CONFIG_SYS_NAND_BASE 0x8000000
163 #define CONFIG_NAND_OMAP_GPMC
164 #define CONFIG_CMD_NAND
165 /* don't change OMAP_ELM, ECCSCHEME. ROM code only supports this */
166 #define CONFIG_NAND_OMAP_ELM
167 #define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW
168 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
169 #define CONFIG_SYS_NAND_BLOCK_SIZE (128*1024)
170 #define CONFIG_SYS_NAND_PAGE_SIZE 2048
171 #define CONFIG_SYS_NAND_PAGE_COUNT (CONFIG_SYS_NAND_BLOCK_SIZE / \
172 CONFIG_SYS_NAND_PAGE_SIZE)
173 #define CONFIG_SYS_NAND_OOBSIZE 64
174 #define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
175 #define CONFIG_SYS_NAND_ECCPOS {2, 3, 4, 5, 6, 7, 8, 9, \
176 10, 11, 12, 13, 14, 15, 16, 17, \
177 18, 19, 20, 21, 22, 23, 24, 25, \
178 26, 27, 28, 29, 30, 31, 32, 33, \
179 34, 35, 36, 37, 38, 39, 40, 41, \
180 42, 43, 44, 45, 46, 47, 48, 49, \
181 50, 51, 52, 53, 54, 55, 56, 57, }
183 #define CONFIG_SYS_NAND_ECCSIZE 512
184 #define CONFIG_SYS_NAND_ECCBYTES 14
186 #define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE
187 #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000
189 #define MTDIDS_DEFAULT "nand0=omap2-nand.0"
190 #define MTDPARTS_DEFAULT "mtdparts=omap2-nand.0:" \
192 "128k(SPL.backup1)," \
193 "128k(SPL.backup2)," \
194 "128k(SPL.backup3)," \
196 "128k(u-boot-spl-os)," \
197 "128k(u-boot-env)," \
200 #endif /* CONFIG_NAND */
202 /* USB configuration */
203 #define CONFIG_USB_MUSB_DSPS
204 #define CONFIG_ARCH_MISC_INIT
205 #define CONFIG_MUSB_PIO_ONLY
206 #define CONFIG_MUSB_DISABLE_BULK_COMBINE_SPLIT
207 /* attention! not only for gadget, enables also highspeed in hostmode */
208 #define CONFIG_USB_GADGET_DUALSPEED
209 #define CONFIG_MUSB_HOST
210 #define CONFIG_AM335X_USB0
211 #define CONFIG_AM335X_USB0_MODE MUSB_HOST
212 #define CONFIG_AM335X_USB1
213 #define CONFIG_AM335X_USB1_MODE MUSB_HOST
215 #ifdef CONFIG_MUSB_HOST
216 #define CONFIG_CMD_USB
217 #define CONFIG_USB_STORAGE
218 #endif /* CONFIG_MUSB_HOST */
220 #if defined(CONFIG_SPI_BOOT)
223 #define CONFIG_OMAP3_SPI
224 #define CONFIG_CMD_SPI
225 #define CONFIG_CMD_SF
226 #define CONFIG_SPI_FLASH
227 #define CONFIG_SPI_FLASH_STMICRO
228 #define CONFIG_SF_DEFAULT_SPEED 24000000
230 #define CONFIG_SPL_SPI_SUPPORT
231 #define CONFIG_SPL_SPI_FLASH_SUPPORT
232 #define CONFIG_SPL_SPI_LOAD
233 #define CONFIG_SYS_SPI_U_BOOT_OFFS 0x20000
234 #undef CONFIG_ENV_IS_NOWHERE
235 #define CONFIG_ENV_IS_IN_SPI_FLASH
236 #define CONFIG_SYS_REDUNDAND_ENVIRONMENT
237 #define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED
238 #define CONFIG_ENV_SECT_SIZE (4 << 10) /* 4 KB sectors */
239 #define CONFIG_ENV_OFFSET (768 << 10) /* 768 KiB in */
240 #define CONFIG_ENV_OFFSET_REDUND (896 << 10) /* 896 KiB in */
242 #elif defined(CONFIG_EMMC_BOOT)
243 #undef CONFIG_ENV_IS_NOWHERE
244 #define CONFIG_ENV_IS_IN_MMC
245 #define CONFIG_SYS_MMC_ENV_DEV 0
246 #define CONFIG_SYS_MMC_ENV_PART 2
247 #define CONFIG_ENV_OFFSET 0x40000 /* TODO: Adresse definieren */
248 #define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
249 #define CONFIG_SYS_REDUNDAND_ENVIRONMENT
251 #elif defined(CONFIG_NAND)
252 /* No NAND env support in SPL */
253 #ifdef CONFIG_SPL_BUILD
254 #define CONFIG_ENV_IS_NOWHERE
256 #define CONFIG_ENV_IS_IN_NAND
258 #define CONFIG_ENV_OFFSET 0x120000 /* TODO: Adresse definieren */
259 #define CONFIG_SYS_ENV_SECT_SIZE CONFIG_ENV_SIZE
261 #error "no storage for Environment defined!"
264 * Common filesystems support. When we have removable storage we
265 * enabled a number of useful commands and support.
267 #if defined(CONFIG_MMC) || defined(CONFIG_USB_STORAGE)
268 #define CONFIG_DOS_PARTITION
269 #define CONFIG_CMD_FAT
270 #define CONFIG_FAT_WRITE
271 #define CONFIG_CMD_FS_GENERIC
272 #endif /* CONFIG_MMC, ... */
274 #endif /* ! __CONFIG_TSERIES_H__ */