]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
net: dwc_eth_qos: Make eqos_get_tick_clk_rate callback optional
authorSumit Garg <sumit.garg@linaro.org>
Wed, 1 Feb 2023 13:58:53 +0000 (19:28 +0530)
committerTom Rini <trini@konsulko.com>
Fri, 10 Feb 2023 17:50:00 +0000 (12:50 -0500)
Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
drivers/net/dwc_eth_qos.c

index afc47b56ff5920dd9361ed4c73ce9455f6a14b6b..753a912607e483780d586c2453313d2011f42b17 100644 (file)
@@ -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,