blob: d1b31c4cfa3550760f4400bf241de2cd3ac30d1c [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 */
Marek Vasut8e8b62a2015-08-03 01:37:28 +020021#define CONFIG_BOOTFILE "fitImage"
22#define CONFIG_BOOTARGS "console=ttyS0," __stringify(CONFIG_BAUDRATE)
23#define CONFIG_PREBOOT "run try_bootscript"
24#define CONFIG_BOOTCOMMAND "run mmc_mmc"
25#define CONFIG_LOADADDR 0x01000000
26#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
27
Marek Vasut2febc662015-09-24 09:06:06 +020028/* Environment is in MMC */
29#define CONFIG_ENV_OVERWRITE
30#define CONFIG_ENV_IS_IN_MMC
Dinh Nguyen813e7e62015-09-23 15:38:01 -050031
Marek Vasut8e8b62a2015-08-03 01:37:28 +020032/* Extra Environment */
Marek Vasut8e8b62a2015-08-03 01:37:28 +020033#define CONFIG_EXTRA_ENV_SETTINGS \
34 "consdev=ttyS0\0" \
35 "baudrate=115200\0" \
36 "bootscript=boot.scr\0" \
37 "bootdev=/dev/mmcblk0p2\0" \
38 "rootdev=/dev/mmcblk0p3\0" \
39 "netdev=eth0\0" \
40 "hostname=mcvevk\0" \
41 "kernel_addr_r=0x10000000\0" \
Simon Glass7bdddb02016-01-31 18:10:53 -070042 "update_filename=u-boot-with-spl.sfp\0" \
Marek Vasut8e8b62a2015-08-03 01:37:28 +020043 "update_sd_offset=0x800\0" \
44 "update_sd=" /* Update the SD firmware partition */ \
45 "if mmc rescan ; then " \
46 "if tftp ${update_filename} ; then " \
47 "setexpr fw_sz ${filesize} / 0x200 ; " /* SD block size */ \
48 "setexpr fw_sz ${fw_sz} + 1 ; " \
49 "mmc write ${loadaddr} ${update_sd_offset} ${fw_sz} ; " \
50 "fi ; " \
51 "fi\0" \
52 "update_qspi_offset=0x0\0" \
53 "update_qspi=" /* Update the QSPI firmware */ \
54 "if sf probe ; then " \
55 "if tftp ${update_filename} ; then " \
56 "sf update ${loadaddr} ${update_qspi_offset} ${filesize} ; " \
57 "fi ; " \
58 "fi\0" \
59 "fpga_filename=output_file.rbf\0" \
60 "load_fpga=" /* Load FPGA bitstream */ \
61 "if tftp ${fpga_filename} ; then " \
62 "fpga load 0 $loadaddr $filesize ; " \
63 "bridge enable ; " \
64 "fi\0" \
65 "addcons=" \
66 "setenv bootargs ${bootargs} " \
67 "console=${consdev},${baudrate}\0" \
68 "addip=" \
69 "setenv bootargs ${bootargs} " \
70 "ip=${ipaddr}:${serverip}:${gatewayip}:" \
71 "${netmask}:${hostname}:${netdev}:off\0" \
72 "addmisc=" \
73 "setenv bootargs ${bootargs} ${miscargs}\0" \
74 "addargs=run addcons addmisc\0" \
75 "mmcload=" \
76 "mmc rescan ; " \
77 "load mmc 0:2 ${kernel_addr_r} ${bootfile}\0" \
78 "netload=" \
79 "tftp ${kernel_addr_r} ${hostname}/${bootfile}\0" \
80 "miscargs=nohlt panic=1\0" \
81 "mmcargs=setenv bootargs root=${rootdev} rw rootwait\0" \
82 "nfsargs=" \
83 "setenv bootargs root=/dev/nfs rw " \
84 "nfsroot=${serverip}:${rootpath},v3,tcp\0" \
85 "mmc_mmc=" \
86 "run mmcload mmcargs addargs ; " \
87 "bootm ${kernel_addr_r}\0" \
88 "mmc_nfs=" \
89 "run mmcload nfsargs addip addargs ; " \
90 "bootm ${kernel_addr_r}\0" \
91 "net_mmc=" \
92 "run netload mmcargs addargs ; " \
93 "bootm ${kernel_addr_r}\0" \
94 "net_nfs=" \
95 "run netload nfsargs addip addargs ; " \
96 "bootm ${kernel_addr_r}\0" \
97 "try_bootscript=" \
98 "mmc rescan;" \
99 "if test -e mmc 0:2 ${bootscript} ; then " \
100 "if load mmc 0:2 ${kernel_addr_r} ${bootscript};" \
101 "then ; " \
102 "echo Running bootscript... ; " \
103 "source ${kernel_addr_r} ; " \
104 "fi ; " \
105 "fi\0"
106
107/* The rest of the configuration is shared */
108#include <configs/socfpga_common.h>
109
110#endif /* __CONFIG_DENX_MCVEVK_H__ */