Skip to contentSkip to conversation

mmc: sdhci-pci-gli: Enable short circuit protection mechanism of GL9755

PATCH In review Renius Chen 2 participants 2 messages Feb 25, 2021 – Mar 2, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: sdhci-pci-gli: Enable short circuit protection mechanism of GL9755

Short circuit protection mechanism of GL9755 is disabled by HW default setting. Enable short circuit protection to prevent GL9755 from being damaged by short circuit or over current.

---
 drivers/mmc/host/sdhci-pci-gli.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/mmc/host/sdhci-pci-gli.c +8 -0
index 5606bdc08a96..7ba0fd601696 100644
@@ -123,6 +123,9 @@
 #define PCI_GLI_9755_PLLSSC        0x68
 #define   PCI_GLI_9755_PLLSSC_PPM    GENMASK(15, 0)
 
+#define PCI_GLI_9755_SerDes  0x70
+#define PCI_GLI_9755_SCP_DIS   BIT(19)
+
 #define GLI_MAX_TUNING_LOOP 40
 
 /* Genesys Logic chipset */
@@ -547,6 +550,11 @@ static void gl9755_hw_setting(struct sdhci_pci_slot *slot)
 	value &= ~PCI_GLI_9755_DMACLK;
 	pci_write_config_dword(pdev, PCI_GLI_9755_PECONF, value);
 
+	/* enable short circuit protection */
+	pci_read_config_dword(pdev, PCI_GLI_9755_SerDes, &value);
+	value &= ~PCI_GLI_9755_SCP_DIS;
+	pci_write_config_dword(pdev, PCI_GLI_9755_SerDes, value);
+
 	gl9755_wt_off(pdev);
 }
 
Signature · 1 line
2.27.0
#1 lore raw
Quoted 6 lines · Renius Chen

Short circuit protection mechanism of GL9755 is disabled by HW default setting. Enable short circuit protection to prevent GL9755 from being damaged by short circuit or over current.

Applied for next, thanks!

Kind regards
Uffe

Quoted 33 lines
---
 drivers/mmc/host/sdhci-pci-gli.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/mmc/host/sdhci-pci-gli.c +8 -1
index 5606bdc08a96..7ba0fd601696 100644
@@ -123,6 +123,9 @@
 #define PCI_GLI_9755_PLLSSC        0x68
 #define   PCI_GLI_9755_PLLSSC_PPM    GENMASK(15, 0)
 
+#define PCI_GLI_9755_SerDes  0x70
+#define PCI_GLI_9755_SCP_DIS   BIT(19)
+
 #define GLI_MAX_TUNING_LOOP 40
 
 /* Genesys Logic chipset */
@@ -547,6 +550,11 @@ static void gl9755_hw_setting(struct sdhci_pci_slot *slot)
        value &= ~PCI_GLI_9755_DMACLK;
        pci_write_config_dword(pdev, PCI_GLI_9755_PECONF, value);
 
+       /* enable short circuit protection */
+       pci_read_config_dword(pdev, PCI_GLI_9755_SerDes, &value);
+       value &= ~PCI_GLI_9755_SCP_DIS;
+       pci_write_config_dword(pdev, PCI_GLI_9755_SerDes, value);
+
        gl9755_wt_off(pdev);
 }
 
--

2.27.0