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 | 27bf441 | 2016-02-19 12:09:45 +0100 | [diff] [blame] | 19 | |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 20 | /* Clock Defines */ |
| 21 | #define V_OSCK 26000000 /* Clock output from T2 */ |
| 22 | #define V_SCLK (V_OSCK) |
| 23 | |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 24 | /* |
Hannes Schmelzer | 5639eeb | 2018-07-06 15:41:28 +0200 | [diff] [blame] | 25 | * 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] | 26 | * both for ease of use in U-Boot and for passing information on to |
| 27 | * the Linux kernel. |
| 28 | */ |
Adam Ford | ac44a30 | 2018-07-07 22:18:22 -0500 | [diff] [blame] | 29 | |
Bernhard Messerklinger | e830ef2 | 2022-08-25 08:54:00 +0200 | [diff] [blame] | 30 | #define MMC_TGTS \ |
Hannes Schmelzer | 9b7c2c1 | 2018-07-06 15:41:26 +0200 | [diff] [blame] | 31 | "t30args#0=setenv bootargs ${optargs_rot} ${optargs} console=${console} " \ |
Bernhard Messerklinger | 158a819 | 2022-08-25 08:54:04 +0200 | [diff] [blame^] | 32 | "b_mode=${b_mode} root=${root_dev} rootfstype=ext4 rootwait\0" \ |
Hannes Schmelzer | 9b7c2c1 | 2018-07-06 15:41:26 +0200 | [diff] [blame] | 33 | "b_t30lgcy#0=" \ |
Hannes Schmelzer | 9b7c2c1 | 2018-07-06 15:41:26 +0200 | [diff] [blame] | 34 | "load ${loaddev}:2 ${loadaddr} /boot/zImage && " \ |
Bernhard Messerklinger | 158a819 | 2022-08-25 08:54:04 +0200 | [diff] [blame^] | 35 | "run load_dtb && " \ |
Hannes Schmelzer | 9b7c2c1 | 2018-07-06 15:41:26 +0200 | [diff] [blame] | 36 | "run t30args#0; run cfgscr; bootz ${loadaddr} - ${dtbaddr}\0" \ |
| 37 | "t30args#1=setenv bootargs ${optargs_rot} ${optargs} console=${console} " \ |
| 38 | "b_mode=${b_mode}\0" \ |
| 39 | "b_t30lgcy#1=" \ |
| 40 | "load ${loaddev}:1 ${loadaddr} zImage && " \ |
Bernhard Messerklinger | 158a819 | 2022-08-25 08:54:04 +0200 | [diff] [blame^] | 41 | "load ${loaddev}:1 ${dtbaddr} am335x-brppt30.dtb && " \ |
Hannes Schmelzer | 9b7c2c1 | 2018-07-06 15:41:26 +0200 | [diff] [blame] | 42 | "load ${loaddev}:1 ${ramaddr} rootfsPPT30.uboot && " \ |
| 43 | "run t30args#1; run cfgscr; bootz ${loadaddr} ${ramaddr} ${dtbaddr}\0" \ |
| 44 | "b_mmc0=load ${loaddev}:1 ${scraddr} bootscr.img && source ${scraddr}\0" \ |
| 45 | "b_mmc1=load ${loaddev}:1 ${scraddr} /boot/bootscr.img && source ${scraddr}\0" \ |
| 46 | "b_tgts_std=mmc0 mmc1 t30lgcy#0 t30lgcy#1 usb0 net\0" \ |
| 47 | "b_tgts_rcy=t30lgcy#1 usb0 net\0" \ |
| 48 | "b_tgts_pme=net usb0 mmc0 mmc1\0" \ |
Bernhard Messerklinger | 158a819 | 2022-08-25 08:54:04 +0200 | [diff] [blame^] | 49 | "loaddev=mmc 1\0" \ |
| 50 | "root_dev=/dev/mmcblk0p2\0" \ |
| 51 | "load_dtb=load ${loaddev}:2 ${dtbaddr} /boot/am335x-brppt30.dtb; " \ |
| 52 | "if test $? -eq 0; then " \ |
| 53 | "setenv root_dev /dev/mmcblk1p2; " \ |
| 54 | "else; " \ |
| 55 | "load ${loaddev}:1 ${dtbaddr} am335x-brppt30-legacy.dtb; " \ |
| 56 | "fi;\0" |
Hannes Schmelzer | 9b7c2c1 | 2018-07-06 15:41:26 +0200 | [diff] [blame] | 57 | |
Hannes Schmelzer | 5639eeb | 2018-07-06 15:41:28 +0200 | [diff] [blame] | 58 | #ifdef CONFIG_ENV_IS_IN_MMC |
Hannes Schmelzer | 9b7c2c1 | 2018-07-06 15:41:26 +0200 | [diff] [blame] | 59 | #define MMCTGTS \ |
Bernhard Messerklinger | e830ef2 | 2022-08-25 08:54:00 +0200 | [diff] [blame] | 60 | MMC_TGTS \ |
Bernhard Messerklinger | 158a819 | 2022-08-25 08:54:04 +0200 | [diff] [blame^] | 61 | "cfgscr=mw ${cfgaddr} 0;" \ |
Hannes Schmelzer | 70e7c70 | 2019-05-16 17:24:19 +0200 | [diff] [blame] | 62 | " mmc dev 1; mmc read ${cfgaddr} 200 80; source ${cfgaddr};" \ |
| 63 | " fdt addr ${dtbaddr} || cp ${fdtcontroladdr} ${dtbaddr} 4000\0" |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 64 | #else |
Hannes Schmelzer | 9b7c2c1 | 2018-07-06 15:41:26 +0200 | [diff] [blame] | 65 | #define MMCTGTS "" |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 66 | #endif /* CONFIG_MMC */ |
| 67 | |
Hannes Schmelzer | 9b7c2c1 | 2018-07-06 15:41:26 +0200 | [diff] [blame] | 68 | #define LOAD_OFFSET(x) 0x8##x |
| 69 | |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 70 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
Hannes Petermaier | 918d97b | 2015-02-03 13:22:34 +0100 | [diff] [blame] | 71 | BUR_COMMON_ENV \ |
Hannes Petermaier | 3d8394c | 2015-02-03 13:22:37 +0100 | [diff] [blame] | 72 | "verify=no\0" \ |
Hannes Schmelzer | 9b7c2c1 | 2018-07-06 15:41:26 +0200 | [diff] [blame] | 73 | "scraddr=" __stringify(LOAD_OFFSET(0000000)) "\0" \ |
| 74 | "cfgaddr=" __stringify(LOAD_OFFSET(0020000)) "\0" \ |
| 75 | "dtbaddr=" __stringify(LOAD_OFFSET(0040000)) "\0" \ |
| 76 | "loadaddr=" __stringify(LOAD_OFFSET(0100000)) "\0" \ |
| 77 | "ramaddr=" __stringify(LOAD_OFFSET(2000000)) "\0" \ |
Hannes Petermaier | 3d8394c | 2015-02-03 13:22:37 +0100 | [diff] [blame] | 78 | "console=ttyO0,115200n8\0" \ |
Hannes Petermaier | 89767d12 | 2015-06-11 12:31:54 +0200 | [diff] [blame] | 79 | "optargs=consoleblank=0 quiet panic=2\0" \ |
Hannes Schmelzer | 9b7c2c1 | 2018-07-06 15:41:26 +0200 | [diff] [blame] | 80 | "b_break=0\0" \ |
| 81 | "b_usb0=usb start && load usb 0 ${scraddr} bootscr.img && source ${scraddr}\0" \ |
| 82 | "b_net=tftp ${scraddr} netscript.img && source ${scraddr}\0" \ |
| 83 | MMCTGTS \ |
Hannes Schmelzer | 9b7c2c1 | 2018-07-06 15:41:26 +0200 | [diff] [blame] | 84 | "b_deftgts=if test ${b_mode} = 12; then setenv b_tgts ${b_tgts_pme};" \ |
| 85 | " elif test ${b_mode} = 0; then setenv b_tgts ${b_tgts_rcy};" \ |
| 86 | " else setenv b_tgts ${b_tgts_std}; fi\0" \ |
| 87 | "b_default=run b_deftgts; for target in ${b_tgts};"\ |
| 88 | " do echo \"### booting ${target} ###\"; run b_${target};" \ |
| 89 | " if test ${b_break} = 1; then; exit; fi; done\0" |
Hannes Petermaier | fb00366 | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 90 | |
Hannes Schmelzer | 20ccb43 | 2016-06-22 12:36:13 +0200 | [diff] [blame] | 91 | #endif /* ! __CONFIG_BRPPT1_H__ */ |