Helios4: Add SPI bootloader install feature (#1126)

* Helios4: Add workaround for SPI and SATA concurrent access issue

Concurrent access on SPI NOR and SATA drives can lead to unstable SATA.
Therefore as workaround, disable SATA controller when SPI flash access
is needed and make it as user configurable item in armbianEnv.txt

This workaround might applies to Clearfog too.

Signed-off-by: Aditya Prayoga <aditya@kobol.io>

* Helios4: Add U-Boot SPI

Signed-off-by: Aditya Prayoga <aditya@kobol.io>

* Helios4: Add SPI bootloader install feature

This will allow to use nand-sata-install to perform the following operations on Helios4 :
- Install bootloader to SPI NOR Flash (Option 5 in Menu).
- Copy RootFS to USB storage in order to boot from SPI with RootFS on USB (Option 6 in Menu).

* Unmount temp mount points in create_armbian() instead of hardcoded /dev/sda
This commit is contained in:
Gauthier Provost 2018-10-08 19:44:36 +08:00 committed by Igor Pečovnik
parent 07f72fa786
commit 59af84c07c
9 changed files with 82 additions and 14 deletions

View file

@ -0,0 +1,30 @@
diff --git a/Makefile b/Makefile
index 55380d7..2fd3440 100755
--- a/Makefile
+++ b/Makefile
@@ -482,6 +482,10 @@ endif
$(obj)u-boot.mmc: $(obj)u-boot.bin
echo y | $(obj)tools/marvell/doimage -T mmc -D 0x0 -E 0x0 -G $(obj)tools/marvell/bin_hdr/bin_hdr.bin u-boot.bin u-boot.mmc
+$(obj)u-boot.flash: $(obj)u-boot.bin
+ echo y | $(obj)tools/marvell/doimage -T flash -D 0x0 -E 0x0 -G $(obj)tools/marvell/bin_hdr/bin_hdr.bin u-boot.bin u-boot.flash
+ echo y | $(obj)tools/marvell/doimage -T uart -D 0x0 -E 0x0 -G $(obj)tools/marvell/bin_hdr/bin_hdr.uart.bin u-boot.bin u-boot-uart.flash
+
$(obj)u-boot.img: $(obj)u-boot.bin
$(obj)tools/mkimage -A $(ARCH) -T firmware -C none \
-O u-boot -a $(CONFIG_SYS_TEXT_BASE) \
diff --git a/include/configs/armada_38x.h b/include/configs/armada_38x.h
index c38122c..cb59ea8 100644
--- a/include/configs/armada_38x.h
+++ b/include/configs/armada_38x.h
@@ -325,6 +325,10 @@ extern unsigned int mvUartPortGet(void);
#endif
/* Boot from SPI settings */
+#if defined(CONFIG_MV_SPI_BOOT)
+ #define MV_SPI_BOOT
+#endif
+
#if defined(MV_SPI_BOOT)
#define CONFIG_ENV_IS_IN_SPI_FLASH

View file

@ -42,7 +42,7 @@ index 0dce7f6..6d69879 100755
+ "echo Trying to boot from MMC; run mmcboot;"
+#elif defined (MV_SATA_BOOT)
+ "echo Trying to boot from SATA; run sataboot;"
+#elif defined (MV_NOR_BOOT)
+#elif defined (MV_SPI_BOOT)
+ "echo Please store the boot environment on the NOR SPI flash to override the default boot sequence;"
+#endif /* MV_NOR_BOOT */
+ "echo Trying to boot from USB; run usbboot;"

View file

@ -0,0 +1,13 @@
diff --git a/boards.cfg b/boards.cfg
index 4d9f810..fb2d487 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -55,7 +55,7 @@ armada_38x arm armv7 a38x mv_ebu
armada_38x_customer0 arm armv7 a38x mv_ebu mvca9 armada_38x:CUSTOMER_BOARD_0,ARMADA_38X
armada_38x_customer1 arm armv7 a38x mv_ebu mvca9 armada_38x:CUSTOMER_BOARD_1,ARMADA_38X
armada_38x_clearfog arm armv7 a38x mv_ebu mvca9 armada_38x:CLEARFOG_BOARD,ARMADA_38X
-armada_38x_helios4 arm armv7 a38x mv_ebu mvca9 armada_38x:HELIOS4_BOARD,ARMADA_38X,MV_MMC_BOOT,MV_INCLUDE_SPI,DDR3
+armada_38x_helios4 arm armv7 a38x mv_ebu mvca9 armada_38x:HELIOS4_BOARD,ARMADA_38X,MV_SPI_BOOT,MV_INCLUDE_SPI,DDR3
armada_39x arm armv7 a38x mv_ebu mvca9 armada_38x:ARMADA_39X
armada_39x_customer0 arm armv7 a38x mv_ebu mvca9 armada_38x:CUSTOMER_BOARD_0,ARMADA_39X
armada_39x_customer1 arm armv7 a38x mv_ebu mvca9 armada_38x:CUSTOMER_BOARD_1,ARMADA_39X