mirror of
https://github.com/espressif/esp-idf.git
synced 2026-05-05 12:25:03 +02:00
Add support for esp32h2 beta2
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
#include "esp_pm.h"
|
||||
#include "esp_phy_init.h"
|
||||
#include "soc/system_reg.h"
|
||||
#include "soc/clkrst_reg.h"
|
||||
|
||||
#include "hci_uart.h"
|
||||
#include "bt_osi_mem.h"
|
||||
@@ -57,9 +58,13 @@
|
||||
#define OSI_COEX_VERSION 0x00010006
|
||||
#define OSI_COEX_MAGIC_VALUE 0xFADEBEAD
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32H2_BETA_VERSION_1
|
||||
#define EXT_FUNC_VERSION 0x20220125
|
||||
#define EXT_FUNC_MAGIC_VALUE 0xA5A5A5A5
|
||||
|
||||
#elif CONFIG_IDF_TARGET_ESP32H2_BETA_VERSION_2
|
||||
#define EXT_FUNC_VERSION 0xE0000001
|
||||
#define EXT_FUNC_MAGIC_VALUE 0xA5A5A5A5
|
||||
#endif
|
||||
/* Types definition
|
||||
************************************************************************
|
||||
*/
|
||||
@@ -89,9 +94,11 @@ struct ext_funcs_t {
|
||||
void (* _task_delete)(void *task_handle);
|
||||
void (*_osi_assert)(const uint32_t ln, const char *fn, uint32_t param1, uint32_t param2);
|
||||
uint32_t (* _os_random)(void);
|
||||
#if CONFIG_IDF_TARGET_ESP32H2_BETA_VERSION_1
|
||||
int (* _ecc_gen_key_pair)(uint8_t *pub, uint8_t *priv);
|
||||
int (* _ecc_gen_dh_key)(const uint8_t *remote_pub_key_x, const uint8_t *remote_pub_key_y, const uint8_t *local_priv_key, uint8_t *dhkey);
|
||||
int (* _esp_reset_rpa_moudle)(void);
|
||||
#endif
|
||||
uint32_t magic;
|
||||
};
|
||||
|
||||
@@ -207,9 +214,11 @@ struct ext_funcs_t ext_funcs_ro = {
|
||||
._task_delete = task_delete_wrapper,
|
||||
._osi_assert = osi_assert_wrapper,
|
||||
._os_random = osi_random_wrapper,
|
||||
#if CONFIG_IDF_TARGET_ESP32H2_BETA_VERSION_1
|
||||
._ecc_gen_key_pair = ble_sm_alg_gen_key_pair,
|
||||
._ecc_gen_dh_key = ble_sm_alg_gen_dhkey,
|
||||
._esp_reset_rpa_moudle = esp_reset_rpa_moudle,
|
||||
#endif
|
||||
.magic = EXT_FUNC_MAGIC_VALUE,
|
||||
};
|
||||
|
||||
@@ -566,8 +575,17 @@ void controller_sleep_deinit(void)
|
||||
|
||||
}
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32H2_BETA_VERSION_2
|
||||
void periph_module_etm_active()
|
||||
{
|
||||
/*This part for esp32h2 beta2*/
|
||||
REG_SET_BIT(SYSTEM_MODCLK_CONF_REG, SYSTEM_ETM_CLK_SEL | SYSTEM_ETM_CLK_ACTIVE ); //Active ETM clock
|
||||
}
|
||||
#endif
|
||||
|
||||
esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
||||
{
|
||||
|
||||
if (ble_controller_status != ESP_BT_CONTROLLER_STATUS_IDLE) {
|
||||
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "invalid controller state");
|
||||
return ESP_FAIL;
|
||||
@@ -613,7 +631,12 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
||||
/* Initialize default event queue */
|
||||
ble_npl_eventq_init(nimble_port_get_dflt_eventq());
|
||||
#endif
|
||||
|
||||
periph_module_enable(PERIPH_BT_MODULE);
|
||||
#if CONFIG_IDF_TARGET_ESP32H2_BETA_VERSION_2
|
||||
// only use for esp32h2 beta2
|
||||
periph_module_etm_active();
|
||||
#endif
|
||||
|
||||
// init phy
|
||||
esp_phy_enable();
|
||||
|
||||
Reference in New Issue
Block a user