blob: f1cfe21a899466b31e51de6343902ec79731e1aa [file] [log] [blame]
Marek Vasutd88995a2015-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 Nguyen871c24b2015-11-23 17:27:17 -06009#include <asm/arch/base_addr_ac5.h>
Marek Vasutd88995a2015-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
17#define CONFIG_CMD_ASKENV
18#define CONFIG_CMD_BOOTZ
19#define CONFIG_CMD_CACHE
20#define CONFIG_CMD_DFU
Marek Vasutd88995a2015-08-03 01:37:28 +020021#define CONFIG_CMD_EXT4
22#define CONFIG_CMD_EXT4_WRITE
23#define CONFIG_CMD_FAT
24#define CONFIG_CMD_FS_GENERIC
Marek Vasutd88995a2015-08-03 01:37:28 +020025#define CONFIG_CMD_GREPENV
26#define CONFIG_CMD_MII
27#define CONFIG_CMD_MMC
Marek Vasutd88995a2015-08-03 01:37:28 +020028#define CONFIG_CMD_USB_MASS_STORAGE
29
30/* Memory configurations */
31#define PHYS_SDRAM_1_SIZE 0x40000000 /* 1GiB on MCV */
32
33/* Booting Linux */
34#define CONFIG_BOOTDELAY 3
35#define CONFIG_BOOTFILE "fitImage"
36#define CONFIG_BOOTARGS "console=ttyS0," __stringify(CONFIG_BAUDRATE)
37#define CONFIG_PREBOOT "run try_bootscript"
38#define CONFIG_BOOTCOMMAND "run mmc_mmc"
39#define CONFIG_LOADADDR 0x01000000
40#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
41
Marek Vasutaad604a2015-09-24 09:06:06 +020042/* Environment is in MMC */
43#define CONFIG_ENV_OVERWRITE
44#define CONFIG_ENV_IS_IN_MMC
Dinh Nguyen68a3e322015-09-23 15:38:01 -050045
Marek Vasutd88995a2015-08-03 01:37:28 +020046/* Extra Environment */
Marek Vasutd88995a2015-08-03 01:37:28 +020047#define CONFIG_EXTRA_ENV_SETTINGS \
48 "consdev=ttyS0\0" \
49 "baudrate=115200\0" \
50 "bootscript=boot.scr\0" \
51 "bootdev=/dev/mmcblk0p2\0" \
52 "rootdev=/dev/mmcblk0p3\0" \
53 "netdev=eth0\0" \
54 "hostname=mcvevk\0" \
55 "kernel_addr_r=0x10000000\0" \
Simon Glassbd7dc382016-01-31 18:10:53 -070056 "update_filename=u-boot-with-spl.sfp\0" \
Marek Vasutd88995a2015-08-03 01:37:28 +020057 "update_sd_offset=0x800\0" \
58 "update_sd=" /* Update the SD firmware partition */ \
59 "if mmc rescan ; then " \
60 "if tftp ${update_filename} ; then " \
61 "setexpr fw_sz ${filesize} / 0x200 ; " /* SD block size */ \
62 "setexpr fw_sz ${fw_sz} + 1 ; " \
63 "mmc write ${loadaddr} ${update_sd_offset} ${fw_sz} ; " \
64 "fi ; " \
65 "fi\0" \
66 "update_qspi_offset=0x0\0" \
67 "update_qspi=" /* Update the QSPI firmware */ \
68 "if sf probe ; then " \
69 "if tftp ${update_filename} ; then " \
70 "sf update ${loadaddr} ${update_qspi_offset} ${filesize} ; " \
71 "fi ; " \
72 "fi\0" \
73 "fpga_filename=output_file.rbf\0" \
74 "load_fpga=" /* Load FPGA bitstream */ \
75 "if tftp ${fpga_filename} ; then " \
76 "fpga load 0 $loadaddr $filesize ; " \
77 "bridge enable ; " \
78 "fi\0" \
79 "addcons=" \
80 "setenv bootargs ${bootargs} " \
81 "console=${consdev},${baudrate}\0" \
82 "addip=" \
83 "setenv bootargs ${bootargs} " \
84 "ip=${ipaddr}:${serverip}:${gatewayip}:" \
85 "${netmask}:${hostname}:${netdev}:off\0" \
86 "addmisc=" \
87 "setenv bootargs ${bootargs} ${miscargs}\0" \
88 "addargs=run addcons addmisc\0" \
89 "mmcload=" \
90 "mmc rescan ; " \
91 "load mmc 0:2 ${kernel_addr_r} ${bootfile}\0" \
92 "netload=" \
93 "tftp ${kernel_addr_r} ${hostname}/${bootfile}\0" \
94 "miscargs=nohlt panic=1\0" \
95 "mmcargs=setenv bootargs root=${rootdev} rw rootwait\0" \
96 "nfsargs=" \
97 "setenv bootargs root=/dev/nfs rw " \
98 "nfsroot=${serverip}:${rootpath},v3,tcp\0" \
99 "mmc_mmc=" \
100 "run mmcload mmcargs addargs ; " \
101 "bootm ${kernel_addr_r}\0" \
102 "mmc_nfs=" \
103 "run mmcload nfsargs addip addargs ; " \
104 "bootm ${kernel_addr_r}\0" \
105 "net_mmc=" \
106 "run netload mmcargs addargs ; " \
107 "bootm ${kernel_addr_r}\0" \
108 "net_nfs=" \
109 "run netload nfsargs addip addargs ; " \
110 "bootm ${kernel_addr_r}\0" \
111 "try_bootscript=" \
112 "mmc rescan;" \
113 "if test -e mmc 0:2 ${bootscript} ; then " \
114 "if load mmc 0:2 ${kernel_addr_r} ${bootscript};" \
115 "then ; " \
116 "echo Running bootscript... ; " \
117 "source ${kernel_addr_r} ; " \
118 "fi ; " \
119 "fi\0"
120
121/* The rest of the configuration is shared */
122#include <configs/socfpga_common.h>
123
124#endif /* __CONFIG_DENX_MCVEVK_H__ */