From e7102ce72e5466abba8a3f5f9060278153453b22 Mon Sep 17 00:00:00 2001 From: Dany LE Date: Thu, 9 Apr 2026 01:14:35 +0200 Subject: [PATCH] adapt to Yocto walnascar + use mainline Linux 6.12 LTS --- conf/layer.conf | 6 +- conf/machine/orange-pi-zero2w.conf | 37 ++------ recipes-bsp/atf/atf-50i-h616_git.bb | 4 +- .../u-boot/files/0003-correct-version.patch | 7 ++ .../0004-python-bindings-with-Swig-4.4.patch | 38 +++++++++ recipes-bsp/u-boot/files/boot.cmd | 84 ++++++++----------- recipes-bsp/u-boot/u-boot-xunlong.bb | 5 +- recipes-core/base-files/base-files_%.bbappend | 7 ++ recipes-core/images/core-image-base.bbappend | 6 +- .../images/core-image-recovery.bbapend | 7 -- .../images/core-image-recovery.bbappend | 19 +++++ .../mesa/{mesa_%.bbappend => mesa.bbappend} | 0 ...ix-reset-issue-on-H6-by-using-R_WDOG.patch | 1 + .../files/0002-fix-rtl8822c-compi-error.patch | 7 ++ .../linux/files/0003-enable-mali-gpu.patch | 7 ++ .../0004-fix-unisocwcn-include-path.patch | 7 ++ .../files/0005-fix-rtl8xxx-include-path.patch | 7 ++ recipes-kernel/linux/linux-mainline_6.12.bb | 52 ++++++++++++ recipes-kernel/linux/linux-xunlong_6.1.31.bb | 35 +++++++- recipes-kernel/linux/linux.inc | 12 +-- .../uwe5622-firmware/uwe5622-firmware.bb | 2 +- wic/image.wks.in | 12 +-- 22 files changed, 251 insertions(+), 111 deletions(-) create mode 100644 recipes-bsp/u-boot/files/0004-python-bindings-with-Swig-4.4.patch delete mode 100644 recipes-core/images/core-image-recovery.bbapend create mode 100644 recipes-core/images/core-image-recovery.bbappend rename recipes-graphics/mesa/{mesa_%.bbappend => mesa.bbappend} (100%) create mode 100644 recipes-kernel/linux/linux-mainline_6.12.bb diff --git a/conf/layer.conf b/conf/layer.conf index 730525c..2a18c79 100644 --- a/conf/layer.conf +++ b/conf/layer.conf @@ -14,8 +14,10 @@ LAYERSERIES_COMPAT_meta-opi-diya = "walnascar" MACHINE ?= "orange-pi-zero2w" -PREFERRED_PROVIDER_virtual/kernel = "linux-xunlong" -PREFERRED_VERSION_linux-xunlong = "6.1.31" +#PREFERRED_PROVIDER_virtual/kernel = "linux-xunlong" +#PREFERRED_VERSION_linux-xunlong = "6.1.31" +PREFERRED_PROVIDER_virtual/kernel = "linux-mainline" +PREFERRED_VERSION_linux-mainline = "6.12" PREFERRED_PROVIDER_virtual/bootloader = "u-boot-xunlong" PREFERRED_PROVIDER_u-boot = "u-boot-xunlong" diff --git a/conf/machine/orange-pi-zero2w.conf b/conf/machine/orange-pi-zero2w.conf index 6197992..1d3d31f 100644 --- a/conf/machine/orange-pi-zero2w.conf +++ b/conf/machine/orange-pi-zero2w.conf @@ -4,42 +4,15 @@ require conf/machine/include/sun50i-h616.inc -KERNEL_DEVICETREE = "allwinner/sun50i-h616-orangepi-zero2w.dtb \ - allwinner/overlay/sun50i-h616-disable-leds.dtbo \ - allwinner/overlay/sun50i-h616-disable-uart0.dtbo \ - allwinner/overlay/sun50i-h616-gpu.dtbo \ - allwinner/overlay/sun50i-h616-ir.dtbo \ - allwinner/overlay/sun50i-h616-ph-i2c1.dtbo \ - allwinner/overlay/sun50i-h616-ph-i2c2.dtbo \ - allwinner/overlay/sun50i-h616-ph-i2c3.dtbo \ - allwinner/overlay/sun50i-h616-ph-i2c4.dtbo \ - allwinner/overlay/sun50i-h616-ph-pwm12.dtbo \ - allwinner/overlay/sun50i-h616-ph-pwm34.dtbo \ - allwinner/overlay/sun50i-h616-ph-uart2.dtbo \ - allwinner/overlay/sun50i-h616-ph-uart5.dtbo \ - allwinner/overlay/sun50i-h616-pi-i2c0.dtbo \ - allwinner/overlay/sun50i-h616-pi-i2c1.dtbo \ - allwinner/overlay/sun50i-h616-pi-i2c2.dtbo \ - allwinner/overlay/sun50i-h616-pi-pwm1.dtbo \ - allwinner/overlay/sun50i-h616-pi-pwm2.dtbo \ - allwinner/overlay/sun50i-h616-pi-pwm3.dtbo \ - allwinner/overlay/sun50i-h616-pi-pwm4.dtbo \ - allwinner/overlay/sun50i-h616-pi-uart2.dtbo \ - allwinner/overlay/sun50i-h616-pi-uart3.dtbo \ - allwinner/overlay/sun50i-h616-pi-uart4.dtbo \ - allwinner/overlay/sun50i-h616-spi0-spidev.dtbo \ - allwinner/overlay/sun50i-h616-spi1-cs0-cs1-spidev.dtbo \ - allwinner/overlay/sun50i-h616-spi1-cs0-spidev.dtbo \ - allwinner/overlay/sun50i-h616-spi1-cs1-spidev.dtbo \ - allwinner/overlay/sun50i-h616-usb0-host.dtbo \ - allwinner/overlay/sun50i-h616-zero2w-disable-led.dtbo \ -" + UBOOT_MACHINE = "orangepi_zero2w_defconfig" +KERNEL_DEVICETREE = "allwinner/sun50i-h618-orangepi-zero2w.dtb " + SPL_BINARY = "u-boot-sunxi-with-spl.bin" # as for now neither graphics nor audio is supported -MACHINE_FEATURES:remove = "alsa x11" -MACHINE_FEATURES:append = "bluetooth wifi" +MACHINE_FEATURES:remove = " x11 " +MACHINE_FEATURES:append = " pic bluetooth wifi " MACHINE_EXTRA_RRECOMMENDS = "uwe5622-firmware" \ No newline at end of file diff --git a/recipes-bsp/atf/atf-50i-h616_git.bb b/recipes-bsp/atf/atf-50i-h616_git.bb index 4ce548a..9b406b8 100644 --- a/recipes-bsp/atf/atf-50i-h616_git.bb +++ b/recipes-bsp/atf/atf-50i-h616_git.bb @@ -8,8 +8,8 @@ SRCREV = "d3e71ead6ea5bc3555ac90a446efec84ef6c6122" # v2.9 -S = "${WORKDIR}/git" -B = "${WORKDIR}/build" +S = "${UNPACKDIR}/git" +B = "${UNPACKDIR}/build" COMPATIBLE_MACHINE = "(sun50i|sun50i-h616)" diff --git a/recipes-bsp/u-boot/files/0003-correct-version.patch b/recipes-bsp/u-boot/files/0003-correct-version.patch index 4737a3b..f6835c7 100644 --- a/recipes-bsp/u-boot/files/0003-correct-version.patch +++ b/recipes-bsp/u-boot/files/0003-correct-version.patch @@ -1,3 +1,10 @@ +From: Dany LE +Date: Wed, 16 Dec 2020 20:16:14 -0800 +Subject: u-boot-xunlong correct version + +Upstream-Status: Pending + +--- diff --git a/scripts/dtc/pylibfdt/Makefile b/scripts/dtc/pylibfdt/Makefile index 493995e30..a7579f0c5 100644 --- a/scripts/dtc/pylibfdt/Makefile diff --git a/recipes-bsp/u-boot/files/0004-python-bindings-with-Swig-4.4.patch b/recipes-bsp/u-boot/files/0004-python-bindings-with-Swig-4.4.patch new file mode 100644 index 0000000..9d0333b --- /dev/null +++ b/recipes-bsp/u-boot/files/0004-python-bindings-with-Swig-4.4.patch @@ -0,0 +1,38 @@ +From: Dany LE +Date: Wed, 8 Apr 2025 20:16:14 -0800 +Subject: fix compatibility python bindings with Swig 4.4 + +Upstream-Status: Pending + +--- +diff --git a/scripts/dtc/pylibfdt/libfdt.i_shipped b/scripts/dtc/pylibfdt/libfdt.i_shipped +index 27c29ea260..3bbbfb3c9f 100644 +--- a/scripts/dtc/pylibfdt/libfdt.i_shipped ++++ b/scripts/dtc/pylibfdt/libfdt.i_shipped +@@ -1033,7 +1033,7 @@ typedef uint32_t fdt32_t; + fdt_string(fdt1, fdt32_to_cpu($1->nameoff))); + buff = PyByteArray_FromStringAndSize( + (const char *)($1 + 1), fdt32_to_cpu($1->len)); +- resultobj = SWIG_Python_AppendOutput(resultobj, buff); ++ resultobj = SWIG_AppendOutput(resultobj, buff); + } + } + +@@ -1072,7 +1072,7 @@ typedef uint32_t fdt32_t; + + %typemap(argout) int *depth { + PyObject *val = Py_BuildValue("i", *arg$argnum); +- resultobj = SWIG_Python_AppendOutput(resultobj, val); ++ resultobj = SWIG_AppendOutput(resultobj, val); + } + + %apply int *depth { int *depth }; +@@ -1088,7 +1088,7 @@ typedef uint32_t fdt32_t; + if (PyTuple_GET_SIZE(resultobj) == 0) + resultobj = val; + else +- resultobj = SWIG_Python_AppendOutput(resultobj, val); ++ resultobj = SWIG_AppendOutput(resultobj, val); + } + } + diff --git a/recipes-bsp/u-boot/files/boot.cmd b/recipes-bsp/u-boot/files/boot.cmd index 57295c4..882ed65 100644 --- a/recipes-bsp/u-boot/files/boot.cmd +++ b/recipes-bsp/u-boot/files/boot.cmd @@ -1,29 +1,23 @@ # default values setenv load_addr "0x45000000" setenv overlay_error "false" -setenv rootdev "/dev/mmcblk1p2" setenv verbosity "1" -setenv rootfstype "ext4" setenv console "both" setenv bootlogo "false" -setenv overlay_prefix "sun50i-h616" -setenv disp_mode "1920x1080p60" +setenv overlay_prefix "sun50i-a64" setenv recovery "false" -setenv recovery_image "recovery.initramfs" - -# Print boot source -itest.b *0x10028 == 0x00 && echo "U-boot loaded from SD" -itest.b *0x10028 == 0x02 && echo "U-boot loaded from eMMC or secondary SD" -itest.b *0x10028 == 0x03 && echo "U-boot loaded from SPI" +setenv recovery_image "recovery-pinephone.cpio.lz4.u-boot" +setenv kernel = "Image.gz" echo "Boot script loaded from ${devtype}" if test -e ${devtype} ${devnum} diya-config.txt; then - load ${devtype} ${devnum} ${load_addr} diya-config.txt - env import -t ${load_addr} ${filesize} + echo "Loading environment variables from ${devtype} ${devnum} diya-config.txt" + load ${devtype} ${devnum} ${load_addr} diya-config.txt + env import -t ${load_addr} ${filesize} fi -if test "${console}" = "display" || test "${console}" = "both"; then setenv consoleargs "console=ttyS0,115200 console=tty1"; fi +if test "${console}" = "display" || test "${console}" = "both"; then setenv consoleargs "console=ttyS0,115200 console=tty0"; fi if test "${console}" = "serial"; then setenv consoleargs "console=ttyS0,115200"; fi if test "${bootlogo}" = "true"; then setenv consoleargs "splash plymouth.ignore-serial-consoles ${consoleargs}" @@ -31,52 +25,42 @@ else setenv consoleargs "splash=verbose ${consoleargs}" fi -# get PARTUUID of first partition on SD/eMMC it was loaded from -# mmc 0 is always mapped to device u-boot (2016.09+) was loaded from -if test "${devtype}" = "mmc"; then part uuid mmc 0:1 partuuid; fi - -# consoleblank=0 loglevel=${verbosity} - -setenv bootargs "root=${rootdev} rootwait rootfstype=${rootfstype} ${consoleargs} ubootpart=${partuuid} usb-storage.quirks=${usbstoragequirks} ${extraargs} ${extraboardargs}" - -# if test "${docker_optimizations}" = "on"; then setenv bootargs "${bootargs} cgroup_enable=memory swapaccount=1"; fi +echo "Loading kernel FDT from ${devtype} ${devnum} ${fdtfile}" load ${devtype} ${devnum} ${fdt_addr_r} ${fdtfile} fdt addr ${fdt_addr_r} fdt resize 65536 for overlay_file in ${overlays}; do - if load ${devtype} ${devnum} ${load_addr} allwinner/overlay/${overlay_prefix}-${overlay_file}.dtbo; then - echo "Applying kernel provided DT overlay ${overlay_prefix}-${overlay_file}.dtbo" - fdt apply ${load_addr} || setenv overlay_error "true" - fi + if load ${devtype} ${devnum} ${load_addr} allwinner/overlay/${overlay_prefix}-${overlay_file}.dtbo; then + echo "Applying kernel provided DT overlay ${overlay_prefix}-${overlay_file}.dtbo" + fdt apply ${load_addr} || setenv overlay_error "true" + fi done if test "${overlay_error}" = "true"; then - echo "Error applying DT overlays, restoring original DT" - load ${devtype} ${devnum} ${fdt_addr_r} ${fdtfile} + echo "Error applying DT overlays, restoring original DT" + load ${devtype} ${devnum} ${fdt_addr_r} ${fdtfile} +fi + + +echo "Loading kernel from ${devtype} ${devnum} ${kernel_comp_addr_r} ${kernel}" +load ${devtype} ${devnum} ${kernel_addr_r} ${kernel} +setenv kernel_comp_size ${filesize} +if test -e ${devtype} ${devnum} enable-recovery-mode; then + echo "Booting Diya in recovery mode with ramdisk at ${devtype} ${devnum} ${ramdisk_addr_r} ${recovery_image}" + fatrm ${devtype} ${devnum} enable-recovery-mode + load ${devtype} ${devnum} ${ramdisk_addr_r} ${recovery_image} + setenv bootargs "root=ramfs rootwait ${consoleargs} ${extraargs} ${extraboardargs}" + booti ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r} else - if load ${devtype} ${devnum} ${load_addr} allwinner/overlay/${overlay_prefix}-fixup.scr; then - echo "Applying kernel provided DT fixup script (${overlay_prefix}-fixup.scr)" - source ${load_addr} - fi -fi - -if test "${ethernet_phy}" = "rtl8211f"; then - fdt set /soc/ethernet@5020000 allwinner,rx-delay-ps <3100> - fdt set /soc/ethernet@5020000 allwinner,tx-delay-ps <700> -fi - -if test "${ethernet_phy}" = "yt8531c"; then - fdt set /soc/ethernet@5020000 allwinner,rx-delay-ps <0> - fdt set /soc/ethernet@5020000 allwinner,tx-delay-ps <600> -fi - -load ${devtype} ${devnum} ${kernel_addr_r} Image -if test "${recovery}" = "true"; then - load ${devtype} ${devnum} ${ramdisk_addr_r} ${recovery_image} - booti ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r} -else - booti ${kernel_addr_r} - ${fdt_addr_r} + # get PARTUUID of first partition on SD/eMMC it was loaded from + # mmc 0 is always mapped to device u-boot (2016.09+) was loaded from + if test "${devtype}" = "mmc"; then part uuid mmc 0:2 partuuid; fi + setenv rootfstype "ext4" + echo "Root dev PARTUUID is ${partuuid}" + setenv bootargs "root=PARTUUID=${partuuid} rootwait rootfstype=${rootfstype} ${consoleargs} ${extraargs} ${extraboardargs}" + echo "Booting Diya: ${bootargs}" + booti ${kernel_addr_r} - ${fdt_addr_r} fi # Recompile with: diff --git a/recipes-bsp/u-boot/u-boot-xunlong.bb b/recipes-bsp/u-boot/u-boot-xunlong.bb index 248068e..f937764 100644 --- a/recipes-bsp/u-boot/u-boot-xunlong.bb +++ b/recipes-bsp/u-boot/u-boot-xunlong.bb @@ -27,6 +27,7 @@ SRC_URI = " \ git://github.com/orangepi-xunlong/u-boot-orangepi.git;protocol=https;branch=v2021.07-sunxi \ file://boot.cmd \ file://0003-correct-version.patch \ + file://0004-python-bindings-with-Swig-4.4.patch \ " PE = "1" @@ -35,7 +36,7 @@ PV = "v2021.07+git${SRCPV}" SRCREV = "6fe17fac388aad17490cf386578b7532975e567f" -S = "${WORKDIR}/git" +S = "${UNPACKDIR}/git" PACKAGE_ARCH = "${MACHINE_ARCH}" @@ -57,6 +58,6 @@ do_configure() { do_compile() { oe_runmake oe_runmake u-boot-initial-env - ${B}/tools/mkimage -C none -A arm -T script -d ${WORKDIR}/boot.cmd ${WORKDIR}/${UBOOT_ENV_BINARY} + ${B}/tools/mkimage -C none -A arm -T script -d ${UNPACKDIR}/boot.cmd ${S}/${UBOOT_ENV_BINARY} } diff --git a/recipes-core/base-files/base-files_%.bbappend b/recipes-core/base-files/base-files_%.bbappend index f278e1e..235e284 100644 --- a/recipes-core/base-files/base-files_%.bbappend +++ b/recipes-core/base-files/base-files_%.bbappend @@ -1,6 +1,13 @@ hostname = "diya" do_install:append () { + install -d ${DEPLOY_DIR_IMAGE} + cat << EOF > ${DEPLOY_DIR_IMAGE}/diya-config.txt +recovery_image=recovery-${MACHINE}.cpio.lz4.u-boot +kernel=Image.gz +console=both +bootlogo=false +EOF cat << 'EOF' >> "${D}${sysconfdir}/profile" export DISK="mmcblk1" EOF diff --git a/recipes-core/images/core-image-base.bbappend b/recipes-core/images/core-image-base.bbappend index 3ca85df..0282111 100644 --- a/recipes-core/images/core-image-base.bbappend +++ b/recipes-core/images/core-image-base.bbappend @@ -1,2 +1,4 @@ -IMAGE_BOOT_FILES:append:orange-pi-zero2w = " boot.scr ${KERNEL_DEVICETREE} allwinner/overlay/sun50i-h616-fixup.scr " -IMAGE_INSTALL:append:orange-pi-zero2w = " uwe5622-firmware " \ No newline at end of file +IMAGE_BOOT_FILES:append:orange-pi-zero2w = " boot.scr ${KERNEL_DEVICETREE} diya-config.txt recovery-${MACHINE}.cpio.lz4.u-boot Image.gz " +# ${KERNEL_DEVICETREE} allwinner/overlay/sun50i-h616-fixup.scr " +IMAGE_INSTALL:append:orange-pi-zero2w = " uwe5622-firmware diya-resizefs " +OVERLAYFS_ETC_DEVICE = "/dev/mmcblk0p3" \ No newline at end of file diff --git a/recipes-core/images/core-image-recovery.bbapend b/recipes-core/images/core-image-recovery.bbapend deleted file mode 100644 index e40048c..0000000 --- a/recipes-core/images/core-image-recovery.bbapend +++ /dev/null @@ -1,7 +0,0 @@ -image_patch:append () { - # create /etc/fstab - cat << EOF > ${IMAGE_ROOTFS}/etc/fstab -/dev/mmcblk1p1 /boot auto defaults 0 0 -/dev/mmcblk1p4 /home auto defaults 0 0 -EOF -} \ No newline at end of file diff --git a/recipes-core/images/core-image-recovery.bbappend b/recipes-core/images/core-image-recovery.bbappend new file mode 100644 index 0000000..920b052 --- /dev/null +++ b/recipes-core/images/core-image-recovery.bbappend @@ -0,0 +1,19 @@ +PACKAGE_INSTALL:append:orange-pi-zero2w = " \ + kernel-module-libcomposite \ + kernel-module-usb-f-rndis \ + kernel-module-usb-f-mass-storage \ + kernel-module-usb-f-ecm \ + kernel-module-usb-f-eem \ + kernel-module-usb-f-serial \ + kernel-module-usb-f-acm \ + kernel-module-usb-f-hid \ + kernel-module-usb-f-fs \ + " + +image_patch:append () { + # create /etc/fstab + cat << EOF > ${IMAGE_ROOTFS}/etc/fstab +/dev/mmcblk1p1 /boot auto defaults 0 0 +/dev/mmcblk1p4 /home auto defaults 0 0 +EOF +} \ No newline at end of file diff --git a/recipes-graphics/mesa/mesa_%.bbappend b/recipes-graphics/mesa/mesa.bbappend similarity index 100% rename from recipes-graphics/mesa/mesa_%.bbappend rename to recipes-graphics/mesa/mesa.bbappend diff --git a/recipes-kernel/linux/files/0001-Fix-reset-issue-on-H6-by-using-R_WDOG.patch b/recipes-kernel/linux/files/0001-Fix-reset-issue-on-H6-by-using-R_WDOG.patch index 5ce8c3f..d6e9d52 100644 --- a/recipes-kernel/linux/files/0001-Fix-reset-issue-on-H6-by-using-R_WDOG.patch +++ b/recipes-kernel/linux/files/0001-Fix-reset-issue-on-H6-by-using-R_WDOG.patch @@ -8,6 +8,7 @@ Inspired by froezuses patch here: https://forum.armbian.com/topic/9833-h6-famous-reboot-problem/?page=3 Signed-off-by: Ondrej Jirman +Upstream-Status: Pending --- plat/allwinner/sun50i_h6/include/sunxi_mmap.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/recipes-kernel/linux/files/0002-fix-rtl8822c-compi-error.patch b/recipes-kernel/linux/files/0002-fix-rtl8822c-compi-error.patch index 1460607..45f8158 100644 --- a/recipes-kernel/linux/files/0002-fix-rtl8822c-compi-error.patch +++ b/recipes-kernel/linux/files/0002-fix-rtl8822c-compi-error.patch @@ -1,3 +1,10 @@ +From: Dany LE +Date: Wed, 8 Apr 2025 20:16:14 -0800 +Subject: fix rtl8822c compile error + +Upstream-Status: Pending + +--- diff --git a/drivers/net/wireless/rtl88x2cs/Makefile b/drivers/net/wireless/rtl88x2cs/Makefile index 814cf1e1ba5f..fe0c5cbe991a 100755 --- a/drivers/net/wireless/rtl88x2cs/Makefile diff --git a/recipes-kernel/linux/files/0003-enable-mali-gpu.patch b/recipes-kernel/linux/files/0003-enable-mali-gpu.patch index 13048b7..963d1ca 100644 --- a/recipes-kernel/linux/files/0003-enable-mali-gpu.patch +++ b/recipes-kernel/linux/files/0003-enable-mali-gpu.patch @@ -1,3 +1,10 @@ +From: Dany LE +Date: Wed, 8 Apr 2025 20:16:14 -0800 +Subject: enable mali GPU + +Upstream-Status: Pending + +--- diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2w.dts b/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2w.dts index 27e817b379a4..01d2d6682c67 100755 --- a/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2w.dts diff --git a/recipes-kernel/linux/files/0004-fix-unisocwcn-include-path.patch b/recipes-kernel/linux/files/0004-fix-unisocwcn-include-path.patch index fc6925b..1fabdc2 100644 --- a/recipes-kernel/linux/files/0004-fix-unisocwcn-include-path.patch +++ b/recipes-kernel/linux/files/0004-fix-unisocwcn-include-path.patch @@ -1,3 +1,10 @@ +From: Dany LE +Date: Wed, 8 Apr 2025 20:16:14 -0800 +Subject: fix unisocwcn include path + +Upstream-Status: Pending + +--- diff --git a/drivers/net/wireless/uwe5622/Makefile b/drivers/net/wireless/uwe5622/Makefile index 313ea512340c..8a68354a186a 100644 --- a/drivers/net/wireless/uwe5622/Makefile diff --git a/recipes-kernel/linux/files/0005-fix-rtl8xxx-include-path.patch b/recipes-kernel/linux/files/0005-fix-rtl8xxx-include-path.patch index a2b3a43..8f313cd 100644 --- a/recipes-kernel/linux/files/0005-fix-rtl8xxx-include-path.patch +++ b/recipes-kernel/linux/files/0005-fix-rtl8xxx-include-path.patch @@ -1,3 +1,10 @@ +From: Dany LE +Date: Wed, 8 Apr 2025 20:16:14 -0800 +Subject: fix rtl8xxx include path + +Upstream-Status: Pending + +--- diff --git a/drivers/net/wireless/rtl8189es/Makefile b/drivers/net/wireless/rtl8189es/Makefile index faa4c0cb66d5..1a99826eee1d 100644 --- a/drivers/net/wireless/rtl8189es/Makefile diff --git a/recipes-kernel/linux/linux-mainline_6.12.bb b/recipes-kernel/linux/linux-mainline_6.12.bb new file mode 100644 index 0000000..052e020 --- /dev/null +++ b/recipes-kernel/linux/linux-mainline_6.12.bb @@ -0,0 +1,52 @@ +DESCRIPTION = "Mainline Linux Kernel orange pi" +SECTION = "kernel" +LICENSE = "GPL-2.0-only" +LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46" + +FILESEXTRAPATHS:prepend := "${THISDIR}/files:" + +SRCREV_machine = "adc218676eef25575469234709c2d87185ca223a" +# SRCREV_meta = "1a97a82e62ebf4ef3787768a1f5937e2d2f280ce" + +# COMPATIBLE_MACHINE ?= "^orange-pi-zero2w$" +COMPATIBLE_MACHINE = "(sun4i|sun5i|sun7i|sun8i|sun50i)" + +LINUX_OPI_BRANCH ?= "master" + +SRC_URI = " \ + git://github.com/torvalds/linux.git;name=machine;branch=${LINUX_OPI_BRANCH};protocol=https \ + file://defconfig \ + " + +# Pull in the devicetree files into the rootfs +RDEPENDS_${KERNEL_PACKAGE_NAME}-base += "kernel-devicetree" + +KERNEL_EXTRA_ARGS += "LOADADDR=${UBOOT_ENTRYPOINT}" + +inherit kernel + +require linux.inc + +LINUX_VERSION ?= "${PV}" +S = "${UNPACKDIR}/git" + +do_deploy:append() { + install -d ${DEPLOY_DIR_IMAGE} + install -d ${DEPLOY_DIR_IMAGE}/allwinner + install -d ${DEPLOY_DIR_IMAGE}/allwinner/overlay + for file in ${KERNEL_DEVICETREE}; do + name=$(basename $file) + ext="${name##*.}" + if [ "$ext" = "dtb" ]; then + ln -sf ${DEPLOY_DIR_IMAGE}/${name} ${DEPLOY_DIR_IMAGE}/allwinner/${name} + else + ln -sf ${DEPLOY_DIR_IMAGE}/${name} ${DEPLOY_DIR_IMAGE}/allwinner/overlay/${name} + fi + done + # install -m 0755 ${S}/arch/arm64/boot/dts/allwinner/overlay/sun50i-h616-fixup.scr ${DEPLOY_DIR_IMAGE}/allwinner/overlay/ + +} + +# allwinner/overlay/sun50i-h616-fixup.scr + +FILES_${KERNEL_PACKAGE_NAME}-base:append = " ${nonarch_base_libdir}/modules/${KERNEL_VERSION}/modules.builtin.modinfo" diff --git a/recipes-kernel/linux/linux-xunlong_6.1.31.bb b/recipes-kernel/linux/linux-xunlong_6.1.31.bb index 942b37f..e685756 100644 --- a/recipes-kernel/linux/linux-xunlong_6.1.31.bb +++ b/recipes-kernel/linux/linux-xunlong_6.1.31.bb @@ -1,4 +1,4 @@ -DESCRIPTION = "Linux Kernel for Raspberry Pi" +DESCRIPTION = "Linux Kernel for Orange Pi Zero" SECTION = "kernel" LICENSE = "GPL-2.0-only" LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46" @@ -11,6 +11,37 @@ SRCREV_machine = "3495b5ee0594566c9fed930b96b1cae90600412e" # COMPATIBLE_MACHINE ?= "^orange-pi-zero2w$" COMPATIBLE_MACHINE = "(sun4i|sun5i|sun7i|sun8i|sun50i)" +KERNEL_DEVICETREE = "allwinner/sun50i-h616-orangepi-zero2w.dtb \ + allwinner/overlay/sun50i-h616-disable-leds.dtbo \ + allwinner/overlay/sun50i-h616-disable-uart0.dtbo \ + allwinner/overlay/sun50i-h616-gpu.dtbo \ + allwinner/overlay/sun50i-h616-ir.dtbo \ + allwinner/overlay/sun50i-h616-ph-i2c1.dtbo \ + allwinner/overlay/sun50i-h616-ph-i2c2.dtbo \ + allwinner/overlay/sun50i-h616-ph-i2c3.dtbo \ + allwinner/overlay/sun50i-h616-ph-i2c4.dtbo \ + allwinner/overlay/sun50i-h616-ph-pwm12.dtbo \ + allwinner/overlay/sun50i-h616-ph-pwm34.dtbo \ + allwinner/overlay/sun50i-h616-ph-uart2.dtbo \ + allwinner/overlay/sun50i-h616-ph-uart5.dtbo \ + allwinner/overlay/sun50i-h616-pi-i2c0.dtbo \ + allwinner/overlay/sun50i-h616-pi-i2c1.dtbo \ + allwinner/overlay/sun50i-h616-pi-i2c2.dtbo \ + allwinner/overlay/sun50i-h616-pi-pwm1.dtbo \ + allwinner/overlay/sun50i-h616-pi-pwm2.dtbo \ + allwinner/overlay/sun50i-h616-pi-pwm3.dtbo \ + allwinner/overlay/sun50i-h616-pi-pwm4.dtbo \ + allwinner/overlay/sun50i-h616-pi-uart2.dtbo \ + allwinner/overlay/sun50i-h616-pi-uart3.dtbo \ + allwinner/overlay/sun50i-h616-pi-uart4.dtbo \ + allwinner/overlay/sun50i-h616-spi0-spidev.dtbo \ + allwinner/overlay/sun50i-h616-spi1-cs0-cs1-spidev.dtbo \ + allwinner/overlay/sun50i-h616-spi1-cs0-spidev.dtbo \ + allwinner/overlay/sun50i-h616-spi1-cs1-spidev.dtbo \ + allwinner/overlay/sun50i-h616-usb0-host.dtbo \ + allwinner/overlay/sun50i-h616-zero2w-disable-led.dtbo \ +" + LINUX_OPI_BRANCH ?= "orange-pi-6.1-sun50iw9" SRC_URI = " \ @@ -32,7 +63,7 @@ inherit kernel require linux.inc LINUX_VERSION ?= "${PV}" -S = "${WORKDIR}/linux-${PV}" +S = "${UNPACKDIR}/git" do_deploy:append() { install -d ${DEPLOY_DIR_IMAGE} diff --git a/recipes-kernel/linux/linux.inc b/recipes-kernel/linux/linux.inc index 95d9ec1..020f772 100644 --- a/recipes-kernel/linux/linux.inc +++ b/recipes-kernel/linux/linux.inc @@ -1,6 +1,6 @@ DESCRIPTION = "Linux Kernel" SECTION = "kernel" -LICENSE = "GPLv2" +LICENSE = "GPL-2.0-only" INC_PR = "r0" @@ -35,8 +35,10 @@ kernel_conf_variable() { fi } -do_kernel_configme[depends] += "virtual/${TARGET_PREFIX}binutils:do_populate_sysroot" -do_kernel_configme[depends] += "virtual/${TARGET_PREFIX}gcc:do_populate_sysroot" +# do_kernel_configme[depends] += "virtual/${TARGET_PREFIX}binutils:do_populate_sysroot" +# do_kernel_configme[depends] += "virtual/${TARGET_PREFIX}gcc:do_populate_sysroot" +do_kernel_configme[depends] += "virtual/cross-binutils:do_populate_sysroot" +do_kernel_configme[depends] += "gcc-cross-${TARGET_ARCH}:do_populate_sysroot" do_kernel_configme[depends] += "bc-native:do_populate_sysroot bison-native:do_populate_sysroot" do_configure:prepend() { @@ -45,8 +47,8 @@ do_configure:prepend() { # # logo support, if you supply logo_linux_clut224.ppm in SRC_URI, then it's going to be used # - if [ -e ${WORKDIR}/logo_linux_clut224.ppm ]; then - install -m 0644 ${WORKDIR}/logo_linux_clut224.ppm drivers/video/logo/logo_linux_clut224.ppm + if [ -e ${UNPACKDIR}/logo_linux_clut224.ppm ]; then + install -m 0644 ${UNPACKDIR}/logo_linux_clut224.ppm drivers/video/logo/logo_linux_clut224.ppm kernel_conf_variable LOGO y kernel_conf_variable LOGO_LINUX_CLUT224 y fi diff --git a/recipes-kernel/uwe5622-firmware/uwe5622-firmware.bb b/recipes-kernel/uwe5622-firmware/uwe5622-firmware.bb index a818ac3..2bbf25a 100644 --- a/recipes-kernel/uwe5622-firmware/uwe5622-firmware.bb +++ b/recipes-kernel/uwe5622-firmware/uwe5622-firmware.bb @@ -2,7 +2,7 @@ DESCRIPTION = "UWE5622 Wifi firmware" LICENSE = "CC0-1.0" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/${LICENSE};md5=0ceb3372c9595f0a8067e55da801e4a1" -S = "${WORKDIR}" +S = "${UNPACKDIR}" COMPATIBLE_MACHINE = "orange-pi-zero2" diff --git a/wic/image.wks.in b/wic/image.wks.in index 47cb8a2..24809eb 100644 --- a/wic/image.wks.in +++ b/wic/image.wks.in @@ -1,12 +1,12 @@ # short-description: Create Raspberry Pi SD card image # long-description: Creates a partitioned SD card image for use with -part u-boot --source rawcopy --sourceparams="file=${SPL_BINARY}" --ondisk mmcblk1 --no-table --align 8 -part /boot --source bootimg-partition --ondisk mmcblk1 --fstype=vfat --label boot --active --align 4096 --size 32 +part u-boot --source rawcopy --sourceparams="file=${SPL_BINARY}" --ondisk mmcblk0 --no-table --align 8 +part /boot --source bootimg-partition --ondisk mmcblk0 --fstype=vfat --label boot --active --align 4096 --size 32 # read only roofs -part / --source rootfs --ondisk mmcblk1 --fstype=ext4 --label root --align 4096 --size 150 --exclude-path home/ --exclude-path var/etc/ --exclude-path boot/ +part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label root --align 4096 --size 150 --exclude-path home/ --exclude-path var/etc/ --exclude-path boot/ # modifiable configurations stored in /var/etc -part /var/etc --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/var/etc --ondisk mmcblk1 --fstype=ext4 --label diya --align 1024 --size 32 +part /var/etc --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/var/etc --ondisk mmcblk0 --fstype=ext4 --label diya --align 1024 --size 32 # home partition -part /home --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/home --ondisk mmcblk1 --fstype=ext4 --label home --align 1024 --size 16 -# part /home --ondisk mmcblk1 --fstype=vfat --label music --active --align 1024 --size 16 \ No newline at end of file +part /home --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/home --ondisk mmcblk0 --fstype=ext4 --label home --align 1024 --size 16 +# part /home --ondisk mmcblk0 --fstype=vfat --label music --active --align 1024 --size 16 \ No newline at end of file