Skip to contentSkip to conversation

nezha_defconfig: bump opensbi, u-boot and linux

PATCH In review Peter Korsgaard 2 participants 8 messages Sep 6, 2022 – Sep 7, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 nezha_defconfig: bump opensbi, u-boot and linux

Opensbi is now based on 1.1, U-Boot on 2022.07-rc3 and Linux on 5.19-rc1. We don't yet support 5.19 kernel headers, so use 5.17 instead.

The incompatibility between opensbi and u-boot is now fixed, so drop 0001-arch-riscv-dts-sun20i-d1.dtsi-adjust-plic-compatible.patch.

The updated device tree in the kernel tree no longer specifies a memory node (and the board exists in 512M/1G/2G variants, so instead use the (otherwise identical) device tree provided by u-boot, where the memory node is fixed up based on the detected memory size. Keep the kernel build configuration in place so host-{bison,flex} is built.

---
 .../nezha/overlay/boot/extlinux/extlinux.conf |  2 +-
 ...port-building-u-boot.toc1-for-nezda.patch} |  0
 ...un20i-d1.dtsi-adjust-plic-compatible.patch | 36 -------------------
 configs/nezha_defconfig                       |  8 ++---
 4 files changed, 5 insertions(+), 41 deletions(-)
 rename board/nezha/patches/uboot/{0002-Makefile-HACK-Support-building-u-boot.toc1-for-nezda.patch => 0001-Makefile-HACK-Support-building-u-boot.toc1-for-nezda.patch} (100%)
 delete mode 100644 board/nezha/patches/uboot/0001-arch-riscv-dts-sun20i-d1.dtsi-adjust-plic-compatible.patch
board/nezha/overlay/boot/extlinux/extlinux.conf +1 -1
index 02232f4d16..91b2298628 100644
@@ -1,4 +1,4 @@
 label linux
   kernel /boot/Image
-  devicetree /boot/sun20i-d1-nezha.dtb
+  # use devicetree from u-boot
   append console=ttyS0,115200 root=/dev/mmcblk0p1 ro rootwait
board/nezha/patches/uboot/0001-Makefile-HACK-Support-building-u-boot.toc1-for-nezda.patch renamed from board/nezha/patches/uboot/0002-Makefile-HACK-Support-building-u-boot.toc1-for-nezda.patch +0 -0
similarity index 100%
rename from board/nezha/patches/uboot/0002-Makefile-HACK-Support-building-u-boot.toc1-for-nezda.patch
rename to board/nezha/patches/uboot/0001-Makefile-HACK-Support-building-u-boot.toc1-for-nezda.patch
board/nezha/patches/uboot/0001-arch-riscv-dts-sun20i-d1.dtsi-adjust-plic-compatible.patch deleted +0 -36
deleted file mode 100644
index 3524f44a61..0000000000
@@ -1,36 +0,0 @@
-From 99cf8f37ceb1def9e7bbaccc395cf2275723e03d Mon Sep 17 00:00:00 2001
-From: Peter Korsgaard <[email protected]>
-Date: Thu, 4 Nov 2021 22:15:13 +0100
-Subject: [PATCH] arch/riscv/dts/sun20i-d1.dtsi: adjust plic compatible to
- match opensbi
-
-The T-HEAD PLIC is by default not accessible from S-mode, and access must be
-enabled by opensbi to make it accessible to Linux.
-
-The DTB is used both by U-Boot and opensbi (but the PLIC node is ignored by
-U-Boot), so change the compatible to match what opensbi expects to fix a
-crash during Linux boot:
-
-https://github.com/riscv-software-src/opensbi/commit/78c2b19218bd
-
-Signed-off-by: Peter Korsgaard <[email protected]>
----
- arch/riscv/dts/sun20i-d1.dtsi | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/arch/riscv/dts/sun20i-d1.dtsi b/arch/riscv/dts/sun20i-d1.dtsi
-index 280e0336d4..56d02c33b0 100644
---- a/arch/riscv/dts/sun20i-d1.dtsi
-+++ b/arch/riscv/dts/sun20i-d1.dtsi
-@@ -1136,7 +1136,7 @@
- 
- 		plic: interrupt-controller@10000000 {
- 			compatible = "allwinner,sun20i-d1-plic",
--				     "sifive,plic-1.0.0";
-+				     "thead,c900-plic";
- 			reg = <0x10000000 0x4000000>;
- 			#address-cells = <0>;
- 			interrupts-extended = <&cpu0_intc 11>,
--- 
-2.20.1
-
configs/nezha_defconfig +4 -4
index 2d66d6cb4a..7a7e86ceab 100644
@@ -1,12 +1,12 @@
 BR2_riscv=y
 BR2_GLOBAL_PATCH_DIR="board/nezha/patches"
-BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_14=y
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_17=y
 BR2_ROOTFS_OVERLAY="board/nezha/overlay"
 BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
 BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/nezha/genimage.cfg"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
-BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,smaeul,linux,012f5a3d01be6d44e32c74bb3637ec281790b297)/linux-012f5a3d01be6d44e32c74bb3637ec281790b297.tar.gz"
+BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,smaeul,linux,fe178cf0153d98b71cb01a46c8cc050826a17e77)/linux-fe178cf0153d98b71cb01a46c8cc050826a17e77.tar.gz"
 BR2_LINUX_KERNEL_DEFCONFIG="nezha"
 BR2_LINUX_KERNEL_DTS_SUPPORT=y
 BR2_LINUX_KERNEL_INTREE_DTS_NAME="allwinner/sun20i-d1-nezha"
@@ -16,14 +16,14 @@ BR2_TARGET_ROOTFS_EXT2_4=y
 # BR2_TARGET_ROOTFS_TAR is not set
 BR2_TARGET_OPENSBI=y
 BR2_TARGET_OPENSBI_CUSTOM_TARBALL=y
-BR2_TARGET_OPENSBI_CUSTOM_TARBALL_LOCATION="$(call github,smaeul,opensbi,b9125c6f8909d1cc0417795737fc13cb6297ff11)/opensbi-b9125c6f8909d1cc0417795737fc13cb6297ff11.tar.gz"
+BR2_TARGET_OPENSBI_CUSTOM_TARBALL_LOCATION="$(call github,smaeul,opensbi,e6793dc36a71537023f078034fe795c64a9992a3)/opensbi-e6793dc36a71537023f078034fe795c64a9992a3.tar.gz"
 BR2_TARGET_OPENSBI_PLAT="generic"
 # BR2_TARGET_OPENSBI_INSTALL_JUMP_IMG is not set
 BR2_TARGET_SUN20I_D1_SPL=y
 BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
 BR2_TARGET_UBOOT_CUSTOM_TARBALL=y
-BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="$(call github,smaeul,u-boot,62392d3b8a624a80646c1876533336f90140088d)/uboot-62392d3b8a624a80646c1876533336f90140088d.tar.gz"
+BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="$(call github,smaeul,u-boot,d1-2022-05-26)/uboot-d1-2022-05-26.tar.gz"
 BR2_TARGET_UBOOT_BOARD_DEFCONFIG="nezha"
 BR2_TARGET_UBOOT_NEEDS_DTC=y
 BR2_TARGET_UBOOT_NEEDS_PYTHON3=y
Signature · 6 lines
2.30.2

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

PATCH 2/2 nezha_defconfig: configure eth0 using DHCP

With the move to 5.19-rc1, the ethernet interface is now supported. Configure it using DHCP at startup.

---
 configs/nezha_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/nezha_defconfig +1 -0
index 7a7e86ceab..2e2df3c09d 100644
@@ -1,6 +1,7 @@
 BR2_riscv=y
 BR2_GLOBAL_PATCH_DIR="board/nezha/patches"
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_17=y
+BR2_SYSTEM_DHCP="eth0"
 BR2_ROOTFS_OVERLAY="board/nezha/overlay"
 BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
 BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/nezha/genimage.cfg"
Signature · 6 lines
2.30.2

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

Peter, All,

On 2022-09-06 18:15 +0200, Peter Korsgaard spake thusly:

Quoted 11 lines

Opensbi is now based on 1.1, U-Boot on 2022.07-rc3 and Linux on 5.19-rc1. We don't yet support 5.19 kernel headers, so use 5.17 instead.

The incompatibility between opensbi and u-boot is now fixed, so drop 0001-arch-riscv-dts-sun20i-d1.dtsi-adjust-plic-compatible.patch.

The updated device tree in the kernel tree no longer specifies a memory node (and the board exists in 512M/1G/2G variants, so instead use the (otherwise identical) device tree provided by u-boot, where the memory node is fixed up based on the detected memory size. Keep the kernel build configuration in place so host-{bison,flex} is built.

So, we've discussed this i=on IRC, but I am not sure this is still needed.

Indeed, you said that the DTB to be used is the one from u-boot, not the kernel, so there is no reason to build the allwinner/sun20i-d1-nezha from the kernel.

u-boot relies on host-dtc, and host-dtc already depends on host-bison and host-flex, so there is no need to pull those by asking the kernel to build a DTB.

Finally, with PPD, the PPD of u-boot would not have host-flex and host-bison because of the kernel anyway (it gets them from host-dtc instead) as the kernel is not a dependency of u-boot.

So, there is no reason to keep building the allwinner/sun20i-d1-nezha DTB.

Or did I miss something else (again)?

Regards,
Yann E. MORIN.

Quoted 109 lines
---
 .../nezha/overlay/boot/extlinux/extlinux.conf |  2 +-
 ...port-building-u-boot.toc1-for-nezda.patch} |  0
 ...un20i-d1.dtsi-adjust-plic-compatible.patch | 36 -------------------
 configs/nezha_defconfig                       |  8 ++---
 4 files changed, 5 insertions(+), 41 deletions(-)
 rename board/nezha/patches/uboot/{0002-Makefile-HACK-Support-building-u-boot.toc1-for-nezda.patch => 0001-Makefile-HACK-Support-building-u-boot.toc1-for-nezda.patch} (100%)
 delete mode 100644 board/nezha/patches/uboot/0001-arch-riscv-dts-sun20i-d1.dtsi-adjust-plic-compatible.patch
board/nezha/overlay/boot/extlinux/extlinux.conf +1 -1
index 02232f4d16..91b2298628 100644
@@ -1,4 +1,4 @@
 label linux
   kernel /boot/Image
-  devicetree /boot/sun20i-d1-nezha.dtb
+  # use devicetree from u-boot
   append console=ttyS0,115200 root=/dev/mmcblk0p1 ro rootwait
board/nezha/patches/uboot/0001-Makefile-HACK-Support-building-u-boot.toc1-for-nezda.patch renamed from board/nezha/patches/uboot/0002-Makefile-HACK-Support-building-u-boot.toc1-for-nezda.patch +0 -0
similarity index 100%
rename from board/nezha/patches/uboot/0002-Makefile-HACK-Support-building-u-boot.toc1-for-nezda.patch
rename to board/nezha/patches/uboot/0001-Makefile-HACK-Support-building-u-boot.toc1-for-nezda.patch
board/nezha/patches/uboot/0001-arch-riscv-dts-sun20i-d1.dtsi-adjust-plic-compatible.patch deleted +0 -36
deleted file mode 100644
index 3524f44a61..0000000000
@@ -1,36 +0,0 @@
-From 99cf8f37ceb1def9e7bbaccc395cf2275723e03d Mon Sep 17 00:00:00 2001
-From: Peter Korsgaard <[email protected]>
-Date: Thu, 4 Nov 2021 22:15:13 +0100
-Subject: [PATCH] arch/riscv/dts/sun20i-d1.dtsi: adjust plic compatible to
- match opensbi
-
-The T-HEAD PLIC is by default not accessible from S-mode, and access must be
-enabled by opensbi to make it accessible to Linux.
-
-The DTB is used both by U-Boot and opensbi (but the PLIC node is ignored by
-U-Boot), so change the compatible to match what opensbi expects to fix a
-crash during Linux boot:
-
-https://github.com/riscv-software-src/opensbi/commit/78c2b19218bd
-
-Signed-off-by: Peter Korsgaard <[email protected]>
----
- arch/riscv/dts/sun20i-d1.dtsi | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/arch/riscv/dts/sun20i-d1.dtsi b/arch/riscv/dts/sun20i-d1.dtsi
-index 280e0336d4..56d02c33b0 100644
---- a/arch/riscv/dts/sun20i-d1.dtsi
-+++ b/arch/riscv/dts/sun20i-d1.dtsi
-@@ -1136,7 +1136,7 @@
- 
- 		plic: interrupt-controller@10000000 {
- 			compatible = "allwinner,sun20i-d1-plic",
--				     "sifive,plic-1.0.0";
-+				     "thead,c900-plic";
- 			reg = <0x10000000 0x4000000>;
- 			#address-cells = <0>;
- 			interrupts-extended = <&cpu0_intc 11>,
--- 
-2.20.1
-
configs/nezha_defconfig +4 -4
index 2d66d6cb4a..7a7e86ceab 100644
@@ -1,12 +1,12 @@
 BR2_riscv=y
 BR2_GLOBAL_PATCH_DIR="board/nezha/patches"
-BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_14=y
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_17=y
 BR2_ROOTFS_OVERLAY="board/nezha/overlay"
 BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
 BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/nezha/genimage.cfg"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
-BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,smaeul,linux,012f5a3d01be6d44e32c74bb3637ec281790b297)/linux-012f5a3d01be6d44e32c74bb3637ec281790b297.tar.gz"
+BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,smaeul,linux,fe178cf0153d98b71cb01a46c8cc050826a17e77)/linux-fe178cf0153d98b71cb01a46c8cc050826a17e77.tar.gz"
 BR2_LINUX_KERNEL_DEFCONFIG="nezha"
 BR2_LINUX_KERNEL_DTS_SUPPORT=y
 BR2_LINUX_KERNEL_INTREE_DTS_NAME="allwinner/sun20i-d1-nezha"
@@ -16,14 +16,14 @@ BR2_TARGET_ROOTFS_EXT2_4=y
 # BR2_TARGET_ROOTFS_TAR is not set
 BR2_TARGET_OPENSBI=y
 BR2_TARGET_OPENSBI_CUSTOM_TARBALL=y
-BR2_TARGET_OPENSBI_CUSTOM_TARBALL_LOCATION="$(call github,smaeul,opensbi,b9125c6f8909d1cc0417795737fc13cb6297ff11)/opensbi-b9125c6f8909d1cc0417795737fc13cb6297ff11.tar.gz"
+BR2_TARGET_OPENSBI_CUSTOM_TARBALL_LOCATION="$(call github,smaeul,opensbi,e6793dc36a71537023f078034fe795c64a9992a3)/opensbi-e6793dc36a71537023f078034fe795c64a9992a3.tar.gz"
 BR2_TARGET_OPENSBI_PLAT="generic"
 # BR2_TARGET_OPENSBI_INSTALL_JUMP_IMG is not set
 BR2_TARGET_SUN20I_D1_SPL=y
 BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
 BR2_TARGET_UBOOT_CUSTOM_TARBALL=y
-BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="$(call github,smaeul,u-boot,62392d3b8a624a80646c1876533336f90140088d)/uboot-62392d3b8a624a80646c1876533336f90140088d.tar.gz"
+BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="$(call github,smaeul,u-boot,d1-2022-05-26)/uboot-d1-2022-05-26.tar.gz"
 BR2_TARGET_UBOOT_BOARD_DEFCONFIG="nezha"
 BR2_TARGET_UBOOT_NEEDS_DTC=y
 BR2_TARGET_UBOOT_NEEDS_PYTHON3=y
Signature · 6 lines
2.30.2

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw

Peter, All,

On 2022-09-06 23:35 +0200, Yann E. MORIN spake thusly:

Quoted 6 lines

On 2022-09-06 18:15 +0200, Peter Korsgaard spake thusly:

Quoted 2 lines

[...] Keep the kernel build configuration in
place so host-{bison,flex} is built.

Finally, with PPD, the PPD of u-boot would not have host-flex and host-bison because of the kernel anyway (it gets them from host-dtc instead) as the kernel is not a dependency of u-boot.

And the build did actually succeed with PPD when running in our docker ref image which does not have flex or bison, and removing those two lines:
BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="allwinner/sun20i-d1-nezha"

But since I don't have the board, I can't test it...

Regards,
Yann E. MORIN.

Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#4 lore raw
Quoted 11 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

Peter, All,
On 2022-09-06 23:35 +0200, Yann E. MORIN spake thusly:

Quoted 6 lines

On 2022-09-06 18:15 +0200, Peter Korsgaard spake thusly:

Quoted 2 lines

[...] Keep the kernel build configuration in
place so host-{bison,flex} is built.

Finally, with PPD, the PPD of u-boot would not have host-flex and host-bison because of the kernel anyway (it gets them from host-dtc instead) as the kernel is not a dependency of u-boot.

Quoted 7 lines

And the build did actually succeed with PPD when running in our docker ref image which does not have flex or bison, and removing those two lines:
BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="allwinner/sun20i-d1-nezha"

But since I don't have the board, I can't test it...

Hmm, perhaps the comment in linux.mk is wrong then and modern kernels no longer need flex and bison? No, it does look like it generated dtc-lexer.lex.c / dtc-parser.tab.c:

ls -lah build/linux-custom/scripts/dtc/dtc-*
-rw-r--r-- 1 peko peko 6,2K Jun 14 03:26 build/linux-custom/scripts/dtc/dtc-lexer.l

-rw-r--r-- 1 peko peko  59K Sep  7 08:24 build/linux-custom/scripts/dtc/dtc-lexer.lex.c
-rw-r--r-- 1 peko peko  33K Sep  7 08:24 build/linux-custom/scripts/dtc/dtc-lexer.lex.o
-rw-r--r-- 1 peko peko  72K Sep  7 08:24 build/linux-custom/scripts/dtc/dtc-parser.tab.c
-rw-r--r-- 1 peko peko 4,3K Sep  7 08:24 build/linux-custom/scripts/dtc/dtc-parser.tab.h
-rw-r--r-- 1 peko peko  37K Sep  7 08:24 build/linux-custom/scripts/dtc/dtc-parser.tab.o

-rw-r--r-- 1 peko peko 11K Jun 14 03:26 build/linux-custom/scripts/dtc/dtc-parser.y

So I am not sure how it could work for you?

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

Peter, All,

On 2022-09-07 09:33 +0200, Peter Korsgaard spake thusly:

Quoted 9 lines
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

And the build did actually succeed with PPD when running in our docker ref image which does not have flex or bison, and removing those two lines:
BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="allwinner/sun20i-d1-nezha"

Hmm, perhaps the comment in linux.mk is wrong then and modern kernels no longer need flex and bison? No, it does look like it generated dtc-lexer.lex.c / dtc-parser.tab.c:

[--SNIP--]

Quoted 1 line

So I am not sure how it could work for you?

Because host-flex and host-bison are pulled in because... they are in LINUX_KCONFIG_DEPENDENCIES... So, they do end up in linux' PPD.

OK, this is an accident that they end up here. We may need to fix that in a cleaner way, though...

Regards,
Yann E. MORIN.

Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#6 lore raw
In reply to Yann E. MORIN
Quoted 27 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

Peter, All,
On 2022-09-06 18:15 +0200, Peter Korsgaard spake thusly:

Quoted 11 lines

Opensbi is now based on 1.1, U-Boot on 2022.07-rc3 and Linux on 5.19-rc1. We don't yet support 5.19 kernel headers, so use 5.17 instead.

The incompatibility between opensbi and u-boot is now fixed, so drop 0001-arch-riscv-dts-sun20i-d1.dtsi-adjust-plic-compatible.patch.

The updated device tree in the kernel tree no longer specifies a memory node (and the board exists in 512M/1G/2G variants, so instead use the (otherwise identical) device tree provided by u-boot, where the memory node is fixed up based on the detected memory size. Keep the kernel build configuration in place so host-{bison,flex} is built.

So, we've discussed this i=on IRC, but I am not sure this is still needed.

Indeed, you said that the DTB to be used is the one from u-boot, not the kernel, so there is no reason to build the allwinner/sun20i-d1-nezha from the kernel.

u-boot relies on host-dtc, and host-dtc already depends on host-bison and host-flex, so there is no need to pull those by asking the kernel to build a DTB.

Quoted 8 lines

Finally, with PPD, the PPD of u-boot would not have host-flex and host-bison because of the kernel anyway (it gets them from host-dtc instead) as the kernel is not a dependency of u-boot.

So, there is no reason to keep building the allwinner/sun20i-d1-nezha DTB.

Or did I miss something else (again)?

The issue is that the kernel will unconditionally build dtc and the dtbs even if we install them or not. E.G. from the toplevel Makefile:

ifdef CONFIG_OF_EARLY_FLATTREE
all: dtbs
endif

Which is unconditionally enabled on riscv. From arch/riscv/Makefile:

config RISCV

       ...
       select OF_EARLY_FLATTREE

So even with those two lines removed from the defconfig I still end up with:

find build/linux-custom -type f -a \( -name \*.dtb -o -name dtc \)

build/linux-custom/scripts/dtc/dtc build/linux-custom/arch/riscv/boot/dts/allwinner/sun20i-d1-nezha.dtb build/linux-custom/arch/riscv/boot/dts/allwinner/sun20i-d1-lichee-rv-dock.dtb build/linux-custom/arch/riscv/boot/dts/allwinner/sun20i-d1-lichee-rv.dtb

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

Peter, All,

On 2022-09-06 18:15 +0200, Peter Korsgaard spake thusly:

Quoted 11 lines

Opensbi is now based on 1.1, U-Boot on 2022.07-rc3 and Linux on 5.19-rc1. We don't yet support 5.19 kernel headers, so use 5.17 instead.

The incompatibility between opensbi and u-boot is now fixed, so drop 0001-arch-riscv-dts-sun20i-d1.dtsi-adjust-plic-compatible.patch.

The updated device tree in the kernel tree no longer specifies a memory node (and the board exists in 512M/1G/2G variants, so instead use the (otherwise identical) device tree provided by u-boot, where the memory node is fixed up based on the detected memory size. Keep the kernel build configuration in place so host-{bison,flex} is built.

Thus mystery has been solved, now, so:

Series of two patches applied to next, thanks.

Regards,
Yann E. MORIN.

Quoted 109 lines
---
 .../nezha/overlay/boot/extlinux/extlinux.conf |  2 +-
 ...port-building-u-boot.toc1-for-nezda.patch} |  0
 ...un20i-d1.dtsi-adjust-plic-compatible.patch | 36 -------------------
 configs/nezha_defconfig                       |  8 ++---
 4 files changed, 5 insertions(+), 41 deletions(-)
 rename board/nezha/patches/uboot/{0002-Makefile-HACK-Support-building-u-boot.toc1-for-nezda.patch => 0001-Makefile-HACK-Support-building-u-boot.toc1-for-nezda.patch} (100%)
 delete mode 100644 board/nezha/patches/uboot/0001-arch-riscv-dts-sun20i-d1.dtsi-adjust-plic-compatible.patch
board/nezha/overlay/boot/extlinux/extlinux.conf +1 -1
index 02232f4d16..91b2298628 100644
@@ -1,4 +1,4 @@
 label linux
   kernel /boot/Image
-  devicetree /boot/sun20i-d1-nezha.dtb
+  # use devicetree from u-boot
   append console=ttyS0,115200 root=/dev/mmcblk0p1 ro rootwait
board/nezha/patches/uboot/0001-Makefile-HACK-Support-building-u-boot.toc1-for-nezda.patch renamed from board/nezha/patches/uboot/0002-Makefile-HACK-Support-building-u-boot.toc1-for-nezda.patch +0 -0
similarity index 100%
rename from board/nezha/patches/uboot/0002-Makefile-HACK-Support-building-u-boot.toc1-for-nezda.patch
rename to board/nezha/patches/uboot/0001-Makefile-HACK-Support-building-u-boot.toc1-for-nezda.patch
board/nezha/patches/uboot/0001-arch-riscv-dts-sun20i-d1.dtsi-adjust-plic-compatible.patch deleted +0 -36
deleted file mode 100644
index 3524f44a61..0000000000
@@ -1,36 +0,0 @@
-From 99cf8f37ceb1def9e7bbaccc395cf2275723e03d Mon Sep 17 00:00:00 2001
-From: Peter Korsgaard <[email protected]>
-Date: Thu, 4 Nov 2021 22:15:13 +0100
-Subject: [PATCH] arch/riscv/dts/sun20i-d1.dtsi: adjust plic compatible to
- match opensbi
-
-The T-HEAD PLIC is by default not accessible from S-mode, and access must be
-enabled by opensbi to make it accessible to Linux.
-
-The DTB is used both by U-Boot and opensbi (but the PLIC node is ignored by
-U-Boot), so change the compatible to match what opensbi expects to fix a
-crash during Linux boot:
-
-https://github.com/riscv-software-src/opensbi/commit/78c2b19218bd
-
-Signed-off-by: Peter Korsgaard <[email protected]>
----
- arch/riscv/dts/sun20i-d1.dtsi | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/arch/riscv/dts/sun20i-d1.dtsi b/arch/riscv/dts/sun20i-d1.dtsi
-index 280e0336d4..56d02c33b0 100644
---- a/arch/riscv/dts/sun20i-d1.dtsi
-+++ b/arch/riscv/dts/sun20i-d1.dtsi
-@@ -1136,7 +1136,7 @@
- 
- 		plic: interrupt-controller@10000000 {
- 			compatible = "allwinner,sun20i-d1-plic",
--				     "sifive,plic-1.0.0";
-+				     "thead,c900-plic";
- 			reg = <0x10000000 0x4000000>;
- 			#address-cells = <0>;
- 			interrupts-extended = <&cpu0_intc 11>,
--- 
-2.20.1
-
configs/nezha_defconfig +4 -4
index 2d66d6cb4a..7a7e86ceab 100644
@@ -1,12 +1,12 @@
 BR2_riscv=y
 BR2_GLOBAL_PATCH_DIR="board/nezha/patches"
-BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_14=y
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_17=y
 BR2_ROOTFS_OVERLAY="board/nezha/overlay"
 BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
 BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/nezha/genimage.cfg"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
-BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,smaeul,linux,012f5a3d01be6d44e32c74bb3637ec281790b297)/linux-012f5a3d01be6d44e32c74bb3637ec281790b297.tar.gz"
+BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,smaeul,linux,fe178cf0153d98b71cb01a46c8cc050826a17e77)/linux-fe178cf0153d98b71cb01a46c8cc050826a17e77.tar.gz"
 BR2_LINUX_KERNEL_DEFCONFIG="nezha"
 BR2_LINUX_KERNEL_DTS_SUPPORT=y
 BR2_LINUX_KERNEL_INTREE_DTS_NAME="allwinner/sun20i-d1-nezha"
@@ -16,14 +16,14 @@ BR2_TARGET_ROOTFS_EXT2_4=y
 # BR2_TARGET_ROOTFS_TAR is not set
 BR2_TARGET_OPENSBI=y
 BR2_TARGET_OPENSBI_CUSTOM_TARBALL=y
-BR2_TARGET_OPENSBI_CUSTOM_TARBALL_LOCATION="$(call github,smaeul,opensbi,b9125c6f8909d1cc0417795737fc13cb6297ff11)/opensbi-b9125c6f8909d1cc0417795737fc13cb6297ff11.tar.gz"
+BR2_TARGET_OPENSBI_CUSTOM_TARBALL_LOCATION="$(call github,smaeul,opensbi,e6793dc36a71537023f078034fe795c64a9992a3)/opensbi-e6793dc36a71537023f078034fe795c64a9992a3.tar.gz"
 BR2_TARGET_OPENSBI_PLAT="generic"
 # BR2_TARGET_OPENSBI_INSTALL_JUMP_IMG is not set
 BR2_TARGET_SUN20I_D1_SPL=y
 BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
 BR2_TARGET_UBOOT_CUSTOM_TARBALL=y
-BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="$(call github,smaeul,u-boot,62392d3b8a624a80646c1876533336f90140088d)/uboot-62392d3b8a624a80646c1876533336f90140088d.tar.gz"
+BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="$(call github,smaeul,u-boot,d1-2022-05-26)/uboot-d1-2022-05-26.tar.gz"
 BR2_TARGET_UBOOT_BOARD_DEFCONFIG="nezha"
 BR2_TARGET_UBOOT_NEEDS_DTC=y
 BR2_TARGET_UBOOT_NEEDS_PYTHON3=y
Signature · 6 lines
2.30.2

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot