From f9fb4fe234e0965a0c0da43e753114ebc7e78e1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Arg=C3=BCelles?= Date: Thu, 17 Aug 2023 15:27:46 +0700 Subject: [PATCH] tests: gpio: nxp_s32: enable get config/direction tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enable tests using pin_get_config() and port_get_direction() GPIO APIs for NXP S32 boards. Signed-off-by: Manuel Argüelles --- .../boards/s32z270dc2_rtu0_r52.overlay | 24 ++++++++++++ .../boards/s32z270dc2_rtu1_r52.overlay | 24 ++++++++++++ .../gpio/gpio_hogs/boards/mr_canhubk3.overlay | 35 ++++++++++++++++++ .../boards/s32z270dc2_rtu0_r52.overlay | 37 +++++++++++++++++++ .../boards/s32z270dc2_rtu1_r52.overlay | 37 +++++++++++++++++++ tests/drivers/gpio/gpio_hogs/testcase.yaml | 3 ++ 6 files changed, 160 insertions(+) create mode 100644 tests/drivers/gpio/gpio_get_direction/boards/s32z270dc2_rtu0_r52.overlay create mode 100644 tests/drivers/gpio/gpio_get_direction/boards/s32z270dc2_rtu1_r52.overlay create mode 100644 tests/drivers/gpio/gpio_hogs/boards/mr_canhubk3.overlay create mode 100644 tests/drivers/gpio/gpio_hogs/boards/s32z270dc2_rtu0_r52.overlay create mode 100644 tests/drivers/gpio/gpio_hogs/boards/s32z270dc2_rtu1_r52.overlay diff --git a/tests/drivers/gpio/gpio_get_direction/boards/s32z270dc2_rtu0_r52.overlay b/tests/drivers/gpio/gpio_get_direction/boards/s32z270dc2_rtu0_r52.overlay new file mode 100644 index 00000000000..c5cc0a80d1f --- /dev/null +++ b/tests/drivers/gpio/gpio_get_direction/boards/s32z270dc2_rtu0_r52.overlay @@ -0,0 +1,24 @@ +/* + * Copyright 2023 NXP + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +/ { + aliases { + led0 = &led_A3; + }; + + gpio-led { + compatible = "gpio-leds"; + led_A3: led_A3 { + gpios = <&gpioa 3 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&gpioa { + status = "okay"; +}; diff --git a/tests/drivers/gpio/gpio_get_direction/boards/s32z270dc2_rtu1_r52.overlay b/tests/drivers/gpio/gpio_get_direction/boards/s32z270dc2_rtu1_r52.overlay new file mode 100644 index 00000000000..c5cc0a80d1f --- /dev/null +++ b/tests/drivers/gpio/gpio_get_direction/boards/s32z270dc2_rtu1_r52.overlay @@ -0,0 +1,24 @@ +/* + * Copyright 2023 NXP + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +/ { + aliases { + led0 = &led_A3; + }; + + gpio-led { + compatible = "gpio-leds"; + led_A3: led_A3 { + gpios = <&gpioa 3 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&gpioa { + status = "okay"; +}; diff --git a/tests/drivers/gpio/gpio_hogs/boards/mr_canhubk3.overlay b/tests/drivers/gpio/gpio_hogs/boards/mr_canhubk3.overlay new file mode 100644 index 00000000000..82ad2208e72 --- /dev/null +++ b/tests/drivers/gpio/gpio_hogs/boards/mr_canhubk3.overlay @@ -0,0 +1,35 @@ +/* + * Copyright 2023 NXP + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +/ { + zephyr,user { + output-high-gpios = <&gpioa_h 0 GPIO_ACTIVE_LOW>; + output-low-gpios = <&gpioa_h 3 GPIO_ACTIVE_HIGH>; + input-gpios = <&gpioa_h 1 GPIO_ACTIVE_HIGH>; + }; +}; + +&gpioa_h { + hog1 { + gpio-hog; + gpios = <0 GPIO_ACTIVE_LOW>; + output-high; + }; + + hog2 { + gpio-hog; + gpios = <1 GPIO_ACTIVE_HIGH>; + input; + }; + + hog3 { + gpio-hog; + gpios = <3 GPIO_ACTIVE_HIGH>; + output-low; + }; +}; diff --git a/tests/drivers/gpio/gpio_hogs/boards/s32z270dc2_rtu0_r52.overlay b/tests/drivers/gpio/gpio_hogs/boards/s32z270dc2_rtu0_r52.overlay new file mode 100644 index 00000000000..73a30e283cc --- /dev/null +++ b/tests/drivers/gpio/gpio_hogs/boards/s32z270dc2_rtu0_r52.overlay @@ -0,0 +1,37 @@ +/* + * Copyright 2023 NXP + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +/ { + zephyr,user { + output-high-gpios = <&gpioa 0 GPIO_ACTIVE_LOW>; + output-low-gpios = <&gpioa 2 GPIO_ACTIVE_HIGH>; + input-gpios = <&gpioa 1 GPIO_ACTIVE_HIGH>; + }; +}; + +&gpioa { + status = "okay"; + + hog1 { + gpio-hog; + gpios = <0 GPIO_ACTIVE_LOW>; + output-high; + }; + + hog2 { + gpio-hog; + gpios = <1 GPIO_ACTIVE_HIGH>; + input; + }; + + hog3 { + gpio-hog; + gpios = <2 GPIO_ACTIVE_HIGH>; + output-low; + }; +}; diff --git a/tests/drivers/gpio/gpio_hogs/boards/s32z270dc2_rtu1_r52.overlay b/tests/drivers/gpio/gpio_hogs/boards/s32z270dc2_rtu1_r52.overlay new file mode 100644 index 00000000000..73a30e283cc --- /dev/null +++ b/tests/drivers/gpio/gpio_hogs/boards/s32z270dc2_rtu1_r52.overlay @@ -0,0 +1,37 @@ +/* + * Copyright 2023 NXP + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +/ { + zephyr,user { + output-high-gpios = <&gpioa 0 GPIO_ACTIVE_LOW>; + output-low-gpios = <&gpioa 2 GPIO_ACTIVE_HIGH>; + input-gpios = <&gpioa 1 GPIO_ACTIVE_HIGH>; + }; +}; + +&gpioa { + status = "okay"; + + hog1 { + gpio-hog; + gpios = <0 GPIO_ACTIVE_LOW>; + output-high; + }; + + hog2 { + gpio-hog; + gpios = <1 GPIO_ACTIVE_HIGH>; + input; + }; + + hog3 { + gpio-hog; + gpios = <2 GPIO_ACTIVE_HIGH>; + output-low; + }; +}; diff --git a/tests/drivers/gpio/gpio_hogs/testcase.yaml b/tests/drivers/gpio/gpio_hogs/testcase.yaml index 70d49fe5079..6c02bf5f7f1 100644 --- a/tests/drivers/gpio/gpio_hogs/testcase.yaml +++ b/tests/drivers/gpio/gpio_hogs/testcase.yaml @@ -11,6 +11,9 @@ tests: - nrf52840dk_nrf52840 - nucleo_g474re - nrf52_bsim + - mr_canhubk3 + - s32z270dc2_rtu0_r52 + - s32z270dc2_rtu1_r52 integration_platforms: - native_posix - native_posix_64