linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Add MMC controller support for HI3670 SoC
@ 2019-02-28 15:45 Manivannan Sadhasivam
  2019-02-28 15:45 ` [PATCH 1/3] dt-bindings: mmc: Add HI3670 MMC controller binding Manivannan Sadhasivam
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Manivannan Sadhasivam @ 2019-02-28 15:45 UTC (permalink / raw)
  To: xuwei5, robh+dt
  Cc: linux-arm-kernel, devicetree, linux-kernel, john.stultz,
	amit.kucheria, guodong.xu, Manivannan Sadhasivam

Hello,

This patchset adds MMC controller support for HI3670 SoC. Since HI3670
SoC is architecturally same as the HI3660 SoC, HI3660 DWMMC driver is
reused here with DT compatible fallback approach. Also, SD and WiFi
supports are added for the HiKey970 board.

Wei:

Please apply this patchset along with the reset and UFS patches in the
following order:

1. Reset support patches
2. MMC support patches
3. UFS support patches

PS: Since there is no PMIC support available yet, fixed-regulator nodes
are used to get the driver working (regulators are enabled by bootloader).

Thanks,
Mani

Manivannan Sadhasivam (3):
  dt-bindings: mmc: Add HI3670 MMC controller binding
  arm64: dts: hisilicon: hi3670: Add MMC controller support
  arm64: dts: hisilicon: hikey970: Add SD and WiFi support

 .../devicetree/bindings/mmc/k3-dw-mshc.txt    |   2 +
 .../boot/dts/hisilicon/hi3670-hikey970.dts    |  75 ++++++++++++
 arch/arm64/boot/dts/hisilicon/hi3670.dtsi     |  37 ++++++
 .../boot/dts/hisilicon/hikey970-pinctrl.dtsi  | 115 ++++++++++++++++++
 4 files changed, 229 insertions(+)

-- 
2.17.1


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

* [PATCH 1/3] dt-bindings: mmc: Add HI3670 MMC controller binding
  2019-02-28 15:45 [PATCH 0/3] Add MMC controller support for HI3670 SoC Manivannan Sadhasivam
@ 2019-02-28 15:45 ` Manivannan Sadhasivam
  2019-03-27 19:31   ` Rob Herring
  2019-02-28 15:45 ` [PATCH 2/3] arm64: dts: hisilicon: hi3670: Add MMC controller support Manivannan Sadhasivam
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Manivannan Sadhasivam @ 2019-02-28 15:45 UTC (permalink / raw)
  To: xuwei5, robh+dt
  Cc: linux-arm-kernel, devicetree, linux-kernel, john.stultz,
	amit.kucheria, guodong.xu, Manivannan Sadhasivam

HI3670 SoC is architecturally same as the HI3660 SoC. Hence, the same
K3 specific designware driver is reused for HI3670 SoC and the binding
is documented with fallback approach for compatible property.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
 Documentation/devicetree/bindings/mmc/k3-dw-mshc.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/mmc/k3-dw-mshc.txt b/Documentation/devicetree/bindings/mmc/k3-dw-mshc.txt
index 07242d141773..36c4bea675d5 100644
--- a/Documentation/devicetree/bindings/mmc/k3-dw-mshc.txt
+++ b/Documentation/devicetree/bindings/mmc/k3-dw-mshc.txt
@@ -13,6 +13,8 @@ Required Properties:
 
 * compatible: should be one of the following.
   - "hisilicon,hi3660-dw-mshc": for controllers with hi3660 specific extensions.
+  - "hisilicon,hi3670-dw-mshc", "hisilicon,hi3660-dw-mshc": for controllers
+     with hi3670 specific extensions.
   - "hisilicon,hi4511-dw-mshc": for controllers with hi4511 specific extensions.
   - "hisilicon,hi6220-dw-mshc": for controllers with hi6220 specific extensions.
 
-- 
2.17.1


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

* [PATCH 2/3] arm64: dts: hisilicon: hi3670: Add MMC controller support
  2019-02-28 15:45 [PATCH 0/3] Add MMC controller support for HI3670 SoC Manivannan Sadhasivam
  2019-02-28 15:45 ` [PATCH 1/3] dt-bindings: mmc: Add HI3670 MMC controller binding Manivannan Sadhasivam
@ 2019-02-28 15:45 ` Manivannan Sadhasivam
  2019-02-28 15:45 ` [PATCH 3/3] arm64: dts: hisilicon: hikey970: Add SD and WiFi support Manivannan Sadhasivam
  2019-04-15 15:57 ` [PATCH 0/3] Add MMC controller support for HI3670 SoC Wei Xu
  3 siblings, 0 replies; 6+ messages in thread
From: Manivannan Sadhasivam @ 2019-02-28 15:45 UTC (permalink / raw)
  To: xuwei5, robh+dt
  Cc: linux-arm-kernel, devicetree, linux-kernel, john.stultz,
	amit.kucheria, guodong.xu, Manivannan Sadhasivam

Add MMC controller support for HiSilicon HI3670 SoC reusing the HI3660
Designware MMC driver. There are 2 DWMMC controllers present in this SoC:

1. DWMMC1 is used for SD card (SD)
2. DWMMC2 is used for WiFi (SDIO)

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
 arch/arm64/boot/dts/hisilicon/hi3670.dtsi | 37 +++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/arch/arm64/boot/dts/hisilicon/hi3670.dtsi b/arch/arm64/boot/dts/hisilicon/hi3670.dtsi
index 9864cf59ebd8..080d6ba5ae39 100644
--- a/arch/arm64/boot/dts/hisilicon/hi3670.dtsi
+++ b/arch/arm64/boot/dts/hisilicon/hi3670.dtsi
@@ -671,5 +671,42 @@
 			resets = <&crg_rst 0x84 12>;
 			reset-names = "rst";
 		};
+
+		/* SD */
+		dwmmc1: dwmmc1@ff37f000 {
+			compatible = "hisilicon,hi3670-dw-mshc",
+				     "hisilicon,hi3660-dw-mshc";
+			reg = <0x0 0xff37f000 0x0 0x1000>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			interrupts = <GIC_SPI 139 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&crg_ctrl HI3670_CLK_GATE_SD>,
+				<&crg_ctrl HI3670_HCLK_GATE_SD>;
+			clock-names = "ciu", "biu";
+			clock-frequency = <3200000>;
+			resets = <&crg_rst 0x94 18>;
+			reset-names = "reset";
+			hisilicon,peripheral-syscon = <&sctrl>;
+			card-detect-delay = <200>;
+			status = "disabled";
+		};
+
+		/* SDIO */
+		dwmmc2: dwmmc2@fc183000 {
+			compatible = "hisilicon,hi3670-dw-mshc",
+				     "hisilicon,hi3660-dw-mshc";
+			reg = <0x0 0xfc183000 0x0 0x1000>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			interrupts = <GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&crg_ctrl HI3670_CLK_GATE_SDIO>,
+				<&crg_ctrl HI3670_HCLK_GATE_SDIO>;
+			clock-names = "ciu", "biu";
+			clock-frequency = <3200000>;
+			resets = <&crg_rst 0x94 20>;
+			reset-names = "reset";
+			card-detect-delay = <200>;
+			status = "disabled";
+		};
 	};
 };
-- 
2.17.1


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

* [PATCH 3/3] arm64: dts: hisilicon: hikey970: Add SD and WiFi support
  2019-02-28 15:45 [PATCH 0/3] Add MMC controller support for HI3670 SoC Manivannan Sadhasivam
  2019-02-28 15:45 ` [PATCH 1/3] dt-bindings: mmc: Add HI3670 MMC controller binding Manivannan Sadhasivam
  2019-02-28 15:45 ` [PATCH 2/3] arm64: dts: hisilicon: hi3670: Add MMC controller support Manivannan Sadhasivam
@ 2019-02-28 15:45 ` Manivannan Sadhasivam
  2019-04-15 15:57 ` [PATCH 0/3] Add MMC controller support for HI3670 SoC Wei Xu
  3 siblings, 0 replies; 6+ messages in thread
From: Manivannan Sadhasivam @ 2019-02-28 15:45 UTC (permalink / raw)
  To: xuwei5, robh+dt
  Cc: linux-arm-kernel, devicetree, linux-kernel, john.stultz,
	amit.kucheria, guodong.xu, Manivannan Sadhasivam

Add SD and WiFi support for HiKey970 board based on HI3670 SoC. Due to
the absence of the PMIC driver, fixed regulators are sourced to make the
driver working.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
 .../boot/dts/hisilicon/hi3670-hikey970.dts    |  75 ++++++++++++
 .../boot/dts/hisilicon/hikey970-pinctrl.dtsi  | 115 ++++++++++++++++++
 2 files changed, 190 insertions(+)

diff --git a/arch/arm64/boot/dts/hisilicon/hi3670-hikey970.dts b/arch/arm64/boot/dts/hisilicon/hi3670-hikey970.dts
index c9775b66629f..7dac33d4fd5c 100644
--- a/arch/arm64/boot/dts/hisilicon/hi3670-hikey970.dts
+++ b/arch/arm64/boot/dts/hisilicon/hi3670-hikey970.dts
@@ -8,6 +8,7 @@
  */
 
 /dts-v1/;
+#include <dt-bindings/gpio/gpio.h>
 
 #include "hi3670.dtsi"
 #include "hikey970-pinctrl.dtsi"
@@ -17,6 +18,8 @@
 	compatible = "hisilicon,hi3670-hikey970", "hisilicon,hi3670";
 
 	aliases {
+		mshc1 = &dwmmc1;
+		mshc2 = &dwmmc2;
 		serial0 = &uart0;
 		serial1 = &uart1;
 		serial2 = &uart2;
@@ -35,6 +38,37 @@
 		/* expect bootloader to fill in this region */
 		reg = <0x0 0x0 0x0 0x0>;
 	};
+
+	sd_1v8: regulator-1v8 {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-1.8V";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		regulator-always-on;
+	};
+
+	sd_3v3: regulator-3v3 {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-3.3V";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		regulator-boot-on;
+		regulator-always-on;
+	};
+
+	wlan_en: wlan-en-1-8v {
+		compatible = "regulator-fixed";
+		regulator-name = "wlan-en-regulator";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+
+		/* GPIO_051_WIFI_EN */
+		gpio = <&gpio6 3 0>;
+
+		/* WLAN card specific delay */
+		startup-delay-us = <70000>;
+		enable-active-high;
+	};
 };
 
 /*
@@ -354,6 +388,47 @@
 		"GPIO_231_HDMI_INT";
 };
 
+&dwmmc1 {
+	bus-width = <0x4>;
+	sd-uhs-sdr12;
+	sd-uhs-sdr25;
+	sd-uhs-sdr50;
+	sd-uhs-sdr104;
+	cap-sd-highspeed;
+	disable-wp;
+	cd-inverted;
+	cd-gpios = <&gpio25 5 GPIO_ACTIVE_HIGH>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&sd_pmx_func
+		     &sd_clk_cfg_func
+		     &sd_cfg_func>;
+	vmmc-supply = <&sd_3v3>;
+	vqmmc-supply = <&sd_1v8>;
+	status = "okay";
+};
+
+&dwmmc2 { /* WIFI */
+	bus-width = <0x4>;
+	non-removable;
+	broken-cd;
+	cap-power-off-card;
+	pinctrl-names = "default";
+	pinctrl-0 = <&sdio_pmx_func
+		     &sdio_clk_cfg_func
+		     &sdio_cfg_func>;
+	/* WL_EN */
+	vmmc-supply = <&wlan_en>;
+	status = "ok";
+
+	wlcore: wlcore@2 {
+		compatible = "ti,wl1837";
+		reg = <2>;      /* sdio func num */
+		/* WL_IRQ, GPIO_177_WL_WAKEUP_AP */
+		interrupt-parent = <&gpio22>;
+		interrupts = <1 IRQ_TYPE_EDGE_RISING>;
+	};
+};
+
 &uart0 {
 	/* On High speed expansion header */
 	label = "HS-UART0";
diff --git a/arch/arm64/boot/dts/hisilicon/hikey970-pinctrl.dtsi b/arch/arm64/boot/dts/hisilicon/hikey970-pinctrl.dtsi
index 67bb52d43619..d456b0aa6f58 100644
--- a/arch/arm64/boot/dts/hisilicon/hikey970-pinctrl.dtsi
+++ b/arch/arm64/boot/dts/hisilicon/hikey970-pinctrl.dtsi
@@ -196,6 +196,16 @@
 			/* pin base, nr pins & gpio function */
 			pinctrl-single,gpio-range = <&range 0 10 0>;
 
+			sdio_pmx_func: sdio_pmx_func {
+				pinctrl-single,pins = <
+					0x000 MUX_M1 /* SDIO_CLK */
+					0x004 MUX_M1 /* SDIO_CMD */
+					0x008 MUX_M1 /* SDIO_DATA0 */
+					0x00c MUX_M1 /* SDIO_DATA1 */
+					0x010 MUX_M1 /* SDIO_DATA2 */
+					0x014 MUX_M1 /* SDIO_DATA3 */
+				>;
+			};
 		};
 
 		pmx6: pinmux@fc182800 {
@@ -203,6 +213,52 @@
 			reg = <0x0 0xfc182800 0x0 0x028>;
 			#pinctrl-cells = <1>;
 			pinctrl-single,register-width = <0x20>;
+
+			sdio_clk_cfg_func: sdio_clk_cfg_func {
+				pinctrl-single,pins = <
+					0x000 0x0 /* SDIO_CLK */
+				>;
+				pinctrl-single,bias-pulldown = <
+					PULL_DIS
+					PULL_DOWN
+					PULL_DIS
+					PULL_DOWN
+				>;
+				pinctrl-single,bias-pullup = <
+					PULL_DIS
+					PULL_UP
+					PULL_DIS
+					PULL_UP
+				>;
+				pinctrl-single,drive-strength = <
+					DRIVE6_32MA DRIVE6_MASK
+				>;
+			};
+
+			sdio_cfg_func: sdio_cfg_func {
+				pinctrl-single,pins = <
+					0x004 0x0 /* SDIO_CMD */
+					0x008 0x0 /* SDIO_DATA0 */
+					0x00c 0x0 /* SDIO_DATA1 */
+					0x010 0x0 /* SDIO_DATA2 */
+					0x014 0x0 /* SDIO_DATA3 */
+				>;
+				pinctrl-single,bias-pulldown = <
+					PULL_DIS
+					PULL_DOWN
+					PULL_DIS
+					PULL_DOWN
+				>;
+				pinctrl-single,bias-pullup = <
+					PULL_UP
+					PULL_UP
+					PULL_DIS
+					PULL_UP
+				>;
+				pinctrl-single,drive-strength = <
+					DRIVE6_19MA DRIVE6_MASK
+				>;
+			};
 		};
 
 		pmx7: pinmux@ff37e000 {
@@ -214,6 +270,17 @@
 			pinctrl-single,function-mask = <7>;
 			/* pin base, nr pins & gpio function */
 			pinctrl-single,gpio-range = <&range 0 12 0>;
+
+			sd_pmx_func: sd_pmx_func {
+				pinctrl-single,pins = <
+					0x000 MUX_M1 /* SD_CLK */
+					0x004 MUX_M1 /* SD_CMD */
+					0x008 MUX_M1 /* SD_DATA0 */
+					0x00c MUX_M1 /* SD_DATA1 */
+					0x010 MUX_M1 /* SD_DATA2 */
+					0x014 MUX_M1 /* SD_DATA3 */
+				>;
+			};
 		};
 
 		pmx8: pinmux@ff37e800 {
@@ -221,6 +288,54 @@
 			reg = <0x0 0xff37e800 0x0 0x030>;
 			#pinctrl-cells = <1>;
 			pinctrl-single,register-width = <0x20>;
+
+			sd_clk_cfg_func: sd_clk_cfg_func {
+				pinctrl-single,pins = <
+					0x000 0x0 /* SD_CLK */
+				>;
+				pinctrl-single,bias-pulldown = <
+					PULL_DIS
+					PULL_DOWN
+					PULL_DIS
+					PULL_DOWN
+				>;
+				pinctrl-single,bias-pullup = <
+					PULL_DIS
+					PULL_UP
+					PULL_DIS
+					PULL_UP
+				>;
+				pinctrl-single,drive-strength = <
+					DRIVE6_32MA
+					DRIVE6_MASK
+				>;
+			};
+
+			sd_cfg_func: sd_cfg_func {
+				pinctrl-single,pins = <
+					0x004 0x0 /* SD_CMD */
+					0x008 0x0 /* SD_DATA0 */
+					0x00c 0x0 /* SD_DATA1 */
+					0x010 0x0 /* SD_DATA2 */
+					0x014 0x0 /* SD_DATA3 */
+				>;
+				pinctrl-single,bias-pulldown = <
+					PULL_DIS
+					PULL_DOWN
+					PULL_DIS
+					PULL_DOWN
+				>;
+				pinctrl-single,bias-pullup = <
+					PULL_UP
+					PULL_UP
+					PULL_DIS
+					PULL_UP
+				>;
+				pinctrl-single,drive-strength = <
+					DRIVE6_19MA
+					DRIVE6_MASK
+				>;
+			};
 		};
 
 		pmx1: pinmux@fff11000 {
-- 
2.17.1


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

* Re: [PATCH 1/3] dt-bindings: mmc: Add HI3670 MMC controller binding
  2019-02-28 15:45 ` [PATCH 1/3] dt-bindings: mmc: Add HI3670 MMC controller binding Manivannan Sadhasivam
@ 2019-03-27 19:31   ` Rob Herring
  0 siblings, 0 replies; 6+ messages in thread
From: Rob Herring @ 2019-03-27 19:31 UTC (permalink / raw)
  To: Manivannan Sadhasivam
  Cc: xuwei5, robh+dt, linux-arm-kernel, devicetree, linux-kernel,
	john.stultz, amit.kucheria, guodong.xu, Manivannan Sadhasivam

On Thu, 28 Feb 2019 21:15:09 +0530, Manivannan Sadhasivam wrote:
> HI3670 SoC is architecturally same as the HI3660 SoC. Hence, the same
> K3 specific designware driver is reused for HI3670 SoC and the binding
> is documented with fallback approach for compatible property.
> 
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> ---
>  Documentation/devicetree/bindings/mmc/k3-dw-mshc.txt | 2 ++
>  1 file changed, 2 insertions(+)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

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

* Re: [PATCH 0/3] Add MMC controller support for HI3670 SoC
  2019-02-28 15:45 [PATCH 0/3] Add MMC controller support for HI3670 SoC Manivannan Sadhasivam
                   ` (2 preceding siblings ...)
  2019-02-28 15:45 ` [PATCH 3/3] arm64: dts: hisilicon: hikey970: Add SD and WiFi support Manivannan Sadhasivam
@ 2019-04-15 15:57 ` Wei Xu
  3 siblings, 0 replies; 6+ messages in thread
From: Wei Xu @ 2019-04-15 15:57 UTC (permalink / raw)
  To: Manivannan Sadhasivam, robh+dt
  Cc: linux-arm-kernel, devicetree, linux-kernel, john.stultz,
	amit.kucheria, guodong.xu, xuwei5

Hi Manivannan,

On 2/28/2019 3:45 PM, Manivannan Sadhasivam wrote:
> Hello,
> 
> This patchset adds MMC controller support for HI3670 SoC. Since HI3670
> SoC is architecturally same as the HI3660 SoC, HI3660 DWMMC driver is
> reused here with DT compatible fallback approach. Also, SD and WiFi
> supports are added for the HiKey970 board.
> 
> Wei:
> 
> Please apply this patchset along with the reset and UFS patches in the
> following order:
> 
> 1. Reset support patches
> 2. MMC support patches
> 3. UFS support patches
> 
> PS: Since there is no PMIC support available yet, fixed-regulator nodes
> are used to get the driver working (regulators are enabled by bootloader).
> 
> Thanks,
> Mani
> 
> Manivannan Sadhasivam (3):
>   dt-bindings: mmc: Add HI3670 MMC controller binding
>   arm64: dts: hisilicon: hi3670: Add MMC controller support
>   arm64: dts: hisilicon: hikey970: Add SD and WiFi support
> 
>  .../devicetree/bindings/mmc/k3-dw-mshc.txt    |   2 +
>  .../boot/dts/hisilicon/hi3670-hikey970.dts    |  75 ++++++++++++
>  arch/arm64/boot/dts/hisilicon/hi3670.dtsi     |  37 ++++++
>  .../boot/dts/hisilicon/hikey970-pinctrl.dtsi  | 115 ++++++++++++++++++
>  4 files changed, 229 insertions(+)
> 

Thanks!
Applied the series to the hisilicon dts tree with the order.

Best Regards,
Wei


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

end of thread, other threads:[~2019-04-15 15:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-28 15:45 [PATCH 0/3] Add MMC controller support for HI3670 SoC Manivannan Sadhasivam
2019-02-28 15:45 ` [PATCH 1/3] dt-bindings: mmc: Add HI3670 MMC controller binding Manivannan Sadhasivam
2019-03-27 19:31   ` Rob Herring
2019-02-28 15:45 ` [PATCH 2/3] arm64: dts: hisilicon: hi3670: Add MMC controller support Manivannan Sadhasivam
2019-02-28 15:45 ` [PATCH 3/3] arm64: dts: hisilicon: hikey970: Add SD and WiFi support Manivannan Sadhasivam
2019-04-15 15:57 ` [PATCH 0/3] Add MMC controller support for HI3670 SoC Wei Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).