esp_common: move to esp_hw_support

This commit is contained in:
Renz Bagaporo 2021-02-18 21:09:27 +08:00
parent c179ece204
commit ae15c81dbe
14 changed files with 34 additions and 100 deletions

View File

@ -122,7 +122,7 @@ menu "ESP32-specific"
endchoice
# 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
bool "Enable workaround for bug in SPI RAM cache for Rev1 ESP32s"

View File

@ -192,7 +192,7 @@ menu "ESP32S2-specific"
endchoice
# 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

View File

@ -242,7 +242,7 @@ menu "ESP32S3-Specific"
endchoice
# 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

View File

@ -1,8 +1,5 @@
idf_build_get_property(target IDF_TARGET)
if(CONFIG_IDF_ENV_FPGA)
list(APPEND srcs "src/fpga_overrides.c")
endif()
if(BOOTLOADER_BUILD)
# For bootloader, all we need from esp_common is headers
@ -16,7 +13,6 @@ else()
"src/esp_err.c"
"src/esp_err_to_name.c"
"src/freertos_hooks.c"
"src/mac_addr.c"
"src/stack_check.c"
"src/task_wdt.c"
"src/int_wdt.c")

View File

@ -286,24 +286,6 @@ menu "Common ESP-related"
Debug stubs are used by OpenOCD to execute pre-compiled onboard code
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
# Invisible option that is set by SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY, but
# exists even if SPIRAM is not supported

View File

@ -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)
{
}

View File

@ -7,7 +7,9 @@ endif()
set(srcs "compare_set.c" "cpu_util.c")
if(NOT BOOTLOADER_BUILD)
list(APPEND srcs "clk_ctrl_os.c")
list(APPEND srcs "clk_ctrl_os.c" "mac_addr.c")
endif()
endif()
idf_component_register(SRCS ${srcs}

View 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

View File

@ -5,5 +5,6 @@ COMPONENT_ADD_LDFRAGMENTS := linker.lf
port/$(IDF_TARGET)/rtc_clk.o: CFLAGS += -fno-jump-tables -fno-tree-switch-conversion
ifdef IS_BOOTLOADER_BUILD
COMPONENT_OBJEXCLUDE += clk_ctrl_os.o
COMPONENT_OBJEXCLUDE += clk_ctrl_os.o mac_addr.o
endif