[PATCH v2] net: mv88e6xxx: fix missing SMI address initialization
Stefan Roese
sr at denx.de
Tue Jan 9 10:37:10 CET 2024
On 12/18/23 17:09, Marek Behún wrote:
> On Wed, 6 Dec 2023 15:35:56 +0100
> Marek Mojík <marek.mojik at nic.cz> wrote:
>
>> The mv88e6xxx driver does not currently initialize the smi_addr field, but
>> instead keeps the default zero value. This leads to driver being unusable
>> on devices where the switch is not on address zero of the mdio bus. Fix
>> this problem by reading the SMI address from device tree.
>>
>> Signed-off-by: Marek Mojík <marek.mojik at nic.cz>
>> ---
>> drivers/net/mv88e6xxx.c | 8 ++++++++
>> 1 file changed, 8 insertions(+)
>>
>> diff --git a/drivers/net/mv88e6xxx.c b/drivers/net/mv88e6xxx.c
>> index c073f81e72..8fbbc1cacc 100644
>> --- a/drivers/net/mv88e6xxx.c
>> +++ b/drivers/net/mv88e6xxx.c
>> @@ -745,6 +745,7 @@ static int mv88e6xxx_probe(struct udevice *dev)
>> {
>> struct dsa_pdata *dsa_pdata = dev_get_uclass_plat(dev);
>> struct mv88e6xxx_priv *priv = dev_get_priv(dev);
>> + fdt_addr_t smi_addr;
>> int val, ret;
>>
>> if (ofnode_valid(dev_ofnode(dev)) &&
>> @@ -753,6 +754,13 @@ static int mv88e6xxx_probe(struct udevice *dev)
>> return -ENODEV;
>> }
>>
>> + smi_addr = dev_read_addr(dev);
>> + if (smi_addr == FDT_ADDR_T_NONE) {
>> + dev_err(dev, "Missing SMI address\n");
>> + return -EINVAL;
>> + }
>> + priv->smi_addr = smi_addr;
>> +
>> /* probe internal mdio bus */
>> ret = mv88e6xxx_probe_mdio(dev);
>> if (ret)
>
> Reviewed-by: Marek Behún <kabel at kernel.org>
Reviewed-by: Stefan Roese <sr at denx.de>
Ramon, this patch was assigned to me as an Marvell MVEBU patch
depends on it. I've assigned it to you now. Or if it's okay that
I pull it with the Marvell tree, just let me know.
Thanks,
Stefan
Viele Grüße,
Stefan Roese
--
DENX Software Engineering GmbH, Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de
More information about the U-Boot
mailing list