mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] net: dsa: ksz9477: fix confusing message detecting KSZ9893 compatible
@ 2023-01-10 13:38 Ahmad Fatoum
  2023-01-10 13:38 ` [PATCH 2/2] net: dsa: ksz9477: match microchip,ksz8563 compatible Ahmad Fatoum
  2023-01-10 14:32 ` [PATCH 1/2] net: dsa: ksz9477: fix confusing message detecting KSZ9893 compatible Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2023-01-10 13:38 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

I have a KSZ8563RNXI-TR, which while it works, barebox reports as
"Found KSZ9893", which is a bit confusing. For non-KSZ9893, barebox
reports "Found KSZ9477 or compatible", so do likewise for KSZ9893.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/net/ksz9477.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ksz9477.c b/drivers/net/ksz9477.c
index b3859e13bf13..0629efbd7d02 100644
--- a/drivers/net/ksz9477.c
+++ b/drivers/net/ksz9477.c
@@ -82,7 +82,7 @@ static int ksz9477_switch_detect(struct ksz_switch *priv)
 	id_lo = (u8)(id32 >> 8);
 	if ((id_lo & 0xf) == 3) {
 		/* Chip is from KSZ9893 design. */
-		dev_info(priv->dev, "Found KSZ9893\n");
+		dev_info(priv->dev, "Found KSZ9893 or compatible\n");
 		priv->features |= IS_9893;
 		priv->features &= ~KSZ9477_PHY_ERRATA;
 
-- 
2.30.2




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

* [PATCH 2/2] net: dsa: ksz9477: match microchip,ksz8563 compatible
  2023-01-10 13:38 [PATCH 1/2] net: dsa: ksz9477: fix confusing message detecting KSZ9893 compatible Ahmad Fatoum
@ 2023-01-10 13:38 ` Ahmad Fatoum
  2023-01-10 14:32 ` [PATCH 1/2] net: dsa: ksz9477: fix confusing message detecting KSZ9893 compatible Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2023-01-10 13:38 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

Tested on an i.MX8MN board communicating with the switch
over I2C. The IC says KSZ9563RNXI, but is detected as KSZ9893:

  ksz9477-i2c ksz85630: Found KSZ9893
  ksz9477-i2c ksz85630: chip id: 0x00989360

This is the same in Linux, but switch works though. I2C support
will follow separately.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/net/ksz9477.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ksz9477.c b/drivers/net/ksz9477.c
index 0629efbd7d02..1da57736f2ea 100644
--- a/drivers/net/ksz9477.c
+++ b/drivers/net/ksz9477.c
@@ -469,6 +469,7 @@ static int microchip_switch_probe(struct device *dev)
 }
 
 static const struct of_device_id microchip_switch_dt_ids[] = {
+	{ .compatible = "microchip,ksz8563" },
 	{ .compatible = "microchip,ksz9477" },
 	{ .compatible = "microchip,ksz9563" },
 	{ }
-- 
2.30.2




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

* Re: [PATCH 1/2] net: dsa: ksz9477: fix confusing message detecting KSZ9893 compatible
  2023-01-10 13:38 [PATCH 1/2] net: dsa: ksz9477: fix confusing message detecting KSZ9893 compatible Ahmad Fatoum
  2023-01-10 13:38 ` [PATCH 2/2] net: dsa: ksz9477: match microchip,ksz8563 compatible Ahmad Fatoum
@ 2023-01-10 14:32 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2023-01-10 14:32 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

On Tue, Jan 10, 2023 at 02:38:16PM +0100, Ahmad Fatoum wrote:
> I have a KSZ8563RNXI-TR, which while it works, barebox reports as
> "Found KSZ9893", which is a bit confusing. For non-KSZ9893, barebox
> reports "Found KSZ9477 or compatible", so do likewise for KSZ9893.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>  drivers/net/ksz9477.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks

Sascha

> 
> diff --git a/drivers/net/ksz9477.c b/drivers/net/ksz9477.c
> index b3859e13bf13..0629efbd7d02 100644
> --- a/drivers/net/ksz9477.c
> +++ b/drivers/net/ksz9477.c
> @@ -82,7 +82,7 @@ static int ksz9477_switch_detect(struct ksz_switch *priv)
>  	id_lo = (u8)(id32 >> 8);
>  	if ((id_lo & 0xf) == 3) {
>  		/* Chip is from KSZ9893 design. */
> -		dev_info(priv->dev, "Found KSZ9893\n");
> +		dev_info(priv->dev, "Found KSZ9893 or compatible\n");
>  		priv->features |= IS_9893;
>  		priv->features &= ~KSZ9477_PHY_ERRATA;
>  
> -- 
> 2.30.2
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



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

end of thread, other threads:[~2023-01-10 14:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-10 13:38 [PATCH 1/2] net: dsa: ksz9477: fix confusing message detecting KSZ9893 compatible Ahmad Fatoum
2023-01-10 13:38 ` [PATCH 2/2] net: dsa: ksz9477: match microchip,ksz8563 compatible Ahmad Fatoum
2023-01-10 14:32 ` [PATCH 1/2] net: dsa: ksz9477: fix confusing message detecting KSZ9893 compatible Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox