Skip to content

Commit

Permalink
LFU-635-1 net: fsl_enetc: Fix enetc id issue on iMX95
Browse files Browse the repository at this point in the history
Because iMX95 uses different pci devfn for enetc ports with ls1028
in dts, using PCI_FUNC will get same value for all ports, thus the
devices' name are duplicated when multiple ports enabled.
Update the codes to use PCI_DEV for iMX95.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
  • Loading branch information
Ye Li committed Dec 27, 2023
1 parent c5f8913 commit 4487e29
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/net/fsl_enetc.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,11 @@ static int enetc_bind(struct udevice *dev)
* PCI function # and enetc#N based on interface count
*/
if (ofnode_valid(dev_ofnode(dev)))
#ifdef CONFIG_ARCH_IMX9
sprintf(name, "enetc-%u", PCI_DEV(pci_get_devfn(dev)) >> 3);
#else
sprintf(name, "enetc-%u", PCI_FUNC(pci_get_devfn(dev)));
#endif
else
sprintf(name, "enetc#%u", eth_num_devices++);
device_set_name(dev, name);
Expand Down

0 comments on commit 4487e29

Please sign in to comment.