[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a9958d92-41da-4c3a-8c57-615158c3c8a2@loongson.cn>
Date: Thu, 21 Mar 2024 17:13:45 +0800
From: Yanteng Si <siyanteng@...ngson.cn>
To: Serge Semin <fancer.lancer@...il.com>
Cc: andrew@...n.ch, hkallweit1@...il.com, peppe.cavallaro@...com,
alexandre.torgue@...s.st.com, joabreu@...opsys.com, Jose.Abreu@...opsys.com,
chenhuacai@...ngson.cn, linux@...linux.org.uk, guyinggang@...ngson.cn,
netdev@...r.kernel.org, chris.chenfeiyang@...il.com
Subject: Re: [PATCH net-next v8 06/11] net: stmmac: dwmac-loongson: Add GNET
support
在 2024/3/19 23:03, Serge Semin 写道:
>>>>> >> +static int loongson_gnet_data(struct pci_dev *pdev,
>>>>> + struct plat_stmmacenet_data *plat)
>>>>> +{
>>>>> + loongson_default_data(pdev, plat);
>>>>> +
>>>>> + plat->multicast_filter_bins = 256;
>>>>> +
>>>>> + plat->mdio_bus_data->phy_mask = ~(u32)BIT(2);
>>>>> +
>>>>> + plat->phy_addr = 2;
>>>>> + plat->phy_interface = PHY_INTERFACE_MODE_INTERNAL;
>>>> Are you sure PHY-interface is supposed to be defined as "internal"?
>>> Yes, because the gnet hardware has a integrated PHY, so we set it to internal,
>>>
> Why do you need the phy_addr set to 2 then? Is PHY still discoverable
> on the subordinate MDIO-bus?
Because the default return value of gnet's mdio is 0xffff, when scanning
for phy,
if the return value is not 0, it will be assumed that the phy for that
address exists.
Not specifying an address will cause all addresses' phy to be
detected, and the
lowest address' phy will be selected by default. so then, the network is
unavailable.
>
> kdoc in "include/linux/phy.h" defines the PHY_INTERFACE_MODE_INTERNAL
> mode as for a case of the MAC and PHY being combined. IIUC it's
> reserved for a case when you can't determine actual interface between
> the MAC and PHY. Is it your case? Are you sure the interface between
> MAC and PHY isn't something like GMII/RGMII/etc?
Hmmm. the interface between MAC and PHY is GMII, so let's use
PHY_INTERFACE_MODE_GMII?
Thanks,
Yanteng
Powered by blists - more mailing lists