From nobody Fri Oct 29 08:31:42 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A47DF1826663; Fri, 29 Oct 2021 08:31:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HgbHz28RYz4SVj; Fri, 29 Oct 2021 08:31:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BBA1813F79; Fri, 29 Oct 2021 08:31:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19T8VgRf073824; Fri, 29 Oct 2021 08:31:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19T8Vgn1073823; Fri, 29 Oct 2021 08:31:42 GMT (envelope-from git) Date: Fri, 29 Oct 2021 08:31:42 GMT Message-Id: <202110290831.19T8Vgn1073823@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wojciech Macek Subject: git: 8c5fead10590 - main - Remove enetc_mdio driver List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wma X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8c5fead105905ffb8cdcf255c08a63ee440b223e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by wma: URL: https://cgit.FreeBSD.org/src/commit/?id=8c5fead105905ffb8cdcf255c08a63ee440b223e commit 8c5fead105905ffb8cdcf255c08a63ee440b223e Author: Kornel Duleba AuthorDate: 2021-10-26 08:41:09 +0000 Commit: Wojciech Macek CommitDate: 2021-10-29 08:08:26 +0000 Remove enetc_mdio driver It was previously used by felix(4) for PHY communication. Since that is not the case anymore this driver is now left unused. Obtained from: Semihalf Sponsored by: Alstom Group --- sys/conf/files.arm64 | 3 +- sys/dev/enetc/enetc_mdio_pci.c | 191 ---------------------------------------- sys/modules/Makefile | 2 - sys/modules/enetc_mdio/Makefile | 8 -- 4 files changed, 1 insertion(+), 203 deletions(-) diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index 3a41554eaea7..2d98568b3d9f 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -176,8 +176,7 @@ dev/cpufreq/cpufreq_dt.c optional cpufreq fdt dev/dwc/if_dwc.c optional fdt dwc_rk soc_rockchip_rk3328 | fdt dwc_rk soc_rockchip_rk3399 | fdt dwc_socfpga soc_intel_stratix10 dev/dwc/if_dwc_if.m optional fdt dwc_rk soc_rockchip_rk3328 | fdt dwc_rk soc_rockchip_rk3399 | fdt dwc_socfpga soc_intel_stratix10 -dev/enetc/enetc_mdio.c optional enetc soc_nxp_ls | enetc_mdio soc_nxp_ls -dev/enetc/enetc_mdio_pci.c optional enetc_mdio pci soc_nxp_ls +dev/enetc/enetc_mdio.c optional enetc soc_nxp_ls dev/enetc/if_enetc.c optional enetc iflib pci fdt soc_nxp_ls dev/etherswitch/felix/felix.c optional enetc etherswitch fdt felix pci soc_nxp_ls diff --git a/sys/dev/enetc/enetc_mdio_pci.c b/sys/dev/enetc/enetc_mdio_pci.c deleted file mode 100644 index 517efa9b9598..000000000000 --- a/sys/dev/enetc/enetc_mdio_pci.c +++ /dev/null @@ -1,191 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2021 Alstom Group. - * Copyright (c) 2021 Semihalf. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "miibus_if.h" - -#define ENETC_MDIO_DEV_ID 0xee01 -#define ENETC_MDIO_DEV_NAME "FSL PCIe IE Central MDIO" - -static struct entec_mdio_pci_id { - uint16_t vendor; - uint16_t device; - const char *desc; -} enetc_mdio_pci_ids[] = { - {PCI_VENDOR_FREESCALE, ENETC_MDIO_DEV_ID, ENETC_MDIO_DEV_NAME}, -}; -MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, enetc_mdio_pci, - enetc_mdio_pci_ids, nitems(enetc_mdio_pci_ids)); - -struct enetc_mdio_pci_softc { - device_t sc_dev; - struct mtx sc_lock; - struct resource *sc_regs; -}; - -static device_attach_t enetc_mdio_pci_attach; -static device_detach_t enetc_mdio_pci_detach; -static device_probe_t enetc_mdio_pci_probe; - -static int -enetc_mdio_pci_readreg(device_t dev, int phy, int reg) -{ - struct enetc_mdio_pci_softc *sc; - uint32_t ret; - - sc = device_get_softc(dev); - - mtx_lock(&sc->sc_lock); - ret = enetc_mdio_read(sc->sc_regs, ENETC_EMDIO_BASE, phy, reg); - mtx_unlock(&sc->sc_lock); - - return (ret); -} - -static int -enetc_mdio_pci_writereg(device_t dev, int phy, int reg, int data) -{ - struct enetc_mdio_pci_softc *sc; - int err; - - sc = device_get_softc(dev); - - mtx_lock(&sc->sc_lock); - err = enetc_mdio_write(sc->sc_regs, ENETC_EMDIO_BASE, phy, reg, data); - mtx_unlock(&sc->sc_lock); - if (err != 0) - return (err); - - return (0); -} - -static int -enetc_mdio_pci_probe(device_t dev) -{ - struct entec_mdio_pci_id *id; - - for (id = enetc_mdio_pci_ids; id->vendor != 0; ++id) { - if (pci_get_device(dev) != id->device || - pci_get_vendor(dev) != id->vendor) - continue; - - device_set_desc(dev, id->desc); - - return (BUS_PROBE_DEFAULT); - } - - return (ENXIO); -} - -static int -enetc_mdio_pci_attach(device_t dev) -{ - struct enetc_mdio_pci_softc *sc; - int rid; - - sc = device_get_softc(dev); - sc->sc_dev = dev; - - /* Init locks */ - mtx_init(&sc->sc_lock, device_get_nameunit(dev), "MDIO lock", MTX_DEF); - - rid = PCIR_BAR(0); - sc->sc_regs = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, - RF_ACTIVE); - if (sc->sc_regs == NULL) { - device_printf(dev, "can't allocate resources for PCI MDIO \n"); - return (ENXIO); - } - - OF_device_register_xref(ofw_bus_get_node(dev), dev); - - return (0); -} - -static int -enetc_mdio_pci_detach(device_t dev) -{ - struct enetc_mdio_pci_softc *sc; - - sc = device_get_softc(dev); - - bus_release_resource(dev, SYS_RES_MEMORY, PCIR_BAR(0), sc->sc_regs); - mtx_destroy(&sc->sc_lock); - - return (0); -} - -static device_method_t enetc_mdio_pci_methods[] ={ - DEVMETHOD(device_probe, enetc_mdio_pci_probe), - DEVMETHOD(device_attach, enetc_mdio_pci_attach), - DEVMETHOD(device_detach, enetc_mdio_pci_detach), - - DEVMETHOD(miibus_readreg, enetc_mdio_pci_readreg), - DEVMETHOD(miibus_writereg, enetc_mdio_pci_writereg), - - DEVMETHOD_END -}; - -static driver_t enetc_mdio_pci_driver = { - "enetc_mdio", - enetc_mdio_pci_methods, - sizeof(struct enetc_mdio_pci_softc), -}; - -static devclass_t enetc_mdio_pci_devclass; - -DRIVER_MODULE(enetc_mdio, pci, enetc_mdio_pci_driver, - enetc_mdio_pci_devclass, 0, 0); -DRIVER_MODULE(miibus, enetc_mdio, miibus_driver, miibus_devclass, - 0, 0); -MODULE_VERSION(enetc_mdio, 1); diff --git a/sys/modules/Makefile b/sys/modules/Makefile index 6cfeba3f45a7..724dcb694d97 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -110,7 +110,6 @@ SUBDIR= \ ${_em} \ ${_ena} \ ${_enetc} \ - ${_enetc_mdio} \ esp \ ${_et} \ evdev \ @@ -615,7 +614,6 @@ _armv8crypto= armv8crypto _dwwdt= dwwdt _em= em _enetc= enetc -_enetc_mdio= enetc_mdio _felix= felix _rockchip= rockchip .endif diff --git a/sys/modules/enetc_mdio/Makefile b/sys/modules/enetc_mdio/Makefile deleted file mode 100644 index f448fc526705..000000000000 --- a/sys/modules/enetc_mdio/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -#$FreeBSD$ - -.PATH: ${SRCTOP}/sys/dev/enetc - -KMOD = enetc_mdio -SRCS = enetc_mdio_pci.c enetc_mdio.c - -.include