Message ID | 20210429062130.29403-1-dqfext@gmail.com |
---|---|
Headers | show |
Series | MT7530 interrupt support | expand |
On Thu, Apr 29, 2021 at 02:21:27PM +0800, DENG Qingfang wrote: > Add support for MediaTek PHYs found in MT7530 and MT7531 switches. > The initialization procedure is from the vendor driver, but due to lack > of documentation, the function of some register values remains unknown. > > Signed-off-by: DENG Qingfang <dqfext@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> > + > + /* Enable HW auto downshift */ > + phy_modify_paged(phydev, MTK_PHY_PAGE_EXTENDED, 0x14, 0, BIT(4)); As a follow up patch, you could add support for controlling this via a PHY tunable. Andrew
Please fix this: error: the following would cause module name conflict: drivers/net/phy/mediatek.ko drivers/usb/musb/mediatek.ko Thanks.
On Thu, Apr 29, 2021 at 05:08:15PM -0700, David Miller wrote: > > Please fix this: > > error: the following would cause module name conflict: > drivers/net/phy/mediatek.ko > drivers/usb/musb/mediatek.ko So I still have to rename the PHY driver.. Andrew, what is your suggestion? Is mediatek_phy.c okay? > > > Thanks.
On Fri, Apr 30, 2021 at 10:38:39AM +0800, DENG Qingfang wrote: > On Thu, Apr 29, 2021 at 05:08:15PM -0700, David Miller wrote: > > > > Please fix this: > > > > error: the following would cause module name conflict: > > drivers/net/phy/mediatek.ko > > drivers/usb/musb/mediatek.ko > > So I still have to rename the PHY driver.. > Andrew, what is your suggestion? Is mediatek_phy.c okay? mediatek_phy.c gets you into trouble with the generic PHY drivers. Most Ethernet PHY drivers have the model number in the file name. Does the PHY have its own name/numbering, or is it always considered part of the switch? If the PHY has an identity of its own, use that. Otherwise maybe mediatek75xx.c? Andrew
Hi, i prepare rename of musb-driver to musb_mtk.ko as this is also not the best name. if this module does only handle mt753x i would suggest phy_mt753x.{c,ko} regards Frank > Gesendet: Freitag, 30. April 2021 um 14:24 Uhr > Von: "Andrew Lunn" <andrew@lunn.ch> > mediatek_phy.c gets you into trouble with the generic PHY drivers. > Most Ethernet PHY drivers have the model number in the file name. Does > the PHY have its own name/numbering, or is it always considered part > of the switch? If the PHY has an identity of its own, use > that. Otherwise maybe mediatek75xx.c?
On Fri, Apr 30, 2021 at 02:37:16PM +0200, Frank Wunderlich wrote: > Hi, > > i prepare rename of musb-driver to musb_mtk.ko as this is also not the best name. > > if this module does only handle mt753x i would suggest > > phy_mt753x.{c,ko} Hi Frank That name will cause confusion with generic PHY drivers. They all seem to use phy- as a file name prefix. At the moment, no Ethernet PHY driver has phy as filename prefix or suffix. Andrew
Hi which ethernet-phy drivers do you mean? i found only combined phy-drivers with ethernet-handling (marvell,xilinx,mscc,ti) having the "phy-" prefix too as i see something like this in drivers/phy/intel/ phy-intel-keembay-emmc.c phy-intel-keembay-usb.c maybe this in drivers/phy/mediatek/ phy-mediatek-mt753x.c ? maybe with additional -eth, but this seems redundant, as mt753x is an ethernet-switch or like the other mtk-phys phy-mtk-eth-mt7531.c (like phy-mtk-mipi-dsi.c,phy-mtk-hdmi.c,phy-mtk-hdmi-mt8173.c) regards Frank > Gesendet: Freitag, 30. April 2021 um 14:44 Uhr > Von: "Andrew Lunn" <andrew@lunn.ch> > That name will cause confusion with generic PHY drivers. They all seem > to use phy- as a file name prefix. At the moment, no Ethernet PHY > driver has phy as filename prefix or suffix.
On Fri, Apr 30, 2021 at 02:56:22PM +0200, Frank Wunderlich wrote: > Hi > > which ethernet-phy drivers do you mean? drivers/net/phy. > i found only combined phy-drivers with ethernet-handling (marvell,xilinx,mscc,ti) having the "phy-" prefix too > > as i see something like this in drivers/phy/intel/ > > phy-intel-keembay-emmc.c > phy-intel-keembay-usb.c > > maybe this in drivers/phy/mediatek/ > > phy-mediatek-mt753x.c > > ? maybe with additional -eth, but this seems redundant, as mt753x is an ethernet-switch > > or like the other mtk-phys > > phy-mtk-eth-mt7531.c (like phy-mtk-mipi-dsi.c,phy-mtk-hdmi.c,phy-mtk-hdmi-mt8173.c) These are all examples of generic PHY drivers, not PHY drivers. There is a lot of confusion between PHY drivers and generic PHY drivers :-( Andrew
> Gesendet: Freitag, 30. April 2021 um 15:13 Uhr > Von: "Andrew Lunn" <andrew@lunn.ch> > > which ethernet-phy drivers do you mean? > > drivers/net/phy. ok, sorry :) > These are all examples of generic PHY drivers, not PHY drivers. > There is a lot of confusion between PHY drivers and generic PHY > drivers :-( right, there is (at least by me) a confusion about generic phy and phy (here net-only phy) drivers. mhm, maybe the naming should differ if generic phy and net-phy are that different. i guess there is no way to merge the net phys to the generic phys (due to linking to the net device drivers) to have only 1 phy section, right? but if phy- prefix is used by generic phys, maybe eth- or net- can be used here (maybe with "phy" added) something like eth-phy-mt753x.ko else i have no idea now...my patch renaming the musb-module seems not to be accepted due to possible breakage regards Frank
> mhm, maybe the naming should differ if generic phy and net-phy are > that different. i guess there is no way to merge the net phys to the > generic phys (due to linking to the net device drivers) to have only > 1 phy section, right? phys and generic PHYs are very different things, completely different API etc. They cannot be merged. > but if phy- prefix is used by generic phys, maybe eth- or net- can be used here (maybe with "phy" added) > > something like > > eth-phy-mt753x.ko > > else i have no idea now...my patch renaming the musb-module seems not > to be accepted due to possible breakage The usb module has been around for a long time, so it cannot be changed. The phy driver is new, not in a released kernel. So we can still rename it without causing problems. I still want to understand the naming here. If you look at most Ethernet switches with integrated PHYs, the PHYs have their own naming scheme, separate from the switch, because they are independent IP. So i would prefer this driver by named after the PHY name, not the switch name. That might solve the naming conflict, mt123x for the PHY, mt7530 for the switch driver. Andrew
On Fri, 2021-04-30 at 18:34 +0200, Andrew Lunn wrote: > > mhm, maybe the naming should differ if generic phy and net-phy are > > that different. i guess there is no way to merge the net phys to > > the > > generic phys (due to linking to the net device drivers) to have > > only > > 1 phy section, right? > > phys and generic PHYs are very different things, completely different > API etc. They cannot be merged. > > > but if phy- prefix is used by generic phys, maybe eth- or net- can > > be used here (maybe with "phy" added) > > > > something like > > > > eth-phy-mt753x.ko How about using mediatek-ge.ko. 'ge' is the abbreviation of gigabit Ethernet. Most mediatek products use the same gigabit Ethernet phy. Landen > > > > else i have no idea now...my patch renaming the musb-module seems > > not > > to be accepted due to possible breakage > > The usb module has been around for a long time, so it cannot be > changed. The phy driver is new, not in a released kernel. So we can > still rename it without causing problems. > > I still want to understand the naming here. If you look at most > Ethernet switches with integrated PHYs, the PHYs have their own > naming > scheme, separate from the switch, because they are independent IP. So > i would prefer this driver by named after the PHY name, not the > switch > name. That might solve the naming conflict, mt123x for the PHY, > mt7530 > for the switch driver. > > Andrew
On Wed, May 5, 2021 at 5:31 PM Landen Chao <landen.chao@mediatek.com> wrote: > How about using mediatek-ge.ko. 'ge' is the abbreviation of gigabit > Ethernet. Most mediatek products use the same gigabit Ethernet phy. Well, MT7620's PHY is FE.. > > Landen
On Wed, 2021-05-05 at 17:43 +0800, DENG Qingfang wrote: > On Wed, May 5, 2021 at 5:31 PM Landen Chao <landen.chao@mediatek.com> > wrote: > > How about using mediatek-ge.ko. 'ge' is the abbreviation of gigabit > > Ethernet. Most mediatek products use the same gigabit Ethernet phy. > > Well, MT7620's PHY is FE.. MT7620's FE PHY HW is different from MT753x's GE PHY. Vendor registers of these two PHY are totally different. However, MT7620 internal switch MAC is quite the same as MT753x's MAC except for VLAN table and other minor changes. The MAC part can be reused. > > > > > Landen
On Thu, May 6, 2021 at 8:54 PM Landen Chao <landen.chao@mediatek.com> wrote: > MT7620's FE PHY HW is different from MT753x's GE PHY. Vendor registers > of these two PHY are totally different. Okay. So if the FE PHY is added later, it can be named mediatek-fe.c.