From owner-dev-commits-src-all@freebsd.org Tue Aug 3 10:08:05 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 62E4A63537D; Tue, 3 Aug 2021 10:08:05 +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 4Gf9YK0vBqz3Ppn; Tue, 3 Aug 2021 10:08:05 +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 C173710EFF; Tue, 3 Aug 2021 10:08:04 +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 173A84U4096695; Tue, 3 Aug 2021 10:08:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 173A84BG096694; Tue, 3 Aug 2021 10:08:04 GMT (envelope-from git) Date: Tue, 3 Aug 2021 10:08:04 GMT Message-Id: <202108031008.173A84BG096694@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marcin Wojtas Subject: git: dfcaa2c18bf9 - main - enetc_mdio: Support building the driver as a loadable module. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mw X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dfcaa2c18bf9c69b94d531364f8913b23f19505f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Aug 2021 10:08:05 -0000 The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=dfcaa2c18bf9c69b94d531364f8913b23f19505f commit dfcaa2c18bf9c69b94d531364f8913b23f19505f Author: Kornel Duleba AuthorDate: 2021-07-28 11:38:53 +0000 Commit: Marcin Wojtas CommitDate: 2021-08-03 10:07:49 +0000 enetc_mdio: Support building the driver as a loadable module. After recent arm64 GENERIC config cleanup the ENETC MDIO in NXP LS1028A SoC should support being loaded as a module. Obtained from: Semihalf Sponsored by: Alstom Group --- sys/conf/files.arm64 | 4 ++-- sys/dev/enetc/enetc_mdio_pci.c | 8 ++++---- sys/dev/etherswitch/felix/felix.c | 2 ++ sys/modules/Makefile | 2 ++ sys/modules/enetc_mdio/Makefile | 8 ++++++++ 5 files changed, 18 insertions(+), 6 deletions(-) diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index bfa03dade1db..5cd1fa396171 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -175,8 +175,8 @@ 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 -dev/enetc/enetc_mdio_pci.c optional enetc pci soc_nxp_ls +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/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 index 0fd540008e57..aac236d1c246 100644 --- a/sys/dev/enetc/enetc_mdio_pci.c +++ b/sys/dev/enetc/enetc_mdio_pci.c @@ -159,7 +159,7 @@ enetc_mdio_pci_detach(device_t dev) sc = device_get_softc(dev); - bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_regs); + bus_release_resource(dev, SYS_RES_MEMORY, PCIR_BAR(0), sc->sc_regs); mtx_destroy(&sc->sc_lock); return (0); @@ -184,8 +184,8 @@ static driver_t enetc_mdio_pci_driver = { static devclass_t enetc_mdio_pci_devclass; -DRIVER_MODULE(enetc_mdio_pci, pci, enetc_mdio_pci_driver, +DRIVER_MODULE(enetc_mdio, pci, enetc_mdio_pci_driver, enetc_mdio_pci_devclass, 0, 0); -DRIVER_MODULE(miibus, enetc_mdio_pci, miibus_driver, miibus_devclass, +DRIVER_MODULE(miibus, enetc_mdio, miibus_driver, miibus_devclass, 0, 0); -MODULE_VERSION(enetc_mdio_pci, 1); +MODULE_VERSION(enetc_mdio, 1); diff --git a/sys/dev/etherswitch/felix/felix.c b/sys/dev/etherswitch/felix/felix.c index 140811807586..1cd1e0e29ca7 100644 --- a/sys/dev/etherswitch/felix/felix.c +++ b/sys/dev/etherswitch/felix/felix.c @@ -138,6 +138,8 @@ MODULE_VERSION(felix, 1); MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, felix, felix_pci_ids, nitems(felix_pci_ids) - 1); +MODULE_DEPEND(felix, enetc_mdio, 1, 1, 1); + static int felix_probe(device_t dev) { diff --git a/sys/modules/Makefile b/sys/modules/Makefile index 0ba139977968..fdaea7fa4ec9 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -112,6 +112,7 @@ SUBDIR= \ ${_em} \ ${_ena} \ ${_enetc} \ + ${_enetc_mdio} \ esp \ ${_et} \ evdev \ @@ -614,6 +615,7 @@ _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 new file mode 100644 index 000000000000..f448fc526705 --- /dev/null +++ b/sys/modules/enetc_mdio/Makefile @@ -0,0 +1,8 @@ +#$FreeBSD$ + +.PATH: ${SRCTOP}/sys/dev/enetc + +KMOD = enetc_mdio +SRCS = enetc_mdio_pci.c enetc_mdio.c + +.include