[Buildroot] [PATCH v3 2/2] configs/aspeed_ast2500evb: new defconfig

Cédric Le Goater clg at kaod.org
Tue Jun 21 20:34:15 UTC 2022


The kernel is from upstream with a few extras to reduce the size of
the 'aspeed_g5' zImage because it is too big for the flash layout.
Mainline U-Boot has enough support to load the kernel from the flash
device and from network but it is still behind the OpenBMC branch
where most the development is done.

The main resulting file from the build is a flash image. The partition
layout matches the OpenBMC one for 32M chips. It makes it easier to
update the different partitions from Linux. Intermediate files can be
used to boot from U-Boot over the network or to boot QEMU using
-kernel/-initrd/-dtb.

Reviewed-by: Joel Stanley <joel at jms.id.au>
Signed-off-by: Cédric Le Goater <clg at kaod.org>
---
 Changes in v3:

 - defconfig cleanup
 - removed custom linux config file
 - switched U-Boot to mainline

 Changes in v2:

 - minor cleanups in readme.txt

 board/aspeed/ast2500-evb/genimage.cfg   | 40 +++++++++++++
 board/aspeed/ast2500-evb/linux.fragment |  7 +++
 board/aspeed/ast2500-evb/readme.txt     | 80 +++++++++++++++++++++++++
 board/aspeed/ast2500-evb/uboot.fragment |  3 +
 configs/aspeed_ast2500evb_defconfig     | 43 +++++++++++++
 5 files changed, 173 insertions(+)
 create mode 100644 board/aspeed/ast2500-evb/genimage.cfg
 create mode 100644 board/aspeed/ast2500-evb/linux.fragment
 create mode 100644 board/aspeed/ast2500-evb/readme.txt
 create mode 100644 board/aspeed/ast2500-evb/uboot.fragment
 create mode 100644 configs/aspeed_ast2500evb_defconfig

diff --git a/board/aspeed/ast2500-evb/genimage.cfg b/board/aspeed/ast2500-evb/genimage.cfg
new file mode 100644
index 000000000000..498a71e4d75d
--- /dev/null
+++ b/board/aspeed/ast2500-evb/genimage.cfg
@@ -0,0 +1,40 @@
+#
+# This config reproduces the OpenBMC flash layout defined in Linux :
+#
+#    arch/arm/boot/dts/openbmc-flash-layout.dtsi
+#
+# and included by aspeed-ast2500-evb.dts
+#
+flash nor-32M-256 {
+	pebsize = 4K
+	numpebs = 8K
+	minimum-io-unit-size = 256
+}
+
+image flash.img {
+	flash {
+	}
+	flashtype = "nor-32M-256"
+
+	partition uboot {
+		image = "u-boot.bin"
+		size = 384K
+	}
+
+	partition ubootenv {
+		/* TODO */
+		offset = 384K
+		size = 128K
+	}
+
+	partition fitimage {
+		image = "image.itb"
+		offset = 512K
+		size = 4352K
+	}
+
+	partition spare {
+		offset = 4864K
+		size = 27904K
+	}
+}
diff --git a/board/aspeed/ast2500-evb/linux.fragment b/board/aspeed/ast2500-evb/linux.fragment
new file mode 100644
index 000000000000..1cee95f8427b
--- /dev/null
+++ b/board/aspeed/ast2500-evb/linux.fragment
@@ -0,0 +1,7 @@
+CONFIG_KERNEL_XZ=y
+CONFIG_ARCH_MULTI_V7=n
+CONFIG_MACH_ASPEED_G6=n
+CONFIG_SMP=n
+CONFIG_EXT4_FS=n
+CONFIG_DEBUG_FS=n
+CONFIG_SUSPEND=n
diff --git a/board/aspeed/ast2500-evb/readme.txt b/board/aspeed/ast2500-evb/readme.txt
new file mode 100644
index 000000000000..f509be553bcf
--- /dev/null
+++ b/board/aspeed/ast2500-evb/readme.txt
@@ -0,0 +1,80 @@
+Aspeed AST2500 EVB
+
+Introduction
+============
+
+The AST2500 EVB is an evaluation board for the AST2500 SoC, most
+commonly used as a Server Management Processor. It includes an 800MHz
+ARM11 processor with DDR3 or DDR4 SDRAM (up to 1GB), SPI flash memory
+devices for BMC and host firmwares and numerous controllers to drive
+the server board.
+
+  https://www.aspeedtech.com/server_ast2500/
+
+How to build it
+===============
+
+Configure buildroot:
+
+  $ make aspeed_ast2500evb_defconfig
+
+Compile everything and build the rootfs image:
+
+  $ make
+
+Result of the build
+===================
+
+After building, the output/images directory contains:
+
+  output/images/
+    ├── aspeed-ast2500-evb.dtb
+    ├── flash.img
+    ├── image.itb
+    ├── rootfs.cpio
+    ├── rootfs.cpio.xz
+    ├── rootfs.tar
+    ├── u-boot.bin
+    └── zImage
+
+Flashing the image
+==================
+
+To update the contents of the first flash device, copy flash.img :
+
+  $ flashcp flash.img /dev/mtd0
+
+or simply the boot loader:
+
+  $ flashcp u-boot.bin /dev/mtd1
+
+Preparing the board
+===================
+
+ * Connect a serial line to the board
+ * Power-up the board
+
+Booting the board
+=================
+
+The AST2500 EVB boots from the SPI flash device directly and loads a
+first bootloader (usually U-Boot). U-Boot will attempt to load a Linux
+kernel from the same flash device by default but other storage could
+be used.
+
+ * from U-Boot
+
+   The FIT image image.itb can be used to boot the board from U-Boot
+   using tftp
+
+ * with QEMU
+
+   $ qemu-system-arm -M ast2500-evb \
+	-drive file=output/images/flash.img,format=raw,if=mtd \
+	-nographic
+
+   $ qemu-system-arm -M ast2500-evb \
+	-kernel output/images/zImage \
+	-initrd output/images/rootfs.cpio \
+	-dtb output/images/aspeed-ast2500-evb.dtb \
+	-nographic
diff --git a/board/aspeed/ast2500-evb/uboot.fragment b/board/aspeed/ast2500-evb/uboot.fragment
new file mode 100644
index 000000000000..8463252e5911
--- /dev/null
+++ b/board/aspeed/ast2500-evb/uboot.fragment
@@ -0,0 +1,3 @@
+CONFIG_BOOTCOMMAND="bootm 20080000"
+CONFIG_FIT=y
+CONFIG_SHA256=y
diff --git a/configs/aspeed_ast2500evb_defconfig b/configs/aspeed_ast2500evb_defconfig
new file mode 100644
index 000000000000..c969f18d079c
--- /dev/null
+++ b/configs/aspeed_ast2500evb_defconfig
@@ -0,0 +1,43 @@
+# Architecture
+BR2_arm=y
+
+# System
+BR2_TARGET_GENERIC_HOSTNAME="aspeed-evb"
+BR2_TARGET_GENERIC_ISSUE="Aspeed EVB"
+BR2_SYSTEM_DHCP="eth0"
+
+# Filesystem
+BR2_TARGET_ROOTFS_CPIO=y
+BR2_TARGET_ROOTFS_CPIO_XZ=y
+
+# Image
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/aspeed/common/post-image.sh"
+
+# Linux headers same as kernel
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_17=y
+
+# Kernel
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.17.7"
+BR2_LINUX_KERNEL_DEFCONFIG="aspeed_g5"
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/aspeed/ast2500-evb/linux.fragment"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="aspeed-ast2500-evb"
+BR2_LINUX_KERNEL_XZ=y
+
+# Boot
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2022.01"
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="evb-ast2500"
+BR2_TARGET_UBOOT_NEEDS_DTC=y
+BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="DEVICE_TREE=ast2500-evb"
+BR2_TARGET_UBOOT_CONFIG_FRAGMENT_FILES="board/aspeed/ast2500-evb/uboot.fragment"
+BR2_PACKAGE_HOST_UBOOT_TOOLS=y
+BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+
+# Target tools
+BR2_PACKAGE_MTD=y
-- 
2.35.3




More information about the buildroot mailing list