netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: dsa: microchip: add ksz9563 to ksz9477 I2C driver
@ 2020-10-07  9:30 Christian Eggers
  2020-10-07 12:21 ` Andrew Lunn
  2020-10-07 13:20 ` Andrew Lunn
  0 siblings, 2 replies; 6+ messages in thread
From: Christian Eggers @ 2020-10-07  9:30 UTC (permalink / raw)
  To: Woojung Huh, Microchip Linux Driver Support, Andrew Lunn,
	Vivien Didelot, Florian Fainelli, Vladimir Oltean,
	David S . Miller, Jakub Kicinski
  Cc: netdev, linux-kernel, Christian Eggers

Add support for the KSZ9563 3-Port Gigabit Ethernet Switch to the
ksz9477 driver. The KSZ9563 supports both SPI (already in) and I2C. The
ksz9563 is already in the device tree binding documentation.

Signed-off-by: Christian Eggers <ceggers@arri.de>
---
 drivers/net/dsa/microchip/ksz9477_i2c.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/dsa/microchip/ksz9477_i2c.c b/drivers/net/dsa/microchip/ksz9477_i2c.c
index 7951f52d860d..4e053a25d077 100644
--- a/drivers/net/dsa/microchip/ksz9477_i2c.c
+++ b/drivers/net/dsa/microchip/ksz9477_i2c.c
@@ -80,6 +80,7 @@ static const struct of_device_id ksz9477_dt_ids[] = {
 	{ .compatible = "microchip,ksz9477" },
 	{ .compatible = "microchip,ksz9897" },
 	{ .compatible = "microchip,ksz9893" },
+	{ .compatible = "microchip,ksz9563" },
 	{ .compatible = "microchip,ksz9567" },
 	{},
 };
-- 
Christian Eggers
Embedded software developer

Arnold & Richter Cine Technik GmbH & Co. Betriebs KG
Sitz: Muenchen - Registergericht: Amtsgericht Muenchen - Handelsregisternummer: HRA 57918
Persoenlich haftender Gesellschafter: Arnold & Richter Cine Technik GmbH
Sitz: Muenchen - Registergericht: Amtsgericht Muenchen - Handelsregisternummer: HRB 54477
Geschaeftsfuehrer: Dr. Michael Neuhaeuser; Stephan Schenk; Walter Trauninger; Markus Zeiler


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next] net: dsa: microchip: add ksz9563 to ksz9477 I2C driver
  2020-10-07  9:30 [PATCH net-next] net: dsa: microchip: add ksz9563 to ksz9477 I2C driver Christian Eggers
@ 2020-10-07 12:21 ` Andrew Lunn
  2020-10-07 13:13   ` Christian Eggers
  2020-10-07 13:20 ` Andrew Lunn
  1 sibling, 1 reply; 6+ messages in thread
From: Andrew Lunn @ 2020-10-07 12:21 UTC (permalink / raw)
  To: Christian Eggers
  Cc: Woojung Huh, Microchip Linux Driver Support, Vivien Didelot,
	Florian Fainelli, Vladimir Oltean, David S . Miller,
	Jakub Kicinski, netdev, linux-kernel

On Wed, Oct 07, 2020 at 11:30:49AM +0200, Christian Eggers wrote:
> Add support for the KSZ9563 3-Port Gigabit Ethernet Switch to the
> ksz9477 driver. The KSZ9563 supports both SPI (already in) and I2C. The
> ksz9563 is already in the device tree binding documentation.

Hi Christian

What chip_id values does it use? I don't see it listed in
ksz9477_switch_chips.

Thanks
	Andrew

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next] net: dsa: microchip: add ksz9563 to ksz9477 I2C driver
  2020-10-07 12:21 ` Andrew Lunn
@ 2020-10-07 13:13   ` Christian Eggers
  2020-10-07 13:19     ` Andrew Lunn
  0 siblings, 1 reply; 6+ messages in thread
From: Christian Eggers @ 2020-10-07 13:13 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Woojung Huh, Microchip Linux Driver Support, Vivien Didelot,
	Florian Fainelli, Vladimir Oltean, David S . Miller,
	Jakub Kicinski, netdev, linux-kernel

Hi Andrew,

> What chip_id values does it use? I don't see it listed in
> ksz9477_switch_chips.

here a short dump of the first chip registers:

>         Chip ID0     00
>         Chip ID1_2   9893      Chip ID      9893
>         Chip ID3     60        Revision ID  6              Reset         normal
>         Chip ID4     1C        SKU ID       1C

In ksz9477_switch_detect(), the 32 bit value is built from only
the 2 middle bytes: 0x00989300. The number of port (3) is also
assigned within this function:

> 	if ((id_lo & 0xf) == 3) {
> 		/* Chip is from KSZ9893 design. */
> 		dev->features |= IS_9893;
> 		/* Chip does not support gigabit. */
> 		if (data8 & SW_QW_ABLE)
> 			dev->features &= ~GBIT_SUPPORT;
> 		dev->mib_port_cnt = 3;
> 		dev->phy_port_cnt = 2;
> 	} ...

The chip id 0x00989300 does already exist in ksz9477_switch_chips:

> 	{
> 		.chip_id = 0x00989300,
> 		.dev_name = "KSZ9893",
> 		.num_vlans = 4096,
> 		.num_alus = 4096,
> 		.num_statics = 16,
> 		.cpu_ports = 0x07,	/* can be configured as cpu port */
> 		.port_cnt = 3,		/* total port count */
> 	},

But my chip is really a KSZ9563.

Best regards
Christian




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next] net: dsa: microchip: add ksz9563 to ksz9477 I2C driver
  2020-10-07 13:13   ` Christian Eggers
@ 2020-10-07 13:19     ` Andrew Lunn
  0 siblings, 0 replies; 6+ messages in thread
From: Andrew Lunn @ 2020-10-07 13:19 UTC (permalink / raw)
  To: Christian Eggers
  Cc: Woojung Huh, Microchip Linux Driver Support, Vivien Didelot,
	Florian Fainelli, Vladimir Oltean, David S . Miller,
	Jakub Kicinski, netdev, linux-kernel

On Wed, Oct 07, 2020 at 03:13:15PM +0200, Christian Eggers wrote:
> Hi Andrew,
> 
> > What chip_id values does it use? I don't see it listed in
> > ksz9477_switch_chips.
> 
> here a short dump of the first chip registers:
> 
> >         Chip ID0     00
> >         Chip ID1_2   9893      Chip ID      9893
> >         Chip ID3     60        Revision ID  6              Reset         normal
> >         Chip ID4     1C        SKU ID       1C
> 
> In ksz9477_switch_detect(), the 32 bit value is built from only
> the 2 middle bytes: 0x00989300. The number of port (3) is also
> assigned within this function:
> 
> > 	if ((id_lo & 0xf) == 3) {
> > 		/* Chip is from KSZ9893 design. */
> > 		dev->features |= IS_9893;
> > 		/* Chip does not support gigabit. */
> > 		if (data8 & SW_QW_ABLE)
> > 			dev->features &= ~GBIT_SUPPORT;
> > 		dev->mib_port_cnt = 3;
> > 		dev->phy_port_cnt = 2;
> > 	} ...
> 
> The chip id 0x00989300 does already exist in ksz9477_switch_chips:
> 
> > 	{
> > 		.chip_id = 0x00989300,
> > 		.dev_name = "KSZ9893",

O.K. Thanks. This is not very clear. Maybe add a follow up patch which
adds some comments?

     Andrew

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next] net: dsa: microchip: add ksz9563 to ksz9477 I2C driver
  2020-10-07  9:30 [PATCH net-next] net: dsa: microchip: add ksz9563 to ksz9477 I2C driver Christian Eggers
  2020-10-07 12:21 ` Andrew Lunn
@ 2020-10-07 13:20 ` Andrew Lunn
  2020-10-09 20:08   ` Jakub Kicinski
  1 sibling, 1 reply; 6+ messages in thread
From: Andrew Lunn @ 2020-10-07 13:20 UTC (permalink / raw)
  To: Christian Eggers
  Cc: Woojung Huh, Microchip Linux Driver Support, Vivien Didelot,
	Florian Fainelli, Vladimir Oltean, David S . Miller,
	Jakub Kicinski, netdev, linux-kernel

On Wed, Oct 07, 2020 at 11:30:49AM +0200, Christian Eggers wrote:
> Add support for the KSZ9563 3-Port Gigabit Ethernet Switch to the
> ksz9477 driver. The KSZ9563 supports both SPI (already in) and I2C. The
> ksz9563 is already in the device tree binding documentation.
> 
> Signed-off-by: Christian Eggers <ceggers@arri.de>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next] net: dsa: microchip: add ksz9563 to ksz9477 I2C driver
  2020-10-07 13:20 ` Andrew Lunn
@ 2020-10-09 20:08   ` Jakub Kicinski
  0 siblings, 0 replies; 6+ messages in thread
From: Jakub Kicinski @ 2020-10-09 20:08 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Christian Eggers, Woojung Huh, Microchip Linux Driver Support,
	Vivien Didelot, Florian Fainelli, Vladimir Oltean,
	David S . Miller, netdev, linux-kernel

On Wed, 7 Oct 2020 15:20:02 +0200 Andrew Lunn wrote:
> On Wed, Oct 07, 2020 at 11:30:49AM +0200, Christian Eggers wrote:
> > Add support for the KSZ9563 3-Port Gigabit Ethernet Switch to the
> > ksz9477 driver. The KSZ9563 supports both SPI (already in) and I2C. The
> > ksz9563 is already in the device tree binding documentation.
> > 
> > Signed-off-by: Christian Eggers <ceggers@arri.de>  
> 
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>

Applied, thanks!

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-10-09 20:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-07  9:30 [PATCH net-next] net: dsa: microchip: add ksz9563 to ksz9477 I2C driver Christian Eggers
2020-10-07 12:21 ` Andrew Lunn
2020-10-07 13:13   ` Christian Eggers
2020-10-07 13:19     ` Andrew Lunn
2020-10-07 13:20 ` Andrew Lunn
2020-10-09 20:08   ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).