blob: 2c5236aa58bbd14727a7a3620e6e3a7c719bcba7 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Hannes Petermaierfb003662014-02-07 08:07:36 +01002/*
Hannes Schmelzer20ccb432016-06-22 12:36:13 +02003 * brtpp1.h
Hannes Petermaierfb003662014-02-07 08:07:36 +01004 *
5 * specific parts for B&R T-Series Motherboard
6 *
Hannes Schmelzer7935f032015-05-28 15:41:12 +02007 * Copyright (C) 2013 Hannes Schmelzer <oe5hpm@oevsv.at> -
Hannes Petermaierfb003662014-02-07 08:07:36 +01008 * Bernecker & Rainer Industrieelektronik GmbH - http://www.br-automation.com
Hannes Petermaierfb003662014-02-07 08:07:36 +01009 */
10
Hannes Schmelzer20ccb432016-06-22 12:36:13 +020011#ifndef __CONFIG_BRPPT1_H__
12#define __CONFIG_BRPPT1_H__
Hannes Petermaierfb003662014-02-07 08:07:36 +010013
Hannes Schmelzer27bf4412016-02-19 12:09:45 +010014#include <configs/bur_cfg_common.h>
Hannes Petermaierfb003662014-02-07 08:07:36 +010015#include <configs/bur_am335x_common.h>
Simon Glassfb64e362020-05-10 11:40:09 -060016#include <linux/stringify.h>
Hannes Petermaierfb003662014-02-07 08:07:36 +010017/* ------------------------------------------------------------------------- */
Hannes Schmelzer27bf4412016-02-19 12:09:45 +010018/* memory */
Hannes Schmelzer27bf4412016-02-19 12:09:45 +010019
Hannes Petermaierfb003662014-02-07 08:07:36 +010020/* Clock Defines */
21#define V_OSCK 26000000 /* Clock output from T2 */
22#define V_SCLK (V_OSCK)
23
Hannes Petermaierfb003662014-02-07 08:07:36 +010024/*
Hannes Schmelzer5639eeb2018-07-06 15:41:28 +020025 * When we have NAND flash we expect to be making use of mtdparts,
Hannes Petermaierfb003662014-02-07 08:07:36 +010026 * both for ease of use in U-Boot and for passing information on to
27 * the Linux kernel.
28 */
Adam Fordac44a302018-07-07 22:18:22 -050029
Bernhard Messerklingere830ef22022-08-25 08:54:00 +020030#define MMC_TGTS \
Hannes Schmelzer9b7c2c12018-07-06 15:41:26 +020031"t30args#0=setenv bootargs ${optargs_rot} ${optargs} console=${console} " \
Bernhard Messerklinger158a8192022-08-25 08:54:04 +020032 "b_mode=${b_mode} root=${root_dev} rootfstype=ext4 rootwait\0" \
Hannes Schmelzer9b7c2c12018-07-06 15:41:26 +020033"b_t30lgcy#0=" \
Hannes Schmelzer9b7c2c12018-07-06 15:41:26 +020034 "load ${loaddev}:2 ${loadaddr} /boot/zImage && " \
Bernhard Messerklinger158a8192022-08-25 08:54:04 +020035 "run load_dtb && " \
Hannes Schmelzer9b7c2c12018-07-06 15:41:26 +020036 "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 Messerklinger158a8192022-08-25 08:54:04 +020041 "load ${loaddev}:1 ${dtbaddr} am335x-brppt30.dtb && " \
Hannes Schmelzer9b7c2c12018-07-06 15:41:26 +020042 "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 Messerklinger158a8192022-08-25 08:54:04 +020049"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 Schmelzer9b7c2c12018-07-06 15:41:26 +020057
Hannes Schmelzer5639eeb2018-07-06 15:41:28 +020058#ifdef CONFIG_ENV_IS_IN_MMC
Hannes Schmelzer9b7c2c12018-07-06 15:41:26 +020059#define MMCTGTS \
Bernhard Messerklingere830ef22022-08-25 08:54:00 +020060MMC_TGTS \
Bernhard Messerklinger158a8192022-08-25 08:54:04 +020061"cfgscr=mw ${cfgaddr} 0;" \
Hannes Schmelzer70e7c702019-05-16 17:24:19 +020062" mmc dev 1; mmc read ${cfgaddr} 200 80; source ${cfgaddr};" \
63" fdt addr ${dtbaddr} || cp ${fdtcontroladdr} ${dtbaddr} 4000\0"
Hannes Petermaierfb003662014-02-07 08:07:36 +010064#else
Hannes Schmelzer9b7c2c12018-07-06 15:41:26 +020065#define MMCTGTS ""
Hannes Petermaierfb003662014-02-07 08:07:36 +010066#endif /* CONFIG_MMC */
67
Hannes Schmelzer9b7c2c12018-07-06 15:41:26 +020068#define LOAD_OFFSET(x) 0x8##x
69
Hannes Petermaierfb003662014-02-07 08:07:36 +010070#define CONFIG_EXTRA_ENV_SETTINGS \
Hannes Petermaier918d97b2015-02-03 13:22:34 +010071BUR_COMMON_ENV \
Hannes Petermaier3d8394c2015-02-03 13:22:37 +010072"verify=no\0" \
Hannes Schmelzer9b7c2c12018-07-06 15:41:26 +020073"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 Petermaier3d8394c2015-02-03 13:22:37 +010078"console=ttyO0,115200n8\0" \
Hannes Petermaier89767d122015-06-11 12:31:54 +020079"optargs=consoleblank=0 quiet panic=2\0" \
Hannes Schmelzer9b7c2c12018-07-06 15:41:26 +020080"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" \
83MMCTGTS \
Hannes Schmelzer9b7c2c12018-07-06 15:41:26 +020084"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 Petermaierfb003662014-02-07 08:07:36 +010090
Hannes Schmelzer20ccb432016-06-22 12:36:13 +020091#endif /* ! __CONFIG_BRPPT1_H__ */