blob: c18445816e52f43a84e5f7112561d484df8d29d0 [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>
17/* ------------------------------------------------------------------------- */
18#define CONFIG_BOARD_TYPES
19
20/* memory */
21#define CONFIG_SYS_MALLOC_LEN (5 * 1024 * 1024)
22#define CONFIG_SYS_BOOTM_LEN (32 * 1024 * 1024)
23
24/* Clock Defines */
25#define V_OSCK 26000000 /* Clock output from T2 */
26#define V_SCLK (V_OSCK)
27
28#define CONFIG_MACH_TYPE 3589
29
30#ifndef CONFIG_SPL_BUILD
31
32/* Default environment */
33#define CONFIG_EXTRA_ENV_SETTINGS \
34BUR_COMMON_ENV \
35"autoload=0\0" \
36"scradr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
37"cfgscr=mw ${dtbaddr} 0;" \
38" sf probe && sf read ${scradr} 0xC0000 0x10000 && source ${scradr};" \
39" fdt addr ${dtbaddr} || cp ${fdtcontroladdr} ${dtbaddr} 4000\0" \
40"dtbaddr=0x84000000\0" \
41"loadaddr=0x82000000\0" \
42"b_break=0\0" \
43"b_tgts_std=mmc0 mmc1 def net usb0\0" \
44"b_tgts_rcy=def net usb0\0" \
45"b_tgts_pme=net usb0 mmc0 mmc1\0" \
46"b_deftgts=if test ${b_mode} = 12; then setenv b_tgts ${b_tgts_pme};" \
47" elif test ${b_mode} = 0; then setenv b_tgts ${b_tgts_rcy};" \
48" else setenv b_tgts ${b_tgts_std}; fi\0" \
49"b_mmc0=load mmc 1 ${scradr} bootscr.img && source ${scradr}\0" \
50"b_mmc1=load mmc 1 ${loadaddr} arimg.ugz && run startsys\0" \
51"b_def=sf read ${loadaddr} 100000 700000; run startsys\0" \
52"b_net=tftp ${scradr} netscript.img && source ${scradr}\0" \
53"b_usb0=usb start && load usb 0 ${scradr} bootscr.img && source ${scradr}\0" \
54"b_default=run b_deftgts; for target in ${b_tgts};"\
55" do run b_${target}; if test ${b_break} = 1; then; exit; fi; done\0" \
56"vxargs=setenv bootargs cpsw(0,0)host:vxWorks h=${serverip}" \
57" e=${ipaddr}:${netmask} g=${gatewayip} u=vxWorksFTP pw=vxWorks\0" \
58"vxfdt=fdt addr ${dtbaddr}; fdt resize 0x8000;" \
59" fdt boardsetup\0" \
60"startsys=run vxargs && mw 0x80001100 0 && run vxfdt &&" \
61" bootm ${loadaddr} - ${dtbaddr}\0"
62#endif /* !CONFIG_SPL_BUILD*/
63
64/* undefine command which we not need here */
65#undef CONFIG_BOOTM_NETBSD
66#undef CONFIG_BOOTM_PLAN9
67#undef CONFIG_BOOTM_RTEMS
68
69/* Support both device trees and ATAGs. */
70#define CONFIG_CMDLINE_TAG
71#define CONFIG_SETUP_MEMORY_TAGS
72#define CONFIG_INITRD_TAG
73
74/* SPI Flash */
75#define CONFIG_SYS_SPI_U_BOOT_OFFS 0x40000
76
77/* Environment */
78#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
79#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + \
80 CONFIG_ENV_SECT_SIZE)
81
82#define CONFIG_CONS_INDEX 1
83#endif /* __CONFIG_BRSMARC1_H__ */