diff mbox series

[v2,1/6] board/orangepi/orangepi-zero-plus2: switch to extlinux

Message ID 20220225072622.3584480-2-geomatsi@gmail.com
State Accepted
Headers show
Series orangepi/linksprite: convert more allwinner boards to extlinux | expand

Commit Message

Sergey Matyukevich Feb. 25, 2022, 7:26 a.m. UTC
Switch to extlinux instead of U-Boot boot script. Drop custom boot
script and genimage config. Instead use common orangepi files from
board/orangepi/common. To help extlinux to find DTB without U-Boot
environment changes, do not strip arm64 board specific directory
from DTB name when installing it in /boot directory. For this
purpose use BR2_KERNEL_DTB_KEEP_DIRNAME config option. Finally,
tidy up configuration file adding section names.

Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
---
 board/orangepi/orangepi-zero-plus2/boot.cmd   |  6 ---
 .../orangepi/orangepi-zero-plus2/genimage.cfg | 41 -------------------
 configs/orangepi_zero_plus2_defconfig         | 14 ++++---
 3 files changed, 8 insertions(+), 53 deletions(-)
 delete mode 100644 board/orangepi/orangepi-zero-plus2/boot.cmd
 delete mode 100644 board/orangepi/orangepi-zero-plus2/genimage.cfg

Comments

Giulio Benetti Feb. 26, 2022, 10:52 a.m. UTC | #1
Hi Sergey,

On 25/02/22 08:26, Sergey Matyukevich wrote:
> Switch to extlinux instead of U-Boot boot script. Drop custom boot
> script and genimage config. Instead use common orangepi files from
> board/orangepi/common. To help extlinux to find DTB without U-Boot
> environment changes, do not strip arm64 board specific directory
> from DTB name when installing it in /boot directory. For this
> purpose use BR2_KERNEL_DTB_KEEP_DIRNAME config option. Finally,
> tidy up configuration file adding section names.
> 
> Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>

Reviewed-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Tested-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
[Giulio: build tested only]

Best regards
diff mbox series

Patch

diff --git a/board/orangepi/orangepi-zero-plus2/boot.cmd b/board/orangepi/orangepi-zero-plus2/boot.cmd
deleted file mode 100644
index aa5162004b..0000000000
--- a/board/orangepi/orangepi-zero-plus2/boot.cmd
+++ /dev/null
@@ -1,6 +0,0 @@ 
-setenv bootargs console=ttyS0,115200 earlyprintk root=PARTLABEL=rootfs rootwait
-
-fatload mmc 0 $kernel_addr_r Image
-fatload mmc 0 $fdt_addr_r sun50i-h5-orangepi-zero-plus2.dtb
-
-booti $kernel_addr_r - $fdt_addr_r
diff --git a/board/orangepi/orangepi-zero-plus2/genimage.cfg b/board/orangepi/orangepi-zero-plus2/genimage.cfg
deleted file mode 100644
index 5a7ee7707a..0000000000
--- a/board/orangepi/orangepi-zero-plus2/genimage.cfg
+++ /dev/null
@@ -1,41 +0,0 @@ 
-image boot.vfat {
-	vfat {
-		files = {
-			"Image",
-			"sun50i-h5-orangepi-zero-plus2.dtb",
-			"boot.scr"
-		}
-	}
-
-	size = 64M
-}
-
-image sdcard.img {
-	hdimage {
-		# for root=PARTLABEL support
-		partition-table-type = "gpt"
-		# default GPT location conflicts with bootloaders, move it after
-		gpt-location = 1M
-	}
-
-	partition spl {
-		in-partition-table = "no"
-		image = "u-boot-sunxi-with-spl.bin"
-		offset = 8K
-		size = 1016K # 1MB - 8KB
-	}
-
-	partition boot {
-		partition-type-uuid = "F"
-		bootable = "true"
-		image = "boot.vfat"
-	}
-
-	# 'rootfs' will be used as the partition label, used
-	# with root=PARTLABEL=rootfs kernel command line
-	partition rootfs {
-		partition-type-uuid = "L"
-		image = "rootfs.ext4"
-		size = 256M
-	}
-}
diff --git a/configs/orangepi_zero_plus2_defconfig b/configs/orangepi_zero_plus2_defconfig
index 9d88b37ac9..ef171c3ad3 100644
--- a/configs/orangepi_zero_plus2_defconfig
+++ b/configs/orangepi_zero_plus2_defconfig
@@ -27,9 +27,6 @@  BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
 BR2_TARGET_UBOOT_SPL=y
 BR2_TARGET_UBOOT_SPL_NAME="u-boot-sunxi-with-spl.bin"
 BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="SCP=/dev/null"
-BR2_PACKAGE_HOST_UBOOT_TOOLS=y
-BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT=y
-BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT_SOURCE="board/orangepi/orangepi-zero-plus2/boot.cmd"
 
 # Kernel
 BR2_LINUX_KERNEL=y
@@ -40,6 +37,8 @@  BR2_LINUX_KERNEL_DTS_SUPPORT=y
 BR2_LINUX_KERNEL_INTREE_DTS_NAME="allwinner/sun50i-h5-orangepi-zero-plus2"
 BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/orangepi/orangepi-zero-plus2/linux-extras.config"
 BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
+BR2_LINUX_KERNEL_INSTALL_TARGET=y
+BR2_LINUX_KERNEL_DTB_KEEP_DIRNAME=y
 
 # wireless firmware
 BR2_PACKAGE_LINUX_FIRMWARE=y
@@ -58,8 +57,11 @@  BR2_TARGET_GENERIC_ISSUE="Welcome to Orangepi Zero Plus2"
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
 BR2_TARGET_ROOTFS_EXT2_SIZE="120M"
-BR2_PACKAGE_HOST_DOSFSTOOLS=y
+
+# host tools
 BR2_PACKAGE_HOST_GENIMAGE=y
-BR2_PACKAGE_HOST_MTOOLS=y
+
+# image scripts
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/orangepi/common/post-build.sh"
 BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
-BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/orangepi/orangepi-zero-plus2/genimage.cfg"
+BR2_ROOTFS_POST_SCRIPT_ARGS="-c $(BINARIES_DIR)/genimage.cfg"