Parcourir la source

spi: remove hard-coded DMA chan in soc_caps.h

Armando il y a 5 ans
Parent
commit
d0415bd8f6

+ 2 - 2
components/driver/spi_common.c

@@ -53,7 +53,7 @@ static const char *SPI_TAG = "spi";
             SPI_CHECK(GPIO_IS_VALID_GPIO(pin_num), pin_name" not valid", ESP_ERR_INVALID_ARG); \
         }
 
-#define MAIN_BUS_DEFAULT() { \
+#define SPI_MAIN_BUS_DEFAULT() { \
         .host_id = 0, \
         .bus_attr = { \
             .tx_dma_chan = 0, \
@@ -88,7 +88,7 @@ ATOMIC_VAR_INIT(false),
 };
 
 static const char* spi_claiming_func[3] = {NULL, NULL, NULL};
-static spicommon_bus_context_t s_mainbus = MAIN_BUS_DEFAULT();
+static spicommon_bus_context_t s_mainbus = SPI_MAIN_BUS_DEFAULT();
 static spicommon_bus_context_t* bus_ctx[SOC_SPI_PERIPH_NUM] = {&s_mainbus};
 
 #if !SOC_GDMA_SUPPORTED

+ 0 - 12
components/soc/esp32c3/include/soc/soc_caps.h

@@ -10,20 +10,8 @@
 #define SOC_TWAI_SUPPORTED  1
 #define SOC_BT_SUPPORTED    1
 
-// There are 3 DMA channels on ESP32-C3
-// Attention: These fixed DMA channels are temporarily workaround before we have a centralized DMA controller API to help alloc the channel dynamically
-// Remove them when GDMA driver API is ready
-#define SOC_GDMA_SPI2_DMA_CHANNEL   (2)
-
-//NOTE: The CHx number should be consistent with the selected DMA channel above
-#define SOC_GDMA_SPI2_INTR_SOURCE   ETS_DMA_CH2_INTR_SOURCE
-//On C3, there is only 1 GPSPI controller (GPSPI2)
-#define SOC_GDMA_SPI3_DMA_CHANNEL   SOC_GDMA_SPI2_DMA_CHANNEL
-
-
 #include "rmt_caps.h"
 
-
 /*-------------------------- DAC CAPS ----------------------------------------*/
 #define SOC_DAC_PERIPH_NUM      0
 

+ 1 - 1
components/soc/esp32c3/spi_periph.c

@@ -63,7 +63,7 @@ const spi_signal_conn_t spi_periph_signal[SOC_SPI_PERIPH_NUM] = {
         .spihd_iomux_pin = FSPI_IOMUX_PIN_NUM_HD,
         .spics0_iomux_pin = FSPI_IOMUX_PIN_NUM_CS,
         .irq = ETS_SPI2_INTR_SOURCE,
-        .irq_dma = SOC_GDMA_SPI2_INTR_SOURCE,
+        .irq_dma = -1,
         .module = PERIPH_SPI2_MODULE,
         .hw = &GPSPI2,
         .func = FSPI_FUNC_NUM,

+ 0 - 2
components/soc/esp32s3/include/soc/soc_caps.h

@@ -159,8 +159,6 @@
 
 // Attention: These fixed DMA channels are temporarily workaround before we have a centralized DMA controller API to help alloc the channel dynamically
 // Remove them when GDMA driver API is ready
-#define SOC_GDMA_SPI2_DMA_CHANNEL (1)
-#define SOC_GDMA_SPI3_DMA_CHANNEL (2)
 #define SOC_GDMA_SHA_DMA_CHANNEL  (3)
 #define SOC_GDMA_AES_DMA_CHANNEL  (4)
 

+ 2 - 2
components/soc/esp32s3/spi_periph.c

@@ -63,7 +63,7 @@ const spi_signal_conn_t spi_periph_signal[SOC_SPI_PERIPH_NUM] = {
         .spihd_iomux_pin = FSPI_IOMUX_PIN_NUM_HD,
         .spics0_iomux_pin = FSPI_IOMUX_PIN_NUM_CS,
         .irq = ETS_SPI2_INTR_SOURCE,
-        .irq_dma = ETS_SPI2_DMA_INTR_SOURCE,
+        .irq_dma = -1,
         .module = PERIPH_FSPI_MODULE,
         .hw = &GPSPI2,
         .func = FSPI_FUNC_NUM,
@@ -89,7 +89,7 @@ const spi_signal_conn_t spi_periph_signal[SOC_SPI_PERIPH_NUM] = {
         .spihd_iomux_pin = -1,
         .spics0_iomux_pin = -1,
         .irq = ETS_SPI3_INTR_SOURCE,
-        .irq_dma = ETS_SPI3_DMA_INTR_SOURCE,
+        .irq_dma = -1,
         .module = PERIPH_HSPI_MODULE,
         .hw = &GPSPI3,
         .func = -1,