1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright (C) 2015 Marek Vasut <marex@denx.de>
4  */
5 #ifndef __CONFIG_ARIES_MCVEVK_H__
6 #define __CONFIG_ARIES_MCVEVK_H__
7 
8 #include <asm/arch/base_addr_ac5.h>
9 
10 /* Memory configurations */
11 #define PHYS_SDRAM_1_SIZE		0x40000000	/* 1GiB on MCV */
12 
13 /* Booting Linux */
14 #define CONFIG_BOOTFILE		"fitImage"
15 #define CONFIG_BOOTCOMMAND	"run mmc_mmc"
16 #define CONFIG_LOADADDR		0x01000000
17 #define CONFIG_SYS_LOAD_ADDR	CONFIG_LOADADDR
18 
19 /* Environment is in MMC */
20 
21 /* Extra Environment */
22 #define CONFIG_EXTRA_ENV_SETTINGS					\
23 	"consdev=ttyS0\0"						\
24 	"baudrate=115200\0"						\
25 	"bootscript=boot.scr\0"						\
26 	"setuuid=part uuid mmc 0:3 uuid\0"				\
27 	"netdev=eth0\0"							\
28 	"hostname=mcvevk\0"						\
29 	"kernel_addr_r=0x10000000\0"					\
30 	"socfpga_legacy_reset_compat=1\0"				\
31 	"bootm_size=0xa000000\0"					\
32 	"dfu_alt_info=mmc raw 0 3867148288\0"				\
33 	"update_filename=u-boot-with-spl.sfp\0"				\
34 	"update_sd_offset=0x800\0"					\
35 	"update_sd="		/* Update the SD firmware partition */	\
36 		"if mmc rescan ; then "					\
37 		"if tftp ${update_filename} ; then "			\
38 		"setexpr fw_sz ${filesize} / 0x200 ; "	/* SD block size */ \
39 		"setexpr fw_sz ${fw_sz} + 1 ; "				\
40 		"mmc write ${loadaddr} ${update_sd_offset} ${fw_sz} ; "	\
41 		"fi ; "							\
42 		"fi\0"							\
43 	"update_qspi_offset=0x0\0"					\
44 	"update_qspi="		/* Update the QSPI firmware */		\
45 		"if sf probe ; then "					\
46 		"if tftp ${update_filename} ; then "			\
47 		"sf update ${loadaddr} ${update_qspi_offset} ${filesize} ; " \
48 		"fi ; "							\
49 		"fi\0"							\
50 	"fpga_filename=output_file.rbf\0"				\
51 	"load_fpga="		/* Load FPGA bitstream */		\
52 		"if tftp ${fpga_filename} ; then "			\
53 		"fpga load 0 $loadaddr $filesize ; "			\
54 		"bridge enable ; "					\
55 		"fi\0"							\
56 	"addcons="							\
57 		"setenv bootargs ${bootargs} "				\
58 		"console=${consdev},${baudrate}\0"			\
59 	"addip="							\
60 		"setenv bootargs ${bootargs} "				\
61 		"ip=${ipaddr}:${serverip}:${gatewayip}:"		\
62 			"${netmask}:${hostname}:${netdev}:off\0"	\
63 	"addmisc="							\
64 		"setenv bootargs ${bootargs} ${miscargs}\0"		\
65 	"addargs=run addcons addmisc\0"					\
66 	"mmcload="							\
67 		"mmc rescan ; "						\
68 		"load mmc 0:2 ${kernel_addr_r} ${bootfile}\0"		\
69 	"netload="							\
70 		"tftp ${kernel_addr_r} ${hostname}/${bootfile}\0"	\
71 	"miscargs=nohlt panic=1\0"					\
72 	"mmcargs=setenv bootargs root=PARTUUID=${uuid} rw rootwait\0"	\
73 	"nfsargs="							\
74 		"setenv bootargs root=/dev/nfs rw "			\
75 			"nfsroot=${serverip}:${rootpath},v3,tcp\0"	\
76 	"mmc_mmc="							\
77 	"run mmcload setuuid mmcargs addargs ; "			\
78 		"bootm ${kernel_addr_r}\0"				\
79 	"mmc_nfs="							\
80 		"run mmcload nfsargs addip addargs ; "			\
81 		"bootm ${kernel_addr_r}\0"				\
82 	"net_mmc="							\
83 	"run netload setuuid mmcargs addargs ; "			\
84 		"bootm ${kernel_addr_r}\0"				\
85 	"net_nfs="							\
86 		"run netload nfsargs addip addargs ; "			\
87 		"bootm ${kernel_addr_r}\0"				\
88 	"try_bootscript="						\
89 		"mmc rescan;"						\
90 		"if test -e mmc 0:2 ${bootscript} ; then "		\
91 		"if load mmc 0:2 ${kernel_addr_r} ${bootscript};"	\
92 		"then ; "						\
93 			"echo Running bootscript... ; "			\
94 			"source ${kernel_addr_r} ; "			\
95 		"fi ; "							\
96 		"fi\0"
97 
98 /* The rest of the configuration is shared */
99 #include <configs/socfpga_common.h>
100 
101 #endif	/* __CONFIG_ARIES_MCVEVK_H__ */
102