From 5b1c9576b9d15222c71951638f476226d82cd083 Mon Sep 17 00:00:00 2001 From: Michael Opdenacker Date: Thu, 3 Sep 2026 09:57:27 +0200 Subject: [PATCH] orangepi-rv2.conf: switch to mainline Linux, U-Boot and OpenSBI This replaces the former "orangepi-rv2-mainline" machine, now that mainline Linux and U-Boot support is usable enough for this board. Vendor recipes for SpaceMIT K1 are still kept for the "orangepi-r2s" machine. Signed-off-by: Michael Opdenacker --- DEPRECATED.md | 1 - README.md | 3 +- .../meta-riscv-oe-nodistro-master.conf.json | 3 +- .../meta-riscv-poky-master.conf.json | 3 +- classes/warn-deprecated-machines.bbclass | 1 - conf/machine/orangepi-rv2-mainline.conf | 11 ---- conf/machine/orangepi-rv2.conf | 12 ++-- ...angepi-rv2-mainline.md => orangepi-rv2.md} | 10 ++-- files/wic/orangepi-rv2.wks | 7 --- kas/orangepi-rv2-mainline.yml | 6 -- .../orangepi-rv2/c23-compatibility.patch | 56 ------------------- recipes-bsp/opensbi/opensbi_%.bbappend | 8 --- recipes-bsp/u-boot/u-boot-orangepi.bb | 14 +---- .../u-boot-orangepi/orangepi-rv2/boot.cmd | 10 ---- recipes-kernel/linux/linux-orangepi.bb | 1 - 15 files changed, 14 insertions(+), 132 deletions(-) delete mode 100644 conf/machine/orangepi-rv2-mainline.conf rename docs/{orangepi-rv2-mainline.md => orangepi-rv2.md} (81%) delete mode 100644 files/wic/orangepi-rv2.wks delete mode 100644 kas/orangepi-rv2-mainline.yml delete mode 100644 recipes-bsp/opensbi/opensbi/orangepi-rv2/c23-compatibility.patch delete mode 100644 recipes-bsp/u-boot/u-boot-orangepi/orangepi-rv2/boot.cmd diff --git a/DEPRECATED.md b/DEPRECATED.md index cc1451e1..2d9fdcb9 100644 --- a/DEPRECATED.md +++ b/DEPRECATED.md @@ -8,7 +8,6 @@ of the listed releases. Note: The following are deprecated for 6.2, but the layer still supports mainline-based BSPs with similar names. -- orangepi-rv2 - eswin-ebc77 ## Yocto 6.1 diff --git a/README.md b/README.md index f93c6339..9d39a1ae 100644 --- a/README.md +++ b/README.md @@ -54,8 +54,7 @@ This layer depends on: | muse-pi-pro | [Muse Pi Pro](https://www.spacemit.com/community/document/info?lang=en&nodepath=hardware/eco/k1_muse_pi_pro/root_overview.md) | | | nezha-allwinner-d1 | [Nezha D1-H](https://docs.aw-ol.com/d1/en/d1_dev/) | | | orangepi-r2s | [OrangePi R2S](http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/details/Orange-Pi-R2S.html) | Vendor Kernel and U-Boot | -| orangepi-rv2 | [OrangePi RV2](http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/details/Orange-Pi-RV2.html) | Vendor Kernel and U-Boot | -| orangepi-rv2-mainline | [OrangePi RV2](http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/details/Orange-Pi-RV2.html) | Mainline Kernel and U-Boot (uses vendor FSBL) | +| orangepi-rv2 | [OrangePi RV2](http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/details/Orange-Pi-RV2.html) | Mainline Kernel and U-Boot (uses vendor FSBL) | | star64 | [PINE64 STAR64](https://pine64.org/devices/star64/) | 5.15 Kernel [fork](https://github.com/fishwaldo/Star64_linux) | | visionfive | StarFive VisionFive | No product page found | | visionfive2 | [StarFive VisionFive 2](https://www.starfivetech.com/en/index.php?s=hardware&c=show&id=14) | | diff --git a/bitbake-registry/meta-riscv-oe-nodistro-master.conf.json b/bitbake-registry/meta-riscv-oe-nodistro-master.conf.json index 7a86bec5..2fff4add 100644 --- a/bitbake-registry/meta-riscv-oe-nodistro-master.conf.json +++ b/bitbake-registry/meta-riscv-oe-nodistro-master.conf.json @@ -61,8 +61,7 @@ { "name": "machine/muse-pi-pro", "description": "SpacemiT Muse Pi Pro" }, { "name": "machine/nezha-allwinner-d1", "description": "Nezha D1-H" }, { "name": "machine/orangepi-r2s", "description": "OrangePi R2S" }, - { "name": "machine/orangepi-rv2", "description": "OrangePi RV2 (Vendor Kernel)" }, - { "name": "machine/orangepi-rv2-mainline", "description": "OrangePi RV2 (Mainline Kernel)" }, + { "name": "machine/orangepi-rv2", "description": "OrangePi RV2" }, { "name": "machine/star64", "description": "PINE64 Star64" }, { "name": "machine/visionfive", "description": "StarFive VisionFive" }, { "name": "machine/visionfive2", "description": "StarFive VisionFive 2" } diff --git a/bitbake-registry/meta-riscv-poky-master.conf.json b/bitbake-registry/meta-riscv-poky-master.conf.json index ad91b722..e02a637f 100644 --- a/bitbake-registry/meta-riscv-poky-master.conf.json +++ b/bitbake-registry/meta-riscv-poky-master.conf.json @@ -66,8 +66,7 @@ { "name": "machine/muse-pi-pro", "description": "SpacemiT Muse Pi Pro" }, { "name": "machine/nezha-allwinner-d1", "description": "Nezha D1-H" }, { "name": "machine/orangepi-r2s", "description": "OrangePi R2S" }, - { "name": "machine/orangepi-rv2", "description": "OrangePi RV2 (Vendor Kernel)" }, - { "name": "machine/orangepi-rv2-mainline", "description": "OrangePi RV2 (Mainline Kernel)" }, + { "name": "machine/orangepi-rv2", "description": "OrangePi RV2" }, { "name": "machine/star64", "description": "PINE64 Star64" }, { "name": "machine/visionfive", "description": "StarFive VisionFive" }, { "name": "machine/visionfive2", "description": "StarFive VisionFive 2" } diff --git a/classes/warn-deprecated-machines.bbclass b/classes/warn-deprecated-machines.bbclass index 6019b2cb..f1a67b31 100644 --- a/classes/warn-deprecated-machines.bbclass +++ b/classes/warn-deprecated-machines.bbclass @@ -3,7 +3,6 @@ python warn_deprecated_machines() { deprecated_machines = { - "orangepi-rv2": "Yocto 6.2", "eswin-ebc77": "Yocto 6.2", "beaglev-starlight-jh7100": "Yocto 6.1", "visionfive": "Yocto 6.1", diff --git a/conf/machine/orangepi-rv2-mainline.conf b/conf/machine/orangepi-rv2-mainline.conf deleted file mode 100644 index 9b302757..00000000 --- a/conf/machine/orangepi-rv2-mainline.conf +++ /dev/null @@ -1,11 +0,0 @@ -#@TYPE: Machine -#@NAME: orangepi-rv2-mainline -#@SOC: Spacemit K1 -#@DESCRIPTION: Machine configuration for OrangePi RV2 with mainline Linux - -require conf/machine/include/k1.inc - -KERNEL_DEVICETREE ?= "spacemit/k1-orangepi-rv2.dtb" - -# OrangePi RV2 not supported yet in mainline U-Boot. A similar machine works. -UBOOT_MACHINE = "bananapi-f3_defconfig" diff --git a/conf/machine/orangepi-rv2.conf b/conf/machine/orangepi-rv2.conf index 181fac91..0de04ff7 100644 --- a/conf/machine/orangepi-rv2.conf +++ b/conf/machine/orangepi-rv2.conf @@ -1,15 +1,13 @@ #@TYPE: Machine #@NAME: orangepi-rv2 -#@SOC: Ky X1 +#@SOC: Spacemit K1 #@DESCRIPTION: Machine configuration for OrangePi RV2 -require include/k1-vendor.inc +require include/k1.inc -KERNEL_DEVICETREE ?= "ky/x1_orangepi-rv2.dtb" +KERNEL_DEVICETREE ?= "spacemit/k1-orangepi-rv2.dtb" -IMAGE_BOOT_FILES += " \ - x1_orangepi-rv2.dtb" - -WKS_FILE ?= "orangepi-rv2.wks" +# OrangePi RV2 not supported yet in mainline U-Boot. A similar machine works. +UBOOT_MACHINE = "bananapi-f3_defconfig" MACHINE_EXTRA_RRECOMMENDS += "kernel-modules linux-firmware-orangepi" diff --git a/docs/orangepi-rv2-mainline.md b/docs/orangepi-rv2.md similarity index 81% rename from docs/orangepi-rv2-mainline.md rename to docs/orangepi-rv2.md index e9889ca6..aa19d1d3 100644 --- a/docs/orangepi-rv2-mainline.md +++ b/docs/orangepi-rv2.md @@ -17,7 +17,7 @@ See [the Yocto Project](https://docs.yoctoproject.org/brief-yoctoprojectqs/index Set these variables in a configuration file: -* `MACHINE = "orangepi-rv2-mainline"` +* `MACHINE = "orangepi-rv2"` * `DISTRO = "poky-altcfg"` * `EXTRA_IMAGE_FEATURES = "allow-empty-password empty-root-password allow-root-login post-install-logging"` @@ -31,7 +31,7 @@ How to Build - Using Kas ======================== ``` -$ kas build /path/to/meta-riscv/kas/orangepi-rv2-mainline.yml +$ kas build /path/to/meta-riscv/kas/orangepi-rv2.yml ``` The `kas` tool can be installed as a package on your distribution or @@ -63,16 +63,16 @@ already loaded in RAM. Flashing the Image ================== -Flash `core-image-full-cmdline-orangepi-rv2-mainline.rootfs.wic.gz` onto a uSD card (assuming it's accessed through `/dev/sdx`): +Flash `core-image-full-cmdline-orangepi-rv2.rootfs.wic.gz` onto a uSD card (assuming it's accessed through `/dev/sdx`): ``` -$ sudo bmaptool copy build/tmp/deploy/images/orangepi-rv2-mainline/core-image-full-cmdline-orangepi-rv2-mainline.rootfs.wic.gz /dev/sdx +$ sudo bmaptool copy build/tmp/deploy/images/orangepi-rv2/core-image-full-cmdline-orangepi-rv2.rootfs.wic.gz /dev/sdx ``` Then, you also need to flash the `bootinfo_sd.bin` file at the very beginning of the SD card (not part of the WIC image yet): ``` -$ sudo dd if=build/tmp/deploy/images/orangepi-rv2-mainline/bootinfo_sd.bin of=/dev/sdx +$ sudo dd if=build/tmp/deploy/images/orangepi-rv2/bootinfo_sd.bin of=/dev/sdx ``` Boot the Board diff --git a/files/wic/orangepi-rv2.wks b/files/wic/orangepi-rv2.wks deleted file mode 100644 index 7ebf8f5f..00000000 --- a/files/wic/orangepi-rv2.wks +++ /dev/null @@ -1,7 +0,0 @@ -# Orange Pi RV2 SD Card Layout - -part spl --offset 256K --fixed-size 256K --fstype=none --source rawcopy --sourceparams="file=u-boot-spl.bin" -part uboot --offset 1M --fixed-size 3M --fstype=none --source rawcopy --sourceparams="file=u-boot-opensbi.itb" - -part /boot --ondisk mmcblk0 --fstype=vfat --label boot --offset 4M --size 128M --source bootimg-partition --use-uuid --active --align 4096 -part / --ondisk mmcblk0 --fstype=ext4 --label root --source rootfs --use-uuid --align 4096 \ No newline at end of file diff --git a/kas/orangepi-rv2-mainline.yml b/kas/orangepi-rv2-mainline.yml deleted file mode 100644 index 4f86b91c..00000000 --- a/kas/orangepi-rv2-mainline.yml +++ /dev/null @@ -1,6 +0,0 @@ -header: - version: 20 - includes: - - kas/base-riscv.yml - -machine: orangepi-rv2-mainline diff --git a/recipes-bsp/opensbi/opensbi/orangepi-rv2/c23-compatibility.patch b/recipes-bsp/opensbi/opensbi/orangepi-rv2/c23-compatibility.patch deleted file mode 100644 index 0ffc08e3..00000000 --- a/recipes-bsp/opensbi/opensbi/orangepi-rv2/c23-compatibility.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 2481b7fdfdc422c439241fd25fcc67cf91280f1b Mon Sep 17 00:00:00 2001 -From: Alper Ak -Date: Sun, 15 Jun 2025 20:33:33 +0300 -Subject: [PATCH] Fix compiling with C23 - -With C23 standards, 'bool' is now a built-in keyword and can't be redefined with typedef. -This patch ensures 'bool' is only typedef'd for pre-C23 standards. - -/opensbi/include/sbi/sbi_types.h:47:33: error: 'bool' cannot be defined via 'typedef' -| 47 | typedef int bool; -| | ^~~~ - -/opensbi/include/sbi/sbi_types.h:47:33: note: 'bool' is a keyword with '-std=c23' onwards - -/opensbi/include/sbi/sbi_types.h:47:1: error: useless type name in empty declaration [-Werror] -| 47 | typedef int bool; -| | ^~~~~~~ - -Upstream-Status: Backport [https://github.com/riscv-software-src/opensbi/commit/d539d64a23bbd64ba324eed595449bcc9c7be0cb] - -Signed-off-by: Alper Ak ---- - opensbi/include/sbi/sbi_types.h | 10 ++++++---- - 1 file changed, 6 insertions(+), 4 deletions(-) - -diff --git a/opensbi/include/sbi/sbi_types.h b/opensbi/include/sbi/sbi_types.h -index def88bbad2..6ad902e1ba 100644 ---- a/include/sbi/sbi_types.h -+++ b/include/sbi/sbi_types.h -@@ -44,7 +44,12 @@ typedef unsigned long long uint64_t; - #error "Unexpected __riscv_xlen" - #endif - --typedef int bool; -+#if __STDC_VERSION__ < 202000L -+typedef _Bool bool; -+#define true 1 -+#define false 0 -+#endif -+ - typedef unsigned long ulong; - typedef unsigned long uintptr_t; - typedef unsigned long size_t; -@@ -61,9 +66,6 @@ typedef uint32_t be32_t; - typedef uint64_t le64_t; - typedef uint64_t be64_t; - --#define true 1 --#define false 0 -- - #define NULL ((void *)0) - - #define __packed __attribute__((packed)) --- -2.43.0 - diff --git a/recipes-bsp/opensbi/opensbi_%.bbappend b/recipes-bsp/opensbi/opensbi_%.bbappend index e0f26d39..057e13cb 100644 --- a/recipes-bsp/opensbi/opensbi_%.bbappend +++ b/recipes-bsp/opensbi/opensbi_%.bbappend @@ -1,13 +1,11 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" -BRANCH:orangepi-rv2 = "v2022.10-ky" # Support fdt drivers for AE350 SRCREV:ae350-ax45mp = "22f38ee6c658a660083aa45c4ec6c72f66a17260" # JH7110_VF2_6.12_v6.0.0 SRCREV:jh7100 = "1725bd71080960290fdde4499a58c25c09d5c8ee" SRCREV:star64 = "c6a092cd80112529cb2e92e180767ff5341b22a3" SRCREV:dc-roma-fml13v01 = "c6a092cd80112529cb2e92e180767ff5341b22a3" -SRCREV:orangepi-rv2 = "89bff4a7e4cadfb5f130edb1ec44c39bff20a427" SRC_URI:star64 = "git://github.com/starfive-tech/opensbi;branch=JH7110_VisionFive2_devel;protocol=https" SRC_URI:append:star64 = "\ @@ -23,15 +21,9 @@ SRC_URI:append:dc-roma-fml13v01 = "\ file://0002-include-sbi-Fix-compiling-with-C23-enabled-compilers.patch \ " -SRC_URI:orangepi-rv2 = "git://github.com/orangepi-xunlong/u-boot-orangepi.git;protocol=https;branch=${BRANCH}" -SRC_URI:append:orangepi-rv2 = " file://c23-compatibility.patch" -S:orangepi-rv2 = "${UNPACKDIR}/${BP}/opensbi" - DEPENDS:append:jh7110 = " u-boot-tools-native dtc-native" -DEPENDS:append:orangepi-rv2 = " u-boot-tools-native" EXTRA_OEMAKE:append:milkv-duo = "FW_FDT_PATH=${DEPLOY_DIR_IMAGE}/u-boot.dtb" -EXTRA_OEMAKE:append:orangepi-rv2 = " PLATFORM_DEFCONFIG=k1_defconfig" # opensbi's own Makefile hardcodes CFLAGS and ignores TARGET_CFLAGS, so its # debug info embeds raw TMPDIR/HOME source paths. Skip the buildpaths QA check diff --git a/recipes-bsp/u-boot/u-boot-orangepi.bb b/recipes-bsp/u-boot/u-boot-orangepi.bb index 001ada43..f14d0b28 100644 --- a/recipes-bsp/u-boot/u-boot-orangepi.bb +++ b/recipes-bsp/u-boot/u-boot-orangepi.bb @@ -12,7 +12,6 @@ SRCREV:k1 = "89bff4a7e4cadfb5f130edb1ec44c39bff20a427" SRC_URI = "git://github.com/orangepi-xunlong/u-boot-orangepi.git;protocol=https;branch=${BRANCH}" SRC_URI:append:k1 = " file://drop-intree-opensbi-build.patch" -SRC_URI:append:orangepi-rv2 = " file://boot.cmd" SRC_URI:append:orangepi-r2s = " file://boot.cmd" SRC_URI:remove:riscv32:k1 = " ${SRC_URI_RISCV}" @@ -23,17 +22,6 @@ do_configure:prepend:k1() { -d ${UNPACKDIR}/${UBOOT_ENV}.${UBOOT_ENV_SRC_SUFFIX} ${UNPACKDIR}/${UBOOT_ENV_BINARY} } -do_deploy:append:orangepi-rv2() { - install -m 644 ${S}/bootinfo_sd.bin ${DEPLOYDIR}/ - cp ${DEPLOY_DIR_IMAGE}/fw_dynamic.bin ${B}/ - cp ${B}/arch/riscv/dts/x1_orangepi-rv2.dtb ${B}/ - # u-boot-nodtb.bin also needed for .itb but already in ${B} - cp ${S}/uboot-opensbi.its ${B}/ - cd ${B} - mkimage -f uboot-opensbi.its -r u-boot-opensbi.itb - install -m 644 u-boot-opensbi.itb ${DEPLOYDIR}/ -} - do_deploy:append:orangepi-r2s() { install -m 644 ${S}/bootinfo_sd.bin ${DEPLOYDIR}/ cp ${DEPLOY_DIR_IMAGE}/fw_dynamic.bin ${B}/ @@ -46,4 +34,4 @@ do_deploy:append:orangepi-r2s() { } do_deploy[depends] += "opensbi:do_deploy" -COMPATIBLE_MACHINE = "(orangepi-rv2|orangepi-r2s)" +COMPATIBLE_MACHINE = "(orangepi-r2s)" diff --git a/recipes-bsp/u-boot/u-boot-orangepi/orangepi-rv2/boot.cmd b/recipes-bsp/u-boot/u-boot-orangepi/orangepi-rv2/boot.cmd deleted file mode 100644 index b2f0772c..00000000 --- a/recipes-bsp/u-boot/u-boot-orangepi/orangepi-rv2/boot.cmd +++ /dev/null @@ -1,10 +0,0 @@ -fdt_file=x1_orangepi-rv2.dtb -rootdev=/dev/mmcblk0p4 - -setenv bootargs "console=ttyS0,115200 earlycon=sbi root=${rootdev} rw rootwait rootfstype=ext4 clk_ignore_unused" - -load mmc 0:3 ${kernel_addr_r} Image -load mmc 0:3 ${ramdisk_addr_r} initramfs.img -load mmc 0:3 ${fdt_addr_r} ${fdt_file} - -booti ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r} diff --git a/recipes-kernel/linux/linux-orangepi.bb b/recipes-kernel/linux/linux-orangepi.bb index 68ed1385..97b115a8 100644 --- a/recipes-kernel/linux/linux-orangepi.bb +++ b/recipes-kernel/linux/linux-orangepi.bb @@ -11,7 +11,6 @@ BRANCH:k1 = "orange-pi-6.6-ky" SRCREV:k1 = "ae9e974d3e19f460b6397bfe8f0f1417a073ce05" LINUX_VERSION:k1 = "6.6.63" -LINUX_VERSION_EXTENSION:append:orangepi-rv2 = "-orangepi-rv2" LINUX_VERSION_EXTENSION:append:orangepi-r2s = "-orangepi-r2s" PV = "${LINUX_VERSION}+git${SRCPV}"