summaryrefslogtreecommitdiff
path: root/drivers/phy
diff options
context:
space:
mode:
authorSean Anderson <[email protected]>2026-01-06 16:54:58 -0500
committerMichal Simek <[email protected]>2026-01-12 13:01:27 +0100
commit0320459cbf857f4bc340d3a500a38a57218768d5 (patch)
tree929e37c8a4004326f2c71d68c208ca1be1922ab2 /drivers/phy
parent4bdaad9dee62439a9e8d7b70fd50e10e4d10d878 (diff)
phy: zynqmp: Allow variation in refclk rate
Due to limited available frequency ratios, the reference clock rate may not be exactly the same as the required rate. Allow a small (100 ppm) deviation. Signed-off-by: Sean Anderson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]> [ Linux commit 76009ee76e05e30e29aade02e788aebe9ce9ffd2 ] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Michal Simek <[email protected]>
Diffstat (limited to 'drivers/phy')
-rw-r--r--drivers/phy/phy-zynqmp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/phy/phy-zynqmp.c b/drivers/phy/phy-zynqmp.c
index 9649e660220..7151402666b 100644
--- a/drivers/phy/phy-zynqmp.c
+++ b/drivers/phy/phy-zynqmp.c
@@ -725,7 +725,10 @@ static int xpsgtr_get_ref_clocks(struct udevice *dev)
}
for (i = 0 ; i < ARRAY_SIZE(ssc_lookup); i++) {
- if (rate == ssc_lookup[i].refclk_rate) {
+ /* Allow an error of 100 ppm */
+ unsigned long error = ssc_lookup[i].refclk_rate / 10000;
+
+ if (abs(rate - ssc_lookup[i].refclk_rate) < error) {
gtr_dev->refclk_sscs[refclk] = &ssc_lookup[i];
dev_dbg(dev, "Found rate %d\n", i);
break;