git: 950a6087ec18 - main - phy: Move phy code in dev/phy

From: Emmanuel Vadot <manu_at_FreeBSD.org>
Date: Wed, 10 Jan 2024 18:21:12 UTC
The branch main has been updated by manu:

URL: https://cgit.FreeBSD.org/src/commit/?id=950a6087ec18cd22464b3297573f54a6d9223c99

commit 950a6087ec18cd22464b3297573f54a6d9223c99
Author:     Emmanuel Vadot <manu@FreeBSD.org>
AuthorDate: 2023-12-26 17:56:52 +0000
Commit:     Emmanuel Vadot <manu@FreeBSD.org>
CommitDate: 2024-01-10 18:20:34 +0000

    phy: Move phy code in dev/phy
    
    We've removed kernel option EXT_RESOURCES almost two years ago.
    While it was ok to have some code under a common 'extres' subdirectory
    at first, we now have a lot of consumer of it and we made it mandatory
    so no need to have it under a cryptic name.
    
    Reviewed by:    emaste, imp
    Sponsored by:   Beckhoff Automation GmbH & Co. KG
    Differential Revision:  https://reviews.freebsd.org/D43195
---
 sys/arm/allwinner/aw_usb3phy.c                  |  2 +-
 sys/arm/allwinner/aw_usbphy.c                   |  2 +-
 sys/arm/nvidia/tegra124/tegra124_xusbpadctl.c   |  2 +-
 sys/arm/nvidia/tegra_ahci.c                     |  2 +-
 sys/arm/nvidia/tegra_ehci.c                     |  2 +-
 sys/arm/nvidia/tegra_pcie.c                     |  2 +-
 sys/arm/nvidia/tegra_usbphy.c                   |  2 +-
 sys/arm/nvidia/tegra_xhci.c                     |  2 +-
 sys/arm/qualcomm/ipq4018_usb_hs_phy.c           |  2 +-
 sys/arm/qualcomm/ipq4018_usb_ss_phy.c           |  2 +-
 sys/arm/ti/am335x/am335x_usb_phy.c              |  2 +-
 sys/arm64/nvidia/tegra210/tegra210_xusbpadctl.c |  2 +-
 sys/arm64/rockchip/rk3399_emmcphy.c             |  2 +-
 sys/arm64/rockchip/rk3568_combphy.c             |  2 +-
 sys/arm64/rockchip/rk3568_pcie.c                |  2 +-
 sys/arm64/rockchip/rk3568_pciephy.c             |  2 +-
 sys/arm64/rockchip/rk_pcie.c                    |  2 +-
 sys/arm64/rockchip/rk_pcie_phy.c                |  4 ++--
 sys/arm64/rockchip/rk_typec_phy.c               |  2 +-
 sys/arm64/rockchip/rk_usb2phy.c                 |  2 +-
 sys/arm64/rockchip/rk_usbphy.c                  |  2 +-
 sys/conf/files                                  | 10 +++++-----
 sys/dev/pci/pci_dw_mv.c                         |  2 +-
 sys/dev/{extres => }/phy/phy.c                  |  4 ++--
 sys/dev/{extres => }/phy/phy.h                  |  7 ++++---
 sys/dev/{extres => }/phy/phy_internal.h         |  6 +++---
 sys/dev/{extres => }/phy/phy_usb.c              |  4 ++--
 sys/dev/{extres => }/phy/phy_usb.h              |  8 ++++----
 sys/dev/{extres => }/phy/phydev_if.m            |  0
 sys/dev/{extres => }/phy/phynode_if.m           |  2 +-
 sys/dev/{extres => }/phy/phynode_usb_if.m       |  0
 sys/dev/qcom_dwc3/qcom_dwc3.c                   |  2 +-
 sys/dev/sdhci/sdhci_fdt.c                       |  2 +-
 sys/dev/usb/controller/dwc3/aw_dwc3.c           |  2 +-
 sys/dev/usb/controller/dwc3/dwc3.c              |  2 +-
 sys/dev/usb/controller/dwc3/rk_dwc3.c           |  2 +-
 sys/dev/usb/controller/generic_ehci_fdt.c       |  4 ++--
 sys/dev/usb/controller/generic_ohci.c           |  4 ++--
 sys/dev/usb/controller/generic_xhci_fdt.c       |  2 +-
 sys/dev/usb/controller/musb_otg_allwinner.c     |  4 ++--
 sys/dev/usb/controller/usb_nop_xceiv.c          |  2 +-
 sys/dev/usb/controller/xlnx_dwc3.c              |  2 +-
 42 files changed, 58 insertions(+), 57 deletions(-)

diff --git a/sys/arm/allwinner/aw_usb3phy.c b/sys/arm/allwinner/aw_usb3phy.c
index fdf54ef79250..66033ef22a18 100644
--- a/sys/arm/allwinner/aw_usb3phy.c
+++ b/sys/arm/allwinner/aw_usb3phy.c
@@ -45,7 +45,7 @@
 #include <dev/clk/clk.h>
 #include <dev/hwreset/hwreset.h>
 #include <dev/regulator/regulator.h>
-#include <dev/extres/phy/phy_usb.h>
+#include <dev/phy/phy_usb.h>
 
 #include "phynode_if.h"
 
diff --git a/sys/arm/allwinner/aw_usbphy.c b/sys/arm/allwinner/aw_usbphy.c
index 855be90d7fb8..b0ef7d9da0a9 100644
--- a/sys/arm/allwinner/aw_usbphy.c
+++ b/sys/arm/allwinner/aw_usbphy.c
@@ -43,7 +43,7 @@
 #include <dev/clk/clk.h>
 #include <dev/hwreset/hwreset.h>
 #include <dev/regulator/regulator.h>
-#include <dev/extres/phy/phy_usb.h>
+#include <dev/phy/phy_usb.h>
 
 #include "phynode_if.h"
 
diff --git a/sys/arm/nvidia/tegra124/tegra124_xusbpadctl.c b/sys/arm/nvidia/tegra124/tegra124_xusbpadctl.c
index 43c7e345d12c..b03fb9e0c3bf 100644
--- a/sys/arm/nvidia/tegra124/tegra124_xusbpadctl.c
+++ b/sys/arm/nvidia/tegra124/tegra124_xusbpadctl.c
@@ -36,7 +36,7 @@
 #include <machine/fdt.h>
 
 #include <dev/hwreset/hwreset.h>
-#include <dev/extres/phy/phy.h>
+#include <dev/phy/phy.h>
 #include <dev/regulator/regulator.h>
 #include <dev/fdt/fdt_common.h>
 #include <dev/fdt/fdt_pinctrl.h>
diff --git a/sys/arm/nvidia/tegra_ahci.c b/sys/arm/nvidia/tegra_ahci.c
index bf60971e2b7c..c5d4dbff977c 100644
--- a/sys/arm/nvidia/tegra_ahci.c
+++ b/sys/arm/nvidia/tegra_ahci.c
@@ -46,7 +46,7 @@
 #include <dev/ahci/ahci.h>
 #include <dev/clk/clk.h>
 #include <dev/hwreset/hwreset.h>
-#include <dev/extres/phy/phy.h>
+#include <dev/phy/phy.h>
 #include <dev/regulator/regulator.h>
 #include <dev/fdt/fdt_pinctrl.h>
 #include <dev/ofw/ofw_bus.h>
diff --git a/sys/arm/nvidia/tegra_ehci.c b/sys/arm/nvidia/tegra_ehci.c
index 033b7b9794fb..e8126a88ba87 100644
--- a/sys/arm/nvidia/tegra_ehci.c
+++ b/sys/arm/nvidia/tegra_ehci.c
@@ -44,7 +44,7 @@
 
 #include <dev/clk/clk.h>
 #include <dev/hwreset/hwreset.h>
-#include <dev/extres/phy/phy.h>
+#include <dev/phy/phy.h>
 #include <dev/ofw/ofw_bus.h>
 #include <dev/ofw/ofw_bus_subr.h>
 #include <dev/usb/usb.h>
diff --git a/sys/arm/nvidia/tegra_pcie.c b/sys/arm/nvidia/tegra_pcie.c
index c9b5f46c4e30..cb0c1c7ec4d4 100644
--- a/sys/arm/nvidia/tegra_pcie.c
+++ b/sys/arm/nvidia/tegra_pcie.c
@@ -49,7 +49,7 @@
 
 #include <dev/clk/clk.h>
 #include <dev/hwreset/hwreset.h>
-#include <dev/extres/phy/phy.h>
+#include <dev/phy/phy.h>
 #include <dev/regulator/regulator.h>
 #include <dev/ofw/ofw_bus.h>
 #include <dev/ofw/ofw_bus_subr.h>
diff --git a/sys/arm/nvidia/tegra_usbphy.c b/sys/arm/nvidia/tegra_usbphy.c
index eeaca9fcc07c..cdf6f7f5833f 100644
--- a/sys/arm/nvidia/tegra_usbphy.c
+++ b/sys/arm/nvidia/tegra_usbphy.c
@@ -40,7 +40,7 @@
 
 #include <dev/clk/clk.h>
 #include <dev/hwreset/hwreset.h>
-#include <dev/extres/phy/phy.h>
+#include <dev/phy/phy.h>
 #include <dev/regulator/regulator.h>
 #include <dev/fdt/fdt_pinctrl.h>
 #include <dev/ofw/openfirm.h>
diff --git a/sys/arm/nvidia/tegra_xhci.c b/sys/arm/nvidia/tegra_xhci.c
index 5bd7e6b7736e..f7d541fabee4 100644
--- a/sys/arm/nvidia/tegra_xhci.c
+++ b/sys/arm/nvidia/tegra_xhci.c
@@ -54,7 +54,7 @@
 
 #include <dev/clk/clk.h>
 #include <dev/hwreset/hwreset.h>
-#include <dev/extres/phy/phy.h>
+#include <dev/phy/phy.h>
 #include <dev/regulator/regulator.h>
 #include <dev/ofw/ofw_bus.h>
 #include <dev/ofw/ofw_bus_subr.h>
diff --git a/sys/arm/qualcomm/ipq4018_usb_hs_phy.c b/sys/arm/qualcomm/ipq4018_usb_hs_phy.c
index 953887ad9906..97f65766466c 100644
--- a/sys/arm/qualcomm/ipq4018_usb_hs_phy.c
+++ b/sys/arm/qualcomm/ipq4018_usb_hs_phy.c
@@ -37,7 +37,7 @@
 #include <machine/bus.h>
 
 #include <dev/hwreset/hwreset.h>
-#include <dev/extres/phy/phy_usb.h>
+#include <dev/phy/phy_usb.h>
 #include <dev/regulator/regulator.h>
 #include <dev/ofw/ofw_bus.h>
 #include <dev/ofw/ofw_bus_subr.h>
diff --git a/sys/arm/qualcomm/ipq4018_usb_ss_phy.c b/sys/arm/qualcomm/ipq4018_usb_ss_phy.c
index b60be5896595..e9b880319bbc 100644
--- a/sys/arm/qualcomm/ipq4018_usb_ss_phy.c
+++ b/sys/arm/qualcomm/ipq4018_usb_ss_phy.c
@@ -37,7 +37,7 @@
 #include <machine/bus.h>
 
 #include <dev/hwreset/hwreset.h>
-#include <dev/extres/phy/phy_usb.h>
+#include <dev/phy/phy_usb.h>
 #include <dev/regulator/regulator.h>
 #include <dev/ofw/ofw_bus.h>
 #include <dev/ofw/ofw_bus_subr.h>
diff --git a/sys/arm/ti/am335x/am335x_usb_phy.c b/sys/arm/ti/am335x/am335x_usb_phy.c
index 04675d1f18ba..05b1c085aea3 100644
--- a/sys/arm/ti/am335x/am335x_usb_phy.c
+++ b/sys/arm/ti/am335x/am335x_usb_phy.c
@@ -83,7 +83,7 @@ ti_usb_phy_attach(device_t dev)
 	sc = device_get_softc(dev);
 	sc->dev = dev;
 
-	/* FIXME: Add dev/extres/phy/ interface */
+	/* FIXME: Add dev/phy/ interface */
 
 	return (bus_generic_attach(dev));
 }
diff --git a/sys/arm64/nvidia/tegra210/tegra210_xusbpadctl.c b/sys/arm64/nvidia/tegra210/tegra210_xusbpadctl.c
index 944f4e645533..4b9b566a79b7 100644
--- a/sys/arm64/nvidia/tegra210/tegra210_xusbpadctl.c
+++ b/sys/arm64/nvidia/tegra210/tegra210_xusbpadctl.c
@@ -37,7 +37,7 @@
 
 #include <dev/clk/clk.h>
 #include <dev/hwreset/hwreset.h>
-#include <dev/extres/phy/phy.h>
+#include <dev/phy/phy.h>
 #include <dev/regulator/regulator.h>
 #include <dev/fdt/fdt_common.h>
 #include <dev/fdt/fdt_pinctrl.h>
diff --git a/sys/arm64/rockchip/rk3399_emmcphy.c b/sys/arm64/rockchip/rk3399_emmcphy.c
index 70c96e4daf4e..8799dcb06b5d 100644
--- a/sys/arm64/rockchip/rk3399_emmcphy.c
+++ b/sys/arm64/rockchip/rk3399_emmcphy.c
@@ -45,7 +45,7 @@
 
 #include <dev/clk/clk.h>
 #include <dev/extres/syscon/syscon.h>
-#include <dev/extres/phy/phy.h>
+#include <dev/phy/phy.h>
 
 #include "syscon_if.h"
 
diff --git a/sys/arm64/rockchip/rk3568_combphy.c b/sys/arm64/rockchip/rk3568_combphy.c
index 99144b3315b1..1f9c0003b531 100644
--- a/sys/arm64/rockchip/rk3568_combphy.c
+++ b/sys/arm64/rockchip/rk3568_combphy.c
@@ -44,7 +44,7 @@
 #include <dev/hwreset/hwreset.h>
 #include <dev/regulator/regulator.h>
 #include <dev/extres/syscon/syscon.h>
-#include <dev/extres/phy/phy.h>
+#include <dev/phy/phy.h>
 
 #include <contrib/device-tree/include/dt-bindings/phy/phy.h>
 
diff --git a/sys/arm64/rockchip/rk3568_pcie.c b/sys/arm64/rockchip/rk3568_pcie.c
index 9874efdb1ec9..d55bfb1bcc73 100644
--- a/sys/arm64/rockchip/rk3568_pcie.c
+++ b/sys/arm64/rockchip/rk3568_pcie.c
@@ -50,7 +50,7 @@
 #include <dev/pci/pci_dw.h>
 
 #include <dev/clk/clk.h>
-#include <dev/extres/phy/phy.h>
+#include <dev/phy/phy.h>
 #include <dev/regulator/regulator.h>
 #include <dev/hwreset/hwreset.h>
 
diff --git a/sys/arm64/rockchip/rk3568_pciephy.c b/sys/arm64/rockchip/rk3568_pciephy.c
index 50471ea55130..83ee77decdb9 100644
--- a/sys/arm64/rockchip/rk3568_pciephy.c
+++ b/sys/arm64/rockchip/rk3568_pciephy.c
@@ -44,7 +44,7 @@
 #include <dev/hwreset/hwreset.h>
 #include <dev/regulator/regulator.h>
 #include <dev/extres/syscon/syscon.h>
-#include <dev/extres/phy/phy.h>
+#include <dev/phy/phy.h>
 
 #include <contrib/device-tree/include/dt-bindings/phy/phy.h>
 
diff --git a/sys/arm64/rockchip/rk_pcie.c b/sys/arm64/rockchip/rk_pcie.c
index ca85637589ee..69ae4254a235 100644
--- a/sys/arm64/rockchip/rk_pcie.c
+++ b/sys/arm64/rockchip/rk_pcie.c
@@ -46,7 +46,7 @@
 
 #include <dev/clk/clk.h>
 #include <dev/hwreset/hwreset.h>
-#include <dev/extres/phy/phy.h>
+#include <dev/phy/phy.h>
 #include <dev/regulator/regulator.h>
 #include <dev/gpio/gpiobusvar.h>
 #include <dev/ofw/ofw_bus.h>
diff --git a/sys/arm64/rockchip/rk_pcie_phy.c b/sys/arm64/rockchip/rk_pcie_phy.c
index 88ba4035ebb9..7e9077d33eb8 100644
--- a/sys/arm64/rockchip/rk_pcie_phy.c
+++ b/sys/arm64/rockchip/rk_pcie_phy.c
@@ -45,8 +45,8 @@
 #include <dev/ofw/ofw_subr.h>
 
 #include <dev/clk/clk.h>
-#include <dev/extres/phy/phy.h>
-#include <dev/extres/phy/phy_internal.h>
+#include <dev/phy/phy.h>
+#include <dev/phy/phy_internal.h>
 #include <dev/extres/syscon/syscon.h>
 #include <dev/hwreset/hwreset.h>
 
diff --git a/sys/arm64/rockchip/rk_typec_phy.c b/sys/arm64/rockchip/rk_typec_phy.c
index 7f49da5e2208..df29d514cf37 100644
--- a/sys/arm64/rockchip/rk_typec_phy.c
+++ b/sys/arm64/rockchip/rk_typec_phy.c
@@ -44,7 +44,7 @@
 #include <dev/ofw/ofw_subr.h>
 
 #include <dev/clk/clk.h>
-#include <dev/extres/phy/phy_usb.h>
+#include <dev/phy/phy_usb.h>
 #include <dev/extres/syscon/syscon.h>
 #include <dev/hwreset/hwreset.h>
 
diff --git a/sys/arm64/rockchip/rk_usb2phy.c b/sys/arm64/rockchip/rk_usb2phy.c
index d06dce90c27b..ec8a4ba89e37 100644
--- a/sys/arm64/rockchip/rk_usb2phy.c
+++ b/sys/arm64/rockchip/rk_usb2phy.c
@@ -44,7 +44,7 @@
 #include <dev/ofw/ofw_subr.h>
 
 #include <dev/clk/clk.h>
-#include <dev/extres/phy/phy_usb.h>
+#include <dev/phy/phy_usb.h>
 #include <dev/regulator/regulator.h>
 #include <dev/extres/syscon/syscon.h>
 
diff --git a/sys/arm64/rockchip/rk_usbphy.c b/sys/arm64/rockchip/rk_usbphy.c
index c2020373d040..f91c8167df62 100644
--- a/sys/arm64/rockchip/rk_usbphy.c
+++ b/sys/arm64/rockchip/rk_usbphy.c
@@ -38,7 +38,7 @@
 
 #include <dev/clk/clk.h>
 #include <dev/hwreset/hwreset.h>
-#include <dev/extres/phy/phy_usb.h>
+#include <dev/phy/phy_usb.h>
 #include <dev/regulator/regulator.h>
 #include <dev/extres/syscon/syscon.h>
 #include <dev/ofw/ofw_bus.h>
diff --git a/sys/conf/files b/sys/conf/files
index f0d4250a4537..f63f844e7942 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -1677,11 +1677,6 @@ dev/evdev/evdev_mt.c			optional evdev
 dev/evdev/evdev_utils.c			optional evdev
 dev/evdev/uinput.c			optional evdev uinput
 dev/exca/exca.c			optional cbb
-dev/extres/phy/phy.c		optional phy
-dev/extres/phy/phydev_if.m	optional phy fdt
-dev/extres/phy/phynode_if.m	optional phy
-dev/extres/phy/phy_usb.c	optional phy
-dev/extres/phy/phynode_usb_if.m	optional phy
 dev/extres/syscon/syscon.c		optional syscon
 dev/extres/syscon/syscon_generic.c	optional syscon fdt
 dev/extres/syscon/syscon_if.m		optional syscon
@@ -2591,6 +2586,11 @@ dev/pci/pci_user.c		optional pci
 dev/pci/pcib_if.m		standard
 dev/pci/pcib_support.c		standard
 dev/pci/vga_pci.c		optional pci
+dev/phy/phy.c			optional phy
+dev/phy/phydev_if.m		optional phy fdt
+dev/phy/phynode_if.m		optional phy
+dev/phy/phy_usb.c		optional phy
+dev/phy/phynode_usb_if.m	optional phy
 dev/pms/freebsd/driver/ini/src/agtiapi.c		optional pmspcv \
 	compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w"
 dev/pms/RefTisa/sallsdk/spc/sadisc.c			optional pmspcv \
diff --git a/sys/dev/pci/pci_dw_mv.c b/sys/dev/pci/pci_dw_mv.c
index 4f0671cb23d9..97d957932d42 100644
--- a/sys/dev/pci/pci_dw_mv.c
+++ b/sys/dev/pci/pci_dw_mv.c
@@ -45,7 +45,7 @@
 #include <machine/resource.h>
 
 #include <dev/clk/clk.h>
-#include <dev/extres/phy/phy.h>
+#include <dev/phy/phy.h>
 #include <dev/ofw/ofw_bus.h>
 #include <dev/ofw/ofw_bus_subr.h>
 #include <dev/ofw/ofw_pci.h>
diff --git a/sys/dev/extres/phy/phy.c b/sys/dev/phy/phy.c
similarity index 99%
rename from sys/dev/extres/phy/phy.c
rename to sys/dev/phy/phy.c
index 8861102b8508..07ffd85377c9 100644
--- a/sys/dev/extres/phy/phy.c
+++ b/sys/dev/phy/phy.c
@@ -40,8 +40,8 @@
 #include <dev/ofw/ofw_bus_subr.h>
 #endif
 
-#include  <dev/extres/phy/phy.h>
-#include  <dev/extres/phy/phy_internal.h>
+#include  <dev/phy/phy.h>
+#include  <dev/phy/phy_internal.h>
 
 #ifdef FDT
 #include "phydev_if.h"
diff --git a/sys/dev/extres/phy/phy.h b/sys/dev/phy/phy.h
similarity index 98%
rename from sys/dev/extres/phy/phy.h
rename to sys/dev/phy/phy.h
index a72904a10e2b..ae610ab74d10 100644
--- a/sys/dev/extres/phy/phy.h
+++ b/sys/dev/phy/phy.h
@@ -23,8 +23,9 @@
  *
  */
 
-#ifndef DEV_EXTRES_PHY_H
-#define DEV_EXTRES_PHY_H
+#ifndef _DEV_PHY_H_
+#define	_DEV_PHY_H_
+
 #include "opt_platform.h"
 
 #include <sys/kobj.h>
@@ -148,4 +149,4 @@ int phy_get_by_ofw_property(device_t consumer, phandle_t node, char *name,
     phy_t *phy);
 #endif
 
-#endif /* DEV_EXTRES_PHY_H */
+#endif /* _DEV_PHY_H_ */
diff --git a/sys/dev/extres/phy/phy_internal.h b/sys/dev/phy/phy_internal.h
similarity index 96%
rename from sys/dev/extres/phy/phy_internal.h
rename to sys/dev/phy/phy_internal.h
index 7f680a1c87fb..d5872d84b8c9 100644
--- a/sys/dev/extres/phy/phy_internal.h
+++ b/sys/dev/phy/phy_internal.h
@@ -23,8 +23,8 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef DEV_EXTRES_PHY_INTERNAL_H
-#define DEV_EXTRES_PHY_INTERNAL_H
+#ifndef _DEV_PHY_INTERNAL_H_
+#define	_DEV_PHY_INTERNAL_H_
 
 /* Forward declarations. */
 struct phy;
@@ -78,4 +78,4 @@ struct phy {
 
 extern struct sx phynode_topo_lock;
 
-#endif /* DEV_EXTRES_PHY_INTERNAL_H */
+#endif /* _DEV_PHY_INTERNAL_H_ */
diff --git a/sys/dev/extres/phy/phy_usb.c b/sys/dev/phy/phy_usb.c
similarity index 97%
rename from sys/dev/extres/phy/phy_usb.c
rename to sys/dev/phy/phy_usb.c
index 9e5556cf7f49..6a4fb17ca199 100644
--- a/sys/dev/extres/phy/phy_usb.c
+++ b/sys/dev/phy/phy_usb.c
@@ -32,8 +32,8 @@
 #include <sys/sx.h>
 
 
-#include <dev/extres/phy/phy_usb.h>
-#include <dev/extres/phy/phy_internal.h>
+#include <dev/phy/phy_usb.h>
+#include <dev/phy/phy_internal.h>
 
 /*
  * USB phy controller methods.
diff --git a/sys/dev/extres/phy/phy_usb.h b/sys/dev/phy/phy_usb.h
similarity index 95%
rename from sys/dev/extres/phy/phy_usb.h
rename to sys/dev/phy/phy_usb.h
index ae175c6700c5..eaaff6ee700c 100644
--- a/sys/dev/extres/phy/phy_usb.h
+++ b/sys/dev/phy/phy_usb.h
@@ -24,10 +24,10 @@
  * SUCH DAMAGE.
  */
 
-#ifndef _DEV_EXTRES_PHY_USB_H_
-#define _DEV_EXTRES_PHY_USB_H_
+#ifndef _DEV_PHY_USB_H_
+#define	_DEV_PHY_USB_H_
 
-#include <dev/extres/phy/phy.h>
+#include <dev/phy/phy.h>
 #include "phynode_usb_if.h"
 
 #define	PHY_USB_MODE_UNKNOWN	0
@@ -80,4 +80,4 @@ int phynode_usb_get_mode(struct phynode *phynode, int *usb_mode);
 int phy_usb_set_mode(phy_t phy, int usb_mode);
 int phy_usb_get_mode(phy_t phy, int *usb_mode);
 
-#endif /*_DEV_EXTRES_PHY_USB_H_*/
+#endif /*_DEV_PHY_USB_H_*/
diff --git a/sys/dev/extres/phy/phydev_if.m b/sys/dev/phy/phydev_if.m
similarity index 100%
rename from sys/dev/extres/phy/phydev_if.m
rename to sys/dev/phy/phydev_if.m
diff --git a/sys/dev/extres/phy/phynode_if.m b/sys/dev/phy/phynode_if.m
similarity index 98%
rename from sys/dev/extres/phy/phynode_if.m
rename to sys/dev/phy/phynode_if.m
index 18b798227109..425deb6bcfbe 100644
--- a/sys/dev/extres/phy/phynode_if.m
+++ b/sys/dev/phy/phynode_if.m
@@ -26,7 +26,7 @@
 INTERFACE phynode;
 
 HEADER {
-	#include <dev/extres/phy/phy.h>
+	#include <dev/phy/phy.h>
 
 	struct phynode;
 }
diff --git a/sys/dev/extres/phy/phynode_usb_if.m b/sys/dev/phy/phynode_usb_if.m
similarity index 100%
rename from sys/dev/extres/phy/phynode_usb_if.m
rename to sys/dev/phy/phynode_usb_if.m
diff --git a/sys/dev/qcom_dwc3/qcom_dwc3.c b/sys/dev/qcom_dwc3/qcom_dwc3.c
index 71c95096e5cf..cd58b9ef7705 100644
--- a/sys/dev/qcom_dwc3/qcom_dwc3.c
+++ b/sys/dev/qcom_dwc3/qcom_dwc3.c
@@ -47,7 +47,7 @@
 
 #include <dev/clk/clk.h>
 #include <dev/hwreset/hwreset.h>
-#include <dev/extres/phy/phy_usb.h>
+#include <dev/phy/phy_usb.h>
 #include <dev/extres/syscon/syscon.h>
 
 static struct ofw_compat_data compat_data[] = {
diff --git a/sys/dev/sdhci/sdhci_fdt.c b/sys/dev/sdhci/sdhci_fdt.c
index bf9f81108467..3914c96b5165 100644
--- a/sys/dev/sdhci/sdhci_fdt.c
+++ b/sys/dev/sdhci/sdhci_fdt.c
@@ -53,7 +53,7 @@
 #include <dev/clk/clk.h>
 #include <dev/clk/clk_fixed.h>
 #include <dev/extres/syscon/syscon.h>
-#include <dev/extres/phy/phy.h>
+#include <dev/phy/phy.h>
 
 #include <dev/mmc/bridge.h>
 
diff --git a/sys/dev/usb/controller/dwc3/aw_dwc3.c b/sys/dev/usb/controller/dwc3/aw_dwc3.c
index 67331f2f1be9..802c46bdae28 100644
--- a/sys/dev/usb/controller/dwc3/aw_dwc3.c
+++ b/sys/dev/usb/controller/dwc3/aw_dwc3.c
@@ -47,7 +47,7 @@
 
 #include <dev/clk/clk.h>
 #include <dev/hwreset/hwreset.h>
-#include <dev/extres/phy/phy_usb.h>
+#include <dev/phy/phy_usb.h>
 
 static struct ofw_compat_data compat_data[] = {
 	{ "allwinner,sun50i-h6-dwc3",	1 },
diff --git a/sys/dev/usb/controller/dwc3/dwc3.c b/sys/dev/usb/controller/dwc3/dwc3.c
index e0ad19fb835f..a44c2371b891 100644
--- a/sys/dev/usb/controller/dwc3/dwc3.c
+++ b/sys/dev/usb/controller/dwc3/dwc3.c
@@ -66,7 +66,7 @@
 #include <dev/ofw/ofw_subr.h>
 
 #include <dev/clk/clk.h>
-#include <dev/extres/phy/phy_usb.h>
+#include <dev/phy/phy_usb.h>
 #endif
 
 #ifdef DEV_ACPI
diff --git a/sys/dev/usb/controller/dwc3/rk_dwc3.c b/sys/dev/usb/controller/dwc3/rk_dwc3.c
index b34ec4880895..b3345fb4a67b 100644
--- a/sys/dev/usb/controller/dwc3/rk_dwc3.c
+++ b/sys/dev/usb/controller/dwc3/rk_dwc3.c
@@ -47,7 +47,7 @@
 
 #include <dev/clk/clk.h>
 #include <dev/hwreset/hwreset.h>
-#include <dev/extres/phy/phy_usb.h>
+#include <dev/phy/phy_usb.h>
 #include <dev/extres/syscon/syscon.h>
 
 enum rk_dwc3_type {
diff --git a/sys/dev/usb/controller/generic_ehci_fdt.c b/sys/dev/usb/controller/generic_ehci_fdt.c
index e88895d20664..af22d0bdef73 100644
--- a/sys/dev/usb/controller/generic_ehci_fdt.c
+++ b/sys/dev/usb/controller/generic_ehci_fdt.c
@@ -56,8 +56,8 @@
 
 #include <dev/clk/clk.h>
 #include <dev/hwreset/hwreset.h>
-#include <dev/extres/phy/phy.h>
-#include <dev/extres/phy/phy_usb.h>
+#include <dev/phy/phy.h>
+#include <dev/phy/phy_usb.h>
 
 #include "generic_ehci.h"
 
diff --git a/sys/dev/usb/controller/generic_ohci.c b/sys/dev/usb/controller/generic_ohci.c
index b71c269cfdcd..f3a9e0481bb2 100644
--- a/sys/dev/usb/controller/generic_ohci.c
+++ b/sys/dev/usb/controller/generic_ohci.c
@@ -55,8 +55,8 @@
 
 #include <dev/clk/clk.h>
 #include <dev/hwreset/hwreset.h>
-#include <dev/extres/phy/phy.h>
-#include <dev/extres/phy/phy_usb.h>
+#include <dev/phy/phy.h>
+#include <dev/phy/phy_usb.h>
 
 #include "generic_usb_if.h"
 
diff --git a/sys/dev/usb/controller/generic_xhci_fdt.c b/sys/dev/usb/controller/generic_xhci_fdt.c
index a5c3f190783f..66fc1ab65a23 100644
--- a/sys/dev/usb/controller/generic_xhci_fdt.c
+++ b/sys/dev/usb/controller/generic_xhci_fdt.c
@@ -51,7 +51,7 @@
 #include <dev/ofw/ofw_bus.h>
 #include <dev/ofw/ofw_bus_subr.h>
 
-#include <dev/extres/phy/phy.h>
+#include <dev/phy/phy.h>
 
 #include "generic_xhci.h"
 
diff --git a/sys/dev/usb/controller/musb_otg_allwinner.c b/sys/dev/usb/controller/musb_otg_allwinner.c
index a8961bed6385..3bfe2b525138 100644
--- a/sys/dev/usb/controller/musb_otg_allwinner.c
+++ b/sys/dev/usb/controller/musb_otg_allwinner.c
@@ -60,8 +60,8 @@
 
 #include <dev/clk/clk.h>
 #include <dev/hwreset/hwreset.h>
-#include <dev/extres/phy/phy.h>
-#include <dev/extres/phy/phy_usb.h>
+#include <dev/phy/phy.h>
+#include <dev/phy/phy_usb.h>
 
 #ifdef __arm__
 #include <arm/allwinner/aw_machdep.h>
diff --git a/sys/dev/usb/controller/usb_nop_xceiv.c b/sys/dev/usb/controller/usb_nop_xceiv.c
index e9503a35531a..9821f4b5e92a 100644
--- a/sys/dev/usb/controller/usb_nop_xceiv.c
+++ b/sys/dev/usb/controller/usb_nop_xceiv.c
@@ -43,7 +43,7 @@
 
 #include <dev/clk/clk.h>
 #include <dev/regulator/regulator.h>
-#include <dev/extres/phy/phy_usb.h>
+#include <dev/phy/phy_usb.h>
 
 #include "phynode_if.h"
 
diff --git a/sys/dev/usb/controller/xlnx_dwc3.c b/sys/dev/usb/controller/xlnx_dwc3.c
index facc44823523..9b9d10e81ad8 100644
--- a/sys/dev/usb/controller/xlnx_dwc3.c
+++ b/sys/dev/usb/controller/xlnx_dwc3.c
@@ -49,7 +49,7 @@
 
 #include <dev/clk/clk.h>
 #include <dev/hwreset/hwreset.h>
-#include <dev/extres/phy/phy_usb.h>
+#include <dev/phy/phy_usb.h>
 #include <dev/extres/syscon/syscon.h>
 
 static struct ofw_compat_data compat_data[] = {