blob: ed9b5cce6acd08ce625c2da59d4582ed907ae266 [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
9#include <asm/arch/socfpga_base_addrs.h>
10
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
21#define CONFIG_CMD_DHCP
22#define CONFIG_CMD_EXT4
23#define CONFIG_CMD_EXT4_WRITE
24#define CONFIG_CMD_FAT
25#define CONFIG_CMD_FS_GENERIC
26#define CONFIG_CMD_GPIO
27#define CONFIG_CMD_GREPENV
28#define CONFIG_CMD_MII
29#define CONFIG_CMD_MMC
30#define CONFIG_CMD_PING
31#define CONFIG_CMD_USB
32#define CONFIG_CMD_USB_MASS_STORAGE
33
34/* Memory configurations */
35#define PHYS_SDRAM_1_SIZE 0x40000000 /* 1GiB on MCV */
36
37/* Booting Linux */
38#define CONFIG_BOOTDELAY 3
39#define CONFIG_BOOTFILE "fitImage"
40#define CONFIG_BOOTARGS "console=ttyS0," __stringify(CONFIG_BAUDRATE)
41#define CONFIG_PREBOOT "run try_bootscript"
42#define CONFIG_BOOTCOMMAND "run mmc_mmc"
43#define CONFIG_LOADADDR 0x01000000
44#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
45
Dinh Nguyen813e7e62015-09-23 15:38:01 -050046#define CONFIG_ENV_IS_NOWHERE
47
Marek Vasut8e8b62a2015-08-03 01:37:28 +020048/* USB */
49#ifdef CONFIG_CMD_USB
50#define CONFIG_USB_DWC2_REG_ADDR SOCFPGA_USB1_ADDRESS
51#endif
52#define CONFIG_G_DNL_MANUFACTURER "DENX"
53
54/* Extra Environment */
55#define CONFIG_HOSTNAME mcvevk
56
57#define CONFIG_EXTRA_ENV_SETTINGS \
58 "consdev=ttyS0\0" \
59 "baudrate=115200\0" \
60 "bootscript=boot.scr\0" \
61 "bootdev=/dev/mmcblk0p2\0" \
62 "rootdev=/dev/mmcblk0p3\0" \
63 "netdev=eth0\0" \
64 "hostname=mcvevk\0" \
65 "kernel_addr_r=0x10000000\0" \
66 "update_filename=u-boot-with-spl-dtb.sfp\0" \
67 "update_sd_offset=0x800\0" \
68 "update_sd=" /* Update the SD firmware partition */ \
69 "if mmc rescan ; then " \
70 "if tftp ${update_filename} ; then " \
71 "setexpr fw_sz ${filesize} / 0x200 ; " /* SD block size */ \
72 "setexpr fw_sz ${fw_sz} + 1 ; " \
73 "mmc write ${loadaddr} ${update_sd_offset} ${fw_sz} ; " \
74 "fi ; " \
75 "fi\0" \
76 "update_qspi_offset=0x0\0" \
77 "update_qspi=" /* Update the QSPI firmware */ \
78 "if sf probe ; then " \
79 "if tftp ${update_filename} ; then " \
80 "sf update ${loadaddr} ${update_qspi_offset} ${filesize} ; " \
81 "fi ; " \
82 "fi\0" \
83 "fpga_filename=output_file.rbf\0" \
84 "load_fpga=" /* Load FPGA bitstream */ \
85 "if tftp ${fpga_filename} ; then " \
86 "fpga load 0 $loadaddr $filesize ; " \
87 "bridge enable ; " \
88 "fi\0" \
89 "addcons=" \
90 "setenv bootargs ${bootargs} " \
91 "console=${consdev},${baudrate}\0" \
92 "addip=" \
93 "setenv bootargs ${bootargs} " \
94 "ip=${ipaddr}:${serverip}:${gatewayip}:" \
95 "${netmask}:${hostname}:${netdev}:off\0" \
96 "addmisc=" \
97 "setenv bootargs ${bootargs} ${miscargs}\0" \
98 "addargs=run addcons addmisc\0" \
99 "mmcload=" \
100 "mmc rescan ; " \
101 "load mmc 0:2 ${kernel_addr_r} ${bootfile}\0" \
102 "netload=" \
103 "tftp ${kernel_addr_r} ${hostname}/${bootfile}\0" \
104 "miscargs=nohlt panic=1\0" \
105 "mmcargs=setenv bootargs root=${rootdev} rw rootwait\0" \
106 "nfsargs=" \
107 "setenv bootargs root=/dev/nfs rw " \
108 "nfsroot=${serverip}:${rootpath},v3,tcp\0" \
109 "mmc_mmc=" \
110 "run mmcload mmcargs addargs ; " \
111 "bootm ${kernel_addr_r}\0" \
112 "mmc_nfs=" \
113 "run mmcload nfsargs addip addargs ; " \
114 "bootm ${kernel_addr_r}\0" \
115 "net_mmc=" \
116 "run netload mmcargs addargs ; " \
117 "bootm ${kernel_addr_r}\0" \
118 "net_nfs=" \
119 "run netload nfsargs addip addargs ; " \
120 "bootm ${kernel_addr_r}\0" \
121 "try_bootscript=" \
122 "mmc rescan;" \
123 "if test -e mmc 0:2 ${bootscript} ; then " \
124 "if load mmc 0:2 ${kernel_addr_r} ${bootscript};" \
125 "then ; " \
126 "echo Running bootscript... ; " \
127 "source ${kernel_addr_r} ; " \
128 "fi ; " \
129 "fi\0"
130
131/* The rest of the configuration is shared */
132#include <configs/socfpga_common.h>
133
134#endif /* __CONFIG_DENX_MCVEVK_H__ */