1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright (C) 2015-2019 Marek Vasut <marex@denx.de>
5 #ifndef __CONFIG_SOFTING_VINING_FPGA_H__
6 #define __CONFIG_SOFTING_VINING_FPGA_H__
8 #include <asm/arch/base_addr_ac5.h>
10 /* Memory configurations */
11 #define PHYS_SDRAM_1_SIZE 0x40000000 /* 1GiB on VINING_FPGA */
14 #define CONFIG_SYS_BOOTM_LEN 0x2000000 /* 32 MiB */
16 /* Extra Environment */
17 #define CONFIG_HOSTNAME "socfpga_vining_fpga"
20 * Active LOW GPIO buttons:
21 * A: GPIO 77 ... the button between USB B and ethernet
22 * B: GPIO 78 ... the button between USB A ports
25 * if button B is pressed, boot recovery system after 10 seconds
26 * if force_boottype is set, boot system depending on the value in the
27 * $force_boottype variable after 1 second
28 * if button B is not pressed and force_boottype is not set, boot normal
29 * Linux system after 5 seconds
32 #define CONFIG_EXTRA_ENV_SETTINGS \
36 "bootscript=boot.scr\0" \
39 "ubipart=ubi0:vining-fpga-rootfs\0" \
40 "ubisfcs=1\0" /* Default is flash at CS#1 */ \
42 "hostname=vining_fpga\0" \
43 "kernel_addr_r=0x10000000\0" \
44 "fdt_addr_r=0x20000000\0" \
45 "fdt_high=0xffffffff\0" \
46 "initrd_high=0xffffffff\0" \
47 "dfu_alt_info=qspi0 sf 0:0;qspi1 sf 0:1\0" \
48 "mtdparts_0_16m=ff705000.spi.0:" /* 16MiB+128MiB SF config */ \
54 "-(rcvrfs)\0" /* Recovery */ \
55 "mtdparts_0_256m=ff705000.spi.0:" /* 256MiB(+256MiB) config */ \
61 "14720k(rcvrfs)," /* Recovery */ \
62 "192m(rootfs)," /* Root */ \
63 "-(userfs)\0" /* User */ \
64 "mtdparts_1_128m=ff705000.spi.1:" /* 16MiB+128MiB SF config */ \
67 "mtdparts_1_256m=ff705000.spi.1:" /* 256MiB+256MiB SF config */ \
69 "update_filename=u-boot-with-spl-dtb.sfp\0" \
70 "update_qspi_offset=0x0\0" \
71 "update_qspi=" /* Update the QSPI firmware */ \
72 "if sf probe ; then " \
73 "if tftp ${update_filename} ; then " \
74 "sf update ${loadaddr} ${update_qspi_offset} ${filesize} ; " \
78 "setenv sf_size_0 ; setenv sf_size_1 ; " \
79 "sf probe 0:0 && setenv sf_size_0 ${sf_size} ; " \
80 "sf probe 0:1 && setenv sf_size_1 ${sf_size} ; " \
81 "if test -z \"${sf_size_1}\" ; then " \
83 "setenv mtdparts_0 ${mtdparts_0_256m} ; " \
84 "setenv mtdparts_1 ; " \
85 "elif test \"${sf_size_0}\" = \"1000000\" ; then " \
86 /* 16MiB+128MiB SF */ \
87 "setenv mtdparts_0 ${mtdparts_0_16m} ; " \
88 "setenv mtdparts_1 ${mtdparts_1_128m} ; " \
90 /* 256MiB+256MiB SF */ \
91 "setenv mtdparts_0 ${mtdparts_0_256m} ; " \
92 "setenv mtdparts_1 ${mtdparts_1_256m} ; " \
94 "fpga_filename=output_file.rbf\0" \
95 "load_fpga=" /* Load FPGA bitstream */ \
96 "if tftp ${fpga_filename} ; then " \
97 "fpga load 0 $loadaddr $filesize ; " \
101 "setenv bootargs ${bootargs} " \
102 "console=${consdev},${baudrate}\0" \
104 "setenv bootargs ${bootargs} " \
105 "ip=${ipaddr}:${serverip}:${gatewayip}:" \
106 "${netmask}:${hostname}:${netdev}:off\0" \
108 "setenv bootargs ${bootargs} ${miscargs}\0" \
110 "if test -z \"${sf_size_1}\" ; then " \
111 "setenv mtdparts \"${mtdparts_0}\" ; " \
113 "setenv mtdparts \"${mtdparts_0};${mtdparts_1}\" ; " \
115 "setenv bootargs ${bootargs} mtdparts=${mtdparts}\0" \
116 "addargs=run addcons addmtd addmisc\0" \
118 "ubi part ${ubimtd} ; ubifsmount ${ubipart} ; " \
119 "ubifsload ${kernel_addr_r} /boot/${bootfile}\0" \
121 "tftp ${kernel_addr_r} ${hostname}/${bootfile}\0" \
122 "miscargs=nohlt panic=1\0" \
124 "setenv bootargs ubi.mtd=${ubimtdnr} " \
125 "root=${ubipart} rootfstype=ubifs\0" \
127 "setenv bootargs root=/dev/nfs rw " \
128 "nfsroot=${serverip}:${rootpath},v3,tcp\0" \
130 "if test \"${boottype}\" = \"rcvr\" ; then " \
131 "setenv ubisfcs 0 ; " \
132 "setenv ubimtd rcvrfs ; " \
133 "setenv ubimtdnr 5 ; " \
134 "setenv mtdparts mtdparts=${mtdparts_0} ; " \
135 "setenv mtdids nor0=ff705000.spi.0 ; " \
136 "setenv ubipart ubi0:vining-fpga-rootfs ; " \
138 "if test \"${sf_size_0}\" = \"1000000\" ; then "\
139 /* 16MiB+128MiB SF */ \
140 "setenv ubisfcs 1 ; " \
141 "setenv ubimtd rootfs ; " \
142 "setenv ubimtdnr 6 ; " \
143 "setenv mtdparts mtdparts=${mtdparts_1} ; " \
144 "setenv mtdids nor0=ff705000.spi.1 ; " \
145 "setenv ubipart ubi0:vining-fpga-rootfs ; " \
147 /* 256MiB(+256MiB) SF */ \
148 "setenv ubisfcs 0 ; " \
149 "setenv ubimtd rootfs ; " \
150 "setenv ubimtdnr 6 ; " \
151 "setenv mtdparts mtdparts=${mtdparts_0} ; " \
152 "setenv mtdids nor0=ff705000.spi.0 ; " \
153 "setenv ubipart ubi0:vining-fpga-rootfs ; " \
156 "sf probe 0:${ubisfcs}\0" \
158 "if test -z \"${sf_size_1}\" ; then " /* 1x256MiB SF */ \
159 "imxtract ${kernel_addr_r} fdt@1 ${fdt_addr_r} && " \
160 "fdt addr ${fdt_addr_r} && " \
162 "fdt set /soc/spi@ff705000/n25q00@1 status disabled && " \
163 "bootm ${kernel_addr_r}:kernel@1 - ${fdt_addr_r} ; " \
165 "bootm ${kernel_addr_r} ; " \
168 "run ubi_sfsel ubiload ubiargs addargs boot_kernel\0" \
170 "run ubiload nfsargs addip addargs boot_kernel\0" \
172 "run netload ubiargs addargs boot_kernel\0" \
174 "run netload nfsargs addip addargs boot_kernel\0" \
175 "selboot=" /* Select from where to boot. */ \
176 "run sf_identify ; " \
177 "if test \"${bootmode}\" = \"qspi\" ; then " \
179 "if test \"${boottype}\" = \"rcvr\" ; then " \
180 "echo \"Booting recovery system\" ; " \
181 "led 3 on ; " /* Bottom RED */ \
183 "led 1 on ; " /* Top RED */ \
185 "else echo \"Unsupported boot mode: \"${bootmode} ; " \
187 "socfpga_legacy_reset_compat=1\0"
189 /* The rest of the configuration is shared */
190 #include <configs/socfpga_common.h>
192 #endif /* __CONFIG_SOFTING_VINING_FPGA_H__ */