Skip to content

Commit 52206f8

Browse files
committed
Merge tag 'pmdomain-v6.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm
Pull pmdomain updates from Ulf Hansson: "pmdomain core: - Allow power-off for out-of-band wakeup-capable devices - Drop the redundant call to dev_pm_domain_detach() for the amba bus - Extend the genpd governor for CPUs to account for IPIs pmdomain providers: - bcm: Add support for BCM2712 - mediatek: Add support for MFlexGraphics power domains - mediatek: Add support for MT8196 power domains - qcom: Add RPMh power domain support for Kaanapali - rockchip: Add support for RV1126B pmdomain consumers: - usb: dwc3: Enable out of band wakeup for i.MX95 - usb: chipidea: Enable out of band wakeup for i.MX95" * tag 'pmdomain-v6.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm: (26 commits) pmdomain: Extend the genpd governor for CPUs to account for IPIs smp: Introduce a helper function to check for pending IPIs pmdomain: mediatek: convert from clk round_rate() to determine_rate() amba: bus: Drop dev_pm_domain_detach() call pmdomain: bcm: bcm2835-power: Prepare to support BCM2712 pmdomain: mediatek: mtk-mfg: select MAILBOX in Kconfig pmdomain: mediatek: Add support for MFlexGraphics pmdomain: mediatek: Fix build-errors cpuidle: psci: Replace deprecated strcpy in psci_idle_init_cpu pmdomain: rockchip: Add support for RV1126B pmdomain: mediatek: Add support for MT8196 HFRPSYS power domains pmdomain: mediatek: Add support for MT8196 SCPSYS power domains pmdomain: mediatek: Add support for secure HWCCF infra power on pmdomain: mediatek: Add support for Hardware Voter power domains pmdomain: qcom: rpmhpd: Add RPMh power domain support for Kaanapali usb: dwc3: imx8mp: Set out of band wakeup for i.MX95 usb: chipidea: ci_hdrc_imx: Set out of band wakeup for i.MX95 usb: chipidea: core: detach power domain for ci_hdrc platform device pmdomain: core: Allow power-off for out-of-band wakeup-capable devices PM: wakeup: Add out-of-band system wakeup support for devices ...
2 parents 500920f + 1f67707 commit 52206f8

30 files changed

Lines changed: 2417 additions & 60 deletions
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/power/mediatek,mt8196-gpufreq.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: MediaTek MFlexGraphics Power and Frequency Controller
8+
9+
maintainers:
10+
- Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
11+
12+
description:
13+
A special-purpose embedded MCU to control power and frequency of GPU devices
14+
using MediaTek Flexible Graphics integration hardware.
15+
16+
properties:
17+
$nodename:
18+
pattern: '^power-controller@[a-f0-9]+$'
19+
20+
compatible:
21+
enum:
22+
- mediatek,mt8196-gpufreq
23+
24+
reg:
25+
items:
26+
- description: GPR memory area
27+
- description: RPC memory area
28+
- description: SoC variant ID register
29+
30+
reg-names:
31+
items:
32+
- const: gpr
33+
- const: rpc
34+
- const: hw-revision
35+
36+
clocks:
37+
items:
38+
- description: main clock of the embedded controller (EB)
39+
- description: core PLL
40+
- description: stack 0 PLL
41+
- description: stack 1 PLL
42+
43+
clock-names:
44+
items:
45+
- const: eb
46+
- const: core
47+
- const: stack0
48+
- const: stack1
49+
50+
mboxes:
51+
items:
52+
- description: FastDVFS events
53+
- description: frequency control
54+
- description: sleep control
55+
- description: timer control
56+
- description: frequency hopping control
57+
- description: hardware voter control
58+
- description: FastDVFS control
59+
60+
mbox-names:
61+
items:
62+
- const: fast-dvfs-event
63+
- const: gpufreq
64+
- const: sleep
65+
- const: timer
66+
- const: fhctl
67+
- const: ccf
68+
- const: fast-dvfs
69+
70+
memory-region:
71+
items:
72+
- description: phandle to the GPUEB shared memory
73+
74+
"#clock-cells":
75+
const: 1
76+
77+
"#power-domain-cells":
78+
const: 0
79+
80+
required:
81+
- compatible
82+
- reg
83+
- reg-names
84+
- clocks
85+
- clock-names
86+
- mboxes
87+
- mbox-names
88+
- memory-region
89+
- "#clock-cells"
90+
- "#power-domain-cells"
91+
92+
additionalProperties: false
93+
94+
examples:
95+
- |
96+
#include <dt-bindings/clock/mediatek,mt8196-clock.h>
97+
98+
power-controller@4b09fd00 {
99+
compatible = "mediatek,mt8196-gpufreq";
100+
reg = <0x4b09fd00 0x80>,
101+
<0x4b800000 0x1000>,
102+
<0x4b860128 0x4>;
103+
reg-names = "gpr", "rpc", "hw-revision";
104+
clocks = <&topckgen CLK_TOP_MFG_EB>,
105+
<&mfgpll CLK_MFG_AO_MFGPLL>,
106+
<&mfgpll_sc0 CLK_MFGSC0_AO_MFGPLL_SC0>,
107+
<&mfgpll_sc1 CLK_MFGSC1_AO_MFGPLL_SC1>;
108+
clock-names = "eb", "core", "stack0", "stack1";
109+
mboxes = <&gpueb_mbox 0>, <&gpueb_mbox 1>, <&gpueb_mbox 2>,
110+
<&gpueb_mbox 3>, <&gpueb_mbox 4>, <&gpueb_mbox 5>,
111+
<&gpueb_mbox 7>;
112+
mbox-names = "fast-dvfs-event", "gpufreq", "sleep", "timer", "fhctl",
113+
"ccf", "fast-dvfs";
114+
memory-region = <&gpueb_shared_memory>;
115+
#clock-cells = <1>;
116+
#power-domain-cells = <0>;
117+
};

Documentation/devicetree/bindings/power/mediatek,power-controller.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ properties:
3333
- mediatek,mt8188-power-controller
3434
- mediatek,mt8192-power-controller
3535
- mediatek,mt8195-power-controller
36+
- mediatek,mt8196-hwv-hfrp-power-controller
37+
- mediatek,mt8196-hwv-scp-power-controller
38+
- mediatek,mt8196-power-controller
3639
- mediatek,mt8365-power-controller
3740

3841
'#power-domain-cells':
@@ -157,6 +160,7 @@ allOf:
157160
contains:
158161
enum:
159162
- mediatek,mt8183-power-controller
163+
- mediatek,mt8196-power-controller
160164
then:
161165
properties:
162166
access-controllers:

Documentation/devicetree/bindings/power/qcom,rpmpd.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ properties:
1818
oneOf:
1919
- enum:
2020
- qcom,glymur-rpmhpd
21+
- qcom,kaanapali-rpmhpd
2122
- qcom,mdm9607-rpmpd
2223
- qcom,milos-rpmhpd
2324
- qcom,msm8226-rpmpd

Documentation/devicetree/bindings/power/rockchip,power-controller.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ properties:
4646
- rockchip,rk3576-power-controller
4747
- rockchip,rk3588-power-controller
4848
- rockchip,rv1126-power-controller
49+
- rockchip,rv1126b-power-controller
4950

5051
"#power-domain-cells":
5152
const: 1
@@ -126,6 +127,7 @@ $defs:
126127
"include/dt-bindings/power/rk3568-power.h"
127128
"include/dt-bindings/power/rk3588-power.h"
128129
"include/dt-bindings/power/rockchip,rv1126-power.h"
130+
"include/dt-bindings/power/rockchip,rv1126b-power-controller.h"
129131
130132
clocks:
131133
minItems: 1

Documentation/devicetree/bindings/soc/bcm/brcm,bcm2835-pm.yaml

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,21 @@ description: |
1313
maintainers:
1414
- Nicolas Saenz Julienne <nsaenz@kernel.org>
1515

16-
allOf:
17-
- $ref: /schemas/watchdog/watchdog.yaml#
18-
1916
properties:
2017
compatible:
2118
items:
2219
- enum:
2320
- brcm,bcm2835-pm
2421
- brcm,bcm2711-pm
22+
- brcm,bcm2712-pm
2523
- const: brcm,bcm2835-pm-wdt
2624

2725
reg:
28-
minItems: 2
26+
minItems: 1
2927
maxItems: 3
3028

3129
reg-names:
32-
minItems: 2
30+
minItems: 1
3331
items:
3432
- const: pm
3533
- const: asb
@@ -62,7 +60,35 @@ required:
6260
- reg
6361
- "#power-domain-cells"
6462
- "#reset-cells"
65-
- clocks
63+
64+
allOf:
65+
- $ref: /schemas/watchdog/watchdog.yaml#
66+
67+
- if:
68+
properties:
69+
compatible:
70+
contains:
71+
enum:
72+
- brcm,bcm2835-pm
73+
- brcm,bcm2711-pm
74+
then:
75+
required:
76+
- clocks
77+
78+
properties:
79+
reg:
80+
minItems: 2
81+
82+
reg-names:
83+
minItems: 2
84+
85+
else:
86+
properties:
87+
reg:
88+
maxItems: 1
89+
90+
reg-names:
91+
maxItems: 1
6692

6793
additionalProperties: false
6894

drivers/amba/bus.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -291,15 +291,14 @@ static int amba_probe(struct device *dev)
291291
if (ret < 0)
292292
break;
293293

294-
ret = dev_pm_domain_attach(dev, PD_FLAG_ATTACH_POWER_ON);
294+
ret = dev_pm_domain_attach(dev, PD_FLAG_ATTACH_POWER_ON |
295+
PD_FLAG_DETACH_POWER_OFF);
295296
if (ret)
296297
break;
297298

298299
ret = amba_get_enable_pclk(pcdev);
299-
if (ret) {
300-
dev_pm_domain_detach(dev, true);
300+
if (ret)
301301
break;
302-
}
303302

304303
pm_runtime_get_noresume(dev);
305304
pm_runtime_set_active(dev);
@@ -314,7 +313,6 @@ static int amba_probe(struct device *dev)
314313
pm_runtime_put_noidle(dev);
315314

316315
amba_put_disable_pclk(pcdev);
317-
dev_pm_domain_detach(dev, true);
318316
} while (0);
319317

320318
return ret;
@@ -336,7 +334,6 @@ static void amba_remove(struct device *dev)
336334
pm_runtime_put_noidle(dev);
337335

338336
amba_put_disable_pclk(pcdev);
339-
dev_pm_domain_detach(dev, true);
340337
}
341338

342339
static void amba_shutdown(struct device *dev)

drivers/base/power/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2148,6 +2148,7 @@ static int device_prepare(struct device *dev, pm_message_t state)
21482148
device_lock(dev);
21492149

21502150
dev->power.wakeup_path = false;
2151+
dev->power.out_band_wakeup = false;
21512152

21522153
if (dev->power.no_pm_callbacks)
21532154
goto unlock;

drivers/cpuidle/cpuidle-psci.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,8 @@ static int psci_idle_init_cpu(struct device *dev, int cpu)
382382
drv->states[0].exit_latency = 1;
383383
drv->states[0].target_residency = 1;
384384
drv->states[0].power_usage = UINT_MAX;
385-
strcpy(drv->states[0].name, "WFI");
386-
strcpy(drv->states[0].desc, "ARM WFI");
385+
strscpy(drv->states[0].name, "WFI");
386+
strscpy(drv->states[0].desc, "ARM WFI");
387387

388388
/*
389389
* If no DT idle states are detected (ret == 0) let the driver

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) {

drivers/pmdomain/core.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1551,7 +1551,8 @@ static int genpd_finish_suspend(struct device *dev,
15511551
if (ret)
15521552
return ret;
15531553

1554-
if (device_awake_path(dev) && genpd_is_active_wakeup(genpd))
1554+
if (device_awake_path(dev) && genpd_is_active_wakeup(genpd) &&
1555+
!device_out_band_wakeup(dev))
15551556
return 0;
15561557

15571558
if (genpd->dev_ops.stop && genpd->dev_ops.start &&
@@ -1606,7 +1607,8 @@ static int genpd_finish_resume(struct device *dev,
16061607
if (IS_ERR(genpd))
16071608
return -EINVAL;
16081609

1609-
if (device_awake_path(dev) && genpd_is_active_wakeup(genpd))
1610+
if (device_awake_path(dev) && genpd_is_active_wakeup(genpd) &&
1611+
!device_out_band_wakeup(dev))
16101612
return resume_noirq(dev);
16111613

16121614
genpd_lock(genpd);

0 commit comments

Comments
 (0)