Marek Vasut | 8e8b62a | 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 | eca8b5c | 2015-11-23 17:27:17 -0600 | [diff] [blame^] | 9 | #include <asm/arch/base_addr_ac5.h> |
Marek Vasut | 8e8b62a | 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 | 8e8b62a | 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 | 2febc66 | 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 |
| 48 | #define CONFIG_SYS_MMC_ENV_DEV 0 /* device 0 */ |
| 49 | #define CONFIG_ENV_OFFSET 512 /* just after the MBR */ |
Dinh Nguyen | 813e7e6 | 2015-09-23 15:38:01 -0500 | [diff] [blame] | 50 | |
Marek Vasut | 8e8b62a | 2015-08-03 01:37:28 +0200 | [diff] [blame] | 51 | /* USB */ |
| 52 | #ifdef CONFIG_CMD_USB |
| 53 | #define CONFIG_USB_DWC2_REG_ADDR SOCFPGA_USB1_ADDRESS |
| 54 | #endif |
| 55 | #define CONFIG_G_DNL_MANUFACTURER "DENX" |
| 56 | |
| 57 | /* Extra Environment */ |
| 58 | #define CONFIG_HOSTNAME mcvevk |
| 59 | |
| 60 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 61 | "consdev=ttyS0\0" \ |
| 62 | "baudrate=115200\0" \ |
| 63 | "bootscript=boot.scr\0" \ |
| 64 | "bootdev=/dev/mmcblk0p2\0" \ |
| 65 | "rootdev=/dev/mmcblk0p3\0" \ |
| 66 | "netdev=eth0\0" \ |
| 67 | "hostname=mcvevk\0" \ |
| 68 | "kernel_addr_r=0x10000000\0" \ |
| 69 | "update_filename=u-boot-with-spl-dtb.sfp\0" \ |
| 70 | "update_sd_offset=0x800\0" \ |
| 71 | "update_sd=" /* Update the SD firmware partition */ \ |
| 72 | "if mmc rescan ; then " \ |
| 73 | "if tftp ${update_filename} ; then " \ |
| 74 | "setexpr fw_sz ${filesize} / 0x200 ; " /* SD block size */ \ |
| 75 | "setexpr fw_sz ${fw_sz} + 1 ; " \ |
| 76 | "mmc write ${loadaddr} ${update_sd_offset} ${fw_sz} ; " \ |
| 77 | "fi ; " \ |
| 78 | "fi\0" \ |
| 79 | "update_qspi_offset=0x0\0" \ |
| 80 | "update_qspi=" /* Update the QSPI firmware */ \ |
| 81 | "if sf probe ; then " \ |
| 82 | "if tftp ${update_filename} ; then " \ |
| 83 | "sf update ${loadaddr} ${update_qspi_offset} ${filesize} ; " \ |
| 84 | "fi ; " \ |
| 85 | "fi\0" \ |
| 86 | "fpga_filename=output_file.rbf\0" \ |
| 87 | "load_fpga=" /* Load FPGA bitstream */ \ |
| 88 | "if tftp ${fpga_filename} ; then " \ |
| 89 | "fpga load 0 $loadaddr $filesize ; " \ |
| 90 | "bridge enable ; " \ |
| 91 | "fi\0" \ |
| 92 | "addcons=" \ |
| 93 | "setenv bootargs ${bootargs} " \ |
| 94 | "console=${consdev},${baudrate}\0" \ |
| 95 | "addip=" \ |
| 96 | "setenv bootargs ${bootargs} " \ |
| 97 | "ip=${ipaddr}:${serverip}:${gatewayip}:" \ |
| 98 | "${netmask}:${hostname}:${netdev}:off\0" \ |
| 99 | "addmisc=" \ |
| 100 | "setenv bootargs ${bootargs} ${miscargs}\0" \ |
| 101 | "addargs=run addcons addmisc\0" \ |
| 102 | "mmcload=" \ |
| 103 | "mmc rescan ; " \ |
| 104 | "load mmc 0:2 ${kernel_addr_r} ${bootfile}\0" \ |
| 105 | "netload=" \ |
| 106 | "tftp ${kernel_addr_r} ${hostname}/${bootfile}\0" \ |
| 107 | "miscargs=nohlt panic=1\0" \ |
| 108 | "mmcargs=setenv bootargs root=${rootdev} rw rootwait\0" \ |
| 109 | "nfsargs=" \ |
| 110 | "setenv bootargs root=/dev/nfs rw " \ |
| 111 | "nfsroot=${serverip}:${rootpath},v3,tcp\0" \ |
| 112 | "mmc_mmc=" \ |
| 113 | "run mmcload mmcargs addargs ; " \ |
| 114 | "bootm ${kernel_addr_r}\0" \ |
| 115 | "mmc_nfs=" \ |
| 116 | "run mmcload nfsargs addip addargs ; " \ |
| 117 | "bootm ${kernel_addr_r}\0" \ |
| 118 | "net_mmc=" \ |
| 119 | "run netload mmcargs addargs ; " \ |
| 120 | "bootm ${kernel_addr_r}\0" \ |
| 121 | "net_nfs=" \ |
| 122 | "run netload nfsargs addip addargs ; " \ |
| 123 | "bootm ${kernel_addr_r}\0" \ |
| 124 | "try_bootscript=" \ |
| 125 | "mmc rescan;" \ |
| 126 | "if test -e mmc 0:2 ${bootscript} ; then " \ |
| 127 | "if load mmc 0:2 ${kernel_addr_r} ${bootscript};" \ |
| 128 | "then ; " \ |
| 129 | "echo Running bootscript... ; " \ |
| 130 | "source ${kernel_addr_r} ; " \ |
| 131 | "fi ; " \ |
| 132 | "fi\0" |
| 133 | |
| 134 | /* The rest of the configuration is shared */ |
| 135 | #include <configs/socfpga_common.h> |
| 136 | |
| 137 | #endif /* __CONFIG_DENX_MCVEVK_H__ */ |