1 From 0c7aeb96fd3ab68011ba6c24239c501190890308 Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.com>
3 Date: Wed, 8 Mar 2023 14:27:58 +0000
4 Subject: [PATCH] mfd: bcm2835-pm: Add support for BCM2712
6 BCM2712 lacks the "asb" and "rpivid_asb" register ranges, but still
7 requires the use of the bcm2835-power driver to reset the V3D block.
9 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
11 drivers/mfd/bcm2835-pm.c | 28 +++++++++++++++++++---------
12 1 file changed, 19 insertions(+), 9 deletions(-)
14 --- a/drivers/mfd/bcm2835-pm.c
15 +++ b/drivers/mfd/bcm2835-pm.c
16 @@ -69,12 +69,30 @@ static int bcm2835_pm_get_pdata(struct p
20 +static const struct of_device_id bcm2835_pm_of_match[] = {
21 + { .compatible = "brcm,bcm2835-pm-wdt", },
22 + { .compatible = "brcm,bcm2835-pm", },
23 + { .compatible = "brcm,bcm2711-pm", },
24 + { .compatible = "brcm,bcm2712-pm", .data = (const void *)1},
27 +MODULE_DEVICE_TABLE(of, bcm2835_pm_of_match);
29 static int bcm2835_pm_probe(struct platform_device *pdev)
31 + const struct of_device_id *of_id;
32 struct device *dev = &pdev->dev;
33 struct bcm2835_pm *pm;
37 + of_id = of_match_node(bcm2835_pm_of_match, pdev->dev.of_node);
39 + dev_err(&pdev->dev, "Failed to match compatible string\n");
42 + is_2712 = !!of_id->data;
44 pm = devm_kzalloc(dev, sizeof(*pm), GFP_KERNEL);
47 @@ -97,21 +115,13 @@ static int bcm2835_pm_probe(struct platf
48 * bcm2835-pm binding as the key for whether we can reference
49 * the full PM register range and support power domains.
52 + if (pm->asb || is_2712)
53 return devm_mfd_add_devices(dev, -1, bcm2835_power_devs,
54 ARRAY_SIZE(bcm2835_power_devs),
59 -static const struct of_device_id bcm2835_pm_of_match[] = {
60 - { .compatible = "brcm,bcm2835-pm-wdt", },
61 - { .compatible = "brcm,bcm2835-pm", },
62 - { .compatible = "brcm,bcm2711-pm", },
65 -MODULE_DEVICE_TABLE(of, bcm2835_pm_of_match);
67 static struct platform_driver bcm2835_pm_driver = {
68 .probe = bcm2835_pm_probe,