|
13 | 13 | #include "esp_rom_efuse.h" |
14 | 14 | #include "esp_rom_serial_output.h" |
15 | 15 | #include "esp_rom_sys.h" |
16 | | -#include "esp_rom_spiflash.h" |
17 | 16 | #include "soc/gpio_sig_map.h" |
18 | 17 | #include "esp_cpu.h" |
19 | 18 | #include "soc/rtc.h" |
20 | | -#include "soc/spi_periph.h" |
21 | 19 | #include "soc/cache_reg.h" |
22 | 20 | #include "soc/io_mux_reg.h" |
23 | 21 | #include "soc/pcr_reg.h" |
|
28 | 26 | #include "bootloader_flash_config.h" |
29 | 27 | #include "bootloader_mem.h" |
30 | 28 | #include "esp_private/regi2c_ctrl.h" |
31 | | -// #include "soc/regi2c_lp_bias.h" |
32 | | -// #include "soc/regi2c_bias.h" |
33 | 29 | #include "soc/hp_system_reg.h" |
34 | 30 | #include "bootloader_console.h" |
35 | 31 | #include "bootloader_flash_priv.h" |
@@ -83,39 +79,18 @@ static void bootloader_super_wdt_auto_feed(void) |
83 | 79 | REG_WRITE(LP_WDT_SWD_WPROTECT_REG, 0); |
84 | 80 | } |
85 | 81 |
|
86 | | -void spi_flash_din_num_set(uint8_t spi_num, uint8_t din_num) |
87 | | -{ |
88 | | - uint32_t reg_val = (REG_READ(SPI_MEM_DIN_NUM_REG(spi_num)) & (~(SPI_MEM_DIN0_NUM_M | SPI_MEM_DIN1_NUM_M | SPI_MEM_DIN2_NUM_M | SPI_MEM_DIN3_NUM_M | SPI_MEM_DIN4_NUM_M | SPI_MEM_DIN5_NUM_M | SPI_MEM_DIN6_NUM_M | SPI_MEM_DIN7_NUM_M | SPI_MEM_DINS_NUM_M))) |
89 | | - | (din_num << SPI_MEM_DIN0_NUM_S) | (din_num << SPI_MEM_DIN1_NUM_S) | (din_num << SPI_MEM_DIN2_NUM_S) | (din_num << SPI_MEM_DIN3_NUM_S) |
90 | | - | (din_num << SPI_MEM_DIN4_NUM_S) | (din_num << SPI_MEM_DIN5_NUM_S) | (din_num << SPI_MEM_DIN6_NUM_S) | (din_num << SPI_MEM_DIN7_NUM_S) | (din_num << SPI_MEM_DINS_NUM_S); |
91 | | - REG_WRITE(SPI_MEM_DIN_NUM_REG(spi_num), reg_val); |
92 | | - REG_SET_BIT(SPI_MEM_TIMING_CALI_REG(spi_num), SPI_MEM_TIMING_CALI_UPDATE); |
93 | | -} |
94 | | - |
95 | | -void spi_flash_extra_dummy_set(uint8_t spi_num, uint8_t extra_dummy) |
96 | | -{ |
97 | | - rom_spiflash_legacy_data->dummy_len_plus[spi_num] = extra_dummy; |
98 | | -} |
99 | | - |
100 | | -/* |
101 | | - * din mode din_num dummy |
102 | | - 1 0 1 |
103 | | - 0 0 0 |
104 | | - 1 0 2 |
105 | | - 0 0 1 |
106 | | - 1 0 3 |
107 | | - 0 0 2 |
108 | | - 1 0 4 |
109 | | - 0 0 3 |
110 | | - */ |
111 | 82 | static inline void bootloader_hardware_init(void) |
112 | 83 | { |
113 | | - // TODO: IDF-12285 RF disable? |
| 84 | + /* Disable RF pll by default */ |
| 85 | + CLEAR_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_XPD_RFPLL); |
| 86 | + SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_XPD_FORCE_RFPLL); |
114 | 87 |
|
| 88 | +#if !CONFIG_IDF_ENV_FPGA |
115 | 89 | /* Enable analog i2c master clock */ |
116 | 90 | _regi2c_ctrl_ll_master_enable_clock(true); // keep ana i2c mst clock always enabled in bootloader |
117 | | - regi2c_ctrl_ll_master_force_enable_clock(true); // TODO: IDF-12285 Remove this? |
| 91 | + regi2c_ctrl_ll_master_force_enable_clock(true); // TODO: IDF-12313 Remove this? |
118 | 92 | regi2c_ctrl_ll_master_configure_clock(); |
| 93 | +#endif |
119 | 94 | } |
120 | 95 |
|
121 | 96 | static inline void bootloader_ana_reset_config(void) |
|
0 commit comments