mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-22 06:57:57 +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>
77 lines
2.4 KiB
Diff
77 lines
2.4 KiB
Diff
From 9cf85a95eeb239a079a3485bd1d0447431bdc7f1 Mon Sep 17 00:00:00 2001
|
|
From: Phil Elwell <phil@raspberrypi.com>
|
|
Date: Wed, 8 Mar 2023 14:42:48 +0000
|
|
Subject: [PATCH] soc: bcm: bcm2835-power: Add support for BCM2712
|
|
|
|
BCM2712 has a PM block but neither ASB nor RPIVID_ASB. Use the absence
|
|
of the "asb" register range to indicate BCM2712 and its different PM
|
|
register range.
|
|
|
|
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
|
---
|
|
drivers/soc/bcm/bcm2835-power.c | 29 +++++++++++++++++++----------
|
|
1 file changed, 19 insertions(+), 10 deletions(-)
|
|
|
|
--- a/drivers/soc/bcm/bcm2835-power.c
|
|
+++ b/drivers/soc/bcm/bcm2835-power.c
|
|
@@ -79,6 +79,7 @@
|
|
#define PM_IMAGE 0x108
|
|
#define PM_GRAFX 0x10c
|
|
#define PM_PROC 0x110
|
|
+#define PM_GRAFX_2712 0x304
|
|
#define PM_ENAB BIT(12)
|
|
#define PM_ISPRSTN BIT(8)
|
|
#define PM_H264RSTN BIT(7)
|
|
@@ -381,6 +382,9 @@ static int bcm2835_power_pd_power_on(str
|
|
return bcm2835_power_power_on(pd, PM_GRAFX);
|
|
|
|
case BCM2835_POWER_DOMAIN_GRAFX_V3D:
|
|
+ if (!power->asb)
|
|
+ return bcm2835_asb_power_on(pd, PM_GRAFX_2712,
|
|
+ 0, 0, PM_V3DRSTN);
|
|
return bcm2835_asb_power_on(pd, PM_GRAFX,
|
|
ASB_V3D_M_CTRL, ASB_V3D_S_CTRL,
|
|
PM_V3DRSTN);
|
|
@@ -447,6 +451,9 @@ static int bcm2835_power_pd_power_off(st
|
|
return bcm2835_power_power_off(pd, PM_GRAFX);
|
|
|
|
case BCM2835_POWER_DOMAIN_GRAFX_V3D:
|
|
+ if (!power->asb)
|
|
+ return bcm2835_asb_power_off(pd, PM_GRAFX_2712,
|
|
+ 0, 0, PM_V3DRSTN);
|
|
return bcm2835_asb_power_off(pd, PM_GRAFX,
|
|
ASB_V3D_M_CTRL, ASB_V3D_S_CTRL,
|
|
PM_V3DRSTN);
|
|
@@ -642,19 +649,21 @@ static int bcm2835_power_probe(struct pl
|
|
power->asb = pm->asb;
|
|
power->rpivid_asb = pm->rpivid_asb;
|
|
|
|
- id = readl(power->asb + ASB_AXI_BRDG_ID);
|
|
- if (id != BCM2835_BRDG_ID /* "BRDG" */) {
|
|
- dev_err(dev, "ASB register ID returned 0x%08x\n", id);
|
|
- return -ENODEV;
|
|
- }
|
|
-
|
|
- if (power->rpivid_asb) {
|
|
- id = readl(power->rpivid_asb + ASB_AXI_BRDG_ID);
|
|
+ if (power->asb) {
|
|
+ id = readl(power->asb + ASB_AXI_BRDG_ID);
|
|
if (id != BCM2835_BRDG_ID /* "BRDG" */) {
|
|
- dev_err(dev, "RPiVid ASB register ID returned 0x%08x\n",
|
|
- id);
|
|
+ dev_err(dev, "ASB register ID returned 0x%08x\n", id);
|
|
return -ENODEV;
|
|
}
|
|
+
|
|
+ if (power->rpivid_asb) {
|
|
+ id = readl(power->rpivid_asb + ASB_AXI_BRDG_ID);
|
|
+ if (id != BCM2835_BRDG_ID /* "BRDG" */) {
|
|
+ dev_err(dev, "RPiVid ASB register ID returned 0x%08x\n",
|
|
+ id);
|
|
+ return -ENODEV;
|
|
+ }
|
|
+ }
|
|
}
|
|
|
|
power->pd_xlate.domains = devm_kcalloc(dev,
|