diff --git a/boards/xtensa/esp32s2_saola/esp32s2_saola_defconfig b/boards/xtensa/esp32s2_saola/esp32s2_saola_defconfig index 9b919996ada..f841cd5ff57 100644 --- a/boards/xtensa/esp32s2_saola/esp32s2_saola_defconfig +++ b/boards/xtensa/esp32s2_saola/esp32s2_saola_defconfig @@ -18,6 +18,9 @@ CONFIG_XTENSA_USE_CORE_CRT1=n CONFIG_PINMUX=y CONFIG_PINMUX_ESP32=y +CONFIG_GPIO=y +CONFIG_GPIO_ESP32=y + CONFIG_GEN_ISR_TABLES=y CONFIG_GEN_IRQ_VECTOR_TABLE=n diff --git a/drivers/gpio/Kconfig.esp32 b/drivers/gpio/Kconfig.esp32 index b78f369f9e8..9ddeb6454d8 100644 --- a/drivers/gpio/Kconfig.esp32 +++ b/drivers/gpio/Kconfig.esp32 @@ -5,7 +5,7 @@ menuconfig GPIO_ESP32 bool "ESP32 GPIO" - depends on SOC_ESP32 + depends on SOC_ESP32 || SOC_ESP32S2 help Enables the ESP32 GPIO driver diff --git a/dts/xtensa/espressif/esp32s2.dtsi b/dts/xtensa/espressif/esp32s2.dtsi index 34ced10d19a..7bd19c46ee3 100644 --- a/dts/xtensa/espressif/esp32s2.dtsi +++ b/dts/xtensa/espressif/esp32s2.dtsi @@ -4,6 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ #include +#include #include / { @@ -52,6 +53,28 @@ compatible = "espressif,esp32-pinmux"; reg = <0x3f409000 0x94>; }; + + gpio0: gpio@3f404000 { + compatible = "espressif,esp32-gpio"; + gpio-controller; + #gpio-cells = <2>; + reg = <0x3f404000 0x800>; + interrupts = ; + interrupt-parent = <&intc>; + label = "GPIO_0"; + ngpios = <32>; /* 0..31 */ + }; + + gpio1: gpio@3f404800 { + compatible = "espressif,esp32-gpio"; + gpio-controller; + #gpio-cells = <2>; + reg = <0x3f404800 0x800>; + interrupts = ; + interrupt-parent = <&intc>; + label = "GPIO_1"; + ngpios = <22>; /* 32..53 */ + }; }; }; diff --git a/soc/xtensa/esp32s2/soc.h b/soc/xtensa/esp32s2/soc.h index f7b7ea89a8f..58b5598317e 100644 --- a/soc/xtensa/esp32s2/soc.h +++ b/soc/xtensa/esp32s2/soc.h @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include