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