![]() |
RT-Thread RTOS
An open source embedded real-time operating system
|
Phye is the DM framework for external PHY blocks: SerDes/USB/PCIe/SATA/MIPI PHY that sit beside the MAC/host controller and are shared via device tree **phys** phandles.
| Topic | Page |
|---|---|
| Core API, refcount, modes | Phye core API |
Device tree **phys / #phy-cells** | Phye and device tree |
| Implement a PHY provider | Phye provider driver |
| Host / MAC consumer pattern | Phye consumer integration |
Built-in **usb-nop-xceiv** | Generic USB PHY |
Header: **drivers/phye.h**. Core: **components/drivers/phye/phye.c**.
| Option | Role |
|---|---|
**RT_USING_PHYE** | Framework (**RT_USING_DM**) |
**RT_PHYE_GENERIC_USB** | **usb-nop-xceiv** platform driver |
**SOC_DM_PHYE_DIR** | BSP adds SoC-specific PHY drivers via **osource** |
Use phye only when the PHY is not fully embedded in the controller IP.
Providers implement **struct rt_phye_ops**; the core handles reference counting on **init** / **power_on**.
Use **rt_phye_*** | Skip phye |
|---|---|
DT **phys** on host; PHY has own **compatible** node | PHY registers only touched inside one driver |
| Same PHY IP shared (mux) or tuning table reused | No OFW and fixed **board.c** init |
Follow SoC TRM; common sequence:
rt_clk_prepare_enable**) rt_phye_init** → **rt_phye_power_on** rt_phye_set_mode** (lane rate, USB HS/SS, PCIe RC/EP, …) Teardown in reverse; see Phye consumer integration.
| Consumer | PHY lookup | Source |
|---|---|---|
| DesignWare AHCI | **rt_phye_get_by_name(dev, "sata-phy")** | **ata/ahci-dw.c** |
| USB host/device | **phys** → generic or SoC PHY | BSP + Generic USB PHY |
PCIe host drivers may call **RT_PHYE_MODE_PCIE** before training when BSP supplies a PHY driver under **SOC_DM_PHYE_DIR**.
components/drivers/include/drivers/phye.h