소스 검색

esp_flash: fix cs_initialize issue on esp32s2

Michael (XIAO Xufeng) 5 년 전
부모
커밋
c7b1436485
2개의 변경된 파일2개의 추가작업 그리고 12개의 파일을 삭제
  1. 2 5
      components/spi_flash/esp_flash_spi_init.c
  2. 0 7
      components/spi_flash/linker.lf

+ 2 - 5
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 {

+ 0 - 7
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)