Added U-Boot SPI image instruction
This commit is contained in:
parent
3fd768addd
commit
354ca901b2
2 changed files with 119 additions and 4 deletions
96
docs/files/software/u-boot-armbian-boot-script-support.patch
Normal file
96
docs/files/software/u-boot-armbian-boot-script-support.patch
Normal file
|
@ -0,0 +1,96 @@
|
||||||
|
diff --git a/board/mv_ebu/a38x/mv_main_a38x.c b/board/mv_ebu/a38x/mv_main_a38x.c
|
||||||
|
index 0dce7f6..ecf60ec 100755
|
||||||
|
--- a/board/mv_ebu/a38x/mv_main_a38x.c
|
||||||
|
+++ b/board/mv_ebu/a38x/mv_main_a38x.c
|
||||||
|
@@ -331,6 +331,10 @@ void misc_init_r_env(void)
|
||||||
|
if (!env)
|
||||||
|
setenv("console", "console=ttyS0,115200");
|
||||||
|
|
||||||
|
+ env = getenv("fdtfile");
|
||||||
|
+ if (!env)
|
||||||
|
+ setenv("fdtfile", "armada-388-helios4.dtb");
|
||||||
|
+
|
||||||
|
env = getenv("mtdids");
|
||||||
|
if (!env) {
|
||||||
|
#if defined(MV_NAND) && defined(MV_INCLUDE_SPI)
|
||||||
|
@@ -679,25 +683,28 @@ void misc_init_r_env(void)
|
||||||
|
setenv("enaLPAE", "no");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
- /* Flatten Device Tree environment setup */
|
||||||
|
-#ifdef CONFIG_CUSTOMER_BOARD_SUPPORT
|
||||||
|
- #ifdef CONFIG_ARMADA_38X
|
||||||
|
- fdt_env_setup("armada-38x.dtb", MV_FALSE); /* static setup: Skip DT update for customer */
|
||||||
|
- #else
|
||||||
|
- fdt_env_setup("armada-39x.dtb", MV_FALSE);
|
||||||
|
- #endif
|
||||||
|
-#else
|
||||||
|
- #ifdef CONFIG_ARMADA_38X
|
||||||
|
- fdt_env_setup("armada-38x-modular.dtb", MV_TRUE); /* dynamic setup: run DT update */
|
||||||
|
- #else
|
||||||
|
- fdt_env_setup("armada-39x.dtb", MV_FALSE); /* static setup: Skip DT update */
|
||||||
|
- #endif
|
||||||
|
-#endif
|
||||||
|
+ setenv("fdt_skip_update", "yes");
|
||||||
|
+ setenv("boot_a_script",
|
||||||
|
+ "for prefix in /boot/ /; do \
|
||||||
|
+ load ${boot_interface} 0:1 ${script_addr_r} ${prefix}boot.scr && \
|
||||||
|
+ source ${script_addr_r}; \
|
||||||
|
+ done");
|
||||||
|
+ setenv("mmcboot",
|
||||||
|
+ "setenv boot_interface mmc; run boot_a_script;");
|
||||||
|
+ setenv("sataboot",
|
||||||
|
+ "scsi init; setenv boot_interface scsi; run boot_a_script;");
|
||||||
|
+ setenv("usbboot",
|
||||||
|
+ "setenv usbActive 1; setenv usbType 3; usb start; setenv boot_interface usb; run boot_a_script;");
|
||||||
|
|
||||||
|
#if (CONFIG_BOOTDELAY >= 0)
|
||||||
|
env = getenv("bootcmd");
|
||||||
|
if (!env)
|
||||||
|
- setenv("bootcmd", "tftpboot 0x2000000 $image_name;tftpboot $fdtaddr $fdtfile;"
|
||||||
|
+ setenv("bootcmd",
|
||||||
|
+ "echo Trying to boot from MMC; run mmcboot;"
|
||||||
|
+ "echo Trying to boot from SATA; run sataboot;"
|
||||||
|
+ "echo Trying to boot from USB; run usbboot;"
|
||||||
|
+ "echo Default boot sequence failed - falling back to TFTP;"
|
||||||
|
+ "tftpboot 0x2000000 $image_name;tftpboot $fdtaddr $fdtfile;"
|
||||||
|
"setenv bootargs $console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath "
|
||||||
|
"ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_params "
|
||||||
|
"clcd.lcd0_enable=$lcd0_enable clcd.lcd_panel=$lcd_panel; bootz 0x2000000 - $fdtaddr;");
|
||||||
|
diff --git a/common/cmd_fs.c b/common/cmd_fs.c
|
||||||
|
index a681d03..9cc5013 100644
|
||||||
|
--- a/common/cmd_fs.c
|
||||||
|
+++ b/common/cmd_fs.c
|
||||||
|
@@ -22,7 +22,7 @@
|
||||||
|
|
||||||
|
int do_load_wrapper(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||||
|
{
|
||||||
|
- return do_load(cmdtp, flag, argc, argv, FS_TYPE_ANY, 0);
|
||||||
|
+ return do_load(cmdtp, flag, argc, argv, FS_TYPE_ANY, 16);
|
||||||
|
}
|
||||||
|
|
||||||
|
U_BOOT_CMD(
|
||||||
|
diff --git a/include/configs/armada_38x.h b/include/configs/armada_38x.h
|
||||||
|
index c57353f..746c843 100644
|
||||||
|
--- a/include/configs/armada_38x.h
|
||||||
|
+++ b/include/configs/armada_38x.h
|
||||||
|
@@ -164,7 +164,7 @@ extern unsigned int mvUartPortGet(void);
|
||||||
|
#define CONFIG_CMD_RCVR
|
||||||
|
#define CONFIG_CMD_BOOT_MENU
|
||||||
|
#define CONFIG_CMD_SYS_RESTORE
|
||||||
|
-
|
||||||
|
+#define CONFIG_CMD_FS_GENERIC
|
||||||
|
|
||||||
|
/* Open this define for enabling Secure Boot Mode eFuses modification
|
||||||
|
#define CONFIG_CMD_EFUSE
|
||||||
|
@@ -207,7 +207,6 @@ extern unsigned int mvUartPortGet(void);
|
||||||
|
#define CONFIG_FS_EXT4
|
||||||
|
#define CONFIG_CMD_EXT4_WRITE
|
||||||
|
#define CONFIG_EXT4_WRITE
|
||||||
|
-#define CONFIG_CMD_JFFS2
|
||||||
|
#define CONFIG_CMD_FAT
|
||||||
|
#define CONFIG_FS_FAT
|
||||||
|
#define CONFIG_SUPPORT_VFAT
|
||||||
|
--
|
||||||
|
2.7.4
|
||||||
|
|
|
@ -8,6 +8,9 @@ sudo apt-get install gcc make gcc-arm-linux-gnueabi binutils-arm-linux-gnueabi
|
||||||
|
|
||||||
Other option, use Linaro cross compiler 4.9.4 arm-gnueabi toolchain. Download [here](https://releases.linaro.org/components/toolchain/binaries/4.9-2017.01/arm-linux-gnueabi/).
|
Other option, use Linaro cross compiler 4.9.4 arm-gnueabi toolchain. Download [here](https://releases.linaro.org/components/toolchain/binaries/4.9-2017.01/arm-linux-gnueabi/).
|
||||||
|
|
||||||
|
!!! Note
|
||||||
|
DO NOT use hard-float variant (arm-linux-gnueabihf).
|
||||||
|
|
||||||
## Compile U Boot
|
## Compile U Boot
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
@ -20,12 +23,28 @@ export CROSS_COMPILE="/path/to/cross/compiler"
|
||||||
export CROSS_COMPILE_BH=${CROSS_COMPILE}
|
export CROSS_COMPILE_BH=${CROSS_COMPILE}
|
||||||
|
|
||||||
make mrproper
|
make mrproper
|
||||||
|
|
||||||
./build.pl -f mmc -b armada_38x_helios4
|
|
||||||
```
|
```
|
||||||
|
|
||||||
!!! note
|
!!! note
|
||||||
To compile using Ubuntu 16.04 cross compiler, please apply [this patch](https://github.com/armbian/build/blob/master/patch/u-boot/u-boot-mvebu/tools-bin_hdr-compiler-fixes.patch) to U-Boot source code.
|
To compile using Ubuntu 16.04 cross compiler, please apply [this patch](https://github.com/armbian/build/blob/master/patch/u-boot/u-boot-mvebu/tools-bin_hdr-compiler-fixes.patch) to U-Boot source code.
|
||||||
|
|
||||||
!!! note
|
To support Armbian boot script, please apply [this patch](/files/software/u-boot-armbian-boot-script-support.patch) to U-Boot source code.
|
||||||
If failed to compile using Linaro cross compiler 4.9.4 arm-gnueabihf (error about hard float VFP), use **soft-float compiler**
|
|
||||||
|
|
||||||
|
### SD Card image
|
||||||
|
|
||||||
|
```
|
||||||
|
./build.pl -f mmc -b armada_38x_helios4
|
||||||
|
```
|
||||||
|
|
||||||
|
it would produced *u-boot-a38x-**mm**-**d**-mmc.bin* whereas **mm** is month and **d** is day. For example, building u-boot on October 2nd would produced
|
||||||
|
*u-boot-a38x-10-2-mmc.bin*
|
||||||
|
|
||||||
|
### SPI NOR flash image
|
||||||
|
|
||||||
|
```
|
||||||
|
./build.pl -f spi -b armada_38x_helios4
|
||||||
|
```
|
||||||
|
|
||||||
|
it would produced *u-boot-a38x-**mm**-**d**-spi.bin* whereas **mm** is month and **d** is day. For example, building u-boot on October 2nd would produced
|
||||||
|
*u-boot-a38x-10-2-spi.bin*
|
||||||
|
|
Loading…
Reference in a new issue