mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-14 14:06:54 +00:00
esp_common: move to esp_hw_support
This commit is contained in:
@@ -122,7 +122,7 @@ menu "ESP32-specific"
|
|||||||
endchoice
|
endchoice
|
||||||
|
|
||||||
# insert non-chip-specific items here
|
# insert non-chip-specific items here
|
||||||
source "$IDF_PATH/components/esp_common/Kconfig.spiram.common"
|
source "$IDF_PATH/components/esp_hw_support/Kconfig.spiram.common"
|
||||||
|
|
||||||
config SPIRAM_CACHE_WORKAROUND
|
config SPIRAM_CACHE_WORKAROUND
|
||||||
bool "Enable workaround for bug in SPI RAM cache for Rev1 ESP32s"
|
bool "Enable workaround for bug in SPI RAM cache for Rev1 ESP32s"
|
||||||
|
@@ -192,7 +192,7 @@ menu "ESP32S2-specific"
|
|||||||
endchoice
|
endchoice
|
||||||
|
|
||||||
# insert non-chip-specific items here
|
# insert non-chip-specific items here
|
||||||
source "$IDF_PATH/components/esp_common/Kconfig.spiram.common"
|
source "$IDF_PATH/components/esp_hw_support/Kconfig.spiram.common"
|
||||||
|
|
||||||
endmenu
|
endmenu
|
||||||
|
|
||||||
|
@@ -242,7 +242,7 @@ menu "ESP32S3-Specific"
|
|||||||
endchoice
|
endchoice
|
||||||
|
|
||||||
# insert non-chip-specific items here
|
# insert non-chip-specific items here
|
||||||
source "$IDF_PATH/components/esp_common/Kconfig.spiram.common"
|
source "$IDF_PATH/components/esp_hw_support/Kconfig.spiram.common"
|
||||||
|
|
||||||
endmenu
|
endmenu
|
||||||
|
|
||||||
|
@@ -1,8 +1,5 @@
|
|||||||
idf_build_get_property(target IDF_TARGET)
|
idf_build_get_property(target IDF_TARGET)
|
||||||
|
|
||||||
if(CONFIG_IDF_ENV_FPGA)
|
|
||||||
list(APPEND srcs "src/fpga_overrides.c")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(BOOTLOADER_BUILD)
|
if(BOOTLOADER_BUILD)
|
||||||
# For bootloader, all we need from esp_common is headers
|
# For bootloader, all we need from esp_common is headers
|
||||||
@@ -16,7 +13,6 @@ else()
|
|||||||
"src/esp_err.c"
|
"src/esp_err.c"
|
||||||
"src/esp_err_to_name.c"
|
"src/esp_err_to_name.c"
|
||||||
"src/freertos_hooks.c"
|
"src/freertos_hooks.c"
|
||||||
"src/mac_addr.c"
|
|
||||||
"src/stack_check.c"
|
"src/stack_check.c"
|
||||||
"src/task_wdt.c"
|
"src/task_wdt.c"
|
||||||
"src/int_wdt.c")
|
"src/int_wdt.c")
|
||||||
|
@@ -286,24 +286,6 @@ menu "Common ESP-related"
|
|||||||
Debug stubs are used by OpenOCD to execute pre-compiled onboard code
|
Debug stubs are used by OpenOCD to execute pre-compiled onboard code
|
||||||
which does some useful debugging stuff, e.g. GCOV data dump.
|
which does some useful debugging stuff, e.g. GCOV data dump.
|
||||||
|
|
||||||
config ESP_MAC_ADDR_UNIVERSE_WIFI_STA
|
|
||||||
bool
|
|
||||||
|
|
||||||
config ESP_MAC_ADDR_UNIVERSE_WIFI_AP
|
|
||||||
bool
|
|
||||||
|
|
||||||
config ESP_MAC_ADDR_UNIVERSE_BT
|
|
||||||
bool
|
|
||||||
|
|
||||||
config ESP_MAC_ADDR_UNIVERSE_BT_OFFSET
|
|
||||||
int
|
|
||||||
default 2 if ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR
|
|
||||||
default 1 if ESP32_UNIVERSAL_MAC_ADDRESSES_TWO
|
|
||||||
default 1
|
|
||||||
|
|
||||||
config ESP_MAC_ADDR_UNIVERSE_ETH
|
|
||||||
bool
|
|
||||||
|
|
||||||
config ESP_ALLOW_BSS_SEG_EXTERNAL_MEMORY
|
config ESP_ALLOW_BSS_SEG_EXTERNAL_MEMORY
|
||||||
# Invisible option that is set by SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY, but
|
# Invisible option that is set by SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY, but
|
||||||
# exists even if SPIRAM is not supported
|
# exists even if SPIRAM is not supported
|
||||||
|
@@ -1,73 +0,0 @@
|
|||||||
// Copyright 2010-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.
|
|
||||||
#include "sdkconfig.h"
|
|
||||||
#include "soc/soc.h"
|
|
||||||
#include "soc/rtc.h"
|
|
||||||
#include "soc/rtc_cntl_reg.h"
|
|
||||||
#include "esp_log.h"
|
|
||||||
#include "esp_rom_sys.h"
|
|
||||||
#include "esp_rom_uart.h"
|
|
||||||
#include "esp_attr.h"
|
|
||||||
|
|
||||||
static const char *TAG = "fpga";
|
|
||||||
|
|
||||||
extern void ets_update_cpu_frequency(uint32_t ticks_per_us);
|
|
||||||
|
|
||||||
static void s_warn(void)
|
|
||||||
{
|
|
||||||
ESP_EARLY_LOGW(TAG, "Project configuration is for internal FPGA use, not all functions will work");
|
|
||||||
}
|
|
||||||
|
|
||||||
void bootloader_clock_configure(void)
|
|
||||||
{
|
|
||||||
s_warn();
|
|
||||||
esp_rom_uart_tx_wait_idle(0);
|
|
||||||
|
|
||||||
uint32_t xtal_freq_mhz = 40;
|
|
||||||
#ifdef CONFIG_IDF_TARGET_ESP32S2
|
|
||||||
uint32_t apb_freq_hz = 20000000;
|
|
||||||
#else
|
|
||||||
uint32_t apb_freq_hz = 40000000;
|
|
||||||
#endif // CONFIG_IDF_TARGET_ESP32S2
|
|
||||||
ets_update_cpu_frequency(apb_freq_hz / 1000000);
|
|
||||||
REG_WRITE(RTC_CNTL_STORE5_REG, (apb_freq_hz >> 12) | ((apb_freq_hz >> 12) << 16));
|
|
||||||
REG_WRITE(RTC_CNTL_STORE4_REG, (xtal_freq_mhz) | ((xtal_freq_mhz) << 16));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Placed in IRAM since test_apps expects it to be */
|
|
||||||
void IRAM_ATTR bootloader_fill_random(void *buffer, size_t length)
|
|
||||||
{
|
|
||||||
uint8_t *buffer_bytes = (uint8_t *)buffer;
|
|
||||||
for (int i = 0; i < length; i++) {
|
|
||||||
buffer_bytes[i] = 0x5A;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void esp_clk_init(void)
|
|
||||||
{
|
|
||||||
s_warn();
|
|
||||||
}
|
|
||||||
|
|
||||||
void esp_perip_clk_init(void)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief No-op function, used to force linking this file
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
void esp_common_include_fpga_overrides(void)
|
|
||||||
{
|
|
||||||
}
|
|
@@ -7,7 +7,9 @@ endif()
|
|||||||
|
|
||||||
set(srcs "compare_set.c" "cpu_util.c")
|
set(srcs "compare_set.c" "cpu_util.c")
|
||||||
if(NOT BOOTLOADER_BUILD)
|
if(NOT BOOTLOADER_BUILD)
|
||||||
list(APPEND srcs "clk_ctrl_os.c")
|
list(APPEND srcs "clk_ctrl_os.c" "mac_addr.c")
|
||||||
|
endif()
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
idf_component_register(SRCS ${srcs}
|
idf_component_register(SRCS ${srcs}
|
||||||
|
26
components/esp_hw_support/Kconfig
Normal file
26
components/esp_hw_support/Kconfig
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
menu "Hardware Settings"
|
||||||
|
menu "MAC Config"
|
||||||
|
config ESP_UNIVERSAL_MAC_ADDRESSES
|
||||||
|
int
|
||||||
|
default 2 if ESP32_UNIVERSAL_MAC_ADDRESSES_TWO
|
||||||
|
default 4 if ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR
|
||||||
|
|
||||||
|
config ESP_MAC_ADDR_UNIVERSE_WIFI_STA
|
||||||
|
bool
|
||||||
|
|
||||||
|
config ESP_MAC_ADDR_UNIVERSE_WIFI_AP
|
||||||
|
bool
|
||||||
|
|
||||||
|
config ESP_MAC_ADDR_UNIVERSE_BT
|
||||||
|
bool
|
||||||
|
|
||||||
|
config ESP_MAC_ADDR_UNIVERSE_BT_OFFSET
|
||||||
|
int
|
||||||
|
default 2 if ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR
|
||||||
|
default 1 if ESP32_UNIVERSAL_MAC_ADDRESSES_TWO
|
||||||
|
default 1
|
||||||
|
|
||||||
|
config ESP_MAC_ADDR_UNIVERSE_ETH
|
||||||
|
bool
|
||||||
|
endmenu
|
||||||
|
endmenu
|
@@ -5,5 +5,6 @@ COMPONENT_ADD_LDFRAGMENTS := linker.lf
|
|||||||
port/$(IDF_TARGET)/rtc_clk.o: CFLAGS += -fno-jump-tables -fno-tree-switch-conversion
|
port/$(IDF_TARGET)/rtc_clk.o: CFLAGS += -fno-jump-tables -fno-tree-switch-conversion
|
||||||
|
|
||||||
ifdef IS_BOOTLOADER_BUILD
|
ifdef IS_BOOTLOADER_BUILD
|
||||||
COMPONENT_OBJEXCLUDE += clk_ctrl_os.o
|
COMPONENT_OBJEXCLUDE += clk_ctrl_os.o mac_addr.o
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
Reference in New Issue
Block a user