mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
esp32 phy_init: Move DPORT Wifi clock masks to macro values
Amended fix for c642079 !534
This commit is contained in:
parent
98f8594151
commit
4d67a2ba8b
@ -62,6 +62,11 @@ void bootloader_fill_random(void *buffer, size_t length)
|
||||
|
||||
void bootloader_random_enable(void)
|
||||
{
|
||||
/* Ensure the hardware RNG is enabled following a soft reset. This should always be the case already (this clock is
|
||||
never disabled while the CPU is running), this is a "belts and braces" type check.
|
||||
*/
|
||||
SET_PERI_REG_MASK(DPORT_WIFI_CLK_EN_REG, DPORT_WIFI_CLK_RNG_EN);
|
||||
|
||||
/* Enable SAR ADC in test mode to feed ADC readings of the 1.1V
|
||||
reference via I2S into the RNG entropy input.
|
||||
|
||||
|
@ -1035,6 +1035,22 @@
|
||||
#define DPORT_WIFI_CLK_EN_V 0xFFFFFFFF
|
||||
#define DPORT_WIFI_CLK_EN_S 0
|
||||
|
||||
/* Mask for all Wifi clock bits - 0, 1, 2, 3, 6, 7, 8, 9, 10, 15 */
|
||||
#define DPORT_WIFI_CLK_WIFI_EN 0x000007cf
|
||||
#define DPORT_WIFI_CLK_WIFI_EN_M ((DPORT_WIFI_CLK_WIFI_EN_V)<<(DPORT_WIFI_CLK_WIFI_EN_S))
|
||||
#define DPORT_WIFI_CLK_WIFI_EN_V 0x1FF
|
||||
#define DPORT_WIFI_CLK_WIFI_EN_S 0
|
||||
/* Mask for all Bluetooth clock bits - 11, 16, 17 */
|
||||
#define DPORT_WIFI_CLK_BT_EN 0x61
|
||||
#define DPORT_WIFI_CLK_BT_EN_M ((DPORT_WIFI_CLK_BT_EN_V)<<(DPORT_WIFI_CLK_BT_EN_S))
|
||||
#define DPORT_WIFI_CLK_BT_EN_V 0x61
|
||||
#define DPORT_WIFI_CLK_BT_EN_S 11
|
||||
/* Remaining single bit clock masks */
|
||||
#define DPORT_WIFI_CLK_SDIOSLAVE_EN BIT(4)
|
||||
#define DPORT_WIFI_CLK_SDIO_HOST_EN BIT(13)
|
||||
#define DPORT_WIFI_CLK_EMAC_EN BIT(14)
|
||||
#define DPORT_WIFI_CLK_RNG_EN BIT(15)
|
||||
|
||||
#define DPORT_CORE_RST_EN_REG (DR_REG_DPORT_BASE + 0x0D0)
|
||||
/* DPORT_CORE_RST : R/W ;bitpos:[31:0] ;default: 32'h0 ; */
|
||||
/*description: */
|
||||
|
@ -60,7 +60,7 @@ esp_err_t esp_phy_rf_init(const esp_phy_init_data_t* init_data,
|
||||
}
|
||||
}
|
||||
// Enable WiFi peripheral clock
|
||||
SET_PERI_REG_MASK(DPORT_WIFI_CLK_EN_REG, 0x87cf);
|
||||
SET_PERI_REG_MASK(DPORT_WIFI_CLK_EN_REG, DPORT_WIFI_CLK_WIFI_EN | DPORT_WIFI_CLK_RNG_EN);
|
||||
ESP_LOGV(TAG, "register_chipv7_phy, init_data=%p, cal_data=%p, mode=%d",
|
||||
init_data, calibration_data, mode);
|
||||
phy_set_wifi_mode_only(0);
|
||||
@ -84,8 +84,8 @@ esp_err_t esp_phy_rf_deinit(void)
|
||||
if (s_phy_rf_init_count == 1) {
|
||||
// Disable PHY and RF.
|
||||
phy_close_rf();
|
||||
// Disable WiFi peripheral clock. Do not disable clock for generating random number.
|
||||
CLEAR_PERI_REG_MASK(DPORT_WIFI_CLK_EN_REG, 0x874f);
|
||||
// Disable WiFi peripheral clock. Do not disable clock for hardware RNG
|
||||
CLEAR_PERI_REG_MASK(DPORT_WIFI_CLK_EN_REG, DPORT_WIFI_CLK_WIFI_EN);
|
||||
} else {
|
||||
#if CONFIG_SW_COEXIST_ENABLE
|
||||
coex_deinit();
|
||||
|
Loading…
x
Reference in New Issue
Block a user