Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Stanimir Varbanov and committed by
Ulf Hansson
d4aa5960 b0671a5f

+13 -4
+13 -4
drivers/pmdomain/bcm/bcm2835-power.c
··· 79 79 #define PM_IMAGE 0x108 80 80 #define PM_GRAFX 0x10c 81 81 #define PM_PROC 0x110 82 + #define PM_GRAFX_2712 0x304 82 83 #define PM_ENAB BIT(12) 83 84 #define PM_ISPRSTN BIT(8) 84 85 #define PM_H264RSTN BIT(7) ··· 382 381 return bcm2835_power_power_on(pd, PM_GRAFX); 383 382 384 383 case BCM2835_POWER_DOMAIN_GRAFX_V3D: 384 + if (!power->asb) 385 + return bcm2835_asb_power_on(pd, PM_GRAFX_2712, 386 + 0, 0, PM_V3DRSTN); 385 387 return bcm2835_asb_power_on(pd, PM_GRAFX, 386 388 ASB_V3D_M_CTRL, ASB_V3D_S_CTRL, 387 389 PM_V3DRSTN); ··· 451 447 return bcm2835_power_power_off(pd, PM_GRAFX); 452 448 453 449 case BCM2835_POWER_DOMAIN_GRAFX_V3D: 450 + if (!power->asb) 451 + return bcm2835_asb_power_off(pd, PM_GRAFX_2712, 452 + 0, 0, PM_V3DRSTN); 454 453 return bcm2835_asb_power_off(pd, PM_GRAFX, 455 454 ASB_V3D_M_CTRL, ASB_V3D_S_CTRL, 456 455 PM_V3DRSTN); ··· 642 635 power->asb = pm->asb; 643 636 power->rpivid_asb = pm->rpivid_asb; 644 637 645 - id = readl(power->asb + ASB_AXI_BRDG_ID); 646 - if (id != BCM2835_BRDG_ID /* "BRDG" */) { 647 - dev_err(dev, "ASB register ID returned 0x%08x\n", id); 648 - return -ENODEV; 638 + if (power->asb) { 639 + id = readl(power->asb + ASB_AXI_BRDG_ID); 640 + if (id != BCM2835_BRDG_ID /* "BRDG" */) { 641 + dev_err(dev, "ASB register ID returned 0x%08x\n", id); 642 + return -ENODEV; 643 + } 649 644 } 650 645 651 646 if (power->rpivid_asb) {