Re: [PATCH] lan743x: Added fixed link support

2020-05-21 Thread Andrew Lunn
On Wed, May 20, 2020 at 07:10:06PM +0200, Roelof Berg wrote: Hi Roelof Here is how i would do this. I don't like this MII bus snooping. It is a microchip propriety's thing, which is not well understood. It adds no value over just doing what every other MAC driver does in the link_change callback,

RE: [PATCH] lan743x: Added fixed link support

2020-05-19 Thread Ronnie.Kunin
0 12:43 PM To: Andrew Lunn Cc: Bryan Whitehead - C21958 ; UNGLinuxDriver ; David S. Miller ; net...@vger.kernel.org; linux-kernel@vger.kernel.org Subject: Re: [PATCH] lan743x: Added fixed link support EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe Hi

Re: [PATCH] lan743x: Added fixed link support

2020-05-19 Thread Roelof Berg
Hi Andrew, thank you for the example, your input got me further. Sorry if my e-mails made the impression that the MAC is sending MDIO on its own. It can issue MDIO but I assume it will do this only on request of the MCU. I read the data sheets again and found what might have confused us. There

RE: [PATCH] lan743x: Added fixed link support

2020-05-18 Thread Bryan.Whitehead
> -Original Message- > From: Roelof Berg > Sent: Sunday, May 17, 2020 4:45 PM > To: Andrew Lunn > Cc: Bryan Whitehead - C21958 ; > UNGLinuxDriver ; David S. Miller > ; net...@vger.kernel.org; linux- > ker...@vger.kernel.org > Subject: Re: [PATCH] lan743

Re: [PATCH] lan743x: Added fixed link support

2020-05-18 Thread Andrew Lunn
> I double checked the vendor documentation and according to the data > sheet in this device the MAC detects speed and duplex mode. It uses > PINs, traces clocks … Also according to an application note of the > vendor duplex and speed detection should be enabled in the MAC > registers. In general,

Re: [PATCH] lan743x: Added fixed link support

2020-05-18 Thread Roelof Berg
Hi, thanks a lot for guiding me. A thought on the transparency of fixed-phy regarding this section: > >> +/* Set duplex mode */ >> +if (phydev->duplex) >> +data |= MAC_CR_DPX_; >> +else >> +

Re: [PATCH] lan743x: Added fixed link support

2020-05-18 Thread Roelof Berg
Hi, thanks a lot for going into detail. I also want to make sure that everything will be right. > Am 18.05.2020 um 01:50 schrieb Andrew Lunn : > + /* Configure MAC to fixed link parameters */ + data = lan743x_csr_read(adapter, MAC_CR); +

Re: [PATCH] lan743x: Added fixed link support

2020-05-17 Thread Andrew Lunn
> >> + /* Configure MAC to fixed link parameters */ > >> + data = lan743x_csr_read(adapter, MAC_CR); > >> + /* Disable auto negotiation */ > >> + data &= ~(MAC_CR_ADD_ | MAC_CR_ASD_); > > > > Why does the MAC care about autoneg? I

Re: [PATCH] lan743x: Added fixed link support

2020-05-17 Thread Roelof Berg
To Everyone: I need a test hardware recommendation for a lan7431/0 NIC in normal mode (not fixed-link mode). In prior patches this was not necessary, because I was able to ensure 100% backwards compatibility by careful coding alone. But I might soon come to a point where I need to test phy-conne

Re: [PATCH] lan743x: Added fixed link support

2020-05-17 Thread Andrew Lunn
> @@ -946,6 +949,9 @@ static void lan743x_phy_link_status_change(struct > net_device *netdev) > { > struct lan743x_adapter *adapter = netdev_priv(netdev); > struct phy_device *phydev = netdev->phydev; > + struct device_node *phynode; > + phy_interface_t phyifc = PHY_INTERFACE_

Re: [PATCH] lan743x: Added fixed link support

2020-05-13 Thread Florian Fainelli
On 5/13/2020 12:06 PM, Roelof Berg wrote: > Microchip lan7431 is frequently connected to a phy. However, it > can also be directly connected to a MII remote peer without > any phy in between. For supporting such a phyless hardware setup > in Linux we added the capability to the driver to underst