Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 1 | /* |
| 2 | * kwb.h |
| 3 | * |
| 4 | * specific parts for B&R KWB Motherboard |
| 5 | * |
Hannes Schmelzer | 7935f03 | 2015-05-28 15:41:12 +0200 | [diff] [blame] | 6 | * Copyright (C) 2013 Hannes Schmelzer <oe5hpm@oevsv.at> - |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 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 | |
Hannes Schmelzer | 27bf441 | 2016-02-19 12:09:45 +0100 | [diff] [blame] | 15 | #include <configs/bur_cfg_common.h> |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 16 | #include <configs/bur_am335x_common.h> |
| 17 | /* ------------------------------------------------------------------------- */ |
Hannes Petermaier | c96a9b1 | 2015-02-03 13:22:39 +0100 | [diff] [blame] | 18 | #define CONFIG_AM335X_LCD |
| 19 | #define CONFIG_LCD |
| 20 | #define CONFIG_LCD_NOSTDOUT |
| 21 | #define CONFIG_SYS_WHITE_ON_BLACK |
| 22 | #define LCD_BPP LCD_COLOR32 |
Hannes Petermaier | 4c4398d | 2015-04-24 14:49:38 +0200 | [diff] [blame] | 23 | |
| 24 | #define CONFIG_VIDEO_BMP_GZIP |
| 25 | #define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (1366*767*4) |
| 26 | #define CONFIG_CMD_UNZIP |
| 27 | #define CONFIG_CMD_BMP |
| 28 | #define CONFIG_BMP_24BMP |
| 29 | #define CONFIG_BMP_32BPP |
| 30 | |
Hannes Schmelzer | 27bf441 | 2016-02-19 12:09:45 +0100 | [diff] [blame] | 31 | /* memory */ |
| 32 | #define CONFIG_SYS_MALLOC_LEN (5 * 1024 * 1024) |
| 33 | |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 34 | /* Clock Defines */ |
| 35 | #define V_OSCK 26000000 /* Clock output from T2 */ |
| 36 | #define V_SCLK (V_OSCK) |
| 37 | |
| 38 | #define CONFIG_POWER_TPS65217 |
| 39 | |
| 40 | #define CONFIG_MACH_TYPE 3589 |
| 41 | /* I2C IP block */ |
| 42 | #define CONFIG_SYS_OMAP24_I2C_SPEED_PSOC 20000 |
| 43 | |
| 44 | /* GPIO */ |
| 45 | #define CONFIG_SPL_GPIO_SUPPORT |
| 46 | |
| 47 | /* MMC/SD IP block */ |
| 48 | #define CONFIG_MMC |
| 49 | #define CONFIG_GENERIC_MMC |
| 50 | #define CONFIG_OMAP_HSMMC |
| 51 | #define CONFIG_CMD_MMC |
| 52 | #define CONFIG_SUPPORT_EMMC_BOOT |
| 53 | /* RAW SD card / eMMC locations. */ |
| 54 | #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /*addr. 0x60000 */ |
| 55 | #define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x200 /* 256 KB */ |
| 56 | #define CONFIG_SPL_MMC_SUPPORT |
| 57 | |
Hannes Petermaier | 44799f4 | 2015-02-03 13:22:41 +0100 | [diff] [blame] | 58 | /* Always 64 KiB env size */ |
| 59 | #define CONFIG_ENV_SIZE (64 << 10) |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 60 | |
| 61 | #ifndef CONFIG_SPL_BUILD |
| 62 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
Hannes Petermaier | 44799f4 | 2015-02-03 13:22:41 +0100 | [diff] [blame] | 63 | BUR_COMMON_ENV \ |
Hannes Petermaier | 73914df | 2015-09-29 08:43:33 +0200 | [diff] [blame] | 64 | "bootaddr=0x80001100\0" \ |
| 65 | "bootdev=cpsw(0,0)\0" \ |
Hannes Petermaier | 44799f4 | 2015-02-03 13:22:41 +0100 | [diff] [blame] | 66 | "vx_romfsbase=0x800E0000\0" \ |
| 67 | "vx_romfssize=0x20000\0" \ |
| 68 | "vx_memtop=0x8FBEF000\0" \ |
| 69 | "loadromfs=mmc read ${vx_romfsbase} 700 100\0" \ |
| 70 | "autoload=0\0" \ |
| 71 | "loadaddr=0x80100000\0" \ |
| 72 | "logoaddr=0x82000000\0" \ |
| 73 | "defaultARlen=0x8000\0" \ |
| 74 | "loaddefaultAR=mmc read ${loadaddr} 800 ${defaultARlen}\0" \ |
Hannes Petermaier | 73914df | 2015-09-29 08:43:33 +0200 | [diff] [blame] | 75 | "defaultAR=run loadromfs; run loaddefaultAR; bootvx ${loadaddr}\0" \ |
Hannes Petermaier | 44799f4 | 2015-02-03 13:22:41 +0100 | [diff] [blame] | 76 | "logo0=fatload mmc 0:1 ${logoaddr} SYSTEM/ADDON/Bootlogo/Bootlogo.bmp.gz && " \ |
| 77 | "bmp display ${logoaddr} 0 0\0" \ |
| 78 | "logo1=fatload mmc 0:1 ${logoaddr} SYSTEM/BASE/Bootlogo/Bootlogo.bmp.gz && " \ |
| 79 | "bmp display ${logoaddr} 0 0\0" \ |
| 80 | "mmcboot=echo booting AR from eMMC-flash ...; "\ |
| 81 | "run logo0 || run logo1; " \ |
| 82 | "run loadromfs; " \ |
Hannes Petermaier | 73914df | 2015-09-29 08:43:33 +0200 | [diff] [blame] | 83 | "fatload mmc 0:1 ${loadaddr} arimg && bootvx ${loadaddr}; " \ |
Hannes Petermaier | 44799f4 | 2015-02-03 13:22:41 +0100 | [diff] [blame] | 84 | "run defaultAR;\0" \ |
| 85 | "netboot=echo booting AR from network ...; " \ |
| 86 | "run loadromfs; " \ |
Hannes Petermaier | 73914df | 2015-09-29 08:43:33 +0200 | [diff] [blame] | 87 | "tftp ${loadaddr} arimg && bootvx ${loadaddr}; " \ |
Hannes Petermaier | 44799f4 | 2015-02-03 13:22:41 +0100 | [diff] [blame] | 88 | "puts 'networkboot failed!';\0" \ |
Hannes Petermaier | 44799f4 | 2015-02-03 13:22:41 +0100 | [diff] [blame] | 89 | "netscript=echo running script from network (tftp) ...; " \ |
| 90 | "tftp 0x80000000 netscript.img && source; " \ |
| 91 | "puts 'netscript load failed!'\0" \ |
| 92 | "netupdate=tftp ${loadddr} MLO && mmc write ${loadaddr} 100 100; " \ |
| 93 | "tftp ${loadaddr} u-boot.img && mmc write ${loadaddr} 300 300\0" \ |
| 94 | "netupdatedefaultAR=echo updating defaultAR from network (tftp) ...; " \ |
| 95 | "if tftp 0x80100000 arimg.bin; " \ |
| 96 | "then mmc write 0x80100000 800 ${defaultARlen}; " \ |
| 97 | "else setcurs 1 8; puts 'defAR update failed (tftp)!'; fi;\0" \ |
| 98 | "netupdateROMFS=echo updating romfs from network (tftp) ...; " \ |
| 99 | "if tftp 0x80100000 romfs.bin; " \ |
| 100 | "then mmc write 0x80100000 700 100; " \ |
| 101 | "else setcurs 1 8; puts 'romfs update failed (tftp)!'; fi;\0" |
| 102 | |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 103 | #endif /* !CONFIG_SPL_BUILD*/ |
| 104 | |
| 105 | #define CONFIG_BOOTCOMMAND \ |
Hannes Petermaier | 9826773 | 2015-04-24 14:49:39 +0200 | [diff] [blame] | 106 | "run usbscript;" |
Hannes Petermaier | 44799f4 | 2015-02-03 13:22:41 +0100 | [diff] [blame] | 107 | #define CONFIG_BOOTDELAY 0 |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 108 | |
| 109 | /* undefine command which we not need here */ |
Hannes Schmelzer | 220597d | 2016-02-19 12:09:46 +0100 | [diff] [blame] | 110 | #undef CONFIG_BOOTM_NETBSD |
| 111 | #undef CONFIG_BOOTM_PLAN9 |
| 112 | #undef CONFIG_BOOTM_RTEMS |
Hannes Petermaier | 5637977 | 2015-02-03 13:22:40 +0100 | [diff] [blame] | 113 | |
| 114 | /* Support both device trees and ATAGs. */ |
Hannes Petermaier | 5637977 | 2015-02-03 13:22:40 +0100 | [diff] [blame] | 115 | #define CONFIG_CMDLINE_TAG |
| 116 | #define CONFIG_SETUP_MEMORY_TAGS |
| 117 | #define CONFIG_INITRD_TAG |
| 118 | #define CONFIG_CMD_BOOTZ |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 119 | |
| 120 | /* USB configuration */ |
| 121 | #define CONFIG_USB_MUSB_DSPS |
| 122 | #define CONFIG_ARCH_MISC_INIT |
Paul Kocialkowski | f34dfcb | 2015-08-04 17:04:06 +0200 | [diff] [blame] | 123 | #define CONFIG_USB_MUSB_PIO_ONLY |
| 124 | #define CONFIG_USB_MUSB_DISABLE_BULK_COMBINE_SPLIT |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 125 | /* attention! not only for gadget, enables also highspeed in hostmode */ |
| 126 | #define CONFIG_USB_GADGET_DUALSPEED |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 127 | #define CONFIG_AM335X_USB0 |
| 128 | #define CONFIG_AM335X_USB0_MODE MUSB_HOST |
Hannes Petermaier | c96a9b1 | 2015-02-03 13:22:39 +0100 | [diff] [blame] | 129 | #define CONFIG_AM335X_USB1 |
| 130 | #define CONFIG_AM335X_USB1_MODE MUSB_HOST |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 131 | |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 132 | #undef CONFIG_ENV_IS_NOWHERE |
| 133 | #define CONFIG_ENV_IS_IN_MMC |
Hannes Petermaier | 8e731ed | 2014-04-08 08:39:20 +0200 | [diff] [blame] | 134 | #define CONFIG_SYS_MMC_ENV_DEV 0 |
Hannes Petermaier | 9436059 | 2014-02-07 14:06:50 +0100 | [diff] [blame] | 135 | #define CONFIG_SYS_MMC_ENV_PART 2 |
| 136 | #define CONFIG_ENV_OFFSET 0x40000 /* TODO: Adresse definieren */ |
| 137 | #define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE) |
| 138 | #define CONFIG_SYS_REDUNDAND_ENVIRONMENT |
| 139 | /* |
| 140 | * Common filesystems support. When we have removable storage we |
| 141 | * enabled a number of useful commands and support. |
| 142 | */ |
| 143 | #if defined(CONFIG_MMC) || defined(CONFIG_USB_STORAGE) |
| 144 | #define CONFIG_DOS_PARTITION |
| 145 | #define CONFIG_CMD_FAT |
| 146 | #define CONFIG_FAT_WRITE |
| 147 | #define CONFIG_CMD_FS_GENERIC |
| 148 | #endif /* CONFIG_MMC, ... */ |
| 149 | |
Hannes Schmelzer | 220597d | 2016-02-19 12:09:46 +0100 | [diff] [blame] | 150 | #endif /* __CONFIG_KWB_H__ */ |