* [PATCH v1 0/2] ARM EXYNOS5 & net: add fixed phy support
@ 2015-01-26 2:37 ` Ming Lei
0 siblings, 0 replies; 8+ messages in thread
From: Ming Lei @ 2015-01-26 2:37 UTC (permalink / raw)
To: linux-arm-kernel, David S. Miller
Cc: linux-samsung-soc, Kukjin Kim, netdev, Byungho An, Florian Fainelli
Hi,
These two patches adds fixed phy support using the fixed-link DT binding
for stmmac.
v1:
- bypassing check on phy id for fixed phy (patch 2/2)
Thanks,
Ming Lei
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v1 0/2] ARM EXYNOS5 & net: add fixed phy support
@ 2015-01-26 2:37 ` Ming Lei
0 siblings, 0 replies; 8+ messages in thread
From: Ming Lei @ 2015-01-26 2:37 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
These two patches adds fixed phy support using the fixed-link DT binding
for stmmac.
v1:
- bypassing check on phy id for fixed phy (patch 2/2)
Thanks,
Ming Lei
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v1 1/2] ARM: exynos5440-sd5v1: switch to fixed-link DT binding
2015-01-26 2:37 ` Ming Lei
@ 2015-01-26 2:37 ` Ming Lei
-1 siblings, 0 replies; 8+ messages in thread
From: Ming Lei @ 2015-01-26 2:37 UTC (permalink / raw)
To: linux-arm-kernel, David S. Miller
Cc: linux-samsung-soc, Kukjin Kim, netdev, Byungho An,
Florian Fainelli, Ming Lei
The previous dts property isn't standard way for fixed phy
support, and switch to the fixed-link DT binding.
Signed-off-by: Ming Lei <ming.lei@canonical.com>
---
arch/arm/boot/dts/exynos5440-sd5v1.dts | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/dts/exynos5440-sd5v1.dts b/arch/arm/boot/dts/exynos5440-sd5v1.dts
index 268609a..ee65a5c 100644
--- a/arch/arm/boot/dts/exynos5440-sd5v1.dts
+++ b/arch/arm/boot/dts/exynos5440-sd5v1.dts
@@ -28,8 +28,10 @@
};
gmac: ethernet@00230000 {
- fixed_phy;
- phy_addr = <1>;
+ fixed-link {
+ speed = <1000>;
+ full-duplex;
+ };
};
spi {
--
1.7.9.5
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v1 1/2] ARM: exynos5440-sd5v1: switch to fixed-link DT binding
@ 2015-01-26 2:37 ` Ming Lei
0 siblings, 0 replies; 8+ messages in thread
From: Ming Lei @ 2015-01-26 2:37 UTC (permalink / raw)
To: linux-arm-kernel
The previous dts property isn't standard way for fixed phy
support, and switch to the fixed-link DT binding.
Signed-off-by: Ming Lei <ming.lei@canonical.com>
---
arch/arm/boot/dts/exynos5440-sd5v1.dts | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/dts/exynos5440-sd5v1.dts b/arch/arm/boot/dts/exynos5440-sd5v1.dts
index 268609a..ee65a5c 100644
--- a/arch/arm/boot/dts/exynos5440-sd5v1.dts
+++ b/arch/arm/boot/dts/exynos5440-sd5v1.dts
@@ -28,8 +28,10 @@
};
gmac: ethernet at 00230000 {
- fixed_phy;
- phy_addr = <1>;
+ fixed-link {
+ speed = <1000>;
+ full-duplex;
+ };
};
spi {
--
1.7.9.5
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v1 2/2] net: stmmac: add fixed_phy support via fixed-link DT binding
2015-01-26 2:37 ` Ming Lei
@ 2015-01-26 2:37 ` Ming Lei
-1 siblings, 0 replies; 8+ messages in thread
From: Ming Lei @ 2015-01-26 2:37 UTC (permalink / raw)
To: linux-arm-kernel, David S. Miller
Cc: linux-samsung-soc, Kukjin Kim, netdev, Byungho An,
Florian Fainelli, Ming Lei
Signed-off-by: Ming Lei <ming.lei@canonical.com>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 5 ++++-
.../net/ethernet/stmicro/stmmac/stmmac_platform.c | 10 ++++++++++
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 8c6b7c16..ddb4351 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -847,8 +847,11 @@ static int stmmac_init_phy(struct net_device *dev)
* 0 rather than 0xffff. Catch this here and treat 0 as a non-existent
* device as well.
* Note: phydev->phy_id is the result of reading the UID PHY registers.
+ * But phy_id returned from fixed phy is always zero, so bypass the
+ * check for fixed phy.
*/
- if (phydev->phy_id == 0) {
+ if (phydev->phy_id == 0 && (!priv->plat->phy_bus_name ||
+ strcmp(priv->plat->phy_bus_name,"fixed"))) {
phy_disconnect(phydev);
return -ENODEV;
}
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 3039de2..73a3ced 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -27,6 +27,7 @@
#include <linux/of.h>
#include <linux/of_net.h>
#include <linux/of_device.h>
+#include <linux/of_mdio.h>
#include "stmmac.h"
#include "stmmac_platform.h"
@@ -216,6 +217,15 @@ static int stmmac_probe_config_dt(struct platform_device *pdev,
plat->pmt = 1;
}
+ if (of_phy_is_fixed_link(np)) {
+ int ret = of_phy_register_fixed_link(np);
+ if (ret) {
+ dev_err(&pdev->dev, "failed to register fixed PHY\n");
+ return ret;
+ }
+ plat->phy_bus_name = "fixed";
+ }
+
if (of_device_is_compatible(np, "snps,dwmac-3.610") ||
of_device_is_compatible(np, "snps,dwmac-3.710")) {
plat->enh_desc = 1;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v1 2/2] net: stmmac: add fixed_phy support via fixed-link DT binding
@ 2015-01-26 2:37 ` Ming Lei
0 siblings, 0 replies; 8+ messages in thread
From: Ming Lei @ 2015-01-26 2:37 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Ming Lei <ming.lei@canonical.com>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 5 ++++-
.../net/ethernet/stmicro/stmmac/stmmac_platform.c | 10 ++++++++++
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 8c6b7c16..ddb4351 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -847,8 +847,11 @@ static int stmmac_init_phy(struct net_device *dev)
* 0 rather than 0xffff. Catch this here and treat 0 as a non-existent
* device as well.
* Note: phydev->phy_id is the result of reading the UID PHY registers.
+ * But phy_id returned from fixed phy is always zero, so bypass the
+ * check for fixed phy.
*/
- if (phydev->phy_id == 0) {
+ if (phydev->phy_id == 0 && (!priv->plat->phy_bus_name ||
+ strcmp(priv->plat->phy_bus_name,"fixed"))) {
phy_disconnect(phydev);
return -ENODEV;
}
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 3039de2..73a3ced 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -27,6 +27,7 @@
#include <linux/of.h>
#include <linux/of_net.h>
#include <linux/of_device.h>
+#include <linux/of_mdio.h>
#include "stmmac.h"
#include "stmmac_platform.h"
@@ -216,6 +217,15 @@ static int stmmac_probe_config_dt(struct platform_device *pdev,
plat->pmt = 1;
}
+ if (of_phy_is_fixed_link(np)) {
+ int ret = of_phy_register_fixed_link(np);
+ if (ret) {
+ dev_err(&pdev->dev, "failed to register fixed PHY\n");
+ return ret;
+ }
+ plat->phy_bus_name = "fixed";
+ }
+
if (of_device_is_compatible(np, "snps,dwmac-3.610") ||
of_device_is_compatible(np, "snps,dwmac-3.710")) {
plat->enh_desc = 1;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v1 2/2] net: stmmac: add fixed_phy support via fixed-link DT binding
2015-01-26 2:37 ` Ming Lei
@ 2015-01-26 3:01 ` Andreas Färber
-1 siblings, 0 replies; 8+ messages in thread
From: Andreas Färber @ 2015-01-26 3:01 UTC (permalink / raw)
To: Ming Lei, linux-arm-kernel, David S. Miller
Cc: linux-samsung-soc, Kukjin Kim, netdev, Byungho An, Florian Fainelli
[-- Attachment #1: Type: text/plain, Size: 1152 bytes --]
Am 26.01.2015 um 03:37 schrieb Ming Lei:
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index 8c6b7c16..ddb4351 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -847,8 +847,11 @@ static int stmmac_init_phy(struct net_device *dev)
> * 0 rather than 0xffff. Catch this here and treat 0 as a non-existent
> * device as well.
> * Note: phydev->phy_id is the result of reading the UID PHY registers.
> + * But phy_id returned from fixed phy is always zero, so bypass the
> + * check for fixed phy.
> */
> - if (phydev->phy_id == 0) {
> + if (phydev->phy_id == 0 && (!priv->plat->phy_bus_name ||
> + strcmp(priv->plat->phy_bus_name,"fixed"))) {
Small nit here: There's a space missing between the arguments.
Cheers,
Andreas
> phy_disconnect(phydev);
> return -ENODEV;
> }
[snip]
--
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Jennifer Guild, Dilip Upmanyu,
Graham Norton; HRB 21284 (AG Nürnberg)
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v1 2/2] net: stmmac: add fixed_phy support via fixed-link DT binding
@ 2015-01-26 3:01 ` Andreas Färber
0 siblings, 0 replies; 8+ messages in thread
From: Andreas Färber @ 2015-01-26 3:01 UTC (permalink / raw)
To: linux-arm-kernel
Am 26.01.2015 um 03:37 schrieb Ming Lei:
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index 8c6b7c16..ddb4351 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -847,8 +847,11 @@ static int stmmac_init_phy(struct net_device *dev)
> * 0 rather than 0xffff. Catch this here and treat 0 as a non-existent
> * device as well.
> * Note: phydev->phy_id is the result of reading the UID PHY registers.
> + * But phy_id returned from fixed phy is always zero, so bypass the
> + * check for fixed phy.
> */
> - if (phydev->phy_id == 0) {
> + if (phydev->phy_id == 0 && (!priv->plat->phy_bus_name ||
> + strcmp(priv->plat->phy_bus_name,"fixed"))) {
Small nit here: There's a space missing between the arguments.
Cheers,
Andreas
> phy_disconnect(phydev);
> return -ENODEV;
> }
[snip]
--
SUSE Linux GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany
GF: Felix Imend?rffer, Jane Smithard, Jennifer Guild, Dilip Upmanyu,
Graham Norton; HRB 21284 (AG N?rnberg)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150126/4315fdde/attachment.sig>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2015-01-26 3:01 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-26 2:37 [PATCH v1 0/2] ARM EXYNOS5 & net: add fixed phy support Ming Lei
2015-01-26 2:37 ` Ming Lei
2015-01-26 2:37 ` [PATCH v1 1/2] ARM: exynos5440-sd5v1: switch to fixed-link DT binding Ming Lei
2015-01-26 2:37 ` Ming Lei
2015-01-26 2:37 ` [PATCH v1 2/2] net: stmmac: add fixed_phy support via " Ming Lei
2015-01-26 2:37 ` Ming Lei
2015-01-26 3:01 ` Andreas Färber
2015-01-26 3:01 ` Andreas Färber
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.