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