blob: dd30df27b05b2d12144a14e4f1d4f6c8969e9b6f [file] [log] [blame]
Hannes Petermaier072cefe2014-02-07 14:06:50 +01001/*
2 * kwb.h
3 *
4 * specific parts for B&R KWB 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_KWB_H__
13#define __CONFIG_KWB_H__
14
15#include <configs/bur_am335x_common.h>
16/* ------------------------------------------------------------------------- */
Hannes Petermaiercf630f22015-02-03 13:22:39 +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
Hannes Petermaier072cefe2014-02-07 14:06:50 +010022/* Clock Defines */
23#define V_OSCK 26000000 /* Clock output from T2 */
24#define V_SCLK (V_OSCK)
25
26#define CONFIG_POWER_TPS65217
27
28#define CONFIG_MACH_TYPE 3589
29/* I2C IP block */
30#define CONFIG_SYS_OMAP24_I2C_SPEED_PSOC 20000
31
32/* GPIO */
33#define CONFIG_SPL_GPIO_SUPPORT
34
35/* MMC/SD IP block */
36#define CONFIG_MMC
37#define CONFIG_GENERIC_MMC
38#define CONFIG_OMAP_HSMMC
39#define CONFIG_CMD_MMC
40#define CONFIG_SUPPORT_EMMC_BOOT
41/* RAW SD card / eMMC locations. */
42#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /*addr. 0x60000 */
43#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x200 /* 256 KB */
44#define CONFIG_SPL_MMC_SUPPORT
45
Hannes Petermaierd2eb73d2015-02-03 13:22:41 +010046/* Always 64 KiB env size */
47#define CONFIG_ENV_SIZE (64 << 10)
Hannes Petermaier072cefe2014-02-07 14:06:50 +010048
49#ifndef CONFIG_SPL_BUILD
50#define CONFIG_EXTRA_ENV_SETTINGS \
Hannes Petermaierd2eb73d2015-02-03 13:22:41 +010051BUR_COMMON_ENV \
52"vx_romfsbase=0x800E0000\0" \
53"vx_romfssize=0x20000\0" \
54"vx_memtop=0x8FBEF000\0" \
55"loadromfs=mmc read ${vx_romfsbase} 700 100\0" \
56"autoload=0\0" \
57"loadaddr=0x80100000\0" \
58"logoaddr=0x82000000\0" \
59"defaultARlen=0x8000\0" \
60"loaddefaultAR=mmc read ${loadaddr} 800 ${defaultARlen}\0" \
61"defaultAR=run loadromfs; run loaddefaultAR; go ${loadaddr}\0" \
62"logo0=fatload mmc 0:1 ${logoaddr} SYSTEM/ADDON/Bootlogo/Bootlogo.bmp.gz && " \
63 "bmp display ${logoaddr} 0 0\0" \
64"logo1=fatload mmc 0:1 ${logoaddr} SYSTEM/BASE/Bootlogo/Bootlogo.bmp.gz && " \
65 "bmp display ${logoaddr} 0 0\0" \
66"mmcboot=echo booting AR from eMMC-flash ...; "\
67 "run logo0 || run logo1; " \
68 "run loadromfs; " \
69 "fatload mmc 0:1 ${loadaddr} arimg && go ${loadaddr}; " \
70 "run defaultAR;\0" \
71"netboot=echo booting AR from network ...; " \
72 "run loadromfs; " \
73 "tftp ${loadaddr} arimg && go ${loadaddr}; " \
74 "puts 'networkboot failed!';\0" \
75"usbupdate=echo updating u-boot from usb ...; " \
76 "usb start; " \
77 "fatload usb 0 0x80000000 updateubootusb.img && source; " \
78 "puts 'usbupdate failed!'\0" \
79"netscript=echo running script from network (tftp) ...; " \
80 "tftp 0x80000000 netscript.img && source; " \
81 "puts 'netscript load failed!'\0" \
82"netupdate=tftp ${loadddr} MLO && mmc write ${loadaddr} 100 100; " \
83 "tftp ${loadaddr} u-boot.img && mmc write ${loadaddr} 300 300\0" \
84"netupdatedefaultAR=echo updating defaultAR from network (tftp) ...; " \
85 "if tftp 0x80100000 arimg.bin; " \
86 "then mmc write 0x80100000 800 ${defaultARlen}; " \
87 "else setcurs 1 8; puts 'defAR update failed (tftp)!'; fi;\0" \
88"netupdateROMFS=echo updating romfs from network (tftp) ...; " \
89 "if tftp 0x80100000 romfs.bin; " \
90 "then mmc write 0x80100000 700 100; " \
91 "else setcurs 1 8; puts 'romfs update failed (tftp)!'; fi;\0"
92
Hannes Petermaier072cefe2014-02-07 14:06:50 +010093#endif /* !CONFIG_SPL_BUILD*/
94
95#define CONFIG_BOOTCOMMAND \
96 "run usbupdate;"
Hannes Petermaierd2eb73d2015-02-03 13:22:41 +010097#define CONFIG_BOOTDELAY 0
Hannes Petermaier072cefe2014-02-07 14:06:50 +010098
99/* undefine command which we not need here */
Hannes Petermaier072cefe2014-02-07 14:06:50 +0100100#undef CONFIG_BOOTM_NETBSD
101#undef CONFIG_BOOTM_PLAN9
102#undef CONFIG_BOOTM_RTEMS
Hannes Petermaierc8184562015-02-03 13:22:40 +0100103#undef CONFIG_CMD_CRC32
104
105/* Support both device trees and ATAGs. */
106#define CONFIG_OF_LIBFDT
107#define CONFIG_CMDLINE_TAG
108#define CONFIG_SETUP_MEMORY_TAGS
109#define CONFIG_INITRD_TAG
110#define CONFIG_CMD_BOOTZ
Hannes Petermaier072cefe2014-02-07 14:06:50 +0100111
112/* USB configuration */
113#define CONFIG_USB_MUSB_DSPS
114#define CONFIG_ARCH_MISC_INIT
115#define CONFIG_MUSB_PIO_ONLY
116#define CONFIG_MUSB_DISABLE_BULK_COMBINE_SPLIT
117/* attention! not only for gadget, enables also highspeed in hostmode */
118#define CONFIG_USB_GADGET_DUALSPEED
119#define CONFIG_MUSB_HOST
120#define CONFIG_AM335X_USB0
121#define CONFIG_AM335X_USB0_MODE MUSB_HOST
Hannes Petermaiercf630f22015-02-03 13:22:39 +0100122#define CONFIG_AM335X_USB1
123#define CONFIG_AM335X_USB1_MODE MUSB_HOST
Hannes Petermaier072cefe2014-02-07 14:06:50 +0100124
125#ifdef CONFIG_MUSB_HOST
126#define CONFIG_CMD_USB
127#define CONFIG_USB_STORAGE
128#endif /* CONFIG_MUSB_HOST */
129
130#undef CONFIG_ENV_IS_NOWHERE
131#define CONFIG_ENV_IS_IN_MMC
Hannes Petermaier46c8ebc2014-04-08 08:39:20 +0200132#define CONFIG_SYS_MMC_ENV_DEV 0
Hannes Petermaier072cefe2014-02-07 14:06:50 +0100133#define CONFIG_SYS_MMC_ENV_PART 2
134#define CONFIG_ENV_OFFSET 0x40000 /* TODO: Adresse definieren */
135#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
136#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
137/*
138 * Common filesystems support. When we have removable storage we
139 * enabled a number of useful commands and support.
140 */
141#if defined(CONFIG_MMC) || defined(CONFIG_USB_STORAGE)
142#define CONFIG_DOS_PARTITION
143#define CONFIG_CMD_FAT
144#define CONFIG_FAT_WRITE
145#define CONFIG_CMD_FS_GENERIC
146#endif /* CONFIG_MMC, ... */
147
148#endif /* ! __CONFIG_TSERIES_H__ */