All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V3 0/6] Enable onboard SDHCI for Nexus 5X (msm8992)
@ 2017-01-24  9:36 Jeremy McNicoll
  2017-01-24  9:36 ` [PATCH V3 1/6] dt-bindings: qcom: clk: Add missing binding for SDCHI enablement on Nexus 5X/6P Jeremy McNicoll
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Jeremy McNicoll @ 2017-01-24  9:36 UTC (permalink / raw)
  To: linux-arm-msm-u79uwXL29TY76Z2rM5mHXA,
	linux-soc-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-mmc-u79uwXL29TY76Z2rM5mHXA
  Cc: andy.gross-QSEj5FYQhm4dnm+yROfE0A, sboyd-sgV2jX0FEOL9JmXXK+q4OQ,
	robh-DgEjT+Ai2ygdnm+yROfE0A, arnd-r2nGTMty4D4,
	bjorn.andersson-QSEj5FYQhm4dnm+yROfE0A,
	riteshh-sgV2jX0FEOL9JmXXK+q4OQ, git-LJ92rlH3Dns,
	ulf.hansson-QSEj5FYQhm4dnm+yROfE0A,
	jszhang-eYqpPyKDWXRBDgjK7y7TUQ, jeremymc-H+wXaHxf7aLQT0dZR+AlfA


Here is a reference to V2:
  http://www.spinics.net/lists/devicetree/msg158808.html [1]

V3->V2:
 * stripped down clock changes to just the essential bits'N pieces
 * split up clock changes between C and DT-binding changes
 * addressed feedback from BjorneA. 
 * Dropped RobH's ACK's as the patches aren't the same.  Sorry!  ;-(
   

The SDHCI workaround has been included again in V3 just like V2, please see justification[1].
 NOTE to SDHCI maintainers:
   "sdhci: Add quirk for delayed IRQ ACK" (patch 2/4) was
    included, if there is no interest in including this change
    feel free to drop it or provide guidance on how this type
    of issue is generally dealt with."

Testing:
  -both Nexus 5X & 6P behaviour was identical given the limited number of things / peripherals which
    are  currently supported. 
  -note to self or anyone reading this, see if there is some kind of cloud type automated testing
    that could help identify breakage as manual testing takes far too much time. 


This series has dependancies on:
   -> "regulator: qcom-smd: Add PM8994 regulator support"   now merged in git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git
  -> https://lkml.org/lkml/2016/12/28/77 [SDHCI-msm support for enhanced strobe]
  -> https://lkml.org/lkml/2016/12/30/102 [sdhci-msm: add more debug logs]




Jeremy McNicoll (6):
  dt-bindings: qcom: clk: Add missing binding for SDCHI enablement on
    Nexus 5X/6P
  sdhci: Add quirk for delayed IRQ ACK
  arm64: dts: msm8992 add fixed regulator
  arm64: dts: smem enablement for msm8992
  dts: arm64: Enable onboard SDHCI on msm8992
  dts: doc: rename rpm_requests to respect DT naming conventions

 .../devicetree/bindings/clock/qcom,rpmcc.txt       |   2 +-
 .../bindings/regulator/qcom,smd-rpm-regulator.txt  |   2 +-
 .../devicetree/bindings/soc/qcom/qcom,smd-rpm.txt  |   6 +-
 .../devicetree/bindings/soc/qcom/qcom,smd.txt      |   2 +-
 arch/arm/boot/dts/qcom-apq8074-dragonboard.dts     |   2 +-
 arch/arm/boot/dts/qcom-apq8084.dtsi                |   2 +-
 .../dts/qcom-msm8974-lge-nexus5-hammerhead.dts     |   2 +-
 .../boot/dts/qcom-msm8974-sony-xperia-honami.dts   |   2 +-
 arch/arm/boot/dts/qcom-msm8974.dtsi                |   2 +-
 arch/arm64/boot/dts/qcom/msm8916.dtsi              |   2 +-
 .../boot/dts/qcom/msm8992-bullhead-rev-101.dts     |   2 +
 arch/arm64/boot/dts/qcom/msm8992-pins.dtsi         |  60 +++++
 arch/arm64/boot/dts/qcom/msm8992.dtsi              | 143 ++++++++++-
 arch/arm64/boot/dts/qcom/msm8994-smd-rpm.dtsi      | 276 +++++++++++++++++++++
 drivers/mmc/host/sdhci-msm.c                       |   7 +
 drivers/mmc/host/sdhci.c                           |  12 +-
 drivers/mmc/host/sdhci.h                           |   2 +
 include/dt-bindings/clock/qcom,gcc-msm8994.h       |   1 +
 18 files changed, 512 insertions(+), 15 deletions(-)
 create mode 100644 arch/arm64/boot/dts/qcom/msm8994-smd-rpm.dtsi

-- 
2.6.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH V3 1/6] dt-bindings: qcom: clk: Add missing binding for SDCHI enablement on Nexus 5X/6P
  2017-01-24  9:36 [PATCH V3 0/6] Enable onboard SDHCI for Nexus 5X (msm8992) Jeremy McNicoll
@ 2017-01-24  9:36 ` Jeremy McNicoll
  2017-01-27  0:24   ` Stephen Boyd
  2017-01-24  9:36 ` [PATCH V3 2/6] sdhci: Add quirk for delayed IRQ ACK Jeremy McNicoll
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Jeremy McNicoll @ 2017-01-24  9:36 UTC (permalink / raw)
  To: linux-arm-msm, linux-soc, devicetree, linux-mmc
  Cc: andy.gross, sboyd, robh, arnd, bjorn.andersson, riteshh, git,
	ulf.hansson, jszhang, jeremymc

AHB clock branch is needed in order to enable SDHCI
on msm899(2/4).

Signed-off-by: Jeremy McNicoll <jeremymc@redhat.com>
---
 include/dt-bindings/clock/qcom,gcc-msm8994.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/dt-bindings/clock/qcom,gcc-msm8994.h b/include/dt-bindings/clock/qcom,gcc-msm8994.h
index 8fa535b..df47da0 100644
--- a/include/dt-bindings/clock/qcom,gcc-msm8994.h
+++ b/include/dt-bindings/clock/qcom,gcc-msm8994.h
@@ -133,5 +133,6 @@
 #define GCC_USB30_MOCK_UTMI_CLK			115
 #define GCC_USB3_PHY_AUX_CLK			116
 #define GCC_USB_HS_SYSTEM_CLK			117
+#define GCC_SDCC1_AHB_CLK			118
 
 #endif
-- 
2.6.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH V3 2/6] sdhci: Add quirk for delayed IRQ ACK
  2017-01-24  9:36 [PATCH V3 0/6] Enable onboard SDHCI for Nexus 5X (msm8992) Jeremy McNicoll
  2017-01-24  9:36 ` [PATCH V3 1/6] dt-bindings: qcom: clk: Add missing binding for SDCHI enablement on Nexus 5X/6P Jeremy McNicoll
@ 2017-01-24  9:36 ` Jeremy McNicoll
  2017-01-25 10:18   ` Ritesh Harjani
  2017-01-24  9:36 ` [PATCH V3 3/6] arm64: dts: msm8992 add fixed regulator Jeremy McNicoll
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Jeremy McNicoll @ 2017-01-24  9:36 UTC (permalink / raw)
  To: linux-arm-msm, linux-soc, devicetree, linux-mmc
  Cc: andy.gross, sboyd, robh, arnd, bjorn.andersson, riteshh, git,
	ulf.hansson, jszhang, jeremymc

On msm8992 it has been observed that IRQs were not getting
ACK'd correctly when clocked at speeds greater than 400KHz.

Signed-off-by: Jeremy McNicoll <jeremymc@redhat.com>
---
 drivers/mmc/host/sdhci-msm.c |  7 +++++++
 drivers/mmc/host/sdhci.c     | 12 ++++++++++--
 drivers/mmc/host/sdhci.h     |  2 ++
 3 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
index f3f3fb3..11dc389 100644
--- a/drivers/mmc/host/sdhci-msm.c
+++ b/drivers/mmc/host/sdhci-msm.c
@@ -1304,6 +1304,13 @@ static int sdhci_msm_probe(struct platform_device *pdev)
 			       CORE_VENDOR_SPEC_CAPABILITIES0);
 	}
 
+	/* Enable delayed IRQ handling workaround on 8992 */
+	if (core_major == 1 && core_minor == 0x3e) {
+		/* Add 40us delay in interrupt handler when operating
+		 * at initialization frequency of 400KHz. */
+		host->quirks2 |= SDHCI_QUIRK2_SLOW_INT_CLR;
+	}
+
 	/* Setup IRQ for handling power/voltage tasks with PMIC */
 	msm_host->pwr_irq = platform_get_irq_byname(pdev, "pwr_irq");
 	if (msm_host->pwr_irq < 0) {
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 06dfac2..68a21a3 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -2742,11 +2742,19 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id)
 			result = IRQ_WAKE_THREAD;
 		}
 
-		if (intmask & SDHCI_INT_CMD_MASK)
+		if (intmask & SDHCI_INT_CMD_MASK) {
+			if ((host->quirks2 & SDHCI_QUIRK2_SLOW_INT_CLR) && (host->clock <= 400000)) {
+				udelay(40);
+			}
 			sdhci_cmd_irq(host, intmask & SDHCI_INT_CMD_MASK);
+		}
 
-		if (intmask & SDHCI_INT_DATA_MASK)
+		if (intmask & SDHCI_INT_DATA_MASK) {
+			if ((host->quirks2 & SDHCI_QUIRK2_SLOW_INT_CLR) && (host->clock <= 400000)) {
+				udelay(40);
+			}
 			sdhci_data_irq(host, intmask & SDHCI_INT_DATA_MASK);
+		}
 
 		if (intmask & SDHCI_INT_BUS_POWER)
 			pr_err("%s: Card is consuming too much power!\n",
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index 400f3a1..7fa1004 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -24,6 +24,8 @@
  * Controller registers
  */
 
+#define SDHCI_QUIRK2_SLOW_INT_CLR	(1<<5)
+
 #define SDHCI_DMA_ADDRESS	0x00
 #define SDHCI_ARGUMENT2		SDHCI_DMA_ADDRESS
 
-- 
2.6.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH V3 3/6] arm64: dts: msm8992 add fixed regulator
  2017-01-24  9:36 [PATCH V3 0/6] Enable onboard SDHCI for Nexus 5X (msm8992) Jeremy McNicoll
  2017-01-24  9:36 ` [PATCH V3 1/6] dt-bindings: qcom: clk: Add missing binding for SDCHI enablement on Nexus 5X/6P Jeremy McNicoll
  2017-01-24  9:36 ` [PATCH V3 2/6] sdhci: Add quirk for delayed IRQ ACK Jeremy McNicoll
@ 2017-01-24  9:36 ` Jeremy McNicoll
  2017-01-24  9:36 ` [PATCH V3 4/6] arm64: dts: smem enablement for msm8992 Jeremy McNicoll
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Jeremy McNicoll @ 2017-01-24  9:36 UTC (permalink / raw)
  To: linux-arm-msm, linux-soc, devicetree, linux-mmc
  Cc: andy.gross, sboyd, robh, arnd, bjorn.andersson, riteshh, git,
	ulf.hansson, jszhang, jeremymc

This regulator is not moving anywhere.

Signed-off-by: Jeremy McNicoll <jeremymc@redhat.com>
---
 arch/arm64/boot/dts/qcom/msm8992.dtsi | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/msm8992.dtsi b/arch/arm64/boot/dts/qcom/msm8992.dtsi
index 44b2d37..0502d29 100644
--- a/arch/arm64/boot/dts/qcom/msm8992.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8992.dtsi
@@ -68,6 +68,19 @@
 		clock-frequency = <32768>;
 	};
 
+
+	vreg_vph_pwr: vreg-vph-pwr {
+		compatible = "regulator-fixed";
+		status = "okay";
+		regulator-name = "vph-pwr";
+
+		regulator-min-microvolt = <3600000>;
+		regulator-max-microvolt = <3600000>;
+
+		regulator-always-on;
+	};
+
+
 	soc {
 		#address-cells = <1>;
 		#size-cells = <1>;
-- 
2.6.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH V3 4/6] arm64: dts: smem enablement for msm8992
  2017-01-24  9:36 [PATCH V3 0/6] Enable onboard SDHCI for Nexus 5X (msm8992) Jeremy McNicoll
                   ` (2 preceding siblings ...)
  2017-01-24  9:36 ` [PATCH V3 3/6] arm64: dts: msm8992 add fixed regulator Jeremy McNicoll
@ 2017-01-24  9:36 ` Jeremy McNicoll
  2017-01-24  9:36 ` [PATCH V3 5/6] dts: arm64: Enable onboard SDHCI on msm8992 Jeremy McNicoll
  2017-01-24  9:36 ` [PATCH V3 6/6] dts: doc: rename rpm_requests to respect DT naming conventions Jeremy McNicoll
  5 siblings, 0 replies; 11+ messages in thread
From: Jeremy McNicoll @ 2017-01-24  9:36 UTC (permalink / raw)
  To: linux-arm-msm, linux-soc, devicetree, linux-mmc
  Cc: andy.gross, sboyd, robh, arnd, bjorn.andersson, riteshh, git,
	ulf.hansson, jszhang, jeremymc

SMEM allows various subsystems/processors to share
memory/data (heap format) in order to enable various
peripherals.

Signed-off-by: Jeremy McNicoll <jeremymc@redhat.com>
---
 arch/arm64/boot/dts/qcom/msm8992.dtsi | 43 +++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/msm8992.dtsi b/arch/arm64/boot/dts/qcom/msm8992.dtsi
index 0502d29..e5a0d91 100644
--- a/arch/arm64/boot/dts/qcom/msm8992.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8992.dtsi
@@ -95,6 +95,12 @@
 				<0xf9002000 0x1000>;
 		};
 
+		apcs: syscon@f900d000 {
+			compatible = "syscon";
+			reg = <0xf900d000 0x2000>;
+		};
+
+
 		timer@f9020000 {
 			#address-cells = <1>;
 			#size-cells = <1>;
@@ -185,12 +191,49 @@
 			#power-domain-cells = <1>;
 			reg = <0xfc400000 0x2000>;
 		};
+
+		rpm_msg_ram: memory@fc428000 {
+			compatible = "qcom,rpm-msg-ram";
+			reg = <0xfc428000 0x4000>;
+		};
+
+		sfpb_mutex_regs: syscon@fd484000 {
+			#address-cells = <1>;
+			#size-cells = <1>;
+			compatible = "syscon";
+			reg = <0xfd484000 0x400>;
+		};
+
+		sfpb_mutex: hwmutex {
+			compatible = "qcom,sfpb-mutex";
+			syscon = <&sfpb_mutex_regs 0x0 0x100>;
+			#hwlock-cells = <1>;
+		};
+
+		smem {
+			compatible = "qcom,smem";
+			memory-region = <&smem_region>;
+			qcom,rpm-msg-ram = <&rpm_msg_ram>;
+			hwlocks = <&sfpb_mutex 3>;
+		};
 	};
 
 	memory {
 		device_type = "memory";
 		reg = <0 0 0 0>; // bootloader will update
 	};
+
+	reserved-memory {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		smem_region: smem@6a00000 {
+			reg = <0x0 0x6a00000 0x0 0x200000>;
+			no-map;
+		};
+	};
+
 };
 
 
-- 
2.6.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH V3 5/6] dts: arm64: Enable onboard SDHCI on msm8992
  2017-01-24  9:36 [PATCH V3 0/6] Enable onboard SDHCI for Nexus 5X (msm8992) Jeremy McNicoll
                   ` (3 preceding siblings ...)
  2017-01-24  9:36 ` [PATCH V3 4/6] arm64: dts: smem enablement for msm8992 Jeremy McNicoll
@ 2017-01-24  9:36 ` Jeremy McNicoll
  2017-01-24  9:36 ` [PATCH V3 6/6] dts: doc: rename rpm_requests to respect DT naming conventions Jeremy McNicoll
  5 siblings, 0 replies; 11+ messages in thread
From: Jeremy McNicoll @ 2017-01-24  9:36 UTC (permalink / raw)
  To: linux-arm-msm, linux-soc, devicetree, linux-mmc
  Cc: andy.gross, sboyd, robh, arnd, bjorn.andersson, riteshh, git,
	ulf.hansson, jszhang, jeremymc

This enables SDHCI on the Nexus 5X as well creates common smd_rpm node
which can be shared between both 5X and 6P as per HW design.

Downstream code [msm-angler-3.10-marshmallow-mr1, msm8992.dtsi] eludes
to the fact that 8994-rpm-regulator is common between both msm8992
& msm8994.

Given the very early stage of development that we are in, it makes
sense for the 8994-rpm-regulator to be common until data suggests
otherwise.

Signed-off-by: Jeremy McNicoll <jeremymc@redhat.com>
---
 .../boot/dts/qcom/msm8992-bullhead-rev-101.dts     |   2 +
 arch/arm64/boot/dts/qcom/msm8992-pins.dtsi         |  60 +++++
 arch/arm64/boot/dts/qcom/msm8992.dtsi              |  87 ++++++-
 arch/arm64/boot/dts/qcom/msm8994-smd-rpm.dtsi      | 276 +++++++++++++++++++++
 4 files changed, 424 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm64/boot/dts/qcom/msm8994-smd-rpm.dtsi

diff --git a/arch/arm64/boot/dts/qcom/msm8992-bullhead-rev-101.dts b/arch/arm64/boot/dts/qcom/msm8992-bullhead-rev-101.dts
index 4542133..3fc9a33 100644
--- a/arch/arm64/boot/dts/qcom/msm8992-bullhead-rev-101.dts
+++ b/arch/arm64/boot/dts/qcom/msm8992-bullhead-rev-101.dts
@@ -39,3 +39,5 @@
 		};
 	};
 };
+
+#include "msm8994-smd-rpm.dtsi"
diff --git a/arch/arm64/boot/dts/qcom/msm8992-pins.dtsi b/arch/arm64/boot/dts/qcom/msm8992-pins.dtsi
index d2a26f0..31bc9d9 100644
--- a/arch/arm64/boot/dts/qcom/msm8992-pins.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8992-pins.dtsi
@@ -35,4 +35,64 @@
 			bias-pull-down;
 		};
 	};
+
+	/* 0-3 for sdc1 4-6 for sdc2 */
+	/* Order of pins */
+	/* SDC1: CLK -> 0, CMD -> 1, DATA -> 2, RCLK -> 3 */
+	/* SDC2: CLK -> 4, CMD -> 5, DATA -> 6 */
+	sdc1_clk_on: clk-on {
+		pinconf {
+			pins = "sdc1_clk";
+			bias-disable = <0>; /* No pull */
+			drive-strength = <16>; /* 16mA */
+		};
+	};
+
+	sdc1_clk_off: clk-off {
+		pinconf {
+			pins = "sdc1_clk";
+			bias-disable = <0>; /* No pull */
+			drive-strength = <2>; /* 2mA */
+		};
+	};
+
+	sdc1_cmd_on: cmd-on {
+		pinconf {
+			pins = "sdc1_cmd";
+			bias-pull-up;
+			drive-strength = <8>;
+		};
+	};
+
+	sdc1_cmd_off: cmd-off {
+		pinconf {
+			pins = "sdc1_cmd";
+			bias-pull-up = <0x3>; /* same as 3.10 ?? */
+			drive-strength = <2>; /* 2mA */
+		};
+	};
+
+	sdc1_data_on: data-on {
+		pinconf {
+			pins = "sdc1_data";
+			bias-pull-up;
+			drive-strength = <8>; /* 8mA */
+		};
+	};
+
+	sdc1_data_off: data-off {
+		pinconf {
+			pins = "sdc1_data";
+			bias-pull-up;
+			drive-strength = <2>;
+		};
+	};
+
+	sdc1_rclk_on: rclk-on {
+		bias-pull-down; /* pull down */
+	};
+
+	sdc1_rclk_off: rclk-off {
+		bias-pull-down; /* pull down */
+	};
 };
diff --git a/arch/arm64/boot/dts/qcom/msm8992.dtsi b/arch/arm64/boot/dts/qcom/msm8992.dtsi
index e5a0d91..2f865a8 100644
--- a/arch/arm64/boot/dts/qcom/msm8992.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8992.dtsi
@@ -192,6 +192,31 @@
 			reg = <0xfc400000 0x2000>;
 		};
 
+		sdhci1: mmc@f9824900 {
+			compatible = "qcom,sdhci-msm-v4";
+			reg = <0xf9824900 0x1a0>, <0xf9824000 0x800>;
+			reg-names = "hc_mem", "core_mem";
+
+			interrupts = <GIC_SPI 123 IRQ_TYPE_NONE>,
+					<GIC_SPI 138 IRQ_TYPE_NONE>;
+			interrupt-names = "hc_irq", "pwr_irq";
+
+			clocks = <&clock_gcc GCC_SDCC1_APPS_CLK>,
+				<&clock_gcc GCC_SDCC1_AHB_CLK>;
+			clock-names = "core", "iface";
+
+			pinctrl-names = "default", "sleep";
+			pinctrl-0 = <&sdc1_clk_on &sdc1_cmd_on &sdc1_data_on
+					&sdc1_rclk_on>;
+			pinctrl-1 = <&sdc1_clk_off &sdc1_cmd_off &sdc1_data_off
+					&sdc1_rclk_off>;
+
+			regulator-always-on;
+			bus-width = <8>;
+			mmc-hs400-1_8v;
+			status = "okay";
+		};
+
 		rpm_msg_ram: memory@fc428000 {
 			compatible = "qcom,rpm-msg-ram";
 			reg = <0xfc428000 0x4000>;
@@ -234,7 +259,67 @@
 		};
 	};
 
+	smd_rpm: smd {
+		compatible = "qcom,smd";
+		rpm {
+			interrupts = <GIC_SPI 168 IRQ_TYPE_EDGE_RISING>;
+			qcom,ipc = <&apcs 8 0>;
+			qcom,smd-edge = <15>;
+			qcom,local-pid = <0>;
+			qcom,remote-pid = <6>;
+
+			rpm-requests {
+				compatible = "qcom,rpm-msm8994";
+				qcom,smd-channels = "rpm_requests";
+
+				pm8994-regulators {
+					compatible = "qcom,rpm-pm8994-regulators";
+
+					pm8994_s1: s1 {};
+					pm8994_s2: s2 {};
+					pm8994_s3: s3 {};
+					pm8994_s4: s4 {};
+					pm8994_s5: s5 {};
+					pm8994_s6: s6 {};
+					pm8994_s7: s7 {};
+
+					pm8994_l1: l1 {};
+					pm8994_l2: l2 {};
+					pm8994_l3: l3 {};
+					pm8994_l4: l4 {};
+					pm8994_l6: l6 {};
+					pm8994_l8: l8 {};
+					pm8994_l9: l9 {};
+					pm8994_l10: l10 {};
+					pm8994_l11: l11 {};
+					pm8994_l12: l12 {};
+					pm8994_l13: l13 {};
+					pm8994_l14: l14 {};
+					pm8994_l15: l15 {};
+					pm8994_l16: l16 {};
+					pm8994_l17: l17 {};
+					pm8994_l18: l18 {};
+					pm8994_l19: l19 {};
+					pm8994_l20: l20 {};
+					pm8994_l21: l21 {};
+					pm8994_l22: l22 {};
+					pm8994_l23: l23 {};
+					pm8994_l24: l24 {};
+					pm8994_l25: l25 {};
+					pm8994_l26: l26 {};
+					pm8994_l27: l27 {};
+					pm8994_l28: l28 {};
+					pm8994_l29: l29 {};
+					pm8994_l30: l30 {};
+					pm8994_l31: l31 {};
+					pm8994_l32: l32 {};
+
+					pm8994_lvs1: lvs1 {};
+					pm8994_lvs2: lvs2 {};
+				};
+			};
+		};
+	};
 };
 
-
 #include "msm8992-pins.dtsi"
diff --git a/arch/arm64/boot/dts/qcom/msm8994-smd-rpm.dtsi b/arch/arm64/boot/dts/qcom/msm8994-smd-rpm.dtsi
new file mode 100644
index 0000000..e9765e1
--- /dev/null
+++ b/arch/arm64/boot/dts/qcom/msm8994-smd-rpm.dtsi
@@ -0,0 +1,276 @@
+/* Copyright (c) 2015, LGE Inc. All rights reserved.
+ * Copyright (c) 2016, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+&smd_rpm {
+	rpm {
+		rpm_requests {
+			pm8994-regulators {
+
+				vdd_l1-supply = <&pm8994_s1>;
+				vdd_l2_26_28-supply = <&pm8994_s3>;
+				vdd_l3_11-supply = <&pm8994_s3>;
+				vdd_l4_27_31-supply = <&pm8994_s3>;
+				vdd_l5_7-supply = <&pm8994_s3>;
+				vdd_l6_12_32-supply = <&pm8994_s5>;
+				vdd_l8_16_30-supply = <&vreg_vph_pwr>;
+				vdd_l9_10_18_22-supply = <&vreg_vph_pwr>;
+				vdd_l13_19_23_24-supply = <&vreg_vph_pwr>;
+				vdd_l14_15-supply = <&pm8994_s5>;
+				vdd_l17_29-supply = <&vreg_vph_pwr>;
+				vdd_l20_21-supply = <&vreg_vph_pwr>;
+				vdd_l25-supply = <&pm8994_s5>;
+				vin_lvs1_2 = <&pm8994_s4>;
+
+				s1 {
+					regulator-min-microvolt = <800000>;
+					regulator-max-microvolt = <800000>;
+				};
+
+				s2 {
+					/* TODO */
+				};
+
+				s3 {
+					regulator-min-microvolt = <1300000>;
+					regulator-max-microvolt = <1300000>;
+				};
+
+				s4 {
+					regulator-min-microvolt = <1800000>;
+					regulator-max-microvolt = <1800000>;
+					regulator-allow-set-load;
+					regulator-system-load = <325000>;
+				};
+
+				s5 {
+					regulator-min-microvolt = <2150000>;
+					regulator-max-microvolt = <2150000>;
+				};
+
+				s7 {
+					regulator-min-microvolt = <1000000>;
+					regulator-max-microvolt = <1000000>;
+				};
+
+				l1 {
+					regulator-min-microvolt = <1000000>;
+					regulator-max-microvolt = <1000000>;
+				};
+
+				l2 {
+					regulator-min-microvolt = <1250000>;
+					regulator-max-microvolt = <1250000>;
+				};
+
+				l3 {
+					regulator-min-microvolt = <1200000>;
+					regulator-max-microvolt = <1200000>;
+				};
+
+				l4 {
+					regulator-min-microvolt = <1225000>;
+					regulator-max-microvolt = <1225000>;
+				};
+
+				l5 {
+					/* TODO */
+				};
+
+				l6 {
+					regulator-min-microvolt = <1800000>;
+					regulator-max-microvolt = <1800000>;
+				};
+
+				l7 {
+					/* TODO */
+				};
+
+				l8 {
+					regulator-min-microvolt = <1800000>;
+					regulator-max-microvolt = <1800000>;
+				};
+
+				l9 {
+					regulator-min-microvolt = <1800000>;
+					regulator-max-microvolt = <1800000>;
+				};
+
+				l10 {
+					regulator-min-microvolt = <1800000>;
+					regulator-max-microvolt = <1800000>;
+					qcom,init-voltage = <1800000>;
+				};
+
+				l11 {
+					regulator-min-microvolt = <1200000>;
+					regulator-max-microvolt = <1200000>;
+					qcom,init-voltage = <1200000>;
+				};
+
+				l12 {
+					regulator-min-microvolt = <1800000>;
+					regulator-max-microvolt = <1800000>;
+					qcom,init-voltage = <1800000>;
+					proxy-supply = <&pm8994_l12>;
+					qcom,proxy-consumer-enable;
+					qcom,proxy-consumer-current = <10000>;
+					status = "okay";
+				};
+
+				l13 {
+					regulator-min-microvolt = <1800000>;
+					regulator-max-microvolt = <2950000>;
+					qcom,init-voltage = <2950000>;
+					status = "okay";
+				};
+
+				l14 {
+					regulator-min-microvolt = <1200000>;
+					regulator-max-microvolt = <1200000>;
+					qcom,init-voltage = <1200000>;
+					proxy-supply = <&pm8994_l14>;
+					qcom,proxy-consumer-enable;
+					qcom,proxy-consumer-current = <10000>;
+					status = "okay";
+				};
+
+				l15 {
+					regulator-min-microvolt = <1800000>;
+					regulator-max-microvolt = <1800000>;
+					qcom,init-voltage = <1800000>;
+					status = "okay";
+				};
+
+				l16 {
+					regulator-min-microvolt = <2700000>;
+					regulator-max-microvolt = <2700000>;
+					qcom,init-voltage = <2700000>;
+					status = "okay";
+				};
+
+				l17 {
+					regulator-min-microvolt = <2700000>;
+					regulator-max-microvolt = <2700000>;
+					qcom,init-voltage = <2700000>;
+					status = "okay";
+				};
+
+				l18 {
+					regulator-min-microvolt = <3000000>;
+					regulator-max-microvolt = <3000000>;
+					regulator-always-on;
+					qcom,init-voltage = <3000000>;
+					qcom,init-ldo-mode = <1>;
+				};
+
+				l19 {
+					regulator-min-microvolt = <1800000>;
+					regulator-max-microvolt = <1800000>;
+					qcom,init-voltage = <1800000>;
+					status = "okay";
+				};
+
+				l20 {
+					regulator-min-microvolt = <2950000>;
+					regulator-max-microvolt = <2950000>;
+					regulator-always-on;
+					regulator-boot-on;
+					regulator-allow-set-load;
+					regulator-system-load = <570000>;
+				};
+
+				l21 {
+					regulator-min-microvolt = <1800000>;
+					regulator-max-microvolt = <1800000>;
+					regulator-always-on;
+					qcom,init-voltage = <1800000>;
+				};
+
+				l22 {
+					regulator-min-microvolt = <3100000>;
+					regulator-max-microvolt = <3100000>;
+					qcom,init-voltage = <3100000>;
+				};
+
+				l23 {
+					regulator-min-microvolt = <2800000>;
+					regulator-max-microvolt = <2800000>;
+					qcom,init-voltage = <2800000>;
+				};
+
+				l24 {
+					regulator-min-microvolt = <3075000>;
+					regulator-max-microvolt = <3150000>;
+					qcom,init-voltage = <3075000>;
+				};
+
+				l25 {
+					regulator-min-microvolt = <1800000>;
+					regulator-max-microvolt = <1800000>;
+					qcom,init-voltage = <1800000>;
+				};
+
+				l26 {
+					/* TODO: value from downstream
+					regulator-min-microvolt = <987500>;
+					fails to apply */
+				};
+
+				l27 {
+					regulator-min-microvolt = <1050000>;
+					regulator-max-microvolt = <1050000>;
+					qcom,init-voltage = <1050000>;
+				};
+
+				l28 {
+					regulator-min-microvolt = <1000000>;
+					regulator-max-microvolt = <1000000>;
+					qcom,init-voltage = <1000000>;
+					proxy-supply = <&pm8994_l28>;
+					qcom,proxy-consumer-enable;
+					qcom,proxy-consumer-current = <10000>;
+				};
+
+				l29 {
+					/* TODO: Unsupported voltage range.
+					regulator-min-microvolt = <2800000>;
+					regulator-max-microvolt = <2800000>;
+					qcom,init-voltage = <2800000>;
+					*/
+				};
+
+				l30 {
+					/* TODO: get this verified
+					regulator-min-microvolt = <1800000>;
+					regulator-max-microvolt = <1800000>;
+					qcom,init-voltage = <1800000>;
+					*/
+				};
+
+				l31 {
+					regulator-min-microvolt = <1262500>;
+					regulator-max-microvolt = <1262500>;
+					qcom,init-voltage = <1262500>;
+				};
+
+				l32 {
+					/* TODO: get this verified
+					regulator-min-microvolt = <1800000>;
+					regulator-max-microvolt = <1800000>;
+					qcom,init-voltage = <1800000>;
+					*/
+				};
+			};
+		};
+	};
+};
-- 
2.6.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH V3 6/6] dts: doc: rename rpm_requests to respect DT naming conventions
  2017-01-24  9:36 [PATCH V3 0/6] Enable onboard SDHCI for Nexus 5X (msm8992) Jeremy McNicoll
                   ` (4 preceding siblings ...)
  2017-01-24  9:36 ` [PATCH V3 5/6] dts: arm64: Enable onboard SDHCI on msm8992 Jeremy McNicoll
@ 2017-01-24  9:36 ` Jeremy McNicoll
  5 siblings, 0 replies; 11+ messages in thread
From: Jeremy McNicoll @ 2017-01-24  9:36 UTC (permalink / raw)
  To: linux-arm-msm, linux-soc, devicetree, linux-mmc
  Cc: andy.gross, sboyd, robh, arnd, bjorn.andersson, riteshh, git,
	ulf.hansson, jszhang, jeremymc

Node names cannot have an underscore '_' in the name.
Simply rename 'rpm_request' nodes to 'rpm-request' and
adjust associated documentation to reflect reality.

Signed-off-by: Jeremy McNicoll <jeremymc@redhat.com>
---
 Documentation/devicetree/bindings/clock/qcom,rpmcc.txt              | 2 +-
 .../devicetree/bindings/regulator/qcom,smd-rpm-regulator.txt        | 2 +-
 Documentation/devicetree/bindings/soc/qcom/qcom,smd-rpm.txt         | 6 +++---
 Documentation/devicetree/bindings/soc/qcom/qcom,smd.txt             | 2 +-
 arch/arm/boot/dts/qcom-apq8074-dragonboard.dts                      | 2 +-
 arch/arm/boot/dts/qcom-apq8084.dtsi                                 | 2 +-
 arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts            | 2 +-
 arch/arm/boot/dts/qcom-msm8974-sony-xperia-honami.dts               | 2 +-
 arch/arm/boot/dts/qcom-msm8974.dtsi                                 | 2 +-
 arch/arm64/boot/dts/qcom/msm8916.dtsi                               | 2 +-
 arch/arm64/boot/dts/qcom/msm8994-smd-rpm.dtsi                       | 2 +-
 11 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/Documentation/devicetree/bindings/clock/qcom,rpmcc.txt b/Documentation/devicetree/bindings/clock/qcom,rpmcc.txt
index 87d3714..7154858 100644
--- a/Documentation/devicetree/bindings/clock/qcom,rpmcc.txt
+++ b/Documentation/devicetree/bindings/clock/qcom,rpmcc.txt
@@ -24,7 +24,7 @@ Example:
 			qcom,ipc = <&apcs 8 0>;
 			qcom,smd-edge = <15>;
 
-			rpm_requests {
+			rpm-requests {
 				compatible = "qcom,rpm-msm8916";
 				qcom,smd-channels = "rpm_requests";
 
diff --git a/Documentation/devicetree/bindings/regulator/qcom,smd-rpm-regulator.txt b/Documentation/devicetree/bindings/regulator/qcom,smd-rpm-regulator.txt
index 4e3dfb5..6b984cc 100644
--- a/Documentation/devicetree/bindings/regulator/qcom,smd-rpm-regulator.txt
+++ b/Documentation/devicetree/bindings/regulator/qcom,smd-rpm-regulator.txt
@@ -187,7 +187,7 @@ see regulator.txt.
 			qcom,ipc = <&apcs 8 0>;
 			qcom,smd-edge = <15>;
 
-			rpm_requests {
+			rpm-requests {
 				compatible = "qcom,rpm-msm8974";
 				qcom,smd-channels = "rpm_requests";
 
diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,smd-rpm.txt b/Documentation/devicetree/bindings/soc/qcom/qcom,smd-rpm.txt
index a48049c..30e1c75 100644
--- a/Documentation/devicetree/bindings/soc/qcom/qcom,smd-rpm.txt
+++ b/Documentation/devicetree/bindings/soc/qcom/qcom,smd-rpm.txt
@@ -11,7 +11,7 @@ RPM node itself.
 
 = SUBDEVICES
 
-The RPM exposes resources to its subnodes.  The rpm_requests node must be
+The RPM exposes resources to its subnodes.  The rpm-requests node must be
 present and this subnode may contain children that designate regulator
 resources.
 
@@ -29,7 +29,7 @@ resources.
 	Definition: must be "rpm_requests"
 
 Refer to Documentation/devicetree/bindings/regulator/qcom,smd-rpm-regulator.txt
-for information on the regulator subnodes that can exist under the rpm_requests.
+for information on the regulator subnodes that can exist under the rpm-requests.
 
 Example:
 
@@ -48,7 +48,7 @@ Example:
 			qcom,ipc = <&apcs 8 0>;
 			qcom,smd-edge = <15>;
 
-			rpm_requests {
+			rpm-requests {
 				compatible = "qcom,rpm-msm8974";
 				qcom,smd-channels = "rpm_requests";
 
diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,smd.txt b/Documentation/devicetree/bindings/soc/qcom/qcom,smd.txt
index ea1dc75..3d4a61c 100644
--- a/Documentation/devicetree/bindings/soc/qcom/qcom,smd.txt
+++ b/Documentation/devicetree/bindings/soc/qcom/qcom,smd.txt
@@ -82,7 +82,7 @@ The following example represents a smd node, with one edge representing the
 			qcom,ipc = <&apcs 8 0>;
 			qcom,smd-edge = <15>;
 
-			rpm_requests {
+			rpm-requests {
 				compatible = "qcom,rpm-msm8974";
 				qcom,smd-channels = "rpm_requests";
 
diff --git a/arch/arm/boot/dts/qcom-apq8074-dragonboard.dts b/arch/arm/boot/dts/qcom-apq8074-dragonboard.dts
index ad51df2..ccae434 100644
--- a/arch/arm/boot/dts/qcom-apq8074-dragonboard.dts
+++ b/arch/arm/boot/dts/qcom-apq8074-dragonboard.dts
@@ -126,7 +126,7 @@
 
 	smd {
 		rpm {
-			rpm_requests {
+			rpm-requests {
 				pm8841-regulators {
 					s1 {
 						regulator-min-microvolt = <675000>;
diff --git a/arch/arm/boot/dts/qcom-apq8084.dtsi b/arch/arm/boot/dts/qcom-apq8084.dtsi
index 80d4886..002fd69 100644
--- a/arch/arm/boot/dts/qcom-apq8084.dtsi
+++ b/arch/arm/boot/dts/qcom-apq8084.dtsi
@@ -461,7 +461,7 @@
 			qcom,ipc = <&apcs 8 0>;
 			qcom,smd-edge = <15>;
 
-			rpm_requests {
+			rpm-requests {
 				compatible = "qcom,rpm-apq8084";
 				qcom,smd-channels = "rpm_requests";
 
diff --git a/arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts b/arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts
index 382bcc3..a24c6b4 100644
--- a/arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts
+++ b/arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts
@@ -19,7 +19,7 @@
 
 	smd {
 		rpm {
-			rpm_requests {
+			rpm-requests {
 				pm8841-regulators {
 					s1 {
 						regulator-min-microvolt = <675000>;
diff --git a/arch/arm/boot/dts/qcom-msm8974-sony-xperia-honami.dts b/arch/arm/boot/dts/qcom-msm8974-sony-xperia-honami.dts
index e7c1577..ec937c9 100644
--- a/arch/arm/boot/dts/qcom-msm8974-sony-xperia-honami.dts
+++ b/arch/arm/boot/dts/qcom-msm8974-sony-xperia-honami.dts
@@ -60,7 +60,7 @@
 
 	smd {
 		rpm {
-			rpm_requests {
+			rpm-requests {
 				pm8841-regulators {
 					s1 {
 						regulator-min-microvolt = <675000>;
diff --git a/arch/arm/boot/dts/qcom-msm8974.dtsi b/arch/arm/boot/dts/qcom-msm8974.dtsi
index 49d579f..0c09049 100644
--- a/arch/arm/boot/dts/qcom-msm8974.dtsi
+++ b/arch/arm/boot/dts/qcom-msm8974.dtsi
@@ -672,7 +672,7 @@
 			qcom,ipc = <&apcs 8 0>;
 			qcom,smd-edge = <15>;
 
-			rpm_requests {
+			rpm-requests {
 				compatible = "qcom,rpm-msm8974";
 				qcom,smd-channels = "rpm_requests";
 
diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi
index f8ff327..69eb846 100644
--- a/arch/arm64/boot/dts/qcom/msm8916.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi
@@ -866,7 +866,7 @@
 			qcom,ipc = <&apcs 8 0>;
 			qcom,smd-edge = <15>;
 
-			rpm_requests {
+			rpm-requests {
 				compatible = "qcom,rpm-msm8916";
 				qcom,smd-channels = "rpm_requests";
 
diff --git a/arch/arm64/boot/dts/qcom/msm8994-smd-rpm.dtsi b/arch/arm64/boot/dts/qcom/msm8994-smd-rpm.dtsi
index e9765e1..9b6ce50 100644
--- a/arch/arm64/boot/dts/qcom/msm8994-smd-rpm.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8994-smd-rpm.dtsi
@@ -13,7 +13,7 @@
 
 &smd_rpm {
 	rpm {
-		rpm_requests {
+		rpm-requests {
 			pm8994-regulators {
 
 				vdd_l1-supply = <&pm8994_s1>;
-- 
2.6.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH V3 2/6] sdhci: Add quirk for delayed IRQ ACK
  2017-01-24  9:36 ` [PATCH V3 2/6] sdhci: Add quirk for delayed IRQ ACK Jeremy McNicoll
@ 2017-01-25 10:18   ` Ritesh Harjani
  2017-01-26 22:32     ` Jeremy McNicoll
  0 siblings, 1 reply; 11+ messages in thread
From: Ritesh Harjani @ 2017-01-25 10:18 UTC (permalink / raw)
  To: Jeremy McNicoll
  Cc: linux-arm-msm, linux-soc, devicetree, linux-mmc, andy.gross,
	sboyd, robh, arnd, bjorn.andersson, git, ulf.hansson, jszhang

Hi Jeremy,

 From what I can see in codeaurora tree, quirk 
(SDHCI_QUIRK2_SLOW_INT_CLR) is only required for sdhci-msm with minor 
number 2B. I think this patch may not be relevant for msm8992 controller.
And as you have also mentioned in your V2, that even without this 
change, the detection is fine. The delay you are observing could be due 
to something else unless we are sure.

On reading history of this quirk, I see that this patch was a SW 
workaround for some HW issue in very initial controller.
This was fixed for later controllers.
For this reason, in my opinion we can drop this patch.

But, as we discussed on IRC, let's investigate more on your issue before 
finalizing on this patch for merging.

Regards
Ritesh

On 1/24/2017 3:06 PM, Jeremy McNicoll wrote:
> On msm8992 it has been observed that IRQs were not getting
> ACK'd correctly when clocked at speeds greater than 400KHz.
>
> Signed-off-by: Jeremy McNicoll <jeremymc@redhat.com>
> ---
>  drivers/mmc/host/sdhci-msm.c |  7 +++++++
>  drivers/mmc/host/sdhci.c     | 12 ++++++++++--
>  drivers/mmc/host/sdhci.h     |  2 ++
>  3 files changed, 19 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
> index f3f3fb3..11dc389 100644
> --- a/drivers/mmc/host/sdhci-msm.c
> +++ b/drivers/mmc/host/sdhci-msm.c
> @@ -1304,6 +1304,13 @@ static int sdhci_msm_probe(struct platform_device *pdev)
>  			       CORE_VENDOR_SPEC_CAPABILITIES0);
>  	}
>
> +	/* Enable delayed IRQ handling workaround on 8992 */
> +	if (core_major == 1 && core_minor == 0x3e) {
> +		/* Add 40us delay in interrupt handler when operating
> +		 * at initialization frequency of 400KHz. */
> +		host->quirks2 |= SDHCI_QUIRK2_SLOW_INT_CLR;
> +	}
> +
>  	/* Setup IRQ for handling power/voltage tasks with PMIC */
>  	msm_host->pwr_irq = platform_get_irq_byname(pdev, "pwr_irq");
>  	if (msm_host->pwr_irq < 0) {
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index 06dfac2..68a21a3 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -2742,11 +2742,19 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id)
>  			result = IRQ_WAKE_THREAD;
>  		}
>
> -		if (intmask & SDHCI_INT_CMD_MASK)
> +		if (intmask & SDHCI_INT_CMD_MASK) {
> +			if ((host->quirks2 & SDHCI_QUIRK2_SLOW_INT_CLR) && (host->clock <= 400000)) {
> +				udelay(40);
> +			}
>  			sdhci_cmd_irq(host, intmask & SDHCI_INT_CMD_MASK);
> +		}
>
> -		if (intmask & SDHCI_INT_DATA_MASK)
> +		if (intmask & SDHCI_INT_DATA_MASK) {
> +			if ((host->quirks2 & SDHCI_QUIRK2_SLOW_INT_CLR) && (host->clock <= 400000)) {
> +				udelay(40);
> +			}
>  			sdhci_data_irq(host, intmask & SDHCI_INT_DATA_MASK);
> +		}
>
>  		if (intmask & SDHCI_INT_BUS_POWER)
>  			pr_err("%s: Card is consuming too much power!\n",
> diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
> index 400f3a1..7fa1004 100644
> --- a/drivers/mmc/host/sdhci.h
> +++ b/drivers/mmc/host/sdhci.h
> @@ -24,6 +24,8 @@
>   * Controller registers
>   */
>
> +#define SDHCI_QUIRK2_SLOW_INT_CLR	(1<<5)
> +
>  #define SDHCI_DMA_ADDRESS	0x00
>  #define SDHCI_ARGUMENT2		SDHCI_DMA_ADDRESS
>
>

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH V3 1/6] dt-bindings: qcom: clk: Add missing binding for SDCHI enablement on Nexus 5X/6P
  2017-01-27  0:24   ` Stephen Boyd
@ 2017-01-26 21:58     ` Jeremy McNicoll
  0 siblings, 0 replies; 11+ messages in thread
From: Jeremy McNicoll @ 2017-01-26 21:58 UTC (permalink / raw)
  To: Stephen Boyd, Jeremy McNicoll
  Cc: linux-arm-msm, linux-soc, devicetree, linux-mmc, andy.gross,
	robh, arnd, bjorn.andersson, riteshh, git, ulf.hansson, jszhang,
	linux-clk

On 2017-01-26 7:24 PM, Stephen Boyd wrote:
> On 01/24, Jeremy McNicoll wrote:
>> AHB clock branch is needed in order to enable SDHCI
>> on msm899(2/4).
>>
>> Signed-off-by: Jeremy McNicoll <jeremymc@redhat.com>
>> ---
>
> Please cc linux-clk on clk patches (it helps my filters).
>

duly noted and added!


>
>>  include/dt-bindings/clock/qcom,gcc-msm8994.h | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/include/dt-bindings/clock/qcom,gcc-msm8994.h b/include/dt-bindings/clock/qcom,gcc-msm8994.h
>> index 8fa535b..df47da0 100644
>> --- a/include/dt-bindings/clock/qcom,gcc-msm8994.h
>> +++ b/include/dt-bindings/clock/qcom,gcc-msm8994.h
>> @@ -133,5 +133,6 @@
>>  #define GCC_USB30_MOCK_UTMI_CLK			115
>>  #define GCC_USB3_PHY_AUX_CLK			116
>>  #define GCC_USB_HS_SYSTEM_CLK			117
>> +#define GCC_SDCC1_AHB_CLK			118
>>
>
> Is there a driver patch too? Or just the #define addition.
>

This was split up as I believe I was told that we need to separate
the dt-bindings from the other code.  Or should we combine them when
dealing with clocks?

The other part of this change looks just fine in my inbox.
Unfortunately that is the only place it got sent to. My bad.....
NAK.

Remember kids, cut twice measure once.

I'll send a V4 shortly.



-jeremy

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH V3 2/6] sdhci: Add quirk for delayed IRQ ACK
  2017-01-25 10:18   ` Ritesh Harjani
@ 2017-01-26 22:32     ` Jeremy McNicoll
  0 siblings, 0 replies; 11+ messages in thread
From: Jeremy McNicoll @ 2017-01-26 22:32 UTC (permalink / raw)
  To: Ritesh Harjani, Jeremy McNicoll
  Cc: linux-arm-msm, linux-soc, devicetree, linux-mmc, andy.gross,
	sboyd, robh, arnd, bjorn.andersson, git, ulf.hansson, jszhang

On 2017-01-25 5:18 AM, Ritesh Harjani wrote:
> Hi Jeremy,
>
> From what I can see in codeaurora tree, quirk
> (SDHCI_QUIRK2_SLOW_INT_CLR) is only required for sdhci-msm with minor
> number 2B. I think this patch may not be relevant for msm8992 controller.

minor number 2B ?  Is that a typo ?

Please check the code from here:

https://android.googlesource.com/kernel/msm.git/+/android-msm-bullhead-3.10-n-preview-1/drivers/mmc/host/sdhci-msm.c?autodive=0%2F%2F#3213

Ok, in the tree there is a check for both 0x3E and 0x2E.


> And as you have also mentioned in your V2, that even without this
> change, the detection is fine. The delay you are observing could be due
> to something else unless we are sure.
>

It is, I did some more testing without this patch and a hack to deal
with a _KNOWN_ rpm-smd issue on the msm899(2/4).  The detection time was
much quicker and very reliable.  Bjorn Andersson is aware of the issue
and I would like to defer to him as to what solution he would like to
pursue.

> On reading history of this quirk, I see that this patch was a SW
> workaround for some HW issue in very initial controller.
> This was fixed for later controllers.
> For this reason, in my opinion we can drop this patch.
>

Agreed as I mentioned above the root cause (reasonably confident) of the 
inconsistent / slow SDHCI detection time seems to be due to the rpm-smd 
issue mentioned above.   It seems as though this quirk was masking / 
altering things enough to provide an appearance of slightly better 
detection.  Mind you my sample set was only 1 device. It would have been 
nice to get data over a larger sample size.

> But, as we discussed on IRC, let's investigate more on your issue before
> finalizing on this patch for merging.
>

At this point I am satisfied that dropping this patch still allows
SDHCI detection to occur.  Will drop as part of V4.

-jeremy

> Regards
> Ritesh
>
> On 1/24/2017 3:06 PM, Jeremy McNicoll wrote:
>> On msm8992 it has been observed that IRQs were not getting
>> ACK'd correctly when clocked at speeds greater than 400KHz.
>>
>> Signed-off-by: Jeremy McNicoll <jeremymc@redhat.com>
>> ---
>>  drivers/mmc/host/sdhci-msm.c |  7 +++++++
>>  drivers/mmc/host/sdhci.c     | 12 ++++++++++--
>>  drivers/mmc/host/sdhci.h     |  2 ++
>>  3 files changed, 19 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
>> index f3f3fb3..11dc389 100644
>> --- a/drivers/mmc/host/sdhci-msm.c
>> +++ b/drivers/mmc/host/sdhci-msm.c
>> @@ -1304,6 +1304,13 @@ static int sdhci_msm_probe(struct
>> platform_device *pdev)
>>                     CORE_VENDOR_SPEC_CAPABILITIES0);
>>      }
>>
>> +    /* Enable delayed IRQ handling workaround on 8992 */
>> +    if (core_major == 1 && core_minor == 0x3e) {
>> +        /* Add 40us delay in interrupt handler when operating
>> +         * at initialization frequency of 400KHz. */
>> +        host->quirks2 |= SDHCI_QUIRK2_SLOW_INT_CLR;
>> +    }
>> +
>>      /* Setup IRQ for handling power/voltage tasks with PMIC */
>>      msm_host->pwr_irq = platform_get_irq_byname(pdev, "pwr_irq");
>>      if (msm_host->pwr_irq < 0) {
>> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
>> index 06dfac2..68a21a3 100644
>> --- a/drivers/mmc/host/sdhci.c
>> +++ b/drivers/mmc/host/sdhci.c
>> @@ -2742,11 +2742,19 @@ static irqreturn_t sdhci_irq(int irq, void
>> *dev_id)
>>              result = IRQ_WAKE_THREAD;
>>          }
>>
>> -        if (intmask & SDHCI_INT_CMD_MASK)
>> +        if (intmask & SDHCI_INT_CMD_MASK) {
>> +            if ((host->quirks2 & SDHCI_QUIRK2_SLOW_INT_CLR) &&
>> (host->clock <= 400000)) {
>> +                udelay(40);
>> +            }
>>              sdhci_cmd_irq(host, intmask & SDHCI_INT_CMD_MASK);
>> +        }
>>
>> -        if (intmask & SDHCI_INT_DATA_MASK)
>> +        if (intmask & SDHCI_INT_DATA_MASK) {
>> +            if ((host->quirks2 & SDHCI_QUIRK2_SLOW_INT_CLR) &&
>> (host->clock <= 400000)) {
>> +                udelay(40);
>> +            }
>>              sdhci_data_irq(host, intmask & SDHCI_INT_DATA_MASK);
>> +        }
>>
>>          if (intmask & SDHCI_INT_BUS_POWER)
>>              pr_err("%s: Card is consuming too much power!\n",
>> diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
>> index 400f3a1..7fa1004 100644
>> --- a/drivers/mmc/host/sdhci.h
>> +++ b/drivers/mmc/host/sdhci.h
>> @@ -24,6 +24,8 @@
>>   * Controller registers
>>   */
>>
>> +#define SDHCI_QUIRK2_SLOW_INT_CLR    (1<<5)
>> +
>>  #define SDHCI_DMA_ADDRESS    0x00
>>  #define SDHCI_ARGUMENT2        SDHCI_DMA_ADDRESS
>>
>>
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH V3 1/6] dt-bindings: qcom: clk: Add missing binding for SDCHI enablement on Nexus 5X/6P
  2017-01-24  9:36 ` [PATCH V3 1/6] dt-bindings: qcom: clk: Add missing binding for SDCHI enablement on Nexus 5X/6P Jeremy McNicoll
@ 2017-01-27  0:24   ` Stephen Boyd
  2017-01-26 21:58     ` Jeremy McNicoll
  0 siblings, 1 reply; 11+ messages in thread
From: Stephen Boyd @ 2017-01-27  0:24 UTC (permalink / raw)
  To: Jeremy McNicoll
  Cc: linux-arm-msm, linux-soc, devicetree, linux-mmc, andy.gross,
	robh, arnd, bjorn.andersson, riteshh, git, ulf.hansson, jszhang

On 01/24, Jeremy McNicoll wrote:
> AHB clock branch is needed in order to enable SDHCI
> on msm899(2/4).
> 
> Signed-off-by: Jeremy McNicoll <jeremymc@redhat.com>
> ---

Please cc linux-clk on clk patches (it helps my filters).


>  include/dt-bindings/clock/qcom,gcc-msm8994.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/include/dt-bindings/clock/qcom,gcc-msm8994.h b/include/dt-bindings/clock/qcom,gcc-msm8994.h
> index 8fa535b..df47da0 100644
> --- a/include/dt-bindings/clock/qcom,gcc-msm8994.h
> +++ b/include/dt-bindings/clock/qcom,gcc-msm8994.h
> @@ -133,5 +133,6 @@
>  #define GCC_USB30_MOCK_UTMI_CLK			115
>  #define GCC_USB3_PHY_AUX_CLK			116
>  #define GCC_USB_HS_SYSTEM_CLK			117
> +#define GCC_SDCC1_AHB_CLK			118
>  

Is there a driver patch too? Or just the #define addition.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-01-27  1:43 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-24  9:36 [PATCH V3 0/6] Enable onboard SDHCI for Nexus 5X (msm8992) Jeremy McNicoll
2017-01-24  9:36 ` [PATCH V3 1/6] dt-bindings: qcom: clk: Add missing binding for SDCHI enablement on Nexus 5X/6P Jeremy McNicoll
2017-01-27  0:24   ` Stephen Boyd
2017-01-26 21:58     ` Jeremy McNicoll
2017-01-24  9:36 ` [PATCH V3 2/6] sdhci: Add quirk for delayed IRQ ACK Jeremy McNicoll
2017-01-25 10:18   ` Ritesh Harjani
2017-01-26 22:32     ` Jeremy McNicoll
2017-01-24  9:36 ` [PATCH V3 3/6] arm64: dts: msm8992 add fixed regulator Jeremy McNicoll
2017-01-24  9:36 ` [PATCH V3 4/6] arm64: dts: smem enablement for msm8992 Jeremy McNicoll
2017-01-24  9:36 ` [PATCH V3 5/6] dts: arm64: Enable onboard SDHCI on msm8992 Jeremy McNicoll
2017-01-24  9:36 ` [PATCH V3 6/6] dts: doc: rename rpm_requests to respect DT naming conventions Jeremy McNicoll

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.