* [PATCH v4 0/2] Extend Sparx5 switch reset driver for lan966x @ 2021-10-18 9:15 ` Horatiu Vultur 0 siblings, 0 replies; 12+ messages in thread From: Horatiu Vultur @ 2021-10-18 9:15 UTC (permalink / raw) To: p.zabel, robh+dt, lars.povlsen, Steen.Hegelund, UNGLinuxDriver, devicetree, linux-kernel, linux-arm-kernel Cc: Horatiu Vultur This patch serie extends the Microchip Sparx5 reset driver to support lan966x v3->v4: - drop all the changes regarding the phy reset. - use enum instead oneOf in dt-bindings v2->v3: - rename variable reset_gpio to phy_reset_gpio - rename gpios property in documentation to phy-reset-gpios v1->v2: - add reviewed-by tag - extend driver to be able to release the reset also for external PHYs Horatiu Vultur (2): dt-bindings: reset: Add lan966x support reset: mchp: sparx5: Extend support for lan966x .../bindings/reset/microchip,rst.yaml | 4 +- drivers/reset/Kconfig | 2 +- drivers/reset/reset-microchip-sparx5.c | 40 +++++++++++++++---- 3 files changed, 36 insertions(+), 10 deletions(-) -- 2.33.0 ^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v4 0/2] Extend Sparx5 switch reset driver for lan966x @ 2021-10-18 9:15 ` Horatiu Vultur 0 siblings, 0 replies; 12+ messages in thread From: Horatiu Vultur @ 2021-10-18 9:15 UTC (permalink / raw) To: p.zabel, robh+dt, lars.povlsen, Steen.Hegelund, UNGLinuxDriver, devicetree, linux-kernel, linux-arm-kernel Cc: Horatiu Vultur This patch serie extends the Microchip Sparx5 reset driver to support lan966x v3->v4: - drop all the changes regarding the phy reset. - use enum instead oneOf in dt-bindings v2->v3: - rename variable reset_gpio to phy_reset_gpio - rename gpios property in documentation to phy-reset-gpios v1->v2: - add reviewed-by tag - extend driver to be able to release the reset also for external PHYs Horatiu Vultur (2): dt-bindings: reset: Add lan966x support reset: mchp: sparx5: Extend support for lan966x .../bindings/reset/microchip,rst.yaml | 4 +- drivers/reset/Kconfig | 2 +- drivers/reset/reset-microchip-sparx5.c | 40 +++++++++++++++---- 3 files changed, 36 insertions(+), 10 deletions(-) -- 2.33.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v4 1/2] dt-bindings: reset: Add lan966x support 2021-10-18 9:15 ` Horatiu Vultur @ 2021-10-18 9:15 ` Horatiu Vultur -1 siblings, 0 replies; 12+ messages in thread From: Horatiu Vultur @ 2021-10-18 9:15 UTC (permalink / raw) To: p.zabel, robh+dt, lars.povlsen, Steen.Hegelund, UNGLinuxDriver, devicetree, linux-kernel, linux-arm-kernel Cc: Horatiu Vultur This patch extends the existing file microchip,rst.yaml to support also the lan966x. For this is added only a new compatible string. Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com> --- Documentation/devicetree/bindings/reset/microchip,rst.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/reset/microchip,rst.yaml b/Documentation/devicetree/bindings/reset/microchip,rst.yaml index 370579aeeca1..578bfa529b16 100644 --- a/Documentation/devicetree/bindings/reset/microchip,rst.yaml +++ b/Documentation/devicetree/bindings/reset/microchip,rst.yaml @@ -20,7 +20,9 @@ properties: pattern: "^reset-controller@[0-9a-f]+$" compatible: - const: microchip,sparx5-switch-reset + enum: + - microchip,sparx5-switch-reset + - microchip,lan966x-switch-reset reg: items: -- 2.33.0 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v4 1/2] dt-bindings: reset: Add lan966x support @ 2021-10-18 9:15 ` Horatiu Vultur 0 siblings, 0 replies; 12+ messages in thread From: Horatiu Vultur @ 2021-10-18 9:15 UTC (permalink / raw) To: p.zabel, robh+dt, lars.povlsen, Steen.Hegelund, UNGLinuxDriver, devicetree, linux-kernel, linux-arm-kernel Cc: Horatiu Vultur This patch extends the existing file microchip,rst.yaml to support also the lan966x. For this is added only a new compatible string. Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com> --- Documentation/devicetree/bindings/reset/microchip,rst.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/reset/microchip,rst.yaml b/Documentation/devicetree/bindings/reset/microchip,rst.yaml index 370579aeeca1..578bfa529b16 100644 --- a/Documentation/devicetree/bindings/reset/microchip,rst.yaml +++ b/Documentation/devicetree/bindings/reset/microchip,rst.yaml @@ -20,7 +20,9 @@ properties: pattern: "^reset-controller@[0-9a-f]+$" compatible: - const: microchip,sparx5-switch-reset + enum: + - microchip,sparx5-switch-reset + - microchip,lan966x-switch-reset reg: items: -- 2.33.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v4 2/2] reset: mchp: sparx5: Extend support for lan966x 2021-10-18 9:15 ` Horatiu Vultur @ 2021-10-18 9:15 ` Horatiu Vultur -1 siblings, 0 replies; 12+ messages in thread From: Horatiu Vultur @ 2021-10-18 9:15 UTC (permalink / raw) To: p.zabel, robh+dt, lars.povlsen, Steen.Hegelund, UNGLinuxDriver, devicetree, linux-kernel, linux-arm-kernel Cc: Horatiu Vultur, Andrew Lunn This patch extends sparx5 driver to support also the lan966x. The process to reset the switch is the same only it has different offsets. Therefore make the driver more generic and add support for lan966x. Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> --- drivers/reset/Kconfig | 2 +- drivers/reset/reset-microchip-sparx5.c | 40 ++++++++++++++++++++------ 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig index be799a5abf8a..36ce6c8bcf1e 100644 --- a/drivers/reset/Kconfig +++ b/drivers/reset/Kconfig @@ -116,7 +116,7 @@ config RESET_LPC18XX config RESET_MCHP_SPARX5 bool "Microchip Sparx5 reset driver" - depends on ARCH_SPARX5 || COMPILE_TEST + depends on ARCH_SPARX5 || SOC_LAN966 || COMPILE_TEST default y if SPARX5_SWITCH select MFD_SYSCON help diff --git a/drivers/reset/reset-microchip-sparx5.c b/drivers/reset/reset-microchip-sparx5.c index f01e7db8e83b..00b612a0effa 100644 --- a/drivers/reset/reset-microchip-sparx5.c +++ b/drivers/reset/reset-microchip-sparx5.c @@ -13,15 +13,18 @@ #include <linux/regmap.h> #include <linux/reset-controller.h> -#define PROTECT_REG 0x84 -#define PROTECT_BIT BIT(10) -#define SOFT_RESET_REG 0x00 -#define SOFT_RESET_BIT BIT(1) +struct reset_props { + u32 protect_reg; + u32 protect_bit; + u32 reset_reg; + u32 reset_bit; +}; struct mchp_reset_context { struct regmap *cpu_ctrl; struct regmap *gcb_ctrl; struct reset_controller_dev rcdev; + const struct reset_props *props; }; static struct regmap_config sparx5_reset_regmap_config = { @@ -38,14 +41,16 @@ static int sparx5_switch_reset(struct reset_controller_dev *rcdev, u32 val; /* Make sure the core is PROTECTED from reset */ - regmap_update_bits(ctx->cpu_ctrl, PROTECT_REG, PROTECT_BIT, PROTECT_BIT); + regmap_update_bits(ctx->cpu_ctrl, ctx->props->protect_reg, + ctx->props->protect_bit, ctx->props->protect_bit); /* Start soft reset */ - regmap_write(ctx->gcb_ctrl, SOFT_RESET_REG, SOFT_RESET_BIT); + regmap_write(ctx->gcb_ctrl, ctx->props->reset_reg, + ctx->props->reset_bit); /* Wait for soft reset done */ - return regmap_read_poll_timeout(ctx->gcb_ctrl, SOFT_RESET_REG, val, - (val & SOFT_RESET_BIT) == 0, + return regmap_read_poll_timeout(ctx->gcb_ctrl, ctx->props->reset_reg, val, + (val & ctx->props->reset_bit) == 0, 1, 100); } @@ -115,13 +120,32 @@ static int mchp_sparx5_reset_probe(struct platform_device *pdev) ctx->rcdev.nr_resets = 1; ctx->rcdev.ops = &sparx5_reset_ops; ctx->rcdev.of_node = dn; + ctx->props = device_get_match_data(&pdev->dev); return devm_reset_controller_register(&pdev->dev, &ctx->rcdev); } +static const struct reset_props reset_props_sparx5 = { + .protect_reg = 0x84, + .protect_bit = BIT(10), + .reset_reg = 0x0, + .reset_bit = BIT(1), +}; + +static const struct reset_props reset_props_lan966x = { + .protect_reg = 0x88, + .protect_bit = BIT(5), + .reset_reg = 0x0, + .reset_bit = BIT(1), +}; + static const struct of_device_id mchp_sparx5_reset_of_match[] = { { .compatible = "microchip,sparx5-switch-reset", + .data = &reset_props_sparx5, + }, { + .compatible = "microchip,lan966x-switch-reset", + .data = &reset_props_lan966x, }, { } }; -- 2.33.0 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v4 2/2] reset: mchp: sparx5: Extend support for lan966x @ 2021-10-18 9:15 ` Horatiu Vultur 0 siblings, 0 replies; 12+ messages in thread From: Horatiu Vultur @ 2021-10-18 9:15 UTC (permalink / raw) To: p.zabel, robh+dt, lars.povlsen, Steen.Hegelund, UNGLinuxDriver, devicetree, linux-kernel, linux-arm-kernel Cc: Horatiu Vultur, Andrew Lunn This patch extends sparx5 driver to support also the lan966x. The process to reset the switch is the same only it has different offsets. Therefore make the driver more generic and add support for lan966x. Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> --- drivers/reset/Kconfig | 2 +- drivers/reset/reset-microchip-sparx5.c | 40 ++++++++++++++++++++------ 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig index be799a5abf8a..36ce6c8bcf1e 100644 --- a/drivers/reset/Kconfig +++ b/drivers/reset/Kconfig @@ -116,7 +116,7 @@ config RESET_LPC18XX config RESET_MCHP_SPARX5 bool "Microchip Sparx5 reset driver" - depends on ARCH_SPARX5 || COMPILE_TEST + depends on ARCH_SPARX5 || SOC_LAN966 || COMPILE_TEST default y if SPARX5_SWITCH select MFD_SYSCON help diff --git a/drivers/reset/reset-microchip-sparx5.c b/drivers/reset/reset-microchip-sparx5.c index f01e7db8e83b..00b612a0effa 100644 --- a/drivers/reset/reset-microchip-sparx5.c +++ b/drivers/reset/reset-microchip-sparx5.c @@ -13,15 +13,18 @@ #include <linux/regmap.h> #include <linux/reset-controller.h> -#define PROTECT_REG 0x84 -#define PROTECT_BIT BIT(10) -#define SOFT_RESET_REG 0x00 -#define SOFT_RESET_BIT BIT(1) +struct reset_props { + u32 protect_reg; + u32 protect_bit; + u32 reset_reg; + u32 reset_bit; +}; struct mchp_reset_context { struct regmap *cpu_ctrl; struct regmap *gcb_ctrl; struct reset_controller_dev rcdev; + const struct reset_props *props; }; static struct regmap_config sparx5_reset_regmap_config = { @@ -38,14 +41,16 @@ static int sparx5_switch_reset(struct reset_controller_dev *rcdev, u32 val; /* Make sure the core is PROTECTED from reset */ - regmap_update_bits(ctx->cpu_ctrl, PROTECT_REG, PROTECT_BIT, PROTECT_BIT); + regmap_update_bits(ctx->cpu_ctrl, ctx->props->protect_reg, + ctx->props->protect_bit, ctx->props->protect_bit); /* Start soft reset */ - regmap_write(ctx->gcb_ctrl, SOFT_RESET_REG, SOFT_RESET_BIT); + regmap_write(ctx->gcb_ctrl, ctx->props->reset_reg, + ctx->props->reset_bit); /* Wait for soft reset done */ - return regmap_read_poll_timeout(ctx->gcb_ctrl, SOFT_RESET_REG, val, - (val & SOFT_RESET_BIT) == 0, + return regmap_read_poll_timeout(ctx->gcb_ctrl, ctx->props->reset_reg, val, + (val & ctx->props->reset_bit) == 0, 1, 100); } @@ -115,13 +120,32 @@ static int mchp_sparx5_reset_probe(struct platform_device *pdev) ctx->rcdev.nr_resets = 1; ctx->rcdev.ops = &sparx5_reset_ops; ctx->rcdev.of_node = dn; + ctx->props = device_get_match_data(&pdev->dev); return devm_reset_controller_register(&pdev->dev, &ctx->rcdev); } +static const struct reset_props reset_props_sparx5 = { + .protect_reg = 0x84, + .protect_bit = BIT(10), + .reset_reg = 0x0, + .reset_bit = BIT(1), +}; + +static const struct reset_props reset_props_lan966x = { + .protect_reg = 0x88, + .protect_bit = BIT(5), + .reset_reg = 0x0, + .reset_bit = BIT(1), +}; + static const struct of_device_id mchp_sparx5_reset_of_match[] = { { .compatible = "microchip,sparx5-switch-reset", + .data = &reset_props_sparx5, + }, { + .compatible = "microchip,lan966x-switch-reset", + .data = &reset_props_lan966x, }, { } }; -- 2.33.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH v4 2/2] reset: mchp: sparx5: Extend support for lan966x 2021-10-18 9:15 ` Horatiu Vultur @ 2021-10-18 10:43 ` Philipp Zabel -1 siblings, 0 replies; 12+ messages in thread From: Philipp Zabel @ 2021-10-18 10:43 UTC (permalink / raw) To: Horatiu Vultur, robh+dt, lars.povlsen, Steen.Hegelund, UNGLinuxDriver, devicetree, linux-kernel, linux-arm-kernel Cc: Andrew Lunn On Mon, 2021-10-18 at 11:15 +0200, Horatiu Vultur wrote: > This patch extends sparx5 driver to support also the lan966x. The > process to reset the switch is the same only it has different offsets. > Therefore make the driver more generic and add support for lan966x. > > Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com> > Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> regards Philipp ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v4 2/2] reset: mchp: sparx5: Extend support for lan966x @ 2021-10-18 10:43 ` Philipp Zabel 0 siblings, 0 replies; 12+ messages in thread From: Philipp Zabel @ 2021-10-18 10:43 UTC (permalink / raw) To: Horatiu Vultur, robh+dt, lars.povlsen, Steen.Hegelund, UNGLinuxDriver, devicetree, linux-kernel, linux-arm-kernel Cc: Andrew Lunn On Mon, 2021-10-18 at 11:15 +0200, Horatiu Vultur wrote: > This patch extends sparx5 driver to support also the lan966x. The > process to reset the switch is the same only it has different offsets. > Therefore make the driver more generic and add support for lan966x. > > Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com> > Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> regards Philipp _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v4 2/2] reset: mchp: sparx5: Extend support for lan966x 2021-10-18 9:15 ` Horatiu Vultur @ 2021-10-18 12:01 ` Steen Hegelund -1 siblings, 0 replies; 12+ messages in thread From: Steen Hegelund @ 2021-10-18 12:01 UTC (permalink / raw) To: Horatiu Vultur, p.zabel, UNGLinuxDriver, devicetree, linux-kernel, linux-arm-kernel Cc: Andrew Lunn, robh+dt On Mon, 2021-10-18 at 11:15 +0200, Horatiu Vultur wrote: > This patch extends sparx5 driver to support also the lan966x. The > process to reset the switch is the same only it has different offsets. > Therefore make the driver more generic and add support for lan966x. > > Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com> > Reviewed-by: Andrew Lunn <andrew@lunn.ch> > --- Reviewed-by: Steen Hegelund <steen.hegelund@microchip.com> -- BR Steen -=-=-=-=-=-=-=-=-=-=-=-=-=-= steen.hegelund@microchip.com ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v4 2/2] reset: mchp: sparx5: Extend support for lan966x @ 2021-10-18 12:01 ` Steen Hegelund 0 siblings, 0 replies; 12+ messages in thread From: Steen Hegelund @ 2021-10-18 12:01 UTC (permalink / raw) To: Horatiu Vultur, p.zabel, UNGLinuxDriver, devicetree, linux-kernel, linux-arm-kernel Cc: Andrew Lunn, robh+dt On Mon, 2021-10-18 at 11:15 +0200, Horatiu Vultur wrote: > This patch extends sparx5 driver to support also the lan966x. The > process to reset the switch is the same only it has different offsets. > Therefore make the driver more generic and add support for lan966x. > > Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com> > Reviewed-by: Andrew Lunn <andrew@lunn.ch> > --- Reviewed-by: Steen Hegelund <steen.hegelund@microchip.com> -- BR Steen -=-=-=-=-=-=-=-=-=-=-=-=-=-= steen.hegelund@microchip.com _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v4 0/2] Extend Sparx5 switch reset driver for lan966x 2021-10-18 9:15 ` Horatiu Vultur @ 2021-10-18 15:01 ` Philipp Zabel -1 siblings, 0 replies; 12+ messages in thread From: Philipp Zabel @ 2021-10-18 15:01 UTC (permalink / raw) To: Horatiu Vultur, robh+dt, lars.povlsen, Steen.Hegelund, UNGLinuxDriver, devicetree, linux-kernel, linux-arm-kernel On Mon, 2021-10-18 at 11:15 +0200, Horatiu Vultur wrote: > This patch serie extends the Microchip Sparx5 reset driver to support > lan966x > > v3->v4: > - drop all the changes regarding the phy reset. > - use enum instead oneOf in dt-bindings > > v2->v3: > - rename variable reset_gpio to phy_reset_gpio > - rename gpios property in documentation to phy-reset-gpios > > v1->v2: > - add reviewed-by tag > - extend driver to be able to release the reset also for external PHYs > > Horatiu Vultur (2): > dt-bindings: reset: Add lan966x support > reset: mchp: sparx5: Extend support for lan966x > > .../bindings/reset/microchip,rst.yaml | 4 +- > drivers/reset/Kconfig | 2 +- > drivers/reset/reset-microchip-sparx5.c | 40 +++++++++++++++---- > 3 files changed, 36 insertions(+), 10 deletions(-) Thank you, both applied to reset/next. regards Philipp ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v4 0/2] Extend Sparx5 switch reset driver for lan966x @ 2021-10-18 15:01 ` Philipp Zabel 0 siblings, 0 replies; 12+ messages in thread From: Philipp Zabel @ 2021-10-18 15:01 UTC (permalink / raw) To: Horatiu Vultur, robh+dt, lars.povlsen, Steen.Hegelund, UNGLinuxDriver, devicetree, linux-kernel, linux-arm-kernel On Mon, 2021-10-18 at 11:15 +0200, Horatiu Vultur wrote: > This patch serie extends the Microchip Sparx5 reset driver to support > lan966x > > v3->v4: > - drop all the changes regarding the phy reset. > - use enum instead oneOf in dt-bindings > > v2->v3: > - rename variable reset_gpio to phy_reset_gpio > - rename gpios property in documentation to phy-reset-gpios > > v1->v2: > - add reviewed-by tag > - extend driver to be able to release the reset also for external PHYs > > Horatiu Vultur (2): > dt-bindings: reset: Add lan966x support > reset: mchp: sparx5: Extend support for lan966x > > .../bindings/reset/microchip,rst.yaml | 4 +- > drivers/reset/Kconfig | 2 +- > drivers/reset/reset-microchip-sparx5.c | 40 +++++++++++++++---- > 3 files changed, 36 insertions(+), 10 deletions(-) Thank you, both applied to reset/next. regards Philipp _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2021-10-18 15:03 UTC | newest] Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2021-10-18 9:15 [PATCH v4 0/2] Extend Sparx5 switch reset driver for lan966x Horatiu Vultur 2021-10-18 9:15 ` Horatiu Vultur 2021-10-18 9:15 ` [PATCH v4 1/2] dt-bindings: reset: Add lan966x support Horatiu Vultur 2021-10-18 9:15 ` Horatiu Vultur 2021-10-18 9:15 ` [PATCH v4 2/2] reset: mchp: sparx5: Extend support for lan966x Horatiu Vultur 2021-10-18 9:15 ` Horatiu Vultur 2021-10-18 10:43 ` Philipp Zabel 2021-10-18 10:43 ` Philipp Zabel 2021-10-18 12:01 ` Steen Hegelund 2021-10-18 12:01 ` Steen Hegelund 2021-10-18 15:01 ` [PATCH v4 0/2] Extend Sparx5 switch reset driver " Philipp Zabel 2021-10-18 15:01 ` Philipp Zabel
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.