diff mbox series

net: dwc_eth_qos: lift parsing of max-speed DT property to common code

Message ID 20220511145841.2064069-1-rasmus.villemoes@prevas.dk
State Accepted
Commit 0c999ce98e9d6485f8637e130f7612f80c111a0e
Delegated to: Tom Rini
Headers show
Series net: dwc_eth_qos: lift parsing of max-speed DT property to common code | expand

Commit Message

Rasmus Villemoes May 11, 2022, 2:58 p.m. UTC
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>
---
 drivers/net/dwc_eth_qos.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Ramon Fried May 16, 2022, 12:27 a.m. UTC | #1
On Wed, May 11, 2022 at 5:58 PM Rasmus Villemoes
<rasmus.villemoes@prevas.dk> wrote:
>
> 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>
> ---
>  drivers/net/dwc_eth_qos.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/dwc_eth_qos.c b/drivers/net/dwc_eth_qos.c
> index 38ccb735ee..8a54e02114 100644
> --- a/drivers/net/dwc_eth_qos.c
> +++ b/drivers/net/dwc_eth_qos.c
> @@ -1692,8 +1692,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);
> @@ -1842,6 +1840,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);
> --
> 2.31.1
>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Rasmus Villemoes Aug. 4, 2022, 12:52 p.m. UTC | #2
On 16/05/2022 02.27, Ramon Fried wrote:
> On Wed, May 11, 2022 at 5:58 PM Rasmus Villemoes
> <rasmus.villemoes@prevas.dk> wrote:
>>
>> 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().
>>
> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>

ping on this as well.
Tom Rini Aug. 8, 2022, 7:07 p.m. UTC | #3
On Wed, May 11, 2022 at 04:58:41PM +0200, Rasmus Villemoes wrote:

> 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>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/drivers/net/dwc_eth_qos.c b/drivers/net/dwc_eth_qos.c
index 38ccb735ee..8a54e02114 100644
--- a/drivers/net/dwc_eth_qos.c
+++ b/drivers/net/dwc_eth_qos.c
@@ -1692,8 +1692,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);
@@ -1842,6 +1840,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);