blob: 8e073e06890682cd790bbed58a4d53feade26501 [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 Petermaierdf770942015-02-03 13:22:29 +010026/* Bootcount using the RTC block */
27#define CONFIG_SYS_BOOTCOUNT_ADDR 0x44E3E000
28#define CONFIG_BOOTCOUNT_LIMIT
29#define CONFIG_BOOTCOUNT_AM33XX
Hannes Petermaier893c04e2014-02-07 08:07:36 +010030/* Clock Defines */
31#define V_OSCK 26000000 /* Clock output from T2 */
32#define V_SCLK (V_OSCK)
33
34#define CONFIG_POWER_TPS65217
35
36/* Support both device trees and ATAGs. */
37#define CONFIG_OF_LIBFDT
Hannes Petermaierfbd5aed2015-02-03 13:22:26 +010038#define CONFIG_USE_FDT /* use fdt within board code */
39#define CONFIG_OF_BOARD_SETUP
Hannes Petermaier893c04e2014-02-07 08:07:36 +010040#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*/
46
47/* MMC/SD IP block */
48#if defined(CONFIG_EMMC_BOOT)
49 #define CONFIG_MMC
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 */
59
60/*
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
63 * the Linux kernel.
64 */
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, ... */
69
70#undef CONFIG_SPL_OS_BOOT
71#ifdef CONFIG_SPL_OS_BOOT
72#define CONFIG_SYS_SPL_ARGS_ADDR 0x80F80000
73
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 */
78
79/* NAND */
80#ifdef CONFIG_NAND
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 */
86
87#ifdef CONFIG_NAND
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 */
96
97/* Always 128 KiB env size */
98#define CONFIG_ENV_SIZE (128 << 10)
99
100#ifdef CONFIG_NAND
101#define NANDARGS \
102 "mtdids=" MTDIDS_DEFAULT "\0" \
103 "mtdparts=" MTDPARTS_DEFAULT "\0" \
104 "nandargs=setenv bootargs console=${console} " \
105 "${optargs} " \
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 ...; " \
112 "run nandargs; " \
113 "nand read ${loadaddr} kernel ${nandimgsize}; " \
114 "bootz ${loadaddr}\0"
115#else
116#define NANDARGS ""
117#endif /* CONFIG_NAND */
118
119#ifdef CONFIG_MMC
120#define MMCARGS \
121 "silent=1\0"
122#else
123#define MMCARGS ""
124#endif /* CONFIG_MMC */
125
126#ifndef CONFIG_SPL_BUILD
127#define CONFIG_EXTRA_ENV_SETTINGS \
Hannes Petermaier7ae47f62015-02-03 13:22:34 +0100128BUR_COMMON_ENV \
129"autoload=0\0" \
130NANDARGS \
131MMCARGS
Hannes Petermaier893c04e2014-02-07 08:07:36 +0100132#endif /* !CONFIG_SPL_BUILD*/
133
134#define CONFIG_BOOTCOMMAND \
135 "run mmcboot1;"
136#define CONFIG_BOOTDELAY 1 /* TODO: für release auf 0 setzen */
137
138#ifdef CONFIG_NAND
139/*
140 * GPMC block. We support 1 device and the physical address to
141 * access CS0 at is 0x8000000.
142 */
143#define CONFIG_SYS_MAX_NAND_DEVICE 1
144#define CONFIG_SYS_NAND_BASE 0x8000000
145#define CONFIG_NAND_OMAP_GPMC
146#define CONFIG_CMD_NAND
147/* don't change OMAP_ELM, ECCSCHEME. ROM code only supports this */
148#define CONFIG_NAND_OMAP_ELM
149#define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW
Hannes Petermaier893c04e2014-02-07 08:07:36 +0100150#define CONFIG_SYS_NAND_5_ADDR_CYCLE
151#define CONFIG_SYS_NAND_BLOCK_SIZE (128*1024)
152#define CONFIG_SYS_NAND_PAGE_SIZE 2048
153#define CONFIG_SYS_NAND_PAGE_COUNT (CONFIG_SYS_NAND_BLOCK_SIZE / \
154 CONFIG_SYS_NAND_PAGE_SIZE)
155#define CONFIG_SYS_NAND_OOBSIZE 64
156#define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
157#define CONFIG_SYS_NAND_ECCPOS {2, 3, 4, 5, 6, 7, 8, 9, \
158 10, 11, 12, 13, 14, 15, 16, 17, \
159 18, 19, 20, 21, 22, 23, 24, 25, \
160 26, 27, 28, 29, 30, 31, 32, 33, \
161 34, 35, 36, 37, 38, 39, 40, 41, \
162 42, 43, 44, 45, 46, 47, 48, 49, \
163 50, 51, 52, 53, 54, 55, 56, 57, }
164
165#define CONFIG_SYS_NAND_ECCSIZE 512
166#define CONFIG_SYS_NAND_ECCBYTES 14
167
168#define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE
169#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000
170
171#define MTDIDS_DEFAULT "nand0=omap2-nand.0"
172#define MTDPARTS_DEFAULT "mtdparts=omap2-nand.0:" \
173 "128k(SPL)," \
174 "128k(SPL.backup1)," \
175 "128k(SPL.backup2)," \
176 "128k(SPL.backup3)," \
177 "512k(u-boot)," \
178 "128k(u-boot-spl-os)," \
179 "128k(u-boot-env)," \
180 "5m(kernel),"\
181 "-(rootfs)"
182#endif /* CONFIG_NAND */
183
184/* USB configuration */
185#define CONFIG_USB_MUSB_DSPS
186#define CONFIG_ARCH_MISC_INIT
187#define CONFIG_MUSB_PIO_ONLY
188#define CONFIG_MUSB_DISABLE_BULK_COMBINE_SPLIT
189/* attention! not only for gadget, enables also highspeed in hostmode */
190#define CONFIG_USB_GADGET_DUALSPEED
191#define CONFIG_MUSB_HOST
192#define CONFIG_AM335X_USB0
193#define CONFIG_AM335X_USB0_MODE MUSB_HOST
194#define CONFIG_AM335X_USB1
195#define CONFIG_AM335X_USB1_MODE MUSB_HOST
196
197#ifdef CONFIG_MUSB_HOST
198#define CONFIG_CMD_USB
199#define CONFIG_USB_STORAGE
200#endif /* CONFIG_MUSB_HOST */
201
202#if defined(CONFIG_SPI_BOOT)
203/* McSPI IP block */
204#define CONFIG_SPI
205#define CONFIG_OMAP3_SPI
206#define CONFIG_CMD_SPI
207#define CONFIG_CMD_SF
208#define CONFIG_SPI_FLASH
209#define CONFIG_SPI_FLASH_STMICRO
210#define CONFIG_SF_DEFAULT_SPEED 24000000
211
212#define CONFIG_SPL_SPI_SUPPORT
213#define CONFIG_SPL_SPI_FLASH_SUPPORT
214#define CONFIG_SPL_SPI_LOAD
Hannes Petermaier893c04e2014-02-07 08:07:36 +0100215#define CONFIG_SYS_SPI_U_BOOT_OFFS 0x20000
216#undef CONFIG_ENV_IS_NOWHERE
217#define CONFIG_ENV_IS_IN_SPI_FLASH
218#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
219#define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED
220#define CONFIG_ENV_SECT_SIZE (4 << 10) /* 4 KB sectors */
221#define CONFIG_ENV_OFFSET (768 << 10) /* 768 KiB in */
222#define CONFIG_ENV_OFFSET_REDUND (896 << 10) /* 896 KiB in */
223
224#elif defined(CONFIG_EMMC_BOOT)
225#undef CONFIG_ENV_IS_NOWHERE
226#define CONFIG_ENV_IS_IN_MMC
Hannes Petermaier46c8ebc2014-04-08 08:39:20 +0200227#define CONFIG_SYS_MMC_ENV_DEV 0
Hannes Petermaier893c04e2014-02-07 08:07:36 +0100228#define CONFIG_SYS_MMC_ENV_PART 2
229#define CONFIG_ENV_OFFSET 0x40000 /* TODO: Adresse definieren */
230#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
231#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
232
233#elif defined(CONFIG_NAND)
Tom Rinie017fd62014-07-18 11:51:33 -0400234/* No NAND env support in SPL */
235#ifdef CONFIG_SPL_BUILD
236#define CONFIG_ENV_IS_NOWHERE
237#else
Hannes Petermaier893c04e2014-02-07 08:07:36 +0100238#define CONFIG_ENV_IS_IN_NAND
Tom Rinie017fd62014-07-18 11:51:33 -0400239#endif
Hannes Petermaier893c04e2014-02-07 08:07:36 +0100240#define CONFIG_ENV_OFFSET 0x120000 /* TODO: Adresse definieren */
241#define CONFIG_SYS_ENV_SECT_SIZE CONFIG_ENV_SIZE
242#else
243#error "no storage for Environment defined!"
244#endif
245/*
246 * Common filesystems support. When we have removable storage we
247 * enabled a number of useful commands and support.
248 */
249#if defined(CONFIG_MMC) || defined(CONFIG_USB_STORAGE)
250#define CONFIG_DOS_PARTITION
251#define CONFIG_CMD_FAT
252#define CONFIG_FAT_WRITE
Hannes Petermaierc05c2962015-02-03 13:22:30 +0100253#define CONFIG_FS_EXT4
254#define CONFIG_EXT4_WRITE
255#define CONFIG_CMD_EXT4
256#define CONFIG_CMD_EXT4_WRITE
Hannes Petermaier893c04e2014-02-07 08:07:36 +0100257#define CONFIG_CMD_FS_GENERIC
258#endif /* CONFIG_MMC, ... */
259
260#endif /* ! __CONFIG_TSERIES_H__ */