Date: Fri, 19 Jun 2020 18:34:27 +0000 (UTC) From: Michal Meloun <mmel@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362405 - in head/sys: arm/allwinner arm/amlogic/aml8726 arm64/rockchip dev/altera/dwc dev/dwc Message-ID: <202006191834.05JIYR35068447@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mmel Date: Fri Jun 19 18:34:27 2020 New Revision: 362405 URL: https://svnweb.freebsd.org/changeset/base/362405 Log: Finish renaming in if_dwc. By using DWC TRM terminology, normal descriptor format should be named extended and alternate descriptor format should be named normal. Should not been functional change. MFC after: 4 weeks Modified: head/sys/arm/allwinner/aw_if_dwc.c head/sys/arm/amlogic/aml8726/aml8726_if_dwc.c head/sys/arm64/rockchip/if_dwc_rk.c head/sys/dev/altera/dwc/if_dwc_socfpga.c head/sys/dev/dwc/if_dwc.c head/sys/dev/dwc/if_dwc.h head/sys/dev/dwc/if_dwc_if.m Modified: head/sys/arm/allwinner/aw_if_dwc.c ============================================================================== --- head/sys/arm/allwinner/aw_if_dwc.c Fri Jun 19 18:27:22 2020 (r362404) +++ head/sys/arm/allwinner/aw_if_dwc.c Fri Jun 19 18:34:27 2020 (r362405) @@ -114,7 +114,7 @@ static int a20_if_dwc_mac_type(device_t dev) { - return (DWC_GMAC_ALT_DESC); + return (DWC_GMAC_NORMAL_DESC); } static int Modified: head/sys/arm/amlogic/aml8726/aml8726_if_dwc.c ============================================================================== --- head/sys/arm/amlogic/aml8726/aml8726_if_dwc.c Fri Jun 19 18:27:22 2020 (r362404) +++ head/sys/arm/amlogic/aml8726/aml8726_if_dwc.c Fri Jun 19 18:34:27 2020 (r362405) @@ -66,7 +66,7 @@ static int aml8726_if_dwc_mac_type(device_t dev) { - return (DWC_GMAC_ALT_DESC); + return (DWC_GMAC_NORMAL_DESC); } static int Modified: head/sys/arm64/rockchip/if_dwc_rk.c ============================================================================== --- head/sys/arm64/rockchip/if_dwc_rk.c Fri Jun 19 18:27:22 2020 (r362404) +++ head/sys/arm64/rockchip/if_dwc_rk.c Fri Jun 19 18:34:27 2020 (r362405) @@ -160,7 +160,7 @@ static int if_dwc_rk_mac_type(device_t dev) { - return (DWC_GMAC_ALT_DESC); + return (DWC_GMAC_NORMAL_DESC); } static int Modified: head/sys/dev/altera/dwc/if_dwc_socfpga.c ============================================================================== --- head/sys/dev/altera/dwc/if_dwc_socfpga.c Fri Jun 19 18:27:22 2020 (r362404) +++ head/sys/dev/altera/dwc/if_dwc_socfpga.c Fri Jun 19 18:34:27 2020 (r362405) @@ -74,7 +74,7 @@ static int if_dwc_socfpga_mac_type(device_t dev) { - return (DWC_GMAC); + return (DWC_GMAC_EXT_DESC); } static int Modified: head/sys/dev/dwc/if_dwc.c ============================================================================== --- head/sys/dev/dwc/if_dwc.c Fri Jun 19 18:27:22 2020 (r362404) +++ head/sys/dev/dwc/if_dwc.c Fri Jun 19 18:34:27 2020 (r362405) @@ -249,7 +249,7 @@ dwc_setup_txdesc(struct dwc_softc *sc, int idx, bus_ad flags = 0; --sc->txcount; } else { - if (sc->mactype == DWC_GMAC_ALT_DESC) + if (sc->mactype != DWC_GMAC_EXT_DESC) flags = NTDESC1_TCH | NTDESC1_FS | NTDESC1_LS | NTDESC1_IC; else @@ -259,7 +259,7 @@ dwc_setup_txdesc(struct dwc_softc *sc, int idx, bus_ad } sc->txdesc_ring[idx].addr1 = (uint32_t)(paddr); - if (sc->mactype == DWC_GMAC_ALT_DESC) { + if (sc->mactype != DWC_GMAC_EXT_DESC) { sc->txdesc_ring[idx].desc0 = 0; sc->txdesc_ring[idx].desc1 = flags | len; } else { @@ -537,7 +537,7 @@ dwc_setup_rxdesc(struct dwc_softc *sc, int idx, bus_ad nidx = next_rxidx(sc, idx); sc->rxdesc_ring[idx].addr2 = sc->rxdesc_ring_paddr + (nidx * sizeof(struct dwc_hwdesc)); - if (sc->mactype == DWC_GMAC_ALT_DESC) + if (sc->mactype != DWC_GMAC_EXT_DESC) sc->rxdesc_ring[idx].desc1 = NRDESC1_RCH | RX_MAX_PACKET; else sc->rxdesc_ring[idx].desc1 = ERDESC1_RCH | MCLBYTES; @@ -661,7 +661,7 @@ dwc_hash_maddr(void *arg, struct sockaddr_dl *sdl, u_i crc = ether_crc32_le(LLADDR(sdl), ETHER_ADDR_LEN); /* Take lower 8 bits and reverse it */ val = bitreverse(~crc & 0xff); - if (ctx->sc->mactype == DWC_GMAC_ALT_DESC) + if (ctx->sc->mactype != DWC_GMAC_EXT_DESC) val >>= 2; /* Only need lower 6 bits */ hashreg = (val >> 5); hashbit = (val & 31); @@ -682,7 +682,7 @@ dwc_setup_rxfilter(struct dwc_softc *sc) DWC_ASSERT_LOCKED(sc); ifp = sc->ifp; - nhash = sc->mactype == DWC_GMAC_ALT_DESC ? 2 : 8; + nhash = sc->mactype != DWC_GMAC_EXT_DESC ? 2 : 8; /* * Set the multicast (group) filter hash. @@ -715,7 +715,7 @@ dwc_setup_rxfilter(struct dwc_softc *sc) WRITE4(sc, MAC_ADDRESS_LOW(0), lo); WRITE4(sc, MAC_ADDRESS_HIGH(0), hi); WRITE4(sc, MAC_FRAME_FILTER, ffval); - if (sc->mactype == DWC_GMAC_ALT_DESC) { + if (sc->mactype != DWC_GMAC_EXT_DESC) { WRITE4(sc, GMAC_MAC_HTLOW, ctx.hash[0]); WRITE4(sc, GMAC_MAC_HTHIGH, ctx.hash[1]); } else { @@ -1260,7 +1260,7 @@ dwc_attach(device_t dev) return (ENXIO); } - if (sc->mactype == DWC_GMAC_ALT_DESC) { + if (sc->mactype != DWC_GMAC_EXT_DESC) { reg = BUS_MODE_FIXEDBURST; reg |= (BUS_MODE_PRIORXTX_41 << BUS_MODE_PRIORXTX_SHIFT); } else Modified: head/sys/dev/dwc/if_dwc.h ============================================================================== --- head/sys/dev/dwc/if_dwc.h Fri Jun 19 18:27:22 2020 (r362404) +++ head/sys/dev/dwc/if_dwc.h Fri Jun 19 18:34:27 2020 (r362405) @@ -272,8 +272,9 @@ #define CURRENT_HOST_RECEIVE_BUF_ADDR 0x1054 #define HW_FEATURE 0x1058 -#define DWC_GMAC 0x1 -#define DWC_GMAC_ALT_DESC 0x2 +#define DWC_GMAC_NORMAL_DESC 0x1 +#define DWC_GMAC_EXT_DESC 0x2 + #define GMAC_MII_CLK_60_100M_DIV42 0x0 #define GMAC_MII_CLK_100_150M_DIV62 0x1 #define GMAC_MII_CLK_25_35M_DIV16 0x2 Modified: head/sys/dev/dwc/if_dwc_if.m ============================================================================== --- head/sys/dev/dwc/if_dwc_if.m Fri Jun 19 18:27:22 2020 (r362404) +++ head/sys/dev/dwc/if_dwc_if.m Fri Jun 19 18:34:27 2020 (r362405) @@ -41,7 +41,7 @@ CODE { static int if_dwc_default_mac_type(device_t dev) { - return (DWC_GMAC); + return (DWC_GMAC_EXT_DESC); } static int
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202006191834.05JIYR35068447>