summaryrefslogtreecommitdiff
path: root/sys/arch/armv7
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2018-12-24 08:45:58 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2018-12-24 08:45:58 +0000
commit37cf98bea1bea9519d91624f79f752b48dfafefe (patch)
tree6c54ef5c54ca827de93564764dcfedefd6824c70 /sys/arch/armv7
parent1cd2a5ebd468d8807810d426f8271c3acf48449b (diff)
Adjust cpsw for linux 4.20 device tree changes. The location of the phy
is now found via phy-handle instead of phy_id.
Diffstat (limited to 'sys/arch/armv7')
-rw-r--r--sys/arch/armv7/omap/if_cpsw.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/arch/armv7/omap/if_cpsw.c b/sys/arch/armv7/omap/if_cpsw.c
index 2813e11cca0..b3868754419 100644
--- a/sys/arch/armv7/omap/if_cpsw.c
+++ b/sys/arch/armv7/omap/if_cpsw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_cpsw.c,v 1.43 2017/04/30 16:45:45 mpi Exp $ */
+/* $OpenBSD: if_cpsw.c,v 1.44 2018/12/24 08:45:57 jsg Exp $ */
/* $NetBSD: if_cpsw.c,v 1.3 2013/04/17 14:36:34 bouyer Exp $ */
/*
@@ -1285,7 +1285,7 @@ cpsw_get_port_config(struct cpsw_port_config *conf, int pnode)
{
char mode[32];
uint32_t phy_id[2];
- int node;
+ int node, phy_handle, phy_node;
int port = 0;
for (node = OF_child(pnode); node; node = OF_peer(node)) {
@@ -1298,6 +1298,13 @@ cpsw_get_port_config(struct cpsw_port_config *conf, int pnode)
if (OF_getpropintarray(node, "phy_id", phy_id,
sizeof(phy_id)) == sizeof(phy_id))
conf[port].phy_id = phy_id[1];
+ else if ((phy_handle =
+ OF_getpropint(node, "phy-handle", 0)) != 0) {
+ phy_node = OF_getnodebyphandle(phy_handle);
+ if (phy_node)
+ conf[port].phy_id = OF_getpropint(phy_node,
+ "reg", MII_PHY_ANY);
+ }
if (OF_getprop(node, "phy-mode", mode, sizeof(mode)) > 0 &&
!strcmp(mode, "rgmii"))