devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] Support the rk3399 gmac pd function
@ 2016-08-30 20:30 Caesar Wang
  2016-08-30 20:30 ` [PATCH 3/4] arm64: dts: rockchip: support gmac for rk3399 Caesar Wang
       [not found] ` <1472589008-7713-1-git-send-email-wxt-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
  0 siblings, 2 replies; 5+ messages in thread
From: Caesar Wang @ 2016-08-30 20:30 UTC (permalink / raw)
  To: Heiko Stuebner, netdev
  Cc: linux-rockchip, Brian Norris, Douglas Anderson, dbasehore,
	Caesar Wang, Arnd Bergmann, Giuseppe Cavallaro, Frank Wang,
	Rob Herring, Catalin Marinas, Elaine Zhang, David Wu, Will Deacon,
	devicetree, linux-arm-kernel, Jianqun Xu, Masahiro Yamada,
	Alexandre Torgue, linux-kernel, Shunqian Zheng, Mark

This patch add to handle the gmac pd issue, and support
the rk3399 gmac for devicetree.



Caesar Wang (2):
  arm64: dts: rockchip: support gmac for rk3399
  arm64: dts: rockchip: enable the gmac for rk3399 evb board

David Wu (1):
  net: stmmac: dwmac-rk: add pd_gmac support for rk3399

Roger Chen (1):
  net: stmmac: dwmac-rk: fixes the gmac resume after PD on/off

 arch/arm64/boot/dts/rockchip/rk3399-evb.dts    | 31 +++++++++
 arch/arm64/boot/dts/rockchip/rk3399.dtsi       | 90 ++++++++++++++++++++++++++
 drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 27 +++++---
 3 files changed, 139 insertions(+), 9 deletions(-)

-- 
1.9.1

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

* [PATCH 3/4] arm64: dts: rockchip: support gmac for rk3399
  2016-08-30 20:30 [PATCH 0/4] Support the rk3399 gmac pd function Caesar Wang
@ 2016-08-30 20:30 ` Caesar Wang
       [not found]   ` <1472589008-7713-4-git-send-email-wxt-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
       [not found] ` <1472589008-7713-1-git-send-email-wxt-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
  1 sibling, 1 reply; 5+ messages in thread
From: Caesar Wang @ 2016-08-30 20:30 UTC (permalink / raw)
  To: Heiko Stuebner, netdev
  Cc: linux-rockchip, Brian Norris, Douglas Anderson, dbasehore,
	Caesar Wang, Roger Chen, Rob Herring, Mark Rutland,
	Catalin Marinas, Will Deacon, Jianqun Xu, Xing Zheng,
	Masahiro Yamada, Elaine Zhang, David Wu, Shunqian Zheng,
	devicetree, linux-arm-kernel, linux-kernel

This patch adds needed gamc information for rk3399,
also support the gmac pd.

Signed-off-by: Roger Chen <roger.chen@rock-chips.com>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
---

 arch/arm64/boot/dts/rockchip/rk3399.dtsi | 90 ++++++++++++++++++++++++++++++++
 1 file changed, 90 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
index 32aebc8..53ac651 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
@@ -200,6 +200,26 @@
 		};
 	};
 
+	gmac: eth@fe300000 {
+		compatible = "rockchip,rk3399-gmac";
+		reg = <0x0 0xfe300000 0x0 0x10000>;
+		rockchip,grf = <&grf>;
+		interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-names = "macirq";
+		clocks = <&cru SCLK_MAC>, <&cru SCLK_MAC_RX>,
+			 <&cru SCLK_MAC_TX>, <&cru SCLK_MACREF>,
+			 <&cru SCLK_MACREF_OUT>, <&cru ACLK_GMAC>,
+			 <&cru PCLK_GMAC>;
+		clock-names = "stmmaceth", "mac_clk_rx",
+			      "mac_clk_tx", "clk_mac_ref",
+			      "clk_mac_refout", "aclk_mac",
+			      "pclk_mac";
+		resets = <&cru SRST_A_GMAC>;
+		reset-names = "stmmaceth";
+		power-domains = <&power RK3399_PD_GMAC>;
+		status = "disabled";
+	};
+
 	sdio0: dwmmc@fe310000 {
 		compatible = "rockchip,rk3399-dw-mshc",
 			     "rockchip,rk3288-dw-mshc";
@@ -611,6 +631,11 @@
 		status = "disabled";
 	};
 
+	qos_gmac: qos@ffa5c000 {
+		compatible = "syscon";
+		reg = <0x0 0xffa5c000 0x0 0x20>;
+	};
+
 	qos_hdcp: qos@ffa90000 {
 		compatible = "syscon";
 		reg = <0x0 0xffa90000 0x0 0x20>;
@@ -704,6 +729,11 @@
 			#size-cells = <0>;
 
 			/* These power domains are grouped by VD_CENTER */
+			pd_gmac@RK3399_PD_GMAC {
+				reg = <RK3399_PD_GMAC>;
+				clocks = <&cru ACLK_GMAC>;
+				pm_qos = <&qos_gmac>;
+			};
 			pd_iep@RK3399_PD_IEP {
 				reg = <RK3399_PD_IEP>;
 				clocks = <&cru ACLK_IEP>,
@@ -1183,6 +1213,66 @@
 			drive-strength = <13>;
 		};
 
+		gmac {
+			rgmii_pins: rgmii-pins {
+				rockchip,pins =
+					/* mac_txclk */
+					<3 17 RK_FUNC_1 &pcfg_pull_none_13ma>,
+					/* mac_rxclk */
+					<3 14 RK_FUNC_1 &pcfg_pull_none>,
+					/* mac_mdio */
+					<3 13 RK_FUNC_1 &pcfg_pull_none>,
+					/* mac_txen */
+					<3 12 RK_FUNC_1 &pcfg_pull_none_13ma>,
+					/* mac_clk */
+					<3 11 RK_FUNC_1 &pcfg_pull_none>,
+					/* mac_rxdv */
+					<3 9 RK_FUNC_1 &pcfg_pull_none>,
+					/* mac_mdc */
+					<3 8 RK_FUNC_1 &pcfg_pull_none>,
+					/* mac_rxd1 */
+					<3 7 RK_FUNC_1 &pcfg_pull_none>,
+					/* mac_rxd0 */
+					<3 6 RK_FUNC_1 &pcfg_pull_none>,
+					/* mac_txd1 */
+					<3 5 RK_FUNC_1 &pcfg_pull_none_13ma>,
+					/* mac_txd0 */
+					<3 4 RK_FUNC_1 &pcfg_pull_none_13ma>,
+					/* mac_rxd3 */
+					<3 3 RK_FUNC_1 &pcfg_pull_none>,
+					/* mac_rxd2 */
+					<3 2 RK_FUNC_1 &pcfg_pull_none>,
+					/* mac_txd3 */
+					<3 1 RK_FUNC_1 &pcfg_pull_none_13ma>,
+					/* mac_txd2 */
+					<3 0 RK_FUNC_1 &pcfg_pull_none_13ma>;
+			};
+
+			rmii_pins: rmii-pins {
+				rockchip,pins =
+					/* mac_mdio */
+					<3 13 RK_FUNC_1 &pcfg_pull_none>,
+					/* mac_txen */
+					<3 12 RK_FUNC_1 &pcfg_pull_none_13ma>,
+					/* mac_clk */
+					<3 11 RK_FUNC_1 &pcfg_pull_none>,
+					/* mac_rxer */
+					<3 10 RK_FUNC_1 &pcfg_pull_none>,
+					/* mac_rxdv */
+					<3 9 RK_FUNC_1 &pcfg_pull_none>,
+					/* mac_mdc */
+					<3 8 RK_FUNC_1 &pcfg_pull_none>,
+					/* mac_rxd1 */
+					<3 7 RK_FUNC_1 &pcfg_pull_none>,
+					/* mac_rxd0 */
+					<3 6 RK_FUNC_1 &pcfg_pull_none>,
+					/* mac_txd1 */
+					<3 5 RK_FUNC_1 &pcfg_pull_none_13ma>,
+					/* mac_txd0 */
+					<3 4 RK_FUNC_1 &pcfg_pull_none_13ma>;
+			};
+		};
+
 		i2c0 {
 			i2c0_xfer: i2c0-xfer {
 				rockchip,pins =
-- 
1.9.1

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

* [PATCH 4/4] arm64: dts: rockchip: enable the gmac for rk3399 evb board
       [not found] ` <1472589008-7713-1-git-send-email-wxt-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
@ 2016-08-30 20:30   ` Caesar Wang
  0 siblings, 0 replies; 5+ messages in thread
From: Caesar Wang @ 2016-08-30 20:30 UTC (permalink / raw)
  To: Heiko Stuebner, netdev-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Brian Norris,
	Douglas Anderson, dbasehore-F7+t8E8rja9g9hUCZPvPmw, Caesar Wang,
	Roger Chen, Rob Herring, Mark Rutland, Catalin Marinas,
	Will Deacon, Masahiro Yamada, Arnd Bergmann, Frank Wang,
	Jianqun Xu, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

We add the required and optional properties for evb board.
See the [0] to get the detail information.

[0]:
Documentation/devicetree/bindings/net/rockchip-dwmac.txt

Signed-off-by: Roger Chen <roger.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
Signed-off-by: Caesar Wang <wxt-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
---

 arch/arm64/boot/dts/rockchip/rk3399-evb.dts | 31 +++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-evb.dts b/arch/arm64/boot/dts/rockchip/rk3399-evb.dts
index d47b4e9..ed6f2e8 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-evb.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-evb.dts
@@ -94,12 +94,43 @@
 		regulator-always-on;
 		regulator-boot-on;
 	};
+
+	clkin_gmac: external-gmac-clock {
+		compatible = "fixed-clock";
+		clock-frequency = <125000000>;
+		clock-output-names = "clkin_gmac";
+		#clock-cells = <0>;
+	};
+
+	vcc_phy: vcc-phy-regulator {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc_phy";
+		regulator-always-on;
+		regulator-boot-on;
+	};
+
 };
 
 &emmc_phy {
 	status = "okay";
 };
 
+&gmac {
+	phy-supply = <&vcc_phy>;
+	phy-mode = "rgmii";
+	clock_in_out = "input";
+	snps,reset-gpio = <&gpio3 15 GPIO_ACTIVE_LOW>;
+	snps,reset-active-low;
+	snps,reset-delays-us = <0 10000 50000>;
+	assigned-clocks = <&cru SCLK_RMII_SRC>;
+	assigned-clock-parents = <&clkin_gmac>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&rgmii_pins>;
+	tx_delay = <0x28>;
+	rx_delay = <0x11>;
+	status = "okay";
+};
+
 &pwm0 {
 	status = "okay";
 };
-- 
1.9.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 related	[flat|nested] 5+ messages in thread

* Re: [PATCH 3/4] arm64: dts: rockchip: support gmac for rk3399
       [not found]   ` <1472589008-7713-4-git-send-email-wxt-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
@ 2016-08-30 22:07     ` Heiko Stübner
  2016-08-31  6:19       ` Caesar Wang
  0 siblings, 1 reply; 5+ messages in thread
From: Heiko Stübner @ 2016-08-30 22:07 UTC (permalink / raw)
  To: Caesar Wang
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Brian Norris,
	Douglas Anderson, dbasehore-F7+t8E8rja9g9hUCZPvPmw, Roger Chen,
	Rob Herring, Mark Rutland, Catalin Marinas, Will Deacon,
	Jianqun Xu, Xing Zheng, Masahiro Yamada, Elaine Zhang, David Wu,
	Shunqian Zheng, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

Am Mittwoch, 31. August 2016, 04:30:06 schrieb Caesar Wang:
> This patch adds needed gamc information for rk3399,
> also support the gmac pd.
> 
> Signed-off-by: Roger Chen <roger.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
> Signed-off-by: Caesar Wang <wxt-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
> ---
> 
>  arch/arm64/boot/dts/rockchip/rk3399.dtsi | 90
> ++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
> b/arch/arm64/boot/dts/rockchip/rk3399.dtsi index 32aebc8..53ac651 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
> +++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
> @@ -200,6 +200,26 @@
>  		};
>  	};
> 
> +	gmac: eth@fe300000 {
> +		compatible = "rockchip,rk3399-gmac";
> +		reg = <0x0 0xfe300000 0x0 0x10000>;
> +		rockchip,grf = <&grf>;

should move below the reset-names .

> +		interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
> +		interrupt-names = "macirq";
> +		clocks = <&cru SCLK_MAC>, <&cru SCLK_MAC_RX>,
> +			 <&cru SCLK_MAC_TX>, <&cru SCLK_MACREF>,
> +			 <&cru SCLK_MACREF_OUT>, <&cru ACLK_GMAC>,
> +			 <&cru PCLK_GMAC>;
> +		clock-names = "stmmaceth", "mac_clk_rx",
> +			      "mac_clk_tx", "clk_mac_ref",
> +			      "clk_mac_refout", "aclk_mac",
> +			      "pclk_mac";
> +		resets = <&cru SRST_A_GMAC>;
> +		reset-names = "stmmaceth";
> +		power-domains = <&power RK3399_PD_GMAC>;

The driver core should handle regular power-domain handling on device creation 
already, right? So I should be able to apply patches 3 and 4 even without the 
dwmac patches, right?

Also if resending please move power-domains above resets


Heiko
--
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] 5+ messages in thread

* Re: [PATCH 3/4] arm64: dts: rockchip: support gmac for rk3399
  2016-08-30 22:07     ` Heiko Stübner
@ 2016-08-31  6:19       ` Caesar Wang
  0 siblings, 0 replies; 5+ messages in thread
From: Caesar Wang @ 2016-08-31  6:19 UTC (permalink / raw)
  To: Heiko Stübner
  Cc: Caesar Wang, Mark Rutland, devicetree, Brian Norris, Xing Zheng,
	Masahiro Yamada, netdev, dbasehore, Will Deacon, Douglas Anderson,
	linux-kernel, linux-rockchip, Rob Herring, Roger Chen,
	Catalin Marinas, Shunqian Zheng, Jianqun Xu, Elaine Zhang,
	linux-arm-kernel, David Wu

[-- Attachment #1: Type: text/plain, Size: 1998 bytes --]

Hi Heiko,

Thanks the response quickly.

On 2016?08?31? 06:07, Heiko St�bner wrote:
> Am Mittwoch, 31. August 2016, 04:30:06 schrieb Caesar Wang:
>> This patch adds needed gamc information for rk3399,
>> also support the gmac pd.
>>
>> Signed-off-by: Roger Chen <roger.chen@rock-chips.com>
>> Signed-off-by: Caesar Wang <wxt@rock-chips.com>
>> ---
>>
>>   arch/arm64/boot/dts/rockchip/rk3399.dtsi | 90
>> ++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
>> b/arch/arm64/boot/dts/rockchip/rk3399.dtsi index 32aebc8..53ac651 100644
>> --- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
>> +++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
>> @@ -200,6 +200,26 @@
>>   		};
>>   	};
>>
>> +	gmac: eth@fe300000 {
>> +		compatible = "rockchip,rk3399-gmac";
>> +		reg = <0x0 0xfe300000 0x0 0x10000>;
>> +		rockchip,grf = <&grf>;
> should move below the reset-names .

Done.

>
>> +		interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
>> +		interrupt-names = "macirq";
>> +		clocks = <&cru SCLK_MAC>, <&cru SCLK_MAC_RX>,
>> +			 <&cru SCLK_MAC_TX>, <&cru SCLK_MACREF>,
>> +			 <&cru SCLK_MACREF_OUT>, <&cru ACLK_GMAC>,
>> +			 <&cru PCLK_GMAC>;
>> +		clock-names = "stmmaceth", "mac_clk_rx",
>> +			      "mac_clk_tx", "clk_mac_ref",
>> +			      "clk_mac_refout", "aclk_mac",
>> +			      "pclk_mac";
>> +		resets = <&cru SRST_A_GMAC>;
>> +		reset-names = "stmmaceth";
>> +		power-domains = <&power RK3399_PD_GMAC>;
> The driver core should handle regular power-domain handling on device creation
> already, right? So I should be able to apply patches 3 and 4 even without the
> dwmac patches, right?

Yup,  the patches 3 and 4 needn't depand on the dwmac driver.

>
> Also if resending please move power-domains above resets

Done.

-
Caesar
>
>
> Heiko
>
> _______________________________________________
> Linux-rockchip mailing list
> Linux-rockchip@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-rockchip


[-- Attachment #2: Type: text/html, Size: 3427 bytes --]

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

end of thread, other threads:[~2016-08-31  6:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-30 20:30 [PATCH 0/4] Support the rk3399 gmac pd function Caesar Wang
2016-08-30 20:30 ` [PATCH 3/4] arm64: dts: rockchip: support gmac for rk3399 Caesar Wang
     [not found]   ` <1472589008-7713-4-git-send-email-wxt-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2016-08-30 22:07     ` Heiko Stübner
2016-08-31  6:19       ` Caesar Wang
     [not found] ` <1472589008-7713-1-git-send-email-wxt-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2016-08-30 20:30   ` [PATCH 4/4] arm64: dts: rockchip: enable the gmac for rk3399 evb board Caesar Wang

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).