* [PATCH v7 1/5] reset: mpfs: add non-auxiliary bus probing
2025-11-10 11:23 [PATCH v7 0/5] Redo PolarFire SoC's mailbox/clock devicestrees and related code Conor Dooley
@ 2025-11-10 11:23 ` Conor Dooley
2025-11-10 11:34 ` Philipp Zabel
2025-11-10 11:23 ` [PATCH v7 2/5] riscv: dts: microchip: fix mailbox description Conor Dooley
` (3 subsequent siblings)
4 siblings, 1 reply; 9+ messages in thread
From: Conor Dooley @ 2025-11-10 11:23 UTC (permalink / raw)
To: claudiu.beznea
Cc: conor, Conor Dooley, Daire McNamara, pierre-henry.moussay,
valentina.fernandezalanis, Michael Turquette, Stephen Boyd,
Rob Herring, Krzysztof Kozlowski, Philipp Zabel, linux-riscv,
linux-clk, devicetree, linux-kernel
From: Conor Dooley <conor.dooley@microchip.com>
While the auxiliary bus was a nice bandaid, and meant that re-writing
the representation of the clock regions in devicetree was not required,
it has run its course. The "mss_top_sysreg" region that contains the
clock and reset regions, also contains pinctrl and an interrupt
controller, so the time has come rewrite the devicetree and probe the
reset controller from an mfd devicetree node, rather than implement
those drivers using the auxiliary bus. Wanting to avoid propagating this
naive/incorrect description of the hardware to the new pic64gx SoC is a
major motivating factor here.
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
---
v7:
- move entirely to regmap
- use clear/set instead of update
v6:
- depend on MFD_SYSCON
- return regmap_update_bits() result directly instead of an additional
return 0
v4:
- Only use driver specific lock for non-regmap writes
v2:
- Implement the request to use regmap_update_bits(). I found that I then
hated the read/write helpers since they were just bloat, so I ripped
them out. I replaced the regular spin_lock_irqsave() stuff with a
guard(spinlock_irqsave), since that's a simpler way of handling the two
different paths through such a trivial pair of functions.
---
drivers/clk/microchip/clk-mpfs.c | 4 +-
drivers/reset/Kconfig | 1 +
drivers/reset/reset-mpfs.c | 92 +++++++++++++++++++-------------
include/soc/microchip/mpfs.h | 3 +-
4 files changed, 61 insertions(+), 39 deletions(-)
diff --git a/drivers/clk/microchip/clk-mpfs.c b/drivers/clk/microchip/clk-mpfs.c
index 484893e68b67..ee58304913ef 100644
--- a/drivers/clk/microchip/clk-mpfs.c
+++ b/drivers/clk/microchip/clk-mpfs.c
@@ -38,7 +38,7 @@ static const struct regmap_config mpfs_clk_regmap_config = {
.reg_stride = 4,
.val_bits = 32,
.val_format_endian = REGMAP_ENDIAN_LITTLE,
- .max_register = REG_SUBBLK_CLOCK_CR,
+ .max_register = REG_SUBBLK_RESET_CR,
};
/*
@@ -502,7 +502,7 @@ static inline int mpfs_clk_old_format_probe(struct mpfs_clock_data *clk_data,
if (IS_ERR(clk_data->regmap))
return PTR_ERR(clk_data->regmap);
- return mpfs_reset_controller_register(dev, clk_data->base + REG_SUBBLK_RESET_CR);
+ return mpfs_reset_controller_register(dev, clk_data->regmap);
}
static int mpfs_clk_probe(struct platform_device *pdev)
diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig
index 78b7078478d4..0ec4b7cd08d6 100644
--- a/drivers/reset/Kconfig
+++ b/drivers/reset/Kconfig
@@ -200,6 +200,7 @@ config RESET_PISTACHIO
config RESET_POLARFIRE_SOC
bool "Microchip PolarFire SoC (MPFS) Reset Driver"
depends on MCHP_CLK_MPFS
+ depends on MFD_SYSCON
select AUXILIARY_BUS
default MCHP_CLK_MPFS
help
diff --git a/drivers/reset/reset-mpfs.c b/drivers/reset/reset-mpfs.c
index f6fa10e03ea8..d00212450990 100644
--- a/drivers/reset/reset-mpfs.c
+++ b/drivers/reset/reset-mpfs.c
@@ -7,13 +7,16 @@
*
*/
#include <linux/auxiliary_bus.h>
+#include <linux/cleanup.h>
#include <linux/delay.h>
#include <linux/io.h>
+#include <linux/mfd/syscon.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
-#include <linux/slab.h>
+#include <linux/regmap.h>
#include <linux/reset-controller.h>
+#include <linux/slab.h>
#include <dt-bindings/clock/microchip,mpfs-clock.h>
#include <soc/microchip/mpfs.h>
@@ -27,11 +30,10 @@
#define MPFS_SLEEP_MIN_US 100
#define MPFS_SLEEP_MAX_US 200
-/* block concurrent access to the soft reset register */
-static DEFINE_SPINLOCK(mpfs_reset_lock);
+#define REG_SUBBLK_RESET_CR 0x88u
struct mpfs_reset {
- void __iomem *base;
+ struct regmap *regmap;
struct reset_controller_dev rcdev;
};
@@ -46,41 +48,25 @@ static inline struct mpfs_reset *to_mpfs_reset(struct reset_controller_dev *rcde
static int mpfs_assert(struct reset_controller_dev *rcdev, unsigned long id)
{
struct mpfs_reset *rst = to_mpfs_reset(rcdev);
- unsigned long flags;
- u32 reg;
- spin_lock_irqsave(&mpfs_reset_lock, flags);
+ return regmap_set_bits(rst->regmap, REG_SUBBLK_RESET_CR, BIT(id));
- reg = readl(rst->base);
- reg |= BIT(id);
- writel(reg, rst->base);
-
- spin_unlock_irqrestore(&mpfs_reset_lock, flags);
-
- return 0;
}
static int mpfs_deassert(struct reset_controller_dev *rcdev, unsigned long id)
{
struct mpfs_reset *rst = to_mpfs_reset(rcdev);
- unsigned long flags;
- u32 reg;
- spin_lock_irqsave(&mpfs_reset_lock, flags);
+ return regmap_clear_bits(rst->regmap, REG_SUBBLK_RESET_CR, BIT(id));
- reg = readl(rst->base);
- reg &= ~BIT(id);
- writel(reg, rst->base);
-
- spin_unlock_irqrestore(&mpfs_reset_lock, flags);
-
- return 0;
}
static int mpfs_status(struct reset_controller_dev *rcdev, unsigned long id)
{
struct mpfs_reset *rst = to_mpfs_reset(rcdev);
- u32 reg = readl(rst->base);
+ u32 reg;
+
+ regmap_read(rst->regmap, REG_SUBBLK_RESET_CR, ®);
/*
* It is safe to return here as MPFS_NUM_RESETS makes sure the sign bit
@@ -130,23 +116,58 @@ static int mpfs_reset_xlate(struct reset_controller_dev *rcdev,
return index - MPFS_PERIPH_OFFSET;
}
-static int mpfs_reset_probe(struct auxiliary_device *adev,
- const struct auxiliary_device_id *id)
+static int mpfs_reset_mfd_probe(struct platform_device *pdev)
{
- struct device *dev = &adev->dev;
struct reset_controller_dev *rcdev;
+ struct device *dev = &pdev->dev;
struct mpfs_reset *rst;
rst = devm_kzalloc(dev, sizeof(*rst), GFP_KERNEL);
if (!rst)
return -ENOMEM;
- rst->base = (void __iomem *)adev->dev.platform_data;
+ rcdev = &rst->rcdev;
+ rcdev->dev = dev;
+ rcdev->ops = &mpfs_reset_ops;
+
+ rcdev->of_node = pdev->dev.parent->of_node;
+ rcdev->of_reset_n_cells = 1;
+ rcdev->of_xlate = mpfs_reset_xlate;
+ rcdev->nr_resets = MPFS_NUM_RESETS;
+
+ rst->regmap = device_node_to_regmap(pdev->dev.parent->of_node);
+ if (IS_ERR(rst->regmap))
+ return dev_err_probe(dev, PTR_ERR(rst->regmap),
+ "Failed to find syscon regmap\n");
+
+ return devm_reset_controller_register(dev, rcdev);
+}
+
+static struct platform_driver mpfs_reset_mfd_driver = {
+ .probe = mpfs_reset_mfd_probe,
+ .driver = {
+ .name = "mpfs-reset",
+ },
+};
+module_platform_driver(mpfs_reset_mfd_driver);
+
+static int mpfs_reset_adev_probe(struct auxiliary_device *adev,
+ const struct auxiliary_device_id *id)
+{
+ struct reset_controller_dev *rcdev;
+ struct device *dev = &adev->dev;
+ struct mpfs_reset *rst;
+
+ rst = devm_kzalloc(dev, sizeof(*rst), GFP_KERNEL);
+ if (!rst)
+ return -ENOMEM;
+
+ rst->regmap = (struct regmap *)adev->dev.platform_data;
rcdev = &rst->rcdev;
rcdev->dev = dev;
- rcdev->dev->parent = dev->parent;
rcdev->ops = &mpfs_reset_ops;
+
rcdev->of_node = dev->parent->of_node;
rcdev->of_reset_n_cells = 1;
rcdev->of_xlate = mpfs_reset_xlate;
@@ -155,12 +176,11 @@ static int mpfs_reset_probe(struct auxiliary_device *adev,
return devm_reset_controller_register(dev, rcdev);
}
-int mpfs_reset_controller_register(struct device *clk_dev, void __iomem *base)
+int mpfs_reset_controller_register(struct device *clk_dev, struct regmap *map)
{
struct auxiliary_device *adev;
- adev = devm_auxiliary_device_create(clk_dev, "reset-mpfs",
- (__force void *)base);
+ adev = devm_auxiliary_device_create(clk_dev, "reset-mpfs", (void *)map);
if (!adev)
return -ENODEV;
@@ -176,12 +196,12 @@ static const struct auxiliary_device_id mpfs_reset_ids[] = {
};
MODULE_DEVICE_TABLE(auxiliary, mpfs_reset_ids);
-static struct auxiliary_driver mpfs_reset_driver = {
- .probe = mpfs_reset_probe,
+static struct auxiliary_driver mpfs_reset_aux_driver = {
+ .probe = mpfs_reset_adev_probe,
.id_table = mpfs_reset_ids,
};
-module_auxiliary_driver(mpfs_reset_driver);
+module_auxiliary_driver(mpfs_reset_aux_driver);
MODULE_DESCRIPTION("Microchip PolarFire SoC Reset Driver");
MODULE_AUTHOR("Conor Dooley <conor.dooley@microchip.com>");
diff --git a/include/soc/microchip/mpfs.h b/include/soc/microchip/mpfs.h
index 0bd67e10b704..ec04c98a8b63 100644
--- a/include/soc/microchip/mpfs.h
+++ b/include/soc/microchip/mpfs.h
@@ -14,6 +14,7 @@
#include <linux/types.h>
#include <linux/of_device.h>
+#include <linux/regmap.h>
struct mpfs_sys_controller;
@@ -44,7 +45,7 @@ struct mtd_info *mpfs_sys_controller_get_flash(struct mpfs_sys_controller *mpfs_
#if IS_ENABLED(CONFIG_MCHP_CLK_MPFS)
#if IS_ENABLED(CONFIG_RESET_POLARFIRE_SOC)
-int mpfs_reset_controller_register(struct device *clk_dev, void __iomem *base);
+int mpfs_reset_controller_register(struct device *clk_dev, struct regmap *map);
#else
static inline int mpfs_reset_controller_register(struct device *clk_dev, void __iomem *base) { return 0; }
#endif /* if IS_ENABLED(CONFIG_RESET_POLARFIRE_SOC) */
--
2.51.0
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH v7 1/5] reset: mpfs: add non-auxiliary bus probing
2025-11-10 11:23 ` [PATCH v7 1/5] reset: mpfs: add non-auxiliary bus probing Conor Dooley
@ 2025-11-10 11:34 ` Philipp Zabel
2025-11-11 16:46 ` Conor Dooley
0 siblings, 1 reply; 9+ messages in thread
From: Philipp Zabel @ 2025-11-10 11:34 UTC (permalink / raw)
To: Conor Dooley, claudiu.beznea
Cc: Conor Dooley, Daire McNamara, pierre-henry.moussay,
valentina.fernandezalanis, Michael Turquette, Stephen Boyd,
Rob Herring, Krzysztof Kozlowski, linux-riscv, linux-clk,
devicetree, linux-kernel
On Mo, 2025-11-10 at 11:23 +0000, Conor Dooley wrote:
> From: Conor Dooley <conor.dooley@microchip.com>
>
> While the auxiliary bus was a nice bandaid, and meant that re-writing
> the representation of the clock regions in devicetree was not required,
> it has run its course. The "mss_top_sysreg" region that contains the
> clock and reset regions, also contains pinctrl and an interrupt
> controller, so the time has come rewrite the devicetree and probe the
> reset controller from an mfd devicetree node, rather than implement
> those drivers using the auxiliary bus. Wanting to avoid propagating this
> naive/incorrect description of the hardware to the new pic64gx SoC is a
> major motivating factor here.
>
> Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
> ---
> v7:
> - move entirely to regmap
> - use clear/set instead of update
>
> v6:
> - depend on MFD_SYSCON
> - return regmap_update_bits() result directly instead of an additional
> return 0
>
> v4:
> - Only use driver specific lock for non-regmap writes
>
> v2:
> - Implement the request to use regmap_update_bits(). I found that I then
> hated the read/write helpers since they were just bloat, so I ripped
> them out. I replaced the regular spin_lock_irqsave() stuff with a
> guard(spinlock_irqsave), since that's a simpler way of handling the two
> different paths through such a trivial pair of functions.
> ---
> drivers/clk/microchip/clk-mpfs.c | 4 +-
> drivers/reset/Kconfig | 1 +
> drivers/reset/reset-mpfs.c | 92 +++++++++++++++++++-------------
> include/soc/microchip/mpfs.h | 3 +-
> 4 files changed, 61 insertions(+), 39 deletions(-)
>
> diff --git a/drivers/clk/microchip/clk-mpfs.c b/drivers/clk/microchip/clk-mpfs.c
> index 484893e68b67..ee58304913ef 100644
> --- a/drivers/clk/microchip/clk-mpfs.c
> +++ b/drivers/clk/microchip/clk-mpfs.c
> @@ -38,7 +38,7 @@ static const struct regmap_config mpfs_clk_regmap_config = {
> .reg_stride = 4,
> .val_bits = 32,
> .val_format_endian = REGMAP_ENDIAN_LITTLE,
> - .max_register = REG_SUBBLK_CLOCK_CR,
> + .max_register = REG_SUBBLK_RESET_CR,
> };
>
> /*
> @@ -502,7 +502,7 @@ static inline int mpfs_clk_old_format_probe(struct mpfs_clock_data *clk_data,
> if (IS_ERR(clk_data->regmap))
> return PTR_ERR(clk_data->regmap);
>
> - return mpfs_reset_controller_register(dev, clk_data->base + REG_SUBBLK_RESET_CR);
> + return mpfs_reset_controller_register(dev, clk_data->regmap);
> }
>
> static int mpfs_clk_probe(struct platform_device *pdev)
> diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig
> index 78b7078478d4..0ec4b7cd08d6 100644
> --- a/drivers/reset/Kconfig
> +++ b/drivers/reset/Kconfig
> @@ -200,6 +200,7 @@ config RESET_PISTACHIO
> config RESET_POLARFIRE_SOC
> bool "Microchip PolarFire SoC (MPFS) Reset Driver"
> depends on MCHP_CLK_MPFS
> + depends on MFD_SYSCON
> select AUXILIARY_BUS
> default MCHP_CLK_MPFS
> help
> diff --git a/drivers/reset/reset-mpfs.c b/drivers/reset/reset-mpfs.c
> index f6fa10e03ea8..d00212450990 100644
> --- a/drivers/reset/reset-mpfs.c
> +++ b/drivers/reset/reset-mpfs.c
> @@ -7,13 +7,16 @@
> *
> */
> #include <linux/auxiliary_bus.h>
> +#include <linux/cleanup.h>
Not used anymore.
[...]
> @@ -176,12 +196,12 @@ static const struct auxiliary_device_id mpfs_reset_ids[] = {
> };
> MODULE_DEVICE_TABLE(auxiliary, mpfs_reset_ids);
>
> -static struct auxiliary_driver mpfs_reset_driver = {
> - .probe = mpfs_reset_probe,
> +static struct auxiliary_driver mpfs_reset_aux_driver = {
> + .probe = mpfs_reset_adev_probe,
> .id_table = mpfs_reset_ids,
> };
>
> -module_auxiliary_driver(mpfs_reset_driver);
> +module_auxiliary_driver(mpfs_reset_aux_driver);
>
> MODULE_DESCRIPTION("Microchip PolarFire SoC Reset Driver");
> MODULE_AUTHOR("Conor Dooley <conor.dooley@microchip.com>");
> diff --git a/include/soc/microchip/mpfs.h b/include/soc/microchip/mpfs.h
> index 0bd67e10b704..ec04c98a8b63 100644
> --- a/include/soc/microchip/mpfs.h
> +++ b/include/soc/microchip/mpfs.h
> @@ -14,6 +14,7 @@
>
> #include <linux/types.h>
> #include <linux/of_device.h>
> +#include <linux/regmap.h>
You don't have to #include <linux/regmap.h> here, a forward declaration
struct regmap;
would suffice.
> struct mpfs_sys_controller;
>
> @@ -44,7 +45,7 @@ struct mtd_info *mpfs_sys_controller_get_flash(struct mpfs_sys_controller *mpfs_
>
> #if IS_ENABLED(CONFIG_MCHP_CLK_MPFS)
> #if IS_ENABLED(CONFIG_RESET_POLARFIRE_SOC)
> -int mpfs_reset_controller_register(struct device *clk_dev, void __iomem *base);
> +int mpfs_reset_controller_register(struct device *clk_dev, struct regmap *map);
> #else
> static inline int mpfs_reset_controller_register(struct device *clk_dev, void __iomem *base) { return 0; }
> #endif /* if IS_ENABLED(CONFIG_RESET_POLARFIRE_SOC) */
With the superfluous cleanup include fixed.
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
and
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
to be merged with the reset of the series.
regards
Philipp
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH v7 1/5] reset: mpfs: add non-auxiliary bus probing
2025-11-10 11:34 ` Philipp Zabel
@ 2025-11-11 16:46 ` Conor Dooley
2025-11-11 16:49 ` Conor Dooley
0 siblings, 1 reply; 9+ messages in thread
From: Conor Dooley @ 2025-11-11 16:46 UTC (permalink / raw)
To: Philipp Zabel
Cc: claudiu.beznea, Conor Dooley, Daire McNamara,
pierre-henry.moussay, valentina.fernandezalanis,
Michael Turquette, Stephen Boyd, Rob Herring, Krzysztof Kozlowski,
linux-riscv, linux-clk, devicetree, linux-kernel
[-- Attachment #1.1: Type: text/plain, Size: 591 bytes --]
On Mon, Nov 10, 2025 at 12:34:16PM +0100, Philipp Zabel wrote:
> On Mo, 2025-11-10 at 11:23 +0000, Conor Dooley wrote:
>
> With the superfluous cleanup include fixed.
>
> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
>
> and
>
> Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
>
> to be merged with the reset of the series.
Cool, I have dropped the include and pushed the patch to the
clk-microchip branch:
https://git.kernel.org/at91/c/4a75fcd2000e1af452343aac6e34387f8e794f37
I opted to leave the include of regmap.h in mpfs.h unchanged.
Cheers,
Conor.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
[-- Attachment #2: Type: text/plain, Size: 161 bytes --]
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v7 1/5] reset: mpfs: add non-auxiliary bus probing
2025-11-11 16:46 ` Conor Dooley
@ 2025-11-11 16:49 ` Conor Dooley
0 siblings, 0 replies; 9+ messages in thread
From: Conor Dooley @ 2025-11-11 16:49 UTC (permalink / raw)
To: Philipp Zabel
Cc: claudiu.beznea, Conor Dooley, Daire McNamara,
pierre-henry.moussay, valentina.fernandezalanis,
Michael Turquette, Stephen Boyd, Rob Herring, Krzysztof Kozlowski,
linux-riscv, linux-clk, devicetree, linux-kernel
[-- Attachment #1.1: Type: text/plain, Size: 868 bytes --]
On Tue, Nov 11, 2025 at 04:46:31PM +0000, Conor Dooley wrote:
> On Mon, Nov 10, 2025 at 12:34:16PM +0100, Philipp Zabel wrote:
> > On Mo, 2025-11-10 at 11:23 +0000, Conor Dooley wrote:
> >
> > With the superfluous cleanup include fixed.
> >
> > Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
> >
> > and
> >
> > Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
> >
> > to be merged with the reset of the series.
>
> Cool, I have dropped the include and pushed the patch to the
> clk-microchip branch:
> https://git.kernel.org/at91/c/4a75fcd2000e1af452343aac6e34387f8e794f37
And of course I made a mistake hand assembling this, that's the hash
from before I removed the header. The actual commit is here:
https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux.git/commit/?h=clk-microchip&id=781f60e45bdfe351aad692ac0fa89e36f8bf4a36
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
[-- Attachment #2: Type: text/plain, Size: 161 bytes --]
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v7 2/5] riscv: dts: microchip: fix mailbox description
2025-11-10 11:23 [PATCH v7 0/5] Redo PolarFire SoC's mailbox/clock devicestrees and related code Conor Dooley
2025-11-10 11:23 ` [PATCH v7 1/5] reset: mpfs: add non-auxiliary bus probing Conor Dooley
@ 2025-11-10 11:23 ` Conor Dooley
2025-11-10 11:23 ` [PATCH v7 3/5] riscv: dts: microchip: convert clock and reset to use syscon Conor Dooley
` (2 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: Conor Dooley @ 2025-11-10 11:23 UTC (permalink / raw)
To: claudiu.beznea
Cc: conor, Conor Dooley, Daire McNamara, pierre-henry.moussay,
valentina.fernandezalanis, Michael Turquette, Stephen Boyd,
Rob Herring, Krzysztof Kozlowski, Philipp Zabel, linux-riscv,
linux-clk, devicetree, linux-kernel
From: Conor Dooley <conor.dooley@microchip.com>
When the binding for the mailbox on PolarFire SoC was originally
written, and later modified, mistakes were made - and the precise
nature of the later modification should have been a giveaway, but alas
I was naive at the time.
A more correct modelling of the hardware is to use two syscons and have
a single reg entry for the mailbox, containing the mailbox region. The
two syscons contain the general control/status registers for the mailbox
and the interrupt related registers respectively. The reason for two
syscons is that the same mailbox is present on the non-SoC version of
the FPGA, which has no interrupt controller, and the shared part of the
rtl was unchanged between devices.
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
---
arch/riscv/boot/dts/microchip/mpfs.dtsi | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/arch/riscv/boot/dts/microchip/mpfs.dtsi b/arch/riscv/boot/dts/microchip/mpfs.dtsi
index 9883ca3554c5..f9d6bf08e717 100644
--- a/arch/riscv/boot/dts/microchip/mpfs.dtsi
+++ b/arch/riscv/boot/dts/microchip/mpfs.dtsi
@@ -259,6 +259,11 @@ clkcfg: clkcfg@20002000 {
#reset-cells = <1>;
};
+ sysreg_scb: syscon@20003000 {
+ compatible = "microchip,mpfs-sysreg-scb", "syscon";
+ reg = <0x0 0x20003000 0x0 0x1000>;
+ };
+
ccc_se: clock-controller@38010000 {
compatible = "microchip,mpfs-ccc";
reg = <0x0 0x38010000 0x0 0x1000>, <0x0 0x38020000 0x0 0x1000>,
@@ -521,10 +526,14 @@ usb: usb@20201000 {
status = "disabled";
};
- mbox: mailbox@37020000 {
+ control_scb: syscon@37020000 {
+ compatible = "microchip,mpfs-control-scb", "syscon";
+ reg = <0x0 0x37020000 0x0 0x100>;
+ };
+
+ mbox: mailbox@37020800 {
compatible = "microchip,mpfs-mailbox";
- reg = <0x0 0x37020000 0x0 0x58>, <0x0 0x2000318C 0x0 0x40>,
- <0x0 0x37020800 0x0 0x100>;
+ reg = <0x0 0x37020800 0x0 0x1000>;
interrupt-parent = <&plic>;
interrupts = <96>;
#mbox-cells = <1>;
--
2.51.0
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v7 3/5] riscv: dts: microchip: convert clock and reset to use syscon
2025-11-10 11:23 [PATCH v7 0/5] Redo PolarFire SoC's mailbox/clock devicestrees and related code Conor Dooley
2025-11-10 11:23 ` [PATCH v7 1/5] reset: mpfs: add non-auxiliary bus probing Conor Dooley
2025-11-10 11:23 ` [PATCH v7 2/5] riscv: dts: microchip: fix mailbox description Conor Dooley
@ 2025-11-10 11:23 ` Conor Dooley
2025-11-10 11:23 ` [PATCH v7 4/5] MAINTAINERS: add new soc drivers to Microchip RISC-V entry Conor Dooley
2025-11-10 11:23 ` [PATCH v7 5/5] MAINTAINERS: rename " Conor Dooley
4 siblings, 0 replies; 9+ messages in thread
From: Conor Dooley @ 2025-11-10 11:23 UTC (permalink / raw)
To: claudiu.beznea
Cc: conor, Conor Dooley, Daire McNamara, pierre-henry.moussay,
valentina.fernandezalanis, Michael Turquette, Stephen Boyd,
Rob Herring, Krzysztof Kozlowski, Philipp Zabel, linux-riscv,
linux-clk, devicetree, linux-kernel
From: Conor Dooley <conor.dooley@microchip.com>
The "subblock" clocks and reset registers on PolarFire SoC are located
in the mss-top-sysreg region, alongside pinctrl and interrupt control
functionality. Re-write the devicetree to describe the sys explicitly,
as its own node, rather than as a region of the clock node.
Correspondingly, the phandles to the reset controller must be updated to
the new provider. The drivers will continue to support the old way of
doing things.
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
---
arch/riscv/boot/dts/microchip/mpfs.dtsi | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/arch/riscv/boot/dts/microchip/mpfs.dtsi b/arch/riscv/boot/dts/microchip/mpfs.dtsi
index f9d6bf08e717..5c2963e269b8 100644
--- a/arch/riscv/boot/dts/microchip/mpfs.dtsi
+++ b/arch/riscv/boot/dts/microchip/mpfs.dtsi
@@ -251,11 +251,9 @@ pdma: dma-controller@3000000 {
#dma-cells = <1>;
};
- clkcfg: clkcfg@20002000 {
- compatible = "microchip,mpfs-clkcfg";
- reg = <0x0 0x20002000 0x0 0x1000>, <0x0 0x3E001000 0x0 0x1000>;
- clocks = <&refclk>;
- #clock-cells = <1>;
+ mss_top_sysreg: syscon@20002000 {
+ compatible = "microchip,mpfs-mss-top-sysreg", "syscon", "simple-mfd";
+ reg = <0x0 0x20002000 0x0 0x1000>;
#reset-cells = <1>;
};
@@ -452,7 +450,7 @@ mac0: ethernet@20110000 {
local-mac-address = [00 00 00 00 00 00];
clocks = <&clkcfg CLK_MAC0>, <&clkcfg CLK_AHB>;
clock-names = "pclk", "hclk";
- resets = <&clkcfg CLK_MAC0>;
+ resets = <&mss_top_sysreg CLK_MAC0>;
status = "disabled";
};
@@ -466,7 +464,7 @@ mac1: ethernet@20112000 {
local-mac-address = [00 00 00 00 00 00];
clocks = <&clkcfg CLK_MAC1>, <&clkcfg CLK_AHB>;
clock-names = "pclk", "hclk";
- resets = <&clkcfg CLK_MAC1>;
+ resets = <&mss_top_sysreg CLK_MAC1>;
status = "disabled";
};
@@ -550,5 +548,12 @@ syscontroller_qspi: spi@37020100 {
clocks = <&scbclk>;
status = "disabled";
};
+
+ clkcfg: clkcfg@3e001000 {
+ compatible = "microchip,mpfs-clkcfg";
+ reg = <0x0 0x3e001000 0x0 0x1000>;
+ clocks = <&refclk>;
+ #clock-cells = <1>;
+ };
};
};
--
2.51.0
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v7 4/5] MAINTAINERS: add new soc drivers to Microchip RISC-V entry
2025-11-10 11:23 [PATCH v7 0/5] Redo PolarFire SoC's mailbox/clock devicestrees and related code Conor Dooley
` (2 preceding siblings ...)
2025-11-10 11:23 ` [PATCH v7 3/5] riscv: dts: microchip: convert clock and reset to use syscon Conor Dooley
@ 2025-11-10 11:23 ` Conor Dooley
2025-11-10 11:23 ` [PATCH v7 5/5] MAINTAINERS: rename " Conor Dooley
4 siblings, 0 replies; 9+ messages in thread
From: Conor Dooley @ 2025-11-10 11:23 UTC (permalink / raw)
To: claudiu.beznea
Cc: conor, Conor Dooley, Daire McNamara, pierre-henry.moussay,
valentina.fernandezalanis, Michael Turquette, Stephen Boyd,
Rob Herring, Krzysztof Kozlowski, Philipp Zabel, linux-riscv,
linux-clk, devicetree, linux-kernel
From: Conor Dooley <conor.dooley@microchip.com>
Add the two new syscon drivers to the RISC-V entry for Microchip
platforms.
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
---
MAINTAINERS | 2 ++
1 file changed, 2 insertions(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index 46126ce2f968..a28740a7d87a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -22105,6 +22105,8 @@ F: drivers/pci/controller/plda/pcie-microchip-host.c
F: drivers/pwm/pwm-microchip-core.c
F: drivers/reset/reset-mpfs.c
F: drivers/rtc/rtc-mpfs.c
+F: drivers/soc/microchip/mpfs-control-scb.c
+F: drivers/soc/microchip/mpfs-mss-top-sysreg.c
F: drivers/soc/microchip/mpfs-sys-controller.c
F: drivers/spi/spi-microchip-core-qspi.c
F: drivers/spi/spi-microchip-core.c
--
2.51.0
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v7 5/5] MAINTAINERS: rename Microchip RISC-V entry
2025-11-10 11:23 [PATCH v7 0/5] Redo PolarFire SoC's mailbox/clock devicestrees and related code Conor Dooley
` (3 preceding siblings ...)
2025-11-10 11:23 ` [PATCH v7 4/5] MAINTAINERS: add new soc drivers to Microchip RISC-V entry Conor Dooley
@ 2025-11-10 11:23 ` Conor Dooley
4 siblings, 0 replies; 9+ messages in thread
From: Conor Dooley @ 2025-11-10 11:23 UTC (permalink / raw)
To: claudiu.beznea
Cc: conor, Conor Dooley, Daire McNamara, pierre-henry.moussay,
valentina.fernandezalanis, Michael Turquette, Stephen Boyd,
Rob Herring, Krzysztof Kozlowski, Philipp Zabel, linux-riscv,
linux-clk, devicetree, linux-kernel
From: Conor Dooley <conor.dooley@microchip.com>
There's now non-FPGA RISC-V SoCs from Microchip, so rename the entry
to reflect that.
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
---
MAINTAINERS | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index a28740a7d87a..24efae3df425 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -22079,7 +22079,7 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux.git
F: Documentation/devicetree/bindings/iommu/riscv,iommu.yaml
F: drivers/iommu/riscv/
-RISC-V MICROCHIP FPGA SUPPORT
+RISC-V MICROCHIP SUPPORT
M: Conor Dooley <conor.dooley@microchip.com>
M: Daire McNamara <daire.mcnamara@microchip.com>
L: linux-riscv@lists.infradead.org
--
2.51.0
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 9+ messages in thread