Skip to content

Commit 2c2d12f

Browse files
ZongchunYukartben
authored andcommitted
boards: nxp: imx91_evk: add GPIO support
Add gpio in board yaml file, gpio2 is enabled by default. Add btn and led nodes to ensure the button and blinky samples can work. Add board overlay file for driver test case: gpio_basic_api. Signed-off-by: Zongchun Yu <zongchun.yu@nxp.com>
1 parent 29bf4e7 commit 2c2d12f

File tree

3 files changed

+62
-0
lines changed

3 files changed

+62
-0
lines changed

boards/nxp/imx91_evk/imx91_evk_mimx9131.dts

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include <nxp/nxp_mimx91.dtsi>
1010
#include "imx91_evk-pinctrl.dtsi"
11+
#include <zephyr/dt-bindings/input/input-event-codes.h>
1112

1213
/ {
1314
model = "NXP i.MX91 A55";
@@ -24,6 +25,44 @@
2425
reg = <0x80000000 DT_SIZE_M(1)>;
2526
};
2627

28+
aliases {
29+
led0 = &led_r;
30+
led1 = &led_g;
31+
sw0 = &btn_1;
32+
};
33+
34+
leds {
35+
compatible = "gpio-leds";
36+
led_r: led_r {
37+
label = "LED_R";
38+
gpios = <&gpio2 13 GPIO_ACTIVE_HIGH>;
39+
};
40+
led_g: led_g {
41+
label = "LED_G";
42+
gpios = <&gpio2 4 GPIO_ACTIVE_HIGH>;
43+
};
44+
led_b: led_b {
45+
label = "LED_B";
46+
gpios = <&gpio2 12 GPIO_ACTIVE_HIGH>;
47+
};
48+
};
49+
50+
keys {
51+
compatible = "gpio-keys";
52+
53+
btn_1: btn_1{
54+
label = "BTN1";
55+
gpios = <&gpio2 23 GPIO_ACTIVE_LOW>;
56+
zephyr,code = <INPUT_KEY_0>;
57+
};
58+
59+
btn_2: btn_2{
60+
label = "BTN2";
61+
gpios = <&gpio2 24 GPIO_ACTIVE_LOW>;
62+
zephyr,code = <INPUT_KEY_1>;
63+
};
64+
};
65+
2766
};
2867

2968
&lpuart1 {
@@ -32,3 +71,7 @@
3271
pinctrl-0 = <&uart1_default>;
3372
pinctrl-names = "default";
3473
};
74+
75+
&gpio2{
76+
status = "okay";
77+
};

boards/nxp/imx91_evk/imx91_evk_mimx9131.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ toolchain:
1313
- cross-compile
1414
ram: 1024
1515
supported:
16+
- gpio
1617
- uart
1718
vendor: nxp
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright 2025 NXP
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/{
8+
resources {
9+
compatible = "test-gpio-basic-api";
10+
/*
11+
* Use connector J1001 Pin 8 which connect to EXP_GPIO_IO14 as input
12+
* GPIO, and connector J1001 Pin 33 which connect to EXP_GPIO_IO13 as
13+
* output GPIO, connect these two pins with a Dupont Line.
14+
*/
15+
out-gpios = <&gpio2 13 0>;
16+
in-gpios = <&gpio2 14 0>;
17+
};
18+
};

0 commit comments

Comments
 (0)