* [Buildroot] [PATCH] configs/rock5b_defconfig: switch to mainline linux
@ 2024-02-15 21:43 Kilian Zinnecker via buildroot
2024-02-15 23:25 ` Giulio Benetti
0 siblings, 1 reply; 4+ messages in thread
From: Kilian Zinnecker via buildroot @ 2024-02-15 21:43 UTC (permalink / raw)
To: buildroot; +Cc: Kilian Zinnecker
This patch switches the board support of the Radxa Rock 5B from
using a custom kernel to mainline linux 6.7.4. Thereby patches,
which became redundant, are removed, as well as device tree
modifications. As kernel 6.7.4 is not buildroot's latest kernel
version (as of creation of this patch), the hash for the kernel is
added. Also the needed ethernet drivers are activated via the
kernel config fragment file.
Signed-off-by: Kilian Zinnecker <kilian.zinnecker@mail.de>
---
board/radxa/rock5b/boot.cmd | 2 +-
board/radxa/rock5b/linux.fragment | 5 +-
...st-ether_addr-prototypes-to-silence-.patch | 64 -------------------
...x-building-error-on-Werror-array-com.patch | 43 -------------
board/radxa/rock5b/patches/linux/linux.hash | 4 +-
board/radxa/rock5b/readme.txt | 50 ++-------------
board/radxa/rock5b/rock5b.dts | 12 ----
board/radxa/rock5b/rock5b.its | 2 +-
configs/rock5b_defconfig | 10 ++-
9 files changed, 14 insertions(+), 178 deletions(-)
delete mode 100644 board/radxa/rock5b/patches/linux/0001-etherdevice-Adjust-ether_addr-prototypes-to-silence-.patch
delete mode 100644 board/radxa/rock5b/patches/linux/0002-mm-page_alloc-fix-building-error-on-Werror-array-com.patch
delete mode 100644 board/radxa/rock5b/rock5b.dts
diff --git a/board/radxa/rock5b/boot.cmd b/board/radxa/rock5b/boot.cmd
index 9a3e73e003..28dd42974c 100644
--- a/board/radxa/rock5b/boot.cmd
+++ b/board/radxa/rock5b/boot.cmd
@@ -1,3 +1,3 @@
-setenv bootargs root=/dev/mmcblk0p2 rw rootfstype=ext4 clkin_hz=(25000000) earlycon clk_ignore_unused earlyprintk console=ttyS2,1500000n8 rootwait
+setenv bootargs root=/dev/mmcblk1p2 rw rootfstype=ext4 clkin_hz=(25000000) earlycon clk_ignore_unused earlyprintk console=ttyS2,1500000n8 rootwait
fatload mmc 1:1 ${loadaddr} image.itb
bootm ${loadaddr}
diff --git a/board/radxa/rock5b/linux.fragment b/board/radxa/rock5b/linux.fragment
index 28bb373ef2..90f2f291ba 100644
--- a/board/radxa/rock5b/linux.fragment
+++ b/board/radxa/rock5b/linux.fragment
@@ -1,5 +1,2 @@
CONFIG_R8169=y
-# CONFIG_ROCKCHIP_FIQ_DEBUGGER is not set
-# Disable Rockchip specific WiFi drivers, as the kernel
-# code cannot be build with GCC 12 due to several Werrors
-# CONFIG_WL_ROCKCHIP is not set
+CONFIG_PHY_ROCKCHIP_NANENG_COMBO_PHY=y
diff --git a/board/radxa/rock5b/patches/linux/0001-etherdevice-Adjust-ether_addr-prototypes-to-silence-.patch b/board/radxa/rock5b/patches/linux/0001-etherdevice-Adjust-ether_addr-prototypes-to-silence-.patch
deleted file mode 100644
index 5632c5a627..0000000000
--- a/board/radxa/rock5b/patches/linux/0001-etherdevice-Adjust-ether_addr-prototypes-to-silence-.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-From 2618a0dae09ef37728dab89ff60418cbe25ae6bd Mon Sep 17 00:00:00 2001
-From: Kees Cook <keescook@chromium.org>
-Date: Sat, 12 Feb 2022 09:14:49 -0800
-Subject: etherdevice: Adjust ether_addr* prototypes to silence
- -Wstringop-overead
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-With GCC 12, -Wstringop-overread was warning about an implicit cast from
-char[6] to char[8]. However, the extra 2 bytes are always thrown away,
-alignment doesn't matter, and the risk of hitting the edge of unallocated
-memory has been accepted, so this prototype can just be converted to a
-regular char *. Silences:
-
-net/core/dev.c: In function ‘bpf_prog_run_generic_xdp’: net/core/dev.c:4618:21: warning: ‘ether_addr_equal_64bits’ reading 8 bytes from a region of size 6 [-Wstringop-overread]
- 4618 | orig_host = ether_addr_equal_64bits(eth->h_dest, > skb->dev->dev_addr);
- | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-net/core/dev.c:4618:21: note: referencing argument 1 of type ‘const u8[8]’ {aka ‘const unsigned char[8]’}
-net/core/dev.c:4618:21: note: referencing argument 2 of type ‘const u8[8]’ {aka ‘const unsigned char[8]’}
-In file included from net/core/dev.c:91: include/linux/etherdevice.h:375:20: note: in a call to function ‘ether_addr_equal_64bits’
- 375 | static inline bool ether_addr_equal_64bits(const u8 addr1[6+2],
- | ^~~~~~~~~~~~~~~~~~~~~~~
-
-Reported-by: Marc Kleine-Budde <mkl@pengutronix.de>
-Tested-by: Marc Kleine-Budde <mkl@pengutronix.de>
-Link: https://lore.kernel.org/netdev/20220212090811.uuzk6d76agw2vv73@pengutronix.de
-Cc: Jakub Kicinski <kuba@kernel.org>
-Cc: "David S. Miller" <davem@davemloft.net>
-Cc: netdev@vger.kernel.org
-Signed-off-by: Kees Cook <keescook@chromium.org>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-Upstream: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2618a0dae09ef37728dab89ff60418cbe25ae6bd
-Signed-off-by: Kilian Zinnecker <kilian.zinnecker@mail.de>
----
- include/linux/etherdevice.h | 5 ++---
- 1 file changed, 2 insertions(+), 3 deletions(-)
-
-diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
-index 2ad71cc90b37d..92b10e67d5f87 100644
---- a/include/linux/etherdevice.h
-+++ b/include/linux/etherdevice.h
-@@ -134,7 +134,7 @@ static inline bool is_multicast_ether_addr(const u8 *addr)
- #endif
- }
-
--static inline bool is_multicast_ether_addr_64bits(const u8 addr[6+2])
-+static inline bool is_multicast_ether_addr_64bits(const u8 *addr)
- {
- #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64
- #ifdef __BIG_ENDIAN
-@@ -372,8 +372,7 @@ static inline bool ether_addr_equal(const u8 *addr1, const u8 *addr2)
- * Please note that alignment of addr1 & addr2 are only guaranteed to be 16 bits.
- */
-
--static inline bool ether_addr_equal_64bits(const u8 addr1[6+2],
-- const u8 addr2[6+2])
-+static inline bool ether_addr_equal_64bits(const u8 *addr1, const u8 *addr2)
- {
- #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64
- u64 fold = (*(const u64 *)addr1) ^ (*(const u64 *)addr2);
---
-cgit
-
diff --git a/board/radxa/rock5b/patches/linux/0002-mm-page_alloc-fix-building-error-on-Werror-array-com.patch b/board/radxa/rock5b/patches/linux/0002-mm-page_alloc-fix-building-error-on-Werror-array-com.patch
deleted file mode 100644
index 10de6c72d3..0000000000
--- a/board/radxa/rock5b/patches/linux/0002-mm-page_alloc-fix-building-error-on-Werror-array-com.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From ca831f29f8f25c97182e726429b38c0802200c8f Mon Sep 17 00:00:00 2001
-From: Xiongwei Song <sxwjean@gmail.com>
-Date: Fri, 14 Jan 2022 14:07:24 -0800
-Subject: mm: page_alloc: fix building error on -Werror=array-compare
-
-Arthur Marsh reported we would hit the error below when building kernel
-with gcc-12:
-
- CC mm/page_alloc.o
- mm/page_alloc.c: In function `mem_init_print_info':
- mm/page_alloc.c:8173:27: error: comparison between two arrays [-Werror=array-compare]
- 8173 | if (start <= pos && pos < end && size > adj) \
- |
-
-In C++20, the comparision between arrays should be warned.
-
-Link: https://lkml.kernel.org/r/20211125130928.32465-1-sxwjean@me.com
-Signed-off-by: Xiongwei Song <sxwjean@gmail.com>
-Reported-by: Arthur Marsh <arthur.marsh@internode.on.net>
-Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-Upstream: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ca831f29f8f25c97182e726429b38c0802200c8f
-Signed-off-by: Kilian Zinnecker <kilian.zinnecker@mail.de>
----
- mm/page_alloc.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/mm/page_alloc.c b/mm/page_alloc.c
-index 806f317c2e7e2..c4ef450ac4428 100644
---- a/mm/page_alloc.c
-+++ b/mm/page_alloc.c
-@@ -8228,7 +8228,7 @@ void __init mem_init_print_info(void)
- */
- #define adj_init_size(start, end, size, pos, adj) \
- do { \
-- if (start <= pos && pos < end && size > adj) \
-+ if (&start[0] <= &pos[0] && &pos[0] < &end[0] && size > adj) \
- size -= adj; \
- } while (0)
-
---
-cgit
-
diff --git a/board/radxa/rock5b/patches/linux/linux.hash b/board/radxa/rock5b/patches/linux/linux.hash
index 95ad749554..fadbe578ad 100644
--- a/board/radxa/rock5b/patches/linux/linux.hash
+++ b/board/radxa/rock5b/patches/linux/linux.hash
@@ -1,2 +1,2 @@
-# Locally calculated
-sha256 a5eca7b8f929a1918125e2e4fbd7ab4ea5b3910b5ae4547e81c794b47373ffb5 linux-52f51a2b5ba178f331af62260d2da86d7472c14b-br1.tar.gz
+# From https://cdn.kernel.org/pub/linux/kernel/v6.x/sha256sums.asc
+sha256 c08ae62f4052eb79d1c167e6e27c3e7513553d4cc687d3385fb2da1f3027e6d5 linux-6.7.4.tar.gz
diff --git a/board/radxa/rock5b/readme.txt b/board/radxa/rock5b/readme.txt
index b3eb06851a..7c1dd6bd49 100644
--- a/board/radxa/rock5b/readme.txt
+++ b/board/radxa/rock5b/readme.txt
@@ -12,22 +12,21 @@ Files created in output directory
output/images
.
-├── Image
-├── Image.gz
├── boot.scr
├── boot.vfat
+├── Image
+├── Image.gz
├── image.itb
-├── rk3588-rock-5b.dtb
├── rk3588_bl31_v1.40.elf
├── rk3588_ddr_lp4_2112MHz_lp5_2736MHz_v1.12.bin
-├── rock5b.dts
+├── rk3588-rock-5b.dtb
├── rock5b.its
├── rootfs.ext2
├── rootfs.ext4
├── rootfs.tar
├── sdcard.img
-├── u-boot-rockchip.bin
-└── u-boot.bin
+├── u-boot.bin
+└── u-boot-rockchip.bin
Creating bootable SD card:
==========================
@@ -61,42 +60,3 @@ Enter 'root' as login user, and the prompt is ready.
wiki link:
----------
https://forum.radxa.com/c/rock5
-
-Issues:
-=======
-
-WiFi
-----
-The custom Radxa kernel provides custom code to support WiFi. However,
-that code does not compile with GCC 12, which is the current default
-version in buildroot. Hence, the WiFi kernel drivers are disabled, until
-the issues get fixed (if ever). If they are desperately needed, one may
-apply the following workaround, as long as buildroot still supports GCC
-version 11:
-
-1. Set GCC version 11, by adding the following line to
-configs/rock5b_defconfig:
-
-BR2_GCC_VERSION_11_X=y
-
-2. Re-enable custom WiFi drivers by removing the following line from
-board/radxa/rock5b/linux.fragment:
-
-# CONFIG_WL_ROCKCHIP is not set
-
-Rockchip FIQ Debugger
----------------------
-The custom kernel used for this board features an FIQ debugger, which
-can be activated by typing "fiq" on the serial interface. As this can be
-annoying if a user wants to type these charakters and it is not needed
-for most users, this board support disables the FIQ debugger by default.
-To re-enable the FIQ debugger follow the steps:
-
-1. In board/radxa/rock5b/rock5b.dts set the status property of the
-fiq_debugger node to "okay" and set the status property of the uart2
-node to "disabled"
-
-2. Re-enable the fiq debugger module by removing the following line
-from board/radxa/rock5b/linux.fragment:
-
-# CONFIG_ROCKCHIP_FIQ_DEBUGGER is not set
diff --git a/board/radxa/rock5b/rock5b.dts b/board/radxa/rock5b/rock5b.dts
deleted file mode 100644
index 71a4e42b5e..0000000000
--- a/board/radxa/rock5b/rock5b.dts
+++ /dev/null
@@ -1,12 +0,0 @@
-/dts-v1/;
-
-#include "rockchip/rk3588-rock-5b.dts"
-
-&fiq_debugger {
- status = "disabled";
-};
-
-&uart2 {
- pinctrl-0 = <&uart2m0_xfer>;
- status = "okay";
-};
diff --git a/board/radxa/rock5b/rock5b.its b/board/radxa/rock5b/rock5b.its
index 9ce235d041..d73659a56e 100644
--- a/board/radxa/rock5b/rock5b.its
+++ b/board/radxa/rock5b/rock5b.its
@@ -20,7 +20,7 @@
};
fdt {
description = "Device Tree";
- data = /incbin/("rock5b.dtb");
+ data = /incbin/("rk3588-rock-5b.dtb");
type = "flat_dt";
arch = "arm64";
compression = "none";
diff --git a/configs/rock5b_defconfig b/configs/rock5b_defconfig
index 7175aa66bf..7de1cfae88 100644
--- a/configs/rock5b_defconfig
+++ b/configs/rock5b_defconfig
@@ -9,13 +9,11 @@ BR2_GLOBAL_PATCH_DIR="board/radxa/rock5b/patches"
BR2_DOWNLOAD_FORCE_CHECK_HASHES=y
BR2_SYSTEM_DHCP="eth0"
BR2_LINUX_KERNEL=y
-BR2_LINUX_KERNEL_CUSTOM_GIT=y
-BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/radxa/kernel.git"
-BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="52f51a2b5ba178f331af62260d2da86d7472c14b"
-BR2_LINUX_KERNEL_DEFCONFIG="rockchip_linux"
+BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
+BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.7.4.tar.gz"
+BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
BR2_LINUX_KERNEL_DTS_SUPPORT=y
-# BR2_LINUX_KERNEL_INTREE_DTS_NAME is not set
-BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="board/radxa/rock5b/rock5b.dts"
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="rockchip/rk3588-rock-5b"
BR2_LINUX_KERNEL_DTB_OVERLAY_SUPPORT=y
BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/radxa/rock5b/linux.fragment"
BR2_TARGET_ROOTFS_EXT2=y
--
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Buildroot] [PATCH] configs/rock5b_defconfig: switch to mainline linux
2024-02-15 21:43 [Buildroot] [PATCH] configs/rock5b_defconfig: switch to mainline linux Kilian Zinnecker via buildroot
@ 2024-02-15 23:25 ` Giulio Benetti
2024-02-16 22:30 ` Kilian Zinnecker via buildroot
0 siblings, 1 reply; 4+ messages in thread
From: Giulio Benetti @ 2024-02-15 23:25 UTC (permalink / raw)
To: Kilian Zinnecker; +Cc: buildroot
Hi Kilian,
> Il giorno 15 feb 2024, alle ore 22:44, Kilian Zinnecker via buildroot <buildroot@buildroot.org> ha scritto:
>
> This patch switches the board support of the Radxa Rock 5B from
> using a custom kernel to mainline linux 6.7.4.
Very well!
> Thereby patches,
> which became redundant, are removed, as well as device tree
> modifications. As kernel 6.7.4 is not buildroot's latest kernel
> version (as of creation of this patch), the hash for the kernel is
> added.
There’s no need to add hash for specific mainline Linux version, you can drop that. Did it happen Buildroot to ask for it during building?
> Also the needed ethernet drivers are activated via the
> kernel config fragment file.
>
> Signed-off-by: Kilian Zinnecker <kilian.zinnecker@mail.de>
> ---
> board/radxa/rock5b/boot.cmd | 2 +-
> board/radxa/rock5b/linux.fragment | 5 +-
> ...st-ether_addr-prototypes-to-silence-.patch | 64 -------------------
> ...x-building-error-on-Werror-array-com.patch | 43 -------------
> board/radxa/rock5b/patches/linux/linux.hash | 4 +-
> board/radxa/rock5b/readme.txt | 50 ++-------------
> board/radxa/rock5b/rock5b.dts | 12 ----
> board/radxa/rock5b/rock5b.its | 2 +-
> configs/rock5b_defconfig | 10 ++-
> 9 files changed, 14 insertions(+), 178 deletions(-)
> delete mode 100644 board/radxa/rock5b/patches/linux/0001-etherdevice-Adjust-ether_addr-prototypes-to-silence-.patch
> delete mode 100644 board/radxa/rock5b/patches/linux/0002-mm-page_alloc-fix-building-error-on-Werror-array-com.patch
> delete mode 100644 board/radxa/rock5b/rock5b.dts
>
> diff --git a/board/radxa/rock5b/boot.cmd b/board/radxa/rock5b/boot.cmd
> index 9a3e73e003..28dd42974c 100644
> --- a/board/radxa/rock5b/boot.cmd
> +++ b/board/radxa/rock5b/boot.cmd
> @@ -1,3 +1,3 @@
> -setenv bootargs root=/dev/mmcblk0p2 rw rootfstype=ext4 clkin_hz=(25000000) earlycon clk_ignore_unused earlyprintk console=ttyS2,1500000n8 rootwait
> +setenv bootargs root=/dev/mmcblk1p2 rw rootfstype=ext4 clkin_hz=(25000000) earlycon clk_ignore_unused earlyprintk console=ttyS2,1500000n8 rootwait
> fatload mmc 1:1 ${loadaddr} image.itb
> bootm ${loadaddr}
It would be great if you switch to extlinux that is easier for debugging and here you only override bootargs so you can add environment uboot variables file.
> diff --git a/board/radxa/rock5b/linux.fragment b/board/radxa/rock5b/linux.fragment
> index 28bb373ef2..90f2f291ba 100644
> --- a/board/radxa/rock5b/linux.fragment
> +++ b/board/radxa/rock5b/linux.fragment
> @@ -1,5 +1,2 @@
> CONFIG_R8169=y
> -# CONFIG_ROCKCHIP_FIQ_DEBUGGER is not set
> -# Disable Rockchip specific WiFi drivers, as the kernel
> -# code cannot be build with GCC 12 due to several Werrors
> -# CONFIG_WL_ROCKCHIP is not set
> +CONFIG_PHY_ROCKCHIP_NANENG_COMBO_PHY=y
> diff --git a/board/radxa/rock5b/patches/linux/0001-etherdevice-Adjust-ether_addr-prototypes-to-silence-.patch b/board/radxa/rock5b/patches/linux/0001-etherdevice-Adjust-ether_addr-prototypes-to-silence-.patch
> deleted file mode 100644
> index 5632c5a627..0000000000
> --- a/board/radxa/rock5b/patches/linux/0001-etherdevice-Adjust-ether_addr-prototypes-to-silence-.patch
> +++ /dev/null
> @@ -1,64 +0,0 @@
> -From 2618a0dae09ef37728dab89ff60418cbe25ae6bd Mon Sep 17 00:00:00 2001
> -From: Kees Cook <keescook@chromium.org>
> -Date: Sat, 12 Feb 2022 09:14:49 -0800
> -Subject: etherdevice: Adjust ether_addr* prototypes to silence
> - -Wstringop-overead
> -MIME-Version: 1.0
> -Content-Type: text/plain; charset=UTF-8
> -Content-Transfer-Encoding: 8bit
> -
> -With GCC 12, -Wstringop-overread was warning about an implicit cast from
> -char[6] to char[8]. However, the extra 2 bytes are always thrown away,
> -alignment doesn't matter, and the risk of hitting the edge of unallocated
> -memory has been accepted, so this prototype can just be converted to a
> -regular char *. Silences:
> -
> -net/core/dev.c: In function ‘bpf_prog_run_generic_xdp’: net/core/dev.c:4618:21: warning: ‘ether_addr_equal_64bits’ reading 8 bytes from a region of size 6 [-Wstringop-overread]
> - 4618 | orig_host = ether_addr_equal_64bits(eth->h_dest, > skb->dev->dev_addr);
> - | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> -net/core/dev.c:4618:21: note: referencing argument 1 of type ‘const u8[8]’ {aka ‘const unsigned char[8]’}
> -net/core/dev.c:4618:21: note: referencing argument 2 of type ‘const u8[8]’ {aka ‘const unsigned char[8]’}
> -In file included from net/core/dev.c:91: include/linux/etherdevice.h:375:20: note: in a call to function ‘ether_addr_equal_64bits’
> - 375 | static inline bool ether_addr_equal_64bits(const u8 addr1[6+2],
> - | ^~~~~~~~~~~~~~~~~~~~~~~
> -
> -Reported-by: Marc Kleine-Budde <mkl@pengutronix.de>
> -Tested-by: Marc Kleine-Budde <mkl@pengutronix.de>
> -Link: https://lore.kernel.org/netdev/20220212090811.uuzk6d76agw2vv73@pengutronix.de
> -Cc: Jakub Kicinski <kuba@kernel.org>
> -Cc: "David S. Miller" <davem@davemloft.net>
> -Cc: netdev@vger.kernel.org
> -Signed-off-by: Kees Cook <keescook@chromium.org>
> -Signed-off-by: David S. Miller <davem@davemloft.net>
> -Upstream: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2618a0dae09ef37728dab89ff60418cbe25ae6bd
> -Signed-off-by: Kilian Zinnecker <kilian.zinnecker@mail.de>
> ----
> - include/linux/etherdevice.h | 5 ++---
> - 1 file changed, 2 insertions(+), 3 deletions(-)
> -
> -diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
> -index 2ad71cc90b37d..92b10e67d5f87 100644
> ---- a/include/linux/etherdevice.h
> -+++ b/include/linux/etherdevice.h
> -@@ -134,7 +134,7 @@ static inline bool is_multicast_ether_addr(const u8 *addr)
> - #endif
> - }
> -
> --static inline bool is_multicast_ether_addr_64bits(const u8 addr[6+2])
> -+static inline bool is_multicast_ether_addr_64bits(const u8 *addr)
> - {
> - #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64
> - #ifdef __BIG_ENDIAN
> -@@ -372,8 +372,7 @@ static inline bool ether_addr_equal(const u8 *addr1, const u8 *addr2)
> - * Please note that alignment of addr1 & addr2 are only guaranteed to be 16 bits.
> - */
> -
> --static inline bool ether_addr_equal_64bits(const u8 addr1[6+2],
> -- const u8 addr2[6+2])
> -+static inline bool ether_addr_equal_64bits(const u8 *addr1, const u8 *addr2)
> - {
> - #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64
> - u64 fold = (*(const u64 *)addr1) ^ (*(const u64 *)addr2);
> ---
> -cgit
> -
> diff --git a/board/radxa/rock5b/patches/linux/0002-mm-page_alloc-fix-building-error-on-Werror-array-com.patch b/board/radxa/rock5b/patches/linux/0002-mm-page_alloc-fix-building-error-on-Werror-array-com.patch
> deleted file mode 100644
> index 10de6c72d3..0000000000
> --- a/board/radxa/rock5b/patches/linux/0002-mm-page_alloc-fix-building-error-on-Werror-array-com.patch
> +++ /dev/null
> @@ -1,43 +0,0 @@
> -From ca831f29f8f25c97182e726429b38c0802200c8f Mon Sep 17 00:00:00 2001
> -From: Xiongwei Song <sxwjean@gmail.com>
> -Date: Fri, 14 Jan 2022 14:07:24 -0800
> -Subject: mm: page_alloc: fix building error on -Werror=array-compare
> -
> -Arthur Marsh reported we would hit the error below when building kernel
> -with gcc-12:
> -
> - CC mm/page_alloc.o
> - mm/page_alloc.c: In function `mem_init_print_info':
> - mm/page_alloc.c:8173:27: error: comparison between two arrays [-Werror=array-compare]
> - 8173 | if (start <= pos && pos < end && size > adj) \
> - |
> -
> -In C++20, the comparision between arrays should be warned.
> -
> -Link: https://lkml.kernel.org/r/20211125130928.32465-1-sxwjean@me.com
> -Signed-off-by: Xiongwei Song <sxwjean@gmail.com>
> -Reported-by: Arthur Marsh <arthur.marsh@internode.on.net>
> -Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> -Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
> -Upstream: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ca831f29f8f25c97182e726429b38c0802200c8f
> -Signed-off-by: Kilian Zinnecker <kilian.zinnecker@mail.de>
> ----
> - mm/page_alloc.c | 2 +-
> - 1 file changed, 1 insertion(+), 1 deletion(-)
> -
> -diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> -index 806f317c2e7e2..c4ef450ac4428 100644
> ---- a/mm/page_alloc.c
> -+++ b/mm/page_alloc.c
> -@@ -8228,7 +8228,7 @@ void __init mem_init_print_info(void)
> - */
> - #define adj_init_size(start, end, size, pos, adj) \
> - do { \
> -- if (start <= pos && pos < end && size > adj) \
> -+ if (&start[0] <= &pos[0] && &pos[0] < &end[0] && size > adj) \
> - size -= adj; \
> - } while (0)
> -
> ---
> -cgit
> -
> diff --git a/board/radxa/rock5b/patches/linux/linux.hash b/board/radxa/rock5b/patches/linux/linux.hash
> index 95ad749554..fadbe578ad 100644
> --- a/board/radxa/rock5b/patches/linux/linux.hash
> +++ b/board/radxa/rock5b/patches/linux/linux.hash
> @@ -1,2 +1,2 @@
> -# Locally calculated
> -sha256 a5eca7b8f929a1918125e2e4fbd7ab4ea5b3910b5ae4547e81c794b47373ffb5 linux-52f51a2b5ba178f331af62260d2da86d7472c14b-br1.tar.gz
> +# From https://cdn.kernel.org/pub/linux/kernel/v6.x/sha256sums.asc
> +sha256 c08ae62f4052eb79d1c167e6e27c3e7513553d4cc687d3385fb2da1f3027e6d5 linux-6.7.4.tar.gz
So you can drop this and patch folder at this point
> diff --git a/board/radxa/rock5b/readme.txt b/board/radxa/rock5b/readme.txt
> index b3eb06851a..7c1dd6bd49 100644
> --- a/board/radxa/rock5b/readme.txt
> +++ b/board/radxa/rock5b/readme.txt
> @@ -12,22 +12,21 @@ Files created in output directory
>
> output/images
> .
> -├── Image
> -├── Image.gz
> ├── boot.scr
> ├── boot.vfat
> +├── Image
> +├── Image.gz
> ├── image.itb
> -├── rk3588-rock-5b.dtb
> ├── rk3588_bl31_v1.40.elf
> ├── rk3588_ddr_lp4_2112MHz_lp5_2736MHz_v1.12.bin
> -├── rock5b.dts
> +├── rk3588-rock-5b.dtb
> ├── rock5b.its
> ├── rootfs.ext2
> ├── rootfs.ext4
> ├── rootfs.tar
> ├── sdcard.img
> -├── u-boot-rockchip.bin
> -└── u-boot.bin
> +├── u-boot.bin
> +└── u-boot-rockchip.bin
>
> Creating bootable SD card:
> ==========================
> @@ -61,42 +60,3 @@ Enter 'root' as login user, and the prompt is ready.
> wiki link:
> ----------
> https://forum.radxa.com/c/rock5
> -
> -Issues:
> -=======
> -
> -WiFi
> -----
> -The custom Radxa kernel provides custom code to support WiFi. However,
> -that code does not compile with GCC 12, which is the current default
> -version in buildroot. Hence, the WiFi kernel drivers are disabled, until
> -the issues get fixed (if ever). If they are desperately needed, one may
> -apply the following workaround, as long as buildroot still supports GCC
> -version 11:
> -
> -1. Set GCC version 11, by adding the following line to
> -configs/rock5b_defconfig:
> -
> -BR2_GCC_VERSION_11_X=y
> -
> -2. Re-enable custom WiFi drivers by removing the following line from
> -board/radxa/rock5b/linux.fragment:
> -
> -# CONFIG_WL_ROCKCHIP is not set
> -
> -Rockchip FIQ Debugger
> ----------------------
> -The custom kernel used for this board features an FIQ debugger, which
> -can be activated by typing "fiq" on the serial interface. As this can be
> -annoying if a user wants to type these charakters and it is not needed
> -for most users, this board support disables the FIQ debugger by default.
> -To re-enable the FIQ debugger follow the steps:
> -
> -1. In board/radxa/rock5b/rock5b.dts set the status property of the
> -fiq_debugger node to "okay" and set the status property of the uart2
> -node to "disabled"
> -
> -2. Re-enable the fiq debugger module by removing the following line
> -from board/radxa/rock5b/linux.fragment:
> -
> -# CONFIG_ROCKCHIP_FIQ_DEBUGGER is not set
> diff --git a/board/radxa/rock5b/rock5b.dts b/board/radxa/rock5b/rock5b.dts
> deleted file mode 100644
> index 71a4e42b5e..0000000000
> --- a/board/radxa/rock5b/rock5b.dts
> +++ /dev/null
> @@ -1,12 +0,0 @@
> -/dts-v1/;
> -
> -#include "rockchip/rk3588-rock-5b.dts"
> -
> -&fiq_debugger {
> - status = "disabled";
> -};
> -
> -&uart2 {
> - pinctrl-0 = <&uart2m0_xfer>;
> - status = "okay";
> -};
> diff --git a/board/radxa/rock5b/rock5b.its b/board/radxa/rock5b/rock5b.its
> index 9ce235d041..d73659a56e 100644
> --- a/board/radxa/rock5b/rock5b.its
> +++ b/board/radxa/rock5b/rock5b.its
> @@ -20,7 +20,7 @@
> };
> fdt {
> description = "Device Tree";
> - data = /incbin/("rock5b.dtb");
> + data = /incbin/("rk3588-rock-5b.dtb");
> type = "flat_dt";
> arch = "arm64";
> compression = "none";
> diff --git a/configs/rock5b_defconfig b/configs/rock5b_defconfig
> index 7175aa66bf..7de1cfae88 100644
> --- a/configs/rock5b_defconfig
> +++ b/configs/rock5b_defconfig
> @@ -9,13 +9,11 @@ BR2_GLOBAL_PATCH_DIR="board/radxa/rock5b/patches"
> BR2_DOWNLOAD_FORCE_CHECK_HASHES=y
> BR2_SYSTEM_DHCP="eth0"
> BR2_LINUX_KERNEL=y
> -BR2_LINUX_KERNEL_CUSTOM_GIT=y
> -BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/radxa/kernel.git"
> -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="52f51a2b5ba178f331af62260d2da86d7472c14b"
> -BR2_LINUX_KERNEL_DEFCONFIG="rockchip_linux"
> +BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
> +BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.7.4.tar.gz"
> +BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
No, please use BR2_LINUX_CUSTOM_VERSION here, not tarball, that’s why it asks for hash.
And above please specify the header version for Linux 6_7
Take a look to the other defconfigs with Linux custom version and mimic them, you will see everything is easier.
Also remember to drop patches folder variable.
I’m on mobile so I’m not that precise, but I think you should manage it.
Kind regards
Giulio
> BR2_LINUX_KERNEL_DTS_SUPPORT=y
> -# BR2_LINUX_KERNEL_INTREE_DTS_NAME is not set
> -BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="board/radxa/rock5b/rock5b.dts"
> +BR2_LINUX_KERNEL_INTREE_DTS_NAME="rockchip/rk3588-rock-5b"
> BR2_LINUX_KERNEL_DTB_OVERLAY_SUPPORT=y
> BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/radxa/rock5b/linux.fragment"
> BR2_TARGET_ROOTFS_EXT2=y
> --
> 2.34.1
>
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Buildroot] [PATCH] configs/rock5b_defconfig: switch to mainline linux
2024-02-15 23:25 ` Giulio Benetti
@ 2024-02-16 22:30 ` Kilian Zinnecker via buildroot
2024-02-16 23:09 ` Giulio Benetti
0 siblings, 1 reply; 4+ messages in thread
From: Kilian Zinnecker via buildroot @ 2024-02-16 22:30 UTC (permalink / raw)
To: Giulio Benetti; +Cc: buildroot
Hello Giulio,
thanks for reviewing! I made changes according to your comments and sent a v2
of the patch.
[--SNIP--]
> It would be great if you switch to extlinux that is easier for debugging and
> here you only override bootargs so you can add environment uboot variables
> file.
Switching to extlinux played out very nicely: A lot of files became redundant
and this decluttered the board support. Thanks!
I have a question though: Is it possible to specify in extlinux.conf, that
uboot shall fetch the kernel image and device tree via tftp? How would an
example of such an extlinux.conf look like?
Best regards,
Kilian
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Buildroot] [PATCH] configs/rock5b_defconfig: switch to mainline linux
2024-02-16 22:30 ` Kilian Zinnecker via buildroot
@ 2024-02-16 23:09 ` Giulio Benetti
0 siblings, 0 replies; 4+ messages in thread
From: Giulio Benetti @ 2024-02-16 23:09 UTC (permalink / raw)
To: Kilian Zinnecker; +Cc: buildroot
[-- Attachment #1.1: Type: text/plain, Size: 1885 bytes --]
Hi Kilian,
> Il giorno 16 feb 2024, alle ore 23:30, Kilian Zinnecker <kilian.zinnecker@mail.de> ha scritto:
>
> Hello Giulio,
>
> thanks for reviewing! I made changes according to your comments and sent a v2
> of the patch.
>
> [--SNIP--]
>
>> It would be great if you switch to extlinux that is easier for debugging and
>> here you only override bootargs so you can add environment uboot variables
>> file.
>
> Switching to extlinux played out very nicely: A lot of files became redundant
> and this decluttered the board support.
Exactly :-)
> Thanks!
No problem
>
> I have a question though: Is it possible to specify in extlinux.conf, that
> uboot shall fetch the kernel image and device tree via tftp? How would an
> example of such an extlinux.conf look like?
Here [0] they explain pretty well the difference between extlinux and boot.cmd and they also point that they can be used together, of course depending on the uboot environment variables.
Another chance is to specify:
BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SOURCE=“uEnv.txt”
And place the resulting uEnv.bin into genimage.cfg on a known address uboot will pick environment variables from.
This is another way to get what you were trying to do before using uEnv.txt, but you need to find or specify the following 2 uboot options:
CONFIG_ENV_SIZE=0x2000
CONFIG_ENV_OFFSET=0xC0000
in a uboot.fragment
This ^^^ is an example and so in genimage.cfg you add something like:
partition uboot-env {
image = "uboot-env.bin"
offset = 768K
size = 8K
}
That way in the resulting image at 0xC0000(768K) uboot will find the environment variables including the commands to run if you specify bootcmd.
[0]: https://developer.toradex.com/linux-bsp/os-development/boot/distro-boot/#boot-sequence
Best regards
Giulio
>
> Best regards,
> Kilian
>
>
[-- Attachment #1.2: Type: text/html, Size: 12805 bytes --]
[-- Attachment #2: Type: text/plain, Size: 150 bytes --]
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-02-16 23:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-15 21:43 [Buildroot] [PATCH] configs/rock5b_defconfig: switch to mainline linux Kilian Zinnecker via buildroot
2024-02-15 23:25 ` Giulio Benetti
2024-02-16 22:30 ` Kilian Zinnecker via buildroot
2024-02-16 23:09 ` Giulio Benetti
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox