Skip to content
This repository was archived by the owner on Mar 29, 2021. It is now read-only.

Commit 3b63db3

Browse files
Jean-Jacques HiblotMarek Vasut
Jean-Jacques Hiblot
authored and
Marek Vasut
committed
phy: add a NO-OP phy driver
This driver is used to stub PHY operations in a driver (USB, SATA). This is useful when the 'client' driver (USB, SATA, ...) uses the PHY framework and there is no actual PHY harwdare to drive. Signed-off-by: Jean-Jacques Hiblot <[email protected]>
1 parent 2080d02 commit 3b63db3

File tree

4 files changed

+61
-0
lines changed

4 files changed

+61
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
NOP PHY driver
2+
3+
This driver is used to stub PHY operations in a driver (USB, SATA).
4+
This is useful when the 'client' driver (USB, SATA, ...) uses the PHY framework
5+
and there is no actual PHY harwdare to drive.
6+
7+
Required properties:
8+
- compatible : must contain "nop-phy"
9+
- #phy-cells : must contain <0>
10+
11+
Example:
12+
13+
nop_phy {
14+
compatible = "nop-phy";
15+
#phy-cells = <0>;
16+
};

drivers/phy/Kconfig

+18
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,24 @@ config PHY_SANDBOX
4141
This select a dummy sandbox PHY driver. It used only to implement
4242
the unit tests for the phy framework
4343

44+
config NOP_PHY
45+
bool "NOP PHY driver"
46+
depends on PHY
47+
help
48+
Support for a no-op PHY driver (stubbed PHY driver).
49+
50+
This is useful when a driver uses the PHY framework but no real PHY
51+
hardware exists.
52+
53+
config SPL_NOP_PHY
54+
bool "NOP PHY driver in SPL"
55+
depends on SPL_PHY
56+
help
57+
Support for a no-op PHY driver (stubbed PHY driver) in the SPL.
58+
59+
This is useful when a driver uses the PHY framework but no real PHY
60+
hardware exists.
61+
4462
config PIPE3_PHY
4563
bool "Support omap's PIPE3 PHY"
4664
depends on PHY && ARCH_OMAP2PLUS

drivers/phy/Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@
66
#
77

88
obj-$(CONFIG_$(SPL_)PHY) += phy-uclass.o
9+
obj-$(CONFIG_$(SPL_)NOP_PHY) += nop-phy.o
910
obj-$(CONFIG_PHY_SANDBOX) += sandbox-phy.o
1011
obj-$(CONFIG_$(SPL_)PIPE3_PHY) += ti-pipe3-phy.o

drivers/phy/nop-phy.c

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com/
3+
* Written by Jean-Jacques Hiblot <[email protected]>
4+
*
5+
* SPDX-License-Identifier: GPL-2.0+
6+
*/
7+
8+
#include <common.h>
9+
#include <dm.h>
10+
#include <dm/device.h>
11+
#include <generic-phy.h>
12+
13+
static const struct udevice_id nop_phy_ids[] = {
14+
{ .compatible = "nop-phy" },
15+
{ }
16+
};
17+
18+
static struct phy_ops nop_phy_ops = {
19+
};
20+
21+
U_BOOT_DRIVER(nop_phy) = {
22+
.name = "nop_phy",
23+
.id = UCLASS_PHY,
24+
.of_match = nop_phy_ids,
25+
.ops = &nop_phy_ops,
26+
};

0 commit comments

Comments
 (0)