]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
net: dwc_eth_qos: lift parsing of max-speed DT property to common code
authorRasmus Villemoes <rasmus.villemoes@prevas.dk>
Wed, 11 May 2022 14:58:41 +0000 (16:58 +0200)
committerTom Rini <trini@konsulko.com>
Mon, 8 Aug 2022 14:50:20 +0000 (10:50 -0400)
I have an iMX8MP with a ti,dp83867 phy in front of the eqos
interface. The phy is Gbit capable - however, the C and D differential
pairs are not physically routed to the RJ45 connector. So I need to
prevent the phy from advertising 1000Mbps.

The necessary code is almost already there in the form of a
phy_set_supported() call in eqos_start(), but the max-speed DT
property is currently only parsed in
eqos_probe_resources_stm32(). Lift that parsing to eqos_probe().

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
drivers/net/dwc_eth_qos.c

index 7c504dd1ca5e7949614db8d490c536e7da76437b..4f3ea4f6295993a9147cb600862df93ce1fa17de 100644 (file)
@@ -1399,8 +1399,6 @@ static int eqos_probe_resources_stm32(struct udevice *dev)
        if (ret)
                return -EINVAL;
 
-       eqos->max_speed = dev_read_u32_default(dev, "max-speed", 0);
-
        ret = clk_get_by_name(dev, "stmmaceth", &eqos->clk_master_bus);
        if (ret) {
                pr_err("clk_get_by_name(master_bus) failed: %d", ret);
@@ -1503,6 +1501,8 @@ static int eqos_probe(struct udevice *dev)
        eqos->dma_regs = (void *)(eqos->regs + EQOS_DMA_REGS_BASE);
        eqos->tegra186_regs = (void *)(eqos->regs + EQOS_TEGRA186_REGS_BASE);
 
+       eqos->max_speed = dev_read_u32_default(dev, "max-speed", 0);
+
        ret = eqos_probe_resources_core(dev);
        if (ret < 0) {
                pr_err("eqos_probe_resources_core() failed: %d", ret);