summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSumit Garg <sumit.garg@linaro.org>2023-02-01 16:58:53 +0300
committerTom Rini <trini@konsulko.com>2023-02-10 20:50:00 +0300
commit9d53f335f615d6219396358dd0a8df5ab67a849a (patch)
tree9b4a6222beacc01b179a7c6d1f472bbf9a3b2187 /drivers
parent56443285f2add2161c97f413ffa25c5024ee1ef9 (diff)
downloadu-boot-9d53f335f615d6219396358dd0a8df5ab67a849a.tar.xz
net: dwc_eth_qos: Make eqos_get_tick_clk_rate callback optional
Signed-off-by: Sumit Garg <sumit.garg@linaro.org> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/dwc_eth_qos.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/net/dwc_eth_qos.c b/drivers/net/dwc_eth_qos.c
index afc47b56ff..753a912607 100644
--- a/drivers/net/dwc_eth_qos.c
+++ b/drivers/net/dwc_eth_qos.c
@@ -774,10 +774,13 @@ static int eqos_start(struct udevice *dev)
pr_err("eqos_calibrate_pads() failed: %d", ret);
goto err_stop_resets;
}
- rate = eqos->config->ops->eqos_get_tick_clk_rate(dev);
- val = (rate / 1000000) - 1;
- writel(val, &eqos->mac_regs->us_tic_counter);
+ if (eqos->config->ops->eqos_get_tick_clk_rate) {
+ rate = eqos->config->ops->eqos_get_tick_clk_rate(dev);
+
+ val = (rate / 1000000) - 1;
+ writel(val, &eqos->mac_regs->us_tic_counter);
+ }
/*
* if PHY was already connected and configured,