[PATCH 2/9] net: fec: use device sequence vs index when fetching fec

sbabic at denx.de sbabic at denx.de
Sat Jul 10 21:35:20 CEST 2021


> When using uclass_get_device* to get the FEC device we need to use
> device sequence instead of index into UCLASS_ETH. In systems where for
> example a I2C based DSA switch exists it will probe before the FEC
> master and its ports will be registered first and have the first
> indexes yet the FEC's sequence comes from the device-tree alias.
> Take for example the imx8mm-venice-gw7901 board which has an i2c based
> DSA switch:
> u-boot=> net list
> eth1 : lan1 00:0d:8d:aa:00:2f
> eth2 : lan2 00:0d:8d:aa:00:30
> eth3 : lan3 00:0d:8d:aa:00:31
> eth4 : lan4 00:0d:8d:aa:00:32
> eth0 : ethernet at 30be0000 00:0d:8d:aa:00:2e active
> Thus in this case uclass_get_device(UCLASS_ETH, 0, &dev) returns lan1
> which is wrong but uclass_get_device_seq(UCLASS_ETH, 0, &dev) returns
> ethernet at 30be000 which is correct.
> Signed-off-by: Tim Harvey <tharvey at gateworks.com>
> Reviewed-by: Ramon Fried <rfried.dev at gmail.com>
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================


More information about the U-Boot mailing list