* [PATCH] b53: Add brcm5389 support
@ 2018-05-30 15:33 Damien Thébault
2018-05-30 17:46 ` Florian Fainelli
0 siblings, 1 reply; 3+ messages in thread
From: Damien Thébault @ 2018-05-30 15:33 UTC (permalink / raw)
To: vivien.didelot, f.fainelli, andrew; +Cc: davem, netdev
This patch adds support for the BCM5389 switch connected through MDIO.
Signed-off-by: Damien Thébault <damien.thebault@vitec.com>
---
drivers/net/dsa/b53/b53_common.c | 13 +++++++++++++
drivers/net/dsa/b53/b53_mdio.c | 5 ++++-
drivers/net/dsa/b53/b53_priv.h | 1 +
3 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
index 78616787f2a3..3da5fca77cbd 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -1711,6 +1711,18 @@ static const struct b53_chip_data b53_switch_chips[] = {
.cpu_port = B53_CPU_PORT_25,
.duplex_reg = B53_DUPLEX_STAT_FE,
},
+ {
+ .chip_id = BCM5389_DEVICE_ID,
+ .dev_name = "BCM5389",
+ .vlans = 4096,
+ .enabled_ports = 0x1f,
+ .arl_entries = 4,
+ .cpu_port = B53_CPU_PORT,
+ .vta_regs = B53_VTA_REGS,
+ .duplex_reg = B53_DUPLEX_STAT_GE,
+ .jumbo_pm_reg = B53_JUMBO_PORT_MASK,
+ .jumbo_size_reg = B53_JUMBO_MAX_SIZE,
+ },
{
.chip_id = BCM5395_DEVICE_ID,
.dev_name = "BCM5395",
@@ -2034,6 +2046,7 @@ int b53_switch_detect(struct b53_device *dev)
else
dev->chip_id = BCM5365_DEVICE_ID;
break;
+ case BCM5389_DEVICE_ID:
case BCM5395_DEVICE_ID:
case BCM5397_DEVICE_ID:
case BCM5398_DEVICE_ID:
diff --git a/drivers/net/dsa/b53/b53_mdio.c b/drivers/net/dsa/b53/b53_mdio.c
index fa7556f5d4fb..a533a90e3904 100644
--- a/drivers/net/dsa/b53/b53_mdio.c
+++ b/drivers/net/dsa/b53/b53_mdio.c
@@ -285,6 +285,7 @@ static const struct b53_io_ops b53_mdio_ops = {
#define B53_BRCM_OUI_1 0x0143bc00
#define B53_BRCM_OUI_2 0x03625c00
#define B53_BRCM_OUI_3 0x00406000
+#define B53_BRCM_OUI_4 0x01410c00
static int b53_mdio_probe(struct mdio_device *mdiodev)
{
@@ -311,7 +312,8 @@ static int b53_mdio_probe(struct mdio_device *mdiodev)
*/
if ((phy_id & 0xfffffc00) != B53_BRCM_OUI_1 &&
(phy_id & 0xfffffc00) != B53_BRCM_OUI_2 &&
- (phy_id & 0xfffffc00) != B53_BRCM_OUI_3) {
+ (phy_id & 0xfffffc00) != B53_BRCM_OUI_3 &&
+ (phy_id & 0xfffffc00) != B53_BRCM_OUI_4) {
dev_err(&mdiodev->dev, "Unsupported device: 0x%08x\n", phy_id);
return -ENODEV;
}
@@ -360,6 +362,7 @@ static const struct of_device_id b53_of_match[] = {
{ .compatible = "brcm,bcm53125" },
{ .compatible = "brcm,bcm53128" },
{ .compatible = "brcm,bcm5365" },
+ { .compatible = "brcm,bcm5389" },
{ .compatible = "brcm,bcm5395" },
{ .compatible = "brcm,bcm5397" },
{ .compatible = "brcm,bcm5398" },
diff --git a/drivers/net/dsa/b53/b53_priv.h b/drivers/net/dsa/b53/b53_priv.h
index 1187ebd79287..3b57f47d0e79 100644
--- a/drivers/net/dsa/b53/b53_priv.h
+++ b/drivers/net/dsa/b53/b53_priv.h
@@ -48,6 +48,7 @@ struct b53_io_ops {
enum {
BCM5325_DEVICE_ID = 0x25,
BCM5365_DEVICE_ID = 0x65,
+ BCM5389_DEVICE_ID = 0x89,
BCM5395_DEVICE_ID = 0x95,
BCM5397_DEVICE_ID = 0x97,
BCM5398_DEVICE_ID = 0x98,
--
2.17.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] b53: Add brcm5389 support
2018-05-30 15:33 [PATCH] b53: Add brcm5389 support Damien Thébault
@ 2018-05-30 17:46 ` Florian Fainelli
2018-05-31 7:02 ` Damien Thébault
0 siblings, 1 reply; 3+ messages in thread
From: Florian Fainelli @ 2018-05-30 17:46 UTC (permalink / raw)
To: Damien Thébault, vivien.didelot, andrew; +Cc: davem, netdev
On 05/30/2018 08:33 AM, Damien Thébault wrote:
> This patch adds support for the BCM5389 switch connected through MDIO.
This looks good, please do address the following couple of things:
- subject should be: net: dsa: b53: Add BCM5389 support
- you also need to update
Documentation/devicetree/bindings/net/dsa/b53.txt with the compatible string
Thank you!
>
> Signed-off-by: Damien Thébault <damien.thebault@vitec.com>
> ---
> drivers/net/dsa/b53/b53_common.c | 13 +++++++++++++
> drivers/net/dsa/b53/b53_mdio.c | 5 ++++-
> drivers/net/dsa/b53/b53_priv.h | 1 +
> 3 files changed, 18 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
> index 78616787f2a3..3da5fca77cbd 100644
> --- a/drivers/net/dsa/b53/b53_common.c
> +++ b/drivers/net/dsa/b53/b53_common.c
> @@ -1711,6 +1711,18 @@ static const struct b53_chip_data b53_switch_chips[] = {
> .cpu_port = B53_CPU_PORT_25,
> .duplex_reg = B53_DUPLEX_STAT_FE,
> },
> + {
> + .chip_id = BCM5389_DEVICE_ID,
> + .dev_name = "BCM5389",
> + .vlans = 4096,
> + .enabled_ports = 0x1f,
> + .arl_entries = 4,
> + .cpu_port = B53_CPU_PORT,
> + .vta_regs = B53_VTA_REGS,
> + .duplex_reg = B53_DUPLEX_STAT_GE,
> + .jumbo_pm_reg = B53_JUMBO_PORT_MASK,
> + .jumbo_size_reg = B53_JUMBO_MAX_SIZE,
> + },
> {
> .chip_id = BCM5395_DEVICE_ID,
> .dev_name = "BCM5395",
> @@ -2034,6 +2046,7 @@ int b53_switch_detect(struct b53_device *dev)
> else
> dev->chip_id = BCM5365_DEVICE_ID;
> break;
> + case BCM5389_DEVICE_ID:
> case BCM5395_DEVICE_ID:
> case BCM5397_DEVICE_ID:
> case BCM5398_DEVICE_ID:
> diff --git a/drivers/net/dsa/b53/b53_mdio.c b/drivers/net/dsa/b53/b53_mdio.c
> index fa7556f5d4fb..a533a90e3904 100644
> --- a/drivers/net/dsa/b53/b53_mdio.c
> +++ b/drivers/net/dsa/b53/b53_mdio.c
> @@ -285,6 +285,7 @@ static const struct b53_io_ops b53_mdio_ops = {
> #define B53_BRCM_OUI_1 0x0143bc00
> #define B53_BRCM_OUI_2 0x03625c00
> #define B53_BRCM_OUI_3 0x00406000
> +#define B53_BRCM_OUI_4 0x01410c00
>
> static int b53_mdio_probe(struct mdio_device *mdiodev)
> {
> @@ -311,7 +312,8 @@ static int b53_mdio_probe(struct mdio_device *mdiodev)
> */
> if ((phy_id & 0xfffffc00) != B53_BRCM_OUI_1 &&
> (phy_id & 0xfffffc00) != B53_BRCM_OUI_2 &&
> - (phy_id & 0xfffffc00) != B53_BRCM_OUI_3) {
> + (phy_id & 0xfffffc00) != B53_BRCM_OUI_3 &&
> + (phy_id & 0xfffffc00) != B53_BRCM_OUI_4) {
> dev_err(&mdiodev->dev, "Unsupported device: 0x%08x\n", phy_id);
> return -ENODEV;
> }
> @@ -360,6 +362,7 @@ static const struct of_device_id b53_of_match[] = {
> { .compatible = "brcm,bcm53125" },
> { .compatible = "brcm,bcm53128" },
> { .compatible = "brcm,bcm5365" },
> + { .compatible = "brcm,bcm5389" },
> { .compatible = "brcm,bcm5395" },
> { .compatible = "brcm,bcm5397" },
> { .compatible = "brcm,bcm5398" },
> diff --git a/drivers/net/dsa/b53/b53_priv.h b/drivers/net/dsa/b53/b53_priv.h
> index 1187ebd79287..3b57f47d0e79 100644
> --- a/drivers/net/dsa/b53/b53_priv.h
> +++ b/drivers/net/dsa/b53/b53_priv.h
> @@ -48,6 +48,7 @@ struct b53_io_ops {
> enum {
> BCM5325_DEVICE_ID = 0x25,
> BCM5365_DEVICE_ID = 0x65,
> + BCM5389_DEVICE_ID = 0x89,
> BCM5395_DEVICE_ID = 0x95,
> BCM5397_DEVICE_ID = 0x97,
> BCM5398_DEVICE_ID = 0x98,
>
--
Florian
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] b53: Add brcm5389 support
2018-05-30 17:46 ` Florian Fainelli
@ 2018-05-31 7:02 ` Damien Thébault
0 siblings, 0 replies; 3+ messages in thread
From: Damien Thébault @ 2018-05-31 7:02 UTC (permalink / raw)
To: vivien.didelot, f.fainelli, andrew; +Cc: davem, netdev
Hello Florian,
Thanks for your feedback, I will send a v2 with those changes.
Regards
On Wed, 2018-05-30 at 10:46 -0700, Florian Fainelli wrote:
>
> On 05/30/2018 08:33 AM, Damien Thébault wrote:
> > This patch adds support for the BCM5389 switch connected through
> > MDIO.
>
> This looks good, please do address the following couple of things:
> - subject should be: net: dsa: b53: Add BCM5389 support
> - you also need to update
> Documentation/devicetree/bindings/net/dsa/b53.txt with the compatible
> string
>
> Thank you!
>
> >
> > Signed-off-by: Damien Thébault <damien.thebault@vitec.com>
> > ---
> > drivers/net/dsa/b53/b53_common.c | 13 +++++++++++++
> > drivers/net/dsa/b53/b53_mdio.c | 5 ++++-
> > drivers/net/dsa/b53/b53_priv.h | 1 +
> > 3 files changed, 18 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/dsa/b53/b53_common.c
> > b/drivers/net/dsa/b53/b53_common.c
> > index 78616787f2a3..3da5fca77cbd 100644
> > --- a/drivers/net/dsa/b53/b53_common.c
> > +++ b/drivers/net/dsa/b53/b53_common.c
> > @@ -1711,6 +1711,18 @@ static const struct b53_chip_data
> > b53_switch_chips[] = {
> > .cpu_port = B53_CPU_PORT_25,
> > .duplex_reg = B53_DUPLEX_STAT_FE,
> > },
> > + {
> > + .chip_id = BCM5389_DEVICE_ID,
> > + .dev_name = "BCM5389",
> > + .vlans = 4096,
> > + .enabled_ports = 0x1f,
> > + .arl_entries = 4,
> > + .cpu_port = B53_CPU_PORT,
> > + .vta_regs = B53_VTA_REGS,
> > + .duplex_reg = B53_DUPLEX_STAT_GE,
> > + .jumbo_pm_reg = B53_JUMBO_PORT_MASK,
> > + .jumbo_size_reg = B53_JUMBO_MAX_SIZE,
> > + },
> > {
> > .chip_id = BCM5395_DEVICE_ID,
> > .dev_name = "BCM5395",
> > @@ -2034,6 +2046,7 @@ int b53_switch_detect(struct b53_device *dev)
> > else
> > dev->chip_id = BCM5365_DEVICE_ID;
> > break;
> > + case BCM5389_DEVICE_ID:
> > case BCM5395_DEVICE_ID:
> > case BCM5397_DEVICE_ID:
> > case BCM5398_DEVICE_ID:
> > diff --git a/drivers/net/dsa/b53/b53_mdio.c
> > b/drivers/net/dsa/b53/b53_mdio.c
> > index fa7556f5d4fb..a533a90e3904 100644
> > --- a/drivers/net/dsa/b53/b53_mdio.c
> > +++ b/drivers/net/dsa/b53/b53_mdio.c
> > @@ -285,6 +285,7 @@ static const struct b53_io_ops b53_mdio_ops = {
> > #define B53_BRCM_OUI_1 0x0143bc00
> > #define B53_BRCM_OUI_2 0x03625c00
> > #define B53_BRCM_OUI_3 0x00406000
> > +#define B53_BRCM_OUI_4 0x01410c00
> >
> > static int b53_mdio_probe(struct mdio_device *mdiodev)
> > {
> > @@ -311,7 +312,8 @@ static int b53_mdio_probe(struct mdio_device
> > *mdiodev)
> > */
> > if ((phy_id & 0xfffffc00) != B53_BRCM_OUI_1 &&
> > (phy_id & 0xfffffc00) != B53_BRCM_OUI_2 &&
> > - (phy_id & 0xfffffc00) != B53_BRCM_OUI_3) {
> > + (phy_id & 0xfffffc00) != B53_BRCM_OUI_3 &&
> > + (phy_id & 0xfffffc00) != B53_BRCM_OUI_4) {
> > dev_err(&mdiodev->dev, "Unsupported device:
> > 0x%08x\n", phy_id);
> > return -ENODEV;
> > }
> > @@ -360,6 +362,7 @@ static const struct of_device_id b53_of_match[]
> > = {
> > { .compatible = "brcm,bcm53125" },
> > { .compatible = "brcm,bcm53128" },
> > { .compatible = "brcm,bcm5365" },
> > + { .compatible = "brcm,bcm5389" },
> > { .compatible = "brcm,bcm5395" },
> > { .compatible = "brcm,bcm5397" },
> > { .compatible = "brcm,bcm5398" },
> > diff --git a/drivers/net/dsa/b53/b53_priv.h
> > b/drivers/net/dsa/b53/b53_priv.h
> > index 1187ebd79287..3b57f47d0e79 100644
> > --- a/drivers/net/dsa/b53/b53_priv.h
> > +++ b/drivers/net/dsa/b53/b53_priv.h
> > @@ -48,6 +48,7 @@ struct b53_io_ops {
> > enum {
> > BCM5325_DEVICE_ID = 0x25,
> > BCM5365_DEVICE_ID = 0x65,
> > + BCM5389_DEVICE_ID = 0x89,
> > BCM5395_DEVICE_ID = 0x95,
> > BCM5397_DEVICE_ID = 0x97,
> > BCM5398_DEVICE_ID = 0x98,
> >
>
>
--
Damien Thébault
R&D Engineer
VITEC
T. +33 1 46 73 06 06
F. +33 9 59 85 99 92
E. damien.thebault@vitec.com
http://www.vitec.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-05-31 7:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-30 15:33 [PATCH] b53: Add brcm5389 support Damien Thébault
2018-05-30 17:46 ` Florian Fainelli
2018-05-31 7:02 ` Damien Thébault
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.