Skip to contentSkip to conversation

Support Andes SPI_burn tool

PATCH In review Yu Chien Peter Lin via buildroot 2 participants 7 messages Sep 25, 2024 – Nov 12, 2024

lore
Share & tools
lore
#0 lore raw

v4 cover Support Andes SPI_burn tool

This series adds support for Andes SPI_burn tool that can be used to update flash memory for U-Boot and OpenSBI development.

Changes v1->v2:
- Add documentation in the readme.txt
Changes v2->v3:
- Resolve comments on v2 patches: https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/
- Fix indentation of the help text
- Add LICENSE file
- Rename downloaded zip file with package version
- Do not make clean before compiling
- Add links for ICEman & AICE in andes/ae350/readme.txt
Changes v3->v4:
- Migrate to a GitHub repository where hosts the source code of SPI_burn
- Fix alphabetic order in DEVELOPERS

Yu-Chien Peter Lin (4):
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
board/andes/ae350: readme.txt: Add SPI_burn tool instructions

 DEVELOPERS                                 |  1 +
 board/andes/ae350/readme.txt               | 43 ++++++++++++++++++++++
 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      |  8 ++++
 package/andes-spi-burn/andes-spi-burn.hash |  3 ++
 package/andes-spi-burn/andes-spi-burn.mk   | 20 ++++++++++
 8 files changed, 77 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 v4 1/4 package/andes-spi-burn: new package

From: Yu-Chien Peter Lin <[email protected]>

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      |  8 ++++++++
 package/andes-spi-burn/andes-spi-burn.hash |  3 +++
 package/andes-spi-burn/andes-spi-burn.mk   | 20 ++++++++++++++++++++
 5 files changed, 33 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 ea4ee3377f..4ce578b330 100644
@@ -2517,6 +2517,7 @@ F:	package/tcf-agent/
 N:	Yu Chien Peter Lin <[email protected]>
 F:	board/andes
 F:	configs/andes_ae350_45_defconfig
+F:	package/andes-spi-burn/
 F:	package/kmon/
 
 N:	Olaf Rempel <[email protected]>
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 +8 -0
new file mode 100644
index 0000000000..09d5ddb2b4
@@ -0,0 +1,8 @@
+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.
+
+	  https://github.com/andestech/IntelJ3
package/andes-spi-burn/andes-spi-burn.hash new file +3 -0
new file mode 100644
index 0000000000..5022f0fc1b
@@ -0,0 +1,3 @@
+# Locally computed
+sha256  72a5b016ebe0da77662a10edb8078c29cfcbedd8c0ff523d299248e0b1fb84dd  andes-spi-burn-5b8193c35360febd8445cfa32adc6b13a861616d.tar.gz
+sha256  cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30  LICENSE
package/andes-spi-burn/andes-spi-burn.mk new file +20 -0
new file mode 100644
index 0000000000..8ee5fb2897
@@ -0,0 +1,20 @@
+################################################################################
+#
+# andes-spi-burn
+#
+################################################################################
+
+ANDES_SPI_BURN_VERSION = 5b8193c35360febd8445cfa32adc6b13a861616d
+ANDES_SPI_BURN_SITE = $(call github,andestech,IntelJ3,$(ANDES_SPI_BURN_VERSION))
+ANDES_SPI_BURN_LICENSE = Apache-2.0
+ANDES_SPI_BURN_FILES = LICENSE
+
+define HOST_ANDES_SPI_BURN_BUILD_CMDS
+	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) -f Makefile_SPIburn
+endef
+
+define HOST_ANDES_SPI_BURN_INSTALL_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/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

Re: [Buildroot] [PATCH v4 1/4] package/andes-spi-burn: new package

Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yu" == Yu Chien Peter Lin via buildroot <[email protected]> writes:

From: Yu-Chien Peter Lin <[email protected]> Add a new package for Andes AE350 SPI_burn tool to program flash memory.

..

package/andes-spi-burn/Config.in.host line 8

Quoted 5 lines
package/andes-spi-burn/Config.in.host new file +5 -0
+	help
+	  Andes Technology SPI_burn tool to program bootloader and
+	  device-tree blob onto flash memory of AE350 platform.
+
+	  https://github.com/andestech/IntelJ3

NIT: Why did you chose such an odd git repo name for a spi_burn utility?

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw

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

In reply to Yu Chien Peter Lin via buildroot

From: Yu-Chien Peter Lin <[email protected]>

Enable Andes SPI_burn tool for updating buildroot generated bootloader and device-tree blob onto 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
#4 lore raw

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

In reply to Yu Chien Peter Lin via buildroot

From: Yu-Chien Peter Lin <[email protected]>

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
#5 lore raw

PATCH v4 4/4 board/andes/ae350: readme.txt: Add SPI_burn tool instructions

In reply to Yu Chien Peter Lin via buildroot

From: Yu-Chien Peter Lin <[email protected]>

Add a section to document how to update bootloader on AE350 platforms with SPI_burn tool.

---
 board/andes/ae350/readme.txt | 43 ++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)
board/andes/ae350/readme.txt +43 -0
index 4de4cb3894..36561fc777 100644
@@ -41,6 +41,49 @@ After building, you should obtain the following files:
   |-- u-boot-spl.bin
   `-- u-boot.itb
 
+How to update the bootloader and device-tree
+============================================
+
+To update the bootloader and device tree, make sure you have
+an ICEman (Andes OpenOCD [1]) and AICE [2] connection set up
+as below:
+
+  Local Host                 Local/Remote Host
+ .-----------------.          .--------------.
+ | buildroot images|          |              |
+ |                 |         ICEman host <IP:PORT>
+ | .----------.    |          |  .--------.  |
+ | | SPI_burn |<---+--socket--+->| ICEman |  |
+ | '----------'    |          |  '--.-----'  |
+ '-----------------'          '-----|--------'
+                                    |
+                                    USB
+   .--------------.                 |
+   | target       |           .-----v-----.
+   | board        <----JTAG---| AICE      |
+   |              |           '-----------'
+   '--------------'
+
+[1] https://github.com/andestech/ICEman
+[2] https://www.andestech.com/en/products-solutions/andeshape-platforms/aice-micro/
+
+The Andes SPI_burn tool will be located in output/host/bin. Use
+the following commands to update the bootloader and device tree:
+
+  $ 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_ax45mp.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_ax45mp.dtb: CONFIG_SYS_FDT_BASE=0x800f0000
+
+How to write the SD card
+========================
+
 Copy the sdcard.img to a SD card with "dd":
 
   $ sudo dd if=sdcard.img of=/dev/sdX bs=4096
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#6 lore raw
In reply to Yu Chien Peter Lin via buildroot
Quoted 6 lines · On Wed, 25 Sep 2024 15:21:47 +0800 Yu Chien Peter Lin via buildroot…

Yu-Chien Peter Lin (4):
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
board/andes/ae350: readme.txt: Add SPI_burn tool instructions

Thanks for this new version, series applied with minor updates to the commit titles.

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot