diff --git a/components/spi_flash/esp_flash_spi_init.c b/components/spi_flash/esp_flash_spi_init.c index 39c2386a91..eefe8a9779 100644 --- a/components/spi_flash/esp_flash_spi_init.c +++ b/components/spi_flash/esp_flash_spi_init.c @@ -88,13 +88,10 @@ static IRAM_ATTR NOINLINE_ATTR void cs_initialize(esp_flash_t *chip, const esp_f //To avoid the panic caused by flash data line conflicts during cs line //initialization, disable the cache temporarily chip->os_func->start(chip->os_func_data); + PIN_INPUT_ENABLE(iomux_reg); if (use_iomux) { - // This requires `gpio_iomux_in` and `gpio_iomux_out` to be in the IRAM. - // `linker.lf` is used fulfill this requirement. - gpio_iomux_in(cs_io_num, spics_in); - gpio_iomux_out(cs_io_num, spics_func, false); + PIN_FUNC_SELECT(iomux_reg, spics_func); } else { - PIN_INPUT_ENABLE(iomux_reg); if (cs_io_num < 32) { GPIO.enable_w1ts = (0x1 << cs_io_num); } else { diff --git a/components/spi_flash/linker.lf b/components/spi_flash/linker.lf index a31658712f..e9e86718ea 100644 --- a/components/spi_flash/linker.lf +++ b/components/spi_flash/linker.lf @@ -7,10 +7,3 @@ entries: spi_flash_chip_mxic (noflash) spi_flash_chip_gd(noflash) memspi_host_driver (noflash) - -# `spi_bus_add_flash_device` uses these functions when the cache is disabled -[mapping:driver_spiflash] -archive: libdriver.a -entries: - gpio:gpio_iomux_out (noflash) - gpio:gpio_iomux_in (noflash)