blob: f0fb43a82f3a5bf8ef62eb8fecdae4cb5b958f36 [file] [log] [blame]
Marek Vasut8e8b62a2015-08-03 01:37:28 +02001/*
2 * Copyright (C) 2015 Marek Vasut <marex@denx.de>
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6#ifndef __CONFIG_DENX_MCVEVK_H__
7#define __CONFIG_DENX_MCVEVK_H__
8
Dinh Nguyeneca8b5c2015-11-23 17:27:17 -06009#include <asm/arch/base_addr_ac5.h>
Marek Vasut8e8b62a2015-08-03 01:37:28 +020010
11/* U-Boot Commands */
12#define CONFIG_SYS_NO_FLASH
13#define CONFIG_DOS_PARTITION
14#define CONFIG_FAT_WRITE
15#define CONFIG_HW_WATCHDOG
16
Marek Vasut8e8b62a2015-08-03 01:37:28 +020017/* Memory configurations */
18#define PHYS_SDRAM_1_SIZE 0x40000000 /* 1GiB on MCV */
19
20/* Booting Linux */
21#define CONFIG_BOOTDELAY 3
22#define CONFIG_BOOTFILE "fitImage"
23#define CONFIG_BOOTARGS "console=ttyS0," __stringify(CONFIG_BAUDRATE)
24#define CONFIG_PREBOOT "run try_bootscript"
25#define CONFIG_BOOTCOMMAND "run mmc_mmc"
26#define CONFIG_LOADADDR 0x01000000
27#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
28
Marek Vasut2febc662015-09-24 09:06:06 +020029/* Environment is in MMC */
30#define CONFIG_ENV_OVERWRITE
31#define CONFIG_ENV_IS_IN_MMC
Dinh Nguyen813e7e62015-09-23 15:38:01 -050032
Marek Vasut8e8b62a2015-08-03 01:37:28 +020033/* Extra Environment */
Marek Vasut8e8b62a2015-08-03 01:37:28 +020034#define CONFIG_EXTRA_ENV_SETTINGS \
35 "consdev=ttyS0\0" \
36 "baudrate=115200\0" \
37 "bootscript=boot.scr\0" \
38 "bootdev=/dev/mmcblk0p2\0" \
39 "rootdev=/dev/mmcblk0p3\0" \
40 "netdev=eth0\0" \
41 "hostname=mcvevk\0" \
42 "kernel_addr_r=0x10000000\0" \
Simon Glass7bdddb02016-01-31 18:10:53 -070043 "update_filename=u-boot-with-spl.sfp\0" \
Marek Vasut8e8b62a2015-08-03 01:37:28 +020044 "update_sd_offset=0x800\0" \
45 "update_sd=" /* Update the SD firmware partition */ \
46 "if mmc rescan ; then " \
47 "if tftp ${update_filename} ; then " \
48 "setexpr fw_sz ${filesize} / 0x200 ; " /* SD block size */ \
49 "setexpr fw_sz ${fw_sz} + 1 ; " \
50 "mmc write ${loadaddr} ${update_sd_offset} ${fw_sz} ; " \
51 "fi ; " \
52 "fi\0" \
53 "update_qspi_offset=0x0\0" \
54 "update_qspi=" /* Update the QSPI firmware */ \
55 "if sf probe ; then " \
56 "if tftp ${update_filename} ; then " \
57 "sf update ${loadaddr} ${update_qspi_offset} ${filesize} ; " \
58 "fi ; " \
59 "fi\0" \
60 "fpga_filename=output_file.rbf\0" \
61 "load_fpga=" /* Load FPGA bitstream */ \
62 "if tftp ${fpga_filename} ; then " \
63 "fpga load 0 $loadaddr $filesize ; " \
64 "bridge enable ; " \
65 "fi\0" \
66 "addcons=" \
67 "setenv bootargs ${bootargs} " \
68 "console=${consdev},${baudrate}\0" \
69 "addip=" \
70 "setenv bootargs ${bootargs} " \
71 "ip=${ipaddr}:${serverip}:${gatewayip}:" \
72 "${netmask}:${hostname}:${netdev}:off\0" \
73 "addmisc=" \
74 "setenv bootargs ${bootargs} ${miscargs}\0" \
75 "addargs=run addcons addmisc\0" \
76 "mmcload=" \
77 "mmc rescan ; " \
78 "load mmc 0:2 ${kernel_addr_r} ${bootfile}\0" \
79 "netload=" \
80 "tftp ${kernel_addr_r} ${hostname}/${bootfile}\0" \
81 "miscargs=nohlt panic=1\0" \
82 "mmcargs=setenv bootargs root=${rootdev} rw rootwait\0" \
83 "nfsargs=" \
84 "setenv bootargs root=/dev/nfs rw " \
85 "nfsroot=${serverip}:${rootpath},v3,tcp\0" \
86 "mmc_mmc=" \
87 "run mmcload mmcargs addargs ; " \
88 "bootm ${kernel_addr_r}\0" \
89 "mmc_nfs=" \
90 "run mmcload nfsargs addip addargs ; " \
91 "bootm ${kernel_addr_r}\0" \
92 "net_mmc=" \
93 "run netload mmcargs addargs ; " \
94 "bootm ${kernel_addr_r}\0" \
95 "net_nfs=" \
96 "run netload nfsargs addip addargs ; " \
97 "bootm ${kernel_addr_r}\0" \
98 "try_bootscript=" \
99 "mmc rescan;" \
100 "if test -e mmc 0:2 ${bootscript} ; then " \
101 "if load mmc 0:2 ${kernel_addr_r} ${bootscript};" \
102 "then ; " \
103 "echo Running bootscript... ; " \
104 "source ${kernel_addr_r} ; " \
105 "fi ; " \
106 "fi\0"
107
108/* The rest of the configuration is shared */
109#include <configs/socfpga_common.h>
110
111#endif /* __CONFIG_DENX_MCVEVK_H__ */