public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Horatiu Vultur <horatiu.vultur@microchip.com>
To: Parthiban Veerasooran <Parthiban.Veerasooran@microchip.com>
Cc: <netdev@vger.kernel.org>, <andrew@lunn.ch>, <davem@davemloft.net>,
	<jan.huber@microchip.com>, <thorsten.kummermehr@microchip.com>,
	<ramon.nordin.rodriguez@ferroamp.se>
Subject: Re: [PATCH net-next 1/2] net: phy: microchip_t1s: update LAN867x PHY supported revision number
Date: Wed, 26 Apr 2023 22:56:08 +0200	[thread overview]
Message-ID: <20230426205608.qqx37bnao2l47st5@soft-dev3-1> (raw)
In-Reply-To: <20230426114655.93672-2-Parthiban.Veerasooran@microchip.com>

The 04/26/2023 17:16, Parthiban Veerasooran wrote:

You didn't add all the maintainers to the thread. Please use
./scripts/get_maintainer.pl

> 
> As per AN1699, the initial configuration in the driver applies to LAN867x
> Rev.B1 hardware revision.
> 
> Signed-off-by: Parthiban Veerasooran <Parthiban.Veerasooran@microchip.com>
> ---
>  drivers/net/phy/microchip_t1s.c | 36 ++++++++++++++++-----------------
>  1 file changed, 18 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/net/phy/microchip_t1s.c b/drivers/net/phy/microchip_t1s.c
> index 094967b3c111..793fb0210605 100644
> --- a/drivers/net/phy/microchip_t1s.c
> +++ b/drivers/net/phy/microchip_t1s.c
> @@ -1,16 +1,16 @@
>  // SPDX-License-Identifier: GPL-2.0+
>  /*
> - * Driver for Microchip 10BASE-T1S LAN867X PHY
> + * Driver for Microchip 10BASE-T1S PHY family
>   *
>   * Support: Microchip Phys:
> - *  lan8670, lan8671, lan8672
> + *  lan8670/1/2 Rev.B1
>   */
> 
>  #include <linux/kernel.h>
>  #include <linux/module.h>
>  #include <linux/phy.h>
> 
> -#define PHY_ID_LAN867X 0x0007C160
> +#define PHY_ID_LAN867X_REVB1 0x0007C162
> 
>  #define LAN867X_REG_IRQ_1_CTL 0x001C
>  #define LAN867X_REG_IRQ_2_CTL 0x001D
> @@ -31,25 +31,25 @@
>   * W   0x1F 0x0099 0x7F80 ------
>   */
> 
> -static const int lan867x_fixup_registers[12] = {
> +static const int lan867x_revb1_fixup_registers[12] = {
>         0x00D0, 0x00D1, 0x0084, 0x0085,
>         0x008A, 0x0087, 0x0088, 0x008B,
>         0x0080, 0x00F1, 0x0096, 0x0099,
>  };
> 
> -static const int lan867x_fixup_values[12] = {
> +static const int lan867x_revb1_fixup_values[12] = {
>         0x0002, 0x0000, 0x3380, 0x0006,
>         0xC000, 0x801C, 0x033F, 0x0404,
>         0x0600, 0x2400, 0x2000, 0x7F80,
>  };
> 
> -static const int lan867x_fixup_masks[12] = {
> +static const int lan867x_revb1_fixup_masks[12] = {
>         0x0E03, 0x0300, 0xFFC0, 0x000F,
>         0xF800, 0x801C, 0x1FFF, 0xFFFF,
>         0x0600, 0x7F00, 0x2000, 0xFFFF,
>  };
> 
> -static int lan867x_config_init(struct phy_device *phydev)
> +static int lan867x_revb1_config_init(struct phy_device *phydev)
>  {
>         /* HW quirk: Microchip states in the application note (AN1699) for the phy
>          * that a set of read-modify-write (rmw) operations has to be performed
> @@ -73,11 +73,11 @@ static int lan867x_config_init(struct phy_device *phydev)
>          * new_val = new_val OR value // Set bits
>          * write_register(mmd, addr, new_val) // Write back updated register value
>          */
> -       for (int i = 0; i < ARRAY_SIZE(lan867x_fixup_registers); i++) {
> -               reg = lan867x_fixup_registers[i];
> +       for (int i = 0; i < ARRAY_SIZE(lan867x_revb1_fixup_registers); i++) {
> +               reg = lan867x_revb1_fixup_registers[i];
>                 reg_value = phy_read_mmd(phydev, MDIO_MMD_VEND2, reg);
> -               reg_value &= ~lan867x_fixup_masks[i];
> -               reg_value |= lan867x_fixup_values[i];
> +               reg_value &= ~lan867x_revb1_fixup_masks[i];
> +               reg_value |= lan867x_revb1_fixup_values[i];
>                 err = phy_write_mmd(phydev, MDIO_MMD_VEND2, reg, reg_value);
>                 if (err != 0)
>                         return err;
> @@ -111,12 +111,12 @@ static int lan867x_read_status(struct phy_device *phydev)
>         return 0;
>  }
> 
> -static struct phy_driver lan867x_driver[] = {
> +static struct phy_driver lan867x_revb1_driver[] = {
>         {
> -               PHY_ID_MATCH_MODEL(PHY_ID_LAN867X),
> -               .name               = "LAN867X",
> +               PHY_ID_MATCH_EXACT(PHY_ID_LAN867X_REVB1),
> +               .name               = "LAN867X Rev.B1",
>                 .features           = PHY_BASIC_T1S_P2MP_FEATURES,
> -               .config_init        = lan867x_config_init,
> +               .config_init        = lan867x_revb1_config_init,
>                 .read_status        = lan867x_read_status,
>                 .get_plca_cfg       = genphy_c45_plca_get_cfg,
>                 .set_plca_cfg       = genphy_c45_plca_set_cfg,
> @@ -124,15 +124,15 @@ static struct phy_driver lan867x_driver[] = {
>         }
>  };
> 
> -module_phy_driver(lan867x_driver);
> +module_phy_driver(lan867x_revb1_driver);
> 
>  static struct mdio_device_id __maybe_unused tbl[] = {
> -       { PHY_ID_MATCH_MODEL(PHY_ID_LAN867X) },
> +       { PHY_ID_MATCH_EXACT(PHY_ID_LAN867X_REVB1) },
>         { }
>  };
> 
>  MODULE_DEVICE_TABLE(mdio, tbl);
> 
> -MODULE_DESCRIPTION("Microchip 10BASE-T1S lan867x Phy driver");
> +MODULE_DESCRIPTION("Microchip 10BASE-T1S Phy driver");
>  MODULE_AUTHOR("Ramón Nordin Rodriguez");
>  MODULE_LICENSE("GPL");
> --
> 2.34.1
> 

-- 
/Horatiu

  reply	other threads:[~2023-04-26 20:56 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-26 11:46 [PATCH net-next 0/2] add driver support for Microchip LAN865X Rev.B0 Internal PHYs Parthiban Veerasooran
2023-04-26 11:46 ` [PATCH net-next 1/2] net: phy: microchip_t1s: update LAN867x PHY supported revision number Parthiban Veerasooran
2023-04-26 20:56   ` Horatiu Vultur [this message]
2023-04-26 11:46 ` [PATCH net-next 2/2] net: phy: microchip_t1s: add support for Microchip LAN865x Rev.B0 PHYs Parthiban Veerasooran
2023-04-26 20:53   ` Ramón Nordin Rodriguez
2023-04-26 21:43     ` Andrew Lunn
2023-04-27 12:28       ` Parthiban.Veerasooran
2023-04-27 14:17     ` Parthiban.Veerasooran
2023-04-26 21:21   ` Horatiu Vultur
2023-04-27 11:28     ` Parthiban.Veerasooran
2023-04-26 21:52   ` Andrew Lunn
2023-04-27 14:19     ` Parthiban.Veerasooran
2023-04-26 22:02   ` Andrew Lunn
2023-04-27 14:23     ` Parthiban.Veerasooran
2023-04-26 20:50 ` [PATCH net-next 0/2] add driver support for Microchip LAN865X Rev.B0 Internal PHYs Horatiu Vultur
2023-04-27  7:07   ` Parthiban.Veerasooran
2023-04-27 11:24     ` Horatiu Vultur - M31836
2023-04-27 14:26       ` Parthiban.Veerasooran

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230426205608.qqx37bnao2l47st5@soft-dev3-1 \
    --to=horatiu.vultur@microchip.com \
    --cc=Parthiban.Veerasooran@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=jan.huber@microchip.com \
    --cc=netdev@vger.kernel.org \
    --cc=ramon.nordin.rodriguez@ferroamp.se \
    --cc=thorsten.kummermehr@microchip.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox