[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251117-partner-anymore-0fe4b6c47557@spud>
Date: Mon, 17 Nov 2025 14:21:22 +0000
From: Conor Dooley <conor@...nel.org>
To: linux-kernel@...r.kernel.org
Cc: conor@...nel.org,
Conor Dooley <conor.dooley@...rochip.com>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Daire McNamara <daire.mcnamara@...rochip.com>,
devicetree@...r.kernel.org,
linux-riscv@...ts.infradead.org,
Pierre-Henry Moussay <pierre-henry.moussay@...rochip.com>
Subject: [PATCH v1 3/3] soc: microchip: mpfs-sys-controller: add support for pic64gx
From: Pierre-Henry Moussay <pierre-henry.moussay@...rochip.com>
pic64gx is not compatible with mpfs because due to the lack of FPGA
functionality some features are disabled. Notably, anything to do with
FPGA fabric contents is not supported.
Signed-off-by: Pierre-Henry Moussay <pierre-henry.moussay@...rochip.com>
Signed-off-by: Conor Dooley <conor.dooley@...rochip.com>
---
drivers/soc/microchip/mpfs-sys-controller.c | 74 +++++++++++++++------
1 file changed, 54 insertions(+), 20 deletions(-)
diff --git a/drivers/soc/microchip/mpfs-sys-controller.c b/drivers/soc/microchip/mpfs-sys-controller.c
index 30bc45d17d34..02ab0875c911 100644
--- a/drivers/soc/microchip/mpfs-sys-controller.c
+++ b/drivers/soc/microchip/mpfs-sys-controller.c
@@ -36,6 +36,11 @@ struct mpfs_sys_controller {
struct kref consumers;
};
+struct mpfs_syscon_config {
+ unsigned int nb_subdevs;
+ struct platform_device *subdevs;
+};
+
int mpfs_blocking_transaction(struct mpfs_sys_controller *sys_controller, struct mpfs_mss_msg *msg)
{
unsigned long timeout = msecs_to_jiffies(MPFS_SYS_CTRL_TIMEOUT_MS);
@@ -110,25 +115,11 @@ struct mtd_info *mpfs_sys_controller_get_flash(struct mpfs_sys_controller *mpfs_
}
EXPORT_SYMBOL(mpfs_sys_controller_get_flash);
-static struct platform_device subdevs[] = {
- {
- .name = "mpfs-rng",
- .id = -1,
- },
- {
- .name = "mpfs-generic-service",
- .id = -1,
- },
- {
- .name = "mpfs-auto-update",
- .id = -1,
- },
-};
-
static int mpfs_sys_controller_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct mpfs_sys_controller *sys_controller;
+ struct mpfs_syscon_config *of_data;
struct device_node *np;
int i, ret;
@@ -164,11 +155,17 @@ static int mpfs_sys_controller_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, sys_controller);
+ of_data = (struct mpfs_syscon_config *) device_get_match_data(dev);
+ if (!of_data) {
+ dev_err(dev, "Error getting match data\n");
+ return -EINVAL;
+ }
- for (i = 0; i < ARRAY_SIZE(subdevs); i++) {
- subdevs[i].dev.parent = dev;
- if (platform_device_register(&subdevs[i]))
- dev_warn(dev, "Error registering sub device %s\n", subdevs[i].name);
+ for (i = 0; i < of_data->nb_subdevs; i++) {
+ of_data->subdevs[i].dev.parent = dev;
+ if (platform_device_register(&of_data->subdevs[i]))
+ dev_warn(dev, "Error registering sub device %s\n",
+ of_data->subdevs[i].name);
}
dev_info(&pdev->dev, "Registered MPFS system controller\n");
@@ -183,8 +180,45 @@ static void mpfs_sys_controller_remove(struct platform_device *pdev)
mpfs_sys_controller_put(sys_controller);
}
+static struct platform_device mpfs_subdevs[] = {
+ {
+ .name = "mpfs-rng",
+ .id = -1,
+ },
+ {
+ .name = "mpfs-generic-service",
+ .id = -1,
+ },
+ {
+ .name = "mpfs-auto-update",
+ .id = -1,
+ },
+};
+
+static struct platform_device pic64gx_subdevs[] = {
+ {
+ .name = "mpfs-rng",
+ .id = -1,
+ },
+ {
+ .name = "mpfs-generic-service",
+ .id = -1,
+ },
+};
+
+static const struct mpfs_syscon_config mpfs_config = {
+ .nb_subdevs = ARRAY_SIZE(mpfs_subdevs),
+ .subdevs = mpfs_subdevs,
+};
+
+static const struct mpfs_syscon_config pic64gx_config = {
+ .nb_subdevs = ARRAY_SIZE(pic64gx_subdevs),
+ .subdevs = pic64gx_subdevs,
+};
+
static const struct of_device_id mpfs_sys_controller_of_match[] = {
- {.compatible = "microchip,mpfs-sys-controller", },
+ {.compatible = "microchip,mpfs-sys-controller", .data = &mpfs_config},
+ {.compatible = "microchip,pic64gx-sys-controller", .data = &pic64gx_config},
{},
};
MODULE_DEVICE_TABLE(of, mpfs_sys_controller_of_match);
--
2.51.0
Powered by blists - more mailing lists