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