blob: f1e6dbf613583c39bde8c04374ec7a2e48a9be9c [file] [log] [blame]
Hannes Schmelzer82088482019-08-01 07:04:46 +02001/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * brsmarc1.h
4 *
5 * specific parts for B&R BRSMARC1 Motherboard
6 *
7 * Copyright (C) 2017 Hannes Schmelzer <oe5hpm@oevsv.at> -
8 * B&R Industrial Automation GmbH - http://www.br-automation.com
9 *
10 */
11
12#ifndef __CONFIG_BRSMARC1_H__
13#define __CONFIG_BRSMARC1_H__
14
15#include <configs/bur_cfg_common.h>
16#include <configs/bur_am335x_common.h>
Simon Glassfb64e362020-05-10 11:40:09 -060017#include <linux/stringify.h>
Hannes Schmelzer82088482019-08-01 07:04:46 +020018/* ------------------------------------------------------------------------- */
Hannes Schmelzer82088482019-08-01 07:04:46 +020019
20/* memory */
Hannes Schmelzer82088482019-08-01 07:04:46 +020021#define CONFIG_SYS_BOOTM_LEN (32 * 1024 * 1024)
22
23/* Clock Defines */
24#define V_OSCK 26000000 /* Clock output from T2 */
25#define V_SCLK (V_OSCK)
26
Hannes Schmelzer82088482019-08-01 07:04:46 +020027#ifndef CONFIG_SPL_BUILD
28
29/* Default environment */
30#define CONFIG_EXTRA_ENV_SETTINGS \
31BUR_COMMON_ENV \
32"autoload=0\0" \
33"scradr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
34"cfgscr=mw ${dtbaddr} 0;" \
35" sf probe && sf read ${scradr} 0xC0000 0x10000 && source ${scradr};" \
36" fdt addr ${dtbaddr} || cp ${fdtcontroladdr} ${dtbaddr} 4000\0" \
37"dtbaddr=0x84000000\0" \
38"loadaddr=0x82000000\0" \
39"b_break=0\0" \
40"b_tgts_std=mmc0 mmc1 def net usb0\0" \
41"b_tgts_rcy=def net usb0\0" \
42"b_tgts_pme=net usb0 mmc0 mmc1\0" \
43"b_deftgts=if test ${b_mode} = 12; then setenv b_tgts ${b_tgts_pme};" \
44" elif test ${b_mode} = 0; then setenv b_tgts ${b_tgts_rcy};" \
45" else setenv b_tgts ${b_tgts_std}; fi\0" \
46"b_mmc0=load mmc 1 ${scradr} bootscr.img && source ${scradr}\0" \
47"b_mmc1=load mmc 1 ${loadaddr} arimg.ugz && run startsys\0" \
48"b_def=sf read ${loadaddr} 100000 700000; run startsys\0" \
49"b_net=tftp ${scradr} netscript.img && source ${scradr}\0" \
50"b_usb0=usb start && load usb 0 ${scradr} bootscr.img && source ${scradr}\0" \
51"b_default=run b_deftgts; for target in ${b_tgts};"\
52" do run b_${target}; if test ${b_break} = 1; then; exit; fi; done\0" \
53"vxargs=setenv bootargs cpsw(0,0)host:vxWorks h=${serverip}" \
54" e=${ipaddr}:${netmask} g=${gatewayip} u=vxWorksFTP pw=vxWorks\0" \
55"vxfdt=fdt addr ${dtbaddr}; fdt resize 0x8000;" \
56" fdt boardsetup\0" \
57"startsys=run vxargs && mw 0x80001100 0 && run vxfdt &&" \
58" bootm ${loadaddr} - ${dtbaddr}\0"
59#endif /* !CONFIG_SPL_BUILD*/
60
Hannes Schmelzer82088482019-08-01 07:04:46 +020061/* SPI Flash */
Hannes Schmelzer82088482019-08-01 07:04:46 +020062
63/* Environment */
Hannes Schmelzer82088482019-08-01 07:04:46 +020064#endif /* __CONFIG_BRSMARC1_H__ */