diff options
| author | Adrian Freihofer <adrian.freihofer@siemens.com> | 2025-06-03 10:23:13 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-06-05 11:02:21 +0100 |
| commit | c6a51f8c99d4b51754c8c6950e8888227e18604a (patch) | |
| tree | 210155dbd2170247eed978adc0b932ac6b2836f0 /meta-selftest | |
| parent | 437043d9f3cdcadb9b9898a25a9216323066e250 (diff) | |
| download | poky-c6a51f8c99d4b51754c8c6950e8888227e18604a.tar.gz | |
oe-selftest: add new ext dtb recipe
There is no test coverage for the devicetree.bbclass class. Add a
minimalist recipe that uses this class.
This recipe compiles a devicetree overlay that does not include any
sources from the kernel build folder to keep it simple and also usable
for testing a kernel from the sstate-cache.
(From OE-Core rev: 44b6eaf9fb408f2a7941e7ba8f2156cf2c7d4bae)
Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta-selftest')
3 files changed, 92 insertions, 0 deletions
diff --git a/meta-selftest/recipes-test/ext-dtb/bbb-dtbs-as-ext.bb b/meta-selftest/recipes-test/ext-dtb/bbb-dtbs-as-ext.bb new file mode 100644 index 0000000000..5055d03e54 --- /dev/null +++ b/meta-selftest/recipes-test/ext-dtb/bbb-dtbs-as-ext.bb | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | SUMMARY = "Boeaglebone Devicetrees" | ||
| 2 | DESCRIPTION = "Handle the dtc files of the beaglebone-yocto via devicetree.bbclass just for testing purpose" | ||
| 3 | SECTION = "kernel" | ||
| 4 | LICENSE = "MIT" | ||
| 5 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | ||
| 6 | |||
| 7 | inherit devicetree | ||
| 8 | |||
| 9 | COMPATIBLE_MACHINE = "^(beaglebone-yocto)$" | ||
| 10 | |||
| 11 | # Take a copy of a small devicetree from the kernel's source directory for handling it externally | ||
| 12 | # Borrowed an example DTB overlay from | ||
| 13 | # https://raw.githubusercontent.com/beagleboard/linux/refs/heads/5.10/arch/arm/boot/dts/overlays/BBORG_RELAY-00A2.dts | ||
| 14 | SRC_URI = "\ | ||
| 15 | file://am335x-bonegreen-ext.dts \ | ||
| 16 | file://BBORG_RELAY-00A2.dts \ | ||
| 17 | " | ||
| 18 | |||
| 19 | # The am335x-bonegreen-ext.dts needs also the ti directories | ||
| 20 | DT_INCLUDE:append = " ${STAGING_KERNEL_DIR}/arch/${ARCH}/boot/dts/ti/omap" | ||
| 21 | |||
| 22 | # Sym-links are handled as extra configuration nodes in FIT images. | ||
| 23 | do_install:append() { | ||
| 24 | ln -sf am335x-bonegreen-ext.dtb "${D}/boot/devicetree/am335x-bonegreen-ext-alias.dtb" | ||
| 25 | } | ||
| 26 | |||
| 27 | do_deploy:append() { | ||
| 28 | ln -sf am335x-bonegreen-ext.dtb "${DEPLOYDIR}/devicetree/am335x-bonegreen-ext-alias.dtb" | ||
| 29 | } | ||
diff --git a/meta-selftest/recipes-test/ext-dtb/files/BBORG_RELAY-00A2.dts b/meta-selftest/recipes-test/ext-dtb/files/BBORG_RELAY-00A2.dts new file mode 100644 index 0000000000..9530fa50fe --- /dev/null +++ b/meta-selftest/recipes-test/ext-dtb/files/BBORG_RELAY-00A2.dts | |||
| @@ -0,0 +1,49 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0-only | ||
| 2 | /* | ||
| 3 | * Copyright (C) 2015 Robert Nelson <robertcnelson@gmail.com> | ||
| 4 | * Copyright (C) 2019 Amilcar Lucas <amilcar.lucas@iav.de> | ||
| 5 | */ | ||
| 6 | |||
| 7 | /dts-v1/; | ||
| 8 | /plugin/; | ||
| 9 | |||
| 10 | &{/chosen} { | ||
| 11 | overlays { | ||
| 12 | BBORG_RELAY-00A2.kernel = __TIMESTAMP__; | ||
| 13 | }; | ||
| 14 | }; | ||
| 15 | |||
| 16 | &ocp { | ||
| 17 | P9_41_pinmux { pinctrl-0 = <&P9_41_gpio_pin>;}; | ||
| 18 | P9_42_pinmux { pinctrl-0 = <&P9_42_gpio_pin>;}; | ||
| 19 | P9_30_pinmux { pinctrl-0 = <&P9_30_gpio_pin>;}; | ||
| 20 | P9_27_pinmux { pinctrl-0 = <&P9_27_gpio_pin>;}; | ||
| 21 | }; | ||
| 22 | |||
| 23 | // relay1 | ||
| 24 | &bone_led_P9_41 { | ||
| 25 | status = "okay"; | ||
| 26 | label = "relay1"; | ||
| 27 | default-state = "keep"; | ||
| 28 | }; | ||
| 29 | |||
| 30 | // relay2 | ||
| 31 | &bone_led_P9_42 { | ||
| 32 | status = "okay"; | ||
| 33 | label = "relay2"; | ||
| 34 | default-state = "keep"; | ||
| 35 | }; | ||
| 36 | |||
| 37 | // realy3 | ||
| 38 | &bone_led_P9_30 { | ||
| 39 | status = "okay"; | ||
| 40 | label = "relay3"; | ||
| 41 | default-state = "keep"; | ||
| 42 | }; | ||
| 43 | |||
| 44 | // realy4 | ||
| 45 | &bone_led_P9_27 { | ||
| 46 | status = "okay"; | ||
| 47 | label = "relay4"; | ||
| 48 | default-state = "keep"; | ||
| 49 | }; | ||
diff --git a/meta-selftest/recipes-test/ext-dtb/files/am335x-bonegreen-ext.dts b/meta-selftest/recipes-test/ext-dtb/files/am335x-bonegreen-ext.dts new file mode 100644 index 0000000000..a0b39337a9 --- /dev/null +++ b/meta-selftest/recipes-test/ext-dtb/files/am335x-bonegreen-ext.dts | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0-only | ||
| 2 | /* | ||
| 3 | * Copyright (C) 2012 Texas Instruments Incorporated - https://www.ti.com/ | ||
| 4 | */ | ||
| 5 | /dts-v1/; | ||
| 6 | |||
| 7 | #include "am33xx.dtsi" | ||
| 8 | #include "am335x-bone-common.dtsi" | ||
| 9 | #include "am335x-bonegreen-common.dtsi" | ||
| 10 | |||
| 11 | / { | ||
| 12 | model = "TI AM335x BeagleBone Green External"; | ||
| 13 | compatible = "ti,am335x-bone-green", "ti,am335x-bone-black", "ti,am335x-bone", "ti,am33xx"; | ||
| 14 | }; | ||
