Skip to content

Commit

Permalink
soc: esp32: rework soc and dts structure
Browse files Browse the repository at this point in the history
Apply to ESP32, ESP32S2, ESP32S3.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
  • Loading branch information
Marek Matej committed May 30, 2023
1 parent 147d406 commit 390f93d
Show file tree
Hide file tree
Showing 103 changed files with 1,586 additions and 201 deletions.
2 changes: 1 addition & 1 deletion boards/xtensa/esp32/esp32.dts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
/dts-v1/;

#include <espressif/esp32.dtsi>
#include <espressif/esp32wroom.dtsi>
#include "esp32-pinctrl.dtsi"

/ {
Expand Down
2 changes: 1 addition & 1 deletion dts/xtensa/espressif/esp32.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@

flash0: flash@0 {
compatible = "soc-nv-flash";
reg = <0 0x400000>;
/* reg = <0 0x400000>; */
erase-block-size = <4096>;
write-block-size = <4>;
};
Expand Down
12 changes: 12 additions & 0 deletions dts/xtensa/espressif/esp32d0wd.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/

#include "esp32.dtsi"

/* placeholder - this is part used in SiP modules
* and on some boards - flash/psram size needs to
* be specified on board level
*/
7 changes: 7 additions & 0 deletions dts/xtensa/espressif/esp32d0wdr2.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/

#include "esp32.dtsi"
11 changes: 11 additions & 0 deletions dts/xtensa/espressif/esp32d2wd.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/

#include "esp32.dtsi"

&flash0 {
reg = <0x00000000 DT_SIZE_M(2)>;
};
11 changes: 11 additions & 0 deletions dts/xtensa/espressif/esp32pico.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/

#include "esp32.dtsi"

&flash0 {
reg = <0x00000000 DT_SIZE_M(4)>;
};
11 changes: 11 additions & 0 deletions dts/xtensa/espressif/esp32pico02.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/

#include "esp32.dtsi"

&flash0 {
reg = <0x0 DT_SIZE_M(8)>;
};
11 changes: 11 additions & 0 deletions dts/xtensa/espressif/esp32picod4.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/

#include "esp32.dtsi"

&flash0 {
reg = <0x0 DT_SIZE_M(4)>;
};
11 changes: 11 additions & 0 deletions dts/xtensa/espressif/esp32u4wdh.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/

#include "esp32.dtsi"

&flash0 {
reg = <0x0 DT_SIZE_M(4)>;
};
11 changes: 11 additions & 0 deletions dts/xtensa/espressif/esp32wroom.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/

#include "esp32.dtsi"

&flash0 {
reg = <0x0 DT_SIZE_M(4)>;
};
11 changes: 11 additions & 0 deletions dts/xtensa/espressif/esp32wrover.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/

#include "esp32.dtsi"

&flash0 {
reg = <0x0 DT_SIZE_M(4)>;
};
6 changes: 6 additions & 0 deletions soc/riscv/espressif_esp32/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd.
# SPDX-License-Identifier: Apache-2.0

add_subdirectory(${SOC_SERIES})
#add_subdirectory(common)
#zephyr_include_directories(common)
16 changes: 16 additions & 0 deletions soc/riscv/espressif_esp32/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright (c) 2023 Espressif
# 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/*/Kconfig.soc"

endif # SOC_FAMILY_ESP32

3 changes: 3 additions & 0 deletions soc/riscv/espressif_esp32/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# SPDX-License-Identifier: Apache-2.0

source "soc/arm/st_stm32/*/Kconfig.defconfig.series"
6 changes: 6 additions & 0 deletions soc/riscv/espressif_esp32/Kconfig.soc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# ST Microelectronics STM32 MCU line

# Copyright (c) 2016 Open-RnD Sp. z o.o.
# SPDX-License-Identifier: Apache-2.0

source "soc/arm/st_stm32/*/Kconfig.series"
File renamed without changes.
File renamed without changes.
50 changes: 50 additions & 0 deletions soc/riscv/espressif_esp32/esp32c3/Kconfig.defconfig.series
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Copyright (c) 2021 NXP
# SPDX-License-Identifier: Apache-2.0

if SOC_SERIES_NXP_IMX8

config SOC_SERIES
string
default "imx8"

config SOC_TOOLCHAIN_NAME
string
default "nxp_imx_adsp"

config SOC
string
default "nxp_imx8"

config SMP
default n

config XTENSA_TIMER
default y

config SYS_CLOCK_HW_CYCLES_PER_SEC
default 666000000 if XTENSA_TIMER

config SYS_CLOCK_TICKS_PER_SEC
default 50000

config KERNEL_ENTRY
default "__start"

config MULTI_LEVEL_INTERRUPTS
default n

config 2ND_LEVEL_INTERRUPTS
default n

config DYNAMIC_INTERRUPTS
default y

config LOG
default y

# To prevent test uses TEST_LOGGING_MINIMAL
config TEST_LOGGING_DEFAULTS
default n
depends on TEST

endif # SOC_SERIES_NXP_IMX8
13 changes: 13 additions & 0 deletions soc/riscv/espressif_esp32/esp32c3/Kconfig.series
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright (c) 2021 NXP
# SPDX-License-Identifier: Apache-2.0

config SOC_SERIES_NXP_IMX8
bool "NXP i.MX8"
select SOC_FAMILY_NXP_ADSP
select XTENSA
select XTENSA_HAL if ("$(ZEPHYR_TOOLCHAIN_VARIANT)" != "xcc" && "$(ZEPHYR_TOOLCHAIN_VARIANT)" != "xt-clang")
select XTENSA_RESET_VECTOR
select XTENSA_USE_CORE_CRT1
select ATOMIC_OPERATIONS_BUILTIN
help
NXP i.MX8
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
63 changes: 0 additions & 63 deletions soc/xtensa/esp32/Kconfig.defconfig

This file was deleted.

5 changes: 5 additions & 0 deletions soc/xtensa/espressif_esp32/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
15 changes: 15 additions & 0 deletions soc/xtensa/espressif_esp32/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# 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/*/Kconfig.soc"

endif # SOC_FAMILY_ESP32
4 changes: 4 additions & 0 deletions soc/xtensa/espressif_esp32/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd.
# SPDX-License-Identifier: Apache-2.0

source "soc/xtensa/espressif_esp32/*/Kconfig.defconfig.series"
4 changes: 4 additions & 0 deletions soc/xtensa/espressif_esp32/Kconfig.soc
Original file line number Diff line number Diff line change
@@ -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"
10 changes: 10 additions & 0 deletions soc/xtensa/espressif_esp32/common/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd.
# SPDX-License-Identifier: Apache-2.0

zephyr_include_directories(.)

#zephyr_sources(stm32cube_hal.c)
#zephyr_linker_sources_ifdef(CONFIG_STM32_CCM SECTIONS ccm.ld)
#zephyr_linker_sources_ifdef(CONFIG_STM32_BACKUP_SRAM SECTIONS stm32_backup_sram.ld)
#zephyr_sources_ifdef(CONFIG_STM32_BACKUP_SRAM stm32_backup_sram.c)
#zephyr_sources(soc_config.c)
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
16 changes: 16 additions & 0 deletions soc/xtensa/espressif_esp32/esp32/Kconfig.defconfig.esp32d0wd
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd.
# SPDX-License-Identifier: Apache-2.0

#ESP32-D0WD-V3
#flash 0
#psram 0
#gpio 34
#used_gpio 6,7,8,9,10,11
#cert BT_SIG

if SOC_ESP32D0WD

config SOC
default "esp32d0wd"

endif # SOC_ESP32D0WD config
37 changes: 37 additions & 0 deletions soc/xtensa/espressif_esp32/esp32/Kconfig.defconfig.esp32d0wdr2
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd.
# SPDX-License-Identifier: Apache-2.0

#ESP32-D0WDR2
#flash 0
#psram 2
#gpio 34
#used_gpio 6,7,8,9,10,11

if SOC_ESP32D0WDR2

config SOC
default "esp32d0wdr2"

#config ESP_SPIRAM
# default y
#
#config SPIRAM_TYPE_ESPPSRAM16
# default y
#
#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.

endif # SOC_ESP32D0WDR2 config
Loading

0 comments on commit 390f93d

Please sign in to comment.