Skip to content

Commit d4aa596

Browse files
Stanimir VarbanovUlf Hansson
authored andcommitted
pmdomain: bcm: bcm2835-power: Prepare to support BCM2712
BCM2712 has a PM block but lacks asb and rpivid_asb register spaces. To avoid unwanted results add a check for asb existence during probe and also add a new register offset for bcm2712 to control grafx_v3d power domain. The decision to use the new register is implicit - if asb register base is null then the driver is probed for bcm2712 (the other supported SoCs have asb register space). Signed-off-by: Stanimir Varbanov <svarbanov@suse.de> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent b0671a5 commit d4aa596

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

drivers/pmdomain/bcm/bcm2835-power.c

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
#define PM_IMAGE 0x108
8080
#define PM_GRAFX 0x10c
8181
#define PM_PROC 0x110
82+
#define PM_GRAFX_2712 0x304
8283
#define PM_ENAB BIT(12)
8384
#define PM_ISPRSTN BIT(8)
8485
#define PM_H264RSTN BIT(7)
@@ -381,6 +382,9 @@ static int bcm2835_power_pd_power_on(struct generic_pm_domain *domain)
381382
return bcm2835_power_power_on(pd, PM_GRAFX);
382383

383384
case BCM2835_POWER_DOMAIN_GRAFX_V3D:
385+
if (!power->asb)
386+
return bcm2835_asb_power_on(pd, PM_GRAFX_2712,
387+
0, 0, PM_V3DRSTN);
384388
return bcm2835_asb_power_on(pd, PM_GRAFX,
385389
ASB_V3D_M_CTRL, ASB_V3D_S_CTRL,
386390
PM_V3DRSTN);
@@ -447,6 +451,9 @@ static int bcm2835_power_pd_power_off(struct generic_pm_domain *domain)
447451
return bcm2835_power_power_off(pd, PM_GRAFX);
448452

449453
case BCM2835_POWER_DOMAIN_GRAFX_V3D:
454+
if (!power->asb)
455+
return bcm2835_asb_power_off(pd, PM_GRAFX_2712,
456+
0, 0, PM_V3DRSTN);
450457
return bcm2835_asb_power_off(pd, PM_GRAFX,
451458
ASB_V3D_M_CTRL, ASB_V3D_S_CTRL,
452459
PM_V3DRSTN);
@@ -635,10 +642,12 @@ static int bcm2835_power_probe(struct platform_device *pdev)
635642
power->asb = pm->asb;
636643
power->rpivid_asb = pm->rpivid_asb;
637644

638-
id = readl(power->asb + ASB_AXI_BRDG_ID);
639-
if (id != BCM2835_BRDG_ID /* "BRDG" */) {
640-
dev_err(dev, "ASB register ID returned 0x%08x\n", id);
641-
return -ENODEV;
645+
if (power->asb) {
646+
id = readl(power->asb + ASB_AXI_BRDG_ID);
647+
if (id != BCM2835_BRDG_ID /* "BRDG" */) {
648+
dev_err(dev, "ASB register ID returned 0x%08x\n", id);
649+
return -ENODEV;
650+
}
642651
}
643652

644653
if (power->rpivid_asb) {

0 commit comments

Comments
 (0)