Hannes Schmelzer | 60df809 | 2019-08-01 07:04:46 +0200 | [diff] [blame] | 1 | /* 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 Glass | 1af3c7f | 2020-05-10 11:40:09 -0600 | [diff] [blame] | 17 | #include <linux/stringify.h> |
Hannes Schmelzer | 60df809 | 2019-08-01 07:04:46 +0200 | [diff] [blame] | 18 | /* ------------------------------------------------------------------------- */ |
Hannes Schmelzer | 60df809 | 2019-08-01 07:04:46 +0200 | [diff] [blame] | 19 | |
| 20 | /* memory */ |
Hannes Schmelzer | 60df809 | 2019-08-01 07:04:46 +0200 | [diff] [blame] | 21 | |
| 22 | /* Clock Defines */ |
| 23 | #define V_OSCK 26000000 /* Clock output from T2 */ |
| 24 | #define V_SCLK (V_OSCK) |
| 25 | |
Hannes Schmelzer | 60df809 | 2019-08-01 07:04:46 +0200 | [diff] [blame] | 26 | /* Default environment */ |
Tom Rini | 0613c36 | 2022-12-04 10:03:50 -0500 | [diff] [blame] | 27 | #define CFG_EXTRA_ENV_SETTINGS \ |
Hannes Schmelzer | 60df809 | 2019-08-01 07:04:46 +0200 | [diff] [blame] | 28 | BUR_COMMON_ENV \ |
Hannes Schmelzer | 60df809 | 2019-08-01 07:04:46 +0200 | [diff] [blame] | 29 | "scradr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \ |
| 30 | "cfgscr=mw ${dtbaddr} 0;" \ |
| 31 | " sf probe && sf read ${scradr} 0xC0000 0x10000 && source ${scradr};" \ |
| 32 | " fdt addr ${dtbaddr} || cp ${fdtcontroladdr} ${dtbaddr} 4000\0" \ |
| 33 | "dtbaddr=0x84000000\0" \ |
| 34 | "loadaddr=0x82000000\0" \ |
| 35 | "b_break=0\0" \ |
| 36 | "b_tgts_std=mmc0 mmc1 def net usb0\0" \ |
| 37 | "b_tgts_rcy=def net usb0\0" \ |
| 38 | "b_tgts_pme=net usb0 mmc0 mmc1\0" \ |
| 39 | "b_deftgts=if test ${b_mode} = 12; then setenv b_tgts ${b_tgts_pme};" \ |
| 40 | " elif test ${b_mode} = 0; then setenv b_tgts ${b_tgts_rcy};" \ |
| 41 | " else setenv b_tgts ${b_tgts_std}; fi\0" \ |
| 42 | "b_mmc0=load mmc 1 ${scradr} bootscr.img && source ${scradr}\0" \ |
| 43 | "b_mmc1=load mmc 1 ${loadaddr} arimg.ugz && run startsys\0" \ |
| 44 | "b_def=sf read ${loadaddr} 100000 700000; run startsys\0" \ |
| 45 | "b_net=tftp ${scradr} netscript.img && source ${scradr}\0" \ |
| 46 | "b_usb0=usb start && load usb 0 ${scradr} bootscr.img && source ${scradr}\0" \ |
| 47 | "b_default=run b_deftgts; for target in ${b_tgts};"\ |
| 48 | " do run b_${target}; if test ${b_break} = 1; then; exit; fi; done\0" \ |
| 49 | "vxargs=setenv bootargs cpsw(0,0)host:vxWorks h=${serverip}" \ |
| 50 | " e=${ipaddr}:${netmask} g=${gatewayip} u=vxWorksFTP pw=vxWorks\0" \ |
| 51 | "vxfdt=fdt addr ${dtbaddr}; fdt resize 0x8000;" \ |
| 52 | " fdt boardsetup\0" \ |
| 53 | "startsys=run vxargs && mw 0x80001100 0 && run vxfdt &&" \ |
| 54 | " bootm ${loadaddr} - ${dtbaddr}\0" |
Hannes Schmelzer | 60df809 | 2019-08-01 07:04:46 +0200 | [diff] [blame] | 55 | |
Hannes Schmelzer | 60df809 | 2019-08-01 07:04:46 +0200 | [diff] [blame] | 56 | /* SPI Flash */ |
Hannes Schmelzer | 60df809 | 2019-08-01 07:04:46 +0200 | [diff] [blame] | 57 | |
| 58 | /* Environment */ |
Hannes Schmelzer | 60df809 | 2019-08-01 07:04:46 +0200 | [diff] [blame] | 59 | #endif /* __CONFIG_BRSMARC1_H__ */ |