fix handling KERNEL_DEVICETREE with allwinner/ prefix

Since linux 6.5, .dts files live in vendor subdirs. Fix all
`KERNEL_DEVICETREE` definitions to contain the `allwinner` subdir as
prefix and drop code that previously added the prefix on demand.
On the other hand, drop the prefix for `BOOT_IMAGE_FILES`, which
searches the .dtb within `DEPLOY_DIR`.

Signed-off-by: Oliver Kästner <git@oliver-kaestner.de>
This commit is contained in:
Oliver Kästner 2025-03-24 18:20:21 +01:00
parent 5e74f7e4d7
commit 3c1d2b073b
No known key found for this signature in database
GPG Key ID: 06A81B143EA9588F
40 changed files with 48 additions and 97 deletions

View File

@ -5,5 +5,5 @@
require conf/machine/include/sun8i.inc
require conf/machine/include/hardware/ap6212a.inc
KERNEL_DEVICETREE = "sun8i-v40-bananapi-m2-berry.dtb"
KERNEL_DEVICETREE = "allwinner/sun8i-v40-bananapi-m2-berry.dtb"
UBOOT_MACHINE = "bananapi_m2_berry_defconfig"

View File

@ -5,6 +5,5 @@
require conf/machine/include/sun8i.inc
require conf/machine/include/hardware/ap6212a.inc
KERNEL_DEVICETREE = "sun8i-h2-plus-bananapi-m2-zero.dtb"
KERNEL_DEVICETREE = "allwinner/sun8i-h2-plus-bananapi-m2-zero.dtb"
UBOOT_MACHINE = "bananapi_m2_zero_defconfig"

View File

@ -4,6 +4,5 @@
require conf/machine/include/sun8i.inc
KERNEL_DEVICETREE = "sun8i-r16-bananapi-m2m.dtb"
KERNEL_DEVICETREE = "allwinner/sun8i-r16-bananapi-m2m.dtb"
UBOOT_MACHINE = "Bananapi_m2m_defconfig"

View File

@ -4,6 +4,5 @@
require conf/machine/include/sun8i.inc
KERNEL_DEVICETREE = "sun8i-h3-bananapi-m2-plus.dtb"
KERNEL_DEVICETREE = "allwinner/sun8i-h3-bananapi-m2-plus.dtb"
UBOOT_MACHINE = "bananapi_m2_plus_h3_defconfig"

View File

@ -4,6 +4,6 @@
require conf/machine/include/sun7i.inc
KERNEL_DEVICETREE = "sun7i-a20-bananapi.dtb"
KERNEL_DEVICETREE = "allwinner/sun7i-a20-bananapi.dtb"
UBOOT_MACHINE = "Bananapi_config"
SUNXI_FEX_FILE = "sys_config/a20/Bananapi.fex"
SUNXI_FEX_FILE = "sys_config/a20/Bananapi.fex"

View File

@ -4,6 +4,6 @@
require conf/machine/include/sun4i.inc
KERNEL_DEVICETREE = "sun4i-a10-cubieboard.dtb"
KERNEL_DEVICETREE = "allwinner/sun4i-a10-cubieboard.dtb"
UBOOT_MACHINE = "Cubieboard_config"
SUNXI_FEX_FILE = "sys_config/a10/cubieboard.fex"

View File

@ -4,6 +4,6 @@
require conf/machine/include/sun7i.inc
KERNEL_DEVICETREE = "sun7i-a20-cubieboard2.dtb"
KERNEL_DEVICETREE = "allwinner/sun7i-a20-cubieboard2.dtb"
UBOOT_MACHINE = "Cubieboard2_config"
SUNXI_FEX_FILE = "sys_config/a20/cubieboard2.fex"

View File

@ -7,5 +7,5 @@ require conf/machine/include/hardware/ap6330.inc
KERNEL_IMAGETYPE = "zImage"
KERNEL_DEVICETREE = "sun9i-a80-cubieboard4.dtb"
KERNEL_DEVICETREE = "allwinner/sun9i-a80-cubieboard4.dtb"
UBOOT_MACHINE = "Cubieboard4_defconfig"

View File

@ -4,6 +4,6 @@
require conf/machine/include/sun7i.inc
KERNEL_DEVICETREE = "sun7i-a20-cubietruck.dtb"
KERNEL_DEVICETREE = "allwinner/sun7i-a20-cubietruck.dtb"
UBOOT_MACHINE = "Cubietruck_config"
SUNXI_FEX_FILE = "sys_config/a20/cubietruck.fex"
SUNXI_FEX_FILE = "sys_config/a20/cubietruck.fex"

View File

@ -40,7 +40,7 @@ SUNXI_FEX_FILE ?= " "
SUNXI_BOOT_SPACE ?= "40"
IMAGE_BOOT_FILES ?= "${KERNEL_IMAGETYPE} boot.scr"
# ship fex file for sunxi kernel, devicetree file for mainline kernel
IMAGE_BOOT_FILES += "${@bb.utils.contains('PREFERRED_PROVIDER_virtual/kernel', 'linux-sunxi', '${SUNXI_FEX_FILE}', '${KERNEL_DEVICETREE}', d)}"
IMAGE_BOOT_FILES += "${@bb.utils.contains('PREFERRED_PROVIDER_virtual/kernel', 'linux-sunxi', '${SUNXI_FEX_FILE}', d.getVar('KERNEL_DEVICETREE', '').split('/')[-1], d)}"
WKS_FILES ?= "sunxi-sdcard-image.wks.in"
WKS_FILE_DEPENDS ?= "virtual/kernel u-boot"
# in case of sunxi kernel, sunxi-board-fex must be built prior wic image assembly

View File

@ -25,28 +25,8 @@ SPL_BINARY ?= "u-boot-sunxi-with-spl.bin"
SERIAL_CONSOLES ?= "115200;ttyS0"
MACHINE_FEATURES ?= "alsa apm keyboard rtc serial screen usbgadget usbhost vfat"
# arm64 dbts are under <vendor>/dts but is deployed under DEPLOYDIR
do_fix_device_tree_location() {
for kdt in ${KERNEL_DEVICETREE}
do
local dbt_dir=$(dirname ${kdt})
if [ "." != "${dbt_dir}" ] ; then
local dbt=$(basename ${kdt})
local dst=${DEPLOY_DIR_IMAGE}/${dbt_dir}/${dbt}
if [ ! -f ${dst} ] ; then
mkdir -p ${DEPLOY_DIR_IMAGE}/$dbt_dir
ln -s ${DEPLOY_DIR_IMAGE}/${dbt} ${dst}
fi
fi
done
}
addtask do_fix_device_tree_location after do_write_wks_template before do_image_wic
SUNXI_BOOT_SPACE ?= "40"
IMAGE_BOOT_FILES ?= "${KERNEL_IMAGETYPE} boot.scr ${KERNEL_DEVICETREE}"
IMAGE_BOOT_FILES ?= "${KERNEL_IMAGETYPE} boot.scr ${@d.getVar('KERNEL_DEVICETREE', '').split('/')[-1]}"
WKS_FILES ?= "sunxi-sdcard-image.wks.in"
WKS_FILE_DEPENDS ?= "virtual/kernel u-boot"

View File

@ -5,6 +5,6 @@
require conf/machine/include/sun7i.inc
MACHINE_EXTRA_RRECOMMENDS = " kernel-modules kernel-devicetree"
KERNEL_DEVICETREE = "sun7i-a20-lamobo-r1.dtb"
KERNEL_DEVICETREE = "allwinner/sun7i-a20-lamobo-r1.dtb"
UBOOT_MACHINE = "Lamobo_R1_config"
SUNXI_FEX_FILE = "sys_config/a20/lamobo-r1.fex"

View File

@ -6,4 +6,4 @@ require conf/machine/include/sun8i.inc
UBOOT_MACHINE = "LicheePi_Zero_defconfig"
KERNEL_DEVICETREE = "sun8i-v3s-licheepi-zero.dtb"
KERNEL_DEVICETREE = "allwinner/sun8i-v3s-licheepi-zero.dtb"

View File

@ -4,7 +4,7 @@
require conf/machine/include/sun8i.inc
KERNEL_DEVICETREE = "sun8i-t113s-mangopi-mq-r-t113.dtb"
KERNEL_DEVICETREE = "allwinner/sun8i-t113s-mangopi-mq-r-t113.dtb"
KERNEL_IMAGETYPE = "zImage"
UBOOT_MACHINE = "mangopi_mq_r_defconfig"

View File

@ -5,6 +5,6 @@
require conf/machine/include/sun4i.inc
KERNEL_DEVICETREE = "sun4i-a10-marsboard.dtb"
KERNEL_DEVICETREE = "allwinner/sun4i-a10-marsboard.dtb"
UBOOT_MACHINE = "Marsboard_A10_config"
SUNXI_FEX_FILE = "sys_config/a10/marsboard_a10.fex"

View File

@ -4,6 +4,6 @@
require conf/machine/include/sun4i.inc
KERNEL_DEVICETREE = "sun4i-a10-a1000.dtb"
KERNEL_DEVICETREE = "allwinner/sun4i-a10-a1000.dtb"
UBOOT_MACHINE = "Mele_A1000_config"
SUNXI_FEX_FILE = "sys_config/a10/mele_a1000.fex"
SUNXI_FEX_FILE = "sys_config/a10/mele_a1000.fex"

View File

@ -7,5 +7,5 @@ require conf/machine/include/hardware/ap6330.inc
KERNEL_IMAGETYPE = "zImage"
KERNEL_DEVICETREE = "sun9i-a80-optimus.dtb"
KERNEL_DEVICETREE = "allwinner/sun9i-a80-optimus.dtb"
UBOOT_MACHINE = "Merrii_A80_Optimus_defconfig"

View File

@ -4,6 +4,5 @@
require conf/machine/include/sun8i.inc
KERNEL_DEVICETREE = "sun8i-h3-nanopi-m1-plus.dtb"
KERNEL_DEVICETREE = "allwinner/sun8i-h3-nanopi-m1-plus.dtb"
UBOOT_MACHINE = "nanopi_m1_plus_defconfig"

View File

@ -4,5 +4,5 @@
require conf/machine/include/sun8i.inc
KERNEL_DEVICETREE = "sun8i-h3-nanopi-m1.dtb"
KERNEL_DEVICETREE = "allwinner/sun8i-h3-nanopi-m1.dtb"
UBOOT_MACHINE = "nanopi_m1_defconfig"

View File

@ -5,5 +5,5 @@
require conf/machine/include/sun8i.inc
KERNEL_DEVICETREE = "sun8i-h3-nanopi-neo-air.dtb"
KERNEL_DEVICETREE = "allwinner/sun8i-h3-nanopi-neo-air.dtb"
UBOOT_MACHINE = "nanopi_neo_air_defconfig"

View File

@ -4,6 +4,5 @@
require conf/machine/include/sun8i.inc
KERNEL_DEVICETREE = "sun8i-h3-nanopi-neo.dtb"
KERNEL_DEVICETREE = "allwinner/sun8i-h3-nanopi-neo.dtb"
UBOOT_MACHINE = "nanopi_neo_defconfig"

View File

@ -4,5 +4,5 @@
require conf/machine/include/sun8i.inc
KERNEL_DEVICETREE = "sun8i-h3-nanopi-r1.dtb"
KERNEL_DEVICETREE = "allwinner/sun8i-h3-nanopi-r1.dtb"
UBOOT_MACHINE = "nanopi_r1_defconfig"

View File

@ -5,6 +5,6 @@
require conf/machine/include/sun4i.inc
KERNEL_DEVICETREE = "sun4i-a10-olinuxino-lime.dtb"
KERNEL_DEVICETREE = "allwinner/sun4i-a10-olinuxino-lime.dtb"
UBOOT_MACHINE = "A10-OLinuXino-Lime_config"
SUNXI_FEX_FILE = "sys_config/a10/a10-olinuxino-lime.fex"
SUNXI_FEX_FILE = "sys_config/a10/a10-olinuxino-lime.fex"

View File

@ -5,6 +5,6 @@
require conf/machine/include/sun5i.inc
KERNEL_DEVICETREE = "sun5i-a10s-olinuxino-micro.dtb"
KERNEL_DEVICETREE = "allwinner/sun5i-a10s-olinuxino-micro.dtb"
UBOOT_MACHINE = "A10s-OLinuXino-M_config"
SUNXI_FEX_FILE = "sys_config/a10s/a10s-olinuxino-m.fex"
SUNXI_FEX_FILE = "sys_config/a10s/a10s-olinuxino-m.fex"

View File

@ -5,6 +5,6 @@
require conf/machine/include/sun5i.inc
KERNEL_DEVICETREE = "sun5i-a13-olinuxino.dtb"
KERNEL_DEVICETREE = "allwinner/sun5i-a13-olinuxino.dtb"
UBOOT_MACHINE = "A13-OLinuXino_config"
SUNXI_FEX_FILE = "sys_config/a13/a13-olinuxino.fex"
SUNXI_FEX_FILE = "sys_config/a13/a13-olinuxino.fex"

View File

@ -5,6 +5,6 @@
require conf/machine/include/sun7i.inc
KERNEL_DEVICETREE = "sun7i-a20-olinuxino-micro.dtb"
KERNEL_DEVICETREE = "allwinner/sun7i-a20-olinuxino-micro.dtb"
UBOOT_MACHINE = "A20-OLinuXino_MICRO_config"
SUNXI_FEX_FILE = "sys_config/a20/a20-olinuxino_micro.fex"
SUNXI_FEX_FILE = "sys_config/a20/a20-olinuxino_micro.fex"

View File

@ -5,6 +5,6 @@
require conf/machine/include/sun7i.inc
KERNEL_DEVICETREE = "sun7i-a20-olinuxino-lime.dtb"
KERNEL_DEVICETREE = "allwinner/sun7i-a20-olinuxino-lime.dtb"
UBOOT_MACHINE = "A20-OLinuXino-Lime_config"
SUNXI_FEX_FILE = "sys_config/a20/a20-olinuxino_lime.fex"
SUNXI_FEX_FILE = "sys_config/a20/a20-olinuxino_lime.fex"

View File

@ -5,6 +5,6 @@
require conf/machine/include/sun7i.inc
KERNEL_DEVICETREE = "sun7i-a20-olinuxino-lime2-emmc.dtb"
KERNEL_DEVICETREE = "allwinner/sun7i-a20-olinuxino-lime2-emmc.dtb"
UBOOT_MACHINE = "A20-OLinuXino-Lime2-eMMC_config"
SUNXI_FEX_FILE = "sys_config/a20/a20-olinuxino_lime2.fex"

View File

@ -5,6 +5,6 @@
require conf/machine/include/sun7i.inc
KERNEL_DEVICETREE = "sun7i-a20-olinuxino-lime2.dtb"
KERNEL_DEVICETREE = "allwinner/sun7i-a20-olinuxino-lime2.dtb"
UBOOT_MACHINE = "A20-OLinuXino-Lime2_config"
SUNXI_FEX_FILE = "sys_config/a20/a20-olinuxino_lime2.fex"

View File

@ -5,6 +5,6 @@
require conf/machine/include/sun7i.inc
KERNEL_DEVICETREE = "sun7i-a20-olimex-som-evb.dtb"
KERNEL_DEVICETREE = "allwinner/sun7i-a20-olimex-som-evb.dtb"
UBOOT_MACHINE = "A20-Olimex-SOM-EVB_config"
SUNXI_FEX_FILE = "sys_config/a20/olimex_a20_som.fex"

View File

@ -4,6 +4,5 @@
require conf/machine/include/sun8i.inc
KERNEL_DEVICETREE = "sun8i-h3-orangepi-lite.dtb"
KERNEL_DEVICETREE = "allwinner/sun8i-h3-orangepi-lite.dtb"
UBOOT_MACHINE = "orangepi_lite_defconfig"

View File

@ -4,6 +4,5 @@
require conf/machine/include/sun8i.inc
KERNEL_DEVICETREE = "sun8i-h3-orangepi-one.dtb"
KERNEL_DEVICETREE = "allwinner/sun8i-h3-orangepi-one.dtb"
UBOOT_MACHINE = "orangepi_one_defconfig"

View File

@ -4,6 +4,5 @@
require conf/machine/include/sun8i.inc
KERNEL_DEVICETREE = "sun8i-h3-orangepi-pc-plus.dtb"
KERNEL_DEVICETREE = "allwinner/sun8i-h3-orangepi-pc-plus.dtb"
UBOOT_MACHINE = "orangepi_pc_plus_defconfig"

View File

@ -4,6 +4,5 @@
require conf/machine/include/sun8i.inc
KERNEL_DEVICETREE = "sun8i-h3-orangepi-pc.dtb"
KERNEL_DEVICETREE = "allwinner/sun8i-h3-orangepi-pc.dtb"
UBOOT_MACHINE = "orangepi_pc_defconfig"

View File

@ -4,6 +4,5 @@
require conf/machine/include/sun8i.inc
KERNEL_DEVICETREE = "sun8i-h2-plus-orangepi-r1.dtb"
KERNEL_DEVICETREE = "allwinner/sun8i-h2-plus-orangepi-r1.dtb"
UBOOT_MACHINE = "orangepi_r1_defconfig"

View File

@ -5,5 +5,5 @@
require conf/machine/include/sun8i.inc
require conf/machine/include/hardware/ap6212a.inc
KERNEL_DEVICETREE = "sun8i-h3-orangepi-zero-plus2.dtb"
KERNEL_DEVICETREE = "allwinner/sun8i-h3-orangepi-zero-plus2.dtb"
UBOOT_MACHINE = "orangepi_zero_plus2_h3_defconfig"

View File

@ -4,6 +4,5 @@
require conf/machine/include/sun8i.inc
KERNEL_DEVICETREE = "sun8i-h2-plus-orangepi-zero.dtb"
KERNEL_DEVICETREE = "allwinner/sun8i-h2-plus-orangepi-zero.dtb"
UBOOT_MACHINE = "orangepi_zero_defconfig"

View File

@ -4,6 +4,6 @@
require conf/machine/include/sun4i.inc
KERNEL_DEVICETREE = "sun4i-a10-pcduino.dtb"
KERNEL_DEVICETREE = "allwinner/sun4i-a10-pcduino.dtb"
UBOOT_MACHINE = "Linksprite_pcDuino_defconfig"
SUNXI_FEX_FILE = "sys_config/a10/pcduino.fex"

View File

@ -4,6 +4,6 @@
require conf/machine/include/sun7i.inc
KERNEL_DEVICETREE = "sun7i-a20-pcduino3.dtb"
KERNEL_DEVICETREE = "allwinner/sun7i-a20-pcduino3.dtb"
UBOOT_MACHINE = "Linksprite_pcDuino3_defconfig"
SUNXI_FEX_FILE = "sys_config/a20/linksprite_pcduino3.fex"
SUNXI_FEX_FILE = "sys_config/a20/linksprite_pcduino3.fex"

View File

@ -9,24 +9,6 @@ require linux.inc
LINUX_VERSION = "${PV}"
KERNEL_DTB_PREFIX = "0"
python() {
# return version in int form
def kernel_version():
ver = d.getVar('PV', True).split('.')
return int("".join(ver[0])),int("".join(ver[1]))
# kernel 6.5 have updated dts path add 'allwinner' prefix automatically
major, minor = kernel_version()
if major >= 6 and minor >= 5:
dt = d.getVar('KERNEL_DEVICETREE', True)
if not "allwinner" in dt:
dt = "allwinner/{0}".format(dt)
d.setVar('KERNEL_DEVICETREE', dt)
d.setVar('KERNEL_DTB_PREFIX', "1")
}
# Since we're not using git, this doesn't make a difference, but we need to fill
# in something or kernel-yocto.bbclass will fail.
KBRANCH ?= "master"