Commit df762342 authored by Stefan Wahren's avatar Stefan Wahren Committed by Lee Jones

mfd: bcm2835-pm: Add support for BCM2711

In BCM2711 the new RPiVid ASB took over V3D. The old ASB is still present
with the ISP and H264 bits, and V3D is in the same place in the new ASB
as the old one.

As per the devicetree bindings, BCM2711 will provide both the old and
new ASB resources, so get both of them and pass them into
'bcm2835-power,' which will take care of selecting which one to use
accordingly.

Since the RPiVid ASB's resources were being provided prior to formalizing
the bindings[1], also support the old DT files that didn't use
'reg-names.'

[1] See: 7dbe8c62 ("ARM: dts: Add minimal Raspberry Pi 4 support")
Signed-off-by: default avatarStefan Wahren <stefan.wahren@i2se.com>
Reviewed-by: default avatarPeter Robinson <pbrobinson@gmail.com>
Acked-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220625113619.15944-8-stefan.wahren@i2se.com
parent 01e7865d
...@@ -42,6 +42,14 @@ static int bcm2835_pm_get_pdata(struct platform_device *pdev, ...@@ -42,6 +42,14 @@ static int bcm2835_pm_get_pdata(struct platform_device *pdev,
pm->asb = NULL; pm->asb = NULL;
} }
res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
"rpivid_asb");
if (res) {
pm->rpivid_asb = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(pm->rpivid_asb))
pm->rpivid_asb = NULL;
}
return 0; return 0;
} }
...@@ -54,6 +62,10 @@ static int bcm2835_pm_get_pdata(struct platform_device *pdev, ...@@ -54,6 +62,10 @@ static int bcm2835_pm_get_pdata(struct platform_device *pdev,
if (IS_ERR(pm->asb)) if (IS_ERR(pm->asb))
pm->asb = NULL; pm->asb = NULL;
pm->rpivid_asb = devm_platform_ioremap_resource(pdev, 2);
if (IS_ERR(pm->rpivid_asb))
pm->rpivid_asb = NULL;
return 0; return 0;
} }
...@@ -95,6 +107,7 @@ static int bcm2835_pm_probe(struct platform_device *pdev) ...@@ -95,6 +107,7 @@ static int bcm2835_pm_probe(struct platform_device *pdev)
static const struct of_device_id bcm2835_pm_of_match[] = { static const struct of_device_id bcm2835_pm_of_match[] = {
{ .compatible = "brcm,bcm2835-pm-wdt", }, { .compatible = "brcm,bcm2835-pm-wdt", },
{ .compatible = "brcm,bcm2835-pm", }, { .compatible = "brcm,bcm2835-pm", },
{ .compatible = "brcm,bcm2711-pm", },
{}, {},
}; };
MODULE_DEVICE_TABLE(of, bcm2835_pm_of_match); MODULE_DEVICE_TABLE(of, bcm2835_pm_of_match);
......
...@@ -9,6 +9,7 @@ struct bcm2835_pm { ...@@ -9,6 +9,7 @@ struct bcm2835_pm {
struct device *dev; struct device *dev;
void __iomem *base; void __iomem *base;
void __iomem *asb; void __iomem *asb;
void __iomem *rpivid_asb;
}; };
#endif /* BCM2835_MFD_PM_H */ #endif /* BCM2835_MFD_PM_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment