Skip to content

Commit 4aac11c

Browse files
committed
soc: microchip: add mfd drivers for two syscon regions on PolarFire SoC
The control-scb and mss-top-sysreg regions on PolarFire SoC both fulfill multiple purposes. The former is used for mailbox functions in addition to the temperature & voltage sensor while the latter is used for clocks, resets, interrupt muxing and pinctrl. Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
1 parent feaa716 commit 4aac11c

4 files changed

Lines changed: 95 additions & 0 deletions

File tree

drivers/soc/microchip/Kconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,15 @@ config POLARFIRE_SOC_SYS_CTRL
99
module will be called mpfs_system_controller.
1010

1111
If unsure, say N.
12+
13+
config POLARFIRE_SOC_SYSCONS
14+
bool "PolarFire SoC (MPFS) syscon drivers"
15+
default y
16+
depends on ARCH_MICROCHIP
17+
select MFD_CORE
18+
help
19+
These drivers add support for the syscons on PolarFire SoC (MPFS).
20+
Without these drivers core parts of the kernel such as clocks
21+
and resets will not function correctly.
22+
23+
If unsure, and on a PolarFire SoC, say y.

drivers/soc/microchip/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
obj-$(CONFIG_POLARFIRE_SOC_SYS_CTRL) += mpfs-sys-controller.o
2+
obj-$(CONFIG_POLARFIRE_SOC_SYSCONS) += mpfs-control-scb.o mpfs-mss-top-sysreg.o
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
3+
#include <linux/array_size.h>
4+
#include <linux/of.h>
5+
#include <linux/mfd/core.h>
6+
#include <linux/mfd/syscon.h>
7+
#include <linux/platform_device.h>
8+
9+
static const struct mfd_cell mpfs_control_scb_devs[] = {
10+
MFD_CELL_NAME("mpfs-tvs"),
11+
};
12+
13+
static int mpfs_control_scb_probe(struct platform_device *pdev)
14+
{
15+
struct device *dev = &pdev->dev;
16+
17+
return mfd_add_devices(dev, PLATFORM_DEVID_NONE, mpfs_control_scb_devs,
18+
ARRAY_SIZE(mpfs_control_scb_devs), NULL, 0, NULL);
19+
}
20+
21+
static const struct of_device_id mpfs_control_scb_of_match[] = {
22+
{ .compatible = "microchip,mpfs-control-scb", },
23+
{},
24+
};
25+
MODULE_DEVICE_TABLE(of, mpfs_control_scb_of_match);
26+
27+
static struct platform_driver mpfs_control_scb_driver = {
28+
.driver = {
29+
.name = "mpfs-control-scb",
30+
.of_match_table = mpfs_control_scb_of_match,
31+
},
32+
.probe = mpfs_control_scb_probe,
33+
};
34+
module_platform_driver(mpfs_control_scb_driver);
35+
36+
MODULE_LICENSE("GPL");
37+
MODULE_AUTHOR("Conor Dooley <conor.dooley@microchip.com>");
38+
MODULE_DESCRIPTION("PolarFire SoC control scb driver");
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
3+
#include <linux/array_size.h>
4+
#include <linux/of.h>
5+
#include <linux/mfd/core.h>
6+
#include <linux/mfd/syscon.h>
7+
#include <linux/of_platform.h>
8+
#include <linux/platform_device.h>
9+
10+
static const struct mfd_cell mpfs_mss_top_sysreg_devs[] = {
11+
MFD_CELL_NAME("mpfs-reset"),
12+
};
13+
14+
static int mpfs_mss_top_sysreg_probe(struct platform_device *pdev)
15+
{
16+
struct device *dev = &pdev->dev;
17+
int ret;
18+
19+
ret = mfd_add_devices(dev, PLATFORM_DEVID_NONE, mpfs_mss_top_sysreg_devs,
20+
ARRAY_SIZE(mpfs_mss_top_sysreg_devs) , NULL, 0, NULL);
21+
if (ret)
22+
return ret;
23+
24+
return devm_of_platform_populate(dev);
25+
}
26+
27+
static const struct of_device_id mpfs_mss_top_sysreg_of_match[] = {
28+
{ .compatible = "microchip,mpfs-mss-top-sysreg", },
29+
{},
30+
};
31+
MODULE_DEVICE_TABLE(of, mpfs_mss_top_sysreg_of_match);
32+
33+
static struct platform_driver mpfs_mss_top_sysreg_driver = {
34+
.driver = {
35+
.name = "mpfs-mss-top-sysreg",
36+
.of_match_table = mpfs_mss_top_sysreg_of_match,
37+
},
38+
.probe = mpfs_mss_top_sysreg_probe,
39+
};
40+
module_platform_driver(mpfs_mss_top_sysreg_driver);
41+
42+
MODULE_LICENSE("GPL");
43+
MODULE_AUTHOR("Conor Dooley <conor.dooley@microchip.com>");
44+
MODULE_DESCRIPTION("PolarFire SoC mss top sysreg driver");

0 commit comments

Comments
 (0)