[U-Boot] [PATCH 04/13] phy: marvell: comphy: add IGNORE COMPHY type

igall at marvell.com igall at marvell.com
Sun Apr 23 09:17:28 UTC 2017


From: Stefan Roese <sr at denx.de>

This type tells u-boot to preserve the COMPHY settings as is
it is usefull in situations where the COMPHY was initialized by
earlier firmware.
Note that IGNORE is different from UNCONNECTED since setting
UNCONNECTED type will disconnect the COMPHY in the COMPHY MUX
which is a desired behaviour

Change-Id: I3fef09828a68f1d859836334b5bcf0c941b13c50
Signed-off-by: Yehuda Yitschak <yehuday at marvell.com>
Signed-off-by: Stefan Roese <sr at denx.de>
Signed-off-by: Igal Liberman <igall at marvell.com>
---
 drivers/phy/marvell/comphy_core.c        | 2 +-
 drivers/phy/marvell/comphy_cp110.c       | 1 +
 drivers/phy/marvell/comphy_mux.c         | 7 +++++++
 include/dt-bindings/comphy/comphy_data.h | 3 ++-
 4 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/phy/marvell/comphy_core.c b/drivers/phy/marvell/comphy_core.c
index db23bef..23e8c4b 100644
--- a/drivers/phy/marvell/comphy_core.c
+++ b/drivers/phy/marvell/comphy_core.c
@@ -37,7 +37,7 @@ static char *get_type_string(u32 type)
 				"SGMII1", "SGMII2", "SGMII3", "QSGMII",
 				"USB3_HOST0", "USB3_HOST1", "USB3_DEVICE",
 				"XAUI0", "XAUI1", "XAUI2", "XAUI3",
-				"RXAUI0", "RXAUI1", "SFI"};
+				"RXAUI0", "RXAUI1", "SFI", "IGNORE"};
 
 	if (type < 0 || type > PHY_TYPE_MAX)
 		return "invalid";
diff --git a/drivers/phy/marvell/comphy_cp110.c b/drivers/phy/marvell/comphy_cp110.c
index 8bec0ab..499aa68 100644
--- a/drivers/phy/marvell/comphy_cp110.c
+++ b/drivers/phy/marvell/comphy_cp110.c
@@ -1663,6 +1663,7 @@ int comphy_cp110_init(struct chip_serdes_phy_config *ptr_chip_cfg,
 		}
 		switch (ptr_comphy_map->type) {
 		case PHY_TYPE_UNCONNECTED:
+		case PHY_TYPE_IGNORE:
 			continue;
 			break;
 		case PHY_TYPE_PEX0:
diff --git a/drivers/phy/marvell/comphy_mux.c b/drivers/phy/marvell/comphy_mux.c
index 1dc7426..b036fb1 100644
--- a/drivers/phy/marvell/comphy_mux.c
+++ b/drivers/phy/marvell/comphy_mux.c
@@ -27,6 +27,10 @@ static void comphy_mux_check_config(struct comphy_mux_data *mux_data,
 
 	for (lane = 0; lane < comphy_max_lanes;
 	     lane++, comphy_map_data++, mux_data++) {
+		/* Don't check ignored COMPHYs */
+		if (comphy_map_data->type == PHY_TYPE_IGNORE)
+			continue;
+
 		mux_opt = mux_data->mux_values;
 		for (opt = 0, valid = 0; opt < mux_data->max_lane_values;
 		     opt++, mux_opt++) {
@@ -83,6 +87,9 @@ static void comphy_mux_reg_write(struct comphy_mux_data *mux_data,
 
 	for (lane = 0; lane < comphy_max_lanes;
 	     lane++, comphy_map_data++, mux_data++) {
+		if (comphy_map_data->type == PHY_TYPE_IGNORE)
+			continue;
+
 		offset = lane * bitcount;
 		mask = (((1 << bitcount) - 1) << offset);
 		value = (comphy_mux_get_mux_value(mux_data,
diff --git a/include/dt-bindings/comphy/comphy_data.h b/include/dt-bindings/comphy/comphy_data.h
index d127388..5eb32ef 100644
--- a/include/dt-bindings/comphy/comphy_data.h
+++ b/include/dt-bindings/comphy/comphy_data.h
@@ -43,7 +43,8 @@
 #define PHY_TYPE_RXAUI0			21
 #define PHY_TYPE_RXAUI1			22
 #define PHY_TYPE_SFI			23
-#define PHY_TYPE_MAX			24
+#define PHY_TYPE_IGNORE			24
+#define PHY_TYPE_MAX			25
 #define PHY_TYPE_INVALID		0xff
 
 #define PHY_POLARITY_NO_INVERT		0
-- 
2.7.4



More information about the U-Boot mailing list