Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 2 | /* |
Hannes Schmelzer | 20ccb43 | 2016-06-22 12:36:13 +0200 | [diff] [blame] | 3 | * brtpp1.h |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 4 | * |
| 5 | * specific parts for B&R T-Series Motherboard |
| 6 | * |
Hannes Schmelzer | 7935f03 | 2015-05-28 15:41:12 +0200 | [diff] [blame] | 7 | * Copyright (C) 2013 Hannes Schmelzer <oe5hpm@oevsv.at> - |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 8 | * Bernecker & Rainer Industrieelektronik GmbH - http://www.br-automation.com |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 9 | */ |
| 10 | |
Hannes Schmelzer | 20ccb43 | 2016-06-22 12:36:13 +0200 | [diff] [blame] | 11 | #ifndef __CONFIG_BRPPT1_H__ |
| 12 | #define __CONFIG_BRPPT1_H__ |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 13 | |
Hannes Schmelzer | 27bf441 | 2016-02-19 12:09:45 +0100 | [diff] [blame] | 14 | #include <configs/bur_cfg_common.h> |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 15 | #include <configs/bur_am335x_common.h> |
| 16 | /* ------------------------------------------------------------------------- */ |
Hannes Schmelzer | 27bf441 | 2016-02-19 12:09:45 +0100 | [diff] [blame] | 17 | /* memory */ |
| 18 | #define CONFIG_SYS_MALLOC_LEN (5 * 1024 * 1024) |
Hannes Schmelzer | 9b7c2c1 | 2018-07-06 15:41:26 +0200 | [diff] [blame^] | 19 | #define CONFIG_SYS_BOOTM_LEN SZ_32M |
Hannes Schmelzer | 27bf441 | 2016-02-19 12:09:45 +0100 | [diff] [blame] | 20 | |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 21 | /* Clock Defines */ |
| 22 | #define V_OSCK 26000000 /* Clock output from T2 */ |
| 23 | #define V_SCLK (V_OSCK) |
| 24 | |
| 25 | #define CONFIG_POWER_TPS65217 |
| 26 | |
| 27 | /* Support both device trees and ATAGs. */ |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 28 | #define CONFIG_CMDLINE_TAG |
| 29 | #define CONFIG_SETUP_MEMORY_TAGS |
| 30 | #define CONFIG_INITRD_TAG |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 31 | /*#define CONFIG_MACH_TYPE 3589*/ |
| 32 | #define CONFIG_MACH_TYPE 0xFFFFFFFF /* TODO: check with kernel*/ |
| 33 | |
| 34 | /* MMC/SD IP block */ |
| 35 | #if defined(CONFIG_EMMC_BOOT) |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 36 | #define CONFIG_SUPPORT_EMMC_BOOT |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 37 | #endif /* CONFIG_EMMC_BOOT */ |
| 38 | |
| 39 | /* |
| 40 | * When we have SPI or NAND flash we expect to be making use of mtdparts, |
| 41 | * both for ease of use in U-Boot and for passing information on to |
| 42 | * the Linux kernel. |
| 43 | */ |
| 44 | #if defined(CONFIG_SPI_BOOT) || defined(CONFIG_NAND) |
| 45 | #define CONFIG_MTD_DEVICE /* Required for mtdparts */ |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 46 | #endif /* CONFIG_SPI_BOOT, ... */ |
| 47 | |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 48 | #ifdef CONFIG_NAND |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 49 | #define CONFIG_SPL_NAND_BASE |
| 50 | #define CONFIG_SPL_NAND_DRIVERS |
| 51 | #define CONFIG_SPL_NAND_ECC |
| 52 | #define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE |
| 53 | #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000 |
| 54 | #endif /* CONFIG_NAND */ |
| 55 | |
Hannes Petermaier | 3d8394c | 2015-02-03 13:22:37 +0100 | [diff] [blame] | 56 | /* Always 64 KiB env size */ |
| 57 | #define CONFIG_ENV_SIZE (64 << 10) |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 58 | |
| 59 | #ifdef CONFIG_NAND |
Hannes Schmelzer | 9b7c2c1 | 2018-07-06 15:41:26 +0200 | [diff] [blame^] | 60 | #define NANDTGTS \ |
| 61 | "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \ |
| 62 | "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \ |
| 63 | "cfgscr=nand read ${cfgaddr} cfgscr && source ${cfgaddr}\0" \ |
| 64 | "nandargs=setenv bootargs console=${console} ${optargs} ${optargs_rot} " \ |
| 65 | "root=mtd6 rootfstype=jffs2 b_mode=${b_mode}\0" \ |
| 66 | "b_nand=nand read ${loadaddr} kernel; nand read ${dtbaddr} dtb; " \ |
| 67 | "run nandargs; run cfgscr; bootz ${loadaddr} - ${dtbaddr}\0" \ |
| 68 | "b_tgts_std=usb0 nand net\0" \ |
| 69 | "b_tgts_rcy=net usb0 nand\0" \ |
| 70 | "b_tgts_pme=usb0 nand net\0" |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 71 | #else |
Hannes Schmelzer | 9b7c2c1 | 2018-07-06 15:41:26 +0200 | [diff] [blame^] | 72 | #define NANDTGTS "" |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 73 | #endif /* CONFIG_NAND */ |
| 74 | |
Hannes Schmelzer | 9b7c2c1 | 2018-07-06 15:41:26 +0200 | [diff] [blame^] | 75 | #define MMCSPI_TGTS \ |
| 76 | "t30args#0=setenv bootargs ${optargs_rot} ${optargs} console=${console} " \ |
| 77 | "b_mode=${b_mode} root=/dev/mmcblk0p2 rootfstype=ext4\0" \ |
| 78 | "b_t30lgcy#0=" \ |
| 79 | "load ${loaddev}:2 ${loadaddr} /boot/PPTImage.md5 && " \ |
| 80 | "load ${loaddev}:2 ${loadaddr} /boot/zImage && " \ |
| 81 | "load ${loaddev}:2 ${dtbaddr} /boot/am335x-ppt30.dtb || " \ |
| 82 | "load ${loaddev}:1 ${dtbaddr} am335x-ppt30-legacy.dtb; "\ |
| 83 | "run t30args#0; run cfgscr; bootz ${loadaddr} - ${dtbaddr}\0" \ |
| 84 | "t30args#1=setenv bootargs ${optargs_rot} ${optargs} console=${console} " \ |
| 85 | "b_mode=${b_mode}\0" \ |
| 86 | "b_t30lgcy#1=" \ |
| 87 | "load ${loaddev}:1 ${loadaddr} zImage && " \ |
| 88 | "load ${loaddev}:1 ${dtbaddr} am335x-ppt30.dtb && " \ |
| 89 | "load ${loaddev}:1 ${ramaddr} rootfsPPT30.uboot && " \ |
| 90 | "run t30args#1; run cfgscr; bootz ${loadaddr} ${ramaddr} ${dtbaddr}\0" \ |
| 91 | "b_mmc0=load ${loaddev}:1 ${scraddr} bootscr.img && source ${scraddr}\0" \ |
| 92 | "b_mmc1=load ${loaddev}:1 ${scraddr} /boot/bootscr.img && source ${scraddr}\0" \ |
| 93 | "b_tgts_std=mmc0 mmc1 t30lgcy#0 t30lgcy#1 usb0 net\0" \ |
| 94 | "b_tgts_rcy=t30lgcy#1 usb0 net\0" \ |
| 95 | "b_tgts_pme=net usb0 mmc0 mmc1\0" \ |
| 96 | "loaddev=mmc 1\0" |
| 97 | |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 98 | #ifdef CONFIG_MMC |
Hannes Schmelzer | 9b7c2c1 | 2018-07-06 15:41:26 +0200 | [diff] [blame^] | 99 | #define MMCTGTS \ |
| 100 | MMCSPI_TGTS \ |
| 101 | "cfgscr=mmc dev 1; mmc read ${cfgaddr} 200 80; source ${cfgaddr}\0" |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 102 | #else |
Hannes Schmelzer | 9b7c2c1 | 2018-07-06 15:41:26 +0200 | [diff] [blame^] | 103 | #define MMCTGTS "" |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 104 | #endif /* CONFIG_MMC */ |
| 105 | |
Hannes Schmelzer | 9b7c2c1 | 2018-07-06 15:41:26 +0200 | [diff] [blame^] | 106 | #ifdef CONFIG_SPI |
| 107 | #define SPITGTS \ |
| 108 | MMCSPI_TGTS \ |
| 109 | "cfgscr=sf probe; sf read ${cfgaddr} 0xC0000 10000; source ${cfgaddr}\0" |
| 110 | #else |
| 111 | #define SPITGTS "" |
| 112 | #endif /* CONFIG_SPI */ |
| 113 | |
| 114 | #define LOAD_OFFSET(x) 0x8##x |
| 115 | |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 116 | #ifndef CONFIG_SPL_BUILD |
| 117 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
Hannes Petermaier | 918d97b | 2015-02-03 13:22:34 +0100 | [diff] [blame] | 118 | BUR_COMMON_ENV \ |
Hannes Petermaier | 3d8394c | 2015-02-03 13:22:37 +0100 | [diff] [blame] | 119 | "verify=no\0" \ |
Hannes Petermaier | 918d97b | 2015-02-03 13:22:34 +0100 | [diff] [blame] | 120 | "autoload=0\0" \ |
Hannes Schmelzer | 9b7c2c1 | 2018-07-06 15:41:26 +0200 | [diff] [blame^] | 121 | "scraddr=" __stringify(LOAD_OFFSET(0000000)) "\0" \ |
| 122 | "cfgaddr=" __stringify(LOAD_OFFSET(0020000)) "\0" \ |
| 123 | "dtbaddr=" __stringify(LOAD_OFFSET(0040000)) "\0" \ |
| 124 | "loadaddr=" __stringify(LOAD_OFFSET(0100000)) "\0" \ |
| 125 | "ramaddr=" __stringify(LOAD_OFFSET(2000000)) "\0" \ |
Hannes Petermaier | 3d8394c | 2015-02-03 13:22:37 +0100 | [diff] [blame] | 126 | "console=ttyO0,115200n8\0" \ |
Hannes Petermaier | 89767d12 | 2015-06-11 12:31:54 +0200 | [diff] [blame] | 127 | "optargs=consoleblank=0 quiet panic=2\0" \ |
Hannes Schmelzer | 9b7c2c1 | 2018-07-06 15:41:26 +0200 | [diff] [blame^] | 128 | "b_break=0\0" \ |
| 129 | "b_usb0=usb start && load usb 0 ${scraddr} bootscr.img && source ${scraddr}\0" \ |
| 130 | "b_net=tftp ${scraddr} netscript.img && source ${scraddr}\0" \ |
| 131 | MMCTGTS \ |
| 132 | SPITGTS \ |
| 133 | NANDTGTS \ |
| 134 | "b_deftgts=if test ${b_mode} = 12; then setenv b_tgts ${b_tgts_pme};" \ |
| 135 | " elif test ${b_mode} = 0; then setenv b_tgts ${b_tgts_rcy};" \ |
| 136 | " else setenv b_tgts ${b_tgts_std}; fi\0" \ |
| 137 | "b_default=run b_deftgts; for target in ${b_tgts};"\ |
| 138 | " do echo \"### booting ${target} ###\"; run b_${target};" \ |
| 139 | " if test ${b_break} = 1; then; exit; fi; done\0" |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 140 | #endif /* !CONFIG_SPL_BUILD*/ |
| 141 | |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 142 | #ifdef CONFIG_NAND |
| 143 | /* |
| 144 | * GPMC block. We support 1 device and the physical address to |
| 145 | * access CS0 at is 0x8000000. |
| 146 | */ |
| 147 | #define CONFIG_SYS_MAX_NAND_DEVICE 1 |
| 148 | #define CONFIG_SYS_NAND_BASE 0x8000000 |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 149 | /* don't change OMAP_ELM, ECCSCHEME. ROM code only supports this */ |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 150 | #define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 151 | #define CONFIG_SYS_NAND_5_ADDR_CYCLE |
| 152 | #define CONFIG_SYS_NAND_BLOCK_SIZE (128*1024) |
| 153 | #define CONFIG_SYS_NAND_PAGE_SIZE 2048 |
| 154 | #define CONFIG_SYS_NAND_PAGE_COUNT (CONFIG_SYS_NAND_BLOCK_SIZE / \ |
| 155 | CONFIG_SYS_NAND_PAGE_SIZE) |
| 156 | #define CONFIG_SYS_NAND_OOBSIZE 64 |
| 157 | #define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS |
| 158 | #define CONFIG_SYS_NAND_ECCPOS {2, 3, 4, 5, 6, 7, 8, 9, \ |
| 159 | 10, 11, 12, 13, 14, 15, 16, 17, \ |
| 160 | 18, 19, 20, 21, 22, 23, 24, 25, \ |
| 161 | 26, 27, 28, 29, 30, 31, 32, 33, \ |
| 162 | 34, 35, 36, 37, 38, 39, 40, 41, \ |
| 163 | 42, 43, 44, 45, 46, 47, 48, 49, \ |
| 164 | 50, 51, 52, 53, 54, 55, 56, 57, } |
| 165 | |
| 166 | #define CONFIG_SYS_NAND_ECCSIZE 512 |
| 167 | #define CONFIG_SYS_NAND_ECCBYTES 14 |
| 168 | |
| 169 | #define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE |
| 170 | #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000 |
| 171 | |
Hannes Petermaier | 763f7f3 | 2015-04-08 07:38:34 +0200 | [diff] [blame] | 172 | #define CONFIG_NAND_OMAP_GPMC_WSCFG 1 |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 173 | #endif /* CONFIG_NAND */ |
| 174 | |
| 175 | /* USB configuration */ |
Paul Kocialkowski | f34dfcb | 2015-08-04 17:04:06 +0200 | [diff] [blame] | 176 | #define CONFIG_USB_MUSB_DISABLE_BULK_COMBINE_SPLIT |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 177 | #define CONFIG_AM335X_USB0 |
| 178 | #define CONFIG_AM335X_USB0_MODE MUSB_HOST |
| 179 | #define CONFIG_AM335X_USB1 |
| 180 | #define CONFIG_AM335X_USB1_MODE MUSB_HOST |
| 181 | |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 182 | #if defined(CONFIG_SPI_BOOT) |
| 183 | /* McSPI IP block */ |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 184 | #define CONFIG_SF_DEFAULT_SPEED 24000000 |
| 185 | |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 186 | #define CONFIG_SYS_SPI_U_BOOT_OFFS 0x20000 |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 187 | #define CONFIG_SYS_REDUNDAND_ENVIRONMENT |
| 188 | #define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED |
| 189 | #define CONFIG_ENV_SECT_SIZE (4 << 10) /* 4 KB sectors */ |
| 190 | #define CONFIG_ENV_OFFSET (768 << 10) /* 768 KiB in */ |
| 191 | #define CONFIG_ENV_OFFSET_REDUND (896 << 10) /* 896 KiB in */ |
| 192 | |
| 193 | #elif defined(CONFIG_EMMC_BOOT) |
Hannes Schmelzer | 6afb92a | 2017-07-06 08:47:14 +0200 | [diff] [blame] | 194 | #define CONFIG_SYS_MMC_ENV_DEV 1 |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 195 | #define CONFIG_SYS_MMC_ENV_PART 2 |
| 196 | #define CONFIG_ENV_OFFSET 0x40000 /* TODO: Adresse definieren */ |
| 197 | #define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE) |
| 198 | #define CONFIG_SYS_REDUNDAND_ENVIRONMENT |
| 199 | |
| 200 | #elif defined(CONFIG_NAND) |
Tom Rini | bff9efa | 2014-07-18 11:51:33 -0400 | [diff] [blame] | 201 | /* No NAND env support in SPL */ |
Hannes Petermaier | 763f7f3 | 2015-04-08 07:38:34 +0200 | [diff] [blame] | 202 | #define CONFIG_ENV_OFFSET 0x60000 |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 203 | #define CONFIG_SYS_ENV_SECT_SIZE CONFIG_ENV_SIZE |
| 204 | #else |
| 205 | #error "no storage for Environment defined!" |
| 206 | #endif |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 207 | |
Hannes Schmelzer | 20ccb43 | 2016-06-22 12:36:13 +0200 | [diff] [blame] | 208 | #endif /* ! __CONFIG_BRPPT1_H__ */ |