From d16b96f88d8341f4e1c7078933f14ff2921855cc Mon Sep 17 00:00:00 2001 From: Jordan Yates Date: Thu, 5 Aug 2021 23:44:27 +1000 Subject: [PATCH] tests: build_all: ieee802154: added Adds build_all for ieee802154 drivers. A substantial number of drivers are for SoC peripherals, so test cases are required many boards. Fixes #11519. Signed-off-by: Jordan Yates --- .../build_all/ieee802154/CMakeLists.txt | 8 ++ .../drivers/build_all/ieee802154/app.overlay | 112 ++++++++++++++++++ .../build_all/ieee802154/external.conf | 5 + tests/drivers/build_all/ieee802154/prj.conf | 9 ++ tests/drivers/build_all/ieee802154/spi.dtsi | 63 ++++++++++ tests/drivers/build_all/ieee802154/src/main.c | 20 ++++ .../build_all/ieee802154/testcase.yaml | 32 +++++ 7 files changed, 249 insertions(+) create mode 100644 tests/drivers/build_all/ieee802154/CMakeLists.txt create mode 100644 tests/drivers/build_all/ieee802154/app.overlay create mode 100644 tests/drivers/build_all/ieee802154/external.conf create mode 100644 tests/drivers/build_all/ieee802154/prj.conf create mode 100644 tests/drivers/build_all/ieee802154/spi.dtsi create mode 100644 tests/drivers/build_all/ieee802154/src/main.c create mode 100644 tests/drivers/build_all/ieee802154/testcase.yaml diff --git a/tests/drivers/build_all/ieee802154/CMakeLists.txt b/tests/drivers/build_all/ieee802154/CMakeLists.txt new file mode 100644 index 00000000000..2820f689345 --- /dev/null +++ b/tests/drivers/build_all/ieee802154/CMakeLists.txt @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: Apache-2.0 + +cmake_minimum_required(VERSION 3.13.1) +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(build_all) + +FILE(GLOB app_sources src/*.c) +target_sources(app PRIVATE ${app_sources}) diff --git a/tests/drivers/build_all/ieee802154/app.overlay b/tests/drivers/build_all/ieee802154/app.overlay new file mode 100644 index 00000000000..0eb783cec25 --- /dev/null +++ b/tests/drivers/build_all/ieee802154/app.overlay @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2021, Commonwealth Scientific and Industrial Research + * Organisation (CSIRO) ABN 41 687 119 230. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Application overlay for testing driver builds + * + * Names in this file should be chosen in a way that won't conflict + * with real-world devicetree nodes, to allow these tests to run on + * (and be extended to test) real hardware. + */ + +/ { + test { + #address-cells = <1>; + #size-cells = <1>; + + test_gpio: gpio@deadbeef { + compatible = "vnd,gpio"; + gpio-controller; + reg = <0xdeadbeef 0x1000>; + #gpio-cells = <0x2>; + label = "TEST_GPIO_1"; + status = "okay"; + }; + + test_spi: spi@33334444 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "vnd,spi"; + reg = <0x33334444 0x1000>; + label = "TEST_SPI_CTLR"; + status = "okay"; + clock-frequency = <2000000>; + + /* one entry for every devices at spi.dtsi */ + cs-gpios = <&test_gpio 0 0>, /* 0x00 */ + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, /* 0x10 */ + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, /* 0x20 */ + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, /* 0x30 */ + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>, + <&test_gpio 0 0>; /* 0x40 */ + + #include "spi.dtsi" + }; + }; +}; + +/* Put device specific modifications to properties or disabling of devices + * here to keep the bus specific dtsi files (i2c.dtsi, spi.dtsi, etc..) + * pristine + */ diff --git a/tests/drivers/build_all/ieee802154/external.conf b/tests/drivers/build_all/ieee802154/external.conf new file mode 100644 index 00000000000..c1d5c6ca1ae --- /dev/null +++ b/tests/drivers/build_all/ieee802154/external.conf @@ -0,0 +1,5 @@ +CONFIG_IEEE802154_CC1200=y +CONFIG_IEEE802154_CC2520=y +CONFIG_IEEE802154_CC2520_CRYPTO=y +CONFIG_IEEE802154_DW1000=y +CONFIG_IEEE802154_RF2XX=y diff --git a/tests/drivers/build_all/ieee802154/prj.conf b/tests/drivers/build_all/ieee802154/prj.conf new file mode 100644 index 00000000000..ed09e5b4b33 --- /dev/null +++ b/tests/drivers/build_all/ieee802154/prj.conf @@ -0,0 +1,9 @@ +CONFIG_TEST=y +CONFIG_TEST_USERSPACE=y +CONFIG_LOG=y +CONFIG_GPIO=y +CONFIG_SPI=y + +CONFIG_NETWORKING=y +CONFIG_NET_L2_IEEE802154=y +CONFIG_NET_L2_IEEE802154_SECURITY=y diff --git a/tests/drivers/build_all/ieee802154/spi.dtsi b/tests/drivers/build_all/ieee802154/spi.dtsi new file mode 100644 index 00000000000..5859c30342c --- /dev/null +++ b/tests/drivers/build_all/ieee802154/spi.dtsi @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2021, Commonwealth Scientific and Industrial Research + * Organisation (CSIRO) ABN 41 687 119 230. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Application overlay for spi devices + */ + +test_spi_cc1200: cc1200@0 { + compatible = "ti,cc1200"; + label = "CC1200"; + reg = <0x0>; + spi-max-frequency = <0>; + int-gpios = <&test_gpio 0 0>; + status= "okay"; +}; + +test_spi_cc2520: cc2520@1 { + compatible = "ti,cc2520"; + label = "CC2520"; + reg = <0x1>; + spi-max-frequency = <0>; + vreg-en-gpios = <&test_gpio 0 0>; + reset-gpios = <&test_gpio 0 0>; + fifo-gpios = <&test_gpio 0 0>; + cca-gpios = <&test_gpio 0 0>; + sfd-gpios = <&test_gpio 0 0>; + fifop-gpios = <&test_gpio 0 0>; + status= "okay"; +}; + +test_spi_dw1000: dw1000@2 { + compatible = "decawave,dw1000"; + label = "DW1000"; + reg = <0x2>; + spi-max-frequency = <0>; + int-gpios = <&test_gpio 0 0>; + reset-gpios =<&test_gpio 0 0>; + status= "okay"; +}; + +test_spi_mcr20a: mcr20a@3 { + compatible = "nxp,mcr20a"; + reg = <0x3>; + label = "MCR20A"; + spi-max-frequency = <0>; + irqb-gpios = <&test_gpio 0 0>; + reset-gpios = <&test_gpio 0 0>; + status = "okay"; +}; + +test_spi_rf2xx: rf2xx@4 { + compatible = "atmel,rf2xx"; + reg = <0x4>; + label = "RF2XX"; + spi-max-frequency = <0>; + irq-gpios = <&test_gpio 0 0>; + reset-gpios = <&test_gpio 0 0>; + slptr-gpios = <&test_gpio 0 0>; + dig2-gpios = <&test_gpio 0 0>; + status = "okay"; +}; diff --git a/tests/drivers/build_all/ieee802154/src/main.c b/tests/drivers/build_all/ieee802154/src/main.c new file mode 100644 index 00000000000..b6e9bb25510 --- /dev/null +++ b/tests/drivers/build_all/ieee802154/src/main.c @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2021, Commonwealth Scientific and Industrial Research + * Organisation (CSIRO) ABN 41 687 119 230. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +void main(void) +{ +} + +#if DT_NODE_EXISTS(DT_INST(0, vnd_gpio)) +/* Fake GPIO device, needed for building drivers that use DEVICE_DT_GET() + * to access GPIO controllers. + */ +DEVICE_DT_DEFINE(DT_INST(0, vnd_gpio), NULL, NULL, NULL, NULL, + POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, NULL); +#endif diff --git a/tests/drivers/build_all/ieee802154/testcase.yaml b/tests/drivers/build_all/ieee802154/testcase.yaml new file mode 100644 index 00000000000..555ae3e3b4f --- /dev/null +++ b/tests/drivers/build_all/ieee802154/testcase.yaml @@ -0,0 +1,32 @@ +common: + tags: drivers ieee802154 + build_only: true +tests: + ieee802154.build.external: + platform_allow: native_posix + extra_args: OVERLAY_CONFIG=external.conf + ieee802154.build.cc12xx_cc2520: + platform_allow: cc1352_sensortag + extra_configs: + - CONFIG_IEEE802154_CC13XX_CC26XX=y + - CONFIG_IEEE802154_CC13XX_CC26XX_SUB_GHZ=y + ieee802154.build.kw41z: + platform_allow: frdm_kw41z + extra_configs: + - CONFIG_IEEE802154_KW41Z=y + ieee802154.build.mcr20a: + platform_allow: usb_kw24d512 + extra_configs: + - CONFIG_IEEE802154_MCR20A=y + ieee802154.build.nrf5: + platform_allow: nrf52840dk_nrf52840 + extra_configs: + - CONFIG_IEEE802154_NRF5=y + ieee802154.build.telink_b91: + platform_allow: tlsr9518adk80d + extra_configs: + - CONFIG_IEEE802154_TELINK_B91=y + ieee802154.build.upipe: + platform_allow: qemu_x86 + extra_configs: + - CONFIG_IEEE802154_UPIPE=y