diff --git a/components/app_trace/port/xtensa/port.c b/components/app_trace/port/xtensa/port.c index d64f2631fd..cefd5a0cd2 100644 --- a/components/app_trace/port/xtensa/port.c +++ b/components/app_trace/port/xtensa/port.c @@ -155,7 +155,7 @@ #include "soc/sensitive_reg.h" #endif #include "eri.h" -#include "trax.h" +#include "esp_private/trax.h" #include "esp_log.h" #include "esp_app_trace_membufs_proto.h" #include "esp_app_trace_port.h" diff --git a/components/app_trace/sys_view/Sample/Config/SEGGER_SYSVIEW_Config_FreeRTOS.c b/components/app_trace/sys_view/Sample/Config/SEGGER_SYSVIEW_Config_FreeRTOS.c index 6398ae039d..3a2b674ce2 100644 --- a/components/app_trace/sys_view/Sample/Config/SEGGER_SYSVIEW_Config_FreeRTOS.c +++ b/components/app_trace/sys_view/Sample/Config/SEGGER_SYSVIEW_Config_FreeRTOS.c @@ -69,16 +69,7 @@ Revision: $Rev: 3734 $ #include "esp_intr_alloc.h" #include "soc/soc.h" #include "soc/interrupts.h" -#if CONFIG_IDF_TARGET_ESP32 -#include "esp32/clk.h" -#elif CONFIG_IDF_TARGET_ESP32S2 -#include "esp32s2/clk.h" -#elif CONFIG_IDF_TARGET_ESP32S3 -#include "esp32s3/clk.h" -#elif CONFIG_IDF_TARGET_ESP32C3 -#include "esp32c3/clk.h" -#endif - +#include "esp_private/esp_clk.h" extern const SEGGER_SYSVIEW_OS_API SYSVIEW_X_OS_TraceAPI; diff --git a/components/bt/controller/esp32/bt.c b/components/bt/controller/esp32/bt.c index a586c3e3fd..3432e09846 100644 --- a/components/bt/controller/esp32/bt.c +++ b/components/bt/controller/esp32/bt.c @@ -29,11 +29,11 @@ #include "esp_err.h" #include "esp_log.h" #include "esp_pm.h" +#include "esp_private/esp_clk.h" #include "esp_private/periph_ctrl.h" #include "soc/rtc.h" #include "soc/soc_memory_layout.h" #include "soc/dport_reg.h" -#include "esp32/clk.h" #include "esp_coexist_internal.h" #if !CONFIG_FREERTOS_UNICORE #include "esp_ipc.h" diff --git a/components/bt/controller/esp32c3/bt.c b/components/bt/controller/esp32c3/bt.c index a05b691d87..80d641784a 100644 --- a/components/bt/controller/esp32c3/bt.c +++ b/components/bt/controller/esp32c3/bt.c @@ -29,10 +29,10 @@ #include "esp_pm.h" #include "esp_ipc.h" #include "esp_private/periph_ctrl.h" +#include "esp_private/esp_clk.h" #include "soc/rtc.h" #include "soc/rtc_cntl_reg.h" #include "soc/soc_memory_layout.h" -#include "esp32c3/clk.h" #include "esp_coexist_internal.h" #include "esp32c3/rom/rom_layout.h" #include "esp_timer.h" diff --git a/components/bt/controller/esp32s3/bt.c b/components/bt/controller/esp32s3/bt.c index 937a1d5513..abd11ee6aa 100644 --- a/components/bt/controller/esp32s3/bt.c +++ b/components/bt/controller/esp32s3/bt.c @@ -30,10 +30,10 @@ #include "esp_pm.h" #include "esp_ipc.h" #include "esp_private/periph_ctrl.h" +#include "esp_private/esp_clk.h" #include "soc/rtc.h" #include "soc/rtc_cntl_reg.h" #include "soc/soc_memory_layout.h" -#include "esp32c3/clk.h" #include "esp_coexist_internal.h" #include "esp_timer.h" #include "esp_sleep.h" diff --git a/components/driver/uart.c b/components/driver/uart.c index 0afbba86a3..1394fcac6e 100644 --- a/components/driver/uart.c +++ b/components/driver/uart.c @@ -22,23 +22,10 @@ #include "driver/gpio.h" #include "driver/uart_select.h" #include "esp_private/periph_ctrl.h" +#include "esp_private/esp_clk.h" #include "sdkconfig.h" #include "esp_rom_gpio.h" -#if CONFIG_IDF_TARGET_ESP32 -#include "esp32/clk.h" -#elif CONFIG_IDF_TARGET_ESP32S2 -#include "esp32s2/clk.h" -#elif CONFIG_IDF_TARGET_ESP32S3 -#include "esp32s3/clk.h" -#elif CONFIG_IDF_TARGET_ESP32C3 -#include "esp32c3/clk.h" -#elif CONFIG_IDF_TARGET_ESP32H2 -#include "esp32h2/clk.h" -#elif CONFIG_IDF_TARGET_ESP8684 -#include "esp_private/esp_clk.h" -#endif - #ifdef CONFIG_UART_ISR_IN_IRAM #define UART_ISR_ATTR IRAM_ATTR #define UART_MALLOC_CAPS (MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT) diff --git a/components/efuse/esp32/esp_efuse_utility.c b/components/efuse/esp32/esp_efuse_utility.c index 2f3cb16c20..d289eaf3db 100644 --- a/components/efuse/esp32/esp_efuse_utility.c +++ b/components/efuse/esp32/esp_efuse_utility.c @@ -6,7 +6,7 @@ #include "esp_efuse_utility.h" #include "soc/efuse_periph.h" -#include "esp32/clk.h" +#include "esp_private/esp_clk.h" #include "esp_log.h" #include "assert.h" #include "sdkconfig.h" diff --git a/components/efuse/esp32c3/esp_efuse_utility.c b/components/efuse/esp32c3/esp_efuse_utility.c index 5105352da5..8f3f6d246d 100644 --- a/components/efuse/esp32c3/esp_efuse_utility.c +++ b/components/efuse/esp32c3/esp_efuse_utility.c @@ -10,7 +10,7 @@ #include "assert.h" #include "esp_efuse_utility.h" #include "soc/efuse_periph.h" -#include "esp32c3/clk.h" +#include "esp_private/esp_clk.h" #include "esp32c3/rom/efuse.h" static const char *TAG = "efuse"; diff --git a/components/efuse/esp32h2/esp_efuse_utility.c b/components/efuse/esp32h2/esp_efuse_utility.c index 1faca45802..91cc15a49c 100644 --- a/components/efuse/esp32h2/esp_efuse_utility.c +++ b/components/efuse/esp32h2/esp_efuse_utility.c @@ -10,7 +10,7 @@ #include "assert.h" #include "esp_efuse_utility.h" #include "soc/efuse_periph.h" -#include "esp32h2/clk.h" +#include "esp_private/esp_clk.h" #include "esp32h2/rom/efuse.h" static const char *TAG = "efuse"; diff --git a/components/efuse/esp32s2/esp_efuse_utility.c b/components/efuse/esp32s2/esp_efuse_utility.c index a5d5dc2867..bab6e61844 100644 --- a/components/efuse/esp32s2/esp_efuse_utility.c +++ b/components/efuse/esp32s2/esp_efuse_utility.c @@ -6,7 +6,7 @@ #include "esp_efuse_utility.h" #include "soc/efuse_periph.h" -#include "esp32s2/clk.h" +#include "esp_private/esp_clk.h" #include "esp_log.h" #include "assert.h" #include "sdkconfig.h" diff --git a/components/efuse/esp32s3/esp_efuse_utility.c b/components/efuse/esp32s3/esp_efuse_utility.c index 5ab670fa65..61c3cfa902 100644 --- a/components/efuse/esp32s3/esp_efuse_utility.c +++ b/components/efuse/esp32s3/esp_efuse_utility.c @@ -6,7 +6,7 @@ #include "esp_efuse_utility.h" #include "soc/efuse_periph.h" -#include "esp32s3/clk.h" +#include "esp_private/esp_clk.h" #include "esp_log.h" #include "assert.h" #include "sdkconfig.h" diff --git a/components/esp_hw_support/esp_clk.c b/components/esp_hw_support/esp_clk.c index 638c8bbcc2..8ea3a4bb89 100644 --- a/components/esp_hw_support/esp_clk.c +++ b/components/esp_hw_support/esp_clk.c @@ -12,31 +12,26 @@ #include "soc/rtc.h" #include "soc/soc_caps.h" #include "esp_rom_caps.h" +#include "esp_private/esp_clk.h" #if CONFIG_IDF_TARGET_ESP32 #include "esp32/rom/rtc.h" -#include "esp32/clk.h" #include "esp32/rtc.h" #elif CONFIG_IDF_TARGET_ESP32S2 #include "esp32s2/rom/rtc.h" -#include "esp32s2/clk.h" #include "esp32s2/rtc.h" #elif CONFIG_IDF_TARGET_ESP32S3 #include "esp32s3/rom/rtc.h" -#include "esp32s3/clk.h" #include "esp32s3/rtc.h" #include "esp32s3/rom/ets_sys.h" #elif CONFIG_IDF_TARGET_ESP32C3 #include "esp32c3/rom/rtc.h" -#include "esp32c3/clk.h" #include "esp32c3/rtc.h" #elif CONFIG_IDF_TARGET_ESP32H2 #include "esp32h2/rom/rtc.h" -#include "esp32h2/clk.h" #include "esp32h2/rtc.h" #elif CONFIG_IDF_TARGET_ESP8684 #include "esp8684/rom/rtc.h" -#include "esp_private/esp_clk.h" #include "esp8684/rtc.h" #endif diff --git a/components/esp_hw_support/hw_random.c b/components/esp_hw_support/hw_random.c index d0d32f4d43..1dc54d05df 100644 --- a/components/esp_hw_support/hw_random.c +++ b/components/esp_hw_support/hw_random.c @@ -12,20 +12,7 @@ #include "esp_attr.h" #include "hal/cpu_hal.h" #include "soc/wdev_reg.h" - -#if CONFIG_IDF_TARGET_ESP32 -#include "esp32/clk.h" -#elif CONFIG_IDF_TARGET_ESP32S2 -#include "esp32s2/clk.h" -#elif CONFIG_IDF_TARGET_ESP32S3 -#include "esp32s3/clk.h" -#elif CONFIG_IDF_TARGET_ESP32C3 -#include "esp32c3/clk.h" -#elif CONFIG_IDF_TARGET_ESP32H2 -#include "esp32h2/clk.h" -#elif CONFIG_IDF_TARGET_ESP8684 #include "esp_private/esp_clk.h" -#endif uint32_t IRAM_ATTR esp_random(void) { diff --git a/components/esp_hw_support/include/esp_clk.h b/components/esp_hw_support/include/esp_clk.h deleted file mode 100644 index 920f310c92..0000000000 --- a/components/esp_hw_support/include/esp_clk.h +++ /dev/null @@ -1,2 +0,0 @@ -#warning esp_clk.h has been replaced by esp32/clk.h, please include esp32/clk.h instead -#include "esp32/clk.h" diff --git a/components/esp_hw_support/include/soc/esp32/clk.h b/components/esp_hw_support/include/soc/esp32/clk.h deleted file mode 100644 index a9ed302852..0000000000 --- a/components/esp_hw_support/include/soc/esp32/clk.h +++ /dev/null @@ -1,8 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#pragma once -#include "esp_private/esp_clk.h" diff --git a/components/esp_hw_support/include/soc/esp32c3/clk.h b/components/esp_hw_support/include/soc/esp32c3/clk.h deleted file mode 100644 index a9ed302852..0000000000 --- a/components/esp_hw_support/include/soc/esp32c3/clk.h +++ /dev/null @@ -1,8 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#pragma once -#include "esp_private/esp_clk.h" diff --git a/components/esp_hw_support/include/soc/esp32h2/clk.h b/components/esp_hw_support/include/soc/esp32h2/clk.h deleted file mode 100644 index a9ed302852..0000000000 --- a/components/esp_hw_support/include/soc/esp32h2/clk.h +++ /dev/null @@ -1,8 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#pragma once -#include "esp_private/esp_clk.h" diff --git a/components/esp_hw_support/include/soc/esp32s2/clk.h b/components/esp_hw_support/include/soc/esp32s2/clk.h deleted file mode 100644 index a9ed302852..0000000000 --- a/components/esp_hw_support/include/soc/esp32s2/clk.h +++ /dev/null @@ -1,8 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#pragma once -#include "esp_private/esp_clk.h" diff --git a/components/esp_hw_support/include/soc/esp32s3/clk.h b/components/esp_hw_support/include/soc/esp32s3/clk.h deleted file mode 100644 index a9ed302852..0000000000 --- a/components/esp_hw_support/include/soc/esp32s3/clk.h +++ /dev/null @@ -1,8 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#pragma once -#include "esp_private/esp_clk.h" diff --git a/components/esp_hw_support/sleep_modes.c b/components/esp_hw_support/sleep_modes.c index 11a2c2d9bf..0414e7134b 100644 --- a/components/esp_hw_support/sleep_modes.c +++ b/components/esp_hw_support/sleep_modes.c @@ -42,40 +42,35 @@ #include "sdkconfig.h" #include "esp_rom_uart.h" #include "esp_rom_sys.h" -#include "brownout.h" +#include "esp_private/brownout.h" #include "esp_private/sleep_retention.h" +#include "esp_private/esp_clk.h" #ifdef CONFIG_IDF_TARGET_ESP32 #include "esp32/rom/cache.h" #include "esp32/rom/rtc.h" -#include "esp32/clk.h" #include "esp_private/gpio.h" #include "esp_private/sleep_gpio.h" #elif CONFIG_IDF_TARGET_ESP32S2 -#include "esp32s2/clk.h" #include "esp32s2/rom/cache.h" #include "esp32s2/rom/rtc.h" #include "soc/extmem_reg.h" #include "esp_private/gpio.h" #elif CONFIG_IDF_TARGET_ESP32S3 -#include "esp32s3/clk.h" #include "esp32s3/rom/cache.h" #include "esp32s3/rom/rtc.h" #include "soc/extmem_reg.h" #include "esp_private/sleep_mac_bb.h" #elif CONFIG_IDF_TARGET_ESP32C3 -#include "esp32c3/clk.h" #include "esp32c3/rom/cache.h" #include "esp32c3/rom/rtc.h" #include "soc/extmem_reg.h" #include "esp_private/sleep_mac_bb.h" #elif CONFIG_IDF_TARGET_ESP32H2 -#include "esp32h2/clk.h" #include "esp32h2/rom/cache.h" #include "esp32h2/rom/rtc.h" #include "soc/extmem_reg.h" #elif CONFIG_IDF_TARGET_ESP8684 -#include "esp_private/esp_clk.h" #include "esp8684/rom/cache.h" #include "esp8684/rom/rtc.h" #include "soc/extmem_reg.h" diff --git a/components/esp_hw_support/test/test_dport.c b/components/esp_hw_support/test/test_dport.c index 7f1b49a192..5c3c741ea8 100644 --- a/components/esp_hw_support/test/test_dport.c +++ b/components/esp_hw_support/test/test_dport.c @@ -11,7 +11,7 @@ #include "xtensa/core-macros.h" #include "xtensa/hal.h" #include "esp_types.h" -#include "esp32/clk.h" +#include "esp_private/esp_clk.h" #include "freertos/FreeRTOS.h" #include "freertos/task.h" diff --git a/components/esp_hw_support/test/test_rtc_clk.c b/components/esp_hw_support/test/test_rtc_clk.c index 10fa7cc114..1c7d273215 100644 --- a/components/esp_hw_support/test/test_rtc_clk.c +++ b/components/esp_hw_support/test/test_rtc_clk.c @@ -26,26 +26,22 @@ #include "esp_sleep.h" #include "esp_system.h" +#include "esp_private/esp_clk.h" #if CONFIG_IDF_TARGET_ESP32 #include "esp32/rtc.h" -#include "esp32/clk.h" #include "esp32/rom/rtc.h" #elif CONFIG_IDF_TARGET_ESP32S2 #include "esp32s2/rtc.h" -#include "esp32s2/clk.h" #include "esp32s2/rom/rtc.h" #elif CONFIG_IDF_TARGET_ESP32S3 #include "esp32s3/rtc.h" -#include "esp32s3/clk.h" #include "esp32s3/rom/rtc.h" #elif CONFIG_IDF_TARGET_ESP32C3 #include "esp32c3/rtc.h" -#include "esp32c3/clk.h" #include "esp32c3/rom/rtc.h" #elif CONFIG_IDF_TARGET_ESP32H2 #include "esp32h2/rtc.h" -#include "esp32h2/clk.h" #include "esp32h2/rom/rtc.h" #endif diff --git a/components/esp_pm/pm_impl.c b/components/esp_pm/pm_impl.c index 14c2d52ad1..5bb8f50d65 100644 --- a/components/esp_pm/pm_impl.c +++ b/components/esp_pm/pm_impl.c @@ -31,6 +31,7 @@ #include "esp_private/pm_impl.h" #include "esp_private/pm_trace.h" #include "esp_private/esp_timer_private.h" +#include "esp_private/esp_clk.h" #include "esp_sleep.h" @@ -38,26 +39,20 @@ // [refactor-todo] opportunity for further refactor #if CONFIG_IDF_TARGET_ESP32 -#include "esp32/clk.h" #include "esp32/pm.h" #include "driver/gpio.h" #elif CONFIG_IDF_TARGET_ESP32S2 -#include "esp32s2/clk.h" #include "esp32s2/pm.h" #include "driver/gpio.h" #elif CONFIG_IDF_TARGET_ESP32S3 -#include "esp32s3/clk.h" #include "esp32s3/pm.h" #elif CONFIG_IDF_TARGET_ESP32C3 -#include "esp32c3/clk.h" #include "esp32c3/pm.h" #include "driver/gpio.h" #elif CONFIG_IDF_TARGET_ESP32H2 -#include "esp32h2/clk.h" #include "esp32h2/pm.h" #include "driver/gpio.h" #elif CONFIG_IDF_TARGET_ESP8684 -#include "esp_private/esp_clk.h" #include "esp8684/pm.h" #include "driver/gpio.h" #endif diff --git a/components/esp_pm/test/test_pm.c b/components/esp_pm/test/test_pm.c index 3931f737d3..fd9774b334 100644 --- a/components/esp_pm/test/test_pm.c +++ b/components/esp_pm/test/test_pm.c @@ -14,22 +14,16 @@ #include "driver/rtc_io.h" #include "soc/rtc_periph.h" #include "esp_rom_sys.h" +#include "esp_private/esp_clk.h" #include "sdkconfig.h" #if CONFIG_IDF_TARGET_ESP32 -#include "esp32/clk.h" #include "esp32/ulp.h" #elif CONFIG_IDF_TARGET_ESP32S2 -#include "esp32s2/clk.h" #include "esp32s2/ulp.h" #elif CONFIG_IDF_TARGET_ESP32S3 -#include "esp32s3/clk.h" #include "esp32s3/ulp.h" -#elif CONFIG_IDF_TARGET_ESP32C3 -#include "esp32c3/clk.h" -#elif CONFIG_IDF_TARGET_ESP32H2 -#include "esp32h2/clk.h" #endif TEST_CASE("Can dump power management lock stats", "[pm]") diff --git a/components/esp_system/port/CMakeLists.txt b/components/esp_system/port/CMakeLists.txt index debcacb4ea..62d6f15553 100644 --- a/components/esp_system/port/CMakeLists.txt +++ b/components/esp_system/port/CMakeLists.txt @@ -4,8 +4,7 @@ if(CONFIG_IDF_TARGET_ARCH_RISCV) list(APPEND INCLUDE_FILES "include/riscv") endif() -target_include_directories(${COMPONENT_LIB} PRIVATE ${INCLUDE_FILES}) -target_include_directories(${COMPONENT_LIB} PUBLIC public_compat) +target_include_directories(${COMPONENT_LIB} PRIVATE ${INCLUDE_FILES} include/private) set(srcs "cpu_start.c" "panic_handler.c" "brownout.c") add_prefix(srcs "${CMAKE_CURRENT_LIST_DIR}/" ${srcs}) diff --git a/components/esp_system/port/arch/riscv/panic_arch.c b/components/esp_system/port/arch/riscv/panic_arch.c index de5cc73cc4..5e000217c8 100644 --- a/components/esp_system/port/arch/riscv/panic_arch.c +++ b/components/esp_system/port/arch/riscv/panic_arch.c @@ -12,7 +12,7 @@ #include "esp_private/panic_internal.h" #include "esp_private/panic_reason.h" #include "riscv/rvruntime-frames.h" -#include "cache_err_int.h" +#include "esp_private/cache_err_int.h" #if CONFIG_ESP_SYSTEM_MEMPROT_FEATURE #if CONFIG_IDF_TARGET_ESP32C3 diff --git a/components/esp_system/port/arch/xtensa/panic_arch.c b/components/esp_system/port/arch/xtensa/panic_arch.c index 23d0b09453..b992e0bbb9 100644 --- a/components/esp_system/port/arch/xtensa/panic_arch.c +++ b/components/esp_system/port/arch/xtensa/panic_arch.c @@ -14,7 +14,7 @@ #include "esp_private/panic_reason.h" #include "soc/soc.h" -#include "cache_err_int.h" +#include "esp_private/cache_err_int.h" #include "sdkconfig.h" diff --git a/components/esp_system/port/arch/xtensa/trax.c b/components/esp_system/port/arch/xtensa/trax.c index fd24aa1a54..96dafeb675 100644 --- a/components/esp_system/port/arch/xtensa/trax.c +++ b/components/esp_system/port/arch/xtensa/trax.c @@ -9,7 +9,7 @@ #include "esp_err.h" #include "esp_log.h" #include "xt_trax.h" -#include "trax.h" +#include "esp_private/trax.h" #include "hal/trace_ll.h" #include "soc/dport_reg.h" #include "soc/tracemem_config.h" diff --git a/components/esp_system/port/cpu_start.c b/components/esp_system/port/cpu_start.c index d672f776e1..ad9b5fcc58 100644 --- a/components/esp_system/port/cpu_start.c +++ b/components/esp_system/port/cpu_start.c @@ -15,7 +15,7 @@ #include "esp_system.h" #include "esp_efuse.h" -#include "cache_err_int.h" +#include "esp_private/cache_err_int.h" #include "esp_clk_internal.h" #include "esp_rom_efuse.h" @@ -79,7 +79,7 @@ #include "soc/spinlock.h" #if CONFIG_ESP32_TRAX || CONFIG_ESP32S2_TRAX || CONFIG_ESP32S3_TRAX -#include "trax.h" +#include "esp_private/trax.h" #endif #include "bootloader_mem.h" diff --git a/components/esp_system/port/include/esp_clk_internal.h b/components/esp_system/port/include/esp_clk_internal.h index f1f8964573..cc9d121285 100644 --- a/components/esp_system/port/include/esp_clk_internal.h +++ b/components/esp_system/port/include/esp_clk_internal.h @@ -1,19 +1,15 @@ -// Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once +#ifdef __cplusplus +extern "C" { +#endif + /** * @file esp_clk_internal.h * @@ -42,3 +38,7 @@ void esp_perip_clk_init(void); * Only internal use in unit test. */ void rtc_clk_select_rtc_slow_clk(void); + +#ifdef __cplusplus +} +#endif diff --git a/components/esp_system/port/include/port/panic_funcs.h b/components/esp_system/port/include/port/panic_funcs.h index 3c681fec95..c2b4280051 100644 --- a/components/esp_system/port/include/port/panic_funcs.h +++ b/components/esp_system/port/include/port/panic_funcs.h @@ -1,17 +1,17 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once +#ifdef __cplusplus +extern "C" { +#endif + void __attribute__((noreturn)) panic_restart(void); + +#ifdef __cplusplus +} +#endif diff --git a/components/esp_system/port/include/private/esp_private/brownout.h b/components/esp_system/port/include/private/esp_private/brownout.h new file mode 100644 index 0000000000..1e369ed6ae --- /dev/null +++ b/components/esp_system/port/include/private/esp_private/brownout.h @@ -0,0 +1,23 @@ +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + + +#ifndef __ESP_BROWNOUT_H +#define __ESP_BROWNOUT_H + +#ifdef __cplusplus +extern "C" { +#endif + +void esp_brownout_init(void); + +void esp_brownout_disable(void); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/components/esp_system/port/public_compat/cache_err_int.h b/components/esp_system/port/include/private/esp_private/cache_err_int.h similarity index 55% rename from components/esp_system/port/public_compat/cache_err_int.h rename to components/esp_system/port/include/private/esp_private/cache_err_int.h index d87406f80f..22e1c3ec7c 100644 --- a/components/esp_system/port/public_compat/cache_err_int.h +++ b/components/esp_system/port/include/private/esp_private/cache_err_int.h @@ -1,16 +1,8 @@ -// Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/components/esp_system/port/public_compat/trax.h b/components/esp_system/port/include/private/esp_private/trax.h similarity index 76% rename from components/esp_system/port/public_compat/trax.h rename to components/esp_system/port/include/private/esp_private/trax.h index 1322b7b585..1ff8d2ea4a 100644 --- a/components/esp_system/port/public_compat/trax.h +++ b/components/esp_system/port/include/private/esp_private/trax.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include "sdkconfig.h" #include "esp_err.h" diff --git a/components/esp_system/port/include/riscv/eh_frame_parser_impl.h b/components/esp_system/port/include/riscv/eh_frame_parser_impl.h index 14e3e655fd..d2a4784627 100644 --- a/components/esp_system/port/include/riscv/eh_frame_parser_impl.h +++ b/components/esp_system/port/include/riscv/eh_frame_parser_impl.h @@ -1,17 +1,9 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ /** * @file DWARF Exception Frames parser header @@ -21,11 +13,14 @@ * */ -#ifndef EH_FRAME_PARSER_IMPL_H -#define EH_FRAME_PARSER_IMPL_H +#pragma once #include "riscv/rvruntime-frames.h" +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief Define the Executionframe as RvExcFrame for this implementation. */ @@ -62,4 +57,8 @@ typedef RvExcFrame ExecutionFrame; */ #define EXECUTION_FRAME_REG(frame, i) (((uint32_t*) (frame))[(i)]) -#endif // _EH_FRAME_PARSER_IMPL_H +#ifdef __cplusplus +} +#endif + +// #endif // _EH_FRAME_PARSER_IMPL_H diff --git a/components/esp_system/port/panic_handler.c b/components/esp_system/port/panic_handler.c index 780777f011..c3944a0e13 100644 --- a/components/esp_system/port/panic_handler.c +++ b/components/esp_system/port/panic_handler.c @@ -17,7 +17,7 @@ #include "hal/soc_hal.h" #include "hal/cpu_hal.h" -#include "cache_err_int.h" +#include "esp_private/cache_err_int.h" #include "sdkconfig.h" #include "esp_rom_sys.h" diff --git a/components/esp_system/port/public_compat/brownout.h b/components/esp_system/port/public_compat/brownout.h deleted file mode 100644 index 397092cd44..0000000000 --- a/components/esp_system/port/public_compat/brownout.h +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2015-2021 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -#ifndef __ESP_BROWNOUT_H -#define __ESP_BROWNOUT_H - -#ifdef __cplusplus -extern "C" { -#endif - -void esp_brownout_init(void); - -void esp_brownout_disable(void); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/components/esp_system/port/soc/esp32/cache_err_int.h b/components/esp_system/port/soc/esp32/cache_err_int.h deleted file mode 100644 index 07085f5309..0000000000 --- a/components/esp_system/port/soc/esp32/cache_err_int.h +++ /dev/null @@ -1,2 +0,0 @@ -#pragma once -#include "cache_err_int.h" diff --git a/components/esp_system/port/soc/esp32/clk.c b/components/esp_system/port/soc/esp32/clk.c index b6fb4ae7ff..19988b820d 100644 --- a/components/esp_system/port/soc/esp32/clk.c +++ b/components/esp_system/port/soc/esp32/clk.c @@ -11,6 +11,7 @@ #include "soc/i2s_reg.h" #include "hal/cpu_hal.h" #include "esp_private/periph_ctrl.h" +#include "esp_private/esp_clk.h" #include "bootloader_clock.h" #include "hal/wdt_hal.h" @@ -18,7 +19,6 @@ #include "esp_log.h" -#include "esp32/clk.h" #include "esp_rom_uart.h" #include "esp_rom_sys.h" diff --git a/components/esp_system/port/soc/esp32/system_internal.c b/components/esp_system/port/soc/esp32/system_internal.c index e6a15e6414..07e8e86933 100644 --- a/components/esp_system/port/soc/esp32/system_internal.c +++ b/components/esp_system/port/soc/esp32/system_internal.c @@ -1,16 +1,8 @@ -// Copyright 2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include #include "esp_system.h" @@ -32,7 +24,7 @@ #include "hal/cpu_hal.h" #include "freertos/xtensa_api.h" #include "soc/soc_memory_layout.h" -#include "cache_err_int.h" +#include "esp_private/cache_err_int.h" #include "esp32/rom/cache.h" #include "esp32/rom/rtc.h" diff --git a/components/esp_system/port/soc/esp32c3/cache_err_int.h b/components/esp_system/port/soc/esp32c3/cache_err_int.h deleted file mode 100644 index 07085f5309..0000000000 --- a/components/esp_system/port/soc/esp32c3/cache_err_int.h +++ /dev/null @@ -1,2 +0,0 @@ -#pragma once -#include "cache_err_int.h" diff --git a/components/esp_system/port/soc/esp32c3/clk.c b/components/esp_system/port/soc/esp32c3/clk.c index de8bd23c5f..b3b2a02d62 100644 --- a/components/esp_system/port/soc/esp32c3/clk.c +++ b/components/esp_system/port/soc/esp32c3/clk.c @@ -11,7 +11,6 @@ #include "sdkconfig.h" #include "esp_attr.h" #include "esp_log.h" -#include "esp32c3/clk.h" #include "esp_clk_internal.h" #include "esp32c3/rom/ets_sys.h" #include "esp32c3/rom/uart.h" @@ -24,6 +23,7 @@ #include "hal/cpu_hal.h" #include "hal/wdt_hal.h" #include "esp_private/periph_ctrl.h" +#include "esp_private/esp_clk.h" #include "bootloader_clock.h" #include "soc/syscon_reg.h" #include "esp_rom_uart.h" diff --git a/components/esp_system/port/soc/esp32c3/system_internal.c b/components/esp_system/port/soc/esp32c3/system_internal.c index 77020b3a91..73c2ad2626 100644 --- a/components/esp_system/port/soc/esp32c3/system_internal.c +++ b/components/esp_system/port/soc/esp32c3/system_internal.c @@ -1,16 +1,8 @@ -// Copyright 2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include #include "sdkconfig.h" @@ -32,7 +24,7 @@ #include "soc/system_reg.h" #include "soc/uart_reg.h" #include "hal/wdt_hal.h" -#include "cache_err_int.h" +#include "esp_private/cache_err_int.h" #include "esp32c3/rom/cache.h" #include "esp32c3/rom/rtc.h" diff --git a/components/esp_system/port/soc/esp32h2/cache_err_int.h b/components/esp_system/port/soc/esp32h2/cache_err_int.h deleted file mode 100644 index 07085f5309..0000000000 --- a/components/esp_system/port/soc/esp32h2/cache_err_int.h +++ /dev/null @@ -1,2 +0,0 @@ -#pragma once -#include "cache_err_int.h" diff --git a/components/esp_system/port/soc/esp32h2/clk.c b/components/esp_system/port/soc/esp32h2/clk.c index 9830cd3467..bedf985702 100644 --- a/components/esp_system/port/soc/esp32h2/clk.c +++ b/components/esp_system/port/soc/esp32h2/clk.c @@ -11,7 +11,6 @@ #include "sdkconfig.h" #include "esp_attr.h" #include "esp_log.h" -#include "esp32h2/clk.h" #include "esp_clk_internal.h" #include "esp32h2/rom/ets_sys.h" #include "esp32h2/rom/uart.h" @@ -25,6 +24,7 @@ #include "hal/cpu_hal.h" #include "hal/wdt_hal.h" #include "esp_private/periph_ctrl.h" +#include "esp_private/esp_clk.h" #include "bootloader_clock.h" #include "soc/syscon_reg.h" #include "esp_rom_uart.h" diff --git a/components/esp_system/port/soc/esp32h2/system_internal.c b/components/esp_system/port/soc/esp32h2/system_internal.c index 71a028e1c1..944864d45c 100644 --- a/components/esp_system/port/soc/esp32h2/system_internal.c +++ b/components/esp_system/port/soc/esp32h2/system_internal.c @@ -23,7 +23,7 @@ #include "soc/syscon_reg.h" #include "soc/system_reg.h" #include "hal/wdt_hal.h" -#include "cache_err_int.h" +#include "esp_private/cache_err_int.h" #include "esp32h2/rom/cache.h" #include "esp32h2/rom/rtc.h" diff --git a/components/esp_system/port/soc/esp32s2/cache_err_int.h b/components/esp_system/port/soc/esp32s2/cache_err_int.h deleted file mode 100644 index 07085f5309..0000000000 --- a/components/esp_system/port/soc/esp32s2/cache_err_int.h +++ /dev/null @@ -1,2 +0,0 @@ -#pragma once -#include "cache_err_int.h" diff --git a/components/esp_system/port/soc/esp32s2/clk.c b/components/esp_system/port/soc/esp32s2/clk.c index dbd4483e66..57c41a9184 100644 --- a/components/esp_system/port/soc/esp32s2/clk.c +++ b/components/esp_system/port/soc/esp32s2/clk.c @@ -12,7 +12,6 @@ #include "sdkconfig.h" #include "esp_attr.h" #include "esp_log.h" -#include "esp32s2/clk.h" #include "esp_clk_internal.h" #include "esp_rom_uart.h" #include "esp_rom_sys.h" @@ -25,6 +24,7 @@ #include "hal/cpu_hal.h" #include "hal/wdt_hal.h" #include "esp_private/periph_ctrl.h" +#include "esp_private/esp_clk.h" #include "bootloader_clock.h" #include "soc/syscon_reg.h" #include "hal/clk_gate_ll.h" diff --git a/components/esp_system/port/soc/esp32s3/cache_err_int.h b/components/esp_system/port/soc/esp32s3/cache_err_int.h deleted file mode 100644 index 07085f5309..0000000000 --- a/components/esp_system/port/soc/esp32s3/cache_err_int.h +++ /dev/null @@ -1,2 +0,0 @@ -#pragma once -#include "cache_err_int.h" diff --git a/components/esp_system/port/soc/esp32s3/clk.c b/components/esp_system/port/soc/esp32s3/clk.c index 7440ac437c..2a14c28349 100644 --- a/components/esp_system/port/soc/esp32s3/clk.c +++ b/components/esp_system/port/soc/esp32s3/clk.c @@ -12,7 +12,6 @@ #include "sdkconfig.h" #include "esp_attr.h" #include "esp_log.h" -#include "esp32s3/clk.h" #include "esp_clk_internal.h" #include "esp_rom_uart.h" #include "esp_rom_sys.h" @@ -25,6 +24,7 @@ #include "hal/cpu_hal.h" #include "hal/wdt_hal.h" #include "esp_private/periph_ctrl.h" +#include "esp_private/esp_clk.h" #include "bootloader_clock.h" #include "soc/syscon_reg.h" diff --git a/components/esp_system/port/soc/esp8684/system_internal.c b/components/esp_system/port/soc/esp8684/system_internal.c index b02c8a51e0..ace4946352 100644 --- a/components/esp_system/port/soc/esp8684/system_internal.c +++ b/components/esp_system/port/soc/esp8684/system_internal.c @@ -23,7 +23,7 @@ #include "soc/syscon_reg.h" #include "soc/system_reg.h" #include "hal/wdt_hal.h" -#include "cache_err_int.h" +#include "esp_private/cache_err_int.h" #include "esp8684/rom/cache.h" #include "esp8684/rom/rtc.h" diff --git a/components/esp_system/startup.c b/components/esp_system/startup.c index 67c5acae42..8886fda52a 100644 --- a/components/esp_system/startup.c +++ b/components/esp_system/startup.c @@ -51,27 +51,19 @@ #include "esp_private/pm_impl.h" #include "esp_pthread.h" #include "esp_vfs_console.h" +#include "esp_private/esp_clk.h" -#include "brownout.h" +#include "esp_private/brownout.h" #include "esp_rom_sys.h" // [refactor-todo] make this file completely target-independent #if CONFIG_IDF_TARGET_ESP32 -#include "esp32/clk.h" #include "esp32/spiram.h" #elif CONFIG_IDF_TARGET_ESP32S2 -#include "esp32s2/clk.h" #include "esp32s2/spiram.h" #elif CONFIG_IDF_TARGET_ESP32S3 -#include "esp32s3/clk.h" #include "esp32s3/spiram.h" -#elif CONFIG_IDF_TARGET_ESP32C3 -#include "esp32c3/clk.h" -#elif CONFIG_IDF_TARGET_ESP32H2 -#include "esp32h2/clk.h" -#elif CONFIG_IDF_TARGET_ESP8684 -#include "esp_private/esp_clk.h" #endif /***********************************************/ diff --git a/components/esp_system/test/test_sleep.c b/components/esp_system/test/test_sleep.c index 16478f42bb..f0c277be63 100644 --- a/components/esp_system/test/test_sleep.c +++ b/components/esp_system/test/test_sleep.c @@ -25,18 +25,7 @@ #include "esp_rom_uart.h" #include "esp_rom_sys.h" #include "esp_timer.h" - -#if CONFIG_IDF_TARGET_ESP32 -#include "esp32/clk.h" -#elif CONFIG_IDF_TARGET_ESP32S2 -#include "esp32s2/clk.h" -#elif CONFIG_IDF_TARGET_ESP32S3 -#include "esp32s3/clk.h" -#elif CONFIG_IDF_TARGET_ESP32C3 -#include "esp32c3/clk.h" -#elif CONFIG_IDF_TARGET_ESP32H2 -#include "esp32h2/clk.h" -#endif +#include "esp_private/esp_clk.h" #define ESP_EXT0_WAKEUP_LEVEL_LOW 0 #define ESP_EXT0_WAKEUP_LEVEL_HIGH 1 diff --git a/components/esp_system/test/test_system_time.c b/components/esp_system/test/test_system_time.c index 24d28de489..ed85cc8e56 100644 --- a/components/esp_system/test/test_system_time.c +++ b/components/esp_system/test/test_system_time.c @@ -2,18 +2,7 @@ #include "unity.h" #include "esp_private/system_internal.h" - -#if CONFIG_IDF_TARGET_ESP32 -#include "esp32/clk.h" -#elif CONFIG_IDF_TARGET_ESP32S2 -#include "esp32s2/clk.h" -#elif CONFIG_IDF_TARGET_ESP32S3 -#include "esp32s3/clk.h" -#elif CONFIG_IDF_TARGET_ESP32C3 -#include "esp32c3/clk.h" -#elif CONFIG_IDF_TARGET_ESP32H2 -#include "esp32h2/clk.h" -#endif +#include "esp_private/esp_clk.h" TEST_CASE("Test effect of rtc clk calibration compensation on system time", "[esp_system]") { diff --git a/components/esp_timer/src/esp_timer_impl_frc_legacy.c b/components/esp_timer/src/esp_timer_impl_frc_legacy.c index 12a6fe0afa..249ca0c45e 100644 --- a/components/esp_timer/src/esp_timer_impl_frc_legacy.c +++ b/components/esp_timer/src/esp_timer_impl_frc_legacy.c @@ -1,16 +1,8 @@ -// Copyright 2017 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include "sys/param.h" #include "esp_timer_impl.h" @@ -21,7 +13,7 @@ #include "esp_attr.h" #include "esp_intr_alloc.h" #include "esp_log.h" -#include "esp32/clk.h" +#include "esp_private/esp_clk.h" #include "soc/frc_timer_reg.h" #include "soc/rtc.h" #include "freertos/FreeRTOS.h" diff --git a/components/esp_timer/src/esp_timer_impl_lac.c b/components/esp_timer/src/esp_timer_impl_lac.c index edc64dcd45..3994275593 100644 --- a/components/esp_timer/src/esp_timer_impl_lac.c +++ b/components/esp_timer/src/esp_timer_impl_lac.c @@ -13,7 +13,7 @@ #include "esp_attr.h" #include "esp_intr_alloc.h" #include "esp_log.h" -#include "esp32/clk.h" +#include "esp_private/esp_clk.h" #include "esp_private/periph_ctrl.h" #include "soc/soc.h" #include "soc/timer_group_reg.h" diff --git a/components/esp_wifi/esp32c3/esp_adapter.c b/components/esp_wifi/esp32c3/esp_adapter.c index aad0ae9bcb..080bfaa4ab 100644 --- a/components/esp_wifi/esp32c3/esp_adapter.c +++ b/components/esp_wifi/esp32c3/esp_adapter.c @@ -31,12 +31,12 @@ #include "esp_private/wifi_os_adapter.h" #include "esp_private/wifi.h" #include "esp_phy_init.h" -#include "esp32c3/clk.h" #include "soc/rtc_cntl_reg.h" #include "soc/rtc.h" #include "soc/syscon_reg.h" #include "phy_init_data.h" #include "esp_private/periph_ctrl.h" +#include "esp_private/esp_clk.h" #include "nvs.h" #include "os.h" #include "esp_smartconfig.h" diff --git a/components/esp_wifi/esp32s2/esp_adapter.c b/components/esp_wifi/esp32s2/esp_adapter.c index 99834df486..16e9c786b5 100644 --- a/components/esp_wifi/esp32s2/esp_adapter.c +++ b/components/esp_wifi/esp32s2/esp_adapter.c @@ -30,13 +30,13 @@ #include "esp_private/wifi_os_adapter.h" #include "esp_private/wifi.h" #include "esp_phy_init.h" -#include "esp32s2/clk.h" #include "soc/dport_reg.h" #include "soc/rtc.h" #include "soc/syscon_reg.h" #include "hal/interrupt_controller_hal.h" #include "phy_init_data.h" #include "esp_private/periph_ctrl.h" +#include "esp_private/esp_clk.h" #include "nvs.h" #include "os.h" #include "esp_smartconfig.h" diff --git a/components/esp_wifi/esp32s3/esp_adapter.c b/components/esp_wifi/esp32s3/esp_adapter.c index d75d0f5067..8b14a5d737 100644 --- a/components/esp_wifi/esp32s3/esp_adapter.c +++ b/components/esp_wifi/esp32s3/esp_adapter.c @@ -30,13 +30,13 @@ #include "esp_private/wifi_os_adapter.h" #include "esp_private/wifi.h" #include "esp_phy_init.h" -#include "esp32s3/clk.h" #include "soc/rtc_cntl_reg.h" #include "soc/rtc.h" #include "soc/syscon_reg.h" #include "hal/interrupt_controller_hal.h" #include "phy_init_data.h" #include "esp_private/periph_ctrl.h" +#include "esp_private/esp_clk.h" #include "nvs.h" #include "os.h" #include "esp_smartconfig.h" diff --git a/components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_init.c b/components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_init.c index bc8921f8ca..4a74de21af 100644 --- a/components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_init.c +++ b/components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_init.c @@ -35,13 +35,7 @@ that are implemented in C. #include "xtensa_rtos.h" #include "sdkconfig.h" -#if CONFIG_IDF_TARGET_ESP32 -#include "esp32/clk.h" -#elif CONFIG_IDF_TARGET_ESP32S2 -#include "esp32s2/clk.h" -#elif CONFIG_IDF_TARGET_ESP32S3 -#include "esp32s3/clk.h" -#endif +#include "esp_private/esp_clk.h" #ifdef XT_RTOS_TIMER_INT diff --git a/components/mbedtls/test/test_sha.c b/components/mbedtls/test/test_sha.c index 063cdcf0a6..1a9aed2f72 100644 --- a/components/mbedtls/test/test_sha.c +++ b/components/mbedtls/test/test_sha.c @@ -11,14 +11,7 @@ #include "ccomp_timer.h" #include "esp_heap_caps.h" #include "idf_performance.h" - -#if CONFIG_IDF_TARGET_ESP32 -#include "esp32/clk.h" -#elif CONFIG_IDF_TARGET_ESP32S2 -#include "esp32s2/clk.h" -#elif CONFIG_IDF_TARGET_ESP32C3 -#include "esp32c3/clk.h" -#endif +#include "esp_private/esp_clk.h" #include "soc/soc_caps.h" diff --git a/components/newlib/port/esp_time_impl.c b/components/newlib/port/esp_time_impl.c index 20ba2be385..6576b19d61 100644 --- a/components/newlib/port/esp_time_impl.c +++ b/components/newlib/port/esp_time_impl.c @@ -15,6 +15,7 @@ #include "esp_rom_sys.h" #include "esp_private/system_internal.h" +#include "esp_private/esp_clk.h" #include "esp_time_impl.h" @@ -22,27 +23,21 @@ #if CONFIG_IDF_TARGET_ESP32 #include "esp32/rom/rtc.h" -#include "esp32/clk.h" #include "esp32/rtc.h" #elif CONFIG_IDF_TARGET_ESP32S2 #include "esp32s2/rom/rtc.h" -#include "esp32s2/clk.h" #include "esp32s2/rtc.h" #elif CONFIG_IDF_TARGET_ESP32S3 #include "esp32s3/rom/rtc.h" -#include "esp32s3/clk.h" #include "esp32s3/rtc.h" #elif CONFIG_IDF_TARGET_ESP32C3 #include "esp32c3/rom/rtc.h" -#include "esp32c3/clk.h" #include "esp32c3/rtc.h" #elif CONFIG_IDF_TARGET_ESP32H2 #include "esp32h2/rom/rtc.h" -#include "esp32h2/clk.h" #include "esp32h2/rtc.h" #elif CONFIG_IDF_TARGET_ESP8684 #include "esp8684/rom/rtc.h" -#include "esp_private/esp_clk.h" #include "esp8684/rtc.h" #endif diff --git a/components/newlib/test/test_time.c b/components/newlib/test/test_time.c index b8db25c2f4..69cde042a0 100644 --- a/components/newlib/test/test_time.c +++ b/components/newlib/test/test_time.c @@ -21,29 +21,24 @@ #include "../priv_include/esp_time_impl.h" #include "esp_private/system_internal.h" +#include "esp_private/esp_clk.h" #if CONFIG_IDF_TARGET_ESP32 -#include "esp32/clk.h" #include "esp32/rtc.h" #define TARGET_DEFAULT_CPU_FREQ_MHZ CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ #elif CONFIG_IDF_TARGET_ESP32S2 -#include "esp32s2/clk.h" #include "esp32s2/rtc.h" #define TARGET_DEFAULT_CPU_FREQ_MHZ CONFIG_ESP32S2_DEFAULT_CPU_FREQ_MHZ #elif CONFIG_IDF_TARGET_ESP32S3 -#include "esp32s3/clk.h" #include "esp32s3/rtc.h" #define TARGET_DEFAULT_CPU_FREQ_MHZ CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ #elif CONFIG_IDF_TARGET_ESP32C3 -#include "esp32c3/clk.h" #include "esp32c3/rtc.h" #define TARGET_DEFAULT_CPU_FREQ_MHZ CONFIG_ESP32C3_DEFAULT_CPU_FREQ_MHZ #elif CONFIG_IDF_TARGET_ESP32H2 -#include "esp32h2/clk.h" #include "esp32h2/rtc.h" #define TARGET_DEFAULT_CPU_FREQ_MHZ CONFIG_ESP32H2_DEFAULT_CPU_FREQ_MHZ #elif CONFIG_IDF_TARGET_ESP8684 -#include "esp_private/esp_clk.h" #define TARGET_DEFAULT_CPU_FREQ_MHZ CONFIG_ESP8684_DEFAULT_CPU_FREQ_MHZ #endif diff --git a/components/spi_flash/flash_ops.c b/components/spi_flash/flash_ops.c index 47e2d4c5e8..df77fb1b04 100644 --- a/components/spi_flash/flash_ops.c +++ b/components/spi_flash/flash_ops.c @@ -21,34 +21,28 @@ #include "esp_log.h" #include "esp_private/system_internal.h" #include "esp_private/spi_flash_os.h" +#include "esp_private/esp_clk.h" #if CONFIG_IDF_TARGET_ESP32 #include "esp32/rom/cache.h" #include "esp32/rom/spi_flash.h" -#include "esp32/clk.h" #elif CONFIG_IDF_TARGET_ESP32S2 #include "esp32s2/rom/cache.h" #include "esp32s2/rom/spi_flash.h" -#include "esp32s2/clk.h" #elif CONFIG_IDF_TARGET_ESP32S3 #include "soc/spi_mem_reg.h" #include "esp32s3/rom/spi_flash.h" #include "esp32s3/rom/opi_flash.h" #include "esp32s3/rom/cache.h" -#include "esp32s3/clk.h" -#include "esp32s3/clk.h" #include "esp32s3/opi_flash_private.h" #elif CONFIG_IDF_TARGET_ESP32C3 #include "esp32c3/rom/cache.h" #include "esp32c3/rom/spi_flash.h" -#include "esp32c3/clk.h" #elif CONFIG_IDF_TARGET_ESP32H2 #include "esp32h2/rom/cache.h" #include "esp32h2/rom/spi_flash.h" -#include "esp32h2/clk.h" #elif CONFIG_IDF_TARGET_ESP8684 #include "esp8684/rom/cache.h" #include "esp8684/rom/spi_flash.h" -#include "esp_private/esp_clk.h" #endif #include "esp_flash_partitions.h" #include "cache_utils.h" diff --git a/components/ulp/ulp.c b/components/ulp/ulp.c index 150ab76eaf..e0c70a6f83 100644 --- a/components/ulp/ulp.c +++ b/components/ulp/ulp.c @@ -1,16 +1,8 @@ -// Copyright 2010-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2010-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -19,14 +11,12 @@ #include "esp_attr.h" #include "esp_err.h" #include "esp_log.h" +#include "esp_private/esp_clk.h" #if CONFIG_IDF_TARGET_ESP32 -#include "esp32/clk.h" #include "esp32/ulp.h" #elif CONFIG_IDF_TARGET_ESP32S2 -#include "esp32s2/clk.h" #include "esp32s2/ulp.h" #elif CONFIG_IDF_TARGET_ESP32S3 -#include "esp32s3/clk.h" #include "esp32s3/ulp.h" #endif diff --git a/components/ulp/ulp_riscv.c b/components/ulp/ulp_riscv.c index ccf2f8fcb9..1afbcc0a9f 100644 --- a/components/ulp/ulp_riscv.c +++ b/components/ulp/ulp_riscv.c @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -19,7 +11,7 @@ #include "esp_attr.h" #include "esp_err.h" #include "esp_log.h" -#include "esp32s2/clk.h" +#include "esp_private/esp_clk.h" #include "esp32s2/ulp.h" #include "esp32s2/ulp_riscv.h" #include "soc/soc.h" diff --git a/components/unity/unity_port_esp32.c b/components/unity/unity_port_esp32.c index c82cb97bab..cf34148ec3 100644 --- a/components/unity/unity_port_esp32.c +++ b/components/unity/unity_port_esp32.c @@ -9,19 +9,7 @@ #include "soc/cpu.h" #include "hal/cpu_hal.h" #include "esp_rom_uart.h" -#if CONFIG_IDF_TARGET_ESP32 -#include "esp32/clk.h" -#elif CONFIG_IDF_TARGET_ESP32S2 -#include "esp32s2/clk.h" -#elif CONFIG_IDF_TARGET_ESP32S3 -#include "esp32s3/clk.h" -#elif CONFIG_IDF_TARGET_ESP32C3 -#include "esp32c3/clk.h" -#elif CONFIG_IDF_TARGET_ESP32H2 -#include "esp32h2/clk.h" -#elif CONFIG_IDF_TARGET_ESP8684 #include "esp_private/esp_clk.h" -#endif static uint32_t s_test_start, s_test_stop; diff --git a/docs/en/migration-guides/system.rst b/docs/en/migration-guides/system.rst index 6d50901f39..3924c507c9 100644 --- a/docs/en/migration-guides/system.rst +++ b/docs/en/migration-guides/system.rst @@ -8,3 +8,24 @@ IPC (Inter-Processor Call) component has been moved to ``esp_system``. Thus, any project presenting a ``CMakeLists.txt`` file with the parameters ``PRIV_REQUIRES esp_ipc`` or ``REQUIRES esp_ipc``, should be modified to simply remove these options as ``esp_system`` component is included by default. +ESP Clock +--------- + +The old headers ``{IDF_TARGET_NAME}/clk.h``, ``esp_clk.h`` have been removed. + +Therefore, If you want to use the function with the prefix ``esp_clk`` please include ``esp_private/esp_clk.h`` instead. + +Cache Error Interrupt +--------------------- + +The old headers ``{IDF_TARGET_NAME}/cache_err_int.h`` have been removed. Please include ``esp_private/cache_err_int.h`` instead. + +Brownout +-------- + +The header ``brownout.h`` has been made private. ESP-IDF developers should include ``esp_private/brownout.h`` instead. + +Trax +---- + +The header ``trax.h`` has been made private. ESP-IDF developers should include ``esp_private/trax.h`` instead. diff --git a/tools/ci/check_copyright_ignore.txt b/tools/ci/check_copyright_ignore.txt index 6a262fbec4..53d680d71a 100644 --- a/tools/ci/check_copyright_ignore.txt +++ b/tools/ci/check_copyright_ignore.txt @@ -908,9 +908,6 @@ components/esp_system/include/esp_task_wdt.h components/esp_system/port/arch/riscv/expression_with_stack.c components/esp_system/port/arch/xtensa/debug_helpers.c components/esp_system/port/arch/xtensa/expression_with_stack.c -components/esp_system/port/include/esp_clk_internal.h -components/esp_system/port/include/port/panic_funcs.h -components/esp_system/port/include/riscv/eh_frame_parser_impl.h components/esp_system/port/public_compat/brownout.h components/esp_system/port/public_compat/cache_err_int.h components/esp_system/port/public_compat/trax.h @@ -918,12 +915,10 @@ components/esp_system/port/soc/esp32/cache_err_int.c components/esp_system/port/soc/esp32/cache_err_int.h components/esp_system/port/soc/esp32/intr.c components/esp_system/port/soc/esp32/reset_reason.c -components/esp_system/port/soc/esp32/system_internal.c components/esp_system/port/soc/esp32c3/apb_backup_dma.c components/esp_system/port/soc/esp32c3/cache_err_int.c components/esp_system/port/soc/esp32c3/cache_err_int.h components/esp_system/port/soc/esp32c3/reset_reason.c -components/esp_system/port/soc/esp32c3/system_internal.c components/esp_system/port/soc/esp32h2/apb_backup_dma.c components/esp_system/port/soc/esp32h2/cache_err_int.c components/esp_system/port/soc/esp32h2/cache_err_int.h @@ -948,7 +943,6 @@ components/esp_system/test_eh_frame_parser/linker.ld components/esp_system/test_eh_frame_parser/main.c components/esp_system/ubsan.c components/esp_timer/include/esp_private/esp_timer_private.h -components/esp_timer/src/esp_timer_impl_frc_legacy.c components/esp_timer/src/ets_timer_legacy.c components/esp_timer/test/test_esp_timer.c components/esp_timer/test/test_esp_timer_light_sleep.c @@ -2365,10 +2359,8 @@ components/ulp/test/esp32/test_ulp.c components/ulp/test/esp32/test_ulp_as.c components/ulp/test/esp32s2/test_ulp_riscv.c components/ulp/test/ulp_riscv/test_main.c -components/ulp/ulp.c components/ulp/ulp_macro.c components/ulp/ulp_private.h -components/ulp/ulp_riscv.c components/ulp/ulp_riscv/include/ulp_riscv/ulp_riscv.h components/ulp/ulp_riscv/include/ulp_riscv/ulp_riscv_gpio.h components/ulp/ulp_riscv/include/ulp_riscv/ulp_riscv_register_ops.h @@ -3620,8 +3612,6 @@ tools/test_idf_size/test_idf_size.py tools/test_mkdfu/test_mkdfu.py tools/test_mkuf2/test_mkuf2.py tools/unit-test-app/components/test_utils/ccomp_timer.c -tools/unit-test-app/components/test_utils/ccomp_timer_impl_riscv.c -tools/unit-test-app/components/test_utils/ccomp_timer_impl_xtensa.c tools/unit-test-app/components/test_utils/include/ccomp_timer.h tools/unit-test-app/components/test_utils/include/test_utils.h tools/unit-test-app/components/test_utils/private_include/ccomp_timer_impl.h diff --git a/tools/unit-test-app/components/test_utils/ccomp_timer_impl_riscv.c b/tools/unit-test-app/components/test_utils/ccomp_timer_impl_riscv.c index 488472de9c..7ac10d3a76 100644 --- a/tools/unit-test-app/components/test_utils/ccomp_timer_impl_riscv.c +++ b/tools/unit-test-app/components/test_utils/ccomp_timer_impl_riscv.c @@ -1,16 +1,8 @@ -// Copyright 2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2019-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include #include "freertos/portmacro.h" @@ -18,12 +10,7 @@ #include "soc/soc_caps.h" #include "hal/cpu_hal.h" #include "esp_rom_sys.h" - -#if CONFIG_IDF_TARGET_ESP32C3 -#include "esp32c3/clk.h" -#elif CONFIG_IDF_TARGET_ESP32H2 -#include "esp32h2/clk.h" -#endif +#include "esp_private/esp_clk.h" typedef enum { PERF_TIMER_UNINIT = 0, // timer has not been initialized yet diff --git a/tools/unit-test-app/components/test_utils/ccomp_timer_impl_xtensa.c b/tools/unit-test-app/components/test_utils/ccomp_timer_impl_xtensa.c index 43da1e1faa..0cdd4fca81 100644 --- a/tools/unit-test-app/components/test_utils/ccomp_timer_impl_xtensa.c +++ b/tools/unit-test-app/components/test_utils/ccomp_timer_impl_xtensa.c @@ -1,16 +1,8 @@ -// Copyright 2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2019-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -26,14 +18,7 @@ #include "xtensa/core-macros.h" #include "xtensa/xt_perf_consts.h" #include "xtensa-debug-module.h" - -#if CONFIG_IDF_TARGET_ESP32 -#include "esp32/clk.h" -#elif CONFIG_IDF_TARGET_ESP32S2 -#include "esp32s2/clk.h" -#elif CONFIG_IDF_TARGET_ESP32S3 -#include "esp32s3/clk.h" -#endif +#include "esp_private/esp_clk.h" #define D_STALL_COUNTER_ID 0 #define I_STALL_COUNTER_ID 1 diff --git a/tools/unit-test-app/components/test_utils/test/ccomp_timer_test_data.c b/tools/unit-test-app/components/test_utils/test/ccomp_timer_test_data.c index a3f0bf032f..9c92e5c808 100644 --- a/tools/unit-test-app/components/test_utils/test/ccomp_timer_test_data.c +++ b/tools/unit-test-app/components/test_utils/test/ccomp_timer_test_data.c @@ -7,17 +7,7 @@ #include "ccomp_timer.h" #include "freertos/FreeRTOS.h" #include "freertos/task.h" - - -#if CONFIG_IDF_TARGET_ESP32 -#include "esp32/clk.h" -#elif CONFIG_IDF_TARGET_ESP32S2 -#include "esp32s2/clk.h" -#elif CONFIG_IDF_TARTGET_ESP32S3 -#include "esp32s3/clk.h" -#elif CONFIG_IDF_TARGET_ESP32C3 -#include "esp32c3/clk.h" -#endif +#include "esp_private/esp_clk.h" #include "unity.h"