Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1701747 > unrolled thread
| Started by | David Wu <david.wu@rock-chips.com> |
|---|---|
| First post | 2017-08-02 08:20 +0200 |
| Last post | 2017-08-02 08:30 +0200 |
| Articles | 5 on this page of 25 — 7 participants |
Back to article view | Back to linux.kernel
[PATCH v3 00/11] Add the internal phy support David Wu <david.wu@rock-chips.com> - 2017-08-02 08:20 +0200
[PATCH v3 02/11] multi_v7_defconfig: Make rockchip phy built-in David Wu <david.wu@rock-chips.com> - 2017-08-02 08:20 +0200
[PATCH v3 03/11] arm64: defconfig: Enable CONFIG_ROCKCHIP_PHY David Wu <david.wu@rock-chips.com> - 2017-08-02 08:20 +0200
[PATCH v3 01/11] net: phy: Add rockchip phy driver support David Wu <david.wu@rock-chips.com> - 2017-08-02 08:20 +0200
Re: [PATCH v3 01/11] net: phy: Add rockchip phy driver support Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-08-02 08:30 +0200
Re: [PATCH v3 01/11] net: phy: Add rockchip phy driver support Andrew Lunn <andrew@lunn.ch> - 2017-08-02 15:30 +0200
Re: [PATCH v3 01/11] net: phy: Add rockchip phy driver support "David.Wu" <david.wu@rock-chips.com> - 2017-08-09 09:10 +0200
[PATCH v3 05/11] net: stmmac: dwmac-rk: Add internal phy support David Wu <david.wu@rock-chips.com> - 2017-08-02 08:20 +0200
Re: [PATCH v3 05/11] net: stmmac: dwmac-rk: Add internal phy support Florian Fainelli <f.fainelli@gmail.com> - 2017-08-02 19:40 +0200
Re: [PATCH v3 05/11] net: stmmac: dwmac-rk: Add internal phy support Chen-Yu Tsai <wens@csie.org> - 2017-08-03 13:10 +0200
Re: [PATCH v3 05/11] net: stmmac: dwmac-rk: Add internal phy support Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-08-09 10:50 +0200
Re: [PATCH v3 05/11] net: stmmac: dwmac-rk: Add internal phy support "David.Wu" <david.wu@rock-chips.com> - 2017-08-09 11:40 +0200
Re: [PATCH v3 05/11] net: stmmac: dwmac-rk: Add internal phy support Chen-Yu Tsai <wens@csie.org> - 2017-08-10 04:50 +0200
Re: [PATCH v3 05/11] net: stmmac: dwmac-rk: Add internal phy support "David.Wu" <david.wu@rock-chips.com> - 2017-08-10 09:50 +0200
Re: [PATCH v3 05/11] net: stmmac: dwmac-rk: Add internal phy support Florian Fainelli <f.fainelli@gmail.com> - 2017-08-10 00:50 +0200
Re: [PATCH v3 05/11] net: stmmac: dwmac-rk: Add internal phy support "David.Wu" <david.wu@rock-chips.com> - 2017-08-03 16:10 +0200
[PATCH v3 08/11] ARM: dts: rk322x: Add support internal phy for gmac David Wu <david.wu@rock-chips.com> - 2017-08-02 08:20 +0200
[PATCH v3 04/11] net: stmmac: dwmac-rk: Remove unwanted code for rk3328_set_to_rmii() David Wu <david.wu@rock-chips.com> - 2017-08-02 08:20 +0200
[PATCH v3 07/11] net: stmmac: dwmac-rk: Add internal phy supprot for rk3328 David Wu <david.wu@rock-chips.com> - 2017-08-02 08:20 +0200
[PATCH v3 09/11] ARM: dts: rk3228-evb: Enable the internal phy for gmac David Wu <david.wu@rock-chips.com> - 2017-08-02 08:20 +0200
[PATCH v3 06/11] net: stmmac: dwmac-rk: Add internal phy support for rk3228 David Wu <david.wu@rock-chips.com> - 2017-08-02 08:20 +0200
[PATCH v3 10/11] ARM64: dts: rockchip: Add gmac2phy node support for rk3328 David Wu <david.wu@rock-chips.com> - 2017-08-02 08:30 +0200
Re: [PATCH v3 10/11] ARM64: dts: rockchip: Add gmac2phy node support for rk3328 Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2017-08-02 13:50 +0200
Re: [PATCH v3 10/11] ARM64: dts: rockchip: Add gmac2phy node support for rk3328 Florian Fainelli <f.fainelli@gmail.com> - 2017-08-02 19:50 +0200
[PATCH v3 11/11] ARM64: dts: rockchip: Enable gmac2phy for rk3328-evb David Wu <david.wu@rock-chips.com> - 2017-08-02 08:30 +0200
Page 2 of 2 — ← Prev page 1 [2]
| From | David Wu <david.wu@rock-chips.com> |
|---|---|
| Date | 2017-08-02 08:20 +0200 |
| Subject | [PATCH v3 06/11] net: stmmac: dwmac-rk: Add internal phy support for rk3228 |
| Message-ID | <u9VaG-6at-29@gated-at.bofh.it> |
| In reply to | #1701747 |
There is only one mac controller in rk3228, which could connect to
external phy or internal phy, use the grf_com_mux bit15 to route
external/internal phy.
Signed-off-by: David Wu <david.wu@rock-chips.com>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
index 7b80ab9..74cf0bb 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
@@ -86,6 +86,8 @@ struct rk_priv_data {
#define RK3228_GRF_MAC_CON0 0x0900
#define RK3228_GRF_MAC_CON1 0x0904
+#define RK3228_GRF_CON_MUX 0x50
+
/* RK3228_GRF_MAC_CON0 */
#define RK3228_GMAC_CLK_RX_DL_CFG(val) HIWORD_UPDATE(val, 0x7F, 7)
#define RK3228_GMAC_CLK_TX_DL_CFG(val) HIWORD_UPDATE(val, 0x7F, 0)
@@ -111,6 +113,9 @@ struct rk_priv_data {
#define RK3228_GMAC_RXCLK_DLY_ENABLE GRF_BIT(1)
#define RK3228_GMAC_RXCLK_DLY_DISABLE GRF_CLR_BIT(1)
+/* RK3228_GRF_COM_MUX */
+#define RK3228_GRF_CON_MUX_GMAC_INTERNAL_PHY GRF_BIT(15)
+
static void rk3228_set_to_rgmii(struct rk_priv_data *bsp_priv,
int tx_delay, int rx_delay)
{
@@ -191,11 +196,18 @@ static void rk3228_set_rmii_speed(struct rk_priv_data *bsp_priv, int speed)
dev_err(dev, "unknown speed value for RMII! speed=%d", speed);
}
+static void rk3228_internal_phy_powerup(struct rk_priv_data *priv)
+{
+ regmap_write(priv->grf, RK3228_GRF_CON_MUX,
+ RK3228_GRF_CON_MUX_GMAC_INTERNAL_PHY);
+}
+
static const struct rk_gmac_ops rk3228_ops = {
.set_to_rgmii = rk3228_set_to_rgmii,
.set_to_rmii = rk3228_set_to_rmii,
.set_rgmii_speed = rk3228_set_rgmii_speed,
.set_rmii_speed = rk3228_set_rmii_speed,
+ .internal_phy_powerup = rk3228_internal_phy_powerup,
};
#define RK3288_GRF_SOC_CON1 0x0248
--
1.9.1
[toc] | [prev] | [next] | [standalone]
| From | David Wu <david.wu@rock-chips.com> |
|---|---|
| Date | 2017-08-02 08:30 +0200 |
| Subject | [PATCH v3 10/11] ARM64: dts: rockchip: Add gmac2phy node support for rk3328 |
| Message-ID | <u9Vkl-6dN-1@gated-at.bofh.it> |
| In reply to | #1701747 |
The gmac2phy controller of rk3328 is connected to internal phy
directly inside, add the node for the internal phy support.
Signed-off-by: David Wu <david.wu@rock-chips.com>
---
arch/arm64/boot/dts/rockchip/rk3328.dtsi | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/arch/arm64/boot/dts/rockchip/rk3328.dtsi b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
index 0be96ce..51c8c66 100644
--- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
@@ -63,6 +63,8 @@
i2c1 = &i2c1;
i2c2 = &i2c2;
i2c3 = &i2c3;
+ ethernet0 = &gmac2io;
+ ethernet1 = &gmac2phy;
};
cpus {
@@ -424,6 +426,29 @@
status = "disabled";
};
+ gmac2phy: eth@ff550000 {
+ compatible = "rockchip,rk3328-gmac";
+ reg = <0x0 0xff550000 0x0 0x10000>;
+ rockchip,grf = <&grf>;
+ interrupts = <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "macirq";
+ clocks = <&cru SCLK_MAC2PHY_SRC>, <&cru SCLK_MAC2PHY_RXTX>,
+ <&cru SCLK_MAC2PHY_RXTX>, <&cru SCLK_MAC2PHY_REF>,
+ <&cru ACLK_MAC2PHY>, <&cru PCLK_MAC2PHY>,
+ <&cru SCLK_MAC2PHY_OUT>;
+ clock-names = "stmmaceth", "mac_clk_rx",
+ "mac_clk_tx", "clk_mac_ref",
+ "aclk_mac", "pclk_mac",
+ "clk_macphy";
+ resets = <&cru SRST_GMAC2PHY_A>, <&cru SRST_MACPHY>;
+ reset-names = "stmmaceth", "mac-phy";
+ phy-mode = "rmii";
+ phy-is-internal;
+ pinctrl-names = "default";
+ pinctrl-0 = <&fephyled_rxm1 &fephyled_linkm1>;
+ status = "disabled";
+ };
+
gic: interrupt-controller@ff811000 {
compatible = "arm,gic-400";
#interrupt-cells = <3>;
--
1.9.1
[toc] | [prev] | [next] | [standalone]
| From | Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> |
|---|---|
| Date | 2017-08-02 13:50 +0200 |
| Subject | Re: [PATCH v3 10/11] ARM64: dts: rockchip: Add gmac2phy node support for rk3328 |
| Message-ID | <ua0k1-RL-1@gated-at.bofh.it> |
| In reply to | #1701759 |
Hello!
On 08/02/2017 09:24 AM, David Wu wrote:
> The gmac2phy controller of rk3328 is connected to internal phy
> directly inside, add the node for the internal phy support.
>
> Signed-off-by: David Wu <david.wu@rock-chips.com>
> ---
> arch/arm64/boot/dts/rockchip/rk3328.dtsi | 25 +++++++++++++++++++++++++
> 1 file changed, 25 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/rockchip/rk3328.dtsi b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
> index 0be96ce..51c8c66 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi
> +++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
[...]
> @@ -424,6 +426,29 @@
> status = "disabled";
> };
>
> + gmac2phy: eth@ff550000 {
The standardized name is ethernet@...
[...]
MBR, Sergei
[toc] | [prev] | [next] | [standalone]
| From | Florian Fainelli <f.fainelli@gmail.com> |
|---|---|
| Date | 2017-08-02 19:50 +0200 |
| Subject | Re: [PATCH v3 10/11] ARM64: dts: rockchip: Add gmac2phy node support for rk3328 |
| Message-ID | <ua5Wq-4AY-23@gated-at.bofh.it> |
| In reply to | #1701759 |
On 08/01/2017 11:24 PM, David Wu wrote:
> The gmac2phy controller of rk3328 is connected to internal phy
> directly inside, add the node for the internal phy support.
>
> Signed-off-by: David Wu <david.wu@rock-chips.com>
> ---
> arch/arm64/boot/dts/rockchip/rk3328.dtsi | 25 +++++++++++++++++++++++++
> 1 file changed, 25 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/rockchip/rk3328.dtsi b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
> index 0be96ce..51c8c66 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi
> +++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
> @@ -63,6 +63,8 @@
> i2c1 = &i2c1;
> i2c2 = &i2c2;
> i2c3 = &i2c3;
> + ethernet0 = &gmac2io;
> + ethernet1 = &gmac2phy;
> };
>
> cpus {
> @@ -424,6 +426,29 @@
> status = "disabled";
> };
>
> + gmac2phy: eth@ff550000 {
> + compatible = "rockchip,rk3328-gmac";
> + reg = <0x0 0xff550000 0x0 0x10000>;
> + rockchip,grf = <&grf>;
> + interrupts = <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>;
> + interrupt-names = "macirq";
> + clocks = <&cru SCLK_MAC2PHY_SRC>, <&cru SCLK_MAC2PHY_RXTX>,
> + <&cru SCLK_MAC2PHY_RXTX>, <&cru SCLK_MAC2PHY_REF>,
> + <&cru ACLK_MAC2PHY>, <&cru PCLK_MAC2PHY>,
> + <&cru SCLK_MAC2PHY_OUT>;
> + clock-names = "stmmaceth", "mac_clk_rx",
> + "mac_clk_tx", "clk_mac_ref",
> + "aclk_mac", "pclk_mac",
> + "clk_macphy";
> + resets = <&cru SRST_GMAC2PHY_A>, <&cru SRST_MACPHY>;
> + reset-names = "stmmaceth", "mac-phy";
> + phy-mode = "rmii";
> + phy-is-internal;
> + pinctrl-names = "default";
> + pinctrl-0 = <&fephyled_rxm1 &fephyled_linkm1>;
> + status = "disabled";
But where is the the phy-handle property that points to this internal
PHY? Even if it is internal, it should be described properly with a mdio
bus sub-node and a standard Ethernet PHY node as specified by both
Documentation/devicetree/bindings/net/mdio.txt and
Documentation/devicetree/bindings/net/phy.txt
That means we should at least see something like this (on top of what
you added already)
phy-handle = <&phy0>;
mdio {
compatible = "snps,dwmac-mdio";
#address-cells = <1>;
#size-cells = <0>;
phy@0 {
compatible = "ethernet-phy-id1234.d400", "ethernet-phy-802.3-c22";
reg = <0>;
phy-is-internal;
};
};
> + };
> +
> gic: interrupt-controller@ff811000 {
> compatible = "arm,gic-400";
> #interrupt-cells = <3>;
>
--
Florian
[toc] | [prev] | [next] | [standalone]
| From | David Wu <david.wu@rock-chips.com> |
|---|---|
| Date | 2017-08-02 08:30 +0200 |
| Subject | [PATCH v3 11/11] ARM64: dts: rockchip: Enable gmac2phy for rk3328-evb |
| Message-ID | <u9Vkl-6dN-3@gated-at.bofh.it> |
| In reply to | #1701747 |
Enable the gmac2phy, make the gmac2phy work on
the rk3328-evb board.
Signed-off-by: David Wu <david.wu@rock-chips.com>
---
arch/arm64/boot/dts/rockchip/rk3328-evb.dts | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/arch/arm64/boot/dts/rockchip/rk3328-evb.dts b/arch/arm64/boot/dts/rockchip/rk3328-evb.dts
index cf27239..b9f36da 100644
--- a/arch/arm64/boot/dts/rockchip/rk3328-evb.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3328-evb.dts
@@ -50,6 +50,23 @@
chosen {
stdout-path = "serial2:1500000n8";
};
+
+ vcc_phy: vcc-phy-regulator {
+ compatible = "regulator-fixed";
+ regulator-name = "vcc_phy";
+ regulator-always-on;
+ regulator-boot-on;
+ };
+};
+
+&gmac2phy {
+ phy-supply = <&vcc_phy>;
+ clock_in_out = "output";
+ assigned-clocks = <&cru SCLK_MAC2PHY_SRC>;
+ assigned-clock-rate = <50000000>;
+ assigned-clocks = <&cru SCLK_MAC2PHY>;
+ assigned-clock-parents = <&cru SCLK_MAC2PHY_SRC>;
+ status = "okay";
};
&uart2 {
--
1.9.1
[toc] | [prev] | [standalone]
Page 2 of 2 — ← Prev page 1 [2]
Back to top | Article view | linux.kernel
csiph-web