mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-30 18:47:06 +00:00
2e715fb4fc
Add support for BCM2712 (Raspberry Pi 5).
3bb5880ab3
Patches were generated from the diff between linux kernel branch linux-6.1.y
and rpi-6.1.y from raspberry pi kernel source:
- git format-patch linux-6.1.y...rpi-6.1.y
Build system: x86_64
Build-tested: bcm2708, bcm2709, bcm2710, bcm2711
Run-tested: bcm2710/RPi3B, bcm2711/RPi4B
Signed-off-by: Marty Jones <mj8263788@gmail.com>
[Remove applied and reverted patches, squash patches and config commits]
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
70 lines
2.1 KiB
Diff
70 lines
2.1 KiB
Diff
From 0c7aeb96fd3ab68011ba6c24239c501190890308 Mon Sep 17 00:00:00 2001
|
|
From: Phil Elwell <phil@raspberrypi.com>
|
|
Date: Wed, 8 Mar 2023 14:27:58 +0000
|
|
Subject: [PATCH] mfd: bcm2835-pm: Add support for BCM2712
|
|
|
|
BCM2712 lacks the "asb" and "rpivid_asb" register ranges, but still
|
|
requires the use of the bcm2835-power driver to reset the V3D block.
|
|
|
|
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
|
---
|
|
drivers/mfd/bcm2835-pm.c | 28 +++++++++++++++++++---------
|
|
1 file changed, 19 insertions(+), 9 deletions(-)
|
|
|
|
--- a/drivers/mfd/bcm2835-pm.c
|
|
+++ b/drivers/mfd/bcm2835-pm.c
|
|
@@ -69,12 +69,30 @@ static int bcm2835_pm_get_pdata(struct p
|
|
return 0;
|
|
}
|
|
|
|
+static const struct of_device_id bcm2835_pm_of_match[] = {
|
|
+ { .compatible = "brcm,bcm2835-pm-wdt", },
|
|
+ { .compatible = "brcm,bcm2835-pm", },
|
|
+ { .compatible = "brcm,bcm2711-pm", },
|
|
+ { .compatible = "brcm,bcm2712-pm", .data = (const void *)1},
|
|
+ {},
|
|
+};
|
|
+MODULE_DEVICE_TABLE(of, bcm2835_pm_of_match);
|
|
+
|
|
static int bcm2835_pm_probe(struct platform_device *pdev)
|
|
{
|
|
+ const struct of_device_id *of_id;
|
|
struct device *dev = &pdev->dev;
|
|
struct bcm2835_pm *pm;
|
|
+ bool is_2712;
|
|
int ret;
|
|
|
|
+ of_id = of_match_node(bcm2835_pm_of_match, pdev->dev.of_node);
|
|
+ if (!of_id) {
|
|
+ dev_err(&pdev->dev, "Failed to match compatible string\n");
|
|
+ return -EINVAL;
|
|
+ }
|
|
+ is_2712 = !!of_id->data;
|
|
+
|
|
pm = devm_kzalloc(dev, sizeof(*pm), GFP_KERNEL);
|
|
if (!pm)
|
|
return -ENOMEM;
|
|
@@ -97,21 +115,13 @@ static int bcm2835_pm_probe(struct platf
|
|
* bcm2835-pm binding as the key for whether we can reference
|
|
* the full PM register range and support power domains.
|
|
*/
|
|
- if (pm->asb)
|
|
+ if (pm->asb || is_2712)
|
|
return devm_mfd_add_devices(dev, -1, bcm2835_power_devs,
|
|
ARRAY_SIZE(bcm2835_power_devs),
|
|
NULL, 0, NULL);
|
|
return 0;
|
|
}
|
|
|
|
-static const struct of_device_id bcm2835_pm_of_match[] = {
|
|
- { .compatible = "brcm,bcm2835-pm-wdt", },
|
|
- { .compatible = "brcm,bcm2835-pm", },
|
|
- { .compatible = "brcm,bcm2711-pm", },
|
|
- {},
|
|
-};
|
|
-MODULE_DEVICE_TABLE(of, bcm2835_pm_of_match);
|
|
-
|
|
static struct platform_driver bcm2835_pm_driver = {
|
|
.probe = bcm2835_pm_probe,
|
|
.driver = {
|