From: Marcos Del Sol Vives <marcos@orca.pet>
To: linux-kernel@vger.kernel.org
Cc: Marcos Del Sol Vives <marcos@orca.pet>,
Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <brgl@bgdev.pl>,
Michael Walle <mwalle@kernel.org>, Lee Jones <lee@kernel.org>,
Bjorn Helgaas <bhelgaas@google.com>,
linux-gpio@vger.kernel.org, linux-pci@vger.kernel.org
Subject: [PATCH v3 3/3] mfd: vortex: implement new driver for Vortex southbridges
Date: Thu, 21 Aug 2025 12:18:59 +0200 [thread overview]
Message-ID: <20250821101902.626329-4-marcos@orca.pet> (raw)
In-Reply-To: <20250821101902.626329-1-marcos@orca.pet>
This new driver loads resources related to southbridges available in DM&P
Vortex devices, currently only the GPIO pins.
Signed-off-by: Marcos Del Sol Vives <marcos@orca.pet>
---
MAINTAINERS | 1 +
drivers/mfd/Kconfig | 9 +++++
drivers/mfd/Makefile | 1 +
drivers/mfd/vortex-sb.c | 81 +++++++++++++++++++++++++++++++++++++++++
include/linux/pci_ids.h | 1 +
5 files changed, 93 insertions(+)
create mode 100644 drivers/mfd/vortex-sb.c
diff --git a/MAINTAINERS b/MAINTAINERS
index 8c3098a39411..bc0c541309dd 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -26957,6 +26957,7 @@ VORTEX HARDWARE SUPPORT
R: Marcos Del Sol Vives <marcos@orca.pet>
S: Maintained
F: drivers/gpio/gpio-vortex.c
+F: drivers/mfd/vortex-sb.c
VRF
M: David Ahern <dsahern@kernel.org>
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 425c5fba6cb1..fe54bb22687d 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -2008,6 +2008,15 @@ config MFD_VX855
VIA VX855/VX875 south bridge. You will need to enable the vx855_spi
and/or vx855_gpio drivers for this to do anything useful.
+config MFD_VORTEX_SB
+ tristate "Vortex southbridge"
+ select MFD_CORE
+ depends on PCI
+ help
+ Say yes here if you want to have support for the southbridge
+ present on Vortex SoCs. You will need to enable the vortex-gpio
+ driver for this to do anything useful.
+
config MFD_ARIZONA
select REGMAP
select REGMAP_IRQ
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index f7bdedd5a66d..2504ba311f1a 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -202,6 +202,7 @@ obj-$(CONFIG_MFD_JANZ_CMODIO) += janz-cmodio.o
obj-$(CONFIG_MFD_TPS6586X) += tps6586x.o
obj-$(CONFIG_MFD_VX855) += vx855.o
obj-$(CONFIG_MFD_WL1273_CORE) += wl1273-core.o
+obj-$(CONFIG_MFD_VORTEX_SB) += vortex-sb.o
si476x-core-y := si476x-cmd.o si476x-prop.o si476x-i2c.o
obj-$(CONFIG_MFD_SI476X_CORE) += si476x-core.o
diff --git a/drivers/mfd/vortex-sb.c b/drivers/mfd/vortex-sb.c
new file mode 100644
index 000000000000..ef9bbe2d3870
--- /dev/null
+++ b/drivers/mfd/vortex-sb.c
@@ -0,0 +1,81 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * MFD southbridge driver for Vortex SoCs
+ *
+ * Author: Marcos Del Sol Vives <marcos@orca.pet>
+ *
+ * Based on the RDC321x MFD driver by Florian Fainelli and Bernhard Loos
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+#include <linux/pci.h>
+#include <linux/mfd/core.h>
+
+static const struct resource vortex_gpio_resources[] = {
+ {
+ .name = "dat",
+ .start = 0x78,
+ .end = 0x7C,
+ .flags = IORESOURCE_IO,
+ }, {
+ .name = "dir",
+ .start = 0x98,
+ .end = 0x9C,
+ .flags = IORESOURCE_IO,
+ }
+};
+
+static const struct mfd_cell vortex_sb_cells[] = {
+ {
+ .name = "vortex-gpio",
+ .resources = vortex_gpio_resources,
+ .num_resources = ARRAY_SIZE(vortex_gpio_resources),
+ },
+};
+
+static int vortex_sb_probe(struct pci_dev *pdev,
+ const struct pci_device_id *ent)
+{
+ int err;
+
+ /*
+ * In the Vortex86DX3, the southbridge appears twice (on both 00:07.0
+ * and 00:07.1). Register only once for .0.
+ *
+ * Other Vortex boards (eg Vortex86MX+) have the southbridge exposed
+ * only once, also at 00:07.0.
+ */
+ if (PCI_FUNC(pdev->devfn) != 0)
+ return -ENODEV;
+
+ err = pci_enable_device(pdev);
+ if (err) {
+ dev_err(&pdev->dev, "failed to enable device\n");
+ return err;
+ }
+
+ return devm_mfd_add_devices(&pdev->dev, -1,
+ vortex_sb_cells,
+ ARRAY_SIZE(vortex_sb_cells),
+ NULL, 0, NULL);
+}
+
+static const struct pci_device_id vortex_sb_table[] = {
+ { PCI_DEVICE(PCI_VENDOR_ID_RDC, PCI_DEVICE_ID_RDC_R6035) },
+ {}
+};
+MODULE_DEVICE_TABLE(pci, vortex_sb_table);
+
+static struct pci_driver vortex_sb_driver = {
+ .name = "vortex-sb",
+ .id_table = vortex_sb_table,
+ .probe = vortex_sb_probe,
+};
+
+module_pci_driver(vortex_sb_driver);
+
+MODULE_AUTHOR("Marcos Del Sol Vives <marcos@orca.pet>");
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("Vortex MFD southbridge driver");
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 92ffc4373f6d..2ff8a593ef72 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2412,6 +2412,7 @@
#define PCI_VENDOR_ID_RDC 0x17f3
#define PCI_DEVICE_ID_RDC_R6020 0x6020
#define PCI_DEVICE_ID_RDC_R6030 0x6030
+#define PCI_DEVICE_ID_RDC_R6035 0x6035
#define PCI_DEVICE_ID_RDC_R6040 0x6040
#define PCI_DEVICE_ID_RDC_R6060 0x6060
#define PCI_DEVICE_ID_RDC_R6061 0x6061
--
2.34.1
prev parent reply other threads:[~2025-08-21 10:19 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-21 10:18 [PATCH v3 0/3] Introduce support for Vortex GPIO pins Marcos Del Sol Vives
2025-08-21 10:18 ` [PATCH v3 1/3] gpio: gpio-regmap: add flags to control some behaviour Marcos Del Sol Vives
2025-08-21 14:32 ` Bjorn Helgaas
2025-08-21 17:14 ` Marcos Del Sol Vives
2025-08-21 16:40 ` Linus Walleij
2025-08-22 7:07 ` Michael Walle
2025-08-22 11:04 ` Marcos Del Sol Vives
2025-08-22 3:27 ` kernel test robot
2025-08-22 11:11 ` Marcos Del Sol Vives
2025-08-21 10:18 ` [PATCH v3 2/3] gpio: vortex: add new GPIO device driver Marcos Del Sol Vives
2025-08-21 16:48 ` Linus Walleij
2025-08-21 17:05 ` Marcos Del Sol Vives
2025-08-22 15:47 ` Bjorn Helgaas
2025-08-22 15:49 ` Bjorn Helgaas
2025-08-22 16:08 ` Marcos Del Sol Vives
2025-08-21 10:18 ` Marcos Del Sol Vives [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250821101902.626329-4-marcos@orca.pet \
--to=marcos@orca.pet \
--cc=bhelgaas@google.com \
--cc=brgl@bgdev.pl \
--cc=lee@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mwalle@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®