diff --git a/Kconfig.zephyr b/Kconfig.zephyr index 6243a03fe7dbf9..15427fa82be847 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -594,7 +594,7 @@ if BUILD_OUTPUT_UF2 config BUILD_OUTPUT_UF2_FAMILY_ID string "UF2 device family ID" - default "0x1c5f21b0" if SOC_ESP32 + default "0x1c5f21b0" if SOC_SERIES_ESP32 default "0x621e937a" if SOC_NRF52833_QIAA default "0xada52840" if SOC_NRF52840_QIAA default "0x4fb2d5bd" if SOC_SERIES_IMX_RT diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig index 93216a5aa247ed..5d042c1d4758c0 100644 --- a/arch/xtensa/Kconfig +++ b/arch/xtensa/Kconfig @@ -46,7 +46,7 @@ config XTENSA_USE_CORE_CRT1 config XTENSA_ENABLE_BACKTRACE bool "Backtrace on panic exception" default y - depends on SOC_ESP32 || SOC_FAMILY_INTEL_ADSP + depends on SOC_SERIES_ESP32 || SOC_FAMILY_INTEL_ADSP help Enable this config option to print backtrace on panic exception diff --git a/arch/xtensa/core/coredump.c b/arch/xtensa/core/coredump.c index 55b1a77884e250..8f15ca39c58534 100644 --- a/arch/xtensa/core/coredump.c +++ b/arch/xtensa/core/coredump.c @@ -109,13 +109,13 @@ void arch_coredump_info_dump(const z_arch_esf_t *esf) #if CONFIG_SOC_XTENSA_SAMPLE_CONTROLLER arch_blk.soc = XTENSA_SOC_SAMPLE_CONTROLLER; - #elif CONFIG_SOC_ESP32 - arch_blk.soc = XTENSA_SOC_ESP32; #elif CONFIG_SOC_FAMILY_INTEL_ADSP arch_blk.soc = XTENSA_SOC_INTEL_ADSP; - #elif CONFIG_SOC_ESP32S2 + #elif CONFIG_SOC_SERIES_ESP32 + arch_blk.soc = XTENSA_SOC_ESP32; + #elif CONFIG_SOC_SERIES_ESP32S2 arch_blk.soc = XTENSA_SOC_ESP32S2; - #elif CONFIG_SOC_ESP32S3 + #elif CONFIG_SOC_SERIES_ESP32S3 arch_blk.soc = XTENSA_SOC_ESP32S3; #else arch_blk.soc = XTENSA_SOC_UNKNOWN; diff --git a/arch/xtensa/core/xtensa_backtrace.c b/arch/xtensa/core/xtensa_backtrace.c index 9b5af2e8753e1f..4f767f6904235d 100644 --- a/arch/xtensa/core/xtensa_backtrace.c +++ b/arch/xtensa/core/xtensa_backtrace.c @@ -7,7 +7,7 @@ #include "xtensa/corebits.h" #include "xtensa_backtrace.h" #include -#if defined(CONFIG_SOC_ESP32) +#if defined(CONFIG_SOC_SERIES_ESP32) #include "soc/soc_memory_layout.h" #elif defined(CONFIG_SOC_FAMILY_INTEL_ADSP) #include "debug_helpers.h" @@ -34,7 +34,7 @@ static inline uint32_t z_xtensa_cpu_process_stack_pc(uint32_t pc) static inline bool z_xtensa_stack_ptr_is_sane(uint32_t sp) { -#if defined(CONFIG_SOC_ESP32) +#if defined(CONFIG_SOC_SERIES_ESP32) return esp_stack_ptr_is_sane(sp); #elif defined(CONFIG_SOC_FAMILY_INTEL_ADSP) return intel_adsp_ptr_is_sane(sp); @@ -45,7 +45,7 @@ static inline bool z_xtensa_stack_ptr_is_sane(uint32_t sp) static inline bool z_xtensa_ptr_executable(const void *p) { -#if defined(CONFIG_SOC_ESP32) +#if defined(CONFIG_SOC_SERIES_ESP32) return esp_ptr_executable(p); #elif defined(CONFIG_SOC_FAMILY_INTEL_ADSP) return intel_adsp_ptr_executable(p); diff --git a/boards/deprecated.cmake b/boards/deprecated.cmake index 9bf260f443d3bf..f238347203a8cd 100644 --- a/boards/deprecated.cmake +++ b/boards/deprecated.cmake @@ -20,3 +20,4 @@ set(nrf9160_innblue21ns_DEPRECATED nrf9160_innblue21_ns) set(nrf9160_innblue22ns_DEPRECATED nrf9160_innblue22_ns) set(sparkfun_thing_plus_nrf9160ns_DEPRECATED sparkfun_thing_plus_nrf9160_ns) set(thingy53_nrf5340_cpuappns_DEPRECATED thingy53_nrf5340_cpuapp_ns) +set(esp32_DEPRECATED esp32_devkitc_wrover) diff --git a/boards/riscv/esp32c3_devkitm/Kconfig.board b/boards/riscv/esp32c3_devkitm/Kconfig.board index 3a4d97f35236ec..51f0f3957df987 100644 --- a/boards/riscv/esp32c3_devkitm/Kconfig.board +++ b/boards/riscv/esp32c3_devkitm/Kconfig.board @@ -5,4 +5,8 @@ config BOARD_ESP32C3_DEVKITM bool "ESP32C3 Devkit-M Board" - depends on SOC_ESP32C3 + depends on SOC_SERIES_ESP32C3 + +choice SOC_PART_NUMBER + default SOC_ESP32C3_MINI_N4 +endchoice diff --git a/boards/riscv/esp32c3_devkitm/esp32c3_devkitm.dts b/boards/riscv/esp32c3_devkitm/esp32c3_devkitm.dts index 1e4a534df2aebf..4072136524a1b6 100644 --- a/boards/riscv/esp32c3_devkitm/esp32c3_devkitm.dts +++ b/boards/riscv/esp32c3_devkitm/esp32c3_devkitm.dts @@ -6,7 +6,7 @@ /dts-v1/; -#include +#include #include "esp32c3_devkitm-pinctrl.dtsi" / { diff --git a/boards/riscv/esp32c3_devkitm/esp32c3_devkitm_defconfig b/boards/riscv/esp32c3_devkitm/esp32c3_devkitm_defconfig index 080bd50908d835..1ca521d9d95915 100644 --- a/boards/riscv/esp32c3_devkitm/esp32c3_devkitm_defconfig +++ b/boards/riscv/esp32c3_devkitm/esp32c3_devkitm_defconfig @@ -1,11 +1,11 @@ # SPDX-License-Identifier: Apache-2.0 CONFIG_BOARD_ESP32C3_DEVKITM=y -CONFIG_SOC_ESP32C3=y +CONFIG_SOC_SERIES_ESP32C3=y + CONFIG_MAIN_STACK_SIZE=2048 -CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000 + CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y CONFIG_GPIO=y -CONFIG_CLOCK_CONTROL=y diff --git a/boards/riscv/icev_wireless/icev_wireless.dts b/boards/riscv/icev_wireless/icev_wireless.dts index a88ec3e2310ecf..88dc0e33834861 100644 --- a/boards/riscv/icev_wireless/icev_wireless.dts +++ b/boards/riscv/icev_wireless/icev_wireless.dts @@ -6,7 +6,7 @@ /dts-v1/; -#include +#include #include "icev_wireless-pinctrl.dtsi" / { diff --git a/boards/riscv/icev_wireless/icev_wireless_defconfig b/boards/riscv/icev_wireless/icev_wireless_defconfig index 78e4586e086409..c5be5732a71be9 100644 --- a/boards/riscv/icev_wireless/icev_wireless_defconfig +++ b/boards/riscv/icev_wireless/icev_wireless_defconfig @@ -1,11 +1,11 @@ # SPDX-License-Identifier: Apache-2.0 CONFIG_BOARD_ICEV_WIRELESS=y -CONFIG_SOC_ESP32C3=y +CONFIG_SOC_SERIES_ESP32C3=y + CONFIG_MAIN_STACK_SIZE=2048 -CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000 + CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y CONFIG_GPIO=y -CONFIG_CLOCK_CONTROL=y diff --git a/boards/riscv/stamp_c3/Kconfig.board b/boards/riscv/stamp_c3/Kconfig.board index 314bbeb0ce7d7c..09ec15d6348295 100644 --- a/boards/riscv/stamp_c3/Kconfig.board +++ b/boards/riscv/stamp_c3/Kconfig.board @@ -5,4 +5,8 @@ config BOARD_STAMP_C3 bool "M5Stack STAMP-C3 Board" - depends on SOC_ESP32C3 + depends on SOC_SERIES_ESP32C3 + +choice SOC_PART_NUMBER + default SOC_ESP32C3_FX4 +endchoice diff --git a/boards/riscv/stamp_c3/stamp_c3.dts b/boards/riscv/stamp_c3/stamp_c3.dts index 25bc93992e747e..27e7a2fe1f626e 100644 --- a/boards/riscv/stamp_c3/stamp_c3.dts +++ b/boards/riscv/stamp_c3/stamp_c3.dts @@ -6,7 +6,7 @@ /dts-v1/; -#include +#include #include "stamp_c3-pinctrl.dtsi" / { diff --git a/boards/riscv/stamp_c3/stamp_c3_defconfig b/boards/riscv/stamp_c3/stamp_c3_defconfig index 56515384f21fd9..3b5efc64fa11f1 100644 --- a/boards/riscv/stamp_c3/stamp_c3_defconfig +++ b/boards/riscv/stamp_c3/stamp_c3_defconfig @@ -1,12 +1,13 @@ # SPDX-License-Identifier: Apache-2.0 CONFIG_BOARD_STAMP_C3=y -CONFIG_SOC_ESP32C3=y +CONFIG_SOC_SERIES_ESP32C3=y + CONFIG_MAIN_STACK_SIZE=2048 + CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=1000000 -CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000 + CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y CONFIG_GPIO=y -CONFIG_CLOCK_CONTROL=y diff --git a/boards/riscv/xiao_esp32c3/Kconfig.board b/boards/riscv/xiao_esp32c3/Kconfig.board index 28d520d15750c0..f8a7e0ecb5b2ac 100644 --- a/boards/riscv/xiao_esp32c3/Kconfig.board +++ b/boards/riscv/xiao_esp32c3/Kconfig.board @@ -3,4 +3,8 @@ config BOARD_XIAO_ESP32C3 bool "XIAO ESP32C3 Board" - depends on SOC_ESP32C3 + depends on SOC_SERIES_ESP32C3 + +choice SOC_PART_NUMBER + default SOC_ESP32C3_FX4 +endchoice diff --git a/boards/riscv/xiao_esp32c3/xiao_esp32c3.dts b/boards/riscv/xiao_esp32c3/xiao_esp32c3.dts index 31d88a0d3aac14..45823b069c8b8a 100644 --- a/boards/riscv/xiao_esp32c3/xiao_esp32c3.dts +++ b/boards/riscv/xiao_esp32c3/xiao_esp32c3.dts @@ -6,7 +6,7 @@ /dts-v1/; -#include +#include #include "xiao_esp32c3-pinctrl.dtsi" #include "seeed_xiao_connector.dtsi" diff --git a/boards/riscv/xiao_esp32c3/xiao_esp32c3_defconfig b/boards/riscv/xiao_esp32c3/xiao_esp32c3_defconfig index 28204464d8130c..0dc868fa60a934 100644 --- a/boards/riscv/xiao_esp32c3/xiao_esp32c3_defconfig +++ b/boards/riscv/xiao_esp32c3/xiao_esp32c3_defconfig @@ -1,11 +1,11 @@ # SPDX-License-Identifier: Apache-2.0 CONFIG_BOARD_XIAO_ESP32C3=y -CONFIG_SOC_ESP32C3=y +CONFIG_SOC_SERIES_ESP32C3=y + CONFIG_MAIN_STACK_SIZE=2048 -CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000 + CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y CONFIG_GPIO=y -CONFIG_CLOCK_CONTROL=y diff --git a/boards/xtensa/esp32/Kconfig.board b/boards/xtensa/esp32/Kconfig.board deleted file mode 100644 index c6b85318c7c24a..00000000000000 --- a/boards/xtensa/esp32/Kconfig.board +++ /dev/null @@ -1,8 +0,0 @@ -# ESP32 board configuration - -# Copyright (c) 2017 Intel Corporation -# SPDX-License-Identifier: Apache-2.0 - -config BOARD_ESP32 - bool "ESP32 Development Board" - depends on SOC_ESP32 diff --git a/boards/xtensa/esp32/esp32_defconfig b/boards/xtensa/esp32/esp32_defconfig deleted file mode 100644 index 099b0c850c5182..00000000000000 --- a/boards/xtensa/esp32/esp32_defconfig +++ /dev/null @@ -1,21 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 - -CONFIG_XTENSA_RESET_VECTOR=n - -CONFIG_BOARD_ESP32=y -CONFIG_SOC_ESP32=y - -CONFIG_MAIN_STACK_SIZE=2048 - -CONFIG_CONSOLE=y -CONFIG_SERIAL=y -CONFIG_UART_CONSOLE=y - -CONFIG_XTENSA_USE_CORE_CRT1=n - -CONFIG_GPIO=y - -CONFIG_GEN_ISR_TABLES=y -CONFIG_GEN_IRQ_VECTOR_TABLE=n - -CONFIG_CLOCK_CONTROL=y diff --git a/boards/xtensa/esp32_devkitc_wroom/Kconfig.board b/boards/xtensa/esp32_devkitc_wroom/Kconfig.board new file mode 100644 index 00000000000000..5c3fa887b57553 --- /dev/null +++ b/boards/xtensa/esp32_devkitc_wroom/Kconfig.board @@ -0,0 +1,10 @@ +# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_ESP32_DEVKITC_WROOM + bool "ESP32-DEVKITC-WROOM Development Board" + depends on SOC_SERIES_ESP32 + +choice SOC_PART_NUMBER + default SOC_ESP32_WROOM_32UE_N4 +endchoice diff --git a/boards/xtensa/esp32/Kconfig.defconfig b/boards/xtensa/esp32_devkitc_wroom/Kconfig.defconfig similarity index 81% rename from boards/xtensa/esp32/Kconfig.defconfig rename to boards/xtensa/esp32_devkitc_wroom/Kconfig.defconfig index c2880e62d4904f..cf2cb4403a164d 100644 --- a/boards/xtensa/esp32/Kconfig.defconfig +++ b/boards/xtensa/esp32_devkitc_wroom/Kconfig.defconfig @@ -4,8 +4,8 @@ # SPDX-License-Identifier: Apache-2.0 config BOARD - default "esp32" - depends on BOARD_ESP32 + default "esp32_devkitc_wroom" + depends on BOARD_ESP32_DEVKITC_WROOM config ENTROPY_GENERATOR default y diff --git a/boards/xtensa/esp32/Kconfig.sysbuild b/boards/xtensa/esp32_devkitc_wroom/Kconfig.sysbuild similarity index 100% rename from boards/xtensa/esp32/Kconfig.sysbuild rename to boards/xtensa/esp32_devkitc_wroom/Kconfig.sysbuild diff --git a/boards/xtensa/esp32/board.cmake b/boards/xtensa/esp32_devkitc_wroom/board.cmake similarity index 85% rename from boards/xtensa/esp32/board.cmake rename to boards/xtensa/esp32_devkitc_wroom/board.cmake index 2f04d1fe8861ea..ad53de11770bda 100644 --- a/boards/xtensa/esp32/board.cmake +++ b/boards/xtensa/esp32_devkitc_wroom/board.cmake @@ -1,8 +1,10 @@ +# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. # SPDX-License-Identifier: Apache-2.0 if(NOT "${OPENOCD}" MATCHES "^${ESPRESSIF_TOOLCHAIN_PATH}/.*") set(OPENOCD OPENOCD-NOTFOUND) endif() + find_program(OPENOCD openocd PATHS ${ESPRESSIF_TOOLCHAIN_PATH}/openocd-esp32/bin NO_DEFAULT_PATH) include(${ZEPHYR_BASE}/boards/common/esp32.board.cmake) diff --git a/boards/xtensa/esp32_devkitc_wroom/doc/img/esp32_devkitc_wroom.jpg b/boards/xtensa/esp32_devkitc_wroom/doc/img/esp32_devkitc_wroom.jpg new file mode 100644 index 00000000000000..2b8317e29ebb24 Binary files /dev/null and b/boards/xtensa/esp32_devkitc_wroom/doc/img/esp32_devkitc_wroom.jpg differ diff --git a/boards/xtensa/esp32_devkitc_wroom/doc/index.rst b/boards/xtensa/esp32_devkitc_wroom/doc/index.rst new file mode 100644 index 00000000000000..b8856c7b3cb9a9 --- /dev/null +++ b/boards/xtensa/esp32_devkitc_wroom/doc/index.rst @@ -0,0 +1,209 @@ +.. _esp32_devkitc_wroom: + +ESP32-DEVKITC-WROOM +################### + +Overview +******** + +ESP32-DEVKITC-WROOM is a series of low cost, low power system on a chip microcontrollers +with integrated Wi-Fi & dual-mode Bluetooth. The ESP32 series employs a +Tensilica Xtensa LX6 microprocessor in both dual-core and single-core +variations. ESP32-WROOM is created and developed by Espressif Systems, a +Shanghai-based Chinese company, and is manufactured by TSMC using their 40nm +process. [1]_ + +The features include the following: + +- Dual core Xtensa microprocessor (LX6), running at 160 or 240MHz +- 520KB of SRAM +- 802.11b/g/n/e/i +- Bluetooth v4.2 BR/EDR and BLE +- Various peripherals: + + - 12-bit ADC with up to 18 channels + - 2x 8-bit DACs + - 10x touch sensors + - Temperature sensor + - 4x SPI + - 2x I2S + - 2x I2C + - 3x UART + - SD/SDIO/MMC host + - Slave (SDIO/SPI) + - Ethernet MAC + - CAN bus 2.0 + - IR (RX/TX) + - Motor PWM + - LED PWM with up to 16 channels + - Hall effect sensor + +- Cryptographic hardware acceleration (RNG, ECC, RSA, SHA-2, AES) +- 5uA deep sleep current + +.. figure:: img/esp32_devkitc_wroom.jpg + :align: center + :alt: ESP32-DEVKITC-WROOM + + ESP32-DevKitC-WROOM-32D DK + +Supported Features +================== + +Current Zephyr's ESP32-WROOM board supports the following features: + ++------------+------------+-------------------------------------+ +| Interface | Controller | Driver/Component | ++============+============+=====================================+ ++------------+------------+-------------------------------------+ +| UART | on-chip | serial port | ++------------+------------+-------------------------------------+ +| GPIO | on-chip | gpio | ++------------+------------+-------------------------------------+ +| PINMUX | on-chip | pinmux | ++------------+------------+-------------------------------------+ +| USB-JTAG | on-chip | hardware interface | ++------------+------------+-------------------------------------+ +| SPI Master | on-chip | spi | ++------------+------------+-------------------------------------+ +| Timers | on-chip | counter | ++------------+------------+-------------------------------------+ +| Watchdog | on-chip | watchdog | ++------------+------------+-------------------------------------+ +| TRNG | on-chip | entropy | ++------------+------------+-------------------------------------+ +| LEDC | on-chip | pwm | ++------------+------------+-------------------------------------+ +| MCPWM | on-chip | pwm | ++------------+------------+-------------------------------------+ +| PCNT | on-chip | qdec | ++------------+------------+-------------------------------------+ +| SPI DMA | on-chip | spi | ++------------+------------+-------------------------------------+ +| TWAI | on-chip | can | ++------------+------------+-------------------------------------+ +| ADC | on-chip | adc | ++------------+------------+-------------------------------------+ +| DAC | on-chip | dac | ++------------+------------+-------------------------------------+ +| Wi-Fi | on-chip | | ++------------+------------+-------------------------------------+ +| Bluetooth | on-chip | | ++------------+------------+-------------------------------------+ + +System requirements +=================== + +Prerequisites +------------- + +Espressif HAL requires WiFi and Bluetooth binary blobs in order work. Run the command +below to retrieve those files. + +.. code-block:: console + + west blobs fetch hal_espressif + +.. note:: + + It is recommended running the command above after :file:`west update`. + +Building & Flashing +------------------- + +Build and flash applications as usual (see :ref:`build_an_application` and +:ref:`application_run` for more details). + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: esp32_devkitc_wroom + :goals: build + +The usual ``flash`` target will work with the ``esp32_devkitc_wroom`` board +configuration. Here is an example for the :ref:`hello_world` +application. + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: esp32_devkitc_wroom + :goals: flash + +Open the serial monitor using the following command: + +.. code-block:: shell + + west espressif monitor + +After the board has automatically reset and booted, you should see the following +message in the monitor: + +.. code-block:: console + + ***** Booting Zephyr OS vx.x.x-xxx-gxxxxxxxxxxxx ***** + Hello World! esp32_devkitc_wroom + +Debugging +--------- + +ESP32-DEVKITC-WROOM support on OpenOCD is available upstream as of version 0.12.0. +Download and install OpenOCD from `OpenOCD`_. + +On the ESP-WROOM-32 DevKitC board, the JTAG pins are not run to a +standard connector (e.g. ARM 20-pin) and need to be manually connected +to the external programmer (e.g. a Flyswatter2): + ++------------+-----------+ +| ESP32 pin | JTAG pin | ++============+===========+ +| 3V3 | VTRef | ++------------+-----------+ +| EN | nTRST | ++------------+-----------+ +| IO14 | TMS | ++------------+-----------+ +| IO12 | TDI | ++------------+-----------+ +| GND | GND | ++------------+-----------+ +| IO13 | TCK | ++------------+-----------+ +| IO15 | TDO | ++------------+-----------+ + +Further documentation can be obtained from the SoC vendor in `JTAG debugging +for ESP32`_. + +Here is an example for building the :ref:`hello_world` application. + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: esp32_devkitc_wroom + :goals: build flash + +You can debug an application in the usual way. Here is an example for the :ref:`hello_world` application. + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: esp32_devkitc_wroom + :goals: debug + +Note on Debugging with GDB Stub +=============================== + +GDB stub is enabled on ESP32. + +* When adding breakpoints, please use hardware breakpoints with command + ``hbreak``. Command ``break`` uses software breakpoints which requires + modifying memory content to insert break/trap instructions. + This does not work as the code is on flash which cannot be randomly + accessed for modification. + +.. _`JTAG debugging for ESP32`: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/jtag-debugging/index.html +.. _`OpenOCD`: https://github.com/openocd-org/openocd + +References +********** + +.. [1] https://en.wikipedia.org/wiki/ESP32 +.. _ESP32 Technical Reference Manual: https://espressif.com/sites/default/files/documentation/esp32_technical_reference_manual_en.pdf +.. _Hardware Reference: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/hw-reference/index.html diff --git a/boards/xtensa/esp32/esp32-pinctrl.dtsi b/boards/xtensa/esp32_devkitc_wroom/esp32_devkitc_wroom-pinctrl.dtsi similarity index 100% rename from boards/xtensa/esp32/esp32-pinctrl.dtsi rename to boards/xtensa/esp32_devkitc_wroom/esp32_devkitc_wroom-pinctrl.dtsi diff --git a/boards/xtensa/esp32_devkitc_wroom/esp32_devkitc_wroom.dts b/boards/xtensa/esp32_devkitc_wroom/esp32_devkitc_wroom.dts new file mode 100644 index 00000000000000..c1849a0646703c --- /dev/null +++ b/boards/xtensa/esp32_devkitc_wroom/esp32_devkitc_wroom.dts @@ -0,0 +1,160 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ +/dts-v1/; + +#include +#include "esp32_devkitc_wroom-pinctrl.dtsi" + +/ { + model = "Espressif ESP32-DEVKITC-WROOM-32D"; + compatible = "espressif,esp32"; + + aliases { + uart-0 = &uart0; + i2c-0 = &i2c0; + sw0 = &button0; + watchdog0 = &wdt0; + }; + + buttons { + compatible = "gpio-keys"; + button0: button_0 { + gpios = <&gpio0 0 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + label = "BOOT Button"; + }; + }; + + chosen { + zephyr,sram = &sram0; + zephyr,console = &uart0; + zephyr,shell-uart = &uart0; + zephyr,flash = &flash0; + }; +}; + +&cpu0 { + clock-frequency = ; + cpu-power-states = <&light_sleep &deep_sleep>; +}; + +&cpu1 { + clock-frequency = ; +}; + +&uart0 { + status = "okay"; + current-speed = <115200>; + pinctrl-0 = <&uart0_default>; + pinctrl-names = "default"; +}; + +&uart1 { + current-speed = <115200>; + pinctrl-0 = <&uart1_default>; + pinctrl-names = "default"; +}; + +&uart2 { + current-speed = <115200>; + pinctrl-0 = <&uart2_default>; + pinctrl-names = "default"; +}; + +&gpio0 { + status = "okay"; +}; + +&gpio1 { + status = "okay"; +}; + +&i2c0 { + status = "okay"; + clock-frequency = ; + sda-gpios = <&gpio0 21 GPIO_OPEN_DRAIN>; + scl-gpios = <&gpio0 22 GPIO_OPEN_DRAIN>; + pinctrl-0 = <&i2c0_default>; + pinctrl-names = "default"; +}; + +&spi2 { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + pinctrl-0 = <&spim2_default>; + pinctrl-names = "default"; +}; + +&spi3 { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + pinctrl-0 = <&spim3_default>; + pinctrl-names = "default"; +}; + +&timer0 { + status = "disabled"; +}; + +&timer1 { + status = "disabled"; +}; + +&timer2 { + status = "disabled"; +}; + +&timer3 { + status = "disabled"; +}; + +&trng0 { + status = "okay"; +}; + +&psram0 { + status = "disabled"; +}; + +&flash0 { + status = "okay"; + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* Reserve 60kB for the bootloader */ + boot_partition: partition@1000 { + label = "mcuboot"; + reg = <0x00001000 0x0000F000>; + read-only; + }; + + /* Reserve 1024kB for the application in slot 0 */ + slot0_partition: partition@10000 { + label = "image-0"; + reg = <0x00010000 0x00100000>; + }; + + /* Reserve 1024kB for the application in slot 1 */ + slot1_partition: partition@110000 { + label = "image-1"; + reg = <0x00110000 0x00100000>; + }; + + /* Reserve 256kB for the scratch partition */ + scratch_partition: partition@210000 { + label = "image-scratch"; + reg = <0x00210000 0x00040000>; + }; + + storage_partition: partition@250000 { + label = "storage"; + reg = <0x00250000 0x00006000>; + }; + }; +}; diff --git a/boards/xtensa/esp32/esp32.yaml b/boards/xtensa/esp32_devkitc_wroom/esp32_devkitc_wroom.yaml similarity index 77% rename from boards/xtensa/esp32/esp32.yaml rename to boards/xtensa/esp32_devkitc_wroom/esp32_devkitc_wroom.yaml index 7ec642ad72e2d3..4a937b09491a70 100644 --- a/boards/xtensa/esp32/esp32.yaml +++ b/boards/xtensa/esp32_devkitc_wroom/esp32_devkitc_wroom.yaml @@ -1,5 +1,5 @@ -identifier: esp32 -name: ESP-32 +identifier: esp32_devkitc_wroom +name: ESP32-DevkitC-WROOM-32D type: mcu arch: xtensa toolchain: diff --git a/boards/xtensa/esp32_devkitc_wroom/esp32_devkitc_wroom_defconfig b/boards/xtensa/esp32_devkitc_wroom/esp32_devkitc_wroom_defconfig new file mode 100644 index 00000000000000..ead6203b86e595 --- /dev/null +++ b/boards/xtensa/esp32_devkitc_wroom/esp32_devkitc_wroom_defconfig @@ -0,0 +1,13 @@ +# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_BOARD_ESP32_DEVKITC_WROOM=y +CONFIG_SOC_SERIES_ESP32=y + +CONFIG_MAIN_STACK_SIZE=2048 + +CONFIG_CONSOLE=y +CONFIG_SERIAL=y +CONFIG_UART_CONSOLE=y + +CONFIG_GPIO=y diff --git a/boards/xtensa/esp32/support/openocd.cfg b/boards/xtensa/esp32_devkitc_wroom/support/openocd.cfg similarity index 100% rename from boards/xtensa/esp32/support/openocd.cfg rename to boards/xtensa/esp32_devkitc_wroom/support/openocd.cfg diff --git a/boards/xtensa/esp32_devkitc_wrover/Kconfig.board b/boards/xtensa/esp32_devkitc_wrover/Kconfig.board new file mode 100644 index 00000000000000..b345a9dff448b2 --- /dev/null +++ b/boards/xtensa/esp32_devkitc_wrover/Kconfig.board @@ -0,0 +1,10 @@ +# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_ESP32_DEVKITC_WROVER + bool "ESP32-DEVKITC-WROVER-E Development board" + depends on SOC_SERIES_ESP32 + +choice SOC_PART_NUMBER + default SOC_ESP32_WROVER_E_N4R8 +endchoice diff --git a/boards/xtensa/esp32_devkitc_wrover/Kconfig.defconfig b/boards/xtensa/esp32_devkitc_wrover/Kconfig.defconfig new file mode 100644 index 00000000000000..8b977af6943657 --- /dev/null +++ b/boards/xtensa/esp32_devkitc_wrover/Kconfig.defconfig @@ -0,0 +1,18 @@ +# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. +# SPDX-License-Identifier: Apache-2.0 + +config BOARD + default "esp32_devkitc_wrover" + depends on BOARD_ESP32_DEVKITC_WROVER + +config ENTROPY_GENERATOR + default y + +config HEAP_MEM_POOL_SIZE + default 98304 if WIFI + default 40960 if BT + default 4096 + +choice BT_HCI_BUS_TYPE + default BT_ESP32 if BT +endchoice diff --git a/boards/xtensa/esp32_devkitc_wrover/Kconfig.sysbuild b/boards/xtensa/esp32_devkitc_wrover/Kconfig.sysbuild new file mode 100644 index 00000000000000..3a2d17ac5cfd06 --- /dev/null +++ b/boards/xtensa/esp32_devkitc_wrover/Kconfig.sysbuild @@ -0,0 +1,10 @@ +# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. +# SPDX-License-Identifier: Apache-2.0 + +choice BOOTLOADER + default BOOTLOADER_MCUBOOT +endchoice + +choice BOOT_SIGNATURE_TYPE + default BOOT_SIGNATURE_TYPE_NONE +endchoice diff --git a/boards/xtensa/esp32_devkitc_wrover/board.cmake b/boards/xtensa/esp32_devkitc_wrover/board.cmake new file mode 100644 index 00000000000000..ad53de11770bda --- /dev/null +++ b/boards/xtensa/esp32_devkitc_wrover/board.cmake @@ -0,0 +1,11 @@ +# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. +# SPDX-License-Identifier: Apache-2.0 + +if(NOT "${OPENOCD}" MATCHES "^${ESPRESSIF_TOOLCHAIN_PATH}/.*") + set(OPENOCD OPENOCD-NOTFOUND) +endif() + +find_program(OPENOCD openocd PATHS ${ESPRESSIF_TOOLCHAIN_PATH}/openocd-esp32/bin NO_DEFAULT_PATH) + +include(${ZEPHYR_BASE}/boards/common/esp32.board.cmake) +include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) diff --git a/boards/xtensa/esp32_devkitc_wrover/doc/img/esp32_devkitc_wrover.jpg b/boards/xtensa/esp32_devkitc_wrover/doc/img/esp32_devkitc_wrover.jpg new file mode 100644 index 00000000000000..9515257dd9a0e1 Binary files /dev/null and b/boards/xtensa/esp32_devkitc_wrover/doc/img/esp32_devkitc_wrover.jpg differ diff --git a/boards/xtensa/esp32/doc/index.rst b/boards/xtensa/esp32_devkitc_wrover/doc/index.rst similarity index 95% rename from boards/xtensa/esp32/doc/index.rst rename to boards/xtensa/esp32_devkitc_wrover/doc/index.rst index 6a6b16172be14a..e749ac4082634d 100644 --- a/boards/xtensa/esp32/doc/index.rst +++ b/boards/xtensa/esp32_devkitc_wrover/doc/index.rst @@ -1,7 +1,7 @@ -.. _esp32: +.. _esp32_devkitc_wrover: -ESP32 -##### +ESP32-DEVKITC-WROVER +#################### Overview ******** @@ -41,6 +41,12 @@ The features include the following: - Cryptographic hardware acceleration (RNG, ECC, RSA, SHA-2, AES) - 5uA deep sleep current +.. figure:: img/esp32_devkitc_wrover.jpg + :align: center + :alt: ESP32-DEVKITC-WROVER + + ESP32-DevKitC-WROVER-IE + Supported Features ================== @@ -142,7 +148,7 @@ To build the sample application using sysbuild use the command: .. zephyr-app-commands:: :tool: west :app: samples/hello_world - :board: esp32 + :board: esp32_devkitc_wrover :goals: build :west-args: --sysbuild :compact: @@ -191,16 +197,16 @@ Build and flash applications as usual (see :ref:`build_an_application` and .. zephyr-app-commands:: :zephyr-app: samples/hello_world - :board: esp32 + :board: esp32_devkitc_wrover :goals: build -The usual ``flash`` target will work with the ``esp32`` board +The usual ``flash`` target will work with the ``esp32_devkitc_wrover`` board configuration. Here is an example for the :ref:`hello_world` application. .. zephyr-app-commands:: :zephyr-app: samples/hello_world - :board: esp32 + :board: esp32_devkitc_wrover :goals: flash Open the serial monitor using the following command: @@ -215,7 +221,7 @@ message in the monitor: .. code-block:: console ***** Booting Zephyr OS vx.x.x-xxx-gxxxxxxxxxxxx ***** - Hello World! esp32 + Hello World! esp32_devkitc_wrover Debugging ********* @@ -252,14 +258,14 @@ Here is an example for building the :ref:`hello_world` application. .. zephyr-app-commands:: :zephyr-app: samples/hello_world - :board: esp32 + :board: esp32_devkitc_wrover :goals: build flash You can debug an application in the usual way. Here is an example for the :ref:`hello_world` application. .. zephyr-app-commands:: :zephyr-app: samples/hello_world - :board: esp32 + :board: esp32_devkitc_wrover :goals: debug Note on Debugging with GDB Stub diff --git a/boards/xtensa/esp32_devkitc_wrover/esp32_devkitc_wrover-pinctrl.dtsi b/boards/xtensa/esp32_devkitc_wrover/esp32_devkitc_wrover-pinctrl.dtsi new file mode 100644 index 00000000000000..f4f51cce98aecd --- /dev/null +++ b/boards/xtensa/esp32_devkitc_wrover/esp32_devkitc_wrover-pinctrl.dtsi @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2022 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include + +&pinctrl { + + uart0_default: uart0_default { + group1 { + pinmux = ; + output-high; + }; + group2 { + pinmux = ; + bias-pull-up; + }; + }; + + uart1_default: uart1_default { + group1 { + pinmux = ; + }; + group2 { + pinmux = ; + bias-pull-up; + }; + }; + + uart2_default: uart2_default { + group1 { + pinmux = ; + }; + group2 { + pinmux = ; + bias-pull-up; + }; + }; + + spim2_default: spim2_default { + group1 { + pinmux = , + , + ; + }; + group2 { + pinmux = ; + output-low; + }; + }; + + spim3_default: spim3_default { + group1 { + pinmux = , + , + ; + }; + group2 { + pinmux = ; + output-low; + }; + }; + + i2c0_default: i2c0_default { + group1 { + pinmux = , + ; + bias-pull-up; + drive-open-drain; + output-high; + }; + }; +}; diff --git a/boards/xtensa/esp32/esp32.dts b/boards/xtensa/esp32_devkitc_wrover/esp32_devkitc_wrover.dts similarity index 92% rename from boards/xtensa/esp32/esp32.dts rename to boards/xtensa/esp32_devkitc_wrover/esp32_devkitc_wrover.dts index 3d61902581a20b..87959ed0b98bcf 100644 --- a/boards/xtensa/esp32/esp32.dts +++ b/boards/xtensa/esp32_devkitc_wrover/esp32_devkitc_wrover.dts @@ -1,15 +1,15 @@ /* - * Copyright (c) 2019 Intel Corporation. + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. * * SPDX-License-Identifier: Apache-2.0 */ /dts-v1/; -#include -#include "esp32-pinctrl.dtsi" +#include +#include "esp32_devkitc_wrover-pinctrl.dtsi" / { - model = "esp32"; + model = "Espressif ESP32-DEVKITC-WROVER-E"; compatible = "espressif,esp32"; aliases { diff --git a/boards/xtensa/esp32_devkitc_wrover/esp32_devkitc_wrover.yaml b/boards/xtensa/esp32_devkitc_wrover/esp32_devkitc_wrover.yaml new file mode 100644 index 00000000000000..3680afba27aacf --- /dev/null +++ b/boards/xtensa/esp32_devkitc_wrover/esp32_devkitc_wrover.yaml @@ -0,0 +1,23 @@ +identifier: esp32_devkitc_wrover +name: ESP32-DevkitC-WROVER-E +type: mcu +arch: xtensa +toolchain: + - zephyr +supported: + - adc + - dac + - gpio + - i2c + - watchdog + - uart + - nvs + - pwm + - dac + - spi + - counter + - entropy +testing: + ignore_tags: + - net + - bluetooth diff --git a/boards/xtensa/esp32_devkitc_wrover/esp32_devkitc_wrover_defconfig b/boards/xtensa/esp32_devkitc_wrover/esp32_devkitc_wrover_defconfig new file mode 100644 index 00000000000000..ad08ccede28bd3 --- /dev/null +++ b/boards/xtensa/esp32_devkitc_wrover/esp32_devkitc_wrover_defconfig @@ -0,0 +1,13 @@ +# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_BOARD_ESP32_DEVKITC_WROVER=y +CONFIG_SOC_SERIES_ESP32=y + +CONFIG_MAIN_STACK_SIZE=2048 + +CONFIG_CONSOLE=y +CONFIG_SERIAL=y +CONFIG_UART_CONSOLE=y + +CONFIG_GPIO=y diff --git a/boards/xtensa/esp32_devkitc_wrover/support/openocd.cfg b/boards/xtensa/esp32_devkitc_wrover/support/openocd.cfg new file mode 100644 index 00000000000000..338e6e4e6eae9a --- /dev/null +++ b/boards/xtensa/esp32_devkitc_wrover/support/openocd.cfg @@ -0,0 +1,5 @@ +set ESP_RTOS none +set ESP32_ONLYCPU 1 + +source [find interface/ftdi/esp32_devkitj_v1.cfg] +source [find target/esp32.cfg] diff --git a/boards/xtensa/esp32_ethernet_kit/Kconfig.board b/boards/xtensa/esp32_ethernet_kit/Kconfig.board index b4d48cc7f05c06..28a8995bbdf287 100644 --- a/boards/xtensa/esp32_ethernet_kit/Kconfig.board +++ b/boards/xtensa/esp32_ethernet_kit/Kconfig.board @@ -5,4 +5,8 @@ config BOARD_ESP32_ETHERNET_KIT bool "ESP32-ETHERNET-KIT Development Board" - depends on SOC_ESP32 + depends on SOC_SERIES_ESP32 + +choice SOC_PART_NUMBER + default SOC_ESP32_WROVER_E_N4R8 +endchoice diff --git a/boards/xtensa/esp32_ethernet_kit/esp32_ethernet_kit.dts b/boards/xtensa/esp32_ethernet_kit/esp32_ethernet_kit.dts index 0ede058c9f4a38..d772cd817d3cf7 100644 --- a/boards/xtensa/esp32_ethernet_kit/esp32_ethernet_kit.dts +++ b/boards/xtensa/esp32_ethernet_kit/esp32_ethernet_kit.dts @@ -5,7 +5,7 @@ */ /dts-v1/; -#include +#include #include "esp32_ethernet_kit-pinctrl.dtsi" / { diff --git a/boards/xtensa/esp32_ethernet_kit/esp32_ethernet_kit_defconfig b/boards/xtensa/esp32_ethernet_kit/esp32_ethernet_kit_defconfig index f5be5006b4c293..a9c99bec06b74c 100644 --- a/boards/xtensa/esp32_ethernet_kit/esp32_ethernet_kit_defconfig +++ b/boards/xtensa/esp32_ethernet_kit/esp32_ethernet_kit_defconfig @@ -1,9 +1,7 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_XTENSA_RESET_VECTOR=n - CONFIG_BOARD_ESP32_ETHERNET_KIT=y -CONFIG_SOC_ESP32=y +CONFIG_SOC_SERIES_ESP32=y CONFIG_MAIN_STACK_SIZE=2048 @@ -11,11 +9,4 @@ CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y -CONFIG_XTENSA_USE_CORE_CRT1=n - CONFIG_GPIO=y - -CONFIG_GEN_ISR_TABLES=y -CONFIG_GEN_IRQ_VECTOR_TABLE=n - -CONFIG_CLOCK_CONTROL=y diff --git a/boards/xtensa/esp32_net/Kconfig.board b/boards/xtensa/esp32_net/Kconfig.board index e7405295d4093e..946a59dce7fbd8 100644 --- a/boards/xtensa/esp32_net/Kconfig.board +++ b/boards/xtensa/esp32_net/Kconfig.board @@ -5,4 +5,8 @@ config BOARD_ESP32_NET bool "ESP32 Board configuration for APP_CPU" - depends on SOC_ESP32_NET + depends on SOC_SERIES_ESP32_NET + +choice SOC_PART_NUMBER + default SOC_ESP32_NET +endchoice diff --git a/boards/xtensa/esp32_net/doc/index.rst b/boards/xtensa/esp32_net/doc/index.rst index 06c1df13c01ad2..5321727aa7db0b 100644 --- a/boards/xtensa/esp32_net/doc/index.rst +++ b/boards/xtensa/esp32_net/doc/index.rst @@ -35,16 +35,16 @@ Build and flash applications as usual (see :ref:`build_an_application` and .. zephyr-app-commands:: :zephyr-app: samples/hello_world - :board: esp32 + :board: esp32_devkitc_wroom :goals: build -The usual ``flash`` target will work with the ``esp32`` board +The usual ``flash`` target will work with the ``esp32_devkitc_wroom`` board configuration. Here is an example for the :ref:`hello_world` application. .. zephyr-app-commands:: :zephyr-app: samples/hello_world - :board: esp32 + :board: esp32_devkitc_wroom :goals: flash Open the serial monitor using the following command: @@ -59,7 +59,7 @@ message in the monitor: .. code-block:: console ***** Booting Zephyr OS vx.x.x-xxx-gxxxxxxxxxxxx ***** - Hello World! esp32 + Hello World! esp32_devkitc_wroom Debugging --------- @@ -76,7 +76,7 @@ Here is an example for building the :ref:`hello_world` application. .. zephyr-app-commands:: :zephyr-app: samples/hello_world - :board: esp32 + :board: esp32_devkitc_wroom :goals: build flash :gen-args: -DOPENOCD= -DOPENOCD_DEFAULT_PATH= @@ -84,7 +84,7 @@ You can debug an application in the usual way. Here is an example for the :ref:` .. zephyr-app-commands:: :zephyr-app: samples/hello_world - :board: esp32 + :board: esp32_devkitc_wroom :goals: debug Using JTAG diff --git a/boards/xtensa/esp32_net/esp32_net.dts b/boards/xtensa/esp32_net/esp32_net.dts index 21f56f565fa05e..7479d342fb696c 100644 --- a/boards/xtensa/esp32_net/esp32_net.dts +++ b/boards/xtensa/esp32_net/esp32_net.dts @@ -5,7 +5,7 @@ */ /dts-v1/; -#include +#include / { model = "esp32_net"; diff --git a/boards/xtensa/esp32_net/esp32_net_defconfig b/boards/xtensa/esp32_net/esp32_net_defconfig index f7846c52402983..94fed73bc45988 100644 --- a/boards/xtensa/esp32_net/esp32_net_defconfig +++ b/boards/xtensa/esp32_net/esp32_net_defconfig @@ -1,9 +1,7 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_XTENSA_RESET_VECTOR=n - CONFIG_BOARD_ESP32_NET=y -CONFIG_SOC_ESP32_NET=y +CONFIG_SOC_SERIES_ESP32_NET=y CONFIG_MAIN_STACK_SIZE=2048 @@ -11,13 +9,7 @@ CONFIG_CONSOLE=n CONFIG_SERIAL=n CONFIG_UART_CONSOLE=n -CONFIG_XTENSA_USE_CORE_CRT1=n - CONFIG_GPIO=n CONFIG_GPIO_ESP32=n -CONFIG_GEN_ISR_TABLES=y -CONFIG_GEN_IRQ_VECTOR_TABLE=n - CONFIG_I2C=n -CONFIG_CLOCK_CONTROL=y diff --git a/boards/xtensa/esp32s2_franzininho/Kconfig.board b/boards/xtensa/esp32s2_franzininho/Kconfig.board index 3f78d5baf931e0..7b52b4d88b12e1 100644 --- a/boards/xtensa/esp32s2_franzininho/Kconfig.board +++ b/boards/xtensa/esp32s2_franzininho/Kconfig.board @@ -5,4 +5,8 @@ config BOARD_ESP32S2_FRANZININHO bool "ESP32S2 Franzininho Board" - depends on SOC_ESP32S2 + depends on SOC_SERIES_ESP32S2 + +choice SOC_PART_NUMBER + default SOC_ESP32S2_WROOM +endchoice diff --git a/boards/xtensa/esp32s2_franzininho/esp32s2_franzininho.dts b/boards/xtensa/esp32s2_franzininho/esp32s2_franzininho.dts index f7492d69662056..66c8560609747b 100644 --- a/boards/xtensa/esp32s2_franzininho/esp32s2_franzininho.dts +++ b/boards/xtensa/esp32s2_franzininho/esp32s2_franzininho.dts @@ -6,7 +6,7 @@ /dts-v1/; -#include +#include #include "esp32s2_franzininho-pinctrl.dtsi" / { diff --git a/boards/xtensa/esp32s2_franzininho/esp32s2_franzininho_defconfig b/boards/xtensa/esp32s2_franzininho/esp32s2_franzininho_defconfig index 3a17ce5b547842..6d95a2f5567bf4 100644 --- a/boards/xtensa/esp32s2_franzininho/esp32s2_franzininho_defconfig +++ b/boards/xtensa/esp32s2_franzininho/esp32s2_franzininho_defconfig @@ -1,20 +1,13 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_XTENSA_RESET_VECTOR=n CONFIG_BOARD_ESP32S2_FRANZININHO=y -CONFIG_SOC_ESP32S2=y +CONFIG_SOC_SERIES_ESP32S2=y + CONFIG_MAIN_STACK_SIZE=2048 CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y -CONFIG_XTENSA_USE_CORE_CRT1=n - CONFIG_GPIO=y - -CONFIG_GEN_ISR_TABLES=y -CONFIG_GEN_IRQ_VECTOR_TABLE=n - -CONFIG_CLOCK_CONTROL=y diff --git a/boards/xtensa/esp32s2_saola/Kconfig.board b/boards/xtensa/esp32s2_saola/Kconfig.board index 5accd94308af76..7d9e3a717ae2ed 100644 --- a/boards/xtensa/esp32s2_saola/Kconfig.board +++ b/boards/xtensa/esp32s2_saola/Kconfig.board @@ -1,8 +1,10 @@ -# ESP32S2 saola board configuration - -# Copyright (c) 2021 Espressif Systems (Shanghai) Co., Ltd. +# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. # SPDX-License-Identifier: Apache-2.0 config BOARD_ESP32S2_SAOLA bool "ESP32S2 Saola Board" - depends on SOC_ESP32S2 + depends on SOC_SERIES_ESP32S2 + +choice SOC_PART_NUMBER + default SOC_ESP32S2_WROVER_N4R2 +endchoice diff --git a/boards/xtensa/esp32s2_saola/esp32s2_saola.dts b/boards/xtensa/esp32s2_saola/esp32s2_saola.dts index 4e34faf09a0df5..73c2915f3a4e79 100644 --- a/boards/xtensa/esp32s2_saola/esp32s2_saola.dts +++ b/boards/xtensa/esp32s2_saola/esp32s2_saola.dts @@ -6,7 +6,7 @@ /dts-v1/; -#include +#include #include "esp32s2_saola-pinctrl.dtsi" / { @@ -103,8 +103,10 @@ pinctrl-names = "default"; }; + &flash0 { status = "okay"; + partitions { compatible = "fixed-partitions"; #address-cells = <1>; diff --git a/boards/xtensa/esp32s2_saola/esp32s2_saola_defconfig b/boards/xtensa/esp32s2_saola/esp32s2_saola_defconfig index f1402eace807d8..c7bacdd2ec6219 100644 --- a/boards/xtensa/esp32s2_saola/esp32s2_saola_defconfig +++ b/boards/xtensa/esp32s2_saola/esp32s2_saola_defconfig @@ -1,20 +1,12 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_XTENSA_RESET_VECTOR=n - CONFIG_BOARD_ESP32S2_SAOLA=y -CONFIG_SOC_ESP32S2=y +CONFIG_SOC_SERIES_ESP32S2=y + CONFIG_MAIN_STACK_SIZE=2048 CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y -CONFIG_XTENSA_USE_CORE_CRT1=n - CONFIG_GPIO=y - -CONFIG_GEN_ISR_TABLES=y -CONFIG_GEN_IRQ_VECTOR_TABLE=n - -CONFIG_CLOCK_CONTROL=y diff --git a/boards/xtensa/esp32s3_devkitm/Kconfig.board b/boards/xtensa/esp32s3_devkitm/Kconfig.board index 38d8db7a1127ea..96de0fb06f7621 100644 --- a/boards/xtensa/esp32s3_devkitm/Kconfig.board +++ b/boards/xtensa/esp32s3_devkitm/Kconfig.board @@ -1,8 +1,11 @@ -# ESP32S3 DevKitM board configuration - # Copyright (c) 2022 Espressif Systems (Shanghai) Co., Ltd. # SPDX-License-Identifier: Apache-2.0 +# ESP32S3 DevKitM board configuration config BOARD_ESP32S3_DEVKITM bool "ESP32S3 DevKitM Board" - depends on SOC_ESP32S3 + depends on SOC_SERIES_ESP32S3 + +choice SOC_PART_NUMBER + default SOC_ESP32S3_MINI_N8 +endchoice diff --git a/boards/xtensa/esp32s3_devkitm/esp32s3_devkitm.dts b/boards/xtensa/esp32s3_devkitm/esp32s3_devkitm.dts index f61034c2d1b746..c52662155615d5 100644 --- a/boards/xtensa/esp32s3_devkitm/esp32s3_devkitm.dts +++ b/boards/xtensa/esp32s3_devkitm/esp32s3_devkitm.dts @@ -5,7 +5,7 @@ */ /dts-v1/; -#include +#include #include "esp32s3_devkitm-pinctrl.dtsi" / { diff --git a/boards/xtensa/esp32s3_devkitm/esp32s3_devkitm_defconfig b/boards/xtensa/esp32s3_devkitm/esp32s3_devkitm_defconfig index 65acf1b660d0c5..1f8b52aa3604bc 100644 --- a/boards/xtensa/esp32s3_devkitm/esp32s3_devkitm_defconfig +++ b/boards/xtensa/esp32s3_devkitm/esp32s3_devkitm_defconfig @@ -1,14 +1,12 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_XTENSA_RESET_VECTOR=n CONFIG_BOARD_ESP32S3_DEVKITM=y -CONFIG_SOC_ESP32S3=y +CONFIG_SOC_SERIES_ESP32S3=y + CONFIG_MAIN_STACK_SIZE=2048 + CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y -CONFIG_XTENSA_USE_CORE_CRT1=n CONFIG_GPIO=y -CONFIG_GEN_ISR_TABLES=y -CONFIG_GEN_IRQ_VECTOR_TABLE=n CONFIG_CLOCK_CONTROL=y diff --git a/boards/xtensa/esp_wrover_kit/Kconfig.board b/boards/xtensa/esp_wrover_kit/Kconfig.board index 7067d53cd5cd71..eb255c7ec55f06 100644 --- a/boards/xtensa/esp_wrover_kit/Kconfig.board +++ b/boards/xtensa/esp_wrover_kit/Kconfig.board @@ -5,4 +5,8 @@ config BOARD_ESP_WROVER_KIT bool "ESP-WROVER-KIT Development Board" - depends on SOC_ESP32 + depends on SOC_SERIES_ESP32 + +choice SOC_PART_NUMBER + default SOC_ESP32_WROVER_E_N4R8 +endchoice diff --git a/boards/xtensa/esp_wrover_kit/esp_wrover_kit.dts b/boards/xtensa/esp_wrover_kit/esp_wrover_kit.dts index 8c6ece9cea6268..05f7a00b2da095 100644 --- a/boards/xtensa/esp_wrover_kit/esp_wrover_kit.dts +++ b/boards/xtensa/esp_wrover_kit/esp_wrover_kit.dts @@ -5,7 +5,7 @@ */ /dts-v1/; -#include +#include #include "esp_wrover_kit-pinctrl.dtsi" / { diff --git a/boards/xtensa/esp_wrover_kit/esp_wrover_kit_defconfig b/boards/xtensa/esp_wrover_kit/esp_wrover_kit_defconfig index 68ef048f0eb9b6..f2b8f7b663c22d 100644 --- a/boards/xtensa/esp_wrover_kit/esp_wrover_kit_defconfig +++ b/boards/xtensa/esp_wrover_kit/esp_wrover_kit_defconfig @@ -1,9 +1,7 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_XTENSA_RESET_VECTOR=n - CONFIG_BOARD_ESP_WROVER_KIT=y -CONFIG_SOC_ESP32=y +CONFIG_SOC_SERIES_ESP32=y CONFIG_MAIN_STACK_SIZE=2048 @@ -11,11 +9,4 @@ CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y -CONFIG_XTENSA_USE_CORE_CRT1=n - CONFIG_GPIO=y - -CONFIG_GEN_ISR_TABLES=y -CONFIG_GEN_IRQ_VECTOR_TABLE=n - -CONFIG_CLOCK_CONTROL=y diff --git a/boards/xtensa/heltec_wifi_lora32_v2/Kconfig.board b/boards/xtensa/heltec_wifi_lora32_v2/Kconfig.board index bd176b95089289..b364fad83fdf06 100644 --- a/boards/xtensa/heltec_wifi_lora32_v2/Kconfig.board +++ b/boards/xtensa/heltec_wifi_lora32_v2/Kconfig.board @@ -5,4 +5,8 @@ config BOARD_HELTEC_WIFI_LORA32 bool "HELTEC WiFi LoRa 32 (V2) Board" - depends on SOC_ESP32 + depends on SOC_SERIES_ESP32 + +choice SOC_PART_NUMBER + default SOC_ESP32_D0WD_V3 +endchoice diff --git a/boards/xtensa/heltec_wifi_lora32_v2/heltec_wifi_lora32_v2.dts b/boards/xtensa/heltec_wifi_lora32_v2/heltec_wifi_lora32_v2.dts index e23aedbb50e9a0..e660a726b0935a 100644 --- a/boards/xtensa/heltec_wifi_lora32_v2/heltec_wifi_lora32_v2.dts +++ b/boards/xtensa/heltec_wifi_lora32_v2/heltec_wifi_lora32_v2.dts @@ -5,7 +5,7 @@ */ /dts-v1/; -#include +#include #include "heltec_wifi_lora32_v2-pinctrl.dtsi" / { @@ -111,6 +111,11 @@ }; &flash0 { + /* the board is using plain d0wd SoC part without the flash + * so any additional flash size should be defined at the board level + */ + reg = <0x0 DT_SIZE_M(8)>; + status = "okay"; partitions { compatible = "fixed-partitions"; diff --git a/boards/xtensa/heltec_wifi_lora32_v2/heltec_wifi_lora32_v2_defconfig b/boards/xtensa/heltec_wifi_lora32_v2/heltec_wifi_lora32_v2_defconfig index 766659e89ba6f3..ac8cf88d749446 100644 --- a/boards/xtensa/heltec_wifi_lora32_v2/heltec_wifi_lora32_v2_defconfig +++ b/boards/xtensa/heltec_wifi_lora32_v2/heltec_wifi_lora32_v2_defconfig @@ -1,9 +1,7 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_XTENSA_RESET_VECTOR=n - CONFIG_BOARD_HELTEC_WIFI_LORA32=y -CONFIG_SOC_ESP32=y +CONFIG_SOC_SERIES_ESP32=y CONFIG_MAIN_STACK_SIZE=2048 @@ -11,11 +9,4 @@ CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y -CONFIG_XTENSA_USE_CORE_CRT1=n - CONFIG_GPIO=y - -CONFIG_GEN_ISR_TABLES=y -CONFIG_GEN_IRQ_VECTOR_TABLE=n - -CONFIG_CLOCK_CONTROL=y diff --git a/boards/xtensa/m5stickc_plus/Kconfig.board b/boards/xtensa/m5stickc_plus/Kconfig.board index c034b8763ff7f0..91e31bc959521c 100644 --- a/boards/xtensa/m5stickc_plus/Kconfig.board +++ b/boards/xtensa/m5stickc_plus/Kconfig.board @@ -5,4 +5,8 @@ config BOARD_M5STICKC_PLUS bool "M5StickC PLUS Development Board" - depends on SOC_ESP32 + depends on SOC_SERIES_ESP32 + +choice SOC_PART_NUMBER + default SOC_ESP32_PICO_D4 +endchoice diff --git a/boards/xtensa/m5stickc_plus/m5stickc_plus.dts b/boards/xtensa/m5stickc_plus/m5stickc_plus.dts index c85ac0762f2d2b..5103997d92a1bc 100644 --- a/boards/xtensa/m5stickc_plus/m5stickc_plus.dts +++ b/boards/xtensa/m5stickc_plus/m5stickc_plus.dts @@ -5,7 +5,7 @@ */ /dts-v1/; -#include +#include #include "m5stickc_plus-pinctrl.dtsi" / { diff --git a/boards/xtensa/m5stickc_plus/m5stickc_plus_defconfig b/boards/xtensa/m5stickc_plus/m5stickc_plus_defconfig index 071ce0845c4a72..cc30c956bafd17 100644 --- a/boards/xtensa/m5stickc_plus/m5stickc_plus_defconfig +++ b/boards/xtensa/m5stickc_plus/m5stickc_plus_defconfig @@ -1,9 +1,7 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_XTENSA_RESET_VECTOR=n - CONFIG_BOARD_M5STICKC_PLUS=y -CONFIG_SOC_ESP32=y +CONFIG_SOC_SERIES_ESP32=y CONFIG_MAIN_STACK_SIZE=2048 @@ -11,12 +9,5 @@ CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y -CONFIG_XTENSA_USE_CORE_CRT1=n - CONFIG_GPIO=y - -CONFIG_GEN_ISR_TABLES=y -CONFIG_GEN_IRQ_VECTOR_TABLE=n - CONFIG_I2C=y -CONFIG_CLOCK_CONTROL=y diff --git a/boards/xtensa/odroid_go/Kconfig.board b/boards/xtensa/odroid_go/Kconfig.board index ad5a4838ba6987..f815a4e7e8823d 100644 --- a/boards/xtensa/odroid_go/Kconfig.board +++ b/boards/xtensa/odroid_go/Kconfig.board @@ -5,4 +5,8 @@ config BOARD_ODROID_GO bool "ODROID-GO Game Kit" - depends on SOC_ESP32 + depends on SOC_SERIES_ESP32 + +choice SOC_PART_NUMBER + default SOC_ESP32_WROVER_E_N16R2 +endchoice diff --git a/boards/xtensa/odroid_go/odroid_go.dts b/boards/xtensa/odroid_go/odroid_go.dts index 19b9b4f361c8c3..740c9a9f94c5c5 100644 --- a/boards/xtensa/odroid_go/odroid_go.dts +++ b/boards/xtensa/odroid_go/odroid_go.dts @@ -5,7 +5,7 @@ */ /dts-v1/; -#include "espressif/esp32.dtsi" +#include #include "odroid_go-pinctrl.dtsi" / { diff --git a/boards/xtensa/odroid_go/odroid_go_defconfig b/boards/xtensa/odroid_go/odroid_go_defconfig index 4a88a4a3365e1f..3bda04a1ed3a71 100644 --- a/boards/xtensa/odroid_go/odroid_go_defconfig +++ b/boards/xtensa/odroid_go/odroid_go_defconfig @@ -1,9 +1,7 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_XTENSA_RESET_VECTOR=n - CONFIG_BOARD_ODROID_GO=y -CONFIG_SOC_ESP32=y +CONFIG_SOC_SERIES_ESP32=y CONFIG_MAIN_STACK_SIZE=2048 @@ -11,14 +9,7 @@ CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y -CONFIG_XTENSA_USE_CORE_CRT1=n - CONFIG_GPIO=y -CONFIG_GEN_ISR_TABLES=y -CONFIG_GEN_IRQ_VECTOR_TABLE=n - -CONFIG_CLOCK_CONTROL=y - # required to enable LCD backlight CONFIG_REGULATOR=y diff --git a/boards/xtensa/olimex_esp32_evb/Kconfig.board b/boards/xtensa/olimex_esp32_evb/Kconfig.board index 2b230816edc778..7bb6c2295b7983 100644 --- a/boards/xtensa/olimex_esp32_evb/Kconfig.board +++ b/boards/xtensa/olimex_esp32_evb/Kconfig.board @@ -5,4 +5,8 @@ config BOARD_OLIMEX_ESP32_EVB bool "Olimex ESP32-EVB" - depends on SOC_ESP32 + depends on SOC_SERIES_ESP32 + +choice SOC_PART_NUMBER + default SOC_ESP32_WROVER_E_N8R2 +endchoice diff --git a/boards/xtensa/olimex_esp32_evb/olimex_esp32_evb.dts b/boards/xtensa/olimex_esp32_evb/olimex_esp32_evb.dts index 248dc7296572f0..008e5b326f2b98 100644 --- a/boards/xtensa/olimex_esp32_evb/olimex_esp32_evb.dts +++ b/boards/xtensa/olimex_esp32_evb/olimex_esp32_evb.dts @@ -6,7 +6,7 @@ /dts-v1/; -#include +#include #include "olimex_esp32_evb-pinctrl.dtsi" / { diff --git a/boards/xtensa/olimex_esp32_evb/olimex_esp32_evb_defconfig b/boards/xtensa/olimex_esp32_evb/olimex_esp32_evb_defconfig index 20f21d98a2a982..a89b387d08441e 100644 --- a/boards/xtensa/olimex_esp32_evb/olimex_esp32_evb_defconfig +++ b/boards/xtensa/olimex_esp32_evb/olimex_esp32_evb_defconfig @@ -1,9 +1,7 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_XTENSA_RESET_VECTOR=n - CONFIG_BOARD_OLIMEX_ESP32_EVB=y -CONFIG_SOC_ESP32=y +CONFIG_SOC_SERIES_ESP32=y CONFIG_MAIN_STACK_SIZE=2048 @@ -11,11 +9,4 @@ CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y -CONFIG_XTENSA_USE_CORE_CRT1=n - CONFIG_GPIO=y - -CONFIG_GEN_ISR_TABLES=y -CONFIG_GEN_IRQ_VECTOR_TABLE=n - -CONFIG_CLOCK_CONTROL=y diff --git a/boards/xtensa/xiao_esp32s3/Kconfig.board b/boards/xtensa/xiao_esp32s3/Kconfig.board index aa4b08ecf0f06f..99669d929e3f3a 100644 --- a/boards/xtensa/xiao_esp32s3/Kconfig.board +++ b/boards/xtensa/xiao_esp32s3/Kconfig.board @@ -5,4 +5,8 @@ config BOARD_XIAO_ESP32S3 bool "XIAO ESP32S3 Board" - depends on SOC_ESP32S3 + depends on SOC_SERIES_ESP32S3 + +choice SOC_PART_NUMBER + default SOC_ESP32S3_WROOM_N8R8 +endchoice diff --git a/boards/xtensa/xiao_esp32s3/xiao_esp32s3.dts b/boards/xtensa/xiao_esp32s3/xiao_esp32s3.dts index 79e29602f0d116..3090f9ff5affd9 100644 --- a/boards/xtensa/xiao_esp32s3/xiao_esp32s3.dts +++ b/boards/xtensa/xiao_esp32s3/xiao_esp32s3.dts @@ -6,7 +6,7 @@ /dts-v1/; -#include +#include #include "xiao_esp32s3-pinctrl.dtsi" #include "seeed_xiao_connector.dtsi" diff --git a/boards/xtensa/xiao_esp32s3/xiao_esp32s3_defconfig b/boards/xtensa/xiao_esp32s3/xiao_esp32s3_defconfig index df75dd7d28367b..978da251a5897b 100644 --- a/boards/xtensa/xiao_esp32s3/xiao_esp32s3_defconfig +++ b/boards/xtensa/xiao_esp32s3/xiao_esp32s3_defconfig @@ -1,14 +1,9 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_XTENSA_RESET_VECTOR=n CONFIG_BOARD_XIAO_ESP32S3=y -CONFIG_SOC_ESP32S3=y +CONFIG_SOC_SERIES_ESP32S3=y CONFIG_MAIN_STACK_SIZE=2048 CONFIG_CONSOLE=y CONFIG_SERIAL=y CONFIG_UART_CONSOLE=y -CONFIG_XTENSA_USE_CORE_CRT1=n CONFIG_GPIO=y -CONFIG_GEN_ISR_TABLES=y -CONFIG_GEN_IRQ_VECTOR_TABLE=n -CONFIG_CLOCK_CONTROL=y diff --git a/drivers/adc/adc_esp32.c b/drivers/adc/adc_esp32.c index 01bd54c32b5aa7..cbf64ea4c458ad 100644 --- a/drivers/adc/adc_esp32.c +++ b/drivers/adc/adc_esp32.c @@ -20,7 +20,7 @@ #include LOG_MODULE_REGISTER(adc_esp32, CONFIG_ADC_LOG_LEVEL); -#if CONFIG_SOC_ESP32 +#if CONFIG_SOC_SERIES_ESP32 #define ADC_CALI_SCHEME ESP_ADC_CAL_VAL_EFUSE_VREF #define ADC_RESOLUTION_MIN SOC_ADC_DIGI_MIN_BITWIDTH #define ADC_RESOLUTION_MAX SOC_ADC_DIGI_MAX_BITWIDTH @@ -31,12 +31,12 @@ LOG_MODULE_REGISTER(adc_esp32, CONFIG_ADC_LOG_LEVEL); */ #define ADC_CLIP_MVOLT_11DB 2550 -#elif CONFIG_SOC_ESP32S2 +#elif CONFIG_SOC_SERIES_ESP32S2 #define ADC_CALI_SCHEME ESP_ADC_CAL_VAL_EFUSE_TP #define ADC_RESOLUTION_MIN SOC_ADC_DIGI_MAX_BITWIDTH #define ADC_RESOLUTION_MAX SOC_ADC_MAX_BITWIDTH -#elif CONFIG_SOC_ESP32C3 +#elif CONFIG_SOC_SERIES_ESP32C3 #define ADC_CALI_SCHEME ESP_ADC_CAL_VAL_EFUSE_TP #define ADC_RESOLUTION_MIN SOC_ADC_DIGI_MAX_BITWIDTH #define ADC_RESOLUTION_MAX SOC_ADC_DIGI_MAX_BITWIDTH @@ -165,14 +165,14 @@ static int adc_esp32_read(const struct device *dev, const struct adc_sequence *s data->resolution[channel_id] = seq->resolution; -#if CONFIG_SOC_ESP32C3 +#if CONFIG_SOC_SERIES_ESP32C3 /* NOTE: nothing to set on ESP32C3 SoC */ if (conf->unit == ADC_UNIT_1) { adc1_config_width(ADC_WIDTH_BIT_DEFAULT); } #else adc_set_data_width(conf->unit, WIDTH_MASK(data->resolution[channel_id])); -#endif /* CONFIG_SOC_ESP32C3 */ +#endif /* CONFIG_SOC_SERIES_ESP32C3 */ /* Read raw value */ if (conf->unit == ADC_UNIT_1) { @@ -191,13 +191,13 @@ static int adc_esp32_read(const struct device *dev, const struct adc_sequence *s /* Get corrected voltage output */ cal = cal_mv = esp_adc_cal_raw_to_voltage(reading, &data->chars[channel_id]); -#if CONFIG_SOC_ESP32 +#if CONFIG_SOC_SERIES_ESP32 if (data->attenuation[channel_id] == ADC_ATTEN_DB_11) { if (cal > ADC_CLIP_MVOLT_11DB) { cal = ADC_CLIP_MVOLT_11DB; } } -#endif /* CONFIG_SOC_ESP32 */ +#endif /* CONFIG_SOC_SERIES_ESP32 */ /* Fit according to selected attenuation */ atten_to_gain(data->attenuation[channel_id], &cal); diff --git a/drivers/bluetooth/hci/hci_esp32.c b/drivers/bluetooth/hci/hci_esp32.c index bdcdb7db99aa01..8dae220dd944d9 100644 --- a/drivers/bluetooth/hci/hci_esp32.c +++ b/drivers/bluetooth/hci/hci_esp32.c @@ -280,7 +280,7 @@ static int bt_esp32_ble_init(void) int ret; esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT(); -#if defined(CONFIG_BT_BREDR) && defined(CONFIG_SOC_ESP32) +#if defined(CONFIG_BT_BREDR) && defined(CONFIG_SOC_SERIES_ESP32) esp_bt_mode_t mode = ESP_BT_MODE_BTDM; #else esp_bt_mode_t mode = ESP_BT_MODE_BLE; diff --git a/drivers/can/can_esp32_twai.c b/drivers/can/can_esp32_twai.c index cd0d6bad6ec3c6..794b3bdb8cdf6d 100644 --- a/drivers/can/can_esp32_twai.c +++ b/drivers/can/can_esp32_twai.c @@ -26,7 +26,7 @@ LOG_MODULE_REGISTER(can_esp32_twai, CONFIG_CAN_LOG_LEVEL); * The names with TWAI_ prefixes from Espressif reference manuals are used for these incompatible * registers. */ -#ifndef CONFIG_SOC_ESP32 +#ifndef CONFIG_SOC_SERIES_ESP32 /* TWAI_BUS_TIMING_0_REG is incompatible with CAN_SJA1000_BTR0 */ #define TWAI_BUS_TIMING_0_REG (6U) @@ -63,7 +63,7 @@ LOG_MODULE_REGISTER(can_esp32_twai, CONFIG_CAN_LOG_LEVEL); #define TWAI_CD_MASK GENMASK(2, 0) #define TWAI_CLOCK_OFF BIT(3) -#endif /* !CONFIG_SOC_ESP32 */ +#endif /* !CONFIG_SOC_SERIES_ESP32 */ struct can_esp32_twai_config { mm_reg_t base; @@ -71,10 +71,10 @@ struct can_esp32_twai_config { const struct device *clock_dev; const clock_control_subsys_t clock_subsys; int irq_source; -#ifndef CONFIG_SOC_ESP32 +#ifndef CONFIG_SOC_SERIES_ESP32 /* 32-bit variant of output clock divider register required for non-ESP32 MCUs */ uint32_t cdr32; -#endif /* !CONFIG_SOC_ESP32 */ +#endif /* !CONFIG_SOC_SERIES_ESP32 */ }; static uint8_t can_esp32_twai_read_reg(const struct device *dev, uint8_t reg) @@ -95,7 +95,7 @@ static void can_esp32_twai_write_reg(const struct device *dev, uint8_t reg, uint sys_write32(val & 0xFF, addr); } -#ifndef CONFIG_SOC_ESP32 +#ifndef CONFIG_SOC_SERIES_ESP32 /* * Required for newer ESP32-series MCUs which violate the original SJA1000 8-bit register size. @@ -157,7 +157,7 @@ static int can_esp32_twai_set_timing(const struct device *dev, const struct can_ return 0; } -#endif /* !CONFIG_SOC_ESP32 */ +#endif /* !CONFIG_SOC_SERIES_ESP32 */ static int can_esp32_twai_get_core_clock(const struct device *dev, uint32_t *rate) { @@ -205,7 +205,7 @@ static int can_esp32_twai_init(const struct device *dev) return err; } -#ifndef CONFIG_SOC_ESP32 +#ifndef CONFIG_SOC_SERIES_ESP32 /* * TWAI_CLOCK_DIVIDER_REG is incompatible with CAN_SJA1000_CDR for non-ESP32 MCUs * - TWAI_CD has length of 8 bits instead of 3 bits @@ -215,7 +215,7 @@ static int can_esp32_twai_init(const struct device *dev) * Overwrite with 32-bit register variant configured via devicetree. */ can_esp32_twai_write_reg32(dev, TWAI_CLOCK_DIVIDER_REG, twai_config->cdr32); -#endif /* !CONFIG_SOC_ESP32 */ +#endif /* !CONFIG_SOC_SERIES_ESP32 */ esp_intr_alloc(twai_config->irq_source, 0, can_esp32_twai_isr, (void *)dev, NULL); @@ -227,11 +227,11 @@ const struct can_driver_api can_esp32_twai_driver_api = { .start = can_sja1000_start, .stop = can_sja1000_stop, .set_mode = can_sja1000_set_mode, -#ifdef CONFIG_SOC_ESP32 +#ifdef CONFIG_SOC_SERIES_ESP32 .set_timing = can_sja1000_set_timing, #else .set_timing = can_esp32_twai_set_timing, -#endif /* CONFIG_SOC_ESP32 */ +#endif /* CONFIG_SOC_SERIES_ESP32 */ .send = can_sja1000_send, .add_rx_filter = can_sja1000_add_rx_filter, .remove_rx_filter = can_sja1000_remove_rx_filter, @@ -244,7 +244,7 @@ const struct can_driver_api can_esp32_twai_driver_api = { .recover = can_sja1000_recover, #endif /* !CONFIG_CAN_AUTO_BUS_OFF_RECOVERY */ .timing_min = CAN_SJA1000_TIMING_MIN_INITIALIZER, -#ifdef CONFIG_SOC_ESP32 +#ifdef CONFIG_SOC_SERIES_ESP32 .timing_max = CAN_SJA1000_TIMING_MAX_INITIALIZER, #else /* larger prescaler allowed for newer ESP32-series MCUs */ @@ -255,16 +255,16 @@ const struct can_driver_api can_esp32_twai_driver_api = { .phase_seg2 = 0x8, .prescaler = 0x2000, } -#endif /* CONFIG_SOC_ESP32 */ +#endif /* CONFIG_SOC_SERIES_ESP32 */ }; -#ifdef CONFIG_SOC_ESP32 +#ifdef CONFIG_SOC_SERIES_ESP32 #define TWAI_CLKOUT_DIVIDER_MAX (14) #define TWAI_CDR32_INIT(inst) #else #define TWAI_CLKOUT_DIVIDER_MAX (490) #define TWAI_CDR32_INIT(inst) .cdr32 = CAN_ESP32_TWAI_DT_CDR_INST_GET(inst) -#endif /* CONFIG_SOC_ESP32 */ +#endif /* CONFIG_SOC_SERIES_ESP32 */ #define CAN_ESP32_TWAI_ASSERT_CLKOUT_DIVIDER(inst) \ BUILD_ASSERT(COND_CODE_0(DT_INST_NODE_HAS_PROP(inst, clkout_divider), (1), \ @@ -293,10 +293,10 @@ const struct can_driver_api can_esp32_twai_driver_api = { CAN_ESP32_TWAI_ASSERT_CLKOUT_DIVIDER(inst); \ static const struct can_sja1000_config can_sja1000_config_##inst = \ CAN_SJA1000_DT_CONFIG_INST_GET(inst, &can_esp32_twai_config_##inst, \ - can_esp32_twai_read_reg, can_esp32_twai_write_reg, \ - CAN_SJA1000_OCR_OCMODE_BIPHASE, \ - COND_CODE_0(IS_ENABLED(CONFIG_SOC_ESP32), (0), \ - (CAN_ESP32_TWAI_DT_CDR_INST_GET(inst)))); \ + can_esp32_twai_read_reg, can_esp32_twai_write_reg, \ + CAN_SJA1000_OCR_OCMODE_BIPHASE, \ + COND_CODE_0(IS_ENABLED(CONFIG_SOC_SERIES_ESP32), (0), \ + (CAN_ESP32_TWAI_DT_CDR_INST_GET(inst)))); \ \ static struct can_sja1000_data can_sja1000_data_##inst = \ CAN_SJA1000_DATA_INITIALIZER(NULL); \ diff --git a/drivers/clock_control/clock_control_esp32.c b/drivers/clock_control/clock_control_esp32.c index d7bda543bb2b46..ea8836d8d751ed 100644 --- a/drivers/clock_control/clock_control_esp32.c +++ b/drivers/clock_control/clock_control_esp32.c @@ -9,32 +9,32 @@ #define CPU_RESET_REASON RTC_SW_CPU_RESET -#if defined(CONFIG_SOC_ESP32) || defined(CONFIG_SOC_ESP32_NET) +#if defined(CONFIG_SOC_SERIES_ESP32) || defined(CONFIG_SOC_SERIES_ESP32_NET) #define DT_CPU_COMPAT cdns_tensilica_xtensa_lx6 #undef CPU_RESET_REASON #define CPU_RESET_REASON SW_CPU_RESET #include #include "esp32/rom/rtc.h" #include "soc/dport_reg.h" -#elif defined(CONFIG_SOC_ESP32S2) +#elif defined(CONFIG_SOC_SERIES_ESP32S2) #define DT_CPU_COMPAT cdns_tensilica_xtensa_lx7 #include #include "esp32s2/rom/rtc.h" #include "soc/dport_reg.h" -#elif defined(CONFIG_SOC_ESP32S3) +#elif defined(CONFIG_SOC_SERIES_ESP32S3) #define DT_CPU_COMPAT cdns_tensilica_xtensa_lx7 #include #include "esp32s3/rom/rtc.h" #include "soc/dport_reg.h" #include "esp32s3/clk.h" -#elif CONFIG_IDF_TARGET_ESP32C3 +#elif CONFIG_SOC_SERIES_ESP32C3 #define DT_CPU_COMPAT espressif_riscv #include #include "esp32c3/rom/rtc.h" #include #include #include -#endif +#endif /* CONFIG_SOC_SERIES_ESP32xx */ #include "esp_rom_sys.h" #include @@ -55,14 +55,16 @@ struct esp32_clock_config { }; static uint8_t const xtal_freq[] = { -#if defined(CONFIG_SOC_ESP32) || defined(CONFIG_SOC_ESP32_NET) || defined(CONFIG_SOC_ESP32S3) +#if defined(CONFIG_SOC_SERIES_ESP32) || \ + defined(CONFIG_SOC_SERIES_ESP32_NET) || \ + defined(CONFIG_SOC_SERIES_ESP32S3) [ESP32_CLK_XTAL_24M] = 24, [ESP32_CLK_XTAL_26M] = 26, [ESP32_CLK_XTAL_40M] = 40, [ESP32_CLK_XTAL_AUTO] = 0 -#elif defined(CONFIG_SOC_ESP32S2) +#elif defined(CONFIG_SOC_SERIES_ESP32S2) [ESP32_CLK_XTAL_40M] = 40, -#elif defined(CONFIG_SOC_ESP32C3) +#elif defined(CONFIG_SOC_SERIES_ESP32C3) [ESP32_CLK_XTAL_32M] = 32, [ESP32_CLK_XTAL_40M] = 40, #endif @@ -124,7 +126,7 @@ static int clock_control_esp32_get_rate(const struct device *dev, return 0; } -#if defined(CONFIG_SOC_ESP32) || defined(CONFIG_SOC_ESP32_NET) +#if defined(CONFIG_SOC_SERIES_ESP32) || defined(CONFIG_SOC_SERIES_ESP32_NET) static void esp32_clock_perip_init(void) { uint32_t common_perip_clk; @@ -217,9 +219,9 @@ static void esp32_clock_perip_init(void) /* Enable RNG clock. */ periph_module_enable(PERIPH_RNG_MODULE); } -#endif +#endif /* CONFIG_SOC_SERIES_ESP32 */ -#if defined(CONFIG_SOC_ESP32S2) +#if defined(CONFIG_SOC_SERIES_ESP32S2) static void esp32_clock_perip_init(void) { uint32_t common_perip_clk; @@ -321,9 +323,9 @@ static void esp32_clock_perip_init(void) /* Enable RNG clock. */ periph_module_enable(PERIPH_RNG_MODULE); } -#endif +#endif /* CONFIG_SOC_SERIES_ESP32S2 */ -#if defined(CONFIG_SOC_ESP32S3) +#if defined(CONFIG_SOC_SERIES_ESP32S3) static void esp32_clock_perip_init(void) { uint32_t common_perip_clk, hwcrypto_perip_clk, wifi_bt_sdio_clk = 0; @@ -421,9 +423,9 @@ static void esp32_clock_perip_init(void) esp_rom_uart_tx_wait_idle(0); esp_rom_uart_set_clock_baudrate(0, UART_CLK_FREQ_ROM, 115200); } -#endif +#endif /* CONFIG_SOC_SERIES_ESP32S3 */ -#if defined(CONFIG_SOC_ESP32C3) +#if defined(CONFIG_SOC_SERIES_ESP32C3) static void esp32_clock_perip_init(void) { uint32_t common_perip_clk; @@ -510,7 +512,7 @@ static void esp32_clock_perip_init(void) /* Enable RNG clock. */ periph_module_enable(PERIPH_RNG_MODULE); } -#endif +#endif /* CONFIG_SOC_SERIES_ESP32C3 */ static int clock_control_esp32_init(const struct device *dev) { @@ -596,7 +598,7 @@ DEVICE_DT_DEFINE(DT_NODELABEL(rtc), CONFIG_CLOCK_CONTROL_INIT_PRIORITY, &clock_control_esp32_api); -#ifndef CONFIG_SOC_ESP32C3 +#ifndef CONFIG_SOC_SERIES_ESP32C3 BUILD_ASSERT((CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC) == DT_PROP(DT_INST(0, DT_CPU_COMPAT), clock_frequency), "SYS_CLOCK_HW_CYCLES_PER_SEC Value must be equal to CPU_Freq"); diff --git a/drivers/counter/counter_esp32_rtc.c b/drivers/counter/counter_esp32_rtc.c index 7b157414b57db3..0b7e8bbbb27cc1 100644 --- a/drivers/counter/counter_esp32_rtc.c +++ b/drivers/counter/counter_esp32_rtc.c @@ -18,7 +18,7 @@ #include #include -#if defined(CONFIG_SOC_ESP32C3) +#if defined(CONFIG_SOC_SERIES_ESP32C3) #include #else #include @@ -27,7 +27,7 @@ #include LOG_MODULE_REGISTER(esp32_counter_rtc, CONFIG_COUNTER_LOG_LEVEL); -#if defined(CONFIG_SOC_ESP32C3) +#if defined(CONFIG_SOC_SERIES_ESP32C3) #define ESP32_COUNTER_RTC_ISR_HANDLER isr_handler_t #else #define ESP32_COUNTER_RTC_ISR_HANDLER intr_handler_t @@ -88,7 +88,7 @@ static int counter_esp32_get_value(const struct device *dev, uint32_t *ticks) ARG_UNUSED(dev); SET_PERI_REG_MASK(RTC_CNTL_TIME_UPDATE_REG, RTC_CNTL_TIME_UPDATE); -#if defined(CONFIG_SOC_ESP32) +#if defined(CONFIG_SOC_SERIES_ESP32) while (GET_PERI_REG_MASK(RTC_CNTL_TIME_UPDATE_REG, RTC_CNTL_TIME_VALID) == 0) { /* might take 1 RTC slowclk period, don't flood RTC bus */ k_sleep(K_USEC(1)); diff --git a/drivers/counter/counter_esp32_tmr.c b/drivers/counter/counter_esp32_tmr.c index d664aed46fc56a..77890f5e8fba47 100644 --- a/drivers/counter/counter_esp32_tmr.c +++ b/drivers/counter/counter_esp32_tmr.c @@ -17,7 +17,7 @@ #include #include #include -#ifndef CONFIG_SOC_ESP32C3 +#ifndef CONFIG_SOC_SERIES_ESP32C3 #include #else #include @@ -26,7 +26,7 @@ #include LOG_MODULE_REGISTER(esp32_counter, CONFIG_COUNTER_LOG_LEVEL); -#ifdef CONFIG_SOC_ESP32C3 +#ifdef CONFIG_SOC_SERIES_ESP32C3 #define ISR_HANDLER isr_handler_t #else #define ISR_HANDLER intr_handler_t diff --git a/drivers/dma/dma_esp32_gdma.c b/drivers/dma/dma_esp32_gdma.c index fc3116bfe49369..588b3fe9414ec1 100644 --- a/drivers/dma/dma_esp32_gdma.c +++ b/drivers/dma/dma_esp32_gdma.c @@ -21,13 +21,13 @@ LOG_MODULE_REGISTER(dma_esp32_gdma, CONFIG_DMA_LOG_LEVEL); #include #include #include -#ifndef CONFIG_SOC_ESP32C3 +#ifndef CONFIG_SOC_SERIES_ESP32C3 #include #else #include #endif -#ifdef CONFIG_SOC_ESP32C3 +#ifdef CONFIG_SOC_SERIES_ESP32C3 #define ISR_HANDLER isr_handler_t #else #define ISR_HANDLER intr_handler_t @@ -53,7 +53,7 @@ struct dma_esp32_channel { dma_callback_t cb; void *user_data; dma_descriptor_t desc; -#if defined(CONFIG_SOC_ESP32S3) +#if defined(CONFIG_SOC_SERIES_ESP32S3) struct intr_handle_data_t *intr_handle; #endif }; @@ -120,7 +120,7 @@ static void IRAM_ATTR dma_esp32_isr_handle(const struct device *dev, uint8_t rx_ } } -#if defined(CONFIG_SOC_ESP32C3) +#if defined(CONFIG_SOC_SERIES_ESP32C3) static int dma_esp32_enable_interrupt(const struct device *dev, struct dma_esp32_channel *dma_channel) { @@ -467,7 +467,7 @@ static int dma_esp32_reload(const struct device *dev, uint32_t channel, uint32_t return 0; } -#if defined(CONFIG_SOC_ESP32C3) +#if defined(CONFIG_SOC_SERIES_ESP32C3) static int dma_esp32_configure_irq(const struct device *dev) { struct dma_esp32_config *config = (struct dma_esp32_config *)dev->config; diff --git a/drivers/ethernet/Kconfig.esp32 b/drivers/ethernet/Kconfig.esp32 index e919e10b707997..8adb24cfb7716b 100644 --- a/drivers/ethernet/Kconfig.esp32 +++ b/drivers/ethernet/Kconfig.esp32 @@ -5,7 +5,7 @@ menuconfig ETH_ESP32 bool "ESP32 Ethernet driver" - depends on SOC_ESP32 + depends on SOC_SERIES_ESP32 select MDIO help Enable ESP32 Ethernet driver. diff --git a/drivers/flash/flash_esp32.c b/drivers/flash/flash_esp32.c index a7c13b332cbf31..419daa342ff700 100644 --- a/drivers/flash/flash_esp32.c +++ b/drivers/flash/flash_esp32.c @@ -30,20 +30,20 @@ #include #include -#if defined(CONFIG_SOC_ESP32) +#if defined(CONFIG_SOC_SERIES_ESP32) #include "soc/dport_reg.h" #include "esp32/rom/cache.h" #include "esp32/rom/spi_flash.h" #include "esp32/spiram.h" -#elif defined(CONFIG_SOC_ESP32S2) +#elif defined(CONFIG_SOC_SERIES_ESP32S2) #include "soc/spi_mem_reg.h" #include "esp32s2/rom/cache.h" #include "esp32s2/rom/spi_flash.h" -#elif defined(CONFIG_SOC_ESP32S3) +#elif defined(CONFIG_SOC_SERIES_ESP32S3) #include "soc/spi_mem_reg.h" #include "esp32s3/rom/cache.h" #include "esp32s3/rom/spi_flash.h" -#elif defined(CONFIG_SOC_ESP32C3) +#elif defined(CONFIG_SOC_SERIES_ESP32C3) #include "soc/spi_periph.h" #include "soc/spi_mem_reg.h" #include "soc/dport_access.h" diff --git a/drivers/gpio/gpio_esp32.c b/drivers/gpio/gpio_esp32.c index e67ffd33fee0a5..3851200b181302 100644 --- a/drivers/gpio/gpio_esp32.c +++ b/drivers/gpio/gpio_esp32.c @@ -20,7 +20,7 @@ #include #include #include -#ifdef CONFIG_SOC_ESP32C3 +#ifdef CONFIG_SOC_SERIES_ESP32C3 #include #else #include @@ -33,7 +33,7 @@ #include LOG_MODULE_REGISTER(gpio_esp32, CONFIG_LOG_DEFAULT_LEVEL); -#ifdef CONFIG_SOC_ESP32C3 +#ifdef CONFIG_SOC_SERIES_ESP32C3 /* gpio structs in esp32c3 series are different from xtensa ones */ #define out out.data #define in in.data diff --git a/drivers/hwinfo/hwinfo_esp32.c b/drivers/hwinfo/hwinfo_esp32.c index fd466c32704a50..df4d67321120d8 100644 --- a/drivers/hwinfo/hwinfo_esp32.c +++ b/drivers/hwinfo/hwinfo_esp32.c @@ -15,7 +15,7 @@ ssize_t z_impl_hwinfo_get_device_id(uint8_t *buffer, size_t length) { -#if !defined(CONFIG_SOC_ESP32) && !defined(CONFIG_SOC_ESP32_NET) +#if !defined(CONFIG_SOC_SERIES_ESP32) && !defined(CONFIG_SOC_SERIES_ESP32_NET) uint32_t rdata1 = sys_read32(EFUSE_RD_MAC_SPI_SYS_0_REG); uint32_t rdata2 = sys_read32(EFUSE_RD_MAC_SPI_SYS_1_REG); #else diff --git a/drivers/i2c/i2c_esp32.c b/drivers/i2c/i2c_esp32.c index 267c49793e4a44..0730fd1a6d6323 100644 --- a/drivers/i2c/i2c_esp32.c +++ b/drivers/i2c/i2c_esp32.c @@ -255,7 +255,7 @@ static void IRAM_ATTR i2c_esp32_configure_timeout(const struct device *dev) * at least for ESP32-C3 (tested with communication to bq76952 chip). So we set the * timeout to maximum supported value instead. */ -#if defined(CONFIG_SOC_ESP32C3) || defined(CONFIG_SOC_ESP32) +#if defined(CONFIG_SOC_SERIES_ESP32C3) || defined(CONFIG_SOC_SERIES_ESP32) i2c_hal_set_tout(&data->hal, I2C_LL_MAX_TIMEOUT); #else i2c_hal_set_tout_en(&data->hal, 0); diff --git a/drivers/interrupt_controller/Kconfig.esp32 b/drivers/interrupt_controller/Kconfig.esp32 index 6080dcbc318e98..dd8599bfbd22e5 100644 --- a/drivers/interrupt_controller/Kconfig.esp32 +++ b/drivers/interrupt_controller/Kconfig.esp32 @@ -5,7 +5,7 @@ config INTC_ESP32 bool "Interrupt allocator for Xtensa-based Espressif SoCs" - default y if SOC_ESP32 || SOC_ESP32S2 || SOC_ESP32_NET || SOC_ESP32S3 + default y if SOC_FAMILY_ESP32 && !SOC_SERIES_ESP32C3 help Enable custom interrupt allocator for Espressif SoCs based on Xtensa architecture. diff --git a/drivers/interrupt_controller/Kconfig.esp32c3 b/drivers/interrupt_controller/Kconfig.esp32c3 index dfcb0f06f992db..c6d4b7da88f6fa 100644 --- a/drivers/interrupt_controller/Kconfig.esp32c3 +++ b/drivers/interrupt_controller/Kconfig.esp32c3 @@ -3,7 +3,7 @@ config INTC_ESP32C3 bool "ESP32C3 interrupt controller driver" - depends on SOC_ESP32C3 + depends on SOC_SERIES_ESP32C3 default y help Enables the esp32c3 interrupt controller driver to handle ISR diff --git a/drivers/mdio/Kconfig.esp32 b/drivers/mdio/Kconfig.esp32 index 39c98eaa3bd92d..bdc8fb1221eee8 100644 --- a/drivers/mdio/Kconfig.esp32 +++ b/drivers/mdio/Kconfig.esp32 @@ -3,7 +3,7 @@ config MDIO_ESP32 bool "ESP32 MDIO driver" - depends on SOC_ESP32 + depends on SOC_SERIES_ESP32 default y help Enable ESP32 MCU Family MDIO driver. diff --git a/drivers/pinctrl/pinctrl_esp32.c b/drivers/pinctrl/pinctrl_esp32.c index d716dd4defa413..ee3811604511e9 100644 --- a/drivers/pinctrl/pinctrl_esp32.c +++ b/drivers/pinctrl/pinctrl_esp32.c @@ -12,7 +12,7 @@ #include #include -#ifdef CONFIG_SOC_ESP32C3 +#ifdef CONFIG_SOC_SERIES_ESP32C3 /* gpio structs in esp32c3 series are different from xtensa ones */ #define out out.data #define in in.data diff --git a/drivers/sensor/esp32_temp/Kconfig b/drivers/sensor/esp32_temp/Kconfig index 93568b416a9e70..22f31ed86253cb 100644 --- a/drivers/sensor/esp32_temp/Kconfig +++ b/drivers/sensor/esp32_temp/Kconfig @@ -5,6 +5,6 @@ config ESP32_TEMP bool "ESP32 Temperature Sensor" default y depends on DT_HAS_ESPRESSIF_ESP32_TEMP_ENABLED - depends on !SOC_ESP32 + depends on !SOC_SERIES_ESP32 help Enable driver for temperature sensor on certain ESP targets. diff --git a/drivers/sensor/esp32_temp/esp32_temp.c b/drivers/sensor/esp32_temp/esp32_temp.c index 1ceb13bde08832..5deaecc3430fab 100644 --- a/drivers/sensor/esp32_temp/esp32_temp.c +++ b/drivers/sensor/esp32_temp/esp32_temp.c @@ -16,7 +16,7 @@ #include LOG_MODULE_REGISTER(esp32_temp, CONFIG_SENSOR_LOG_LEVEL); -#if CONFIG_SOC_ESP32 +#if CONFIG_SOC_SERIES_ESP32 #error "Temperature sensor not supported on ESP32" #endif /* CONFIG_IDF_TARGET_ESP32 */ diff --git a/drivers/sensor/pcnt_esp32/pcnt_esp32.c b/drivers/sensor/pcnt_esp32/pcnt_esp32.c index 21da92897356cc..487e1352156a83 100644 --- a/drivers/sensor/pcnt_esp32/pcnt_esp32.c +++ b/drivers/sensor/pcnt_esp32/pcnt_esp32.c @@ -29,12 +29,12 @@ LOG_MODULE_REGISTER(pcnt_esp32, CONFIG_SENSOR_LOG_LEVEL); #define PCNT_INTR_UNIT_1 BIT(1) #define PCNT_INTR_UNIT_2 BIT(2) #define PCNT_INTR_UNIT_3 BIT(3) -#ifdef CONFIG_SOC_ESP32 +#ifdef CONFIG_SOC_SERIES_ESP32 #define PCNT_INTR_UNIT_4 BIT(4) #define PCNT_INTR_UNIT_5 BIT(5) #define PCNT_INTR_UNIT_6 BIT(6) #define PCNT_INTR_UNIT_7 BIT(7) -#endif /* CONFIG_SOC_ESP32 */ +#endif /* CONFIG_SOC_SERIES_ESP32 */ #ifdef CONFIG_PCNT_ESP32_TRIGGER #define PCNT_INTR_THRES_1 BIT(2) @@ -293,7 +293,7 @@ static void IRAM_ATTR pcnt_esp32_isr(const struct device *dev) pcnt_unit_status = pcnt_ll_get_unit_status(data->hal.dev, 2); } else if (pcnt_intr_status & PCNT_INTR_UNIT_3) { pcnt_unit_status = pcnt_ll_get_unit_status(data->hal.dev, 3); -#ifdef CONFIG_SOC_ESP32 +#ifdef CONFIG_SOC_SERIES_ESP32 } else if (pcnt_intr_status & PCNT_INTR_UNIT_4) { pcnt_unit_status = pcnt_ll_get_unit_status(data->hal.dev, 4); } else if (pcnt_intr_status & PCNT_INTR_UNIT_5) { @@ -302,7 +302,7 @@ static void IRAM_ATTR pcnt_esp32_isr(const struct device *dev) pcnt_unit_status = pcnt_ll_get_unit_status(data->hal.dev, 6); } else if (pcnt_intr_status & PCNT_INTR_UNIT_7) { pcnt_unit_status = pcnt_ll_get_unit_status(data->hal.dev, 7); -#endif /* CONFIG_SOC_ESP32 */ +#endif /* CONFIG_SOC_SERIES_ESP32 */ } else { return; } diff --git a/drivers/serial/Kconfig.esp32 b/drivers/serial/Kconfig.esp32 index 729d61b35ff9cd..f6fa5ac9d937e3 100644 --- a/drivers/serial/Kconfig.esp32 +++ b/drivers/serial/Kconfig.esp32 @@ -7,7 +7,7 @@ config UART_ESP32 depends on DT_HAS_ESPRESSIF_ESP32_UART_ENABLED select SERIAL_HAS_DRIVER select SERIAL_SUPPORT_INTERRUPT - select SERIAL_SUPPORT_ASYNC if (SOC_ESP32C3 || SOC_ESP32S3) + select SERIAL_SUPPORT_ASYNC if (SOC_SERIES_ESP32C3 || SOC_SERIES_ESP32S3) select GPIO_ESP32 help Enable the ESP32 UART. diff --git a/drivers/serial/uart_esp32.c b/drivers/serial/uart_esp32.c index a1054ba7d85396..6608d91a44ade3 100644 --- a/drivers/serial/uart_esp32.c +++ b/drivers/serial/uart_esp32.c @@ -9,19 +9,19 @@ /* Include esp-idf headers first to avoid redefining BIT() macro */ /* TODO: include w/o prefix */ -#ifdef CONFIG_SOC_ESP32 +#ifdef CONFIG_SOC_SERIES_ESP32 #include #include #include -#elif defined(CONFIG_SOC_ESP32S2) +#elif defined(CONFIG_SOC_SERIES_ESP32S2) #include #include #include -#elif defined(CONFIG_SOC_ESP32S3) +#elif defined(CONFIG_SOC_SERIES_ESP32S3) #include #include #include -#elif defined(CONFIG_SOC_ESP32C3) +#elif defined(CONFIG_SOC_SERIES_ESP32C3) #include #include #include @@ -43,7 +43,7 @@ #include #include -#ifndef CONFIG_SOC_ESP32C3 +#ifndef CONFIG_SOC_SERIES_ESP32C3 #include #else #include @@ -55,7 +55,7 @@ #include LOG_MODULE_REGISTER(uart_esp32, CONFIG_UART_LOG_LEVEL); -#ifdef CONFIG_SOC_ESP32C3 +#ifdef CONFIG_SOC_SERIES_ESP32C3 #define ISR_HANDLER isr_handler_t #else #define ISR_HANDLER intr_handler_t diff --git a/drivers/spi/spi_esp32_spim.c b/drivers/spi/spi_esp32_spim.c index 74b5d7c82b9b40..3a1a5dc244a75b 100644 --- a/drivers/spi/spi_esp32_spim.c +++ b/drivers/spi/spi_esp32_spim.c @@ -16,7 +16,7 @@ LOG_MODULE_REGISTER(esp32_spi, CONFIG_SPI_LOG_LEVEL); #include #include #include -#ifndef CONFIG_SOC_ESP32C3 +#ifndef CONFIG_SOC_SERIES_ESP32C3 #include #else #include @@ -29,7 +29,7 @@ LOG_MODULE_REGISTER(esp32_spi, CONFIG_SPI_LOG_LEVEL); #include "spi_context.h" #include "spi_esp32_spim.h" -#ifdef CONFIG_SOC_ESP32C3 +#ifdef CONFIG_SOC_SERIES_ESP32C3 #define ISR_HANDLER isr_handler_t #else #define ISR_HANDLER intr_handler_t @@ -180,11 +180,11 @@ static int spi_esp32_init_dma(const struct device *dev) #else channel_offset = 1; #endif /* SOC_GDMA_SUPPORTED */ -#ifdef CONFIG_SOC_ESP32 +#ifdef CONFIG_SOC_SERIES_ESP32 /*Connect SPI and DMA*/ DPORT_SET_PERI_REG_BITS(DPORT_SPI_DMA_CHAN_SEL_REG, 3, cfg->dma_host + 1, ((cfg->dma_host + 1) * 2)); -#endif /* CONFIG_SOC_ESP32 */ +#endif /* CONFIG_SOC_SERIES_ESP32 */ data->hal_config.dma_in = (spi_dma_dev_t *)cfg->spi; data->hal_config.dma_out = (spi_dma_dev_t *)cfg->spi; @@ -351,7 +351,7 @@ static int IRAM_ATTR spi_esp32_configure(const struct device *dev, * Workaround for ESP32S3 and ESP32C3 SoC. This dummy transaction is needed to sync CLK and * software controlled CS when SPI is in mode 3 */ -#if defined(CONFIG_SOC_ESP32S3) || defined(CONFIG_SOC_ESP32C3) +#if defined(CONFIG_SOC_SERIES_ESP32S3) || defined(CONFIG_SOC_SERIES_ESP32C3) if (ctx->num_cs_gpios && (hal_dev->mode & (SPI_MODE_CPOL | SPI_MODE_CPHA))) { spi_esp32_transfer(dev); } @@ -463,7 +463,7 @@ static const struct spi_driver_api spi_api = { .release = spi_esp32_release }; -#ifdef CONFIG_SOC_ESP32 +#ifdef CONFIG_SOC_SERIES_ESP32 #define GET_AS_CS(idx) .as_cs = DT_INST_PROP(idx, clk_as_cs), #else #define GET_AS_CS(idx) diff --git a/drivers/timer/Kconfig.esp32c3_sys b/drivers/timer/Kconfig.esp32c3_sys index 8bf5580c52bf2f..366cfcd8526e79 100644 --- a/drivers/timer/Kconfig.esp32c3_sys +++ b/drivers/timer/Kconfig.esp32c3_sys @@ -5,7 +5,7 @@ config ESP32C3_SYS_TIMER bool "ESP32C3 sys-timer support" - depends on SOC_ESP32C3 + depends on SOC_SERIES_ESP32C3 default y select TICKLESS_CAPABLE select TIMER_HAS_64BIT_CYCLE_COUNTER diff --git a/drivers/watchdog/wdt_esp32.c b/drivers/watchdog/wdt_esp32.c index c99c2b6f93a67f..460f130c1b5f5f 100644 --- a/drivers/watchdog/wdt_esp32.c +++ b/drivers/watchdog/wdt_esp32.c @@ -15,7 +15,7 @@ #include #include #include -#ifndef CONFIG_SOC_ESP32C3 +#ifndef CONFIG_SOC_SERIES_ESP32C3 #include #else #include @@ -25,7 +25,7 @@ #include LOG_MODULE_REGISTER(wdt_esp32, CONFIG_WDT_LOG_LEVEL); -#ifdef CONFIG_SOC_ESP32C3 +#ifdef CONFIG_SOC_SERIES_ESP32C3 #define ISR_HANDLER isr_handler_t #else #define ISR_HANDLER intr_handler_t diff --git a/dts/riscv/espressif/esp32c3/esp32c3.dtsi b/dts/riscv/espressif/esp32c3/esp32c3.dtsi new file mode 100644 index 00000000000000..43b734399f4c01 --- /dev/null +++ b/dts/riscv/espressif/esp32c3/esp32c3.dtsi @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32c3_common.dtsi" diff --git a/dts/riscv/espressif/esp32c3.dtsi b/dts/riscv/espressif/esp32c3/esp32c3_common.dtsi similarity index 97% rename from dts/riscv/espressif/esp32c3.dtsi rename to dts/riscv/espressif/esp32c3/esp32c3_common.dtsi index 9d751c1fe7e1e0..10fc17ac03adcc 100644 --- a/dts/riscv/espressif/esp32c3.dtsi +++ b/dts/riscv/espressif/esp32c3/esp32c3_common.dtsi @@ -129,7 +129,12 @@ reg = <0x60004000 0x800>; interrupts = ; interrupt-parent = <&intc>; - ngpios = <32>; /* 0..31 */ + /* Maximum available pins (per port) + * Actual occupied pins are specified + * on part number dtsi level, using + * the `gpio-reserved-ranges` property. + */ + ngpios = <26>; /* 0..25 */ }; i2c0: i2c@60013000 { diff --git a/dts/riscv/espressif/esp32c3/esp32c3_fx4.dtsi b/dts/riscv/espressif/esp32c3/esp32c3_fx4.dtsi new file mode 100644 index 00000000000000..4061cd1775512c --- /dev/null +++ b/dts/riscv/espressif/esp32c3/esp32c3_fx4.dtsi @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32c3_common.dtsi" + +/* 4MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(4)>; +}; diff --git a/dts/riscv/espressif/esp32c3/esp32c3_mini_n4.dtsi b/dts/riscv/espressif/esp32c3/esp32c3_mini_n4.dtsi new file mode 100644 index 00000000000000..4061cd1775512c --- /dev/null +++ b/dts/riscv/espressif/esp32c3/esp32c3_mini_n4.dtsi @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32c3_common.dtsi" + +/* 4MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(4)>; +}; diff --git a/dts/riscv/espressif/esp32c3/esp32c3_wroom_h2.dtsi b/dts/riscv/espressif/esp32c3/esp32c3_wroom_h2.dtsi new file mode 100644 index 00000000000000..271d1304422699 --- /dev/null +++ b/dts/riscv/espressif/esp32c3/esp32c3_wroom_h2.dtsi @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32c3_common.dtsi" + +/* 2MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(2)>; +}; diff --git a/dts/riscv/espressif/esp32c3/esp32c3_wroom_h4.dtsi b/dts/riscv/espressif/esp32c3/esp32c3_wroom_h4.dtsi new file mode 100644 index 00000000000000..4061cd1775512c --- /dev/null +++ b/dts/riscv/espressif/esp32c3/esp32c3_wroom_h4.dtsi @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32c3_common.dtsi" + +/* 4MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(4)>; +}; diff --git a/dts/xtensa/espressif/esp32.dtsi b/dts/xtensa/espressif/esp32/esp32_common.dtsi similarity index 95% rename from dts/xtensa/espressif/esp32.dtsi rename to dts/xtensa/espressif/esp32/esp32_common.dtsi index f8acfbdfb9ca44..e862a653e9be1a 100644 --- a/dts/xtensa/espressif/esp32.dtsi +++ b/dts/xtensa/espressif/esp32/esp32_common.dtsi @@ -129,12 +129,20 @@ flash0: flash@0 { compatible = "soc-nv-flash"; - reg = <0 0x400000>; erase-block-size = <4096>; write-block-size = <4>; + /* Flash size is specified in SOC/SIP dtsi */ }; }; + psram0: psram@3f800000 { + device_type = "memory"; + compatible = "mmio-sram"; + /* PSRAM size is specified in SOC/SIP dtsi */ + reg = <0x3f800000 DT_SIZE_M(2)>; + status = "disabled"; + }; + ipm0: ipm@3ffed238 { compatible = "espressif,esp32-ipm"; reg = <0x3FFED238 0x8>; @@ -243,6 +251,11 @@ reg = <0x3ff44000 0x800>; interrupts = ; interrupt-parent = <&intc>; + /* Maximum available pins (per port) + * Actual occupied pins are specified + * on part number dtsi level, using + * the `gpio-reserved-ranges` property. + */ ngpios = <32>; /* 0..31 */ }; diff --git a/dts/xtensa/espressif/esp32/esp32_d0wd_v3.dtsi b/dts/xtensa/espressif/esp32/esp32_d0wd_v3.dtsi new file mode 100644 index 00000000000000..6511f3d351a211 --- /dev/null +++ b/dts/xtensa/espressif/esp32/esp32_d0wd_v3.dtsi @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32_common.dtsi" + +/* Reserved GPIO pins */ +&gpio0 { + gpio-reserved-ranges = <20>,<24>,<28 31>; // NC +}; + +/* Add flash or psram on board or application level */ diff --git a/dts/xtensa/espressif/esp32/esp32_d0wdr2_v3.dtsi b/dts/xtensa/espressif/esp32/esp32_d0wdr2_v3.dtsi new file mode 100644 index 00000000000000..eb5e239c1aaadb --- /dev/null +++ b/dts/xtensa/espressif/esp32/esp32_d0wdr2_v3.dtsi @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32_common.dtsi" + +/* Reserved GPIO pins */ +&gpio0 { + gpio-reserved-ranges = <6 10>, // embeddef psram + <11>, // flash CS + <20>,<24>,<28 31>; // NC +}; + +/* 2MB psram */ +&psram0 { + reg = <0x3f800000 DT_SIZE_M(2)>; + status = "okay"; +}; diff --git a/dts/xtensa/espressif/esp32/esp32_net.dtsi b/dts/xtensa/espressif/esp32/esp32_net.dtsi new file mode 100644 index 00000000000000..00657ac0425fd8 --- /dev/null +++ b/dts/xtensa/espressif/esp32/esp32_net.dtsi @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32_common.dtsi" + +/* Reserved GPIO pins */ +&gpio0 { + gpio-reserved-ranges = <20>,<24>,<28 31>; // NC +}; + +&flash0 { + reg = <0x0 DT_SIZE_M(4)>; +}; diff --git a/dts/xtensa/espressif/esp32/esp32_pico_d4.dtsi b/dts/xtensa/espressif/esp32/esp32_pico_d4.dtsi new file mode 100644 index 00000000000000..8ed101d24bc2dc --- /dev/null +++ b/dts/xtensa/espressif/esp32/esp32_pico_d4.dtsi @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32_common.dtsi" + +/* Reserved GPIO pins */ +&gpio0 { + gpio-reserved-ranges = <6 8>,<11>,<16 17>, // embedded flash + <20>, <24>, <28 31>; // NC +}; + +/* 4MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(4)>; +}; diff --git a/dts/xtensa/espressif/esp32/esp32_pico_v3.dtsi b/dts/xtensa/espressif/esp32/esp32_pico_v3.dtsi new file mode 100644 index 00000000000000..76e4d4c05ebb79 --- /dev/null +++ b/dts/xtensa/espressif/esp32/esp32_pico_v3.dtsi @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32_common.dtsi" + +/* Reserved GPIO pins */ +&gpio0 { + gpio-reserved-ranges = <16 18>,<23>, // limitations + <24>,<28 31>; // NC +}; + +/* 4MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(4)>; +}; diff --git a/dts/xtensa/espressif/esp32/esp32_pico_v3_02.dtsi b/dts/xtensa/espressif/esp32/esp32_pico_v3_02.dtsi new file mode 100644 index 00000000000000..249debca7520f3 --- /dev/null +++ b/dts/xtensa/espressif/esp32/esp32_pico_v3_02.dtsi @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32_common.dtsi" + +/* Reserved GPIO pins */ +&gpio0 { + gpio-reserved-ranges = <6 11>, // flash + <24 25>,<28 31>; // NC +}; + +/* 8MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(8)>; +}; + +/* 2MB psram */ +&psram0 { + reg = <0x3f800000 DT_SIZE_M(2)>; + status = "okay"; +}; diff --git a/dts/xtensa/espressif/esp32/esp32_u4wdh.dtsi b/dts/xtensa/espressif/esp32/esp32_u4wdh.dtsi new file mode 100644 index 00000000000000..d26074898fa23c --- /dev/null +++ b/dts/xtensa/espressif/esp32/esp32_u4wdh.dtsi @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32_common.dtsi" + +/* Reserved GPIO pins */ +&gpio0 { + gpio-reserved-ranges = <20>, <24>, <28 31>; +}; + +/* 4MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(4)>; +}; diff --git a/dts/xtensa/espressif/esp32/esp32_wroom_32ue_n16.dtsi b/dts/xtensa/espressif/esp32/esp32_wroom_32ue_n16.dtsi new file mode 100644 index 00000000000000..2461a80395440c --- /dev/null +++ b/dts/xtensa/espressif/esp32/esp32_wroom_32ue_n16.dtsi @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32_common.dtsi" + +/* Reserved GPIO pins */ +&gpio0 { + gpio-reserved-ranges = <6 11>, // flash + <20>, <24>, <28 31>; // NC +}; + +&gpio1 { + gpio-reserved-ranges = <6>,<7>; // GPIO37-38 NC +}; + +/* 16MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(16)>; +}; diff --git a/dts/xtensa/espressif/esp32/esp32_wroom_32ue_n4.dtsi b/dts/xtensa/espressif/esp32/esp32_wroom_32ue_n4.dtsi new file mode 100644 index 00000000000000..9c8ef71acfdbf7 --- /dev/null +++ b/dts/xtensa/espressif/esp32/esp32_wroom_32ue_n4.dtsi @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32_common.dtsi" + +/* Reserved GPIO pins */ +&gpio0 { + gpio-reserved-ranges = <6 11>, // flash + <20>,<24>,<28 31>; // NC +}; + +&gpio1 { + gpio-reserved-ranges = <6>,<7>; // GPIO37-38 NC +}; + +/* 4MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(4)>; +}; diff --git a/dts/xtensa/espressif/esp32/esp32_wroom_32ue_n8.dtsi b/dts/xtensa/espressif/esp32/esp32_wroom_32ue_n8.dtsi new file mode 100644 index 00000000000000..4dee1868cc3445 --- /dev/null +++ b/dts/xtensa/espressif/esp32/esp32_wroom_32ue_n8.dtsi @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32_common.dtsi" + +/* Reserved GPIO pins */ +&gpio0 { + gpio-reserved-ranges = <6 11>, // flash + <20>,<24>,<28 31>; // NC +}; + +&gpio1 { + gpio-reserved-ranges = <6>,<7>; // GPIO37-38 NC +}; + +/* 8MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(8)>; +}; diff --git a/dts/xtensa/espressif/esp32/esp32_wroom_da_n16.dtsi b/dts/xtensa/espressif/esp32/esp32_wroom_da_n16.dtsi new file mode 100644 index 00000000000000..f034a5b289853c --- /dev/null +++ b/dts/xtensa/espressif/esp32/esp32_wroom_da_n16.dtsi @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32_common.dtsi" + +/* Reserved GPIO pins */ +&gpio0 { + gpio-reserved-ranges = <2>,<25>, // NC/test + <6 11>, // flash + <20>,<24>,<28 31>; // NC +}; + +&gpio1 { + gpio-reserved-ranges = <6>,<7>; // GPIO37-38 NC +}; + +/* 16MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(16)>; +}; diff --git a/dts/xtensa/espressif/esp32/esp32_wroom_da_n4.dtsi b/dts/xtensa/espressif/esp32/esp32_wroom_da_n4.dtsi new file mode 100644 index 00000000000000..324c1bba2de7d3 --- /dev/null +++ b/dts/xtensa/espressif/esp32/esp32_wroom_da_n4.dtsi @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32_common.dtsi" + +/* Reserved GPIO pins */ +&gpio0 { + gpio-reserved-ranges = <2>,<25>, // NC/test + <6 11>, // flash + <20>,<24>,<28 31>; // NC +}; + +&gpio1 { + gpio-reserved-ranges = <6>,<7>; // GPIO37-38 NC +}; + +/* 4MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(4)>; +}; diff --git a/dts/xtensa/espressif/esp32/esp32_wroom_da_n8.dtsi b/dts/xtensa/espressif/esp32/esp32_wroom_da_n8.dtsi new file mode 100644 index 00000000000000..ec5583c440677f --- /dev/null +++ b/dts/xtensa/espressif/esp32/esp32_wroom_da_n8.dtsi @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32_common.dtsi" + +/* Reserved GPIO pins */ +&gpio0 { + gpio-reserved-ranges = <2>,<25>, // NC/test + <6 11>, // flash + <20>,<24>,<28 31>; // NC +}; + +&gpio1 { + gpio-reserved-ranges = <6>,<7>; // GPIO37-38 NC +}; + +/* 8MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(8)>; +}; diff --git a/dts/xtensa/espressif/esp32/esp32_wrover_e_n16r2.dtsi b/dts/xtensa/espressif/esp32/esp32_wrover_e_n16r2.dtsi new file mode 100644 index 00000000000000..712d86fc0f4d66 --- /dev/null +++ b/dts/xtensa/espressif/esp32/esp32_wrover_e_n16r2.dtsi @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32_common.dtsi" + +/* Reserved GPIO pins */ +&gpio0 { + gpio-reserved-ranges = <6 11>,<16 17>, // flash&psram + <20>,<24>,<28 31>; // NC +}; + +&gpio1 { + gpio-reserved-ranges = <6>,<7>; // GPIO37-38 NC +}; + +/* 16MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(16)>; +}; + +/* 2MB psram */ +&psram0 { + reg = <0x3f800000 DT_SIZE_M(2)>; + status = "okay"; +}; diff --git a/dts/xtensa/espressif/esp32/esp32_wrover_e_n16r4.dtsi b/dts/xtensa/espressif/esp32/esp32_wrover_e_n16r4.dtsi new file mode 100644 index 00000000000000..119e3e3ed6aee3 --- /dev/null +++ b/dts/xtensa/espressif/esp32/esp32_wrover_e_n16r4.dtsi @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32_common.dtsi" + +/* Reserved GPIO pins */ +&gpio0 { + gpio-reserved-ranges = <6 11>,<16 17>, // flash&psram + <20>,<24>,<28 31>; // NC +}; + +&gpio1 { + gpio-reserved-ranges = <6>,<7>; // GPIO37-38 NC +}; + +/* 16MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(16)>; +}; + +/* 4MB psram */ +&psram0 { + reg = <0x3f800000 DT_SIZE_M(4)>; + status = "okay"; +}; diff --git a/dts/xtensa/espressif/esp32/esp32_wrover_e_n16r8.dtsi b/dts/xtensa/espressif/esp32/esp32_wrover_e_n16r8.dtsi new file mode 100644 index 00000000000000..10ab7f11fa127b --- /dev/null +++ b/dts/xtensa/espressif/esp32/esp32_wrover_e_n16r8.dtsi @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32_common.dtsi" + +/* Reserved GPIO pins */ +&gpio0 { + gpio-reserved-ranges = <6 11>,<16 17>, // flash&psram + <20>,<24>,<28 31>; // NC +}; + +&gpio1 { + gpio-reserved-ranges = <6>,<7>; // GPIO37-38 NC +}; + +/* 16MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(16)>; +}; + +/* 8MB psram */ +&psram0 { + reg = <0x3f800000 DT_SIZE_M(8)>; + status = "okay"; +}; diff --git a/dts/xtensa/espressif/esp32/esp32_wrover_e_n4r2.dtsi b/dts/xtensa/espressif/esp32/esp32_wrover_e_n4r2.dtsi new file mode 100644 index 00000000000000..b4367cc223d102 --- /dev/null +++ b/dts/xtensa/espressif/esp32/esp32_wrover_e_n4r2.dtsi @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32_common.dtsi" + +/* Reserved GPIO pins */ +&gpio0 { + gpio-reserved-ranges = <6 11>,<16 17>, // flash&psram + <20>,<24>,<28 31>; // NC +}; + +&gpio1 { + gpio-reserved-ranges = <6>,<7>; // GPIO37-38 NC +}; + +/* 4MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(4)>; +}; + +/* 2MB psram */ +&psram0 { + reg = <0x3f800000 DT_SIZE_M(2)>; + status = "okay"; +}; diff --git a/dts/xtensa/espressif/esp32/esp32_wrover_e_n4r8.dtsi b/dts/xtensa/espressif/esp32/esp32_wrover_e_n4r8.dtsi new file mode 100644 index 00000000000000..ef6037b394c3fe --- /dev/null +++ b/dts/xtensa/espressif/esp32/esp32_wrover_e_n4r8.dtsi @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32_common.dtsi" + +/* Reserved GPIO pins */ +&gpio0 { + gpio-reserved-ranges = <6 11>,<16 17>, // flash&psram + <20>,<24>,<28 31>; // NC +}; + +&gpio1 { + gpio-reserved-ranges = <6>,<7>; // GPIO37-38 NC +}; + +/* 4MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(4)>; +}; + +/* 8MB psram */ +&psram0 { + reg = <0x3f800000 DT_SIZE_M(8)>; + status = "okay"; +}; diff --git a/dts/xtensa/espressif/esp32/esp32_wrover_e_n8r2.dtsi b/dts/xtensa/espressif/esp32/esp32_wrover_e_n8r2.dtsi new file mode 100644 index 00000000000000..e8d902c73ae65c --- /dev/null +++ b/dts/xtensa/espressif/esp32/esp32_wrover_e_n8r2.dtsi @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32_common.dtsi" + +/* Reserved GPIO pins */ +&gpio0 { + gpio-reserved-ranges = <6 11>,<16 17>, // flash&psram + <20>,<24>,<28 31>; // NC +}; + +&gpio1 { + gpio-reserved-ranges = <6>,<7>; // GPIO37-38 NC +}; + +/* 8MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(8)>; +}; + +/* 2MB psram */ +&psram0 { + reg = <0x3f800000 DT_SIZE_M(2)>; + status = "okay"; +}; diff --git a/dts/xtensa/espressif/esp32/esp32_wrover_e_n8r8.dtsi b/dts/xtensa/espressif/esp32/esp32_wrover_e_n8r8.dtsi new file mode 100644 index 00000000000000..1ab318f35898a9 --- /dev/null +++ b/dts/xtensa/espressif/esp32/esp32_wrover_e_n8r8.dtsi @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32_common.dtsi" + +/* Reserved GPIO pins */ +&gpio0 { + gpio-reserved-ranges = <20>, <24>, <28 31>; + gpio-reserved-ranges = <6 11>,<16 17>, // flash&psram + <20>,<24>,<28 31>; // NC +}; + +&gpio1 { + gpio-reserved-ranges = <6>,<7>; // GPIO37-38 NC +}; + +/* 8MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(8)>; +}; + +/* 8MB flash */ +&psram0 { + reg = <0x3f800000 DT_SIZE_M(8)>; + status = "okay"; +}; diff --git a/dts/xtensa/espressif/esp32s2/esp32s2.dtsi b/dts/xtensa/espressif/esp32s2/esp32s2.dtsi new file mode 100644 index 00000000000000..d295a9c27cf88d --- /dev/null +++ b/dts/xtensa/espressif/esp32s2/esp32s2.dtsi @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32s2_common.dtsi" diff --git a/dts/xtensa/espressif/esp32s2.dtsi b/dts/xtensa/espressif/esp32s2/esp32s2_common.dtsi similarity index 94% rename from dts/xtensa/espressif/esp32s2.dtsi rename to dts/xtensa/espressif/esp32s2/esp32s2_common.dtsi index 898701457d4dd4..696e77a8ffb952 100644 --- a/dts/xtensa/espressif/esp32s2.dtsi +++ b/dts/xtensa/espressif/esp32s2/esp32s2_common.dtsi @@ -108,12 +108,20 @@ flash0: flash@0 { compatible = "soc-nv-flash"; - reg = <0 0x400000>; erase-block-size = <4096>; write-block-size = <4>; + /* Flash size is specified in SOC/SIP dtsi */ }; }; + psram0: psram@3f500000 { + device_type = "memory"; + compatible = "mmio-sram"; + /* PSRAM size is specified in SOC/SIP dtsi */ + reg = <0x3f500000 DT_SIZE_M(2)>; + status = "disabled"; + }; + uart0: uart@3f400000 { compatible = "espressif,esp32-uart"; reg = <0x3f400000 0x400>; @@ -158,6 +166,11 @@ reg = <0x3f404000 0x800>; interrupts = ; interrupt-parent = <&intc>; + /* Maximum available pins (per port) + * Actual occupied pins are specified + * on part number dtsi level, using + * the `gpio-reserved-ranges` property. + */ ngpios = <32>; /* 0..31 */ }; diff --git a/dts/xtensa/espressif/esp32s2/esp32s2_fh2.dtsi b/dts/xtensa/espressif/esp32s2/esp32s2_fh2.dtsi new file mode 100644 index 00000000000000..cd14799cef02c1 --- /dev/null +++ b/dts/xtensa/espressif/esp32s2/esp32s2_fh2.dtsi @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32s2_common.dtsi" + +/* 2MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(2)>; +}; diff --git a/dts/xtensa/espressif/esp32s2/esp32s2_fh4.dtsi b/dts/xtensa/espressif/esp32s2/esp32s2_fh4.dtsi new file mode 100644 index 00000000000000..036fed0055cc99 --- /dev/null +++ b/dts/xtensa/espressif/esp32s2/esp32s2_fh4.dtsi @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32s2_common.dtsi" + +/* 4MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(4)>; +}; diff --git a/dts/xtensa/espressif/esp32s2/esp32s2_fn4r2.dtsi b/dts/xtensa/espressif/esp32s2/esp32s2_fn4r2.dtsi new file mode 100644 index 00000000000000..f3175a99233f43 --- /dev/null +++ b/dts/xtensa/espressif/esp32s2/esp32s2_fn4r2.dtsi @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32s2_common.dtsi" + +/* 4MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(4)>; +}; + +/* 2MB psram */ +&psram0 { + reg = <0x3f500000 DT_SIZE_M(2)>; + status = "okay"; +}; diff --git a/dts/xtensa/espressif/esp32s2/esp32s2_mini_n4.dtsi b/dts/xtensa/espressif/esp32s2/esp32s2_mini_n4.dtsi new file mode 100644 index 00000000000000..036fed0055cc99 --- /dev/null +++ b/dts/xtensa/espressif/esp32s2/esp32s2_mini_n4.dtsi @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32s2_common.dtsi" + +/* 4MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(4)>; +}; diff --git a/dts/xtensa/espressif/esp32s2/esp32s2_mini_n4r2.dtsi b/dts/xtensa/espressif/esp32s2/esp32s2_mini_n4r2.dtsi new file mode 100644 index 00000000000000..84e3b16cc39be6 --- /dev/null +++ b/dts/xtensa/espressif/esp32s2/esp32s2_mini_n4r2.dtsi @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32s2_common.dtsi" + +/* 4MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(4)>; +}; + +/* 2MB psram */ +&psram0 { + status = "okay"; + reg = <0x3f500000 DT_SIZE_M(2)>; +}; diff --git a/dts/xtensa/espressif/esp32s2/esp32s2_r2.dtsi b/dts/xtensa/espressif/esp32s2/esp32s2_r2.dtsi new file mode 100644 index 00000000000000..db004992e703b7 --- /dev/null +++ b/dts/xtensa/espressif/esp32s2/esp32s2_r2.dtsi @@ -0,0 +1,13 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32s2_common.dtsi" + +/* 2MB psram */ +&psram0 { + status = "okay"; + reg = <0x3f500000 DT_SIZE_M(2)>; +}; diff --git a/dts/xtensa/espressif/esp32s2/esp32s2_solo_n16.dtsi b/dts/xtensa/espressif/esp32s2/esp32s2_solo_n16.dtsi new file mode 100644 index 00000000000000..357735b9e03e48 --- /dev/null +++ b/dts/xtensa/espressif/esp32s2/esp32s2_solo_n16.dtsi @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32s2_common.dtsi" + +/* 16 MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(16)>; +}; diff --git a/dts/xtensa/espressif/esp32s2/esp32s2_solo_n4.dtsi b/dts/xtensa/espressif/esp32s2/esp32s2_solo_n4.dtsi new file mode 100644 index 00000000000000..036fed0055cc99 --- /dev/null +++ b/dts/xtensa/espressif/esp32s2/esp32s2_solo_n4.dtsi @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32s2_common.dtsi" + +/* 4MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(4)>; +}; diff --git a/dts/xtensa/espressif/esp32s2/esp32s2_solo_n4r2.dtsi b/dts/xtensa/espressif/esp32s2/esp32s2_solo_n4r2.dtsi new file mode 100644 index 00000000000000..84e3b16cc39be6 --- /dev/null +++ b/dts/xtensa/espressif/esp32s2/esp32s2_solo_n4r2.dtsi @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32s2_common.dtsi" + +/* 4MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(4)>; +}; + +/* 2MB psram */ +&psram0 { + status = "okay"; + reg = <0x3f500000 DT_SIZE_M(2)>; +}; diff --git a/dts/xtensa/espressif/esp32s2/esp32s2_solo_n8.dtsi b/dts/xtensa/espressif/esp32s2/esp32s2_solo_n8.dtsi new file mode 100644 index 00000000000000..a0c57c7ae01701 --- /dev/null +++ b/dts/xtensa/espressif/esp32s2/esp32s2_solo_n8.dtsi @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32s2_common.dtsi" + +/* 8MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(8)>; +}; diff --git a/dts/xtensa/espressif/esp32s2/esp32s2_wroom.dtsi b/dts/xtensa/espressif/esp32s2/esp32s2_wroom.dtsi new file mode 100644 index 00000000000000..036fed0055cc99 --- /dev/null +++ b/dts/xtensa/espressif/esp32s2/esp32s2_wroom.dtsi @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32s2_common.dtsi" + +/* 4MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(4)>; +}; diff --git a/dts/xtensa/espressif/esp32s2/esp32s2_wrover_n16r2.dtsi b/dts/xtensa/espressif/esp32s2/esp32s2_wrover_n16r2.dtsi new file mode 100644 index 00000000000000..77645a3c2e076f --- /dev/null +++ b/dts/xtensa/espressif/esp32s2/esp32s2_wrover_n16r2.dtsi @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32s2_common.dtsi" + +/* 16MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(16)>; +}; + +/* 2MB psram */ +&psram0 { + status = "okay"; + reg = <0x3f500000 DT_SIZE_M(2)>; +}; diff --git a/dts/xtensa/espressif/esp32s2/esp32s2_wrover_n4r2.dtsi b/dts/xtensa/espressif/esp32s2/esp32s2_wrover_n4r2.dtsi new file mode 100644 index 00000000000000..84e3b16cc39be6 --- /dev/null +++ b/dts/xtensa/espressif/esp32s2/esp32s2_wrover_n4r2.dtsi @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32s2_common.dtsi" + +/* 4MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(4)>; +}; + +/* 2MB psram */ +&psram0 { + status = "okay"; + reg = <0x3f500000 DT_SIZE_M(2)>; +}; diff --git a/dts/xtensa/espressif/esp32s2/esp32s2_wrover_n8r2.dtsi b/dts/xtensa/espressif/esp32s2/esp32s2_wrover_n8r2.dtsi new file mode 100644 index 00000000000000..92d8775368ef6e --- /dev/null +++ b/dts/xtensa/espressif/esp32s2/esp32s2_wrover_n8r2.dtsi @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32s2_common.dtsi" + +/* 8MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(8)>; +}; + +/* 2MB psram */ +&psram0 { + status = "okay"; + reg = <0x3f500000 DT_SIZE_M(2)>; +}; diff --git a/dts/xtensa/espressif/esp32s3/esp32s3.dtsi b/dts/xtensa/espressif/esp32s3/esp32s3.dtsi new file mode 100644 index 00000000000000..c405bfedecdda2 --- /dev/null +++ b/dts/xtensa/espressif/esp32s3/esp32s3.dtsi @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32s3_common.dtsi" diff --git a/dts/xtensa/espressif/esp32s3.dtsi b/dts/xtensa/espressif/esp32s3/esp32s3_common.dtsi similarity index 94% rename from dts/xtensa/espressif/esp32s3.dtsi rename to dts/xtensa/espressif/esp32s3/esp32s3_common.dtsi index 6c2337a2a5e794..bf3853ab710a58 100644 --- a/dts/xtensa/espressif/esp32s3.dtsi +++ b/dts/xtensa/espressif/esp32s3/esp32s3_common.dtsi @@ -94,9 +94,18 @@ reg = <0 0x800000>; erase-block-size = <4096>; write-block-size = <4>; + /* Flash size is specified in SOC/SIP dtsi */ }; }; + psram0: psram@3c000000 { + device_type = "memory"; + compatible = "mmio-sram"; + /* PSRAM size is specified in SOC/SIP dtsi */ + reg = <0x3c000000 DT_SIZE_M(2)>; + status = "disabled"; + }; + uart0: uart@60000000 { compatible = "espressif,esp32-uart"; reg = <0x60000000 0x1000>; @@ -144,7 +153,12 @@ reg = <0x60004000 0x800>; interrupts = ; interrupt-parent = <&intc>; - ngpios = <32>; + /* Maximum available pins (per port) + * Actual occupied pins are specified + * on part number dtsi level, using + * the `gpio-reserved-ranges` property. + */ + ngpios = <32>; /* 0..31 */ }; gpio1: gpio@60004800 { @@ -154,7 +168,7 @@ reg = <0x60004800 0x800>; interrupts = ; interrupt-parent = <&intc>; - ngpios = <13>; + ngpios = <22>; /* 32..53 */ }; }; diff --git a/dts/xtensa/espressif/esp32s3/esp32s3_fn8.dtsi b/dts/xtensa/espressif/esp32s3/esp32s3_fn8.dtsi new file mode 100644 index 00000000000000..4b2e7404282ad9 --- /dev/null +++ b/dts/xtensa/espressif/esp32s3/esp32s3_fn8.dtsi @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32s3_common.dtsi" + +/* 8MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(8)>; +}; diff --git a/dts/xtensa/espressif/esp32s3/esp32s3_mini_n4r2.dtsi b/dts/xtensa/espressif/esp32s3/esp32s3_mini_n4r2.dtsi new file mode 100644 index 00000000000000..b8f733a3c54791 --- /dev/null +++ b/dts/xtensa/espressif/esp32s3/esp32s3_mini_n4r2.dtsi @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32s3_common.dtsi" + +/* 4MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(4)>; +}; + +/* 2MB psram */ +&psram0 { + reg = <0x3c000000 DT_SIZE_M(2)>; + status = "okay"; +}; diff --git a/dts/xtensa/espressif/esp32s3/esp32s3_mini_n8.dtsi b/dts/xtensa/espressif/esp32s3/esp32s3_mini_n8.dtsi new file mode 100644 index 00000000000000..4b2e7404282ad9 --- /dev/null +++ b/dts/xtensa/espressif/esp32s3/esp32s3_mini_n8.dtsi @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32s3_common.dtsi" + +/* 8MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(8)>; +}; diff --git a/dts/xtensa/espressif/esp32s3/esp32s3_pico_n8r2.dtsi b/dts/xtensa/espressif/esp32s3/esp32s3_pico_n8r2.dtsi new file mode 100644 index 00000000000000..b77169f172beea --- /dev/null +++ b/dts/xtensa/espressif/esp32s3/esp32s3_pico_n8r2.dtsi @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32s3_common.dtsi" + +/* 8MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(8)>; +}; + +/* 2MB psram */ +&psram0 { + reg = <0x3c000000 DT_SIZE_M(2)>; + status = "okay"; +}; diff --git a/dts/xtensa/espressif/esp32s3/esp32s3_pico_n8r8.dtsi b/dts/xtensa/espressif/esp32s3/esp32s3_pico_n8r8.dtsi new file mode 100644 index 00000000000000..34ec0ec5ac1aae --- /dev/null +++ b/dts/xtensa/espressif/esp32s3/esp32s3_pico_n8r8.dtsi @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32s3_common.dtsi" + +/* 8MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(8)>; +}; + +/* 8MB psram */ +&psram0 { + reg = <0x3c000000 DT_SIZE_M(8)>; + status = "okay"; +}; diff --git a/dts/xtensa/espressif/esp32s3/esp32s3_r2.dtsi b/dts/xtensa/espressif/esp32s3/esp32s3_r2.dtsi new file mode 100644 index 00000000000000..187a214078fd1c --- /dev/null +++ b/dts/xtensa/espressif/esp32s3/esp32s3_r2.dtsi @@ -0,0 +1,13 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32s3_common.dtsi" + +/* 2MB psram */ +&psram0 { + reg = <0x3c000000 DT_SIZE_M(2)>; + status = "okay"; +}; diff --git a/dts/xtensa/espressif/esp32s3/esp32s3_r8.dtsi b/dts/xtensa/espressif/esp32s3/esp32s3_r8.dtsi new file mode 100644 index 00000000000000..29a21140630c9b --- /dev/null +++ b/dts/xtensa/espressif/esp32s3/esp32s3_r8.dtsi @@ -0,0 +1,13 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32s3_common.dtsi" + +/* 8MB psram */ +&psram0 { + reg = <0x3c000000 DT_SIZE_M(8)>; + status = "okay"; +}; diff --git a/dts/xtensa/espressif/esp32s3/esp32s3_r8v.dtsi b/dts/xtensa/espressif/esp32s3/esp32s3_r8v.dtsi new file mode 100644 index 00000000000000..29a21140630c9b --- /dev/null +++ b/dts/xtensa/espressif/esp32s3/esp32s3_r8v.dtsi @@ -0,0 +1,13 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32s3_common.dtsi" + +/* 8MB psram */ +&psram0 { + reg = <0x3c000000 DT_SIZE_M(8)>; + status = "okay"; +}; diff --git a/dts/xtensa/espressif/esp32s3/esp32s3_wroom_n16.dtsi b/dts/xtensa/espressif/esp32s3/esp32s3_wroom_n16.dtsi new file mode 100644 index 00000000000000..dbd9c44e52f6c2 --- /dev/null +++ b/dts/xtensa/espressif/esp32s3/esp32s3_wroom_n16.dtsi @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32s3_common.dtsi" + +/* 16MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(16)>; +}; diff --git a/dts/xtensa/espressif/esp32s3/esp32s3_wroom_n16r8.dtsi b/dts/xtensa/espressif/esp32s3/esp32s3_wroom_n16r8.dtsi new file mode 100644 index 00000000000000..102fd94ec12670 --- /dev/null +++ b/dts/xtensa/espressif/esp32s3/esp32s3_wroom_n16r8.dtsi @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32s3_common.dtsi" + +/* 16MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(16)>; +}; + +/* 8MB psram */ +&psram0 { + reg = <0x3c000000 DT_SIZE_M(8)>; + status = "okay"; +}; diff --git a/dts/xtensa/espressif/esp32s3/esp32s3_wroom_n4.dtsi b/dts/xtensa/espressif/esp32s3/esp32s3_wroom_n4.dtsi new file mode 100644 index 00000000000000..086e7744908b80 --- /dev/null +++ b/dts/xtensa/espressif/esp32s3/esp32s3_wroom_n4.dtsi @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32s3_common.dtsi" + +/* 4MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(4)>; +}; diff --git a/dts/xtensa/espressif/esp32s3/esp32s3_wroom_n4r8.dtsi b/dts/xtensa/espressif/esp32s3/esp32s3_wroom_n4r8.dtsi new file mode 100644 index 00000000000000..b17d9f9223b34a --- /dev/null +++ b/dts/xtensa/espressif/esp32s3/esp32s3_wroom_n4r8.dtsi @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32s3_common.dtsi" + +/* 4MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(4)>; +}; + +/* 8MB psram */ +&psram0 { + reg = <0x3c000000 DT_SIZE_M(8)>; + status = "okay"; +}; diff --git a/dts/xtensa/espressif/esp32s3/esp32s3_wroom_n8.dtsi b/dts/xtensa/espressif/esp32s3/esp32s3_wroom_n8.dtsi new file mode 100644 index 00000000000000..4b2e7404282ad9 --- /dev/null +++ b/dts/xtensa/espressif/esp32s3/esp32s3_wroom_n8.dtsi @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32s3_common.dtsi" + +/* 8MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(8)>; +}; diff --git a/dts/xtensa/espressif/esp32s3/esp32s3_wroom_n8r8.dtsi b/dts/xtensa/espressif/esp32s3/esp32s3_wroom_n8r8.dtsi new file mode 100644 index 00000000000000..eac737e3d61909 --- /dev/null +++ b/dts/xtensa/espressif/esp32s3/esp32s3_wroom_n8r8.dtsi @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp32s3_common.dtsi" + +/* 8MB flash */ +&flash0 { + reg = <0x0 DT_SIZE_M(8)>; +}; + +/* 8MB psram */ +&psram0 { + reg = <0x3c000000 DT_SIZE_M(8)>; +}; diff --git a/include/zephyr/dt-bindings/pinctrl/esp32s3-gpio-sigmap.h b/include/zephyr/dt-bindings/pinctrl/esp32s3-gpio-sigmap.h index 47fd0f91302e10..7e12f1d4105b5f 100644 --- a/include/zephyr/dt-bindings/pinctrl/esp32s3-gpio-sigmap.h +++ b/include/zephyr/dt-bindings/pinctrl/esp32s3-gpio-sigmap.h @@ -452,4 +452,4 @@ #define ESP_SIG_GPIO_OUT 256 #define ESP_GPIO_MAP_DATE 0x1907040 -#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_PINCTRL_ESP32S2_GPIO_SIGMAP_H_ */ +#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_PINCTRL_ESP32S3_GPIO_SIGMAP_H_ */ diff --git a/modules/Kconfig.esp32 b/modules/Kconfig.esp32 index 8c432032a9fa11..4022f7534b0324 100644 --- a/modules/Kconfig.esp32 +++ b/modules/Kconfig.esp32 @@ -3,4 +3,4 @@ config HAS_ESPRESSIF_HAL bool - depends on SOC_ESP32 || SOC_ESP32S2 || SOC_ESP32C3 || SOC_ESP32_NET || SOC_ESP32S3 + depends on SOC_FAMILY_ESP32 diff --git a/samples/arch/smp/pktqueue/sample.yaml b/samples/arch/smp/pktqueue/sample.yaml index 685de5cfd8f4dd..890d36653d6200 100644 --- a/samples/arch/smp/pktqueue/sample.yaml +++ b/samples/arch/smp/pktqueue/sample.yaml @@ -19,7 +19,7 @@ tests: - smp filter: (CONFIG_MP_MAX_NUM_CPUS > 1) platform_exclude: - - esp32 + - esp32_devkitc_wroom - esp_wrover_kit - esp32_ethernet_kit - heltec_wifi_lora32_v2 diff --git a/samples/basic/blinky_pwm/README.rst b/samples/basic/blinky_pwm/README.rst index bdb80252fca7ed..ec59a6b3a97152 100644 --- a/samples/basic/blinky_pwm/README.rst +++ b/samples/basic/blinky_pwm/README.rst @@ -53,7 +53,7 @@ In these other cases, however, manual wiring is necessary: - connect PWM1 (PA8) to an LED * - :ref:`nucleo_wb55rg_board` - connect PWM1 (PA8) to an LED - * - :ref:`esp32` + * - :ref:`esp32_devkitc_wroom` - connect GPIO2 to an LED * - :ref:`esp32s2_saola` - connect GPIO2 to an LED diff --git a/samples/basic/blinky_pwm/boards/esp32.overlay b/samples/basic/blinky_pwm/boards/esp32_devkitc_wroom.overlay similarity index 100% rename from samples/basic/blinky_pwm/boards/esp32.overlay rename to samples/basic/blinky_pwm/boards/esp32_devkitc_wroom.overlay diff --git a/samples/basic/hash_map/sample.yaml b/samples/basic/hash_map/sample.yaml index 0ba16fe1fc216e..b73474975813cb 100644 --- a/samples/basic/hash_map/sample.yaml +++ b/samples/basic/hash_map/sample.yaml @@ -16,6 +16,9 @@ common: type: one_line regex: - .*success + platform_exclude: + - esp32_net + tests: # Minimal Libc diff --git a/samples/bluetooth/hci_uart/boards/esp32.conf b/samples/bluetooth/hci_uart/boards/esp32_devkitc_wroom.conf similarity index 100% rename from samples/bluetooth/hci_uart/boards/esp32.conf rename to samples/bluetooth/hci_uart/boards/esp32_devkitc_wroom.conf diff --git a/samples/bluetooth/hci_uart/boards/esp32.overlay b/samples/bluetooth/hci_uart/boards/esp32_devkitc_wroom.overlay similarity index 100% rename from samples/bluetooth/hci_uart/boards/esp32.overlay rename to samples/bluetooth/hci_uart/boards/esp32_devkitc_wroom.overlay diff --git a/samples/boards/esp32/deep_sleep/README.rst b/samples/boards/esp32/deep_sleep/README.rst index 9506709fa56b53..7d258b537c1e02 100644 --- a/samples/boards/esp32/deep_sleep/README.rst +++ b/samples/boards/esp32/deep_sleep/README.rst @@ -30,9 +30,9 @@ as wake-up source, deep sleep for 20 seconds, wake up. Requirements ************ -This example should be able to run on any commonly available :ref:`esp32` -development board without any extra hardware if only ``Timer`` is used as -wakeup source. +This example should be able to run on any commonly available +:ref:`esp32_devkitc_wroom` development board without any extra hardware if +only ``Timer`` is used as wakeup source. However, when ``EXT1`` is also enabled, GPIO2 and GPIO4 should be pulled-down by external resistors to avoid floating pins. When triggering a wake up, one diff --git a/samples/boards/esp32/deep_sleep/boards/esp32.conf b/samples/boards/esp32/deep_sleep/boards/esp32_devkitc_wroom.conf similarity index 100% rename from samples/boards/esp32/deep_sleep/boards/esp32.conf rename to samples/boards/esp32/deep_sleep/boards/esp32_devkitc_wroom.conf diff --git a/samples/boards/esp32/flash_encryption/README.rst b/samples/boards/esp32/flash_encryption/README.rst index 8eaf06835cb8f2..9d337083e8f9d8 100644 --- a/samples/boards/esp32/flash_encryption/README.rst +++ b/samples/boards/esp32/flash_encryption/README.rst @@ -69,7 +69,7 @@ Make sure you have your board connected over USB port. .. code-block:: console - west build -b esp32 samples/boards/esp32/flash_encryption + west build -b esp32_devkitc_wrover samples/boards/esp32/flash_encryption west flash Sample Output diff --git a/samples/boards/esp32/flash_encryption/boards/esp32.overlay b/samples/boards/esp32/flash_encryption/boards/esp32_devkitc_wroom.overlay similarity index 100% rename from samples/boards/esp32/flash_encryption/boards/esp32.overlay rename to samples/boards/esp32/flash_encryption/boards/esp32_devkitc_wroom.overlay diff --git a/samples/boards/esp32/flash_encryption/sample.yaml b/samples/boards/esp32/flash_encryption/sample.yaml index 22069c5bf6ad31..a5080d25275eeb 100644 --- a/samples/boards/esp32/flash_encryption/sample.yaml +++ b/samples/boards/esp32/flash_encryption/sample.yaml @@ -3,5 +3,5 @@ sample: name: flash_encryption tests: sample.board.esp32: - platform_allow: esp32 + platform_allow: esp32_devkitc_wroom tags: esp32 diff --git a/samples/boards/esp32/flash_encryption/src/main.c b/samples/boards/esp32/flash_encryption/src/main.c index adbc6326bcef9c..414376495ca145 100644 --- a/samples/boards/esp32/flash_encryption/src/main.c +++ b/samples/boards/esp32/flash_encryption/src/main.c @@ -16,7 +16,7 @@ #include LOG_MODULE_REGISTER(flash_encryption, CONFIG_LOG_DEFAULT_LEVEL); -#if !defined(CONFIG_SOC_ESP32) +#if !defined(CONFIG_SOC_SERIES_ESP32) #error Flash encryption feature is only available for ESP32 SOC yet. #endif diff --git a/samples/boards/esp32/spiram_test/README.rst b/samples/boards/esp32/spiram_test/README.rst index 3d4e13a6915ccc..b3dea1a682246f 100644 --- a/samples/boards/esp32/spiram_test/README.rst +++ b/samples/boards/esp32/spiram_test/README.rst @@ -29,7 +29,7 @@ Make sure you have your board connected over USB port. .. code-block:: console - west build -b esp32 samples/boards/esp32/spiram_test + west build -b esp32_devkitc_wrover samples/boards/esp32/spiram_test west flash If using another supported Espressif board, replace the argument in the above diff --git a/samples/boards/esp32/spiram_test/boards/esp32.conf b/samples/boards/esp32/spiram_test/boards/esp32_devkitc_wroom.conf similarity index 100% rename from samples/boards/esp32/spiram_test/boards/esp32.conf rename to samples/boards/esp32/spiram_test/boards/esp32_devkitc_wroom.conf diff --git a/samples/boards/esp32/spiram_test/sample.yaml b/samples/boards/esp32/spiram_test/sample.yaml index d8fa92d9b98bff..d8cbfaa62d7868 100644 --- a/samples/boards/esp32/spiram_test/sample.yaml +++ b/samples/boards/esp32/spiram_test/sample.yaml @@ -3,5 +3,5 @@ sample: name: spiram_test tests: sample.board.esp32.spiram: - platform_allow: esp32 + platform_allow: esp32_devkitc_wrover tags: esp32 diff --git a/samples/drivers/adc/boards/esp32.overlay b/samples/drivers/adc/boards/esp32_devkitc_wroom.overlay similarity index 100% rename from samples/drivers/adc/boards/esp32.overlay rename to samples/drivers/adc/boards/esp32_devkitc_wroom.overlay diff --git a/samples/drivers/adc/sample.yaml b/samples/drivers/adc/sample.yaml index 66a57fa561f908..678e0afd8802df 100644 --- a/samples/drivers/adc/sample.yaml +++ b/samples/drivers/adc/sample.yaml @@ -18,7 +18,7 @@ tests: - gd32f450i_eval - gd32vf103v_eval - gd32f403z_eval - - esp32 + - esp32_devkitc_wroom - esp32s2_saola - esp32c3_devkitm - gd32l233r_eval diff --git a/samples/drivers/counter/alarm/boards/esp32.overlay b/samples/drivers/counter/alarm/boards/esp32_devkitc_wroom.overlay similarity index 100% rename from samples/drivers/counter/alarm/boards/esp32.overlay rename to samples/drivers/counter/alarm/boards/esp32_devkitc_wroom.overlay diff --git a/samples/drivers/dac/boards/esp32.overlay b/samples/drivers/dac/boards/esp32_devkitc_wroom.overlay similarity index 100% rename from samples/drivers/dac/boards/esp32.overlay rename to samples/drivers/dac/boards/esp32_devkitc_wroom.overlay diff --git a/samples/drivers/dac/sample.yaml b/samples/drivers/dac/sample.yaml index 902371a18053ac..ee8ea042f5da1f 100644 --- a/samples/drivers/dac/sample.yaml +++ b/samples/drivers/dac/sample.yaml @@ -11,7 +11,7 @@ tests: - bl654_dvk - bl5340_dvk_cpuapp - disco_l475_iot1 - - esp32 + - esp32_devkitc_wroom - esp32s2_saola - frdm_k22f - frdm_k64f diff --git a/samples/drivers/ipm/ipm_esp32/boards/esp32.overlay b/samples/drivers/ipm/ipm_esp32/boards/esp32_devkitc_wroom.overlay similarity index 100% rename from samples/drivers/ipm/ipm_esp32/boards/esp32.overlay rename to samples/drivers/ipm/ipm_esp32/boards/esp32_devkitc_wroom.overlay diff --git a/samples/drivers/ipm/ipm_esp32/boards/esp32_devkitc_wrover.overlay b/samples/drivers/ipm/ipm_esp32/boards/esp32_devkitc_wrover.overlay new file mode 100644 index 00000000000000..80f7950333f2b2 --- /dev/null +++ b/samples/drivers/ipm/ipm_esp32/boards/esp32_devkitc_wrover.overlay @@ -0,0 +1,3 @@ +&ipm0 { + status = "okay"; +}; diff --git a/samples/drivers/ipm/ipm_esp32/sample.yaml b/samples/drivers/ipm/ipm_esp32/sample.yaml index aa6092ac48abfb..e28e4474e9840c 100644 --- a/samples/drivers/ipm/ipm_esp32/sample.yaml +++ b/samples/drivers/ipm/ipm_esp32/sample.yaml @@ -2,7 +2,7 @@ sample: name: ESP32 IPM Sample tests: sample.ipm.ipm_esp32: - platform_allow: esp32 + platform_allow: esp32_devkitc_wroom tags: - samples - ipm diff --git a/samples/drivers/watchdog/boards/esp32.conf b/samples/drivers/watchdog/boards/esp32_devkitc_wroom.conf similarity index 100% rename from samples/drivers/watchdog/boards/esp32.conf rename to samples/drivers/watchdog/boards/esp32_devkitc_wroom.conf diff --git a/samples/net/wifi/boards/esp32.conf b/samples/net/wifi/boards/esp32_devkitc_wroom.conf similarity index 100% rename from samples/net/wifi/boards/esp32.conf rename to samples/net/wifi/boards/esp32_devkitc_wroom.conf diff --git a/samples/net/wifi/boards/esp32.overlay b/samples/net/wifi/boards/esp32_devkitc_wroom.overlay similarity index 100% rename from samples/net/wifi/boards/esp32.overlay rename to samples/net/wifi/boards/esp32_devkitc_wroom.overlay diff --git a/samples/net/wifi/boards/esp32_devkitc_wrover.conf b/samples/net/wifi/boards/esp32_devkitc_wrover.conf new file mode 100644 index 00000000000000..5c37cfc402d35f --- /dev/null +++ b/samples/net/wifi/boards/esp32_devkitc_wrover.conf @@ -0,0 +1,12 @@ +CONFIG_WIFI=y +CONFIG_HEAP_MEM_POOL_SIZE=98304 + +CONFIG_NETWORKING=y +CONFIG_NET_L2_ETHERNET=y + +CONFIG_NET_IPV6=n +CONFIG_NET_IPV4=y +CONFIG_NET_DHCPV4=y +CONFIG_ESP32_WIFI_STA_AUTO_DHCPV4=y + +CONFIG_NET_LOG=y diff --git a/samples/net/wifi/boards/esp32_devkitc_wrover.overlay b/samples/net/wifi/boards/esp32_devkitc_wrover.overlay new file mode 100644 index 00000000000000..ea9865cf5f8a3f --- /dev/null +++ b/samples/net/wifi/boards/esp32_devkitc_wrover.overlay @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2022 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&wifi { + status = "okay"; +}; diff --git a/samples/sensor/grow_r502a/boards/esp32.overlay b/samples/sensor/grow_r502a/boards/esp32_devkitc_wroom.overlay similarity index 100% rename from samples/sensor/grow_r502a/boards/esp32.overlay rename to samples/sensor/grow_r502a/boards/esp32_devkitc_wroom.overlay diff --git a/samples/subsys/ipc/rpmsg_service/boards/esp32.conf b/samples/subsys/ipc/rpmsg_service/boards/esp32_devkitc_wroom.conf similarity index 100% rename from samples/subsys/ipc/rpmsg_service/boards/esp32.conf rename to samples/subsys/ipc/rpmsg_service/boards/esp32_devkitc_wroom.conf diff --git a/samples/subsys/ipc/rpmsg_service/boards/esp32.overlay b/samples/subsys/ipc/rpmsg_service/boards/esp32_devkitc_wroom.overlay similarity index 100% rename from samples/subsys/ipc/rpmsg_service/boards/esp32.overlay rename to samples/subsys/ipc/rpmsg_service/boards/esp32_devkitc_wroom.overlay diff --git a/samples/subsys/nvs/boards/esp32.conf b/samples/subsys/nvs/boards/esp32_devkitc_wroom.conf similarity index 100% rename from samples/subsys/nvs/boards/esp32.conf rename to samples/subsys/nvs/boards/esp32_devkitc_wroom.conf diff --git a/samples/subsys/settings/boards/esp32.conf b/samples/subsys/settings/boards/esp32_devkitc_wroom.conf similarity index 100% rename from samples/subsys/settings/boards/esp32.conf rename to samples/subsys/settings/boards/esp32_devkitc_wroom.conf diff --git a/soc/riscv/esp32c3/Kconfig.defconfig b/soc/riscv/esp32c3/Kconfig.defconfig deleted file mode 100644 index adc9eca040ea2c..00000000000000 --- a/soc/riscv/esp32c3/Kconfig.defconfig +++ /dev/null @@ -1,54 +0,0 @@ -# ESP32C3 board configuration - -# Copyright (c) 2021 Espressif Systems (Shanghai) Co., Ltd. -# SPDX-License-Identifier: Apache-2.0 - -if SOC_ESP32C3 - -if BOOTLOADER_MCUBOOT - -config HAS_FLASH_LOAD_OFFSET - default y - -config MCUBOOT_GENERATE_UNSIGNED_IMAGE - default y - -config MCUBOOT_GENERATE_CONFIRMED_IMAGE - default y - -config ROM_START_OFFSET - default 0x20 - -endif - -config SOC - default "esp32c3" - -config NUM_IRQS - default 62 - -config GEN_ISR_TABLES - default y - -config GEN_SW_ISR_TABLE - default y - -config GEN_IRQ_VECTOR_TABLE - default n - -config DYNAMIC_INTERRUPTS - default y - -config ISR_STACK_SIZE - default 2048 - -config ATOMIC_OPERATIONS_C - default y - -config MINIMAL_LIBC_OPTIMIZE_STRING_FOR_SIZE - default n - -config SYS_CLOCK_HW_CYCLES_PER_SEC - default 16000000 - -endif diff --git a/soc/riscv/espressif_esp32/CMakeLists.txt b/soc/riscv/espressif_esp32/CMakeLists.txt new file mode 100644 index 00000000000000..31ef76aadeef99 --- /dev/null +++ b/soc/riscv/espressif_esp32/CMakeLists.txt @@ -0,0 +1,5 @@ +# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(${SOC_SERIES}) +add_subdirectory(common) diff --git a/soc/riscv/espressif_esp32/Kconfig b/soc/riscv/espressif_esp32/Kconfig new file mode 100644 index 00000000000000..0a6d3f90be9837 --- /dev/null +++ b/soc/riscv/espressif_esp32/Kconfig @@ -0,0 +1,16 @@ +# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. +# SPDX-License-Identifier: Apache-2.0 + +config SOC_FAMILY_ESP32 + bool + +if SOC_FAMILY_ESP32 + +config SOC_FAMILY + string + default "espressif_esp32" + +source "soc/riscv/espressif_esp32/common/Kconfig.soc" +source "soc/riscv/espressif_esp32/*/Kconfig.soc" + +endif # SOC_FAMILY_ESP32 diff --git a/soc/riscv/espressif_esp32/Kconfig.defconfig b/soc/riscv/espressif_esp32/Kconfig.defconfig new file mode 100644 index 00000000000000..ee9d04c4daba5a --- /dev/null +++ b/soc/riscv/espressif_esp32/Kconfig.defconfig @@ -0,0 +1,5 @@ +# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. +# SPDX-License-Identifier: Apache-2.0 + +source "soc/riscv/espressif_esp32/common/Kconfig.defconfig.series" +source "soc/riscv/espressif_esp32/*/Kconfig.defconfig.series" diff --git a/soc/riscv/espressif_esp32/Kconfig.soc b/soc/riscv/espressif_esp32/Kconfig.soc new file mode 100644 index 00000000000000..ce15ddcf10e3ab --- /dev/null +++ b/soc/riscv/espressif_esp32/Kconfig.soc @@ -0,0 +1,4 @@ +# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. +# SPDX-License-Identifier: Apache-2.0 + +source "soc/riscv/espressif_esp32/*/Kconfig.series" diff --git a/soc/riscv/espressif_esp32/common/CMakeLists.txt b/soc/riscv/espressif_esp32/common/CMakeLists.txt new file mode 100644 index 00000000000000..9edbe85c8217b7 --- /dev/null +++ b/soc/riscv/espressif_esp32/common/CMakeLists.txt @@ -0,0 +1,2 @@ +# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. +# SPDX-License-Identifier: Apache-2.0 diff --git a/soc/riscv/espressif_esp32/common/Kconfig.defconfig.series b/soc/riscv/espressif_esp32/common/Kconfig.defconfig.series new file mode 100644 index 00000000000000..a0a4b4f49432dc --- /dev/null +++ b/soc/riscv/espressif_esp32/common/Kconfig.defconfig.series @@ -0,0 +1,52 @@ +# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. +# SPDX-License-Identifier: Apache-2.0 + +if SOC_FAMILY_ESP32 + +config GEN_ISR_TABLES + default y + +config GEN_SW_ISR_TABLE + default y + +config GEN_IRQ_VECTOR_TABLE + default n + +config DYNAMIC_INTERRUPTS + default y + +config ISR_STACK_SIZE + default 2048 + +config ATOMIC_OPERATIONS_C + default y + +config MINIMAL_LIBC_OPTIMIZE_STRING_FOR_SIZE + default n + +config SYS_CLOCK_HW_CYCLES_PER_SEC + default 16000000 + +config SYS_CLOCK_TICKS_PER_SEC + default 1000 + +config MINIMAL_LIBC_OPTIMIZE_STRING_FOR_SIZE + default n + +config CLOCK_CONTROL + default y + +if BOOTLOADER_MCUBOOT + + config HAS_FLASH_LOAD_OFFSET + default y + config MCUBOOT_GENERATE_UNSIGNED_IMAGE + default y + config MCUBOOT_GENERATE_CONFIRMED_IMAGE + default y + config ROM_START_OFFSET + default 0x20 + +endif # BOOTLOADER_MCUBOOT config + +endif # SOC_FAMILY_ESP32 diff --git a/soc/riscv/espressif_esp32/common/Kconfig.soc b/soc/riscv/espressif_esp32/common/Kconfig.soc new file mode 100644 index 00000000000000..5eb40f3b3405e8 --- /dev/null +++ b/soc/riscv/espressif_esp32/common/Kconfig.soc @@ -0,0 +1,15 @@ +# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. +# SPDX-License-Identifier: Apache-2.0 + +if SOC_FAMILY_ESP32 + +config ESPTOOLPY_FLASHFREQ_80M + bool + +config FLASH_SIZE + int + +config FLASH_BASE_ADDRESS + hex + +endif # SOC_FAMILY_ESP32 diff --git a/soc/riscv/esp32c3/CMakeLists.txt b/soc/riscv/espressif_esp32/esp32c3/CMakeLists.txt similarity index 98% rename from soc/riscv/esp32c3/CMakeLists.txt rename to soc/riscv/espressif_esp32/esp32c3/CMakeLists.txt index 49c3f57b9e89c8..8f27b8d9d3e693 100644 --- a/soc/riscv/esp32c3/CMakeLists.txt +++ b/soc/riscv/espressif_esp32/esp32c3/CMakeLists.txt @@ -39,7 +39,7 @@ if(CONFIG_BOOTLOADER_ESP_IDF) ${CMAKE_COMMAND} -G${CMAKE_GENERATOR} -S ${espidf_components_dir}/bootloader/subproject -B ${espidf_build_dir}/bootloader -DSDKCONFIG=${espidf_build_dir}/sdkconfig - -DIDF_PATH=${ESP_IDF_PATH} -DIDF_TARGET=${CONFIG_SOC} + -DIDF_PATH=${ESP_IDF_PATH} -DIDF_TARGET=${CONFIG_SOC_SERIES} -DPYTHON_DEPS_CHECKED=1 -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} diff --git a/soc/riscv/espressif_esp32/esp32c3/Kconfig.defconfig.series b/soc/riscv/espressif_esp32/esp32c3/Kconfig.defconfig.series new file mode 100644 index 00000000000000..50d52b3f5bfc3b --- /dev/null +++ b/soc/riscv/espressif_esp32/esp32c3/Kconfig.defconfig.series @@ -0,0 +1,21 @@ +# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. +# SPDX-License-Identifier: Apache-2.0 + +if SOC_SERIES_ESP32C3 + +config SOC_SERIES + default "esp32c3" + +config NUM_IRQS + default 62 + +config ESPTOOLPY_FLASHFREQ_80M + default y + +config FLASH_SIZE + default $(dt_node_reg_size_int,/soc/flash-controller@60002000/flash@0,0) + +config FLASH_BASE_ADDRESS + default $(dt_node_reg_addr_hex,/soc/flash-controller@60002000/flash@0) + +endif # SOC_SERIES_ESP32C3 diff --git a/soc/riscv/espressif_esp32/esp32c3/Kconfig.series b/soc/riscv/espressif_esp32/esp32c3/Kconfig.series new file mode 100644 index 00000000000000..d506898f5b2362 --- /dev/null +++ b/soc/riscv/espressif_esp32/esp32c3/Kconfig.series @@ -0,0 +1,20 @@ +# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. +# SPDX-License-Identifier: Apache-2.0 + +config SOC_SERIES_ESP32C3 + bool "ESP32C3" + select RISCV + select RISCV_GP + select DYNAMIC_INTERRUPTS + select CLOCK_CONTROL + select PINCTRL + select RISCV_ISA_RV32I + select RISCV_ISA_EXT_M + select RISCV_ISA_EXT_C + select RISCV_ISA_EXT_ZICSR + select HAS_ESPRESSIF_HAL + select SOC_FAMILY_ESP32 + select XIP if !MCUBOOT + select HAS_PM + help + Enable support for Espressif ESP32-C3 diff --git a/soc/riscv/esp32c3/Kconfig.soc b/soc/riscv/espressif_esp32/esp32c3/Kconfig.soc similarity index 78% rename from soc/riscv/esp32c3/Kconfig.soc rename to soc/riscv/espressif_esp32/esp32c3/Kconfig.soc index 56d2a64a63ced8..dce91fcc86a448 100644 --- a/soc/riscv/esp32c3/Kconfig.soc +++ b/soc/riscv/espressif_esp32/esp32c3/Kconfig.soc @@ -1,42 +1,28 @@ -# Copyright (c) 2021 Espressif Systems (Shanghai) Co., Ltd. +# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. # SPDX-License-Identifier: Apache-2.0 -config SOC_ESP32C3 - bool "ESP32C3" - select RISCV - select RISCV_GP - select DYNAMIC_INTERRUPTS - select CLOCK_CONTROL - select PINCTRL - select XIP if !MCUBOOT - select HAS_ESPRESSIF_HAL - select RISCV_ISA_RV32I - select RISCV_ISA_EXT_M - select RISCV_ISA_EXT_C - select RISCV_ISA_EXT_ZICSR - select HAS_PM - -if SOC_ESP32C3 - -config SOC_FAMILY_ESP32 - bool - default y +if SOC_SERIES_ESP32C3 config IDF_TARGET_ESP32C3 bool "ESP32C3 as target board" default y -config ESPTOOLPY_FLASHFREQ_80M - bool - default y +choice SOC_PART_NUMBER + prompt "ESP32-C3 SOC Selection" + depends on SOC_SERIES_ESP32C3 -config FLASH_SIZE - int - default $(dt_node_reg_size_int,/soc/flash-controller@60002000/flash@0,0) + config SOC_ESP32C3 + bool "ESP32C3" + config SOC_ESP32C3_FX4 + bool "ESP32C3_FX4" + config SOC_ESP32C3_MINI_N4 + bool "ESP32C3_MINI_N4" + config SOC_ESP32C3_WROOM_H2 + bool "ESP32C3_MINI_N4" + config SOC_ESP32C3_WROOM_H4 + bool "ESP32C3_MINI_N4" -config FLASH_BASE_ADDRESS - hex - default $(dt_node_reg_addr_hex,/soc/flash-controller@60002000/flash@0) +endchoice # SOC_PART_NUMBER config ESP_SYSTEM_RTC_EXT_XTAL bool @@ -64,7 +50,7 @@ config ESP32C3_RTC_CLK_SRC_EXT_OSC config ESP32C3_RTC_CLK_SRC_INT_8MD256 bool "Internal 8MHz oscillator, divided by 256 (~32kHz)" -endchoice +endchoice # ESP32C3_RTC_CLK_SRC config ESP32C3_RTC_CLK_CAL_CYCLES int "Number of cycles for RTC_SLOW_CLK calibration" @@ -102,7 +88,7 @@ config ESP32_PHY_MAX_TX_POWER config MAC_BB_PD bool "Power down MAC and baseband of Wi-Fi and Bluetooth when PHY is disabled" - depends on SOC_ESP32C3 && TICKLESS_KERNEL + depends on SOC_SERIES_ESP32C3 && TICKLESS_KERNEL default n help If enabled, the MAC and baseband of Wi-Fi and Bluetooth will be powered @@ -110,4 +96,4 @@ config MAC_BB_PD by a small amount but increases RAM use by approximately 4 KB(Wi-Fi only), 2 KB(Bluetooth only) or 5.3 KB(Wi-Fi + Bluetooth). -endif +endif # SOC_SERIES_ESP32C3 diff --git a/soc/riscv/esp32c3/default.ld b/soc/riscv/espressif_esp32/esp32c3/default.ld similarity index 100% rename from soc/riscv/esp32c3/default.ld rename to soc/riscv/espressif_esp32/esp32c3/default.ld diff --git a/soc/riscv/esp32c3/idle.c b/soc/riscv/espressif_esp32/esp32c3/idle.c similarity index 100% rename from soc/riscv/esp32c3/idle.c rename to soc/riscv/espressif_esp32/esp32c3/idle.c diff --git a/soc/riscv/esp32c3/linker.ld b/soc/riscv/espressif_esp32/esp32c3/linker.ld similarity index 100% rename from soc/riscv/esp32c3/linker.ld rename to soc/riscv/espressif_esp32/esp32c3/linker.ld diff --git a/soc/riscv/esp32c3/loader.c b/soc/riscv/espressif_esp32/esp32c3/loader.c similarity index 97% rename from soc/riscv/esp32c3/loader.c rename to soc/riscv/espressif_esp32/esp32c3/loader.c index bf1665d76eb335..d4740fd23549ee 100644 --- a/soc/riscv/esp32c3/loader.c +++ b/soc/riscv/espressif_esp32/esp32c3/loader.c @@ -18,7 +18,7 @@ #ifdef CONFIG_BOOTLOADER_MCUBOOT #define BOOT_LOG_INF(_fmt, ...) \ - ets_printf("[" CONFIG_SOC "] [INF] " _fmt "\n\r", ##__VA_ARGS__) + ets_printf("[" CONFIG_SOC_SERIES "] [INF] " _fmt "\n\r", ##__VA_ARGS__) #define HDR_ATTR __attribute__((section(".entry_addr"))) __attribute__((used)) diff --git a/soc/riscv/esp32c3/mcuboot.ld b/soc/riscv/espressif_esp32/esp32c3/mcuboot.ld similarity index 100% rename from soc/riscv/esp32c3/mcuboot.ld rename to soc/riscv/espressif_esp32/esp32c3/mcuboot.ld diff --git a/soc/riscv/esp32c3/pinctrl_soc.h b/soc/riscv/espressif_esp32/esp32c3/pinctrl_soc.h similarity index 100% rename from soc/riscv/esp32c3/pinctrl_soc.h rename to soc/riscv/espressif_esp32/esp32c3/pinctrl_soc.h diff --git a/soc/riscv/esp32c3/power.c b/soc/riscv/espressif_esp32/esp32c3/power.c similarity index 100% rename from soc/riscv/esp32c3/power.c rename to soc/riscv/espressif_esp32/esp32c3/power.c diff --git a/soc/riscv/esp32c3/soc.c b/soc/riscv/espressif_esp32/esp32c3/soc.c similarity index 100% rename from soc/riscv/esp32c3/soc.c rename to soc/riscv/espressif_esp32/esp32c3/soc.c diff --git a/soc/riscv/esp32c3/soc.h b/soc/riscv/espressif_esp32/esp32c3/soc.h similarity index 100% rename from soc/riscv/esp32c3/soc.h rename to soc/riscv/espressif_esp32/esp32c3/soc.h diff --git a/soc/riscv/esp32c3/soc_irq.S b/soc/riscv/espressif_esp32/esp32c3/soc_irq.S similarity index 100% rename from soc/riscv/esp32c3/soc_irq.S rename to soc/riscv/espressif_esp32/esp32c3/soc_irq.S diff --git a/soc/riscv/esp32c3/soc_irq.c b/soc/riscv/espressif_esp32/esp32c3/soc_irq.c similarity index 100% rename from soc/riscv/esp32c3/soc_irq.c rename to soc/riscv/espressif_esp32/esp32c3/soc_irq.c diff --git a/soc/riscv/esp32c3/vectors.S b/soc/riscv/espressif_esp32/esp32c3/vectors.S similarity index 100% rename from soc/riscv/esp32c3/vectors.S rename to soc/riscv/espressif_esp32/esp32c3/vectors.S diff --git a/soc/xtensa/esp32/include/_soc_inthandlers.h b/soc/xtensa/esp32/include/_soc_inthandlers.h deleted file mode 100644 index 9d7e4b29b71407..00000000000000 --- a/soc/xtensa/esp32/include/_soc_inthandlers.h +++ /dev/null @@ -1,365 +0,0 @@ -/* - * THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT. - * - * Functions here are designed to produce efficient code to - * search an Xtensa bitmask of interrupts, inspecting only those bits - * declared to be associated with a given interrupt level. Each - * dispatcher will handle exactly one flagged interrupt, in numerical - * order (low bits first) and will return a mask of that bit that can - * then be cleared by the calling code. Unrecognized bits for the - * level will invoke an error handler. - */ - -#include -#include -#include - -#if !defined(XCHAL_INT0_LEVEL) || XCHAL_INT0_LEVEL != 1 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT1_LEVEL) || XCHAL_INT1_LEVEL != 1 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT2_LEVEL) || XCHAL_INT2_LEVEL != 1 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT3_LEVEL) || XCHAL_INT3_LEVEL != 1 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT4_LEVEL) || XCHAL_INT4_LEVEL != 1 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT5_LEVEL) || XCHAL_INT5_LEVEL != 1 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT6_LEVEL) || XCHAL_INT6_LEVEL != 1 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT7_LEVEL) || XCHAL_INT7_LEVEL != 1 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT8_LEVEL) || XCHAL_INT8_LEVEL != 1 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT9_LEVEL) || XCHAL_INT9_LEVEL != 1 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT10_LEVEL) || XCHAL_INT10_LEVEL != 1 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT12_LEVEL) || XCHAL_INT12_LEVEL != 1 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT13_LEVEL) || XCHAL_INT13_LEVEL != 1 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT17_LEVEL) || XCHAL_INT17_LEVEL != 1 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT18_LEVEL) || XCHAL_INT18_LEVEL != 1 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT11_LEVEL) || XCHAL_INT11_LEVEL != 3 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT15_LEVEL) || XCHAL_INT15_LEVEL != 3 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT22_LEVEL) || XCHAL_INT22_LEVEL != 3 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT23_LEVEL) || XCHAL_INT23_LEVEL != 3 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT27_LEVEL) || XCHAL_INT27_LEVEL != 3 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT29_LEVEL) || XCHAL_INT29_LEVEL != 3 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT14_LEVEL) || XCHAL_INT14_LEVEL != 7 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT16_LEVEL) || XCHAL_INT16_LEVEL != 5 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT26_LEVEL) || XCHAL_INT26_LEVEL != 5 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT31_LEVEL) || XCHAL_INT31_LEVEL != 5 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT19_LEVEL) || XCHAL_INT19_LEVEL != 2 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT20_LEVEL) || XCHAL_INT20_LEVEL != 2 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT21_LEVEL) || XCHAL_INT21_LEVEL != 2 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT24_LEVEL) || XCHAL_INT24_LEVEL != 4 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT25_LEVEL) || XCHAL_INT25_LEVEL != 4 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT28_LEVEL) || XCHAL_INT28_LEVEL != 4 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT30_LEVEL) || XCHAL_INT30_LEVEL != 4 -#error core-isa.h interrupt level does not match dispatcher! -#endif - -static inline int _xtensa_handle_one_int1(unsigned int mask) -{ - int irq; - - if (mask & 0x7f) { - if (mask & 0x7) { - if (mask & BIT(0)) { - mask = BIT(0); - irq = 0; - goto handle_irq; - } - if (mask & BIT(1)) { - mask = BIT(1); - irq = 1; - goto handle_irq; - } - if (mask & BIT(2)) { - mask = BIT(2); - irq = 2; - goto handle_irq; - } - } else { - if (mask & 0x18) { - if (mask & BIT(3)) { - mask = BIT(3); - irq = 3; - goto handle_irq; - } - if (mask & BIT(4)) { - mask = BIT(4); - irq = 4; - goto handle_irq; - } - } else { - if (mask & BIT(5)) { - mask = BIT(5); - irq = 5; - goto handle_irq; - } - if (mask & BIT(6)) { - mask = BIT(6); - irq = 6; - goto handle_irq; - } - } - } - } else { - if (mask & 0x780) { - if (mask & 0x180) { - if (mask & BIT(7)) { - mask = BIT(7); - irq = 7; - goto handle_irq; - } - if (mask & BIT(8)) { - mask = BIT(8); - irq = 8; - goto handle_irq; - } - } else { - if (mask & BIT(9)) { - mask = BIT(9); - irq = 9; - goto handle_irq; - } - if (mask & BIT(10)) { - mask = BIT(10); - irq = 10; - goto handle_irq; - } - } - } else { - if (mask & 0x3000) { - if (mask & BIT(12)) { - mask = BIT(12); - irq = 12; - goto handle_irq; - } - if (mask & BIT(13)) { - mask = BIT(13); - irq = 13; - goto handle_irq; - } - } else { - if (mask & BIT(17)) { - mask = BIT(17); - irq = 17; - goto handle_irq; - } - if (mask & BIT(18)) { - mask = BIT(18); - irq = 18; - goto handle_irq; - } - } - } - } - return 0; -handle_irq: - _sw_isr_table[irq].isr(_sw_isr_table[irq].arg); - return mask; -} - -static inline int _xtensa_handle_one_int3(unsigned int mask) -{ - int irq; - - if (mask & 0x408800) { - if (mask & BIT(11)) { - mask = BIT(11); - irq = 11; - goto handle_irq; - } - if (mask & BIT(15)) { - mask = BIT(15); - irq = 15; - goto handle_irq; - } - if (mask & BIT(22)) { - mask = BIT(22); - irq = 22; - goto handle_irq; - } - } else { - if (mask & BIT(23)) { - mask = BIT(23); - irq = 23; - goto handle_irq; - } - if (mask & BIT(27)) { - mask = BIT(27); - irq = 27; - goto handle_irq; - } - if (mask & BIT(29)) { - mask = BIT(29); - irq = 29; - goto handle_irq; - } - } - return 0; -handle_irq: - _sw_isr_table[irq].isr(_sw_isr_table[irq].arg); - return mask; -} - -static inline int _xtensa_handle_one_int7(unsigned int mask) -{ - int irq; - - if (mask & BIT(14)) { - mask = BIT(14); - irq = 14; - goto handle_irq; - } - return 0; -handle_irq: - _sw_isr_table[irq].isr(_sw_isr_table[irq].arg); - return mask; -} - -static inline int _xtensa_handle_one_int5(unsigned int mask) -{ - int irq; - - if (mask & BIT(16)) { - mask = BIT(16); - irq = 16; - goto handle_irq; - } - if (mask & BIT(26)) { - mask = BIT(26); - irq = 26; - goto handle_irq; - } - if (mask & BIT(31)) { - mask = BIT(31); - irq = 31; - goto handle_irq; - } - return 0; -handle_irq: - _sw_isr_table[irq].isr(_sw_isr_table[irq].arg); - return mask; -} - -static inline int _xtensa_handle_one_int2(unsigned int mask) -{ - int irq; - - if (mask & BIT(19)) { - mask = BIT(19); - irq = 19; - goto handle_irq; - } - if (mask & BIT(20)) { - mask = BIT(20); - irq = 20; - goto handle_irq; - } - if (mask & BIT(21)) { - mask = BIT(21); - irq = 21; - goto handle_irq; - } - return 0; -handle_irq: - _sw_isr_table[irq].isr(_sw_isr_table[irq].arg); - return mask; -} - -static inline int _xtensa_handle_one_int4(unsigned int mask) -{ - int irq; - - if (mask & 0x3000000) { - if (mask & BIT(24)) { - mask = BIT(24); - irq = 24; - goto handle_irq; - } - if (mask & BIT(25)) { - mask = BIT(25); - irq = 25; - goto handle_irq; - } - } else { - if (mask & BIT(28)) { - mask = BIT(28); - irq = 28; - goto handle_irq; - } - if (mask & BIT(30)) { - mask = BIT(30); - irq = 30; - goto handle_irq; - } - } - return 0; -handle_irq: - _sw_isr_table[irq].isr(_sw_isr_table[irq].arg); - return mask; -} - -static inline int _xtensa_handle_one_int0(unsigned int mask) -{ - return 0; -} -static inline int _xtensa_handle_one_int6(unsigned int mask) -{ - return 0; -} diff --git a/soc/xtensa/esp32s2/Kconfig.defconfig b/soc/xtensa/esp32s2/Kconfig.defconfig deleted file mode 100644 index 24e829d5d43abf..00000000000000 --- a/soc/xtensa/esp32s2/Kconfig.defconfig +++ /dev/null @@ -1,55 +0,0 @@ -# ESP32S2 board configuration - -# Copyright (c) 2021 Espressif Systems (Shanghai) Co., Ltd. -# SPDX-License-Identifier: Apache-2.0 - -if SOC_ESP32S2 - -if BOOTLOADER_MCUBOOT - -config HAS_FLASH_LOAD_OFFSET - default y - -config MCUBOOT_GENERATE_UNSIGNED_IMAGE - default y - -config MCUBOOT_GENERATE_CONFIRMED_IMAGE - default y - -config ROM_START_OFFSET - default 0x20 - -endif - -config SOC - default "esp32s2" - -config SOC_TOOLCHAIN_NAME - string - default "espressif_esp32s2" - -config GEN_ISR_TABLES - default y - -config GEN_IRQ_VECTOR_TABLE - default n - -config ISR_STACK_SIZE - default 2048 - -config HEAP_MEM_POOL_SIZE - default 32768 - -config MP_MAX_NUM_CPUS - default 1 - -config MINIMAL_LIBC_OPTIMIZE_STRING_FOR_SIZE - default n - -config SYS_CLOCK_HW_CYCLES_PER_SEC - default $(dt_node_int_prop_int,/cpus/cpu@0,clock-frequency) - -config XTENSA_CCOUNT_HZ - default SYS_CLOCK_HW_CYCLES_PER_SEC - -endif diff --git a/soc/xtensa/esp32s3/include/_soc_inthandlers.h b/soc/xtensa/esp32s3/include/_soc_inthandlers.h deleted file mode 100644 index 6980643e71dd4a..00000000000000 --- a/soc/xtensa/esp32s3/include/_soc_inthandlers.h +++ /dev/null @@ -1,371 +0,0 @@ -/* - * Copyright (c) 2022 Espressif Systems (Shanghai) Co., Ltd. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* - * THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT. - * - * Functions here are designed to produce efficient code to - * search an Xtensa bitmask of interrupts, inspecting only those bits - * declared to be associated with a given interrupt level. Each - * dispatcher will handle exactly one flagged interrupt, in numerical - * order (low bits first) and will return a mask of that bit that can - * then be cleared by the calling code. Unrecognized bits for the - * level will invoke an error handler. - */ - -#include -#include -#include - -#if !defined(XCHAL_INT0_LEVEL) || XCHAL_INT0_LEVEL != 1 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT1_LEVEL) || XCHAL_INT1_LEVEL != 1 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT2_LEVEL) || XCHAL_INT2_LEVEL != 1 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT3_LEVEL) || XCHAL_INT3_LEVEL != 1 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT4_LEVEL) || XCHAL_INT4_LEVEL != 1 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT5_LEVEL) || XCHAL_INT5_LEVEL != 1 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT6_LEVEL) || XCHAL_INT6_LEVEL != 1 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT7_LEVEL) || XCHAL_INT7_LEVEL != 1 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT8_LEVEL) || XCHAL_INT8_LEVEL != 1 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT9_LEVEL) || XCHAL_INT9_LEVEL != 1 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT10_LEVEL) || XCHAL_INT10_LEVEL != 1 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT12_LEVEL) || XCHAL_INT12_LEVEL != 1 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT13_LEVEL) || XCHAL_INT13_LEVEL != 1 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT17_LEVEL) || XCHAL_INT17_LEVEL != 1 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT18_LEVEL) || XCHAL_INT18_LEVEL != 1 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT11_LEVEL) || XCHAL_INT11_LEVEL != 3 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT15_LEVEL) || XCHAL_INT15_LEVEL != 3 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT22_LEVEL) || XCHAL_INT22_LEVEL != 3 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT23_LEVEL) || XCHAL_INT23_LEVEL != 3 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT27_LEVEL) || XCHAL_INT27_LEVEL != 3 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT29_LEVEL) || XCHAL_INT29_LEVEL != 3 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT14_LEVEL) || XCHAL_INT14_LEVEL != 7 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT16_LEVEL) || XCHAL_INT16_LEVEL != 5 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT26_LEVEL) || XCHAL_INT26_LEVEL != 5 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT31_LEVEL) || XCHAL_INT31_LEVEL != 5 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT19_LEVEL) || XCHAL_INT19_LEVEL != 2 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT20_LEVEL) || XCHAL_INT20_LEVEL != 2 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT21_LEVEL) || XCHAL_INT21_LEVEL != 2 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT24_LEVEL) || XCHAL_INT24_LEVEL != 4 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT25_LEVEL) || XCHAL_INT25_LEVEL != 4 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT28_LEVEL) || XCHAL_INT28_LEVEL != 4 -#error core-isa.h interrupt level does not match dispatcher! -#endif -#if !defined(XCHAL_INT30_LEVEL) || XCHAL_INT30_LEVEL != 4 -#error core-isa.h interrupt level does not match dispatcher! -#endif - -static inline int _xtensa_handle_one_int1(unsigned int mask) -{ - int irq; - - if (mask & 0x7f) { - if (mask & 0x7) { - if (mask & BIT(0)) { - mask = BIT(0); - irq = 0; - goto handle_irq; - } - if (mask & BIT(1)) { - mask = BIT(1); - irq = 1; - goto handle_irq; - } - if (mask & BIT(2)) { - mask = BIT(2); - irq = 2; - goto handle_irq; - } - } else { - if (mask & 0x18) { - if (mask & BIT(3)) { - mask = BIT(3); - irq = 3; - goto handle_irq; - } - if (mask & BIT(4)) { - mask = BIT(4); - irq = 4; - goto handle_irq; - } - } else { - if (mask & BIT(5)) { - mask = BIT(5); - irq = 5; - goto handle_irq; - } - if (mask & BIT(6)) { - mask = BIT(6); - irq = 6; - goto handle_irq; - } - } - } - } else { - if (mask & 0x780) { - if (mask & 0x180) { - if (mask & BIT(7)) { - mask = BIT(7); - irq = 7; - goto handle_irq; - } - if (mask & BIT(8)) { - mask = BIT(8); - irq = 8; - goto handle_irq; - } - } else { - if (mask & BIT(9)) { - mask = BIT(9); - irq = 9; - goto handle_irq; - } - if (mask & BIT(10)) { - mask = BIT(10); - irq = 10; - goto handle_irq; - } - } - } else { - if (mask & 0x3000) { - if (mask & BIT(12)) { - mask = BIT(12); - irq = 12; - goto handle_irq; - } - if (mask & BIT(13)) { - mask = BIT(13); - irq = 13; - goto handle_irq; - } - } else { - if (mask & BIT(17)) { - mask = BIT(17); - irq = 17; - goto handle_irq; - } - if (mask & BIT(18)) { - mask = BIT(18); - irq = 18; - goto handle_irq; - } - } - } - } - return 0; -handle_irq: - _sw_isr_table[irq].isr(_sw_isr_table[irq].arg); - return mask; -} - -static inline int _xtensa_handle_one_int3(unsigned int mask) -{ - int irq; - - if (mask & 0x408800) { - if (mask & BIT(11)) { - mask = BIT(11); - irq = 11; - goto handle_irq; - } - if (mask & BIT(15)) { - mask = BIT(15); - irq = 15; - goto handle_irq; - } - if (mask & BIT(22)) { - mask = BIT(22); - irq = 22; - goto handle_irq; - } - } else { - if (mask & BIT(23)) { - mask = BIT(23); - irq = 23; - goto handle_irq; - } - if (mask & BIT(27)) { - mask = BIT(27); - irq = 27; - goto handle_irq; - } - if (mask & BIT(29)) { - mask = BIT(29); - irq = 29; - goto handle_irq; - } - } - return 0; -handle_irq: - _sw_isr_table[irq].isr(_sw_isr_table[irq].arg); - return mask; -} - -static inline int _xtensa_handle_one_int7(unsigned int mask) -{ - int irq; - - if (mask & BIT(14)) { - mask = BIT(14); - irq = 14; - goto handle_irq; - } - return 0; -handle_irq: - _sw_isr_table[irq].isr(_sw_isr_table[irq].arg); - return mask; -} - -static inline int _xtensa_handle_one_int5(unsigned int mask) -{ - int irq; - - if (mask & BIT(16)) { - mask = BIT(16); - irq = 16; - goto handle_irq; - } - if (mask & BIT(26)) { - mask = BIT(26); - irq = 26; - goto handle_irq; - } - if (mask & BIT(31)) { - mask = BIT(31); - irq = 31; - goto handle_irq; - } - return 0; -handle_irq: - _sw_isr_table[irq].isr(_sw_isr_table[irq].arg); - return mask; -} - -static inline int _xtensa_handle_one_int2(unsigned int mask) -{ - int irq; - - if (mask & BIT(19)) { - mask = BIT(19); - irq = 19; - goto handle_irq; - } - if (mask & BIT(20)) { - mask = BIT(20); - irq = 20; - goto handle_irq; - } - if (mask & BIT(21)) { - mask = BIT(21); - irq = 21; - goto handle_irq; - } - return 0; -handle_irq: - _sw_isr_table[irq].isr(_sw_isr_table[irq].arg); - return mask; -} - -static inline int _xtensa_handle_one_int4(unsigned int mask) -{ - int irq; - - if (mask & 0x3000000) { - if (mask & BIT(24)) { - mask = BIT(24); - irq = 24; - goto handle_irq; - } - if (mask & BIT(25)) { - mask = BIT(25); - irq = 25; - goto handle_irq; - } - } else { - if (mask & BIT(28)) { - mask = BIT(28); - irq = 28; - goto handle_irq; - } - if (mask & BIT(30)) { - mask = BIT(30); - irq = 30; - goto handle_irq; - } - } - return 0; -handle_irq: - _sw_isr_table[irq].isr(_sw_isr_table[irq].arg); - return mask; -} - -static inline int _xtensa_handle_one_int0(unsigned int mask) -{ - return 0; -} -static inline int _xtensa_handle_one_int6(unsigned int mask) -{ - return 0; -} diff --git a/soc/xtensa/espressif_esp32/CMakeLists.txt b/soc/xtensa/espressif_esp32/CMakeLists.txt new file mode 100644 index 00000000000000..31ef76aadeef99 --- /dev/null +++ b/soc/xtensa/espressif_esp32/CMakeLists.txt @@ -0,0 +1,5 @@ +# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(${SOC_SERIES}) +add_subdirectory(common) diff --git a/soc/xtensa/espressif_esp32/Kconfig b/soc/xtensa/espressif_esp32/Kconfig new file mode 100644 index 00000000000000..31e176291ab8bc --- /dev/null +++ b/soc/xtensa/espressif_esp32/Kconfig @@ -0,0 +1,16 @@ +# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. +# SPDX-License-Identifier: Apache-2.0 + +config SOC_FAMILY_ESP32 + bool + +if SOC_FAMILY_ESP32 + +config SOC_FAMILY + string + default "espressif_esp32" + +source "soc/xtensa/espressif_esp32/common/Kconfig.soc" +source "soc/xtensa/espressif_esp32/*/Kconfig.soc" + +endif # SOC_FAMILY_ESP32 diff --git a/soc/xtensa/espressif_esp32/Kconfig.defconfig b/soc/xtensa/espressif_esp32/Kconfig.defconfig new file mode 100644 index 00000000000000..fedabb82b8c749 --- /dev/null +++ b/soc/xtensa/espressif_esp32/Kconfig.defconfig @@ -0,0 +1,5 @@ +# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. +# SPDX-License-Identifier: Apache-2.0 + +source "soc/xtensa/espressif_esp32/common/Kconfig.defconfig.series" +source "soc/xtensa/espressif_esp32/*/Kconfig.defconfig.series" diff --git a/soc/xtensa/espressif_esp32/Kconfig.soc b/soc/xtensa/espressif_esp32/Kconfig.soc new file mode 100644 index 00000000000000..6b28e800868952 --- /dev/null +++ b/soc/xtensa/espressif_esp32/Kconfig.soc @@ -0,0 +1,4 @@ +# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. +# SPDX-License-Identifier: Apache-2.0 + +source "soc/xtensa/espressif_esp32/*/Kconfig.series" diff --git a/soc/xtensa/espressif_esp32/common/CMakeLists.txt b/soc/xtensa/espressif_esp32/common/CMakeLists.txt new file mode 100644 index 00000000000000..e097e8ce4eec43 --- /dev/null +++ b/soc/xtensa/espressif_esp32/common/CMakeLists.txt @@ -0,0 +1,4 @@ +# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. +# SPDX-License-Identifier: Apache-2.0 + +zephyr_include_directories(include) diff --git a/soc/xtensa/esp32s3/Kconfig.defconfig b/soc/xtensa/espressif_esp32/common/Kconfig.defconfig.series similarity index 57% rename from soc/xtensa/esp32s3/Kconfig.defconfig rename to soc/xtensa/espressif_esp32/common/Kconfig.defconfig.series index 864bc13515623a..771976bc66d53c 100644 --- a/soc/xtensa/esp32s3/Kconfig.defconfig +++ b/soc/xtensa/espressif_esp32/common/Kconfig.defconfig.series @@ -1,41 +1,44 @@ -# ESP32 board configuration - -# Copyright (c) 2022 Espressif Systems (Shanghai) Co., Ltd. +# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. # SPDX-License-Identifier: Apache-2.0 -if SOC_ESP32S3 +if SOC_FAMILY_ESP32 -if BOOTLOADER_MCUBOOT - config HAS_FLASH_LOAD_OFFSET - default y +# Xtensa default options for ESP32 family +config XTENSA_RESET_VECTOR + default n - config MCUBOOT_GENERATE_UNSIGNED_IMAGE - default y +config XTENSA_USE_CORE_CRT1 + default n - config MCUBOOT_GENERATE_CONFIRMED_IMAGE - default y +config GEN_ISR_TABLES + default y - config ROM_START_OFFSET - default 0x20 -endif +config GEN_IRQ_VECTOR_TABLE + default n -config SOC - default "esp32s3" +config CLOCK_CONTROL + default y -config SOC_TOOLCHAIN_NAME - string - default "espressif_esp32s3" +config SYS_CLOCK_HW_CYCLES_PER_SEC + default $(dt_node_int_prop_int,/cpus/cpu@0,clock-frequency) -config HEAP_MEM_POOL_SIZE - default 32768 +config XTENSA_CCOUNT_HZ + default SYS_CLOCK_HW_CYCLES_PER_SEC config MINIMAL_LIBC_OPTIMIZE_STRING_FOR_SIZE default n -config SYS_CLOCK_HW_CYCLES_PER_SEC - default $(dt_node_int_prop_int,/cpus/cpu@0,clock-frequency) +if BOOTLOADER_MCUBOOT -config XTENSA_CCOUNT_HZ - default SYS_CLOCK_HW_CYCLES_PER_SEC + config HAS_FLASH_LOAD_OFFSET + default y + config MCUBOOT_GENERATE_UNSIGNED_IMAGE + default y + config MCUBOOT_GENERATE_CONFIRMED_IMAGE + default y + config ROM_START_OFFSET + default 0x20 + +endif # BOOTLOADER_MCUBOOT -endif +endif # SOC_FAMILY_ESP32 diff --git a/soc/xtensa/espressif_esp32/common/Kconfig.soc b/soc/xtensa/espressif_esp32/common/Kconfig.soc new file mode 100644 index 00000000000000..4cf8bf9095f824 --- /dev/null +++ b/soc/xtensa/espressif_esp32/common/Kconfig.soc @@ -0,0 +1,194 @@ +# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. +# SPDX-License-Identifier: Apache-2.0 + +if SOC_FAMILY_ESP32 + +config ESPTOOLPY_FLASHFREQ_80M + bool + +config FLASH_SIZE + int + +config FLASH_BASE_ADDRESS + hex + +config ESP_SPIRAM + bool "Support for external, SPI-connected RAM" + help + This enables support for an external SPI RAM chip, connected in + parallel with the main SPI flash chip. + +config ESP_HEAP_MIN_EXTRAM_THRESHOLD + int "Minimum threshold for external RAM allocation" + default 8192 + range 1024 131072 + depends on ESP_SPIRAM + help + Threshold to decide if memory will be allocated from DRAM + or SPIRAM. If value of allocation size is less than this value, + memory will be allocated from internal RAM. + +config ESP_HEAP_SEARCH_ALL_REGIONS + bool "Search for all available heap regions" + depends on ESP_SPIRAM + default y + help + This configuration enables searching all available heap + regions. If the region of desired capability is exhausted, + memory will be allocated from other available region. + +menu "SPI RAM config" + depends on ESP_SPIRAM + +choice SPIRAM_TYPE + prompt "Type of SPI RAM chip in use" + depends on ESP_SPIRAM + default SPIRAM_TYPE_ESPPSRAM16 + +config SPIRAM_TYPE_ESPPSRAM16 + bool "ESP-PSRAM16 or APS1604" + +config SPIRAM_TYPE_ESPPSRAM32 + bool "ESP-PSRAM32 or IS25WP032" + +config SPIRAM_TYPE_ESPPSRAM64 + bool "ESP-PSRAM64 or LY68L6400" + +endchoice # SPIRAM_TYPE + +config ESP_SPIRAM_SIZE + int "Size of SPIRAM part" + default 2097152 if SPIRAM_TYPE_ESPPSRAM16 + default 4194304 if SPIRAM_TYPE_ESPPSRAM32 + default 8388608 if SPIRAM_TYPE_ESPPSRAM64 + help + Specify size of SPIRAM part. + NOTE: If SPIRAM size is greater than 4MB, only + lower 4MB can be allocated using k_malloc(). + +choice SPIRAM_SPEED + prompt "Set RAM clock speed" + default SPIRAM_SPEED_40M + help + Select the speed for the SPI RAM chip. + If SPI RAM is enabled, we only support three combinations of SPI speed mode we supported now: + + 1. Flash SPI running at 40MHz and RAM SPI running at 40MHz + 2. Flash SPI running at 80MHz and RAM SPI running at 40MHz + 3. Flash SPI running at 80MHz and RAM SPI running at 80MHz + + Note: If the third mode(80MHz+80MHz) is enabled for SPI RAM of type 32MBit, one of the HSPI/VSPI host + will be occupied by the system. Which SPI host to use can be selected by the config item + SPIRAM_OCCUPY_SPI_HOST. Application code should never touch HSPI/VSPI hardware in this case. The + option to select 80MHz will only be visible if the flash SPI speed is also 80MHz. + (ESPTOOLPY_FLASHFREQ_79M is true) + +config SPIRAM_SPEED_26M + bool "26MHz clock speed" + depends on SOC_SERIES_ESP32S2 + +config SPIRAM_SPEED_20M + bool "20MHz clock speed" + depends on SOC_SERIES_ESP32S2 + +config SPIRAM_SPEED_40M + bool "40MHz clock speed" + +config SPIRAM_SPEED_80M + depends on ESPTOOLPY_FLASHFREQ_80M + bool "80MHz clock speed" + +endchoice # SPIRAM_SPEED + +menu "PSRAM clock and cs IO for ESP32-DOWD" + +config D0WD_PSRAM_CLK_IO + int "PSRAM CLK IO number" + range 0 33 + default 17 + help + The PSRAM CLOCK IO can be any unused GPIO, user can config it based on hardware design. If user use + 1.8V flash and 1.8V psram, this value can only be one of 6, 7, 8, 9, 10, 11, 16, 17. + +config D0WD_PSRAM_CS_IO + int "PSRAM CS IO number" + range 0 33 + default 16 + help + The PSRAM CS IO can be any unused GPIO, user can config it based on hardware design. If user use + 1.8V flash and 1.8V psram, this value can only be one of 6, 7, 8, 9, 10, 11, 16, 17. + +endmenu # PSRAM clock and cs IO for ESP32-DOWD + +menu "PSRAM clock and cs IO for ESP32-D2WD" + +config D2WD_PSRAM_CLK_IO + int "PSRAM CLK IO number" + range 0 33 + default 9 + help + User can config it based on hardware design. For ESP32-D2WD chip, the psram can only be 1.8V psram, + so this value can only be one of 6, 7, 8, 9, 10, 11, 16, 17. + +config D2WD_PSRAM_CS_IO + int "PSRAM CS IO number" + range 0 33 + default 10 + help + User can config it based on hardware design. For ESP32-D2WD chip, the psram can only be 1.8V psram, + so this value can only be one of 6, 7, 8, 9, 10, 11, 16, 17. + +endmenu # PSRAM clock and cs IO for ESP32-D2WD + +menu "PSRAM clock and cs IO for ESP32-PICO" + +config PICO_PSRAM_CS_IO + int "PSRAM CS IO number" + range 0 33 + default 10 + help + The PSRAM CS IO can be any unused GPIO, user can config it based on hardware design. + + For ESP32-PICO chip, the psram share clock with flash, so user do not need to configure the clock + IO. + For the reference hardware design, please refer to + https://www.espressif.com/sites/default/files/documentation/esp32-pico-d4_datasheet_en.pdf + +endmenu # PSRAM clock and cs IO for ESP32-PICO + +config SPIRAM_CUSTOM_SPIWP_SD3_PIN + bool "Use custom SPI PSRAM WP(SD3) Pin when flash pins set in eFuse (read help)" + default y if SPIRAM_SPIWP_SD3_PIN != 7 # backwards compatibility, can remove in IDF 5 + default n + help + This setting is only used if the SPI flash pins have been overridden by setting the eFuses + SPI_PAD_CONFIG_xxx, and the SPI flash mode is DIO or DOUT. + + When this is the case, the eFuse config only defines 3 of the 4 Quad I/O data pins. The WP pin (aka + ESP32 pin "SD_DATA_3" or SPI flash pin "IO2") is not specified in eFuse. The psram only has QPI + mode, so a WP pin setting is necessary. + + If this config item is set to N (default), the correct WP pin will be automatically used for any + Espressif chip or module with integrated flash. If a custom setting is needed, set this config item + to Y and specify the GPIO number connected to the WP pin. + + When flash mode is set to QIO or QOUT, the PSRAM WP pin will be set the same as the SPI Flash WP pin + configured in the bootloader. + +config SPIRAM_SPIWP_SD3_PIN + int "Custom SPI PSRAM WP(SD3) Pin" + range 0 33 + default 7 + help + The option "Use custom SPI PSRAM WP(SD3) pin" must be set or this value is ignored + + If burning a customized set of SPI flash pins in eFuse and using DIO or DOUT mode for flash, set this + value to the GPIO number of the SPIRAM WP pin. + +config SPIRAM + bool + default y + +endmenu # SPI RAM config + +endif # SOC_FAMILY_ESP32 diff --git a/soc/xtensa/esp32s2/include/_soc_inthandlers.h b/soc/xtensa/espressif_esp32/common/include/_soc_inthandlers.h similarity index 99% rename from soc/xtensa/esp32s2/include/_soc_inthandlers.h rename to soc/xtensa/espressif_esp32/common/include/_soc_inthandlers.h index becafa7285a283..8e6b115bca3db8 100644 --- a/soc/xtensa/esp32s2/include/_soc_inthandlers.h +++ b/soc/xtensa/espressif_esp32/common/include/_soc_inthandlers.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Espressif Systems (Shanghai) Co., Ltd. + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. * * SPDX-License-Identifier: Apache-2.0 */ diff --git a/soc/xtensa/esp32/include/gdbstub/soc.h b/soc/xtensa/espressif_esp32/common/include/gdbstub/soc.h similarity index 100% rename from soc/xtensa/esp32/include/gdbstub/soc.h rename to soc/xtensa/espressif_esp32/common/include/gdbstub/soc.h diff --git a/soc/xtensa/esp32/CMakeLists.txt b/soc/xtensa/espressif_esp32/esp32/CMakeLists.txt similarity index 98% rename from soc/xtensa/esp32/CMakeLists.txt rename to soc/xtensa/espressif_esp32/esp32/CMakeLists.txt index 0728e94e253572..6c3039116cb476 100644 --- a/soc/xtensa/esp32/CMakeLists.txt +++ b/soc/xtensa/espressif_esp32/esp32/CMakeLists.txt @@ -40,7 +40,7 @@ if(CONFIG_BOOTLOADER_ESP_IDF) ${CMAKE_COMMAND} -G${CMAKE_GENERATOR} -S ${espidf_components_dir}/bootloader/subproject -B ${espidf_build_dir}/bootloader -DSDKCONFIG=${espidf_build_dir}/sdkconfig - -DIDF_PATH=${ESP_IDF_PATH} -DIDF_TARGET=${CONFIG_SOC} + -DIDF_PATH=${ESP_IDF_PATH} -DIDF_TARGET=${CONFIG_SOC_SERIES} -DPYTHON_DEPS_CHECKED=1 -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} diff --git a/soc/xtensa/esp32/Kconfig.defconfig b/soc/xtensa/espressif_esp32/esp32/Kconfig.defconfig.series similarity index 56% rename from soc/xtensa/esp32/Kconfig.defconfig rename to soc/xtensa/espressif_esp32/esp32/Kconfig.defconfig.series index 229f6fb02e7c8f..50a7e9e8124f0a 100644 --- a/soc/xtensa/esp32/Kconfig.defconfig +++ b/soc/xtensa/espressif_esp32/esp32/Kconfig.defconfig.series @@ -1,30 +1,28 @@ -# ESP32 board configuration - -# Copyright (c) 2017 Intel Corporation +# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. # SPDX-License-Identifier: Apache-2.0 -if SOC_ESP32 +if SOC_SERIES_ESP32 -if BOOTLOADER_MCUBOOT - config HAS_FLASH_LOAD_OFFSET - default y +config SOC_SERIES + default "esp32" - config MCUBOOT_GENERATE_UNSIGNED_IMAGE - default y +config MINIMAL_LIBC_OPTIMIZE_STRING_FOR_SIZE + default n - config MCUBOOT_GENERATE_CONFIRMED_IMAGE - default y +config SYS_CLOCK_HW_CYCLES_PER_SEC + default $(dt_node_int_prop_int,/cpus/cpu@0,clock-frequency) - config ROM_START_OFFSET - default 0x20 -endif +config XTENSA_CCOUNT_HZ + default SYS_CLOCK_HW_CYCLES_PER_SEC -config SOC - default "esp32" +config ESPTOOLPY_FLASHFREQ_80M + default y -config SOC_TOOLCHAIN_NAME - string - default "espressif_esp32" +config FLASH_SIZE + default $(dt_node_reg_size_int,/soc/flash-controller@3ff42000/flash@0,0) + +config FLASH_BASE_ADDRESS + default $(dt_node_reg_addr_hex,/soc/flash-controller@3ff42000/flash@0) if SMP @@ -37,16 +35,7 @@ config SCHED_CPU_MASK config MP_MAX_NUM_CPUS default 2 -endif - -config MINIMAL_LIBC_OPTIMIZE_STRING_FOR_SIZE - default n - -config SYS_CLOCK_HW_CYCLES_PER_SEC - default $(dt_node_int_prop_int,/cpus/cpu@0,clock-frequency) - -config XTENSA_CCOUNT_HZ - default SYS_CLOCK_HW_CYCLES_PER_SEC +endif # SMP config if GDBSTUB @@ -55,6 +44,6 @@ if GDBSTUB config GDBSTUB_BUF_SZ default 840 if GDBSTUB -endif +endif # GDBSTUB config -endif +endif # SOC_SERIES_ESP32 config diff --git a/soc/xtensa/espressif_esp32/esp32/Kconfig.series b/soc/xtensa/espressif_esp32/esp32/Kconfig.series new file mode 100644 index 00000000000000..dce3176ed53c73 --- /dev/null +++ b/soc/xtensa/espressif_esp32/esp32/Kconfig.series @@ -0,0 +1,18 @@ +# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. +# SPDX-License-Identifier: Apache-2.0 + +config SOC_SERIES_ESP32 + bool "ESP32 Series" + select XTENSA + select SOC_FAMILY_ESP32 + select CLOCK_CONTROL + select DYNAMIC_INTERRUPTS + select ARCH_HAS_GDBSTUB + select ARCH_SUPPORTS_COREDUMP + select PINCTRL + select XIP if !MCUBOOT + select HAS_ESPRESSIF_HAL + select CPU_HAS_FPU + select HAS_PM + help + Enable support for Espressif ESP32 diff --git a/soc/xtensa/esp32/Kconfig.soc b/soc/xtensa/espressif_esp32/esp32/Kconfig.soc similarity index 56% rename from soc/xtensa/esp32/Kconfig.soc rename to soc/xtensa/espressif_esp32/esp32/Kconfig.soc index 9e4e0e6892f5ba..7371c49ed9403f 100644 --- a/soc/xtensa/esp32/Kconfig.soc +++ b/soc/xtensa/espressif_esp32/esp32/Kconfig.soc @@ -1,40 +1,66 @@ -# Copyright (c) 2017 Intel Corporation +# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. # SPDX-License-Identifier: Apache-2.0 -config SOC_ESP32 - bool "ESP32" - select XTENSA - select CLOCK_CONTROL - select DYNAMIC_INTERRUPTS - select ARCH_HAS_GDBSTUB - select ARCH_SUPPORTS_COREDUMP - select PINCTRL - select XIP if !MCUBOOT - select HAS_ESPRESSIF_HAL - select CPU_HAS_FPU - select HAS_PM - -if SOC_ESP32 - -config SOC_FAMILY_ESP32 - bool - default y +if SOC_SERIES_ESP32 config IDF_TARGET_ESP32 bool "ESP32 as target board" default y -config ESPTOOLPY_FLASHFREQ_80M - bool - default y +config SOC_TOOLCHAIN_NAME + string + default "espressif_esp32" + +choice SOC_PART_NUMBER + prompt "ESP32 SOC/SIP Selection" + depends on SOC_SERIES_ESP32 + + # SoC with/without embedded flash + config SOC_ESP32_D0WD_V3 + bool "ESP32_D0WD_V3" + config SOC_ESP32_D0WDR2_V3 + bool "ESP32_D0WDR2_V3" + config SOC_ESP32_U4WDH + bool "ESP32_U4WDH" + config SOC_ESP32_PICO_V3 + bool "ESP32_PICO_V3" + config SOC_ESP32_PICO_V3_02 + bool "ESP32_PICO_V3_02" + config SOC_ESP32_PICO_D4 + bool "ESP32_PICO_D4" + # SiP with external flash / psram + config SOC_ESP32_WROOM_DA_N4 + bool "ESP32_WROOM_DA_N4" + config SOC_ESP32_WROOM_DA_N8 + bool "ESP32_WROOM_DA_N8" + config SOC_ESP32_WROOM_DA_N16 + bool "ESP32_WROOM_DA_N16" + config SOC_ESP32_WROOM_32UE_N4 + bool "ESP32_WROOM_32UE_N4" + config SOC_ESP32_WROOM_32UE_N8 + bool "ESP32_WROOM_32UE_N8" + config SOC_ESP32_WROOM_32UE_N16 + bool "ESP32_WROOM_32UE_N16" + config SOC_ESP32_WROVER_E_N4R2 + bool "ESP32_WROVER_E_N4R2" + config SOC_ESP32_WROVER_E_N8R2 + bool "ESP32_WROVER_E_N8R2" + config SOC_ESP32_WROVER_E_N16R2 + bool "ESP32_WROVER_E_N16R2" + config SOC_ESP32_WROVER_E_N4R8 + bool "ESP32_WROVER_E_N4R8" + config SOC_ESP32_WROVER_E_N8R8 + bool "ESP32_WROVER_E_N8R8" + config SOC_ESP32_WROVER_E_N16R8 + bool "ESP32_WROVER_E_N16R8" + +endchoice # SOC_PART_NUMBER -config FLASH_SIZE - int - default $(dt_node_reg_size_int,/soc/flash-controller@3ff42000/flash@0,0) +config ESP_SYSTEM_RTC_EXT_XTAL + bool -config FLASH_BASE_ADDRESS - hex - default $(dt_node_reg_addr_hex,/soc/flash-controller@3ff42000/flash@0) +config ESP_SYSTEM_RTC_EXT_OSC + bool config ESP32_NETWORK_CORE bool "Uses the ESP32 APP_CPU as Network dedicated core" @@ -55,183 +81,6 @@ config ESP_HEAP_MEM_POOL_REGION_1_SIZE This configuration can be used to add memory from region 1 to heap and can be allocated using k_malloc. -config ESP_SPIRAM - bool "Support for external, SPI-connected RAM" - default n if MCUBOOT - help - This enables support for an external SPI RAM chip, connected in - parallel with the main SPI flash chip. - -config ESP_HEAP_MIN_EXTRAM_THRESHOLD - int "Minimum threshold for external RAM allocation" - default 8192 - range 1024 131072 - depends on ESP_SPIRAM - help - Threshold to decide if memory will be allocated from DRAM - or SPIRAM. If value of allocation size is less than this value, - memory will be allocated from internal RAM. - -config ESP_HEAP_SEARCH_ALL_REGIONS - bool "Search for all available heap regions" - depends on ESP_SPIRAM - default y - help - This configuration enables searching all available heap - regions. If the region of desired capability is exhausted, - memory will be allocated from other available region. - -menu "SPI RAM config" - depends on ESP_SPIRAM - -choice SPIRAM_TYPE - prompt "Type of SPI RAM chip in use" - default SPIRAM_TYPE_ESPPSRAM16 - -config SPIRAM_TYPE_ESPPSRAM16 - bool "ESP-PSRAM16 or APS1604" - -config SPIRAM_TYPE_ESPPSRAM32 - bool "ESP-PSRAM32 or IS25WP032" - -config SPIRAM_TYPE_ESPPSRAM64 - bool "ESP-PSRAM64 or LY68L6400" - -endchoice # SPIRAM_TYPE - -config ESP_SPIRAM_SIZE - int "Size of SPIRAM part" - default 2097152 if SPIRAM_TYPE_ESPPSRAM16 - default 4194304 if SPIRAM_TYPE_ESPPSRAM32 - default 8388608 if SPIRAM_TYPE_ESPPSRAM64 - help - Specify size of SPIRAM part. - NOTE: If SPIRAM size is greater than 4MB, only - lower 4MB can be allocated using k_malloc(). - -choice SPIRAM_SPEED - prompt "Set RAM clock speed" - default SPIRAM_SPEED_40M - help - Select the speed for the SPI RAM chip. - If SPI RAM is enabled, we only support three combinations of SPI speed mode we supported now: - - 1. Flash SPI running at 40MHz and RAM SPI running at 40MHz - 2. Flash SPI running at 80MHz and RAM SPI running at 40MHz - 3. Flash SPI running at 80MHz and RAM SPI running at 80MHz - - Note: If the third mode(80MHz+80MHz) is enabled for SPI RAM of type 32MBit, one of the HSPI/VSPI host - will be occupied by the system. Which SPI host to use can be selected by the config item - SPIRAM_OCCUPY_SPI_HOST. Application code should never touch HSPI/VSPI hardware in this case. The - option to select 80MHz will only be visible if the flash SPI speed is also 80MHz. - (ESPTOOLPY_FLASHFREQ_79M is true) - -config SPIRAM_SPEED_40M - bool "40MHz clock speed" - -config SPIRAM_SPEED_80M - depends on ESPTOOLPY_FLASHFREQ_80M - bool "80MHz clock speed" - -endchoice # SPIRAM_SPEED - -menu "PSRAM clock and cs IO for ESP32-DOWD" - -config D0WD_PSRAM_CLK_IO - int "PSRAM CLK IO number" - range 0 33 - default 17 - help - The PSRAM CLOCK IO can be any unused GPIO, user can config it based on hardware design. If user use - 1.8V flash and 1.8V psram, this value can only be one of 6, 7, 8, 9, 10, 11, 16, 17. - -config D0WD_PSRAM_CS_IO - int "PSRAM CS IO number" - range 0 33 - default 16 - help - The PSRAM CS IO can be any unused GPIO, user can config it based on hardware design. If user use - 1.8V flash and 1.8V psram, this value can only be one of 6, 7, 8, 9, 10, 11, 16, 17. - -endmenu # PSRAM clock and cs IO for ESP32-DOWD - -menu "PSRAM clock and cs IO for ESP32-D2WD" - -config D2WD_PSRAM_CLK_IO - int "PSRAM CLK IO number" - range 0 33 - default 9 - help - User can config it based on hardware design. For ESP32-D2WD chip, the psram can only be 1.8V psram, - so this value can only be one of 6, 7, 8, 9, 10, 11, 16, 17. - -config D2WD_PSRAM_CS_IO - int "PSRAM CS IO number" - range 0 33 - default 10 - help - User can config it based on hardware design. For ESP32-D2WD chip, the psram can only be 1.8V psram, - so this value can only be one of 6, 7, 8, 9, 10, 11, 16, 17. - -endmenu # PSRAM clock and cs IO for ESP32-D2WD - -menu "PSRAM clock and cs IO for ESP32-PICO" - -config PICO_PSRAM_CS_IO - int "PSRAM CS IO number" - range 0 33 - default 10 - help - The PSRAM CS IO can be any unused GPIO, user can config it based on hardware design. - - For ESP32-PICO chip, the psram share clock with flash, so user do not need to configure the clock - IO. - For the reference hardware design, please refer to - https://www.espressif.com/sites/default/files/documentation/esp32-pico-d4_datasheet_en.pdf - -endmenu # PSRAM clock and cs IO for ESP32-PICO - -config SPIRAM_CUSTOM_SPIWP_SD3_PIN - bool "Use custom SPI PSRAM WP(SD3) Pin when flash pins set in eFuse (read help)" - default y if SPIRAM_SPIWP_SD3_PIN != 7 # backwards compatibility, can remove in IDF 5 - default n - help - This setting is only used if the SPI flash pins have been overridden by setting the eFuses - SPI_PAD_CONFIG_xxx, and the SPI flash mode is DIO or DOUT. - - When this is the case, the eFuse config only defines 3 of the 4 Quad I/O data pins. The WP pin (aka - ESP32 pin "SD_DATA_3" or SPI flash pin "IO2") is not specified in eFuse. The psram only has QPI - mode, so a WP pin setting is necessary. - - If this config item is set to N (default), the correct WP pin will be automatically used for any - Espressif chip or module with integrated flash. If a custom setting is needed, set this config item - to Y and specify the GPIO number connected to the WP pin. - - When flash mode is set to QIO or QOUT, the PSRAM WP pin will be set the same as the SPI Flash WP pin - configured in the bootloader. - -config SPIRAM_SPIWP_SD3_PIN - int "Custom SPI PSRAM WP(SD3) Pin" - range 0 33 - default 7 - help - The option "Use custom SPI PSRAM WP(SD3) pin" must be set or this value is ignored - - If burning a customized set of SPI flash pins in eFuse and using DIO or DOUT mode for flash, set this - value to the GPIO number of the SPIRAM WP pin. - -config SPIRAM - bool - default y - -endmenu # SPI RAM config - -config ESP_SYSTEM_RTC_EXT_XTAL - bool - -config ESP_SYSTEM_RTC_EXT_OSC - bool - choice ESP32_RTC_CLK_SRC prompt "RTC clock source" default ESP32_RTC_CLK_SRC_INT_RC @@ -417,6 +266,6 @@ config ETH_DMA_TX_BUFFER_NUM Number of DMA transmit buffers. Each buffer's size is ETH_DMA_BUFFER_SIZE. Larger number of buffers could increase throughput somehow. -endif # ESP32_EMAC +endif # ESP32_EMAC config -endif # SOC_ESP32 +endif # SOC_SERIES_ESP32 config diff --git a/soc/xtensa/esp32/default.ld b/soc/xtensa/espressif_esp32/esp32/default.ld similarity index 100% rename from soc/xtensa/esp32/default.ld rename to soc/xtensa/espressif_esp32/esp32/default.ld diff --git a/soc/xtensa/esp32/esp32-mp.c b/soc/xtensa/espressif_esp32/esp32/esp32-mp.c similarity index 100% rename from soc/xtensa/esp32/esp32-mp.c rename to soc/xtensa/espressif_esp32/esp32/esp32-mp.c diff --git a/soc/xtensa/esp32/gdbstub.c b/soc/xtensa/espressif_esp32/esp32/gdbstub.c similarity index 100% rename from soc/xtensa/esp32/gdbstub.c rename to soc/xtensa/espressif_esp32/esp32/gdbstub.c diff --git a/soc/xtensa/esp32/linker.ld b/soc/xtensa/espressif_esp32/esp32/linker.ld similarity index 100% rename from soc/xtensa/esp32/linker.ld rename to soc/xtensa/espressif_esp32/esp32/linker.ld diff --git a/soc/xtensa/esp32/loader.c b/soc/xtensa/espressif_esp32/esp32/loader.c similarity index 97% rename from soc/xtensa/esp32/loader.c rename to soc/xtensa/espressif_esp32/esp32/loader.c index ed18aa8d02a386..5b946bfba4156e 100644 --- a/soc/xtensa/esp32/loader.c +++ b/soc/xtensa/espressif_esp32/esp32/loader.c @@ -16,7 +16,7 @@ #ifdef CONFIG_BOOTLOADER_MCUBOOT #define BOOT_LOG_INF(_fmt, ...) \ - ets_printf("[" CONFIG_SOC "] [INF] " _fmt "\n\r", ##__VA_ARGS__) + ets_printf("[" CONFIG_SOC_SERIES "] [INF] " _fmt "\n\r", ##__VA_ARGS__) #define HDR_ATTR __attribute__((section(".entry_addr"))) __attribute__((used)) diff --git a/soc/xtensa/esp32/mcuboot.ld b/soc/xtensa/espressif_esp32/esp32/mcuboot.ld similarity index 100% rename from soc/xtensa/esp32/mcuboot.ld rename to soc/xtensa/espressif_esp32/esp32/mcuboot.ld diff --git a/soc/xtensa/esp32/newlib_fix.c b/soc/xtensa/espressif_esp32/esp32/newlib_fix.c similarity index 100% rename from soc/xtensa/esp32/newlib_fix.c rename to soc/xtensa/espressif_esp32/esp32/newlib_fix.c diff --git a/soc/xtensa/esp32/pinctrl_soc.h b/soc/xtensa/espressif_esp32/esp32/pinctrl_soc.h similarity index 100% rename from soc/xtensa/esp32/pinctrl_soc.h rename to soc/xtensa/espressif_esp32/esp32/pinctrl_soc.h diff --git a/soc/xtensa/esp32/power.c b/soc/xtensa/espressif_esp32/esp32/power.c similarity index 100% rename from soc/xtensa/esp32/power.c rename to soc/xtensa/espressif_esp32/esp32/power.c diff --git a/soc/xtensa/esp32/soc.c b/soc/xtensa/espressif_esp32/esp32/soc.c similarity index 98% rename from soc/xtensa/esp32/soc.c rename to soc/xtensa/espressif_esp32/esp32/soc.c index cb1e3433fa8efc..0f7537bacfc94d 100644 --- a/soc/xtensa/esp32/soc.c +++ b/soc/xtensa/espressif_esp32/esp32/soc.c @@ -31,9 +31,9 @@ #include "esp_app_format.h" #include "hal/wdt_hal.h" -#ifndef CONFIG_SOC_ESP32_NET +#ifndef CONFIG_SOC_SERIES_ESP32_NET #include "esp_clk_internal.h" -#endif /* CONFIG_SOC_ESP32_NET */ +#endif /* CONFIG_SOC_SERIES_ESP32_NET */ #ifdef CONFIG_MCUBOOT #include "bootloader_init.h" @@ -135,7 +135,7 @@ void __attribute__((section(".iram1"))) __esp_platform_start(void) wdt_hal_disable(&rtc_wdt_ctx); wdt_hal_write_protect_enable(&rtc_wdt_ctx); -#ifndef CONFIG_SOC_ESP32_NET +#ifndef CONFIG_SOC_SERIES_ESP32_NET /* Configures the CPU clock, RTC slow and fast clocks, and performs * RTC slow clock calibration. */ diff --git a/soc/xtensa/esp32/soc.h b/soc/xtensa/espressif_esp32/esp32/soc.h similarity index 100% rename from soc/xtensa/esp32/soc.h rename to soc/xtensa/espressif_esp32/esp32/soc.h diff --git a/soc/xtensa/esp32_net/CMakeLists.txt b/soc/xtensa/espressif_esp32/esp32_net/CMakeLists.txt similarity index 100% rename from soc/xtensa/esp32_net/CMakeLists.txt rename to soc/xtensa/espressif_esp32/esp32_net/CMakeLists.txt diff --git a/soc/xtensa/esp32_net/Kconfig.defconfig b/soc/xtensa/espressif_esp32/esp32_net/Kconfig.defconfig.series similarity index 62% rename from soc/xtensa/esp32_net/Kconfig.defconfig rename to soc/xtensa/espressif_esp32/esp32_net/Kconfig.defconfig.series index 7484769fb16051..8193bbb6149a7e 100644 --- a/soc/xtensa/esp32_net/Kconfig.defconfig +++ b/soc/xtensa/espressif_esp32/esp32_net/Kconfig.defconfig.series @@ -1,15 +1,11 @@ -# Copyright (c) 2022 Espressif Systems (Shanghai) Co., Ltd. +# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. # SPDX-License-Identifier: Apache-2.0 -if SOC_ESP32_NET +if SOC_SERIES_ESP32_NET -config SOC +config SOC_SERIES default "esp32_net" -config SOC_TOOLCHAIN_NAME - string - default "espressif_esp32" - config MINIMAL_LIBC_OPTIMIZE_STRING_FOR_SIZE default n @@ -19,4 +15,7 @@ config SYS_CLOCK_HW_CYCLES_PER_SEC config XTENSA_CCOUNT_HZ default SYS_CLOCK_HW_CYCLES_PER_SEC -endif +config ESPTOOLPY_FLASHFREQ_80M + default y + +endif # SOC_ESP32_NET diff --git a/soc/xtensa/espressif_esp32/esp32_net/Kconfig.series b/soc/xtensa/espressif_esp32/esp32_net/Kconfig.series new file mode 100644 index 00000000000000..55f794f96e0567 --- /dev/null +++ b/soc/xtensa/espressif_esp32/esp32_net/Kconfig.series @@ -0,0 +1,12 @@ +# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. +# SPDX-License-Identifier: Apache-2.0 + +config SOC_SERIES_ESP32_NET + bool "ESP32-NET Series" + select XTENSA + select SOC_FAMILY_ESP32 + select CLOCK_CONTROL + select DYNAMIC_INTERRUPTS + select HAS_ESPRESSIF_HAL + help + Enable support for Espressif ESP32_NET diff --git a/soc/xtensa/esp32_net/Kconfig.soc b/soc/xtensa/espressif_esp32/esp32_net/Kconfig.soc similarity index 88% rename from soc/xtensa/esp32_net/Kconfig.soc rename to soc/xtensa/espressif_esp32/esp32_net/Kconfig.soc index 3b735071700378..975b777b790768 100644 --- a/soc/xtensa/esp32_net/Kconfig.soc +++ b/soc/xtensa/espressif_esp32/esp32_net/Kconfig.soc @@ -1,26 +1,25 @@ # Copyright (c) 2022 Espressif Systems (Shanghai) Co., Ltd. # SPDX-License-Identifier: Apache-2.0 -config SOC_ESP32_NET - bool "ESP32_NET" - select XTENSA - select CLOCK_CONTROL - select DYNAMIC_INTERRUPTS - select HAS_ESPRESSIF_HAL - -if SOC_ESP32_NET - -config SOC_FAMILY_ESP32 - bool - default y +if SOC_SERIES_ESP32_NET config IDF_TARGET_ESP32 bool "ESP32 as target board" default y -config ESPTOOLPY_FLASHFREQ_80M - bool - default y +config SOC_TOOLCHAIN_NAME + string + default "espressif_esp32" + +choice SOC_PART_NUMBER + prompt "ESP32-NET SOC Selection" + depends on SOC_SERIES_ESP32_NET + + # SoC with/without embedded flash + config SOC_ESP32_NET + bool "ESP32_NET" + +endchoice # SOC_PART_NUMBER config ESP32_BT_RESERVE_DRAM hex "Bluetooth controller reserved RAM region" @@ -76,4 +75,4 @@ config ESP32_UNIVERSAL_MAC_ADDRESSES default 2 if ESP32_UNIVERSAL_MAC_ADDRESSES_TWO default 4 if ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR -endif # SOC_ESP32 +endif # SOC_ESP32_NET diff --git a/soc/xtensa/esp32_net/include/_soc_inthandlers.h b/soc/xtensa/espressif_esp32/esp32_net/include/_soc_inthandlers.h similarity index 100% rename from soc/xtensa/esp32_net/include/_soc_inthandlers.h rename to soc/xtensa/espressif_esp32/esp32_net/include/_soc_inthandlers.h diff --git a/soc/xtensa/esp32_net/include/gdbstub/soc.h b/soc/xtensa/espressif_esp32/esp32_net/include/gdbstub/soc.h similarity index 100% rename from soc/xtensa/esp32_net/include/gdbstub/soc.h rename to soc/xtensa/espressif_esp32/esp32_net/include/gdbstub/soc.h diff --git a/soc/xtensa/esp32_net/linker.ld b/soc/xtensa/espressif_esp32/esp32_net/linker.ld similarity index 100% rename from soc/xtensa/esp32_net/linker.ld rename to soc/xtensa/espressif_esp32/esp32_net/linker.ld diff --git a/soc/xtensa/esp32_net/newlib_fix.c b/soc/xtensa/espressif_esp32/esp32_net/newlib_fix.c similarity index 100% rename from soc/xtensa/esp32_net/newlib_fix.c rename to soc/xtensa/espressif_esp32/esp32_net/newlib_fix.c diff --git a/soc/xtensa/esp32_net/soc.c b/soc/xtensa/espressif_esp32/esp32_net/soc.c similarity index 100% rename from soc/xtensa/esp32_net/soc.c rename to soc/xtensa/espressif_esp32/esp32_net/soc.c diff --git a/soc/xtensa/esp32_net/soc.h b/soc/xtensa/espressif_esp32/esp32_net/soc.h similarity index 100% rename from soc/xtensa/esp32_net/soc.h rename to soc/xtensa/espressif_esp32/esp32_net/soc.h diff --git a/soc/xtensa/esp32s2/CMakeLists.txt b/soc/xtensa/espressif_esp32/esp32s2/CMakeLists.txt similarity index 98% rename from soc/xtensa/esp32s2/CMakeLists.txt rename to soc/xtensa/espressif_esp32/esp32s2/CMakeLists.txt index c520dabda273bd..18cf77e3248fe1 100644 --- a/soc/xtensa/esp32s2/CMakeLists.txt +++ b/soc/xtensa/espressif_esp32/esp32s2/CMakeLists.txt @@ -38,7 +38,7 @@ if(CONFIG_BOOTLOADER_ESP_IDF) ${CMAKE_COMMAND} -G${CMAKE_GENERATOR} -S ${espidf_components_dir}/bootloader/subproject -B ${espidf_build_dir}/bootloader -DSDKCONFIG=${espidf_build_dir}/sdkconfig - -DIDF_PATH=${ESP_IDF_PATH} -DIDF_TARGET=${CONFIG_SOC} + -DIDF_PATH=${ESP_IDF_PATH} -DIDF_TARGET=${CONFIG_SOC_SERIES} -DPYTHON_DEPS_CHECKED=1 -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} diff --git a/soc/xtensa/espressif_esp32/esp32s2/Kconfig.defconfig.series b/soc/xtensa/espressif_esp32/esp32s2/Kconfig.defconfig.series new file mode 100644 index 00000000000000..c1618783ae598c --- /dev/null +++ b/soc/xtensa/espressif_esp32/esp32s2/Kconfig.defconfig.series @@ -0,0 +1,33 @@ +# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. +# SPDX-License-Identifier: Apache-2.0 + +if SOC_SERIES_ESP32S2 + +config SOC_SERIES + default "esp32s2" + +config SYS_CLOCK_HW_CYCLES_PER_SEC + default $(dt_node_int_prop_int,/cpus/cpu@0,clock-frequency) + +config XTENSA_CCOUNT_HZ + default SYS_CLOCK_HW_CYCLES_PER_SEC + +config MP_MAX_NUM_CPUS + default 1 + +config ISR_STACK_SIZE + default 2048 + +config HEAP_MEM_POOL_SIZE + default 32768 + +config ESPTOOLPY_FLASHFREQ_80M + default y + +config FLASH_SIZE + default $(dt_node_reg_size_int,/soc/flash-controller@3f402000/flash@0,0) + +config FLASH_BASE_ADDRESS + default $(dt_node_reg_addr_hex,/soc/flash-controller@3f402000/flash@0) + +endif # SOC_SERIES_ESP32S2 diff --git a/soc/xtensa/espressif_esp32/esp32s2/Kconfig.series b/soc/xtensa/espressif_esp32/esp32s2/Kconfig.series new file mode 100644 index 00000000000000..88bdcf1a53aea3 --- /dev/null +++ b/soc/xtensa/espressif_esp32/esp32s2/Kconfig.series @@ -0,0 +1,17 @@ +# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. +# SPDX-License-Identifier: Apache-2.0 + +config SOC_SERIES_ESP32S2 + bool "ESP32-S2 Series" + select XTENSA + select SOC_FAMILY_ESP32 + select ATOMIC_OPERATIONS_C + select DYNAMIC_INTERRUPTS + select CLOCK_CONTROL + select PINCTRL + select XIP if !MCUBOOT + select HAS_ESPRESSIF_HAL + select ARCH_SUPPORTS_COREDUMP + select HAS_PM + help + Enable support for Espressif ESP32-S2 diff --git a/soc/xtensa/esp32s2/Kconfig.soc b/soc/xtensa/espressif_esp32/esp32s2/Kconfig.soc similarity index 74% rename from soc/xtensa/esp32s2/Kconfig.soc rename to soc/xtensa/espressif_esp32/esp32s2/Kconfig.soc index eef1a489ea2f5a..85d190d6472b20 100644 --- a/soc/xtensa/esp32s2/Kconfig.soc +++ b/soc/xtensa/espressif_esp32/esp32s2/Kconfig.soc @@ -1,39 +1,122 @@ -# Copyright (c) 2021 Espressif Systems (Shanghai) Co., Ltd. +# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. # SPDX-License-Identifier: Apache-2.0 -config SOC_ESP32S2 - bool "ESP32S2" - select XTENSA - select ATOMIC_OPERATIONS_C - select DYNAMIC_INTERRUPTS - select CLOCK_CONTROL - select PINCTRL - select XIP if !MCUBOOT - select HAS_ESPRESSIF_HAL - select ARCH_SUPPORTS_COREDUMP - select HAS_PM - -if SOC_ESP32S2 - -config SOC_FAMILY_ESP32 - bool - default y +if SOC_SERIES_ESP32S2 config IDF_TARGET_ESP32S2 - bool "ESP32S2 as target board" + bool "ESP32S2 as target SOC" default y -config ESPTOOLPY_FLASHFREQ_80M +config SOC_TOOLCHAIN_NAME + string + default "espressif_esp32s2" + +choice SOC_PART_NUMBER + prompt "ESP32-S2 SOC Selection" + depends on SOC_SERIES_ESP32S2 + + # SoC with/without embedded flash + config SOC_ESP32S2 + bool "ESP32S2" + config SOC_ESP32S2_R2 + bool "ESP32S2_R2" + config SOC_ESP32S2_FH2 + bool "ESP32S2_FH2" + config SOC_ESP32S2_FH4 + bool "ESP32S2_FH4" + config SOC_ESP32S2_FN4R2 + bool "ESP32S2_FN4R2" + # SiP with external flash / psram + config SOC_ESP32S2_SOLO_N4 + bool "ESP32S2_SOLO_N4" + config SOC_ESP32S2_SOLO_N8 + bool "ESP32S2_SOLO_N8" + config SOC_ESP32S2_SOLO_N16 + bool "ESP32S2_SOLO_N16" + config SOC_ESP32S2_SOLO_N4R2 + bool "ESP32S2_SOLO_N4R2" + config SOC_ESP32S2_MINI_N4 + bool "ESP32S2_MINI_N4" + config SOC_ESP32S2_MINI_N4R2 + bool "ESP32S2_MINI_N4R2" + config SOC_ESP32S2_WROOM + bool "ESP32S2_WROOM" + config SOC_ESP32S2_WROVER_N4R2 + bool "ESP32S2_WROVER_N4R2" + config SOC_ESP32S2_WROVER_N8R2 + bool "ESP32S2_WROVER_N8R2" + config SOC_ESP32S2_WROVER_N16R2 + bool "ESP32S2_WROVER_N16R2" + +endchoice # SOC_PART_NUMBER + +config ESP_SYSTEM_RTC_EXT_XTAL bool - default y -config FLASH_SIZE - int - default $(dt_node_reg_size_int,/soc/flash-controller@3f402000/flash@0,0) +config ESP_SYSTEM_RTC_EXT_OSC + bool -config FLASH_BASE_ADDRESS - hex - default $(dt_node_reg_addr_hex,/soc/flash-controller@3f402000/flash@0) +choice ESP32S2_RTC_CLK_SRC + prompt "RTC clock source" + default ESP32S2_RTC_CLK_SRC_INT_RC + help + Choose which clock is used as RTC clock source. + + - "Internal 90kHz oscillator" option provides lowest deep sleep current + consumption, and does not require extra external components. However + frequency stability with respect to temperature is poor, so time may + drift in deep/light sleep modes. + - "External 32kHz crystal" provides better frequency stability, at the + expense of slightly higher (1uA) deep sleep current consumption. + - "External 32kHz oscillator" allows using 32kHz clock generated by an + external circuit. In this case, external clock signal must be connected + to 32K_XN pin. Amplitude should be <1.2V in case of sine wave signal, + and <1V in case of square wave signal. Common mode voltage should be + 0.1 < Vcm < 0.5Vamp, where Vamp is the signal amplitude. + Additionally, 1nF capacitor must be connected between 32K_XP pin and + ground. 32K_XP pin can not be used as a GPIO in this case. + - "Internal 8MHz oscillator divided by 256" option results in higher + deep sleep current (by 5uA) but has better frequency stability than + the internal 90kHz oscillator. It does not require external components. + +config ESP32S2_RTC_CLK_SRC_INT_RC + bool "Internal 90kHz RC oscillator" + +config ESP32S2_RTC_CLK_SRC_EXT_CRYS + bool "External 32kHz crystal" + select ESP_SYSTEM_RTC_EXT_XTAL + +config ESP32S2_RTC_CLK_SRC_EXT_OSC + bool "External 32kHz oscillator at 32K_XN pin" + select ESP_SYSTEM_RTC_EXT_OSC + +config ESP32S2_RTC_CLK_SRC_INT_8MD256 + bool "Internal 8MHz oscillator, divided by 256 (~32kHz)" + +endchoice + +config ESP32S2_RTC_CLK_CAL_CYCLES + int "Number of cycles for RTC_SLOW_CLK calibration" + default 3000 if ESP32S2_RTC_CLK_SRC_EXT_CRYS || ESP32S2_RTC_CLK_SRC_EXT_OSC || ESP32S2_RTC_CLK_SRC_INT_8MD256 + default 576 if ESP32S2_RTC_CLK_SRC_INT_RC + range 0 125000 + help + When the startup code initializes RTC_SLOW_CLK, it can perform + calibration by comparing the RTC_SLOW_CLK frequency with main XTAL + frequency. This option sets the number of RTC_SLOW_CLK cycles measured + by the calibration routine. Higher numbers increase calibration + precision, which may be important for applications which spend a lot of + time in deep sleep. Lower numbers reduce startup time. + + When this option is set to 0, clock calibration will not be performed at + startup, and approximate clock frequencies will be assumed: + + - 90000 Hz if internal RC oscillator is used as clock source. For this use value 1024. + - 32768 Hz if the 32k crystal oscillator is used. For this use value 3000 or more. + In case more value will help improve the definition of the launch of the crystal. + If the crystal could not start, it will be switched to internal RC. + +menu "Cache config" choice prompt "Instruction cache line size" @@ -98,51 +181,9 @@ config ESP32S2_DATA_CACHE_SIZE default 0x4000 if ESP32S2_DATA_CACHE_16KB default 0x0000 -config ESP_SPIRAM - bool "Support for external, SPI-connected RAM" - help - This enables support for an external SPI RAM chip, connected in - parallel with the main SPI flash chip. - -config ESP_HEAP_MIN_EXTRAM_THRESHOLD - int "Minimum threshold for external RAM allocation" - default 8192 - range 1024 131072 - depends on ESP_SPIRAM - help - Threshold to decide if memory will be allocated from DRAM - or SPIRAM. If value of allocation size is less than this value, - memory will be allocated from internal RAM. - -menu "SPI RAM config" - depends on ESP_SPIRAM - -choice SPIRAM_TYPE - prompt "Type of SPI RAM chip in use" - default SPIRAM_TYPE_ESPPSRAM16 - -config SPIRAM_TYPE_ESPPSRAM16 - bool "ESP-PSRAM16 or APS1604" - -config SPIRAM_TYPE_ESPPSRAM32 - bool "ESP-PSRAM32 or IS25WP032" - -config SPIRAM_TYPE_ESPPSRAM64 - bool "ESP-PSRAM64 or LY68L6400" - -endchoice # SPIRAM_TYPE +endmenu # Cache config -config ESP_SPIRAM_SIZE - int "Size of SPIRAM part" - default 2097152 if SPIRAM_TYPE_ESPPSRAM16 - default 4194304 if SPIRAM_TYPE_ESPPSRAM32 - default 8388608 if SPIRAM_TYPE_ESPPSRAM64 - help - Specify size of SPIRAM part. - NOTE: If SPIRAM size is greater than 4MB, only - lower 4MB can be allocated using k_malloc(). - -menu "PSRAM clock and cs IO for ESP32S2" +menu "PSRAM clock and cs IO for ESP32-S2" depends on ESP_SPIRAM config DEFAULT_PSRAM_CLK_IO @@ -163,98 +204,6 @@ config DEFAULT_PSRAM_CS_IO endmenu # PSRAM clock and cs IO for ESP32S2 -choice SPIRAM_SPEED - prompt "Set RAM clock speed" - default SPIRAM_SPEED_40M - help - Select the speed for the SPI RAM chip. - -config SPIRAM_SPEED_80M - bool "80MHz clock speed" - -config SPIRAM_SPEED_40M - bool "40MHz clock speed" - -config SPIRAM_SPEED_26M - bool "26MHz clock speed" - -config SPIRAM_SPEED_20M - bool "20MHz clock speed" - -endchoice # SPIRAM_SPEED - -config SPIRAM - bool - default y - -endmenu # SPI RAM config - -config ESP_SYSTEM_RTC_EXT_XTAL - bool - -config ESP_SYSTEM_RTC_EXT_OSC - bool - -choice ESP32S2_RTC_CLK_SRC - prompt "RTC clock source" - default ESP32S2_RTC_CLK_SRC_INT_RC - help - Choose which clock is used as RTC clock source. - - - "Internal 90kHz oscillator" option provides lowest deep sleep current - consumption, and does not require extra external components. However - frequency stability with respect to temperature is poor, so time may - drift in deep/light sleep modes. - - "External 32kHz crystal" provides better frequency stability, at the - expense of slightly higher (1uA) deep sleep current consumption. - - "External 32kHz oscillator" allows using 32kHz clock generated by an - external circuit. In this case, external clock signal must be connected - to 32K_XN pin. Amplitude should be <1.2V in case of sine wave signal, - and <1V in case of square wave signal. Common mode voltage should be - 0.1 < Vcm < 0.5Vamp, where Vamp is the signal amplitude. - Additionally, 1nF capacitor must be connected between 32K_XP pin and - ground. 32K_XP pin can not be used as a GPIO in this case. - - "Internal 8MHz oscillator divided by 256" option results in higher - deep sleep current (by 5uA) but has better frequency stability than - the internal 90kHz oscillator. It does not require external components. - -config ESP32S2_RTC_CLK_SRC_INT_RC - bool "Internal 90kHz RC oscillator" - -config ESP32S2_RTC_CLK_SRC_EXT_CRYS - bool "External 32kHz crystal" - select ESP_SYSTEM_RTC_EXT_XTAL - -config ESP32S2_RTC_CLK_SRC_EXT_OSC - bool "External 32kHz oscillator at 32K_XN pin" - select ESP_SYSTEM_RTC_EXT_OSC - -config ESP32S2_RTC_CLK_SRC_INT_8MD256 - bool "Internal 8MHz oscillator, divided by 256 (~32kHz)" - -endchoice - -config ESP32S2_RTC_CLK_CAL_CYCLES - int "Number of cycles for RTC_SLOW_CLK calibration" - default 3000 if ESP32S2_RTC_CLK_SRC_EXT_CRYS || ESP32S2_RTC_CLK_SRC_EXT_OSC || ESP32S2_RTC_CLK_SRC_INT_8MD256 - default 576 if ESP32S2_RTC_CLK_SRC_INT_RC - range 0 125000 - help - When the startup code initializes RTC_SLOW_CLK, it can perform - calibration by comparing the RTC_SLOW_CLK frequency with main XTAL - frequency. This option sets the number of RTC_SLOW_CLK cycles measured - by the calibration routine. Higher numbers increase calibration - precision, which may be important for applications which spend a lot of - time in deep sleep. Lower numbers reduce startup time. - - When this option is set to 0, clock calibration will not be performed at - startup, and approximate clock frequencies will be assumed: - - - 90000 Hz if internal RC oscillator is used as clock source. For this use value 1024. - - 32768 Hz if the 32k crystal oscillator is used. For this use value 3000 or more. - In case more value will help improve the definition of the launch of the crystal. - If the crystal could not start, it will be switched to internal RC. - choice ESP32S2_UNIVERSAL_MAC_ADDRESSES bool "Number of universally administered (by IEEE) MAC address" default ESP32S2_UNIVERSAL_MAC_ADDRESSES_TWO @@ -274,7 +223,7 @@ choice ESP32S2_UNIVERSAL_MAC_ADDRESSES allocation of MAC addresses in this range (either 1 or 2 per device). config ESP32S2_UNIVERSAL_MAC_ADDRESSES_ONE - bool "Two" + bool "One" select ESP_MAC_ADDR_UNIVERSE_WIFI_STA config ESP32S2_UNIVERSAL_MAC_ADDRESSES_TWO @@ -307,4 +256,4 @@ config ESP32_PHY_MAX_TX_POWER int default ESP32_PHY_MAX_WIFI_TX_POWER -endif # SOC_ESP32S2 +endif # SOC_SERIES_ESP32S2 diff --git a/soc/xtensa/esp32s2/default.ld b/soc/xtensa/espressif_esp32/esp32s2/default.ld similarity index 100% rename from soc/xtensa/esp32s2/default.ld rename to soc/xtensa/espressif_esp32/esp32s2/default.ld diff --git a/soc/xtensa/esp32s2/linker.ld b/soc/xtensa/espressif_esp32/esp32s2/linker.ld similarity index 100% rename from soc/xtensa/esp32s2/linker.ld rename to soc/xtensa/espressif_esp32/esp32s2/linker.ld diff --git a/soc/xtensa/esp32s2/loader.c b/soc/xtensa/espressif_esp32/esp32s2/loader.c similarity index 100% rename from soc/xtensa/esp32s2/loader.c rename to soc/xtensa/espressif_esp32/esp32s2/loader.c diff --git a/soc/xtensa/esp32s2/mcuboot.ld b/soc/xtensa/espressif_esp32/esp32s2/mcuboot.ld similarity index 100% rename from soc/xtensa/esp32s2/mcuboot.ld rename to soc/xtensa/espressif_esp32/esp32s2/mcuboot.ld diff --git a/soc/xtensa/esp32s2/newlib_fix.c b/soc/xtensa/espressif_esp32/esp32s2/newlib_fix.c similarity index 100% rename from soc/xtensa/esp32s2/newlib_fix.c rename to soc/xtensa/espressif_esp32/esp32s2/newlib_fix.c diff --git a/soc/xtensa/esp32s2/pinctrl_soc.h b/soc/xtensa/espressif_esp32/esp32s2/pinctrl_soc.h similarity index 100% rename from soc/xtensa/esp32s2/pinctrl_soc.h rename to soc/xtensa/espressif_esp32/esp32s2/pinctrl_soc.h diff --git a/soc/xtensa/esp32s2/power.c b/soc/xtensa/espressif_esp32/esp32s2/power.c similarity index 100% rename from soc/xtensa/esp32s2/power.c rename to soc/xtensa/espressif_esp32/esp32s2/power.c diff --git a/soc/xtensa/esp32s2/soc.c b/soc/xtensa/espressif_esp32/esp32s2/soc.c similarity index 100% rename from soc/xtensa/esp32s2/soc.c rename to soc/xtensa/espressif_esp32/esp32s2/soc.c diff --git a/soc/xtensa/esp32s2/soc.h b/soc/xtensa/espressif_esp32/esp32s2/soc.h similarity index 100% rename from soc/xtensa/esp32s2/soc.h rename to soc/xtensa/espressif_esp32/esp32s2/soc.h diff --git a/soc/xtensa/esp32s2/soc_cache.c b/soc/xtensa/espressif_esp32/esp32s2/soc_cache.c similarity index 100% rename from soc/xtensa/esp32s2/soc_cache.c rename to soc/xtensa/espressif_esp32/esp32s2/soc_cache.c diff --git a/soc/xtensa/esp32s3/CMakeLists.txt b/soc/xtensa/espressif_esp32/esp32s3/CMakeLists.txt similarity index 98% rename from soc/xtensa/esp32s3/CMakeLists.txt rename to soc/xtensa/espressif_esp32/esp32s3/CMakeLists.txt index 70cc633e764950..87d71798159234 100644 --- a/soc/xtensa/esp32s3/CMakeLists.txt +++ b/soc/xtensa/espressif_esp32/esp32s3/CMakeLists.txt @@ -36,7 +36,7 @@ if(CONFIG_BOOTLOADER_ESP_IDF) ${CMAKE_COMMAND} -G${CMAKE_GENERATOR} -S ${espidf_components_dir}/bootloader/subproject -B ${espidf_build_dir}/bootloader -DSDKCONFIG=${espidf_build_dir}/sdkconfig - -DIDF_PATH=${ESP_IDF_PATH} -DIDF_TARGET=${CONFIG_SOC} + -DIDF_PATH=${ESP_IDF_PATH} -DIDF_TARGET=${CONFIG_SOC_SERIES} -DPYTHON_DEPS_CHECKED=1 -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} diff --git a/soc/xtensa/espressif_esp32/esp32s3/Kconfig.defconfig.series b/soc/xtensa/espressif_esp32/esp32s3/Kconfig.defconfig.series new file mode 100644 index 00000000000000..31f7bdbff50cc9 --- /dev/null +++ b/soc/xtensa/espressif_esp32/esp32s3/Kconfig.defconfig.series @@ -0,0 +1,30 @@ +# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. +# SPDX-License-Identifier: Apache-2.0 + +if SOC_SERIES_ESP32S3 + +config SOC_SERIES + default "esp32s3" + +config HEAP_MEM_POOL_SIZE + default 32768 + +config MINIMAL_LIBC_OPTIMIZE_STRING_FOR_SIZE + default n + +config SYS_CLOCK_HW_CYCLES_PER_SEC + default $(dt_node_int_prop_int,/cpus/cpu@0,clock-frequency) + +config XTENSA_CCOUNT_HZ + default SYS_CLOCK_HW_CYCLES_PER_SEC + +config ESPTOOLPY_FLASHFREQ_80M + default y + +config FLASH_SIZE + default $(dt_node_reg_size_int,/soc/flash-controller@60002000/flash@0,0) + +config FLASH_BASE_ADDRESS + default $(dt_node_reg_addr_hex,/soc/flash-controller@60002000/flash@0) + +endif # SOC_SERIES_ESP32S3 diff --git a/soc/xtensa/espressif_esp32/esp32s3/Kconfig.series b/soc/xtensa/espressif_esp32/esp32s3/Kconfig.series new file mode 100644 index 00000000000000..1265375c12a280 --- /dev/null +++ b/soc/xtensa/espressif_esp32/esp32s3/Kconfig.series @@ -0,0 +1,16 @@ +# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. +# SPDX-License-Identifier: Apache-2.0 + +config SOC_SERIES_ESP32S3 + bool "ESP32-S3 Series" + select XTENSA + select SOC_FAMILY_ESP32 + select DYNAMIC_INTERRUPTS + select ARCH_SUPPORTS_COREDUMP + select CLOCK_CONTROL + select PINCTRL + select XIP if !MCUBOOT + select HAS_ESPRESSIF_HAL + select CPU_HAS_FPU + help + Enable support for Espressif ESP32-S3 diff --git a/soc/xtensa/esp32s3/Kconfig.soc b/soc/xtensa/espressif_esp32/esp32s3/Kconfig.soc similarity index 87% rename from soc/xtensa/esp32s3/Kconfig.soc rename to soc/xtensa/espressif_esp32/esp32s3/Kconfig.soc index 3860bea328b4c6..7dd8fc4dddb83a 100644 --- a/soc/xtensa/esp32s3/Kconfig.soc +++ b/soc/xtensa/espressif_esp32/esp32s3/Kconfig.soc @@ -1,38 +1,54 @@ -# Copyright (c) 2022 Espressif Systems (Shanghai) Co., Ltd. +# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. # SPDX-License-Identifier: Apache-2.0 -config SOC_ESP32S3 - bool "ESP32S3" - select XTENSA - select CLOCK_CONTROL - select DYNAMIC_INTERRUPTS - select ARCH_SUPPORTS_COREDUMP - select PINCTRL - select XIP if !MCUBOOT - select HAS_ESPRESSIF_HAL - select CPU_HAS_FPU - -if SOC_ESP32S3 - -config SOC_FAMILY_ESP32 - bool - default y +if SOC_SERIES_ESP32S3 config IDF_TARGET_ESP32S3 - bool "ESP32S3 as target board" - default y - -config ESPTOOLPY_FLASHFREQ_80M - bool + bool "ESP32S3 as target SOC" default y -config FLASH_SIZE - int - default $(dt_node_reg_size_int,/soc/flash-controller@60002000/flash@0,0) - -config FLASH_BASE_ADDRESS - hex - default $(dt_node_reg_addr_hex,/soc/flash-controller@60002000/flash@0) +config SOC_TOOLCHAIN_NAME + string + default "espressif_esp32s3" + +choice SOC_PART_NUMBER + prompt "ESP32-S3 SOC Selection" + depends on SOC_SERIES_ESP32S3 + + # SoC with/without embedded flash + config SOC_ESP32S3 + bool "ESP32S3" + config SOC_ESP32S3_R2 + bool "ESP32S3_R2" + config SOC_ESP32S3_R8 + bool "ESP32S3_R8" + config SOC_ESP32S3_R8V + bool "ESP32S3_R8V" + config SOC_ESP32S3_FN8 + bool "ESP32S3_FN8" + config SOC_ESP32S3_PICO_N8R2 + bool "ESP32S3_PICO_N8R2" + config SOC_ESP32S3_PICO_N8R8 + bool "ESP32S3_PICO_N8R8" + # SiP with flash and/or psram + config SOC_ESP32S3_MINI_N8 + bool "ESP32S3_MINI_N8" + config SOC_ESP32S3_MINI_N4R2 + bool "ESP32S3_MINI_N4R2" + config SOC_ESP32S3_WROOM_N4 + bool "ESP32S3_WROOM_N4" + config SOC_ESP32S3_WROOM_N8 + bool "ESP32S3_WROOM_N8" + config SOC_ESP32S3_WROOM_N16 + bool "ESP32S3_WROOM_N16" + config SOC_ESP32S3_WROOM_N4R8 + bool "ESP32S3_WROOM_N4R8" + config SOC_ESP32S3_WROOM_N8R8 + bool "ESP32S3_WROOM_N8R8" + config SOC_ESP32S3_WROOM_N16R8 + bool "ESP32S3_WROOM_N16" + +endchoice # SOC_PART_NUMBER choice ESP32S3_RTC_CLK_SRC prompt "RTC clock source" @@ -268,7 +284,7 @@ config ESP32S3_DATA_CACHE_WRAP config MAC_BB_PD bool "Power down MAC and baseband of Wi-Fi and Bluetooth when PHY is disabled" - depends on SOC_ESP32S3 && TICKLESS_KERNEL + depends on SOC_SERIES_ESP32S3 && TICKLESS_KERNEL default n help If enabled, the MAC and baseband of Wi-Fi and Bluetooth will be powered @@ -277,4 +293,4 @@ config MAC_BB_PD endmenu # Cache config -endif # SOC_ESP32S3 +endif # SOC_SERIES_ESP32S3 diff --git a/soc/xtensa/esp32s3/default.ld b/soc/xtensa/espressif_esp32/esp32s3/default.ld similarity index 100% rename from soc/xtensa/esp32s3/default.ld rename to soc/xtensa/espressif_esp32/esp32s3/default.ld diff --git a/soc/xtensa/esp32s3/linker.ld b/soc/xtensa/espressif_esp32/esp32s3/linker.ld similarity index 100% rename from soc/xtensa/esp32s3/linker.ld rename to soc/xtensa/espressif_esp32/esp32s3/linker.ld diff --git a/soc/xtensa/esp32s3/loader.c b/soc/xtensa/espressif_esp32/esp32s3/loader.c similarity index 100% rename from soc/xtensa/esp32s3/loader.c rename to soc/xtensa/espressif_esp32/esp32s3/loader.c diff --git a/soc/xtensa/esp32s3/mcuboot.ld b/soc/xtensa/espressif_esp32/esp32s3/mcuboot.ld similarity index 100% rename from soc/xtensa/esp32s3/mcuboot.ld rename to soc/xtensa/espressif_esp32/esp32s3/mcuboot.ld diff --git a/soc/xtensa/esp32s3/newlib_fix.c b/soc/xtensa/espressif_esp32/esp32s3/newlib_fix.c similarity index 100% rename from soc/xtensa/esp32s3/newlib_fix.c rename to soc/xtensa/espressif_esp32/esp32s3/newlib_fix.c diff --git a/soc/xtensa/esp32s3/pinctrl_soc.h b/soc/xtensa/espressif_esp32/esp32s3/pinctrl_soc.h similarity index 100% rename from soc/xtensa/esp32s3/pinctrl_soc.h rename to soc/xtensa/espressif_esp32/esp32s3/pinctrl_soc.h diff --git a/soc/xtensa/esp32s3/soc.c b/soc/xtensa/espressif_esp32/esp32s3/soc.c similarity index 100% rename from soc/xtensa/esp32s3/soc.c rename to soc/xtensa/espressif_esp32/esp32s3/soc.c diff --git a/soc/xtensa/esp32s3/soc.h b/soc/xtensa/espressif_esp32/esp32s3/soc.h similarity index 100% rename from soc/xtensa/esp32s3/soc.h rename to soc/xtensa/espressif_esp32/esp32s3/soc.h diff --git a/soc/xtensa/esp32s3/soc_cache.c b/soc/xtensa/espressif_esp32/esp32s3/soc_cache.c similarity index 100% rename from soc/xtensa/esp32s3/soc_cache.c rename to soc/xtensa/espressif_esp32/esp32s3/soc_cache.c diff --git a/tests/boards/espressif_esp32/cache_coex/README.rst b/tests/boards/espressif_esp32/cache_coex/README.rst index 5bee38ea40c5d1..00a6877841d817 100644 --- a/tests/boards/espressif_esp32/cache_coex/README.rst +++ b/tests/boards/espressif_esp32/cache_coex/README.rst @@ -19,7 +19,7 @@ Make sure you have the ESP32 DevKitC connected over USB port. .. code-block:: console - west build -b esp32 tests/boards/espressif_esp32/cache_coex + west build -b esp32_devkitc_wrover tests/boards/espressif_esp32/cache_coex west flash --esp-device /dev/ttyUSB0 Sample Output diff --git a/tests/boards/espressif_esp32/cache_coex/testcase.yaml b/tests/boards/espressif_esp32/cache_coex/testcase.yaml index bcb037bc99aec0..9de6d546a4b397 100644 --- a/tests/boards/espressif_esp32/cache_coex/testcase.yaml +++ b/tests/boards/espressif_esp32/cache_coex/testcase.yaml @@ -1,6 +1,6 @@ tests: boards.esp32.cache_coex: - platform_allow: esp32 esp32s2_saola + platform_allow: esp32_devkitc_wrover esp32s2_saola tags: - spiram - spiflash diff --git a/tests/drivers/adc/adc_api/boards/esp32.overlay b/tests/drivers/adc/adc_api/boards/esp32_devkitc_wroom.overlay similarity index 100% rename from tests/drivers/adc/adc_api/boards/esp32.overlay rename to tests/drivers/adc/adc_api/boards/esp32_devkitc_wroom.overlay diff --git a/tests/drivers/adc/adc_api/boards/esp32_devkitc_wrover.overlay b/tests/drivers/adc/adc_api/boards/esp32_devkitc_wrover.overlay new file mode 100644 index 00000000000000..c288312aa3aa69 --- /dev/null +++ b/tests/drivers/adc/adc_api/boards/esp32_devkitc_wrover.overlay @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2022 Wolter HV + * Copyright (c) 2023 Benjamin Björnsson + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + zephyr,user { + /* adjust channel number according to pinmux in board.dts */ + io-channels = <&adc0 0>, <&adc0 1>; + }; +}; + +&adc0 { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + channel@0 { + reg = <0>; + zephyr,gain = "ADC_GAIN_1"; + zephyr,reference = "ADC_REF_INTERNAL"; + zephyr,acquisition-time = ; + zephyr,resolution = <12>; + }; + + channel@1 { + reg = <1>; + zephyr,gain = "ADC_GAIN_1"; + zephyr,reference = "ADC_REF_INTERNAL"; + zephyr,acquisition-time = ; + zephyr,resolution = <12>; + }; +}; diff --git a/tests/drivers/can/api/testcase.yaml b/tests/drivers/can/api/testcase.yaml index 5048e5c6edbc47..9b38220e1e4bc0 100644 --- a/tests/drivers/can/api/testcase.yaml +++ b/tests/drivers/can/api/testcase.yaml @@ -12,7 +12,7 @@ tests: extra_args: DTC_OVERLAY_FILE=twai-enable.overlay filter: dt_compat_enabled("espressif,esp32-twai") platform_allow: - - esp32 + - esp32_devkitc_wroom - esp32c3_devkitm - esp32s2_saola - esp32s3_devkitm diff --git a/tests/drivers/counter/counter_basic_api/boards/esp32.overlay b/tests/drivers/counter/counter_basic_api/boards/esp32_devkitc_wroom.overlay similarity index 100% rename from tests/drivers/counter/counter_basic_api/boards/esp32.overlay rename to tests/drivers/counter/counter_basic_api/boards/esp32_devkitc_wroom.overlay diff --git a/tests/drivers/dac/dac_api/boards/esp32.overlay b/tests/drivers/dac/dac_api/boards/esp32_devkitc_wroom.overlay similarity index 100% rename from tests/drivers/dac/dac_api/boards/esp32.overlay rename to tests/drivers/dac/dac_api/boards/esp32_devkitc_wroom.overlay diff --git a/tests/drivers/dac/dac_api/boards/esp32_devkitc_wrover.overlay b/tests/drivers/dac/dac_api/boards/esp32_devkitc_wrover.overlay new file mode 100644 index 00000000000000..c179baef7454a9 --- /dev/null +++ b/tests/drivers/dac/dac_api/boards/esp32_devkitc_wrover.overlay @@ -0,0 +1,9 @@ +/* + * Copyright 2022 Espressif (Shanghai) + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&dac { + status = "okay"; +}; diff --git a/tests/drivers/dac/dac_api/src/test_dac.c b/tests/drivers/dac/dac_api/src/test_dac.c index 6e4883d9a9c569..377de463c7ea4e 100644 --- a/tests/drivers/dac/dac_api/src/test_dac.c +++ b/tests/drivers/dac/dac_api/src/test_dac.c @@ -62,7 +62,8 @@ #define DAC_RESOLUTION 12 #define DAC_CHANNEL_ID 0 -#elif defined(CONFIG_BOARD_ESP32) || \ +#elif defined(CONFIG_BOARD_ESP32_DEVKITC_WROOM) || \ + defined(CONFIG_BOARD_ESP32_DEVKITC_WROVER) || \ defined(CONFIG_BOARD_ESP_WROVER_KIT) || \ defined(CONFIG_BOARD_ESP32S2_SAOLA) || \ defined(CONFIG_BOARD_GD32A503V_EVAL) || \ diff --git a/tests/drivers/gpio/gpio_basic_api/boards/esp32.overlay b/tests/drivers/gpio/gpio_basic_api/boards/esp32_devkitc_wroom.overlay similarity index 100% rename from tests/drivers/gpio/gpio_basic_api/boards/esp32.overlay rename to tests/drivers/gpio/gpio_basic_api/boards/esp32_devkitc_wroom.overlay diff --git a/tests/drivers/pwm/pwm_api/boards/esp32.overlay b/tests/drivers/pwm/pwm_api/boards/esp32_devkitc_wroom.overlay similarity index 100% rename from tests/drivers/pwm/pwm_api/boards/esp32.overlay rename to tests/drivers/pwm/pwm_api/boards/esp32_devkitc_wroom.overlay diff --git a/tests/drivers/pwm/pwm_api/src/test_pwm.c b/tests/drivers/pwm/pwm_api/src/test_pwm.c index 21f1b10960d7c0..28b7ea541f2a0b 100644 --- a/tests/drivers/pwm/pwm_api/src/test_pwm.c +++ b/tests/drivers/pwm/pwm_api/src/test_pwm.c @@ -55,8 +55,8 @@ #endif #if defined(CONFIG_BOARD_COLIBRI_IMX7D_M4) || defined(CONFIG_SOC_MK64F12) || \ - defined(CONFIG_SOC_MKW41Z4) || defined(CONFIG_SOC_ESP32S2) || \ - defined(CONFIG_SOC_ESP32S3) || defined(CONFIG_SOC_ESP32C3) + defined(CONFIG_SOC_MKW41Z4) || defined(CONFIG_SOC_SERIES_ESP32S2) || \ + defined(CONFIG_SOC_ESP32S3) || defined(CONFIG_SOC_SERIES_ESP32C3) #define DEFAULT_PERIOD_CYCLE 1024 #define DEFAULT_PULSE_CYCLE 512 #define DEFAULT_PERIOD_NSEC 2000000 diff --git a/tests/drivers/pwm/pwm_loopback/boards/esp32.overlay b/tests/drivers/pwm/pwm_loopback/boards/esp32_devkitc_wroom.overlay similarity index 100% rename from tests/drivers/pwm/pwm_loopback/boards/esp32.overlay rename to tests/drivers/pwm/pwm_loopback/boards/esp32_devkitc_wroom.overlay diff --git a/tests/drivers/spi/spi_loopback/boards/esp32.conf b/tests/drivers/spi/spi_loopback/boards/esp32_devkitc_wroom.conf similarity index 100% rename from tests/drivers/spi/spi_loopback/boards/esp32.conf rename to tests/drivers/spi/spi_loopback/boards/esp32_devkitc_wroom.conf diff --git a/tests/drivers/spi/spi_loopback/boards/esp32.overlay b/tests/drivers/spi/spi_loopback/boards/esp32_devkitc_wroom.overlay similarity index 100% rename from tests/drivers/spi/spi_loopback/boards/esp32.overlay rename to tests/drivers/spi/spi_loopback/boards/esp32_devkitc_wroom.overlay diff --git a/tests/drivers/uart/uart_async_api/src/test_uart.h b/tests/drivers/uart/uart_async_api/src/test_uart.h index b6b5ee66f56355..cd9dd316248309 100644 --- a/tests/drivers/uart/uart_async_api/src/test_uart.h +++ b/tests/drivers/uart/uart_async_api/src/test_uart.h @@ -21,6 +21,8 @@ #if DT_NODE_EXISTS(DT_NODELABEL(dut)) #define UART_NODE DT_NODELABEL(dut) +#elif defined(CONFIG_SOC_SERIES_ESP32C3) +#define UART_NODE DT_NODELABEL(uart1) #else #define UART_NODE DT_CHOSEN(zephyr_console) #endif diff --git a/tests/subsys/debug/coredump_backends/boards/esp32.overlay b/tests/subsys/debug/coredump_backends/boards/esp32_devkitc_wroom.overlay similarity index 100% rename from tests/subsys/debug/coredump_backends/boards/esp32.overlay rename to tests/subsys/debug/coredump_backends/boards/esp32_devkitc_wroom.overlay diff --git a/tests/subsys/debug/coredump_backends/boards/esp32_devkitc_wrover.overlay b/tests/subsys/debug/coredump_backends/boards/esp32_devkitc_wrover.overlay new file mode 100644 index 00000000000000..eb707ee7221198 --- /dev/null +++ b/tests/subsys/debug/coredump_backends/boards/esp32_devkitc_wrover.overlay @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&flash0 { + partitions { + /* + * Reduce storage_partition to make space for + * coredump_partition + */ + + storage_partition: partition@250000 { + label = "storage"; + reg = <0x00250000 0x00005000>; + }; + + coredump_partition: partition@255000 { + label = "coredump-partition"; + reg = <0x255000 DT_SIZE_K(4)>; + }; + + }; +}; diff --git a/tests/subsys/debug/coredump_backends/testcase.yaml b/tests/subsys/debug/coredump_backends/testcase.yaml index 2b4399e09bfdb7..c8da7138e7a142 100644 --- a/tests/subsys/debug/coredump_backends/testcase.yaml +++ b/tests/subsys/debug/coredump_backends/testcase.yaml @@ -20,7 +20,8 @@ tests: extra_args: CONF_FILE=prj_flash_partition.conf platform_allow: - qemu_x86 - - esp32 + - esp32_devkitc_wroom + - esp32_devkitc_wrover - esp32s2_saola - esp32s3_devkitm - esp32c3_devkitm diff --git a/west.yml b/west.yml index ff83119fcc682f..3def5691788b61 100644 --- a/west.yml +++ b/west.yml @@ -147,7 +147,7 @@ manifest: groups: - hal - name: hal_espressif - revision: 322f6389e21d08845486b5ebe1a6e5cb077981b8 + revision: ae1bd648a1ac701672c46b6ff4eadfa716937ce3 path: modules/hal/espressif west-commands: west/west-commands.yml groups: