All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v3 1/2] configs/aspeed_ast2600evb: new defconfig
@ 2022-06-21 20:34 Cédric Le Goater
  2022-06-21 20:34 ` [Buildroot] [PATCH v3 2/2] configs/aspeed_ast2500evb: " Cédric Le Goater
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Cédric Le Goater @ 2022-06-21 20:34 UTC (permalink / raw)
  To: buildroot; +Cc: chin-ting_kuo, troy_lee, Joel Stanley, Cédric Le Goater

The kernel is from upstream and U-Boot is from the OpenBMC branch
because mainline doesn't have the required support for HW, yet.

The main resulting file from the build is a flash image. The partition
layout matches the OpenBMC one for 64M 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.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
---

 Changes in v3:

 - defconfig cleanup

 Changes in v2:

 - Add Joel to the list of developers
 - Removed unused CONFIG from linux.fragment but added
   CONFIG_I2C_SLAVE_EEPROM which is useful for tests
 - minor cleanups in readme.txt

 DEVELOPERS                             |  4 ++
 board/aspeed/ast2600-evb/genimage.cfg  | 40 +++++++++++++
 board/aspeed/ast2600-evb/readme.txt    | 80 ++++++++++++++++++++++++++
 board/aspeed/common/image.its.template | 56 ++++++++++++++++++
 board/aspeed/common/post-image.sh      | 27 +++++++++
 configs/aspeed_ast2600evb_defconfig    | 44 ++++++++++++++
 6 files changed, 251 insertions(+)
 create mode 100644 board/aspeed/ast2600-evb/genimage.cfg
 create mode 100644 board/aspeed/ast2600-evb/readme.txt
 create mode 100644 board/aspeed/common/image.its.template
 create mode 100755 board/aspeed/common/post-image.sh
 create mode 100644 configs/aspeed_ast2600evb_defconfig

diff --git a/DEVELOPERS b/DEVELOPERS
index aa18de83bcb6..0a09b8b5607c 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -501,8 +501,10 @@ F:	package/znc/
 N:	Cédric Le Goater <clg@kaod.org>
 F:	board/qemu/ppc-bamboo/
 F:	board/qemu/ppc64le-powernv8/readme.txt
+F:	board/aspeed/
 F:	configs/qemu_ppc_bamboo_defconfig
 F:	configs/qemu_ppc64le_powernv8_defconfig
+F:	configs/aspeed*
 
 N:	Charles Hardin <ckhardin@gmail.com>
 F:	package/alsa-plugins/
@@ -1451,6 +1453,8 @@ F:	board/qemu/ppc64le-pseries/
 F:	configs/qemu_ppc64le_pseries_defconfig
 F:	board/qemu/ppc-mac99/
 F:	configs/qemu_ppc_mac99_defconfig
+F:	board/aspeed/
+F:	configs/aspeed*
 
 N:	Johan Derycke <johanderycke@gmail.com>
 F:	package/python-libconfig/
diff --git a/board/aspeed/ast2600-evb/genimage.cfg b/board/aspeed/ast2600-evb/genimage.cfg
new file mode 100644
index 000000000000..56932d478756
--- /dev/null
+++ b/board/aspeed/ast2600-evb/genimage.cfg
@@ -0,0 +1,40 @@
+#
+# This config reproduces the OpenBMC flash layout defined in Linux :
+#
+#    arch/arm/boot/dts/openbmc-flash-layout-64.dtsi
+#
+# and included by aspeed-ast2600-evb.dts
+#
+flash nor-64M-256 {
+	pebsize = 4K
+	numpebs = 16K
+	minimum-io-unit-size = 256
+}
+
+image flash.img {
+	flash {
+	}
+	flashtype = "nor-64M-256"
+
+	partition uboot {
+		image = "u-boot.bin"
+		size = 896K
+	}
+
+	partition ubootenv {
+		/* TODO */
+		offset = 896K
+		size = 128K
+	}
+
+	partition fitimage {
+		image = "image.itb"
+		offset = 1M
+		size = 9M
+	}
+
+	partition spare {
+		offset = 10M
+		size = 54M
+	}
+}
diff --git a/board/aspeed/ast2600-evb/readme.txt b/board/aspeed/ast2600-evb/readme.txt
new file mode 100644
index 000000000000..1f7ba13d5d97
--- /dev/null
+++ b/board/aspeed/ast2600-evb/readme.txt
@@ -0,0 +1,80 @@
+Aspeed AST2600 EVB
+
+Introduction
+============
+
+The AST2600 EVB is an evaluation board for the AST2600 SoC, most
+commonly used as a Server Management Processor. It includes a
+Dual-core ARM Cortex A7 processor with DDR4 SDRAM (up to 2GB), SPI
+flash memory devices for BMC and host firmwares and numerous
+controllers to drive the server board.
+
+  https://www.aspeedtech.com/server_ast2600/
+
+How to build it
+===============
+
+Configure buildroot:
+
+  $ make aspeed_ast2600evb_defconfig
+
+Compile everything and build the rootfs image:
+
+  $ make
+
+Result of the build
+===================
+
+After building, the output/images directory contains:
+
+  output/images/
+    ├── aspeed-ast2600-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 AST2600 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 ast2600-evb \
+	-drive file=output/images/flash.img,format=raw,if=mtd \
+	-nographic
+
+   $ qemu-system-arm -M ast2600-evb \
+	-kernel output/images/zImage \
+	-initrd output/images/rootfs.cpio \
+	-dtb output/images/aspeed-ast2600-evb.dtb \
+	-nographic
diff --git a/board/aspeed/common/image.its.template b/board/aspeed/common/image.its.template
new file mode 100644
index 000000000000..e3200e240709
--- /dev/null
+++ b/board/aspeed/common/image.its.template
@@ -0,0 +1,56 @@
+/dts-v1/;
+
+/ {
+	description = "Kernel and buildroot image";
+	#address-cells = <1>;
+
+	images {
+		kernel-1 {
+			description = "Linux kernel";
+			data = /incbin/("zImage");
+			type = "kernel";
+			arch = "arm";
+			os = "linux";
+			compression = "none";
+			load = <0x80001000>;
+			entry = <0x80001000>;
+			hash-1 {
+				algo = "sha256";
+			};
+		};
+		fdt-1 {
+			description = "Flattened Device Tree blob";
+			data = /incbin/("%BOARD_DTB%");
+			type = "flat_dt";
+			arch = "arm";
+			compression = "none";
+			hash-1 {
+				algo = "sha256";
+			};
+		};
+		ramdisk-1 {
+			description = "ramdisk";
+			data = /incbin/("rootfs.cpio.xz");
+			type = "ramdisk";
+			arch = "arm";
+			os = "linux";
+			compression = "none";
+			hash-1 {
+				algo = "sha256";
+			};
+		};
+	};
+
+	configurations {
+		default = "conf-1";
+		conf-1 {
+			description = "Boot Linux kernel with FDT blob, ramdisk";
+			kernel = "kernel-1";
+			fdt = "fdt-1";
+			ramdisk = "ramdisk-1";
+			hash-1 {
+				algo = "sha256";
+			};
+		};
+	};
+};
diff --git a/board/aspeed/common/post-image.sh b/board/aspeed/common/post-image.sh
new file mode 100755
index 000000000000..ea65a49afff0
--- /dev/null
+++ b/board/aspeed/common/post-image.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+BOARD_DIR="$(dirname $0)"
+mkimage=$HOST_DIR/bin/mkimage
+
+BOARD_DT=$(sed -n \
+           's/^BR2_LINUX_KERNEL_INTREE_DTS_NAME="\([a-z0-9\-]*\).*"$/\1/p' \
+           ${BR2_CONFIG})
+
+sed -e "s/%BOARD_DTB%/${BOARD_DT}.dtb/" \
+    $BOARD_DIR/image.its.template > $BINARIES_DIR/image.its
+
+(cd $BINARIES_DIR && $mkimage -f image.its image.itb)
+
+GENIMAGE_CFG="board/aspeed/${BOARD_DT#aspeed-*}/genimage.cfg"
+GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
+
+rm -rf "${GENIMAGE_TMP}"
+
+genimage \
+  --rootpath "${TARGET_DIR}" \
+  --tmppath "${GENIMAGE_TMP}" \
+  --inputpath "${BINARIES_DIR}" \
+  --outputpath "${BINARIES_DIR}" \
+  --config "${GENIMAGE_CFG}"
+
+rm -f $BINARIES_DIR/image.its
diff --git a/configs/aspeed_ast2600evb_defconfig b/configs/aspeed_ast2600evb_defconfig
new file mode 100644
index 000000000000..cd058ad0ac28
--- /dev/null
+++ b/configs/aspeed_ast2600evb_defconfig
@@ -0,0 +1,44 @@
+# Architecture
+BR2_arm=y
+BR2_cortex_a7=y
+BR2_ARM_FPU_VFPV4=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_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="aspeed-ast2600-evb"
+
+# Boot
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+BR2_TARGET_UBOOT_CUSTOM_GIT=y
+BR2_TARGET_UBOOT_CUSTOM_REPO_URL="https://github.com/openbmc/u-boot.git"
+BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="f2b82fa4ba17ed8091fe76c284220006645a293b"
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="evb-ast2600"
+BR2_TARGET_UBOOT_NEEDS_DTC=y
+BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="DEVICE_TREE=ast2600a1-evb"
+
+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

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH v3 2/2] configs/aspeed_ast2500evb: new defconfig
  2022-06-21 20:34 [Buildroot] [PATCH v3 1/2] configs/aspeed_ast2600evb: new defconfig Cédric Le Goater
@ 2022-06-21 20:34 ` Cédric Le Goater
  2022-06-27 20:52   ` Arnout Vandecappelle
  2022-06-23 13:00 ` [Buildroot] [PATCH v3 1/2] configs/aspeed_ast2600evb: " Joel Stanley
  2022-06-27 20:49 ` Arnout Vandecappelle
  2 siblings, 1 reply; 6+ messages in thread
From: Cédric Le Goater @ 2022-06-21 20:34 UTC (permalink / raw)
  To: buildroot; +Cc: chin-ting_kuo, troy_lee, Joel Stanley, Cédric Le Goater

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@jms.id.au>
Signed-off-by: Cédric Le Goater <clg@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

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Buildroot] [PATCH v3 1/2] configs/aspeed_ast2600evb: new defconfig
  2022-06-21 20:34 [Buildroot] [PATCH v3 1/2] configs/aspeed_ast2600evb: new defconfig Cédric Le Goater
  2022-06-21 20:34 ` [Buildroot] [PATCH v3 2/2] configs/aspeed_ast2500evb: " Cédric Le Goater
@ 2022-06-23 13:00 ` Joel Stanley
  2022-06-27 20:49 ` Arnout Vandecappelle
  2 siblings, 0 replies; 6+ messages in thread
From: Joel Stanley @ 2022-06-23 13:00 UTC (permalink / raw)
  To: Cédric Le Goater, Jeremy Kerr
  Cc: Chin-Ting Kuo, Troy Lee, Buildroot Mailing List

On Tue, 21 Jun 2022 at 20:34, Cédric Le Goater <clg@kaod.org> wrote:
>
> The kernel is from upstream and U-Boot is from the OpenBMC branch
> because mainline doesn't have the required support for HW, yet.
>
> The main resulting file from the build is a flash image. The partition
> layout matches the OpenBMC one for 64M 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.
>
> Signed-off-by: Cédric Le Goater <clg@kaod.org>

Reviewed-by: Joel Stanley <joel@jms.id.au>

> diff --git a/board/aspeed/ast2600-evb/genimage.cfg b/board/aspeed/ast2600-evb/genimage.cfg
> new file mode 100644
> index 000000000000..56932d478756
> --- /dev/null
> +++ b/board/aspeed/ast2600-evb/genimage.cfg
> @@ -0,0 +1,40 @@
> +#
> +# This config reproduces the OpenBMC flash layout defined in Linux :
> +#
> +#    arch/arm/boot/dts/openbmc-flash-layout-64.dtsi
> +#
> +# and included by aspeed-ast2600-evb.dts
> +#
> +flash nor-64M-256 {
> +       pebsize = 4K
> +       numpebs = 16K
> +       minimum-io-unit-size = 256
> +}
> +
> +image flash.img {
> +       flash {
> +       }
> +       flashtype = "nor-64M-256"
> +
> +       partition uboot {
> +               image = "u-boot.bin"

This works with the config you're using. If we went to upstream we
would need to construct this from the SPL + u-boot-FIT.

> +               size = 896K
> +       }
> +
> +       partition ubootenv {
> +               /* TODO */
> +               offset = 896K
> +               size = 128K
> +       }
> +
> +       partition fitimage {
> +               image = "image.itb"
> +               offset = 1M
> +               size = 9M
> +       }
> +
> +       partition spare {
> +               offset = 10M
> +               size = 54M
> +       }
> +}

> new file mode 100644
> index 000000000000..cd058ad0ac28
> --- /dev/null
> +++ b/configs/aspeed_ast2600evb_defconfig
> @@ -0,0 +1,44 @@
> +# Architecture
> +BR2_arm=y
> +BR2_cortex_a7=y
> +BR2_ARM_FPU_VFPV4=y

Nice. This works on hardware and in qemu I assume? Jeremy was asking
about the correct FPU config for the 2600 the other day.

> +# Boot
> +BR2_TARGET_UBOOT=y
> +BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
> +BR2_TARGET_UBOOT_CUSTOM_GIT=y
> +BR2_TARGET_UBOOT_CUSTOM_REPO_URL="https://github.com/openbmc/u-boot.git"
> +BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="f2b82fa4ba17ed8091fe76c284220006645a293b"
> +BR2_TARGET_UBOOT_BOARD_DEFCONFIG="evb-ast2600"
> +BR2_TARGET_UBOOT_NEEDS_DTC=y
> +BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="DEVICE_TREE=ast2600a1-evb"

This could be "ast2600-evb", which is pretty much the same as the a1
device tree but is intended for all non-a0 boards.

> +
> +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
>
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Buildroot] [PATCH v3 1/2] configs/aspeed_ast2600evb: new defconfig
  2022-06-21 20:34 [Buildroot] [PATCH v3 1/2] configs/aspeed_ast2600evb: new defconfig Cédric Le Goater
  2022-06-21 20:34 ` [Buildroot] [PATCH v3 2/2] configs/aspeed_ast2500evb: " Cédric Le Goater
  2022-06-23 13:00 ` [Buildroot] [PATCH v3 1/2] configs/aspeed_ast2600evb: " Joel Stanley
@ 2022-06-27 20:49 ` Arnout Vandecappelle
  2 siblings, 0 replies; 6+ messages in thread
From: Arnout Vandecappelle @ 2022-06-27 20:49 UTC (permalink / raw)
  To: Cédric Le Goater, buildroot; +Cc: chin-ting_kuo, troy_lee, Joel Stanley



On 21/06/2022 22:34, Cédric Le Goater wrote:
> The kernel is from upstream and U-Boot is from the OpenBMC branch
> because mainline doesn't have the required support for HW, yet.
> 
> The main resulting file from the build is a flash image. The partition
> layout matches the OpenBMC one for 64M 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.
> 
> Signed-off-by: Cédric Le Goater <clg@kaod.org>

  Both applied to master, thanks.

  Very nice patches!

  Regards,
  Arnout

> ---
> 
>   Changes in v3:
> 
>   - defconfig cleanup
> 
>   Changes in v2:
> 
>   - Add Joel to the list of developers
>   - Removed unused CONFIG from linux.fragment but added
>     CONFIG_I2C_SLAVE_EEPROM which is useful for tests
>   - minor cleanups in readme.txt
> 
>   DEVELOPERS                             |  4 ++
>   board/aspeed/ast2600-evb/genimage.cfg  | 40 +++++++++++++
>   board/aspeed/ast2600-evb/readme.txt    | 80 ++++++++++++++++++++++++++
>   board/aspeed/common/image.its.template | 56 ++++++++++++++++++
>   board/aspeed/common/post-image.sh      | 27 +++++++++
>   configs/aspeed_ast2600evb_defconfig    | 44 ++++++++++++++
>   6 files changed, 251 insertions(+)
>   create mode 100644 board/aspeed/ast2600-evb/genimage.cfg
>   create mode 100644 board/aspeed/ast2600-evb/readme.txt
>   create mode 100644 board/aspeed/common/image.its.template
>   create mode 100755 board/aspeed/common/post-image.sh
>   create mode 100644 configs/aspeed_ast2600evb_defconfig
> 
> diff --git a/DEVELOPERS b/DEVELOPERS
> index aa18de83bcb6..0a09b8b5607c 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -501,8 +501,10 @@ F:	package/znc/
>   N:	Cédric Le Goater <clg@kaod.org>
>   F:	board/qemu/ppc-bamboo/
>   F:	board/qemu/ppc64le-powernv8/readme.txt
> +F:	board/aspeed/
>   F:	configs/qemu_ppc_bamboo_defconfig
>   F:	configs/qemu_ppc64le_powernv8_defconfig
> +F:	configs/aspeed*
>   
>   N:	Charles Hardin <ckhardin@gmail.com>
>   F:	package/alsa-plugins/
> @@ -1451,6 +1453,8 @@ F:	board/qemu/ppc64le-pseries/
>   F:	configs/qemu_ppc64le_pseries_defconfig
>   F:	board/qemu/ppc-mac99/
>   F:	configs/qemu_ppc_mac99_defconfig
> +F:	board/aspeed/
> +F:	configs/aspeed*
>   
>   N:	Johan Derycke <johanderycke@gmail.com>
>   F:	package/python-libconfig/
> diff --git a/board/aspeed/ast2600-evb/genimage.cfg b/board/aspeed/ast2600-evb/genimage.cfg
> new file mode 100644
> index 000000000000..56932d478756
> --- /dev/null
> +++ b/board/aspeed/ast2600-evb/genimage.cfg
> @@ -0,0 +1,40 @@
> +#
> +# This config reproduces the OpenBMC flash layout defined in Linux :
> +#
> +#    arch/arm/boot/dts/openbmc-flash-layout-64.dtsi
> +#
> +# and included by aspeed-ast2600-evb.dts
> +#
> +flash nor-64M-256 {
> +	pebsize = 4K
> +	numpebs = 16K
> +	minimum-io-unit-size = 256
> +}
> +
> +image flash.img {
> +	flash {
> +	}
> +	flashtype = "nor-64M-256"
> +
> +	partition uboot {
> +		image = "u-boot.bin"
> +		size = 896K
> +	}
> +
> +	partition ubootenv {
> +		/* TODO */
> +		offset = 896K
> +		size = 128K
> +	}
> +
> +	partition fitimage {
> +		image = "image.itb"
> +		offset = 1M
> +		size = 9M
> +	}
> +
> +	partition spare {
> +		offset = 10M
> +		size = 54M
> +	}
> +}
> diff --git a/board/aspeed/ast2600-evb/readme.txt b/board/aspeed/ast2600-evb/readme.txt
> new file mode 100644
> index 000000000000..1f7ba13d5d97
> --- /dev/null
> +++ b/board/aspeed/ast2600-evb/readme.txt
> @@ -0,0 +1,80 @@
> +Aspeed AST2600 EVB
> +
> +Introduction
> +============
> +
> +The AST2600 EVB is an evaluation board for the AST2600 SoC, most
> +commonly used as a Server Management Processor. It includes a
> +Dual-core ARM Cortex A7 processor with DDR4 SDRAM (up to 2GB), SPI
> +flash memory devices for BMC and host firmwares and numerous
> +controllers to drive the server board.
> +
> +  https://www.aspeedtech.com/server_ast2600/
> +
> +How to build it
> +===============
> +
> +Configure buildroot:
> +
> +  $ make aspeed_ast2600evb_defconfig
> +
> +Compile everything and build the rootfs image:
> +
> +  $ make
> +
> +Result of the build
> +===================
> +
> +After building, the output/images directory contains:
> +
> +  output/images/
> +    ├── aspeed-ast2600-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 AST2600 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 ast2600-evb \
> +	-drive file=output/images/flash.img,format=raw,if=mtd \
> +	-nographic
> +
> +   $ qemu-system-arm -M ast2600-evb \
> +	-kernel output/images/zImage \
> +	-initrd output/images/rootfs.cpio \
> +	-dtb output/images/aspeed-ast2600-evb.dtb \
> +	-nographic
> diff --git a/board/aspeed/common/image.its.template b/board/aspeed/common/image.its.template
> new file mode 100644
> index 000000000000..e3200e240709
> --- /dev/null
> +++ b/board/aspeed/common/image.its.template
> @@ -0,0 +1,56 @@
> +/dts-v1/;
> +
> +/ {
> +	description = "Kernel and buildroot image";
> +	#address-cells = <1>;
> +
> +	images {
> +		kernel-1 {
> +			description = "Linux kernel";
> +			data = /incbin/("zImage");
> +			type = "kernel";
> +			arch = "arm";
> +			os = "linux";
> +			compression = "none";
> +			load = <0x80001000>;
> +			entry = <0x80001000>;
> +			hash-1 {
> +				algo = "sha256";
> +			};
> +		};
> +		fdt-1 {
> +			description = "Flattened Device Tree blob";
> +			data = /incbin/("%BOARD_DTB%");
> +			type = "flat_dt";
> +			arch = "arm";
> +			compression = "none";
> +			hash-1 {
> +				algo = "sha256";
> +			};
> +		};
> +		ramdisk-1 {
> +			description = "ramdisk";
> +			data = /incbin/("rootfs.cpio.xz");
> +			type = "ramdisk";
> +			arch = "arm";
> +			os = "linux";
> +			compression = "none";
> +			hash-1 {
> +				algo = "sha256";
> +			};
> +		};
> +	};
> +
> +	configurations {
> +		default = "conf-1";
> +		conf-1 {
> +			description = "Boot Linux kernel with FDT blob, ramdisk";
> +			kernel = "kernel-1";
> +			fdt = "fdt-1";
> +			ramdisk = "ramdisk-1";
> +			hash-1 {
> +				algo = "sha256";
> +			};
> +		};
> +	};
> +};
> diff --git a/board/aspeed/common/post-image.sh b/board/aspeed/common/post-image.sh
> new file mode 100755
> index 000000000000..ea65a49afff0
> --- /dev/null
> +++ b/board/aspeed/common/post-image.sh
> @@ -0,0 +1,27 @@
> +#!/bin/bash
> +
> +BOARD_DIR="$(dirname $0)"
> +mkimage=$HOST_DIR/bin/mkimage
> +
> +BOARD_DT=$(sed -n \
> +           's/^BR2_LINUX_KERNEL_INTREE_DTS_NAME="\([a-z0-9\-]*\).*"$/\1/p' \
> +           ${BR2_CONFIG})
> +
> +sed -e "s/%BOARD_DTB%/${BOARD_DT}.dtb/" \
> +    $BOARD_DIR/image.its.template > $BINARIES_DIR/image.its
> +
> +(cd $BINARIES_DIR && $mkimage -f image.its image.itb)
> +
> +GENIMAGE_CFG="board/aspeed/${BOARD_DT#aspeed-*}/genimage.cfg"
> +GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
> +
> +rm -rf "${GENIMAGE_TMP}"
> +
> +genimage \
> +  --rootpath "${TARGET_DIR}" \
> +  --tmppath "${GENIMAGE_TMP}" \
> +  --inputpath "${BINARIES_DIR}" \
> +  --outputpath "${BINARIES_DIR}" \
> +  --config "${GENIMAGE_CFG}"
> +
> +rm -f $BINARIES_DIR/image.its
> diff --git a/configs/aspeed_ast2600evb_defconfig b/configs/aspeed_ast2600evb_defconfig
> new file mode 100644
> index 000000000000..cd058ad0ac28
> --- /dev/null
> +++ b/configs/aspeed_ast2600evb_defconfig
> @@ -0,0 +1,44 @@
> +# Architecture
> +BR2_arm=y
> +BR2_cortex_a7=y
> +BR2_ARM_FPU_VFPV4=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_DTS_SUPPORT=y
> +BR2_LINUX_KERNEL_INTREE_DTS_NAME="aspeed-ast2600-evb"
> +
> +# Boot
> +BR2_TARGET_UBOOT=y
> +BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
> +BR2_TARGET_UBOOT_CUSTOM_GIT=y
> +BR2_TARGET_UBOOT_CUSTOM_REPO_URL="https://github.com/openbmc/u-boot.git"
> +BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="f2b82fa4ba17ed8091fe76c284220006645a293b"
> +BR2_TARGET_UBOOT_BOARD_DEFCONFIG="evb-ast2600"
> +BR2_TARGET_UBOOT_NEEDS_DTC=y
> +BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="DEVICE_TREE=ast2600a1-evb"
> +
> +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
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Buildroot] [PATCH v3 2/2] configs/aspeed_ast2500evb: new defconfig
  2022-06-21 20:34 ` [Buildroot] [PATCH v3 2/2] configs/aspeed_ast2500evb: " Cédric Le Goater
@ 2022-06-27 20:52   ` Arnout Vandecappelle
  2022-06-28  5:15     ` Cédric Le Goater
  0 siblings, 1 reply; 6+ messages in thread
From: Arnout Vandecappelle @ 2022-06-27 20:52 UTC (permalink / raw)
  To: Cédric Le Goater, buildroot; +Cc: chin-ting_kuo, troy_lee, Joel Stanley



On 21/06/2022 22:34, Cédric Le Goater wrote:
> 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@jms.id.au>
> Signed-off-by: Cédric Le Goater <clg@kaod.org>

[snip]
> 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

  Normally this would be

# CONFIG_ARCH_MULTI_V7 is not set

but this works as well. How did you generate this config? diffconfig?

  Anyway, I applied it as is.

  Regards,
  Arnout

> +CONFIG_MACH_ASPEED_G6=n
> +CONFIG_SMP=n
> +CONFIG_EXT4_FS=n
> +CONFIG_DEBUG_FS=n
> +CONFIG_SUSPEND=n
[snip]
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Buildroot] [PATCH v3 2/2] configs/aspeed_ast2500evb: new defconfig
  2022-06-27 20:52   ` Arnout Vandecappelle
@ 2022-06-28  5:15     ` Cédric Le Goater
  0 siblings, 0 replies; 6+ messages in thread
From: Cédric Le Goater @ 2022-06-28  5:15 UTC (permalink / raw)
  To: Arnout Vandecappelle, buildroot; +Cc: chin-ting_kuo, troy_lee, Joel Stanley

On 6/27/22 22:52, Arnout Vandecappelle wrote:
> 
> 
> On 21/06/2022 22:34, Cédric Le Goater wrote:
>> 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@jms.id.au>
>> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> 
> [snip]
>> 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
> 
>   Normally this would be
> 
> # CONFIG_ARCH_MULTI_V7 is not set
> 
> but this works as well. How did you generate this config? diffconfig?

no. Manually, adding =n until the kernel image file reached a size that
was small enough to fit the flash partition.

Having 2 different defconfig  aspeed_g5 and aspeed_g6 would help but
it is more work to maintain.

Thanks,

C.


> 
>   Anyway, I applied it as is.
> 
>   Regards,
>   Arnout
> 
>> +CONFIG_MACH_ASPEED_G6=n
>> +CONFIG_SMP=n
>> +CONFIG_EXT4_FS=n
>> +CONFIG_DEBUG_FS=n
>> +CONFIG_SUSPEND=n
> [snip]

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-06-28  5:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-21 20:34 [Buildroot] [PATCH v3 1/2] configs/aspeed_ast2600evb: new defconfig Cédric Le Goater
2022-06-21 20:34 ` [Buildroot] [PATCH v3 2/2] configs/aspeed_ast2500evb: " Cédric Le Goater
2022-06-27 20:52   ` Arnout Vandecappelle
2022-06-28  5:15     ` Cédric Le Goater
2022-06-23 13:00 ` [Buildroot] [PATCH v3 1/2] configs/aspeed_ast2600evb: " Joel Stanley
2022-06-27 20:49 ` Arnout Vandecappelle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.