Message ID | 1451900573-22657-3-git-send-email-narmstrong@baylibre.com |
---|---|
State | Changes Requested, archived |
Delegated to: | David Miller |
Headers | show |
Le 04/01/2016 10:42, Neil Armstrong a écrit : > Declare a new SoC variant for NPx SoCs having USRIO_DISABLED as > capability bit. > > Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> > --- > drivers/net/ethernet/cadence/macb.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c > index fa53bc3..a9e27a7 100644 > --- a/drivers/net/ethernet/cadence/macb.c > +++ b/drivers/net/ethernet/cadence/macb.c > @@ -2781,6 +2781,11 @@ static const struct macb_config emac_config = { > .init = at91ether_init, > }; > > +static const struct macb_config npx_config = { > + .caps = MACB_CAPS_USRIO_DISABLED, > + .clk_init = macb_clk_init, > + .init = macb_init, > +}; > > static const struct macb_config zynqmp_config = { > .caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_JUMBO, > @@ -2801,6 +2806,7 @@ static const struct of_device_id macb_dt_ids[] = { > { .compatible = "cdns,at32ap7000-macb" }, > { .compatible = "cdns,at91sam9260-macb", .data = &at91sam9260_config }, > { .compatible = "cdns,macb" }, > + { .compatible = "cdns,npx-macb", .data = &npx_config }, I can accept that, but I think that you'd better make your device tree compatibility string *not* generic. Name it by the first NPx SoC or perfectly compatible SoC family that has this configuration and you'll be able to make the NP(x+1) compatible with it. It has proven to be much more future proof and even if in the early days of DT on ARM we accepted some binding with generic strings like this one below, It has proven to be a mistake. > { .compatible = "cdns,gem", .data = &pc302gem_config }, > { .compatible = "atmel,sama5d2-gem", .data = &sama5d2_config }, >
On 01/04/2016 11:38 AM, Nicolas Ferre wrote: > Le 04/01/2016 10:42, Neil Armstrong a écrit : >> static const struct macb_config zynqmp_config = { >> .caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_JUMBO, >> @@ -2801,6 +2806,7 @@ static const struct of_device_id macb_dt_ids[] = { >> { .compatible = "cdns,at32ap7000-macb" }, >> { .compatible = "cdns,at91sam9260-macb", .data = &at91sam9260_config }, >> { .compatible = "cdns,macb" }, >> + { .compatible = "cdns,npx-macb", .data = &npx_config }, > > I can accept that, but I think that you'd better make your device tree > compatibility string *not* generic. Name it by the first NPx SoC or > perfectly compatible SoC family that has this configuration and you'll > be able to make the NP(x+1) compatible with it. Well, the first Soc having this configuration is Np4, would cdns,np4-macb be ok ? > > It has proven to be much more future proof and even if in the early days > of DT on ARM we accepted some binding with generic strings like this one > below, It has proven to be a mistake. > >> { .compatible = "cdns,gem", .data = &pc302gem_config }, >> { .compatible = "atmel,sama5d2-gem", .data = &sama5d2_config }, >> > > Neil -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Le 05/01/2016 13:20, Neil Armstrong a écrit : > On 01/04/2016 11:38 AM, Nicolas Ferre wrote: >> Le 04/01/2016 10:42, Neil Armstrong a écrit : >>> static const struct macb_config zynqmp_config = { >>> .caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_JUMBO, >>> @@ -2801,6 +2806,7 @@ static const struct of_device_id macb_dt_ids[] = { >>> { .compatible = "cdns,at32ap7000-macb" }, >>> { .compatible = "cdns,at91sam9260-macb", .data = &at91sam9260_config }, >>> { .compatible = "cdns,macb" }, >>> + { .compatible = "cdns,npx-macb", .data = &npx_config }, >> >> I can accept that, but I think that you'd better make your device tree >> compatibility string *not* generic. Name it by the first NPx SoC or >> perfectly compatible SoC family that has this configuration and you'll >> be able to make the NP(x+1) compatible with it. > Well, the first Soc having this configuration is Np4, would cdns,np4-macb be ok ? Yes, absolutely. Thanks >> It has proven to be much more future proof and even if in the early days >> of DT on ARM we accepted some binding with generic strings like this one >> below, It has proven to be a mistake. >> >>> { .compatible = "cdns,gem", .data = &pc302gem_config }, >>> { .compatible = "atmel,sama5d2-gem", .data = &sama5d2_config }, >>> >> >> > > Neil >
diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c index fa53bc3..a9e27a7 100644 --- a/drivers/net/ethernet/cadence/macb.c +++ b/drivers/net/ethernet/cadence/macb.c @@ -2781,6 +2781,11 @@ static const struct macb_config emac_config = { .init = at91ether_init, }; +static const struct macb_config npx_config = { + .caps = MACB_CAPS_USRIO_DISABLED, + .clk_init = macb_clk_init, + .init = macb_init, +}; static const struct macb_config zynqmp_config = { .caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_JUMBO, @@ -2801,6 +2806,7 @@ static const struct of_device_id macb_dt_ids[] = { { .compatible = "cdns,at32ap7000-macb" }, { .compatible = "cdns,at91sam9260-macb", .data = &at91sam9260_config }, { .compatible = "cdns,macb" }, + { .compatible = "cdns,npx-macb", .data = &npx_config }, { .compatible = "cdns,pc302-gem", .data = &pc302gem_config }, { .compatible = "cdns,gem", .data = &pc302gem_config }, { .compatible = "atmel,sama5d2-gem", .data = &sama5d2_config },
Declare a new SoC variant for NPx SoCs having USRIO_DISABLED as capability bit. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> --- drivers/net/ethernet/cadence/macb.c | 6 ++++++ 1 file changed, 6 insertions(+)