Discussion:
[PATCH 0/6] net: stmmac: revert "support future possible different internal phy mode"
(too old to reply)
Corentin Labbe
2017-07-02 12:31:53 UTC
Permalink
Raw Message
Hello

The current way to find if the phy is internal is to compare DT phy-mode
and emac_variant/internal_phy.
But it will negate a possible future SoC where an external PHY use the
same phy mode than the internal one.

My first idea was to use phy-mode = "internal" but since internal phy-mode
is reserved for non-xMII protocol we cannot use it with dwmac-sun8i

I will send an additionnal patch for documenting more phy-mode = "internal"

Corentin Labbe (6):
arm: sun8i: nanopi-neo: revert use internal phy-mode
arm: sun8i: orangepi-2: revert "use internal phy-mode"
arm: sun8i: orangepi-one: revert "use internal phy-mode"
arm: sun8i: orangepi-zero: revert "use internal phy-mode"
arm: sun8i: orangepipc: revert "use internal phy-mode"
net: stmmac: revert "support future possible different internal phy
mode"

arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts | 2 +-
arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts | 2 +-
arch/arm/boot/dts/sun8i-h3-orangepi-2.dts | 2 +-
arch/arm/boot/dts/sun8i-h3-orangepi-one.dts | 2 +-
arch/arm/boot/dts/sun8i-h3-orangepi-pc.dts | 2 +-
drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 10 +++-------
6 files changed, 8 insertions(+), 12 deletions(-)
--
2.13.0
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Corentin Labbe
2017-07-02 12:31:54 UTC
Permalink
Raw Message
Since internal phy-mode is reserved for non-xMII protocol we cannot use
it with dwmac-sun8i
This reverts commit bdcc005beac9 ("arm: sun8i: nanopi-neo: use internal phy-mode")

Signed-off-by: Corentin Labbe <***@gmail.com>
---
arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts b/arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts
index 5c5ba806e2f1..78f6c24952dd 100644
--- a/arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts
+++ b/arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts
@@ -49,7 +49,7 @@

&emac {
phy-handle = <&int_mii_phy>;
- phy-mode = "internal";
+ phy-mode = "mii";
allwinner,leds-active-low;
status = "okay";
};
--
2.13.0
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Corentin Labbe
2017-07-02 12:31:55 UTC
Permalink
Raw Message
Since internal phy-mode is reserved for non-xMII protocol we cannot use
it with dwmac-sun8i
This reverts commit 5a79b4f2a5e7 ("arm: sun8i: orangepi-2: use internal phy-mode")

Signed-off-by: Corentin Labbe <***@gmail.com>
---
arch/arm/boot/dts/sun8i-h3-orangepi-2.dts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/sun8i-h3-orangepi-2.dts b/arch/arm/boot/dts/sun8i-h3-orangepi-2.dts
index a2a2b11dfeed..17cdeae19c6f 100644
--- a/arch/arm/boot/dts/sun8i-h3-orangepi-2.dts
+++ b/arch/arm/boot/dts/sun8i-h3-orangepi-2.dts
@@ -120,7 +120,7 @@

&emac {
phy-handle = <&int_mii_phy>;
- phy-mode = "internal";
+ phy-mode = "mii";
allwinner,leds-active-low;
status = "okay";
};
--
2.13.0
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Corentin Labbe
2017-07-02 12:31:56 UTC
Permalink
Raw Message
Since internal phy-mode is reserved for non-xMII protocol we cannot use
it with dwmac-sun8i
This reverts commit 4ac57180eab2 ("arm: sun8i: orangepi-one: use internal phy-mode")

Signed-off-by: Corentin Labbe <***@gmail.com>
---
arch/arm/boot/dts/sun8i-h3-orangepi-one.dts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/sun8i-h3-orangepi-one.dts b/arch/arm/boot/dts/sun8i-h3-orangepi-one.dts
index 27e7ef4e42f2..6880268e8b87 100644
--- a/arch/arm/boot/dts/sun8i-h3-orangepi-one.dts
+++ b/arch/arm/boot/dts/sun8i-h3-orangepi-one.dts
@@ -100,7 +100,7 @@

&emac {
phy-handle = <&int_mii_phy>;
- phy-mode = "internal";
+ phy-mode = "mii";
allwinner,leds-active-low;
status = "okay";
};
--
2.13.0
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Corentin Labbe
2017-07-02 12:31:58 UTC
Permalink
Raw Message
Since internal phy-mode is reserved for non-xMII protocol we cannot use
it with dwmac-sun8i
This reverts commit 3432a86e641c ("arm: sun8i: orangepipc: use internal phy-mode")

Signed-off-by: Corentin Labbe <***@gmail.com>
---
arch/arm/boot/dts/sun8i-h3-orangepi-pc.dts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/sun8i-h3-orangepi-pc.dts b/arch/arm/boot/dts/sun8i-h3-orangepi-pc.dts
index 94edeb889e55..f5f0f15a2088 100644
--- a/arch/arm/boot/dts/sun8i-h3-orangepi-pc.dts
+++ b/arch/arm/boot/dts/sun8i-h3-orangepi-pc.dts
@@ -120,7 +120,7 @@

&emac {
phy-handle = <&int_mii_phy>;
- phy-mode = "internal";
+ phy-mode = "mii";
allwinner,leds-active-low;
status = "okay";
};
--
2.13.0
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Corentin Labbe
2017-07-02 12:31:57 UTC
Permalink
Raw Message
Since internal phy-mode is reserved for non-xMII protocol we cannot use
it with dwmac-sun8i
This reverts commit 6066de6848d4 ("arm: sun8i: orangepi-zero: use internal phy-mode")

Signed-off-by: Corentin Labbe <***@gmail.com>
---
arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts b/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts
index 7c154b845baa..6713d0f2b3f4 100644
--- a/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts
+++ b/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts
@@ -106,7 +106,7 @@

&emac {
phy-handle = <&int_mii_phy>;
- phy-mode = "internal";
+ phy-mode = "mii";
allwinner,leds-active-low;
status = "okay";
};
--
2.13.0
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Corentin Labbe
2017-07-02 12:31:59 UTC
Permalink
Raw Message
Since internal phy-mode is reserved for non-xMII protocol we cannot use
it with dwmac-sun8i
This reverts commit 1c2fa5f84683 ("net: stmmac: support future possible different internal phy mode")

Signed-off-by: Corentin Labbe <***@gmail.com>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
index 6c2d1da05588..fffd6d5fc907 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
@@ -638,7 +638,7 @@ static int sun8i_dwmac_set_syscon(struct stmmac_priv *priv)
{
struct sunxi_priv_data *gmac = priv->plat->bsp_priv;
struct device_node *node = priv->device->of_node;
- int ret, phy_interface;
+ int ret;
u32 reg, val;

regmap_read(gmac->regmap, SYSCON_EMAC_REG, &val);
@@ -718,11 +718,7 @@ static int sun8i_dwmac_set_syscon(struct stmmac_priv *priv)
if (gmac->variant->support_rmii)
reg &= ~SYSCON_RMII_EN;

- phy_interface = priv->plat->interface;
- /* if PHY is internal, select the mode (xMII) used by the SoC */
- if (gmac->use_internal_phy)
- phy_interface = gmac->variant->internal_phy;
- switch (phy_interface) {
+ switch (priv->plat->interface) {
case PHY_INTERFACE_MODE_MII:
/* default */
break;
@@ -936,7 +932,7 @@ static int sun8i_dwmac_probe(struct platform_device *pdev)
}

plat_dat->interface = of_get_phy_mode(dev->of_node);
- if (plat_dat->interface == PHY_INTERFACE_MODE_INTERNAL) {
+ if (plat_dat->interface == gmac->variant->internal_phy) {
dev_info(&pdev->dev, "Will use internal PHY\n");
gmac->use_internal_phy = true;
gmac->ephy_clk = of_clk_get(plat_dat->phy_node, 0);
--
2.13.0
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Corentin Labbe
2017-07-06 08:51:47 UTC
Permalink
Raw Message
Post by Corentin Labbe
Since internal phy-mode is reserved for non-xMII protocol we cannot use
it with dwmac-sun8i
This reverts commit 1c2fa5f84683 ("net: stmmac: support future possible different internal phy mode")
---
Hello

This patch was left not applied but all other patch from this serie was.
Could you apply it, or perhaps you prefer I resend it with some "Fixes:"

Regards
Corentin Labbe
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
David Miller
2017-07-06 09:45:14 UTC
Permalink
Raw Message
From: Corentin Labbe <***@gmail.com>
Date: Thu, 6 Jul 2017 10:51:47 +0200
Post by Corentin Labbe
Post by Corentin Labbe
Since internal phy-mode is reserved for non-xMII protocol we cannot use
it with dwmac-sun8i
This reverts commit 1c2fa5f84683 ("net: stmmac: support future possible different internal phy mode")
---
Hello
This patch was left not applied but all other patch from this serie was.
Could you apply it, or perhaps you prefer I resend it with some "Fixes:"
You never need to ask questions like this.

If it's not active in my patchwork queue, you must resend.

Thank you.
Chen-Yu Tsai
2017-07-06 10:37:59 UTC
Permalink
Raw Message
Hi Corentin,
Post by David Miller
Date: Thu, 6 Jul 2017 10:51:47 +0200
Post by Corentin Labbe
Post by Corentin Labbe
Since internal phy-mode is reserved for non-xMII protocol we cannot use
it with dwmac-sun8i
This reverts commit 1c2fa5f84683 ("net: stmmac: support future possible different internal phy mode")
---
Hello
This patch was left not applied but all other patch from this serie was.
Could you apply it, or perhaps you prefer I resend it with some "Fixes:"
You never need to ask questions like this.
If it's not active in my patchwork queue, you must resend.
Thank you.
Your series was not applied at all. See the status on patchwork:

http://patchwork.ozlabs.org/patch/783179/

Maxime's patch to revert all device tree changes in net-next was
applied first.

Please rebase and resend this patch for netdev (not net-next).

ChenYu
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...