Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

esp32: move common XTAL and RUN_IRAM configs to ESP32 KConfig #3473

Merged
merged 1 commit into from Apr 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 19 additions & 0 deletions arch/xtensa/src/esp32/Kconfig
Expand Up @@ -200,6 +200,18 @@ config ESP32_DEFAULT_CPU_FREQ_MHZ
default 160 if ESP32_DEFAULT_CPU_FREQ_160
default 240 if ESP32_DEFAULT_CPU_FREQ_240

choice
prompt "On-board Crystal Frequency"
default ESP32_XTAL_40MZ

config ESP32_XTAL_40MZ
bool "40MHz"

config ESP32_XTAL_26MHz
bool "26MHz"

endchoice # On-board Crystal Frequency

config ESP32_RT_TIMER
bool "Real-time Timer"
default n
Expand All @@ -212,6 +224,13 @@ config ESP32_PARTITION
Decode esp-idf's partition file and initialize
partition by nuttx MTD.

config ESP32_RUN_IRAM
bool "Run from IRAM"
default n
---help---
This loads all of NuttX inside IRAM. Used to test somewhat small
images that can fit entirely in IRAM.

menu "ESP32 Peripheral Selection"

config ESP32_UART
Expand Down
19 changes: 0 additions & 19 deletions boards/xtensa/esp32/esp32-devkitc/Kconfig
Expand Up @@ -5,25 +5,6 @@

if ARCH_BOARD_ESP32_DEVKITC

choice
prompt "On-board Crystal Frequency"
default ESP32_DEVKITC_XTAL_40MZ

config ESP32_DEVKITC_XTAL_40MZ
bool "40MHz"

config ESP32_DEVKITC_XTAL_26MHz
bool "26MHz"

endchoice # On-board Crystal Frequency

config ESP32_DEVKITC_RUN_IRAM
bool "Run from IRAM"
default n
---help---
This loads all of NuttX inside IRAM. Used to test somewhat small
images that can fit entirely in IRAM.

source boards/xtensa/esp32/common/Kconfig

if PM
Expand Down
4 changes: 2 additions & 2 deletions boards/xtensa/esp32/esp32-devkitc/include/board.h
Expand Up @@ -29,7 +29,7 @@

/* The ESP32 Core board V2 is fitted with either a 26 a 40MHz crystal */

#ifdef CONFIG_ESP32_DEVKITC_XTAL_26MHz
#ifdef CONFIG_ESP32_XTAL_26MHz
# define BOARD_XTAL_FREQUENCY 26000000
#else
# define BOARD_XTAL_FREQUENCY 40000000
Expand Down Expand Up @@ -60,7 +60,7 @@
* /bootloader_support/src/bootloader_clock.c#L38-L62
*/

#ifdef CONFIG_ESP32_DEVKITC_RUN_IRAM
#ifdef CONFIG_ESP32_RUN_IRAM
# define BOARD_CLOCK_FREQUENCY (2 * BOARD_XTAL_FREQUENCY)
#else
#ifdef CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ
Expand Down
2 changes: 1 addition & 1 deletion boards/xtensa/esp32/esp32-devkitc/scripts/Make.defs
Expand Up @@ -27,7 +27,7 @@ LDSCRIPT1 = $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32_out.ld
LDSCRIPT3 = $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32_rom.ld
LDSCRIPT4 = $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32_peripherals.ld

ifeq ($(CONFIG_ESP32_DEVKITC_RUN_IRAM),y)
ifeq ($(CONFIG_ESP32_RUN_IRAM),y)
LDSCRIPT2 = $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32_iram.ld
else
LDSCRIPT2 = $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32_flash.ld
Expand Down
19 changes: 0 additions & 19 deletions boards/xtensa/esp32/esp32-ethernet-kit/Kconfig
Expand Up @@ -5,25 +5,6 @@

if ARCH_BOARD_ESP32_ETHERNETKIT

choice
prompt "On-board Crystal Frequency"
default ESP32_ETHERNETKIT_XTAL_40MZ

config ESP32_ETHERNETKIT_XTAL_40MZ
bool "40MHz"

config ESP32_ETHERNETKIT_XTAL_26MHz
bool "26MHz"

endchoice # On-board Crystal Frequency

config ESP32_ETHERNETKIT_RUN_IRAM
bool "Run from IRAM"
default n
---help---
This loads all of NuttX inside IRAM. Used to test somewhat small
images that can fit entirely in IRAM.

source boards/xtensa/esp32/common/Kconfig

endif # ARCH_BOARD_ESP32_ETHERNETKIT
4 changes: 2 additions & 2 deletions boards/xtensa/esp32/esp32-ethernet-kit/include/board.h
Expand Up @@ -31,7 +31,7 @@
* crystal
*/

#ifdef CONFIG_ESP32_ETHERNETKIT_XTAL_26MHz
#ifdef CONFIG_ESP32_XTAL_26MHz
# define BOARD_XTAL_FREQUENCY 26000000
#else
# define BOARD_XTAL_FREQUENCY 40000000
Expand Down Expand Up @@ -62,7 +62,7 @@
* /bootloader_support/src/bootloader_clock.c#L38-L62
*/

#ifdef CONFIG_ESP32_ETHERNETKIT_RUN_IRAM
#ifdef CONFIG_ESP32_RUN_IRAM
# define BOARD_CLOCK_FREQUENCY (2 * BOARD_XTAL_FREQUENCY)
#else
#ifdef CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ
Expand Down
2 changes: 1 addition & 1 deletion boards/xtensa/esp32/esp32-ethernet-kit/scripts/Make.defs
Expand Up @@ -27,7 +27,7 @@ LDSCRIPT1 = $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32_out.ld
LDSCRIPT3 = $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32_rom.ld
LDSCRIPT4 = $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32_peripherals.ld

ifeq ($(CONFIG_ESP32_ETHERNETKIT_RUN_IRAM),y)
ifeq ($(CONFIG_ESP32_RUN_IRAM),y)
LDSCRIPT2 = $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32_iram.ld
else
LDSCRIPT2 = $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32_flash.ld
Expand Down
19 changes: 0 additions & 19 deletions boards/xtensa/esp32/esp32-wrover-kit/Kconfig
Expand Up @@ -5,25 +5,6 @@

if ARCH_BOARD_ESP32_WROVERKIT

choice
prompt "On-board Crystal Frequency"
default ESP32_WROVERKIT_XTAL_40MZ

config ESP32_WROVERKIT_XTAL_40MZ
bool "40MHz"

config ESP32_WROVERKIT_XTAL_26MHz
bool "26MHz"

endchoice # On-board Crystal Frequency

config ESP32_WROVERKIT_RUN_IRAM
bool "Run from IRAM"
default n
---help---
This loads all of NuttX inside IRAM. Used to test somewhat small
images that can fit entirely in IRAM.

source boards/xtensa/esp32/common/Kconfig

endif # ARCH_BOARD_ESP32_WROVERKIT
4 changes: 2 additions & 2 deletions boards/xtensa/esp32/esp32-wrover-kit/include/board.h
Expand Up @@ -31,7 +31,7 @@
* crystal
*/

#ifdef CONFIG_ESP32_WROVERKIT_XTAL_26MHz
#ifdef CONFIG_ESP32_XTAL_26MHz
# define BOARD_XTAL_FREQUENCY 26000000
#else
# define BOARD_XTAL_FREQUENCY 40000000
Expand Down Expand Up @@ -62,7 +62,7 @@
* /bootloader_support/src/bootloader_clock.c#L38-L62
*/

#ifdef CONFIG_ESP32_WROVERKIT_RUN_IRAM
#ifdef CONFIG_ESP32_RUN_IRAM
# define BOARD_CLOCK_FREQUENCY (2 * BOARD_XTAL_FREQUENCY)
#else
#ifdef CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ
Expand Down
2 changes: 1 addition & 1 deletion boards/xtensa/esp32/esp32-wrover-kit/scripts/Make.defs
Expand Up @@ -27,7 +27,7 @@ LDSCRIPT1 = $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32_out.ld
LDSCRIPT3 = $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32_rom.ld
LDSCRIPT4 = $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32_peripherals.ld

ifeq ($(CONFIG_ESP32_WROVERKIT_RUN_IRAM),y)
ifeq ($(CONFIG_ESP32_RUN_IRAM),y)
LDSCRIPT2 = $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32_iram.ld
else
LDSCRIPT2 = $(BOARD_DIR)$(DELIM)scripts$(DELIM)esp32_flash.ld
Expand Down