[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250511133939.801777-21-apatel@ventanamicro.com>
Date: Sun, 11 May 2025 19:09:36 +0530
From: Anup Patel <apatel@...tanamicro.com>
To: Michael Turquette <mturquette@...libre.com>,
Stephen Boyd <sboyd@...nel.org>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Jassi Brar <jassisinghbrar@...il.com>,
Thomas Gleixner <tglx@...utronix.de>,
"Rafael J . Wysocki" <rafael@...nel.org>,
Mika Westerberg <mika.westerberg@...ux.intel.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <brgl@...ev.pl>,
Uwe Kleine-König <ukleinek@...nel.org>
Cc: Palmer Dabbelt <palmer@...belt.com>,
Paul Walmsley <paul.walmsley@...ive.com>,
Len Brown <lenb@...nel.org>,
Sunil V L <sunilvl@...tanamicro.com>,
Rahul Pathak <rpathak@...tanamicro.com>,
Leyfoon Tan <leyfoon.tan@...rfivetech.com>,
Atish Patra <atish.patra@...ux.dev>,
Andrew Jones <ajones@...tanamicro.com>,
Samuel Holland <samuel.holland@...ive.com>,
Anup Patel <anup@...infault.org>,
linux-clk@...r.kernel.org,
devicetree@...r.kernel.org,
linux-riscv@...ts.infradead.org,
linux-kernel@...r.kernel.org,
Anup Patel <apatel@...tanamicro.com>
Subject: [PATCH v3 20/23] mailbox/riscv-sbi-mpxy: Add ACPI support
From: Sunil V L <sunilvl@...tanamicro.com>
Add ACPI support for the RISC-V SBI message proxy (MPXY) based
mailbox driver.
Signed-off-by: Sunil V L <sunilvl@...tanamicro.com>
Signed-off-by: Anup Patel <apatel@...tanamicro.com>
---
drivers/mailbox/riscv-sbi-mpxy-mbox.c | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/drivers/mailbox/riscv-sbi-mpxy-mbox.c b/drivers/mailbox/riscv-sbi-mpxy-mbox.c
index 240df2f9d5c2..eae84b26d628 100644
--- a/drivers/mailbox/riscv-sbi-mpxy-mbox.c
+++ b/drivers/mailbox/riscv-sbi-mpxy-mbox.c
@@ -6,9 +6,11 @@
*/
#include <asm/sbi.h>
+#include <linux/acpi.h>
#include <linux/cpu.h>
#include <linux/err.h>
#include <linux/init.h>
+#include <linux/irqchip/riscv-imsic.h>
#include <linux/jump_label.h>
#include <linux/kernel.h>
#include <linux/mailbox_controller.h>
@@ -775,6 +777,7 @@ static int mpxy_mbox_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct mpxy_mbox_channel *mchan;
+ struct irq_domain *msi_domain;
struct mpxy_mbox *mbox;
int i, msi_idx, rc;
u32 *channel_ids;
@@ -907,8 +910,13 @@ static int mpxy_mbox_probe(struct platform_device *pdev)
* then we need to set it explicitly before using any platform
* MSI functions.
*/
- if (is_of_node(dev_fwnode(dev)))
+ if (is_of_node(dev_fwnode(dev))) {
of_msi_configure(dev, to_of_node(dev_fwnode(dev)));
+ } else {
+ msi_domain = irq_find_matching_fwnode(imsic_acpi_get_fwnode(dev),
+ DOMAIN_BUS_PLATFORM_MSI);
+ dev_set_msi_domain(dev, msi_domain);
+ }
}
/* Setup MSIs for mailbox (if required) */
@@ -953,6 +961,11 @@ static int mpxy_mbox_probe(struct platform_device *pdev)
return rc;
}
+#ifdef CONFIG_ACPI
+ if (!acpi_disabled)
+ acpi_dev_clear_dependencies(ACPI_COMPANION(dev));
+#endif
+
dev_info(dev, "mailbox registered with %d channels\n",
mbox->channel_count);
return 0;
@@ -972,10 +985,17 @@ static const struct of_device_id mpxy_mbox_of_match[] = {
};
MODULE_DEVICE_TABLE(of, mpxy_mbox_of_match);
+static const struct acpi_device_id mpxy_mbox_acpi_match[] = {
+ { "RSCV0005" },
+ {}
+};
+MODULE_DEVICE_TABLE(acpi, mpxy_mbox_acpi_match);
+
static struct platform_driver mpxy_mbox_driver = {
.driver = {
.name = "riscv-sbi-mpxy-mbox",
.of_match_table = mpxy_mbox_of_match,
+ .acpi_match_table = mpxy_mbox_acpi_match,
},
.probe = mpxy_mbox_probe,
.remove = mpxy_mbox_remove,
--
2.43.0
Powered by blists - more mailing lists