Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/ti ti: cpsw: adapt to dts-5.15 bindings



details:   https://anonhg.NetBSD.org/src/rev/400dfcf3d10c
branches:  trunk
changeset: 1024864:400dfcf3d10c
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sun Nov 07 17:12:55 2021 +0000

description:
ti: cpsw: adapt to dts-5.15 bindings

diffstat:

 sys/arch/arm/ti/if_cpsw.c |  13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diffs (41 lines):

diff -r 3ca0d7de7d12 -r 400dfcf3d10c sys/arch/arm/ti/if_cpsw.c
--- a/sys/arch/arm/ti/if_cpsw.c Sun Nov 07 17:12:45 2021 +0000
+++ b/sys/arch/arm/ti/if_cpsw.c Sun Nov 07 17:12:55 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_cpsw.c,v 1.14 2021/01/27 03:10:20 thorpej Exp $     */
+/*     $NetBSD: if_cpsw.c,v 1.15 2021/11/07 17:12:55 jmcneill Exp $    */
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -53,7 +53,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: if_cpsw.c,v 1.14 2021/01/27 03:10:20 thorpej Exp $");
+__KERNEL_RCSID(1, "$NetBSD: if_cpsw.c,v 1.15 2021/11/07 17:12:55 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -310,6 +310,7 @@
 }
 
 static const struct device_compatible_entry compat_data[] = {
+       { .compat = "ti,am335x-cpsw-switch" },
        { .compat = "ti,am335x-cpsw" },
        { .compat = "ti,cpsw" },
        DEVICE_COMPAT_EOL
@@ -417,7 +418,13 @@
 
        macaddr = NULL;
        slave = of_find_firstchild_byname(phandle, "slave");
-       if (slave > 0) {
+       if (slave == -1) {
+               slave = of_find_firstchild_byname(phandle, "ethernet-ports");
+               if (slave != -1) {
+                       slave = of_find_firstchild_byname(slave, "port");
+               }
+       }
+       if (slave != -1) {
                macaddr = fdtbus_get_prop(slave, "mac-address", &len);
                if (len != ETHER_ADDR_LEN)
                        macaddr = NULL;



Home | Main Index | Thread Index | Old Index