Просмотр исходного кода

refactor(sar): build sar_periph_ctrl related files by chip

Armando 2 лет назад
Родитель
Сommit
00df6b378d

+ 5 - 5
components/esp_hw_support/linker.lf

@@ -37,11 +37,11 @@ entries:
         mspi_timing_config (noflash)
         mspi_timing_config (noflash)
         if SOC_MEMSPI_TIMING_TUNING_BY_MSPI_DELAY = y:
         if SOC_MEMSPI_TIMING_TUNING_BY_MSPI_DELAY = y:
             mspi_timing_by_mspi_delay (noflash)
             mspi_timing_by_mspi_delay (noflash)
-
-    if ADC_ONESHOT_CTRL_FUNC_IN_IRAM = y:
-        sar_periph_ctrl (noflash)
-    else:
-        sar_periph_ctrl: sar_periph_ctrl_power_enable (noflash)
+    if SOC_ADC_SHARED_POWER = y:
+        if ADC_ONESHOT_CTRL_FUNC_IN_IRAM = y:
+            sar_periph_ctrl (noflash)
+        else:
+            sar_periph_ctrl: sar_periph_ctrl_power_enable (noflash)
 
 
 [mapping:soc_pm]
 [mapping:soc_pm]
 archive: libsoc.a
 archive: libsoc.a

+ 4 - 0
components/soc/esp32/include/soc/Kconfig.soc_caps.in

@@ -235,6 +235,10 @@ config SOC_ADC_RTC_MAX_BITWIDTH
     int
     int
     default 12
     default 12
 
 
+config SOC_ADC_SHARED_POWER
+    bool
+    default y
+
 config SOC_SHARED_IDCACHE_SUPPORTED
 config SOC_SHARED_IDCACHE_SUPPORTED
     bool
     bool
     default y
     default y

+ 3 - 0
components/soc/esp32/include/soc/soc_caps.h

@@ -134,6 +134,9 @@
 #define SOC_ADC_RTC_MIN_BITWIDTH                (9)
 #define SOC_ADC_RTC_MIN_BITWIDTH                (9)
 #define SOC_ADC_RTC_MAX_BITWIDTH                (12)
 #define SOC_ADC_RTC_MAX_BITWIDTH                (12)
 
 
+/*!< ADC power control is shared by PWDET */
+#define SOC_ADC_SHARED_POWER                    1
+
 /*-------------------------- BROWNOUT CAPS -----------------------------------*/
 /*-------------------------- BROWNOUT CAPS -----------------------------------*/
 #if SOC_CAPS_ECO_VER >= 100
 #if SOC_CAPS_ECO_VER >= 100
 #define SOC_BROWNOUT_RESET_SUPPORTED 1
 #define SOC_BROWNOUT_RESET_SUPPORTED 1

+ 4 - 0
components/soc/esp32c2/include/soc/Kconfig.soc_caps.in

@@ -179,6 +179,10 @@ config SOC_ADC_SELF_HW_CALI_SUPPORTED
     bool
     bool
     default y
     default y
 
 
+config SOC_ADC_SHARED_POWER
+    bool
+    default y
+
 config SOC_BROWNOUT_RESET_SUPPORTED
 config SOC_BROWNOUT_RESET_SUPPORTED
     bool
     bool
     default y
     default y

+ 3 - 0
components/soc/esp32c2/include/soc/soc_caps.h

@@ -84,6 +84,9 @@
 #define SOC_ADC_CALIBRATION_V1_SUPPORTED        (1) /*!< support HW offset calibration version 1*/
 #define SOC_ADC_CALIBRATION_V1_SUPPORTED        (1) /*!< support HW offset calibration version 1*/
 #define SOC_ADC_SELF_HW_CALI_SUPPORTED          (1) /*!< support HW offset self calibration */
 #define SOC_ADC_SELF_HW_CALI_SUPPORTED          (1) /*!< support HW offset self calibration */
 
 
+/*!< ADC power control is shared by PWDET, TempSensor */
+#define SOC_ADC_SHARED_POWER                    1
+
 /*-------------------------- BROWNOUT CAPS -----------------------------------*/
 /*-------------------------- BROWNOUT CAPS -----------------------------------*/
 #define SOC_BROWNOUT_RESET_SUPPORTED 1
 #define SOC_BROWNOUT_RESET_SUPPORTED 1
 
 

+ 4 - 0
components/soc/esp32c3/include/soc/Kconfig.soc_caps.in

@@ -259,6 +259,10 @@ config SOC_ADC_SELF_HW_CALI_SUPPORTED
     bool
     bool
     default y
     default y
 
 
+config SOC_ADC_SHARED_POWER
+    bool
+    default y
+
 config SOC_APB_BACKUP_DMA
 config SOC_APB_BACKUP_DMA
     bool
     bool
     default y
     default y

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

@@ -112,6 +112,9 @@
 #define SOC_ADC_CALIBRATION_V1_SUPPORTED        (1) /*!< support HW offset calibration version 1*/
 #define SOC_ADC_CALIBRATION_V1_SUPPORTED        (1) /*!< support HW offset calibration version 1*/
 #define SOC_ADC_SELF_HW_CALI_SUPPORTED          (1) /*!< support HW offset self calibration */
 #define SOC_ADC_SELF_HW_CALI_SUPPORTED          (1) /*!< support HW offset self calibration */
 
 
+/*!< ADC power control is shared by PWDET, TempSensor */
+#define SOC_ADC_SHARED_POWER                    1
+
 /*-------------------------- APB BACKUP DMA CAPS -------------------------------*/
 /*-------------------------- APB BACKUP DMA CAPS -------------------------------*/
 #define SOC_APB_BACKUP_DMA              (1)
 #define SOC_APB_BACKUP_DMA              (1)
 
 

+ 4 - 0
components/soc/esp32c6/include/soc/Kconfig.soc_caps.in

@@ -315,6 +315,10 @@ config SOC_ADC_TEMPERATURE_SHARE_INTR
     bool
     bool
     default y
     default y
 
 
+config SOC_ADC_SHARED_POWER
+    bool
+    default y
+
 config SOC_APB_BACKUP_DMA
 config SOC_APB_BACKUP_DMA
     bool
     bool
     default n
     default n

+ 3 - 0
components/soc/esp32c6/include/soc/soc_caps.h

@@ -125,6 +125,9 @@
 /*!< Interrupt */
 /*!< Interrupt */
 #define SOC_ADC_TEMPERATURE_SHARE_INTR          (1)
 #define SOC_ADC_TEMPERATURE_SHARE_INTR          (1)
 
 
+/*!< ADC power control is shared by PWDET */
+#define SOC_ADC_SHARED_POWER                    1
+
 // ESP32C6-TODO: Copy from esp32c6, need check
 // ESP32C6-TODO: Copy from esp32c6, need check
 /*-------------------------- APB BACKUP DMA CAPS -------------------------------*/
 /*-------------------------- APB BACKUP DMA CAPS -------------------------------*/
 #define SOC_APB_BACKUP_DMA              (0)
 #define SOC_APB_BACKUP_DMA              (0)

+ 4 - 0
components/soc/esp32h2/include/soc/Kconfig.soc_caps.in

@@ -295,6 +295,10 @@ config SOC_ADC_TEMPERATURE_SHARE_INTR
     bool
     bool
     default y
     default y
 
 
+config SOC_ADC_SHARED_POWER
+    bool
+    default y
+
 config SOC_APB_BACKUP_DMA
 config SOC_APB_BACKUP_DMA
     bool
     bool
     default n
     default n

+ 3 - 0
components/soc/esp32h2/include/soc/soc_caps.h

@@ -121,6 +121,9 @@
 /*!< Interrupt */
 /*!< Interrupt */
 #define SOC_ADC_TEMPERATURE_SHARE_INTR          (1)
 #define SOC_ADC_TEMPERATURE_SHARE_INTR          (1)
 
 
+/*!< ADC power control is shared by PWDET */
+#define SOC_ADC_SHARED_POWER                    1
+
 // ESP32H2-TODO: Copy from esp32c6, need check
 // ESP32H2-TODO: Copy from esp32c6, need check
 /*-------------------------- APB BACKUP DMA CAPS -------------------------------*/
 /*-------------------------- APB BACKUP DMA CAPS -------------------------------*/
 #define SOC_APB_BACKUP_DMA              (0)
 #define SOC_APB_BACKUP_DMA              (0)

+ 4 - 0
components/soc/esp32s2/include/soc/Kconfig.soc_caps.in

@@ -275,6 +275,10 @@ config SOC_ADC_SELF_HW_CALI_SUPPORTED
     bool
     bool
     default y
     default y
 
 
+config SOC_ADC_SHARED_POWER
+    bool
+    default y
+
 config SOC_BROWNOUT_RESET_SUPPORTED
 config SOC_BROWNOUT_RESET_SUPPORTED
     bool
     bool
     default y
     default y

+ 3 - 0
components/soc/esp32s2/include/soc/soc_caps.h

@@ -122,6 +122,9 @@
 #define SOC_ADC_CALIBRATION_V1_SUPPORTED        (1) /*!< support HW offset calibration version 1*/
 #define SOC_ADC_CALIBRATION_V1_SUPPORTED        (1) /*!< support HW offset calibration version 1*/
 #define SOC_ADC_SELF_HW_CALI_SUPPORTED          (1) /*!< support HW offset self calibration */
 #define SOC_ADC_SELF_HW_CALI_SUPPORTED          (1) /*!< support HW offset self calibration */
 
 
+/*!< ADC power control is shared by PWDET, TempSensor */
+#define SOC_ADC_SHARED_POWER                    1
+
 /*-------------------------- BROWNOUT CAPS -----------------------------------*/
 /*-------------------------- BROWNOUT CAPS -----------------------------------*/
 #define SOC_BROWNOUT_RESET_SUPPORTED 1
 #define SOC_BROWNOUT_RESET_SUPPORTED 1
 
 

+ 4 - 0
components/soc/esp32s3/include/soc/Kconfig.soc_caps.in

@@ -315,6 +315,10 @@ config SOC_ADC_SELF_HW_CALI_SUPPORTED
     bool
     bool
     default y
     default y
 
 
+config SOC_ADC_SHARED_POWER
+    bool
+    default y
+
 config SOC_APB_BACKUP_DMA
 config SOC_APB_BACKUP_DMA
     bool
     bool
     default y
     default y

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

@@ -115,6 +115,9 @@
 #define SOC_ADC_CALIBRATION_V1_SUPPORTED        (1) /*!< support HW offset calibration version 1*/
 #define SOC_ADC_CALIBRATION_V1_SUPPORTED        (1) /*!< support HW offset calibration version 1*/
 #define SOC_ADC_SELF_HW_CALI_SUPPORTED          (1) /*!< support HW offset self calibration */
 #define SOC_ADC_SELF_HW_CALI_SUPPORTED          (1) /*!< support HW offset self calibration */
 
 
+/*!< ADC power control is shared by PWDET, TempSensor */
+#define SOC_ADC_SHARED_POWER                    1
+
 /*-------------------------- APB BACKUP DMA CAPS -------------------------------*/
 /*-------------------------- APB BACKUP DMA CAPS -------------------------------*/
 #define SOC_APB_BACKUP_DMA              (1)
 #define SOC_APB_BACKUP_DMA              (1)