Skip to content

Commit

Permalink
tests: drivers: build_all: Add a build_all test for wifi
Browse files Browse the repository at this point in the history
The test targets the following devices at this time.

- atmel,winc1500
- inventek,eswifi
- inventek,eswifi-uart

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
  • Loading branch information
soburi authored and henrikbrixandersen committed Oct 16, 2024
1 parent 3c4789a commit 8c705ca
Show file tree
Hide file tree
Showing 6 changed files with 134 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/drivers/build_all/wifi/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.20.0)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(build_all)

FILE(GLOB app_sources src/*.c)
target_sources(app PRIVATE ${app_sources})
6 changes: 6 additions & 0 deletions tests/drivers/build_all/wifi/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CONFIG_TEST=y
CONFIG_TEST_USERSPACE=y
CONFIG_WIFI=y
CONFIG_GPIO=y
CONFIG_NETWORKING=y
CONFIG_NET_IPV4=y
56 changes: 56 additions & 0 deletions tests/drivers/build_all/wifi/spi_devices.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* Copyright (c) 2024 TOKITA Hiroshi
* SPDX-License-Identifier: Apache-2.0
*/

/ {
test {
#address-cells = <1>;
#size-cells = <1>;

test_gpio: gpio@deadbeef {
compatible = "vnd,gpio";
gpio-controller;
reg = <0xdeadbeef 0x1000>;
#gpio-cells = <0x2>;
status = "okay";
};

test_spi: spi@33334444 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "vnd,spi";
reg = <0x33334444 0x1000>;
status = "okay";
clock-frequency = <2000000>;

/* one entry for every devices at spi.dtsi */
cs-gpios = <&test_gpio 0 0>,
<&test_gpio 0 0>,
<&test_gpio 0 0>,
<&test_gpio 0 0>,
<&test_gpio 0 0>;

test_spi_winc1500: winc1500@0 {
compatible = "atmel,winc1500";
status = "okay";
reg = <0>;
spi-max-frequency = <5000000>;
irq-gpios = <&test_gpio 0 0>;
reset-gpios = <&test_gpio 0 0>;
enable-gpios = <&test_gpio 0 0>;
};

test_spi_eswifi: eswifi@1 {
compatible = "inventek,eswifi";
status = "okay";
reg = <1>;
spi-max-frequency = <2000000>;
resetn-gpios = <&test_gpio 0 0>;
wakeup-gpios = <&test_gpio 0 0>;
boot0-gpios = <&test_gpio 0 0>;
data-gpios = <&test_gpio 0 0>;
};
};
};
};
10 changes: 10 additions & 0 deletions tests/drivers/build_all/wifi/src/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright © 2024 TOKITA Hiroshi
*
* SPDX-License-Identifier: Apache-2.0
*/

int main(void)
{
return 0;
}
22 changes: 22 additions & 0 deletions tests/drivers/build_all/wifi/testcase.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
common:
build_only: true
tags:
- drivers
- wifi
tests:
drivers.wifi.build.spi:
extra_args: DTC_OVERLAY_FILE="spi_devices.overlay"
extra_configs:
- CONFIG_SPI=y
platform_allow:
- native_sim
- native_sim/native/64

drivers.wifi.build.uart:
extra_args: DTC_OVERLAY_FILE="uart_devices.overlay"
extra_configs:
- CONFIG_SERIAL=y
- CONFIG_WIFI_ESWIFI_BUS_UART=y
platform_allow:
- native_sim
- native_sim/native/64
32 changes: 32 additions & 0 deletions tests/drivers/build_all/wifi/uart_devices.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright (c) 2024 TOKITA Hiroshi
* SPDX-License-Identifier: Apache-2.0
*/

/ {
test {
#address-cells = <1>;
#size-cells = <1>;

test_gpio: gpio@deadbeef {
compatible = "vnd,gpio";
gpio-controller;
reg = <0xdeadbeef 0x1000>;
#gpio-cells = <0x2>;
status = "okay";
};

test_uart: uart@55556666 {
compatible = "vnd,serial";
reg = <0x55556666 0x1000>;
status = "okay";

test_uart_eswifi: eswifi-uart {
compatible = "inventek,eswifi-uart";
status = "okay";
wakeup-gpios = <&test_gpio 0 0>;
resetn-gpios = <&test_gpio 0 0>;
};
};
};
};

0 comments on commit 8c705ca

Please sign in to comment.