Skip to contentSkip to conversation

ahci-platform: Bump max number of clocks to 5

PATCH Superseded Kumar Gala 3 participants 7 messages Jun 12, 2014 – Jun 13, 2014

Subsystems (3)

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Kumar Gala

author
#0 lore raw

PATCH 1/3 ahci-platform: Bump max number of clocks to 5

Qualcomm IPQ806x SoCs with SATA controllers need 5 clocks to be enabled.

---
 drivers/ata/ahci.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ata/ahci.h +1 -1
index 05882e4..001aa99 100644
@@ -53,7 +53,7 @@
 
 enum {
 	AHCI_MAX_PORTS		= 32,
-	AHCI_MAX_CLKS		= 3,
+	AHCI_MAX_CLKS		= 5,
 	AHCI_MAX_SG		= 168, /* hardware max is 64K */
 	AHCI_DMA_BOUNDARY	= 0xffffffff,
 	AHCI_MAX_CMDS		= 32,
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
author
#1 lore raw

PATCH 2/3 ata: Add Qualcomm ARM SoC AHCI SATA host controller driver

Add support for the Qualcomm AHCI SATA controller that exists on several SoC and specifically the IPQ806x family of chips. The IPQ806x SATA support requires the associated IPQ806x SATA PHY Driver to be enabled as well.

---
 drivers/ata/Kconfig     | 10 ++++++
 drivers/ata/Makefile    |  1 +
 drivers/ata/ahci_qcom.c | 86 +++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 97 insertions(+)
 create mode 100644 drivers/ata/ahci_qcom.c
drivers/ata/Kconfig +10 -0
index 7671dba..aa88648 100644
@@ -132,6 +132,16 @@ config AHCI_MVEBU
 
 	  If unsure, say N.
 
+config AHCI_QCOM
+	tristate "Qualcomm AHCI SATA support"
+	depends on ARCH_QCOM
+	help
+	  This option enables support for AHCI SATA controller
+	  integrated into Qualcomm ARM SoC chipsets. For more
+	  information please refer to http://www.qualcomm.com/chipsets.
+
+	  If unsure, say N.
+
 config AHCI_SUNXI
 	tristate "Allwinner sunxi AHCI SATA support"
 	depends on ARCH_SUNXI
drivers/ata/Makefile +1 -0
index 5a02aee..15401e9 100644
@@ -13,6 +13,7 @@ obj-$(CONFIG_SATA_HIGHBANK)	+= sata_highbank.o libahci.o
 obj-$(CONFIG_AHCI_DA850)	+= ahci_da850.o libahci.o libahci_platform.o
 obj-$(CONFIG_AHCI_IMX)		+= ahci_imx.o libahci.o libahci_platform.o
 obj-$(CONFIG_AHCI_MVEBU)	+= ahci_mvebu.o libahci.o libahci_platform.o
+obj-$(CONFIG_AHCI_QCOM)		+= ahci_qcom.o libahci.o libahci_platform.o
 obj-$(CONFIG_AHCI_SUNXI)	+= ahci_sunxi.o libahci.o libahci_platform.o
 obj-$(CONFIG_AHCI_ST)		+= ahci_st.o libahci.o libahci_platform.o
 obj-$(CONFIG_AHCI_XGENE)	+= ahci_xgene.o libahci.o libahci_platform.o
drivers/ata/ahci_qcom.c new file +86 -0

86 lines not on this page · raw message

Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
author
#6 lore raw

PATCH 3/3 ata: qcom: Add device tree bindings information

In reply to Kumar Gala

Add device tree binding for Qualcomm AHCI SATA controller and specifically the sata controller on the IPQ806x family of SoCs.

---
 .../devicetree/bindings/ata/qcom-sata.txt          | 40 ++++++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/ata/qcom-sata.txt
Documentation/devicetree/bindings/ata/qcom-sata.txt new file +40 -0
new file mode 100644
index 0000000..5e74e41
@@ -0,0 +1,40 @@
+* Qualcomm AHCI SATA Controller
+
+SATA nodes are defined to describe on-chip Serial ATA controllers.
+Each SATA controller should have its own node.
+
+Required properties:
+- compatible		: compatible list, contains "qcom,msm-ahci"
+- interrupts		: <interrupt mapping for SATA IRQ>
+- reg			: <registers mapping>
+- phys			: Must contain exactly one entry as specified
+			  in phy-bindings.txt
+- phy-names		: Must be "sata-phy"
+
+Required properties for "qcom,ipq806x-ahci" compatible:
+- clocks		: Must contain an entry for each entry in clock-names.
+- clock-names		: Shall be:
+				"slave_iface" - Fabric port AHB clock for SATA
+				"iface" - AHB clock
+				"core" - core clock
+				"rxoob" - RX out-of-band clock
+				"pmalive" - Power Module Alive clock
+
+Example:
+	sata at 29000000 {
+		compatible = "qcom,ipq806x-ahci", "qcom,msm-ahci";
+		reg = <0x29000000 0x180>;
+
+		interrupts = <0 209 0x0>;
+
+		clocks = <&gcc SFAB_SATA_S_H_CLK>,
+			 <&gcc SATA_H_CLK>,
+			 <&gcc SATA_A_CLK>,
+			 <&gcc SATA_RXOOB_CLK>,
+			 <&gcc SATA_PMALIVE_CLK>;
+		clock-names = "slave_iface", "iface", "core",
+				"rxoob", "pmalive";
+
+		phys = <&sata_phy>;
+		phy-names = "sata-phy";
+	};
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
#2 lore raw

Re: [PATCH 2/3] ata: Add Qualcomm ARM SoC AHCI SATA host controller driver

In reply to Kumar Gala

drivers/ata/ahci_qcom.c line 45

Quoted 12 lines · Kumar Gala
drivers/ata/ahci_qcom.c new file +12 -0
+static int qcom_ahci_probe(struct platform_device *pdev)
+{
+	struct ahci_host_priv *hpriv;
+	struct clk *rxoob_clk;
+	int rc;
+
+	hpriv = ahci_platform_get_resources(pdev);
+	if (IS_ERR(hpriv))
+		return PTR_ERR(hpriv);
+
+	/* Try and set the rxoob clk to 100Mhz */
+	rxoob_clk = of_clk_get_by_name(pdev->dev.of_node, "rxoob");

Any reason we can't use devm_clk_get() here?

Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
author
#3 lore raw

Re: [PATCH 2/3] ata: Add Qualcomm ARM SoC AHCI SATA host controller driver

Quoted 15 lines · Stephen Boyd

drivers/ata/ahci_qcom.c line 45

Quoted 12 lines · Kumar Gala
drivers/ata/ahci_qcom.c new file +12 -0
+static int qcom_ahci_probe(struct platform_device *pdev)
+{
+	struct ahci_host_priv *hpriv;
+	struct clk *rxoob_clk;
+	int rc;
+
+	hpriv = ahci_platform_get_resources(pdev);
+	if (IS_ERR(hpriv))
+		return PTR_ERR(hpriv);
+
+	/* Try and set the rxoob clk to 100Mhz */
+	rxoob_clk = of_clk_get_by_name(pdev->dev.of_node, "rxoob");

Any reason we can't use devm_clk_get() here?

Was trying to avoid the ref cnt of devm_clk_get() as the clk?s are actually handled in ahci_platform_get_resources/ahci_platform_enable_resources

- k

Signature · 2 lines
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
#4 lore raw

Re: [PATCH 2/3] ata: Add Qualcomm ARM SoC AHCI SATA host controller driver

In reply to Kumar Gala

Hi Kumar,

Quoted 4 lines
drivers/ata/ahci_qcom.c new file +4 -0
+
+static struct platform_driver qcom_ahci_driver = {
+	.probe = qcom_ahci_probe,
+	.remove = ata_platform_remove_one,

drivers/ata/ahci_qcom.c line 85

Quoted 10 lines
drivers/ata/ahci_qcom.c new file +10 -0
+	.driver = {
+		.name = "qcom_ahci_qcom",
+		.owner = THIS_MODULE,
+		.of_match_table = qcom_ahci_of_match,
+	},
+};
+module_platform_driver(qcom_ahci_driver);
+
+MODULE_DESCRIPTION("Qualcomm AHCI SATA platform driver");
+MODULE_LICENSE("GPL");

"GPL v2" ? Or only GPL is intentional?

Quoted 2 lines

+MODULE_ALIAS("ahci:qcom");

missing MODULE_AUTHOR

Signature · 2 lines
regards,
Stan
author
#5 lore raw

Re: [PATCH 2/3] ata: Add Qualcomm ARM SoC AHCI SATA host controller driver

Quoted 18 lines · Stanimir Varbanov

Hi Kumar,

Quoted 4 lines
drivers/ata/ahci_qcom.c new file +4 -0
+
+static struct platform_driver qcom_ahci_driver = {
+	.probe = qcom_ahci_probe,
+	.remove = ata_platform_remove_one,

drivers/ata/ahci_qcom.c line 85

Quoted 10 lines
drivers/ata/ahci_qcom.c new file +10 -0
+	.driver = {
+		.name = "qcom_ahci_qcom",
+		.owner = THIS_MODULE,
+		.of_match_table = qcom_ahci_of_match,
+	},
+};
+module_platform_driver(qcom_ahci_driver);
+
+MODULE_DESCRIPTION("Qualcomm AHCI SATA platform driver");
+MODULE_LICENSE("GPL");

"GPL v2" ? Or only GPL is intentional?

should be v2, will fix

Quoted 13 lines
Quoted 3 lines

+MODULE_ALIAS("ahci:qcom");

missing MODULE_AUTHOR

Signature · 6 lines
regards,
Stan
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

- k

Signature · 2 lines
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation