* [PATCH net-next 0/2] net: phy: add new led configuration for marvell m88e1510 @ 2019-02-14 4:31 Jian Shen 2019-02-14 4:31 ` [PATCH net-next 1/2] net: phy: marvell: add new m88e1510 LED configuration Jian Shen 2019-02-14 4:31 ` [PATCH net-next 2/2] net: hns3: add fixup handle for hns3 driver Jian Shen 0 siblings, 2 replies; 7+ messages in thread From: Jian Shen @ 2019-02-14 4:31 UTC (permalink / raw) To: andrew, f.fainelli, hkallweit1, davem; +Cc: netdev, linux-kernel, linuxarm Currently, the m88e1510 phy driver used LED[0] and LED[1] for link, LED[2] for active. It's incompatible with some boards which uses LED[1] for active. This patchset adds new led configuration for HNS3 driver. Jian Shen (2): net: phy: marvell: add new m88e1510 LED configuration net: hns3: add fixup handle for hns3 driver .../ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c | 19 +++++++++++++++++++ drivers/net/phy/marvell.c | 22 +++++++++++++++++++++- include/linux/marvell_phy.h | 1 + 3 files changed, 41 insertions(+), 1 deletion(-) -- 1.9.1 ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH net-next 1/2] net: phy: marvell: add new m88e1510 LED configuration 2019-02-14 4:31 [PATCH net-next 0/2] net: phy: add new led configuration for marvell m88e1510 Jian Shen @ 2019-02-14 4:31 ` Jian Shen 2019-02-14 4:06 ` Florian Fainelli 2019-02-14 4:31 ` [PATCH net-next 2/2] net: hns3: add fixup handle for hns3 driver Jian Shen 1 sibling, 1 reply; 7+ messages in thread From: Jian Shen @ 2019-02-14 4:31 UTC (permalink / raw) To: andrew, f.fainelli, hkallweit1, davem; +Cc: netdev, linux-kernel, linuxarm The default m88e1510 LED configuration is 0x1177, used LED[0] for 1000M link, LED[1] for 100M link, and LED[2] for active. But for our boards, we want to use 0x1040, which use LED[0] for link, and LED[1] for active. This patch adds a new m88e1510 LED configuration for it. Signed-off-by: Jian Shen <shenjian15@huawei.com> --- drivers/net/phy/marvell.c | 22 +++++++++++++++++++++- include/linux/marvell_phy.h | 1 + 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c index 3ccba37..c195286 100644 --- a/drivers/net/phy/marvell.c +++ b/drivers/net/phy/marvell.c @@ -128,6 +128,10 @@ #define MII_PHY_LED_CTRL 16 #define MII_88E1121_PHY_LED_DEF 0x0030 #define MII_88E1510_PHY_LED_DEF 0x1177 +#define MII_88E1510_PHY_HNS3_LED_DEF 0x1040 + +#define MII_88E1510_PHY_LED_POLARITY_CTRL 0x11 +#define MII_88E1510_PHY_HNS3_LED_POLARITY 0x4415 #define MII_M1011_PHY_STATUS 0x11 #define MII_M1011_PHY_STATUS_1000 0x8000 @@ -619,12 +623,19 @@ static void marvell_config_led(struct phy_device *phydev) def_config = MII_88E1121_PHY_LED_DEF; break; /* Default PHY LED config: + * For hns3: + * LED[0] .. Link + * LED[1] .. Activity + * For others: * LED[0] .. 1000Mbps Link * LED[1] .. 100Mbps Link * LED[2] .. Blink, Activity */ case MARVELL_PHY_FAMILY_ID(MARVELL_PHY_ID_88E1510): - def_config = MII_88E1510_PHY_LED_DEF; + if (phydev->dev_flags & MARVELL_PHY_M1510_HNS3_LEDS) + def_config = MII_88E1510_PHY_HNS3_LED_DEF; + else + def_config = MII_88E1510_PHY_LED_DEF; break; default: return; @@ -634,6 +645,15 @@ static void marvell_config_led(struct phy_device *phydev) def_config); if (err < 0) phydev_warn(phydev, "Fail to config marvell phy LED.\n"); + + if (phydev->dev_flags & MARVELL_PHY_M1510_HNS3_LEDS) { + err = phy_write_paged(phydev, MII_MARVELL_LED_PAGE, + MII_88E1510_PHY_LED_POLARITY_CTRL, + MII_88E1510_PHY_HNS3_LED_POLARITY); + if (err < 0) + phydev_warn(phydev, + "Fail to config marvell phy LED polarity.\n"); + } } static int marvell_config_init(struct phy_device *phydev) diff --git a/include/linux/marvell_phy.h b/include/linux/marvell_phy.h index 1eb6f24..99e0bbb 100644 --- a/include/linux/marvell_phy.h +++ b/include/linux/marvell_phy.h @@ -32,5 +32,6 @@ /* struct phy_device dev_flags definitions */ #define MARVELL_PHY_M1145_FLAGS_RESISTANCE 0x00000001 #define MARVELL_PHY_M1118_DNS323_LEDS 0x00000002 +#define MARVELL_PHY_M1510_HNS3_LEDS 0x00000004 #endif /* _MARVELL_PHY_H */ -- 1.9.1 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH net-next 1/2] net: phy: marvell: add new m88e1510 LED configuration 2019-02-14 4:31 ` [PATCH net-next 1/2] net: phy: marvell: add new m88e1510 LED configuration Jian Shen @ 2019-02-14 4:06 ` Florian Fainelli 2019-02-14 7:24 ` shenjian (K) 0 siblings, 1 reply; 7+ messages in thread From: Florian Fainelli @ 2019-02-14 4:06 UTC (permalink / raw) To: Jian Shen, andrew, hkallweit1, davem; +Cc: netdev, linux-kernel, linuxarm On 2/13/2019 8:31 PM, Jian Shen wrote: > The default m88e1510 LED configuration is 0x1177, used LED[0] > for 1000M link, LED[1] for 100M link, and LED[2] for active. > But for our boards, we want to use 0x1040, which use LED[0] for > link, and LED[1] for active. > > This patch adds a new m88e1510 LED configuration for it. There appears to be a precedent with the DNS323 flag that was defined for the same purpose, but this unfortunately does not scale we cannot have every new platform come up with its own LED configuration without having a more structured approach to representing the LED configuration. Maybe we can encode the desired LED behavior in a more generic way and utilize the 32 flag bits available to denote a selection, e.g.: MARVELL_PHY_FLAG_LED0_100M BIT(3) MARVELL_PHY_FLAG_LED0_1000M BIT(4) etc. or maybe even better would be to expose the LEDs using the standard LEDs class subsystem and allow configuring different triggers. We have some amount of support for PHY LEDs already in tree, but AFAIR what we do not have support for is a "hardware blinking" trigger which those LEDs are. > > Signed-off-by: Jian Shen <shenjian15@huawei.com> > --- > drivers/net/phy/marvell.c | 22 +++++++++++++++++++++- > include/linux/marvell_phy.h | 1 + > 2 files changed, 22 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c > index 3ccba37..c195286 100644 > --- a/drivers/net/phy/marvell.c > +++ b/drivers/net/phy/marvell.c > @@ -128,6 +128,10 @@ > #define MII_PHY_LED_CTRL 16 > #define MII_88E1121_PHY_LED_DEF 0x0030 > #define MII_88E1510_PHY_LED_DEF 0x1177 > +#define MII_88E1510_PHY_HNS3_LED_DEF 0x1040 > + > +#define MII_88E1510_PHY_LED_POLARITY_CTRL 0x11 > +#define MII_88E1510_PHY_HNS3_LED_POLARITY 0x4415 > > #define MII_M1011_PHY_STATUS 0x11 > #define MII_M1011_PHY_STATUS_1000 0x8000 > @@ -619,12 +623,19 @@ static void marvell_config_led(struct phy_device *phydev) > def_config = MII_88E1121_PHY_LED_DEF; > break; > /* Default PHY LED config: > + * For hns3: > + * LED[0] .. Link > + * LED[1] .. Activity > + * For others: > * LED[0] .. 1000Mbps Link > * LED[1] .. 100Mbps Link > * LED[2] .. Blink, Activity > */ > case MARVELL_PHY_FAMILY_ID(MARVELL_PHY_ID_88E1510): > - def_config = MII_88E1510_PHY_LED_DEF; > + if (phydev->dev_flags & MARVELL_PHY_M1510_HNS3_LEDS) > + def_config = MII_88E1510_PHY_HNS3_LED_DEF; > + else > + def_config = MII_88E1510_PHY_LED_DEF; > break; > default: > return; > @@ -634,6 +645,15 @@ static void marvell_config_led(struct phy_device *phydev) > def_config); > if (err < 0) > phydev_warn(phydev, "Fail to config marvell phy LED.\n"); > + > + if (phydev->dev_flags & MARVELL_PHY_M1510_HNS3_LEDS) { > + err = phy_write_paged(phydev, MII_MARVELL_LED_PAGE, > + MII_88E1510_PHY_LED_POLARITY_CTRL, > + MII_88E1510_PHY_HNS3_LED_POLARITY); > + if (err < 0) > + phydev_warn(phydev, > + "Fail to config marvell phy LED polarity.\n"); > + } > } > > static int marvell_config_init(struct phy_device *phydev) > diff --git a/include/linux/marvell_phy.h b/include/linux/marvell_phy.h > index 1eb6f24..99e0bbb 100644 > --- a/include/linux/marvell_phy.h > +++ b/include/linux/marvell_phy.h > @@ -32,5 +32,6 @@ > /* struct phy_device dev_flags definitions */ > #define MARVELL_PHY_M1145_FLAGS_RESISTANCE 0x00000001 > #define MARVELL_PHY_M1118_DNS323_LEDS 0x00000002 > +#define MARVELL_PHY_M1510_HNS3_LEDS 0x00000004 > > #endif /* _MARVELL_PHY_H */ > -- Florian ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net-next 1/2] net: phy: marvell: add new m88e1510 LED configuration 2019-02-14 4:06 ` Florian Fainelli @ 2019-02-14 7:24 ` shenjian (K) 0 siblings, 0 replies; 7+ messages in thread From: shenjian (K) @ 2019-02-14 7:24 UTC (permalink / raw) To: Florian Fainelli, andrew, hkallweit1, davem Cc: netdev, linux-kernel, linuxarm 在 2019/2/14 12:06, Florian Fainelli 写道: > > > On 2/13/2019 8:31 PM, Jian Shen wrote: >> The default m88e1510 LED configuration is 0x1177, used LED[0] >> for 1000M link, LED[1] for 100M link, and LED[2] for active. >> But for our boards, we want to use 0x1040, which use LED[0] for >> link, and LED[1] for active. >> >> This patch adds a new m88e1510 LED configuration for it. > > There appears to be a precedent with the DNS323 flag that was defined > for the same purpose, but this unfortunately does not scale we cannot > have every new platform come up with its own LED configuration without > having a more structured approach to representing the LED configuration. > > Maybe we can encode the desired LED behavior in a more generic way and > utilize the 32 flag bits available to denote a selection, e.g.: > > MARVELL_PHY_FLAG_LED0_100M BIT(3) > MARVELL_PHY_FLAG_LED0_1000M BIT(4) > > etc. > > or maybe even better would be to expose the LEDs using the standard LEDs > class subsystem and allow configuring different triggers. We have some > amount of support for PHY LEDs already in tree, but AFAIR what we do not > have support for is a "hardware blinking" trigger which those LEDs are. > Thanks Florian. I agree that we should use a generic way. Maybe I understood incorrectly, for "utilize the 32 flag bits available to denote a selection", do you mean to define a serial flags for each usage of each led ? For each led can be configured to several usages, include link/10M link/100M link/1000M link/active/..., it needs a lot bits for these combination, e.g: #define MARVELL_PHY_FLAG_LED0_LINK BIT(2) #define MARVELL_PHY_FLAG_LED0_LINK_100M BIT(3) #define MARVELL_PHY_FLAG_LED0_LINK_1000M BIT(4) #define MARVELL_PHY_FLAG_LED0_ACTIVE BIT(5) #define MARVELL_PHY_FLAG_LED1_LINK BIT(6) #define MARVELL_PHY_FLAG_LED1_LINK_100M BIT(7) #define MARVELL_PHY_FLAG_LED1_LINK_1000M BIT(8) #define MARVELL_PHY_FLAG_LED1_ACTIVE BIT(9) ... Jian Shen >> >> Signed-off-by: Jian Shen <shenjian15@huawei.com> >> --- >> drivers/net/phy/marvell.c | 22 +++++++++++++++++++++- >> include/linux/marvell_phy.h | 1 + >> 2 files changed, 22 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c >> index 3ccba37..c195286 100644 >> --- a/drivers/net/phy/marvell.c >> +++ b/drivers/net/phy/marvell.c >> @@ -128,6 +128,10 @@ >> #define MII_PHY_LED_CTRL 16 >> #define MII_88E1121_PHY_LED_DEF 0x0030 >> #define MII_88E1510_PHY_LED_DEF 0x1177 >> +#define MII_88E1510_PHY_HNS3_LED_DEF 0x1040 >> + >> +#define MII_88E1510_PHY_LED_POLARITY_CTRL 0x11 >> +#define MII_88E1510_PHY_HNS3_LED_POLARITY 0x4415 >> >> #define MII_M1011_PHY_STATUS 0x11 >> #define MII_M1011_PHY_STATUS_1000 0x8000 >> @@ -619,12 +623,19 @@ static void marvell_config_led(struct phy_device *phydev) >> def_config = MII_88E1121_PHY_LED_DEF; >> break; >> /* Default PHY LED config: >> + * For hns3: >> + * LED[0] .. Link >> + * LED[1] .. Activity >> + * For others: >> * LED[0] .. 1000Mbps Link >> * LED[1] .. 100Mbps Link >> * LED[2] .. Blink, Activity >> */ >> case MARVELL_PHY_FAMILY_ID(MARVELL_PHY_ID_88E1510): >> - def_config = MII_88E1510_PHY_LED_DEF; >> + if (phydev->dev_flags & MARVELL_PHY_M1510_HNS3_LEDS) >> + def_config = MII_88E1510_PHY_HNS3_LED_DEF; >> + else >> + def_config = MII_88E1510_PHY_LED_DEF; >> break; >> default: >> return; >> @@ -634,6 +645,15 @@ static void marvell_config_led(struct phy_device *phydev) >> def_config); >> if (err < 0) >> phydev_warn(phydev, "Fail to config marvell phy LED.\n"); >> + >> + if (phydev->dev_flags & MARVELL_PHY_M1510_HNS3_LEDS) { >> + err = phy_write_paged(phydev, MII_MARVELL_LED_PAGE, >> + MII_88E1510_PHY_LED_POLARITY_CTRL, >> + MII_88E1510_PHY_HNS3_LED_POLARITY); >> + if (err < 0) >> + phydev_warn(phydev, >> + "Fail to config marvell phy LED polarity.\n"); >> + } >> } >> >> static int marvell_config_init(struct phy_device *phydev) >> diff --git a/include/linux/marvell_phy.h b/include/linux/marvell_phy.h >> index 1eb6f24..99e0bbb 100644 >> --- a/include/linux/marvell_phy.h >> +++ b/include/linux/marvell_phy.h >> @@ -32,5 +32,6 @@ >> /* struct phy_device dev_flags definitions */ >> #define MARVELL_PHY_M1145_FLAGS_RESISTANCE 0x00000001 >> #define MARVELL_PHY_M1118_DNS323_LEDS 0x00000002 >> +#define MARVELL_PHY_M1510_HNS3_LEDS 0x00000004 >> >> #endif /* _MARVELL_PHY_H */ >> > ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH net-next 2/2] net: hns3: add fixup handle for hns3 driver 2019-02-14 4:31 [PATCH net-next 0/2] net: phy: add new led configuration for marvell m88e1510 Jian Shen 2019-02-14 4:31 ` [PATCH net-next 1/2] net: phy: marvell: add new m88e1510 LED configuration Jian Shen @ 2019-02-14 4:31 ` Jian Shen 2019-02-14 4:08 ` Florian Fainelli 1 sibling, 1 reply; 7+ messages in thread From: Jian Shen @ 2019-02-14 4:31 UTC (permalink / raw) To: andrew, f.fainelli, hkallweit1, davem; +Cc: netdev, linux-kernel, linuxarm The default led configuration of marvell 88E1510 is not fit for hns3 driver, this patch fixes it. Signed-off-by: Jian Shen <shenjian15@huawei.com> --- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c index 84f2878..4c8346e 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c @@ -2,6 +2,7 @@ // Copyright (c) 2016-2017 Hisilicon Limited. #include <linux/etherdevice.h> +#include <linux/marvell_phy.h> #include <linux/kernel.h> #include "hclge_cmd.h" @@ -125,6 +126,13 @@ static int hclge_mdio_read(struct mii_bus *bus, int phyid, int regnum) return le16_to_cpu(mdio_cmd->data_rd); } +static int hclge_phy_marvell_fixup(struct phy_device *phydev) +{ + phydev->dev_flags |= MARVELL_PHY_M1510_HNS3_LEDS; + + return 0; +} + int hclge_mac_mdio_config(struct hclge_dev *hdev) { struct hclge_mac *mac = &hdev->hw.mac; @@ -168,6 +176,15 @@ int hclge_mac_mdio_config(struct hclge_dev *hdev) mac->phydev = phydev; mac->mdio_bus = mdio_bus; + /* register the PHY board fixup (for Marvell 88E1510) */ + ret = phy_register_fixup_for_uid(MARVELL_PHY_ID_88E1510, + MARVELL_PHY_ID_MASK, + hclge_phy_marvell_fixup); + /* we can live without it, so just issue a warning */ + if (ret) + dev_warn(&hdev->pdev->dev, + "Cannot register PHY board fixup\n"); + return 0; } @@ -240,6 +257,8 @@ void hclge_mac_disconnect_phy(struct hnae3_handle *handle) if (!phydev) return; + phy_unregister_fixup_for_uid(MARVELL_PHY_ID_88E1510, + MARVELL_PHY_ID_MASK); phy_disconnect(phydev); } -- 1.9.1 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH net-next 2/2] net: hns3: add fixup handle for hns3 driver 2019-02-14 4:31 ` [PATCH net-next 2/2] net: hns3: add fixup handle for hns3 driver Jian Shen @ 2019-02-14 4:08 ` Florian Fainelli 2019-02-14 7:25 ` shenjian (K) 0 siblings, 1 reply; 7+ messages in thread From: Florian Fainelli @ 2019-02-14 4:08 UTC (permalink / raw) To: Jian Shen, andrew, hkallweit1, davem; +Cc: netdev, linux-kernel, linuxarm On 2/13/2019 8:31 PM, Jian Shen wrote: > The default led configuration of marvell 88E1510 is not fit > for hns3 driver, this patch fixes it. > > Signed-off-by: Jian Shen <shenjian15@huawei.com> > --- > .../net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c | 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) > > diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c > index 84f2878..4c8346e 100644 > --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c > +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c > @@ -2,6 +2,7 @@ > // Copyright (c) 2016-2017 Hisilicon Limited. > > #include <linux/etherdevice.h> > +#include <linux/marvell_phy.h> > #include <linux/kernel.h> > > #include "hclge_cmd.h" > @@ -125,6 +126,13 @@ static int hclge_mdio_read(struct mii_bus *bus, int phyid, int regnum) > return le16_to_cpu(mdio_cmd->data_rd); > } > > +static int hclge_phy_marvell_fixup(struct phy_device *phydev) > +{ > + phydev->dev_flags |= MARVELL_PHY_M1510_HNS3_LEDS; > + > + return 0; > +} > + > int hclge_mac_mdio_config(struct hclge_dev *hdev) > { > struct hclge_mac *mac = &hdev->hw.mac; > @@ -168,6 +176,15 @@ int hclge_mac_mdio_config(struct hclge_dev *hdev) > mac->phydev = phydev; > mac->mdio_bus = mdio_bus; > > + /* register the PHY board fixup (for Marvell 88E1510) */ > + ret = phy_register_fixup_for_uid(MARVELL_PHY_ID_88E1510, > + MARVELL_PHY_ID_MASK, > + hclge_phy_marvell_fixup); > + /* we can live without it, so just issue a warning */ > + if (ret) > + dev_warn(&hdev->pdev->dev, > + "Cannot register PHY board fixup\n"); You don't need to register a fixup for passing your flags, you can do that at the time you attach to the PHY: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/phy.h#n945 > + > return 0; > } > > @@ -240,6 +257,8 @@ void hclge_mac_disconnect_phy(struct hnae3_handle *handle) > if (!phydev) > return; > > + phy_unregister_fixup_for_uid(MARVELL_PHY_ID_88E1510, > + MARVELL_PHY_ID_MASK); > phy_disconnect(phydev); > } > > -- Florian ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net-next 2/2] net: hns3: add fixup handle for hns3 driver 2019-02-14 4:08 ` Florian Fainelli @ 2019-02-14 7:25 ` shenjian (K) 0 siblings, 0 replies; 7+ messages in thread From: shenjian (K) @ 2019-02-14 7:25 UTC (permalink / raw) To: Florian Fainelli, andrew, hkallweit1, davem Cc: netdev, linux-kernel, linuxarm 在 2019/2/14 12:08, Florian Fainelli 写道: > > > On 2/13/2019 8:31 PM, Jian Shen wrote: >> The default led configuration of marvell 88E1510 is not fit >> for hns3 driver, this patch fixes it. >> >> Signed-off-by: Jian Shen <shenjian15@huawei.com> >> --- >> .../net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c | 19 +++++++++++++++++++ >> 1 file changed, 19 insertions(+) >> >> diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c >> index 84f2878..4c8346e 100644 >> --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c >> +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c >> @@ -2,6 +2,7 @@ >> // Copyright (c) 2016-2017 Hisilicon Limited. >> >> #include <linux/etherdevice.h> >> +#include <linux/marvell_phy.h> >> #include <linux/kernel.h> >> >> #include "hclge_cmd.h" >> @@ -125,6 +126,13 @@ static int hclge_mdio_read(struct mii_bus *bus, int phyid, int regnum) >> return le16_to_cpu(mdio_cmd->data_rd); >> } >> >> +static int hclge_phy_marvell_fixup(struct phy_device *phydev) >> +{ >> + phydev->dev_flags |= MARVELL_PHY_M1510_HNS3_LEDS; >> + >> + return 0; >> +} >> + >> int hclge_mac_mdio_config(struct hclge_dev *hdev) >> { >> struct hclge_mac *mac = &hdev->hw.mac; >> @@ -168,6 +176,15 @@ int hclge_mac_mdio_config(struct hclge_dev *hdev) >> mac->phydev = phydev; >> mac->mdio_bus = mdio_bus; >> >> + /* register the PHY board fixup (for Marvell 88E1510) */ >> + ret = phy_register_fixup_for_uid(MARVELL_PHY_ID_88E1510, >> + MARVELL_PHY_ID_MASK, >> + hclge_phy_marvell_fixup); >> + /* we can live without it, so just issue a warning */ >> + if (ret) >> + dev_warn(&hdev->pdev->dev, >> + "Cannot register PHY board fixup\n"); > > You don't need to register a fixup for passing your flags, you can do > that at the time you attach to the PHY: > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/phy.h#n945 > > Thanks, will fix it in next version. >> + >> return 0; >> } >> >> @@ -240,6 +257,8 @@ void hclge_mac_disconnect_phy(struct hnae3_handle *handle) >> if (!phydev) >> return; >> >> + phy_unregister_fixup_for_uid(MARVELL_PHY_ID_88E1510, >> + MARVELL_PHY_ID_MASK); >> phy_disconnect(phydev); >> } >> >> > ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2019-02-14 7:26 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2019-02-14 4:31 [PATCH net-next 0/2] net: phy: add new led configuration for marvell m88e1510 Jian Shen 2019-02-14 4:31 ` [PATCH net-next 1/2] net: phy: marvell: add new m88e1510 LED configuration Jian Shen 2019-02-14 4:06 ` Florian Fainelli 2019-02-14 7:24 ` shenjian (K) 2019-02-14 4:31 ` [PATCH net-next 2/2] net: hns3: add fixup handle for hns3 driver Jian Shen 2019-02-14 4:08 ` Florian Fainelli 2019-02-14 7:25 ` shenjian (K)
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox