Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm Handle RGMII variants.



details:   https://anonhg.NetBSD.org/src/rev/01111e3384f9
branches:  trunk
changeset: 1025158:01111e3384f9
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sun Nov 07 19:21:32 2021 +0000

description:
Handle RGMII variants.

diffstat:

 sys/arch/arm/amlogic/meson_dwmac.c |  6 +++---
 sys/arch/arm/rockchip/rk_gmac.c    |  8 ++++----
 sys/arch/arm/sunxi/sunxi_emac.c    |  6 +++---
 sys/arch/arm/sunxi/sunxi_gmac.c    |  6 +++---
 4 files changed, 13 insertions(+), 13 deletions(-)

diffs (117 lines):

diff -r c4e6abd02bf0 -r 01111e3384f9 sys/arch/arm/amlogic/meson_dwmac.c
--- a/sys/arch/arm/amlogic/meson_dwmac.c        Sun Nov 07 19:18:56 2021 +0000
+++ b/sys/arch/arm/amlogic/meson_dwmac.c        Sun Nov 07 19:21:32 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: meson_dwmac.c,v 1.11 2021/01/27 03:10:18 thorpej Exp $ */
+/* $NetBSD: meson_dwmac.c,v 1.12 2021/11/07 19:21:32 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(0, "$NetBSD: meson_dwmac.c,v 1.11 2021/01/27 03:10:18 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: meson_dwmac.c,v 1.12 2021/11/07 19:21:32 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -207,7 +207,7 @@
                phandle_phy = phandle;
        }
 
-       if (strcmp(phy_mode, "rgmii") == 0) {
+       if (strncmp(phy_mode, "rgmii", 5) == 0) {
                meson_dwmac_set_mode_rgmii(phandle, sc->sc_bst, prgeth_bsh, clk_in[0]);
        } else if (strcmp(phy_mode, "rmii") == 0) {
                meson_dwmac_set_mode_rmii(phandle, sc->sc_bst, prgeth_bsh);
diff -r c4e6abd02bf0 -r 01111e3384f9 sys/arch/arm/rockchip/rk_gmac.c
--- a/sys/arch/arm/rockchip/rk_gmac.c   Sun Nov 07 19:18:56 2021 +0000
+++ b/sys/arch/arm/rockchip/rk_gmac.c   Sun Nov 07 19:21:32 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rk_gmac.c,v 1.19 2021/01/27 03:10:19 thorpej Exp $ */
+/* $NetBSD: rk_gmac.c,v 1.20 2021/11/07 19:21:33 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(0, "$NetBSD: rk_gmac.c,v 1.19 2021/01/27 03:10:19 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rk_gmac.c,v 1.20 2021/11/07 19:21:33 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -416,7 +416,7 @@
 
        switch (rk_sc->sc_type) {
        case GMAC_RK3328:
-               if (strcmp(phy_mode, "rgmii") == 0) {
+               if (strncmp(phy_mode, "rgmii", 5) == 0) {
                        rk3328_gmac_set_mode_rgmii(sc, tx_delay, rx_delay,
                            set_delay);
 
@@ -427,7 +427,7 @@
                }
                break;
        case GMAC_RK3399:
-               if (strcmp(phy_mode, "rgmii") == 0) {
+               if (strncmp(phy_mode, "rgmii", 5) == 0) {
                        rk3399_gmac_set_mode_rgmii(sc, tx_delay, rx_delay,
                            set_delay);
 
diff -r c4e6abd02bf0 -r 01111e3384f9 sys/arch/arm/sunxi/sunxi_emac.c
--- a/sys/arch/arm/sunxi/sunxi_emac.c   Sun Nov 07 19:18:56 2021 +0000
+++ b/sys/arch/arm/sunxi/sunxi_emac.c   Sun Nov 07 19:21:32 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_emac.c,v 1.33 2021/01/27 03:10:20 thorpej Exp $ */
+/* $NetBSD: sunxi_emac.c,v 1.34 2021/11/07 19:21:33 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2016-2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -33,7 +33,7 @@
 #include "opt_net_mpsafe.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunxi_emac.c,v 1.33 2021/01/27 03:10:20 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_emac.c,v 1.34 2021/11/07 19:21:33 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -987,7 +987,7 @@
        reg = syscon_read_4(sc->syscon, EMAC_CLK_REG);
 
        reg &= ~(EMAC_CLK_PIT | EMAC_CLK_SRC | EMAC_CLK_RMII_EN);
-       if (strcmp(phy_type, "rgmii") == 0)
+       if (strncmp(phy_type, "rgmii", 5) == 0)
                reg |= EMAC_CLK_PIT_RGMII | EMAC_CLK_SRC_RGMII;
        else if (strcmp(phy_type, "rmii") == 0)
                reg |= EMAC_CLK_RMII_EN;
diff -r c4e6abd02bf0 -r 01111e3384f9 sys/arch/arm/sunxi/sunxi_gmac.c
--- a/sys/arch/arm/sunxi/sunxi_gmac.c   Sun Nov 07 19:18:56 2021 +0000
+++ b/sys/arch/arm/sunxi/sunxi_gmac.c   Sun Nov 07 19:21:32 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_gmac.c,v 1.9 2021/01/27 03:10:20 thorpej Exp $ */
+/* $NetBSD: sunxi_gmac.c,v 1.10 2021/11/07 19:21:33 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_gmac.c,v 1.9 2021/01/27 03:10:20 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_gmac.c,v 1.10 2021/11/07 19:21:33 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -177,7 +177,7 @@
                        aprint_error(": failed to set TX clock rate (MII)\n");
                        return;
                }
-       } else if (strcmp(phy_mode, "rgmii") == 0) {
+       } else if (strncmp(phy_mode, "rgmii", 5) == 0) {
                if (clk_set_rate(clk_gmac_tx, GMAC_TX_RATE_RGMII) != 0) {
                        aprint_error(": failed to set TX clock rate (RGMII)\n");
                        return;



Home | Main Index | Thread Index | Old Index