Skip to contentSkip to conversation

Support Andes SPI_burn tool

PATCH Superseded Yu Chien Peter Lin via buildroot 1 participant 4 messages Sep 4, 2024

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

cover Support Andes SPI_burn tool

This series support Andes SPI_Burn tool can be used to update flash memory when we are developing U-Boot or OpenSBI.

Yu Chien Peter Lin (3):
package: andes-spi-burn: new package configs/andes_ae350_45: Enable host-andes-spi-burn board/andes/ae350: uboot.config.fragment: Support loading U-Boot on
RAM

 DEVELOPERS                                 |  1 +
 board/andes/ae350/uboot.config.fragment    |  1 -
 configs/andes_ae350_45_defconfig           |  1 +
 package/Config.in.host                     |  1 +
 package/andes-spi-burn/Config.in.host      | 38 ++++++++++++++++++++++
 package/andes-spi-burn/andes-spi-burn.hash |  2 ++
 package/andes-spi-burn/andes-spi-burn.mk   | 25 ++++++++++++++
 7 files changed, 68 insertions(+), 1 deletion(-)
 create mode 100644 package/andes-spi-burn/Config.in.host
 create mode 100644 package/andes-spi-burn/andes-spi-burn.hash
 create mode 100644 package/andes-spi-burn/andes-spi-burn.mk
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

PATCH 1/3 package: andes-spi-burn: new package

Add a new package for Andes AE350 SPI_burn tool to program flash memory.

---
 DEVELOPERS                                 |  1 +
 package/Config.in.host                     |  1 +
 package/andes-spi-burn/Config.in.host      | 38 ++++++++++++++++++++++
 package/andes-spi-burn/andes-spi-burn.hash |  2 ++
 package/andes-spi-burn/andes-spi-burn.mk   | 25 ++++++++++++++
 5 files changed, 67 insertions(+)
 create mode 100644 package/andes-spi-burn/Config.in.host
 create mode 100644 package/andes-spi-burn/andes-spi-burn.hash
 create mode 100644 package/andes-spi-burn/andes-spi-burn.mk
DEVELOPERS +1 -0
index 069965680b..aab5a6c05f 100644
@@ -2487,6 +2487,7 @@ N:	Yu Chien Peter Lin <[email protected]>
 F:	board/andes
 F:	configs/andes_ae350_45_defconfig
 F:	package/kmon/
+F:	package/andes-spi-burn/
 
 N:	Olaf Rempel <[email protected]>
 F:	package/ctorrent/
package/Config.in.host +1 -0
index e4fbee4f2a..191833d94d 100644
@@ -4,6 +4,7 @@ menu "Host utilities"
 	source "package/aespipe/Config.in.host"
 	source "package/agent-proxy/Config.in.host"
 	source "package/amlogic-boot-fip/Config.in.host"
+	source "package/andes-spi-burn/Config.in.host"
 	source "package/android-tools/Config.in.host"
 	source "package/asn1c/Config.in.host"
 	source "package/babeltrace2/Config.in.host"
package/andes-spi-burn/Config.in.host new file +38 -0
new file mode 100644
index 0000000000..8acb48d083
@@ -0,0 +1,38 @@
+config BR2_PACKAGE_HOST_ANDES_SPI_BURN
+	bool "host andes-spi-burn"
+	depends on BR2_riscv
+	help
+		Andes Technology SPI_burn tool to program bootloader and
+		device-tree blob onto flash memory of AE350 platform.
+
+		Ensure you have an ICEman connection set up as follows:
+
+		  Local Host                 Local/Remote Host
+		 .-----------------.          .--------------.
+		 | buildroot images|          |              |
+		 |                 |         ICEman host <IP:PORT>
+		 | .----------.    |          |  .--------.  |
+		 | | SPI_burn |<---+--socket--+->| ICEman |  |
+		 | '----------'    |          |  '--.-----'  |
+		 '-----------------'          '-----|--------'
+		                                    |
+		                                    USB
+		   .--------------.                 |
+		   | target       |           .-----v-----.
+		   | board        <----JTAG---| ICE       |
+		   |              |           '-----------'
+		   '--------------'
+
+		Commands:
+		$ SPI_burn --host $ICE_IP --port $ICE_BURNER_PORT --addr 0x0     -i u-boot-spl.bin
+		$ SPI_burn --host $ICE_IP --port $ICE_BURNER_PORT --addr 0x10000 -i u-boot.itb
+		$ SPI_burn --host $ICE_IP --port $ICE_BURNER_PORT --addr 0xf0000 -i ae350.dtb
+
+		Note that the --addr option specifies the offset starting from
+		the flash base address 0x80000000 and set by U-Boot configurations.
+		e.g.
+		u-boot-spl.bin: CONFIG_SPL_TEXT_BASE=0x80000000
+		u-boot.itb    : CONFIG_SPL_LOAD_FIT_ADDRESS=0x80010000
+		ae350.dtb     : CONFIG_SYS_FDT_BASE=0x800f0000
+
+		https://github.com/andestech/Andes-Development-Kit
package/andes-spi-burn/andes-spi-burn.hash new file +2 -0
new file mode 100644
index 0000000000..170f362646
@@ -0,0 +1,2 @@
+# Locally computed
+sha256  6632bc0ddd0b6d07bd328758cd9132f48429d144079eb8011af60d95b0bdfd6b  flash.zip
package/andes-spi-burn/andes-spi-burn.mk new file +25 -0
new file mode 100644
index 0000000000..2f7387ca2f
@@ -0,0 +1,25 @@
+################################################################################
+#
+# andes-spi-burn
+#
+################################################################################
+
+ANDES_SPI_BURN_VERSION = 5.3.0
+ANDES_SPI_BURN_SOURCE = flash.zip
+ANDES_SPI_BURN_SITE = https://github.com/andestech/Andes-Development-Kit/releases/download/ast-v5_3_0-release-windows
+ANDES_SPI_BURN_LICENSE = Apache-2.0
+
+define HOST_ANDES_SPI_BURN_EXTRACT_CMDS
+	$(UNZIP) -q $(HOST_ANDES_SPI_BURN_DL_DIR)/$(ANDES_SPI_BURN_SOURCE) -d $(@D)
+endef
+
+define HOST_ANDES_SPI_BURN_BUILD_CMDS
+	$(HOST_MAKE_ENV) $(MAKE) -C $(@D)/flash/src-SPI_burn clean
+	$(HOST_MAKE_ENV) $(MAKE) -C $(@D)/flash/src-SPI_burn --makefile=Makefile_SPIburn_linux
+endef
+
+define HOST_ANDES_SPI_BURN_INSTALL_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/flash/src-SPI_burn/SPI_burn $(HOST_DIR)/bin/SPI_burn
+endef
+
+$(eval $(host-generic-package))
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

PATCH 2/3 configs/andes_ae350_45: Enable host-andes-spi-burn

In reply to Yu Chien Peter Lin via buildroot

Enable Andes SPI_Burn tool for updating buildroot generated bootloader and device-tree blob on flash memory.

---
 configs/andes_ae350_45_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/andes_ae350_45_defconfig +1 -0
index fd8b7db0e7..7b5a6f73c6 100644
@@ -34,6 +34,7 @@ BR2_TARGET_UBOOT_NEEDS_OPENSBI=y
 BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
 BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot.itb"
 BR2_TARGET_UBOOT_SPL=y
+BR2_PACKAGE_HOST_ANDES_SPI_BURN=y
 BR2_PACKAGE_HOST_DOSFSTOOLS=y
 BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_MTOOLS=y
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw

PATCH 3/3 board/andes/ae350: uboot.config.fragment: Support loading U-Boot on RAM

In reply to Yu Chien Peter Lin via buildroot

Do not disable SPL RAM support so the u-boot.itb programmed on flash memory can be used.

---
 board/andes/ae350/uboot.config.fragment | 1 -
 1 file changed, 1 deletion(-)
board/andes/ae350/uboot.config.fragment +0 -1
index fa38bbca3a..4497ed4c74 100644
@@ -1,6 +1,5 @@
 CONFIG_SPL_FS_FAT=y
 CONFIG_SPL_MMC=y
-# CONFIG_SPL_RAM_SUPPORT is not set
 CONFIG_SPL_OPENSBI_LOAD_ADDR=0x0
 CONFIG_SPL_OPENSBI_SCRATCH_OPTIONS=0x0
 CONFIG_DISPLAY_CPUINFO=y
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot