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> |
Simon Glass | fb64e36 | 2020-05-10 11:40:09 -0600 | [diff] [blame] | 16 | #include <linux/stringify.h> |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 17 | /* ------------------------------------------------------------------------- */ |
Hannes Schmelzer | 27bf441 | 2016-02-19 12:09:45 +0100 | [diff] [blame] | 18 | /* memory */ |
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 | |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 25 | /* |
Hannes Schmelzer | 5639eeb | 2018-07-06 15:41:28 +0200 | [diff] [blame] | 26 | * When we have NAND flash we expect to be making use of mtdparts, |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 27 | * both for ease of use in U-Boot and for passing information on to |
| 28 | * the Linux kernel. |
| 29 | */ |
Adam Ford | ac44a30 | 2018-07-07 22:18:22 -0500 | [diff] [blame] | 30 | |
| 31 | #ifdef CONFIG_SPL_OS_BOOT |
Adam Ford | ac44a30 | 2018-07-07 22:18:22 -0500 | [diff] [blame] | 32 | /* RAW SD card / eMMC */ |
Adam Ford | ac44a30 | 2018-07-07 22:18:22 -0500 | [diff] [blame] | 33 | |
Adam Ford | ac44a30 | 2018-07-07 22:18:22 -0500 | [diff] [blame] | 34 | #endif /* CONFIG_SPL_OS_BOOT */ |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 35 | |
Miquel Raynal | d093536 | 2019-10-03 19:50:03 +0200 | [diff] [blame] | 36 | #ifdef CONFIG_MTD_RAW_NAND |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 37 | #define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE |
Miquel Raynal | d093536 | 2019-10-03 19:50:03 +0200 | [diff] [blame] | 38 | #endif /* CONFIG_MTD_RAW_NAND */ |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 39 | |
Miquel Raynal | d093536 | 2019-10-03 19:50:03 +0200 | [diff] [blame] | 40 | #ifdef CONFIG_MTD_RAW_NAND |
Hannes Schmelzer | 9b7c2c1 | 2018-07-06 15:41:26 +0200 | [diff] [blame] | 41 | #define NANDTGTS \ |
| 42 | "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \ |
| 43 | "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \ |
Hannes Schmelzer | 70e7c70 | 2019-05-16 17:24:19 +0200 | [diff] [blame] | 44 | "cfgscr=mw ${dtbaddr} 0; nand read ${cfgaddr} cfgscr && source ${cfgaddr};" \ |
| 45 | " fdt addr ${dtbaddr} || cp ${fdtcontroladdr} ${dtbaddr} 4000\0" \ |
Hannes Schmelzer | 9b7c2c1 | 2018-07-06 15:41:26 +0200 | [diff] [blame] | 46 | "nandargs=setenv bootargs console=${console} ${optargs} ${optargs_rot} " \ |
| 47 | "root=mtd6 rootfstype=jffs2 b_mode=${b_mode}\0" \ |
| 48 | "b_nand=nand read ${loadaddr} kernel; nand read ${dtbaddr} dtb; " \ |
| 49 | "run nandargs; run cfgscr; bootz ${loadaddr} - ${dtbaddr}\0" \ |
| 50 | "b_tgts_std=usb0 nand net\0" \ |
| 51 | "b_tgts_rcy=net usb0 nand\0" \ |
| 52 | "b_tgts_pme=usb0 nand net\0" |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 53 | #else |
Hannes Schmelzer | 9b7c2c1 | 2018-07-06 15:41:26 +0200 | [diff] [blame] | 54 | #define NANDTGTS "" |
Miquel Raynal | d093536 | 2019-10-03 19:50:03 +0200 | [diff] [blame] | 55 | #endif /* CONFIG_MTD_RAW_NAND */ |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 56 | |
Hannes Schmelzer | 9b7c2c1 | 2018-07-06 15:41:26 +0200 | [diff] [blame] | 57 | #define MMCSPI_TGTS \ |
| 58 | "t30args#0=setenv bootargs ${optargs_rot} ${optargs} console=${console} " \ |
| 59 | "b_mode=${b_mode} root=/dev/mmcblk0p2 rootfstype=ext4\0" \ |
| 60 | "b_t30lgcy#0=" \ |
| 61 | "load ${loaddev}:2 ${loadaddr} /boot/PPTImage.md5 && " \ |
| 62 | "load ${loaddev}:2 ${loadaddr} /boot/zImage && " \ |
| 63 | "load ${loaddev}:2 ${dtbaddr} /boot/am335x-ppt30.dtb || " \ |
| 64 | "load ${loaddev}:1 ${dtbaddr} am335x-ppt30-legacy.dtb; "\ |
| 65 | "run t30args#0; run cfgscr; bootz ${loadaddr} - ${dtbaddr}\0" \ |
| 66 | "t30args#1=setenv bootargs ${optargs_rot} ${optargs} console=${console} " \ |
| 67 | "b_mode=${b_mode}\0" \ |
| 68 | "b_t30lgcy#1=" \ |
| 69 | "load ${loaddev}:1 ${loadaddr} zImage && " \ |
| 70 | "load ${loaddev}:1 ${dtbaddr} am335x-ppt30.dtb && " \ |
| 71 | "load ${loaddev}:1 ${ramaddr} rootfsPPT30.uboot && " \ |
| 72 | "run t30args#1; run cfgscr; bootz ${loadaddr} ${ramaddr} ${dtbaddr}\0" \ |
| 73 | "b_mmc0=load ${loaddev}:1 ${scraddr} bootscr.img && source ${scraddr}\0" \ |
| 74 | "b_mmc1=load ${loaddev}:1 ${scraddr} /boot/bootscr.img && source ${scraddr}\0" \ |
| 75 | "b_tgts_std=mmc0 mmc1 t30lgcy#0 t30lgcy#1 usb0 net\0" \ |
| 76 | "b_tgts_rcy=t30lgcy#1 usb0 net\0" \ |
| 77 | "b_tgts_pme=net usb0 mmc0 mmc1\0" \ |
| 78 | "loaddev=mmc 1\0" |
| 79 | |
Hannes Schmelzer | 5639eeb | 2018-07-06 15:41:28 +0200 | [diff] [blame] | 80 | #ifdef CONFIG_ENV_IS_IN_MMC |
Hannes Schmelzer | 9b7c2c1 | 2018-07-06 15:41:26 +0200 | [diff] [blame] | 81 | #define MMCTGTS \ |
| 82 | MMCSPI_TGTS \ |
Hannes Schmelzer | 70e7c70 | 2019-05-16 17:24:19 +0200 | [diff] [blame] | 83 | "cfgscr=mw ${dtbaddr} 0;" \ |
| 84 | " mmc dev 1; mmc read ${cfgaddr} 200 80; source ${cfgaddr};" \ |
| 85 | " fdt addr ${dtbaddr} || cp ${fdtcontroladdr} ${dtbaddr} 4000\0" |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 86 | #else |
Hannes Schmelzer | 9b7c2c1 | 2018-07-06 15:41:26 +0200 | [diff] [blame] | 87 | #define MMCTGTS "" |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 88 | #endif /* CONFIG_MMC */ |
| 89 | |
Hannes Schmelzer | 9b7c2c1 | 2018-07-06 15:41:26 +0200 | [diff] [blame] | 90 | #ifdef CONFIG_SPI |
| 91 | #define SPITGTS \ |
| 92 | MMCSPI_TGTS \ |
Hannes Schmelzer | 70e7c70 | 2019-05-16 17:24:19 +0200 | [diff] [blame] | 93 | "cfgscr=mw ${dtbaddr} 0;" \ |
| 94 | " sf probe; sf read ${cfgaddr} 0xC0000 10000; source ${cfgaddr};" \ |
| 95 | " fdt addr ${dtbaddr} || cp ${fdtcontroladdr} ${dtbaddr} 4000\0" |
Hannes Schmelzer | 9b7c2c1 | 2018-07-06 15:41:26 +0200 | [diff] [blame] | 96 | #else |
| 97 | #define SPITGTS "" |
| 98 | #endif /* CONFIG_SPI */ |
| 99 | |
| 100 | #define LOAD_OFFSET(x) 0x8##x |
| 101 | |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 102 | #ifndef CONFIG_SPL_BUILD |
| 103 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
Hannes Petermaier | 918d97b | 2015-02-03 13:22:34 +0100 | [diff] [blame] | 104 | BUR_COMMON_ENV \ |
Hannes Petermaier | 3d8394c | 2015-02-03 13:22:37 +0100 | [diff] [blame] | 105 | "verify=no\0" \ |
Hannes Petermaier | 918d97b | 2015-02-03 13:22:34 +0100 | [diff] [blame] | 106 | "autoload=0\0" \ |
Hannes Schmelzer | 9b7c2c1 | 2018-07-06 15:41:26 +0200 | [diff] [blame] | 107 | "scraddr=" __stringify(LOAD_OFFSET(0000000)) "\0" \ |
| 108 | "cfgaddr=" __stringify(LOAD_OFFSET(0020000)) "\0" \ |
| 109 | "dtbaddr=" __stringify(LOAD_OFFSET(0040000)) "\0" \ |
| 110 | "loadaddr=" __stringify(LOAD_OFFSET(0100000)) "\0" \ |
| 111 | "ramaddr=" __stringify(LOAD_OFFSET(2000000)) "\0" \ |
Hannes Petermaier | 3d8394c | 2015-02-03 13:22:37 +0100 | [diff] [blame] | 112 | "console=ttyO0,115200n8\0" \ |
Hannes Petermaier | 89767d12 | 2015-06-11 12:31:54 +0200 | [diff] [blame] | 113 | "optargs=consoleblank=0 quiet panic=2\0" \ |
Hannes Schmelzer | 9b7c2c1 | 2018-07-06 15:41:26 +0200 | [diff] [blame] | 114 | "b_break=0\0" \ |
| 115 | "b_usb0=usb start && load usb 0 ${scraddr} bootscr.img && source ${scraddr}\0" \ |
| 116 | "b_net=tftp ${scraddr} netscript.img && source ${scraddr}\0" \ |
| 117 | MMCTGTS \ |
| 118 | SPITGTS \ |
| 119 | NANDTGTS \ |
| 120 | "b_deftgts=if test ${b_mode} = 12; then setenv b_tgts ${b_tgts_pme};" \ |
| 121 | " elif test ${b_mode} = 0; then setenv b_tgts ${b_tgts_rcy};" \ |
| 122 | " else setenv b_tgts ${b_tgts_std}; fi\0" \ |
| 123 | "b_default=run b_deftgts; for target in ${b_tgts};"\ |
| 124 | " do echo \"### booting ${target} ###\"; run b_${target};" \ |
| 125 | " if test ${b_break} = 1; then; exit; fi; done\0" |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 126 | #endif /* !CONFIG_SPL_BUILD*/ |
| 127 | |
Miquel Raynal | d093536 | 2019-10-03 19:50:03 +0200 | [diff] [blame] | 128 | #ifdef CONFIG_MTD_RAW_NAND |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 129 | /* |
| 130 | * GPMC block. We support 1 device and the physical address to |
| 131 | * access CS0 at is 0x8000000. |
| 132 | */ |
| 133 | #define CONFIG_SYS_MAX_NAND_DEVICE 1 |
| 134 | #define CONFIG_SYS_NAND_BASE 0x8000000 |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 135 | /* don't change OMAP_ELM, ECCSCHEME. ROM code only supports this */ |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 136 | #define CONFIG_SYS_NAND_ECCPOS {2, 3, 4, 5, 6, 7, 8, 9, \ |
| 137 | 10, 11, 12, 13, 14, 15, 16, 17, \ |
| 138 | 18, 19, 20, 21, 22, 23, 24, 25, \ |
| 139 | 26, 27, 28, 29, 30, 31, 32, 33, \ |
| 140 | 34, 35, 36, 37, 38, 39, 40, 41, \ |
| 141 | 42, 43, 44, 45, 46, 47, 48, 49, \ |
| 142 | 50, 51, 52, 53, 54, 55, 56, 57, } |
| 143 | |
| 144 | #define CONFIG_SYS_NAND_ECCSIZE 512 |
| 145 | #define CONFIG_SYS_NAND_ECCBYTES 14 |
| 146 | |
| 147 | #define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 148 | |
Hannes Petermaier | 763f7f3 | 2015-04-08 07:38:34 +0200 | [diff] [blame] | 149 | #define CONFIG_NAND_OMAP_GPMC_WSCFG 1 |
Miquel Raynal | d093536 | 2019-10-03 19:50:03 +0200 | [diff] [blame] | 150 | #endif /* CONFIG_MTD_RAW_NAND */ |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 151 | |
Tom Rini | eb1f909 | 2020-07-24 17:14:47 -0400 | [diff] [blame] | 152 | #if defined(CONFIG_ENV_IS_IN_NAND) |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 153 | #define CONFIG_SYS_ENV_SECT_SIZE CONFIG_ENV_SIZE |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 154 | #endif |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 155 | |
Hannes Schmelzer | 20ccb43 | 2016-06-22 12:36:13 +0200 | [diff] [blame] | 156 | #endif /* ! __CONFIG_BRPPT1_H__ */ |