Skip to contentSkip to conversation

Add support of eMMC PHY for Intel Thunder Bay

PATCH Superseded [email protected] 3 participants 10 messages Aug 29, 2021 – Oct 25, 2021

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

v2 cover Add support of eMMC PHY for Intel Thunder Bay

From: Rashmi A <[email protected]>

This patch set enables the support for eMMC PHY on the Intel Thunder Bay SoC. eMMC PHY is based on arasan phy.

Patch 1 Adds arasan sdhci support for eMMC in Intel Thunder Bay. Patch 2 Adds arasan sdhci dt bindings.
Patch 3 Holds the device tree binding documentation for eMMC PHY
and listings of new files in MAINTAINERS file.
Patch 4 Holds the eMMC PHY driver.

Rashmi A (4):
mmc: sdhci-of-arasan: Add intel Thunder Bay SOC support to the arasan
eMMC driver
dt-bindings: mmc: Add bindings for Intel Thunder Bay SoC
dt-bindings: phy: intel: Add Thunder Bay eMMC PHY bindings
phy: intel: Add Thunder Bay eMMC PHY support

 .../devicetree/bindings/mmc/arasan,sdhci.yaml |  25 +
 .../phy/intel,phy-thunderbay-emmc.yaml        |  46 ++
 MAINTAINERS                                   |   7 +
 drivers/mmc/host/sdhci-of-arasan.c            |  29 +-
 drivers/phy/intel/Kconfig                     |  10 +
 drivers/phy/intel/Makefile                    |   1 +
 drivers/phy/intel/phy-intel-thunderbay-emmc.c | 512 ++++++++++++++++++
 7 files changed, 629 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/phy/intel,phy-thunderbay-emmc.yaml
 create mode 100644 drivers/phy/intel/phy-intel-thunderbay-emmc.c
Signature · 1 line
2.17.1
#1 lore raw

PATCH v2 1/4 mmc: sdhci-of-arasan: Add intel Thunder Bay SOC support to the arasan eMMC driver

From: Rashmi A <[email protected]>

Intel Thunder Bay SoC eMMC controller is based on Arasan eMMC 5.1 host controller IP

---
 drivers/mmc/host/sdhci-of-arasan.c | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)
drivers/mmc/host/sdhci-of-arasan.c +28 -1
index 839965f7c717..6f202fb7a546 100644
@@ -185,6 +185,13 @@ static const struct sdhci_arasan_soc_ctl_map intel_lgm_sdxc_soc_ctl_map = {
 	.hiword_update = false,
 };
 
+static const struct sdhci_arasan_soc_ctl_map thunderbay_soc_ctl_map = {
+	.baseclkfreq = { .reg = 0x0, .width = 8, .shift = 14 },
+	.clockmultiplier = { .reg = 0x4, .width = 8, .shift = 14 },
+	.support64b = { .reg = 0x4, .width = 1, .shift = 24 },
+	.hiword_update = false,
+};
+
 static const struct sdhci_arasan_soc_ctl_map intel_keembay_soc_ctl_map = {
 	.baseclkfreq = { .reg = 0x0, .width = 8, .shift = 14 },
 	.clockmultiplier = { .reg = 0x4, .width = 8, .shift = 14 },
@@ -430,6 +437,15 @@ static const struct sdhci_pltfm_data sdhci_arasan_cqe_pdata = {
 			SDHCI_QUIRK2_CLOCK_DIV_ZERO_BROKEN,
 };
 
+static const struct sdhci_pltfm_data sdhci_arasan_thunderbay_pdata = {
+	.ops = &sdhci_arasan_cqe_ops,
+	.quirks = SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN | SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC,
+	.quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN |
+		SDHCI_QUIRK2_CLOCK_DIV_ZERO_BROKEN |
+		SDHCI_QUIRK2_STOP_WITH_TC |
+		SDHCI_QUIRK2_CAPS_BIT63_FOR_HS400,
+};
+
 #ifdef CONFIG_PM_SLEEP
 /**
  * sdhci_arasan_suspend - Suspend method for the driver
@@ -1098,6 +1114,12 @@ static struct sdhci_arasan_of_data sdhci_arasan_generic_data = {
 	.clk_ops = &arasan_clk_ops,
 };
 
+static const struct sdhci_arasan_of_data sdhci_arasan_thunderbay_data = {
+	.soc_ctl_map = &thunderbay_soc_ctl_map,
+	.pdata = &sdhci_arasan_thunderbay_pdata,
+	.clk_ops = &arasan_clk_ops,
+};
+
 static const struct sdhci_pltfm_data sdhci_keembay_emmc_pdata = {
 	.ops = &sdhci_arasan_cqe_ops,
 	.quirks = SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN |
@@ -1231,6 +1253,10 @@ static const struct of_device_id sdhci_arasan_of_match[] = {
 		.compatible = "intel,keembay-sdhci-5.1-sdio",
 		.data = &intel_keembay_sdio_data,
 	},
+	{
+		.compatible = "intel,thunderbay-sdhci-5.1",
+		.data = &sdhci_arasan_thunderbay_data,
+	},
 	/* Generic compatible below here */
 	{
 		.compatible = "arasan,sdhci-8.9a",
@@ -1582,7 +1608,8 @@ static int sdhci_arasan_probe(struct platform_device *pdev)
 
 	if (of_device_is_compatible(np, "intel,keembay-sdhci-5.1-emmc") ||
 	    of_device_is_compatible(np, "intel,keembay-sdhci-5.1-sd") ||
-	    of_device_is_compatible(np, "intel,keembay-sdhci-5.1-sdio")) {
+	    of_device_is_compatible(np, "intel,keembay-sdhci-5.1-sdio") ||
+	    of_device_is_compatible(np, "intel,thunderbay-sdhci-5.1")) {
 		sdhci_arasan_update_clockmultiplier(host, 0x0);
 		sdhci_arasan_update_support64b(host, 0x0);
 
Signature · 1 line
2.17.1
#2 lore raw

PATCH v2 2/4 dt-bindings: mmc: Add bindings for Intel Thunder Bay SoC

In reply to [email protected]

From: Rashmi A <[email protected]>

Add documentation for Arasan SDHCI controller in Thunder Bay SOC.

---
 .../devicetree/bindings/mmc/arasan,sdhci.yaml | 25 +++++++++++++++++++
 1 file changed, 25 insertions(+)
Documentation/devicetree/bindings/mmc/arasan,sdhci.yaml +25 -0
index 37a5fe7b26dc..23abb7e8b9d8 100644
@@ -88,6 +88,12 @@ properties:
         description:
           For this device it is strongly suggested to include
           arasan,soc-ctl-syscon.
+      - items:
+          - const: intel,thunderbay-sdhci-5.1   # Intel Thunder Bay eMMC PHY
+          - const: arasan,sdhci-5.1
+        description:
+          For this device it is strongly suggested to include
+          clock-output-names and '#clock-cells'.
 
   reg:
     maxItems: 1
@@ -301,3 +307,22 @@ examples:
                    <&scmi_clk KEEM_BAY_PSS_SD0>;
           arasan,soc-ctl-syscon = <&sd0_phy_syscon>;
     };
+
+  - |
+    #define EMMC_XIN_CLK
+    #define EMMC_AXI_CLK
+    #define TBH_PSS_EMMC_RST_N
+    mmc@80420000 {
+          compatible = "intel,thunderbay-sdhci-5.1", "arasan,sdhci-5.1";
+          interrupts = <GIC_SPI 714 IRQ_TYPE_LEVEL_HIGH>;
+          reg = <0x80420000 0x400>;
+          clocks = <&scmi_clk EMMC_XIN_CLK>,
+                   <&scmi_clk EMMC_AXI_CLK>;
+          clock-names = "clk_xin", "clk_ahb";
+          phys = <&emmc_phy>;
+          phy-names = "phy_arasan";
+          assigned-clocks = <&scmi_clk EMMC_XIN_CLK>;
+          clock-output-names = "emmc_cardclock";
+          resets = <&rst_pss1 TBH_PSS_EMMC_RST_N>;
+          #clock-cells = <0x0>;
+    };
Signature · 1 line
2.17.1
#3 lore raw

PATCH v2 3/4 dt-bindings: phy: intel: Add Thunder Bay eMMC PHY bindings

In reply to [email protected]

From: Rashmi A <[email protected]>

Binding description for Intel Thunder Bay eMMC PHY. Added the newly introduced files into MAINTAINERS file-list

---
 .../phy/intel,phy-thunderbay-emmc.yaml        | 46 +++++++++++++++++++
 MAINTAINERS                                   |  7 +++
 2 files changed, 53 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/phy/intel,phy-thunderbay-emmc.yaml
Documentation/devicetree/bindings/phy/intel,phy-thunderbay-emmc.yaml new file +46 -0
new file mode 100644
index 000000000000..34bdb5c4cae8
@@ -0,0 +1,46 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/phy/intel,phy-thunderbay-emmc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Intel Thunder Bay eMMC PHY bindings
+
+maintainers:
+  - Srikandan Nandhini <[email protected]>
+
+properties:
+  compatible:
+    const: intel,thunderbay-emmc-phy
+
+  "#phy-cells":
+    const: 0
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    items:
+      - const: emmcclk
+
+required:
+  - "#phy-cells"
+  - compatible
+  - reg
+  - clocks
+
+additionalProperties: false
+
+examples:
+  - |
+     mmc_phy@80440800 {
+     #phy-cells = <0x0>;
+     compatible = "intel,thunderbay-emmc-phy";
+     status = "okay";
+     reg = <0x80440800 0x100>;
+     clocks = <&emmc>;
+     clock-names = "emmcclk";
+     };
MAINTAINERS +7 -0
index bd7aff0c120f..44533319c900 100644
@@ -9278,6 +9278,13 @@ F:	drivers/crypto/keembay/keembay-ocs-hcu-core.c
 F:	drivers/crypto/keembay/ocs-hcu.c
 F:	drivers/crypto/keembay/ocs-hcu.h
 
+INTEL THUNDER BAY EMMC PHY DRIVER
+M:	Nandhini Srikandan <[email protected]>
+M:	Rashmi A <[email protected]>
+S:	Maintained
+F:	Documentation/devicetree/bindings/phy/intel,phy-thunderbay-emmc.yaml
+F:	drivers/phy/intel/phy-intel-thunderbay-emmc.c
+
 INTEL MANAGEMENT ENGINE (mei)
 M:	Tomas Winkler <[email protected]>
 L:	[email protected]
Signature · 1 line
2.17.1
#4 lore raw

PATCH v2 4/4 phy: intel: Add Thunder Bay eMMC PHY support

In reply to [email protected]

From: Rashmi A <[email protected]>

Add support of eMMC PHY for Intel Thunder Bay SoC, uses the Arasan eMMC phy

---
 drivers/phy/intel/Kconfig                     |  10 +
 drivers/phy/intel/Makefile                    |   1 +
 drivers/phy/intel/phy-intel-thunderbay-emmc.c | 512 ++++++++++++++++++
 3 files changed, 523 insertions(+)
 create mode 100644 drivers/phy/intel/phy-intel-thunderbay-emmc.c
drivers/phy/intel/Kconfig +10 -0
index ac42bb2fb394..18a3cc5b98c0 100644
@@ -46,3 +46,13 @@ config PHY_INTEL_LGM_EMMC
 	select GENERIC_PHY
 	help
 	  Enable this to support the Intel EMMC PHY
+
+config PHY_INTEL_THUNDERBAY_EMMC
+        tristate "Intel Thunder Bay eMMC PHY driver"
+        depends on OF && (ARCH_THUNDERBAY || COMPILE_TEST)
+        select GENERIC_PHY
+        help
+	  This option enables support for Intel Thunder Bay SoC eMMC PHY.
+
+	  To compile this driver as a module, choose M here: the module
+	  will be called phy-intel-thunderbay-emmc.ko.
drivers/phy/intel/Makefile +1 -0
index 14550981a707..b7321d56b0bb 100644
@@ -3,3 +3,4 @@ obj-$(CONFIG_PHY_INTEL_KEEMBAY_EMMC)	+= phy-intel-keembay-emmc.o
 obj-$(CONFIG_PHY_INTEL_KEEMBAY_USB)	+= phy-intel-keembay-usb.o
 obj-$(CONFIG_PHY_INTEL_LGM_COMBO)	+= phy-intel-lgm-combo.o
 obj-$(CONFIG_PHY_INTEL_LGM_EMMC)	+= phy-intel-lgm-emmc.o
+obj-$(CONFIG_PHY_INTEL_THUNDERBAY_EMMC) += phy-intel-thunderbay-emmc.o
drivers/phy/intel/phy-intel-thunderbay-emmc.c new file +512 -0

512 lines not on this page · raw message

Signature · 1 line
2.17.1
#5 lore raw
In reply to [email protected]
Quoted 20 lines · On Sun, 29 Aug 2021 at 20:24, <[email protected]> wrote:

From: Rashmi A <[email protected]>

This patch set enables the support for eMMC PHY on the Intel Thunder Bay SoC. eMMC PHY is based on arasan phy.

Patch 1 Adds arasan sdhci support for eMMC in Intel Thunder Bay. Patch 2 Adds arasan sdhci dt bindings.
Patch 3 Holds the device tree binding documentation for eMMC PHY
and listings of new files in MAINTAINERS file.
Patch 4 Holds the eMMC PHY driver.

Rashmi A (4):
mmc: sdhci-of-arasan: Add intel Thunder Bay SOC support to the arasan
eMMC driver
dt-bindings: mmc: Add bindings for Intel Thunder Bay SoC
dt-bindings: phy: intel: Add Thunder Bay eMMC PHY bindings
phy: intel: Add Thunder Bay eMMC PHY support

Quoted 11 lines
 .../devicetree/bindings/mmc/arasan,sdhci.yaml |  25 +
 .../phy/intel,phy-thunderbay-emmc.yaml        |  46 ++
 MAINTAINERS                                   |   7 +
 drivers/mmc/host/sdhci-of-arasan.c            |  29 +-
 drivers/phy/intel/Kconfig                     |  10 +
 drivers/phy/intel/Makefile                    |   1 +
 drivers/phy/intel/phy-intel-thunderbay-emmc.c | 512 ++++++++++++++++++
 7 files changed, 629 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/phy/intel,phy-thunderbay-emmc.yaml
 create mode 100644 drivers/phy/intel/phy-intel-thunderbay-emmc.c

Applied patch1 and patch2 for next, thus leaving the phy changes in patch3 and patch 4 for Kishon/Vinod to pick up.

Thanks and kind regards
Uffe

author
#6 lore raw

-----Original Message-----
From: Ulf Hansson <[email protected]>
Sent: Tuesday, September 14, 2021 4:54 PM
To: A, Rashmi <[email protected]>
Cc: Michal Simek <[email protected]>; linux-mmc <[email protected]>; Linux ARM <[email protected]>; Linux Kernel Mailing List <[email protected]>; Kishon <[email protected]>; Vinod Koul <[email protected]>; Andy Shevchenko <[email protected]>; [email protected]; Mark Gross <[email protected]>; [email protected]; Zhou, Furong <[email protected]>; Sangannavar, Mallikarjunappa <[email protected]>; Hunter, Adrian <[email protected]>; Vaidya, Mahesh R <[email protected]>; Srikandan, Nandhini <[email protected]>
Subject: Re: [PATCH v2 0/4] Add support of eMMC PHY for Intel Thunder Bay

Quoted 20 lines · On Sun, 29 Aug 2021 at 20:24, <[email protected]> wrote:

From: Rashmi A <[email protected]>

This patch set enables the support for eMMC PHY on the Intel Thunder Bay SoC. eMMC PHY is based on arasan phy.

Patch 1 Adds arasan sdhci support for eMMC in Intel Thunder Bay. Patch 2 Adds arasan sdhci dt bindings.
Patch 3 Holds the device tree binding documentation for eMMC PHY
and listings of new files in MAINTAINERS file.
Patch 4 Holds the eMMC PHY driver.

Rashmi A (4):
mmc: sdhci-of-arasan: Add intel Thunder Bay SOC support to the arasan
eMMC driver
dt-bindings: mmc: Add bindings for Intel Thunder Bay SoC
dt-bindings: phy: intel: Add Thunder Bay eMMC PHY bindings
phy: intel: Add Thunder Bay eMMC PHY support

Quoted 12 lines
 .../devicetree/bindings/mmc/arasan,sdhci.yaml |  25 +
 .../phy/intel,phy-thunderbay-emmc.yaml        |  46 ++
 MAINTAINERS                                   |   7 +
 drivers/mmc/host/sdhci-of-arasan.c            |  29 +-
 drivers/phy/intel/Kconfig                     |  10 +
 drivers/phy/intel/Makefile                    |   1 +
 drivers/phy/intel/phy-intel-thunderbay-emmc.c | 512 
++++++++++++++++++
 7 files changed, 629 insertions(+), 1 deletion(-)  create mode 100644 
Documentation/devicetree/bindings/phy/intel,phy-thunderbay-emmc.yaml
 create mode 100644 drivers/phy/intel/phy-intel-thunderbay-emmc.c

Applied patch1 and patch2 for next, thus leaving the phy changes in patch3 and patch 4 for Kishon/Vinod to pick up.

Thanks and kind regards
Uffe

Thanks Uffe,
Hi Kishon/Vinod,
Please let me know if you have any comments

Regards
Rashmi

maintainer
#7 lore raw
Quoted 10 lines · Rashmi

Applied patch1 and patch2 for next, thus leaving the phy changes in patch3 and patch 4 for Kishon/Vinod to pick up.

Thanks and kind regards
Uffe

Thanks Uffe,
Hi Kishon/Vinod,
Please let me know if you have any comments

Need ack from Rob on binding patch

Signature · 1 line
~Vinod
author
#8 lore raw
Quoted 28 lines

-----Original Message-----
From: Vinod Koul <[email protected]>
Sent: Tuesday, October 5, 2021 4:05 PM
To: A, Rashmi <[email protected]>
Cc: Ulf Hansson <[email protected]>; Michal Simek <[email protected]>; linux-mmc <[email protected]>; Linux ARM <[email protected]>; Linux Kernel Mailing List <linux- [email protected]>; Kishon <[email protected]>; Andy Shevchenko <[email protected]>; [email protected]; Mark Gross <[email protected]>; [email protected]; Zhou, Furong <[email protected]>; Sangannavar, Mallikarjunappa <[email protected]>; Hunter, Adrian <[email protected]>; Vaidya, Mahesh R <[email protected]>; Srikandan, Nandhini <[email protected]>
Subject: Re: [PATCH v2 0/4] Add support of eMMC PHY for Intel Thunder Bay

Quoted 7 lines · Rashmi

Applied patch1 and patch2 for next, thus leaving the phy changes in patch3 and patch 4 for Kishon/Vinod to pick up.

Thanks and kind regards
Uffe

Quoted 8 lines
Quoted 3 lines

Thanks Uffe,
Hi Kishon/Vinod,
Please let me know if you have any comments

Need ack from Rob on binding patch

--
~Vinod

Hi Rob Herring,
Please help to review the eMMC dt-binding patches

-Rashmi

maintainer
#9 lore raw
Quoted 32 lines · Rashmi
Quoted 32 lines

-----Original Message-----
From: Vinod Koul <[email protected]>
Sent: Tuesday, October 5, 2021 4:05 PM
To: A, Rashmi <[email protected]>
Cc: Ulf Hansson <[email protected]>; Michal Simek <[email protected]>; linux-mmc <[email protected]>; Linux ARM <[email protected]>; Linux Kernel Mailing List <linux- [email protected]>; Kishon <[email protected]>; Andy Shevchenko <[email protected]>; [email protected]; Mark Gross <[email protected]>; [email protected]; Zhou, Furong <[email protected]>; Sangannavar, Mallikarjunappa <[email protected]>; Hunter, Adrian <[email protected]>; Vaidya, Mahesh R <[email protected]>; Srikandan, Nandhini <[email protected]>
Subject: Re: [PATCH v2 0/4] Add support of eMMC PHY for Intel Thunder Bay

Quoted 10 lines · Rashmi

Applied patch1 and patch2 for next, thus leaving the phy changes in patch3 and patch 4 for Kishon/Vinod to pick up.

Thanks and kind regards
Uffe

Thanks Uffe,
Hi Kishon/Vinod,
Please let me know if you have any comments

Quoted 7 lines
Quoted 4 lines

Need ack from Rob on binding patch

--
~Vinod

Hi Rob Herring,
Please help to review the eMMC dt-binding patches

Just realised, neither Rob nor the DT list is in CC, ofcourse he would not have seen this.

Please rebase and repost with Rob and DT list in CC!

Signature · 1 line
~Vinod