* [PATCH v2 0/4] Marvell PXA1908 power domains
@ 2025-08-21 11:17 Duje Mihanović
2025-08-21 11:17 ` [PATCH v2 1/4] dt-bindings: clock: marvell,pxa1908: Add syscon compatible to apmu Duje Mihanović
` (3 more replies)
0 siblings, 4 replies; 11+ messages in thread
From: Duje Mihanović @ 2025-08-21 11:17 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Ulf Hansson
Cc: David Wronek, Karel Balej, phone-devel, ~postmarketos/upstreaming,
linux-arm-kernel, linux-clk, devicetree, linux-kernel, linux-pm,
Duje Mihanović
Hello,
This series implements support for the power domains found in Marvell's
PXA1908 SoC. The domains control power for the graphics, video and image
processors along with the DSI PHY.
Signed-off-by: Duje Mihanović <duje@dujemihanovic.xyz>
---
Changes in v2:
- Move driver to clk subsystem (domains are instantiated by clock
driver)
- Drop power controller schema
- Drop RFC prefix
- Rebase on v6.17-rc2
- Link to v1: https://lore.kernel.org/r/20250806-pxa1908-genpd-v1-0-16409309fc72@dujemihanovic.xyz
---
Duje Mihanović (4):
dt-bindings: clock: marvell,pxa1908: Add syscon compatible to apmu
dt-bindings: power: Add Marvell PXA1908 domains
clk: mmp: Add PXA1908 power domain driver
arm64: dts: marvell: pxa1908: Add power domains
.../devicetree/bindings/clock/marvell,pxa1908.yaml | 30 ++-
MAINTAINERS | 5 +
.../marvell/mmp/pxa1908-samsung-coreprimevelte.dts | 1 +
arch/arm64/boot/dts/marvell/mmp/pxa1908.dtsi | 5 +-
drivers/clk/Kconfig | 1 +
drivers/clk/mmp/Kconfig | 14 ++
drivers/clk/mmp/Makefile | 5 +-
drivers/clk/mmp/clk-pxa1908-apmu.c | 2 +-
drivers/clk/mmp/clk.h | 2 +
drivers/clk/mmp/pxa1908-power-domains.c | 253 +++++++++++++++++++++
include/dt-bindings/power/marvell,pxa1908-power.h | 17 ++
11 files changed, 326 insertions(+), 9 deletions(-)
---
base-commit: c17b750b3ad9f45f2b6f7e6f7f4679844244f0b9
change-id: 20250803-pxa1908-genpd-15918db5260c
Best regards,
--
Duje Mihanović <duje@dujemihanovic.xyz>
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v2 1/4] dt-bindings: clock: marvell,pxa1908: Add syscon compatible to apmu
2025-08-21 11:17 [PATCH v2 0/4] Marvell PXA1908 power domains Duje Mihanović
@ 2025-08-21 11:17 ` Duje Mihanović
2025-08-22 19:35 ` Rob Herring (Arm)
2025-08-21 11:17 ` [PATCH v2 2/4] dt-bindings: power: Add Marvell PXA1908 domains Duje Mihanović
` (2 subsequent siblings)
3 siblings, 1 reply; 11+ messages in thread
From: Duje Mihanović @ 2025-08-21 11:17 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Ulf Hansson
Cc: David Wronek, Karel Balej, phone-devel, ~postmarketos/upstreaming,
linux-arm-kernel, linux-clk, devicetree, linux-kernel, linux-pm,
Duje Mihanović
Add required syscon compatible to the APMU controller. This is required
for the SoC's power domain controller as the registers are shared.
Also add a #power-domain-cells property as the node will serve as the
power domain phandle.
Signed-off-by: Duje Mihanović <duje@dujemihanovic.xyz>
---
v2:
- Drop simple-mfd
- Add #power-domain-cells
---
.../devicetree/bindings/clock/marvell,pxa1908.yaml | 30 +++++++++++++++++-----
1 file changed, 24 insertions(+), 6 deletions(-)
diff --git a/Documentation/devicetree/bindings/clock/marvell,pxa1908.yaml b/Documentation/devicetree/bindings/clock/marvell,pxa1908.yaml
index 4e78933232b6b925811425f853bedf6e9f01a27d..6f3a8578fe2a6810911fec5879c07c9ddb34565a 100644
--- a/Documentation/devicetree/bindings/clock/marvell,pxa1908.yaml
+++ b/Documentation/devicetree/bindings/clock/marvell,pxa1908.yaml
@@ -19,11 +19,14 @@ description: |
properties:
compatible:
- enum:
- - marvell,pxa1908-apbc
- - marvell,pxa1908-apbcp
- - marvell,pxa1908-mpmu
- - marvell,pxa1908-apmu
+ oneOf:
+ - enum:
+ - marvell,pxa1908-apbc
+ - marvell,pxa1908-apbcp
+ - marvell,pxa1908-mpmu
+ - items:
+ - const: marvell,pxa1908-apmu
+ - const: syscon
reg:
maxItems: 1
@@ -31,6 +34,9 @@ properties:
'#clock-cells':
const: 1
+ '#power-domain-cells':
+ const: 1
+
required:
- compatible
- reg
@@ -38,11 +44,23 @@ required:
additionalProperties: false
+if:
+ not:
+ properties:
+ compatible:
+ contains:
+ const: marvell,pxa1908-apmu
+
+then:
+ properties:
+ '#power-domain-cells': false
+
examples:
# APMU block:
- |
clock-controller@d4282800 {
- compatible = "marvell,pxa1908-apmu";
+ compatible = "marvell,pxa1908-apmu", "syscon";
reg = <0xd4282800 0x400>;
#clock-cells = <1>;
+ #power-domain-cells = <1>;
};
--
2.50.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 2/4] dt-bindings: power: Add Marvell PXA1908 domains
2025-08-21 11:17 [PATCH v2 0/4] Marvell PXA1908 power domains Duje Mihanović
2025-08-21 11:17 ` [PATCH v2 1/4] dt-bindings: clock: marvell,pxa1908: Add syscon compatible to apmu Duje Mihanović
@ 2025-08-21 11:17 ` Duje Mihanović
2025-08-22 19:36 ` Rob Herring
2025-08-21 11:17 ` [PATCH v2 3/4] clk: mmp: Add PXA1908 power domain driver Duje Mihanović
2025-08-21 11:17 ` [PATCH v2 4/4] arm64: dts: marvell: pxa1908: Add power domains Duje Mihanović
3 siblings, 1 reply; 11+ messages in thread
From: Duje Mihanović @ 2025-08-21 11:17 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Ulf Hansson
Cc: David Wronek, Karel Balej, phone-devel, ~postmarketos/upstreaming,
linux-arm-kernel, linux-clk, devicetree, linux-kernel, linux-pm,
Duje Mihanović
Add device tree bindings for Marvell PXA1908's power domains.
Signed-off-by: Duje Mihanović <duje@dujemihanovic.xyz>
---
v2:
- Drop schema
---
include/dt-bindings/power/marvell,pxa1908-power.h | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/include/dt-bindings/power/marvell,pxa1908-power.h b/include/dt-bindings/power/marvell,pxa1908-power.h
new file mode 100644
index 0000000000000000000000000000000000000000..19b088351af138823505a774ff27203429fe2d97
--- /dev/null
+++ b/include/dt-bindings/power/marvell,pxa1908-power.h
@@ -0,0 +1,17 @@
+/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
+/*
+ * Marvell PXA1908 power domains
+ *
+ * Copyright 2025, Duje Mihanović <duje@dujemihanovic.xyz>
+ */
+
+#ifndef __DTS_MARVELL_PXA1908_POWER_H
+#define __DTS_MARVELL_PXA1908_POWER_H
+
+#define PXA1908_POWER_DOMAIN_VPU 0
+#define PXA1908_POWER_DOMAIN_GPU 1
+#define PXA1908_POWER_DOMAIN_GPU2D 2
+#define PXA1908_POWER_DOMAIN_DSI 3
+#define PXA1908_POWER_DOMAIN_ISP 4
+
+#endif
--
2.50.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 3/4] clk: mmp: Add PXA1908 power domain driver
2025-08-21 11:17 [PATCH v2 0/4] Marvell PXA1908 power domains Duje Mihanović
2025-08-21 11:17 ` [PATCH v2 1/4] dt-bindings: clock: marvell,pxa1908: Add syscon compatible to apmu Duje Mihanović
2025-08-21 11:17 ` [PATCH v2 2/4] dt-bindings: power: Add Marvell PXA1908 domains Duje Mihanović
@ 2025-08-21 11:17 ` Duje Mihanović
2025-08-22 9:36 ` Ulf Hansson
2025-08-22 13:46 ` kernel test robot
2025-08-21 11:17 ` [PATCH v2 4/4] arm64: dts: marvell: pxa1908: Add power domains Duje Mihanović
3 siblings, 2 replies; 11+ messages in thread
From: Duje Mihanović @ 2025-08-21 11:17 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Ulf Hansson
Cc: David Wronek, Karel Balej, phone-devel, ~postmarketos/upstreaming,
linux-arm-kernel, linux-clk, devicetree, linux-kernel, linux-pm,
Duje Mihanović
Marvell's PXA1908 SoC has a few power domains for its VPU, GPU, image
processor and DSI PHY. Add a driver to control these.
Also create a separate Kconfig entry for the PXA1908 clock drivers to
allow satisfying the driver's dependencies.
Signed-off-by: Duje Mihanović <duje@dujemihanovic.xyz>
---
v2:
- Move to clk subsystem, instantiate the driver from the APMU clock
driver
- Drop clock handling
- Squash MAINTAINERS patch
---
MAINTAINERS | 5 +
drivers/clk/Kconfig | 1 +
drivers/clk/mmp/Kconfig | 14 ++
drivers/clk/mmp/Makefile | 5 +-
drivers/clk/mmp/clk-pxa1908-apmu.c | 2 +-
drivers/clk/mmp/clk.h | 2 +
drivers/clk/mmp/pxa1908-power-domains.c | 253 ++++++++++++++++++++++++++++++++
7 files changed, 280 insertions(+), 2 deletions(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index daf520a13bdf6a991c0160a96620f40308c29ee0..309090a5ba6c03a2c00d3e39a896748958ffa593 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2869,9 +2869,14 @@ ARM/Marvell PXA1908 SOC support
M: Duje Mihanović <duje@dujemihanovic.xyz>
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
S: Maintained
+C: ircs://irc.oftc.net/pxa1908-mainline
+F: Documentation/devicetree/bindings/clock/marvell,pxa1908.yaml
F: arch/arm64/boot/dts/marvell/mmp/
+F: drivers/clk/mmp/Kconfig
F: drivers/clk/mmp/clk-pxa1908*.c
+F: drivers/clk/mmp/pxa1908-power-domains.c
F: include/dt-bindings/clock/marvell,pxa1908.h
+F: include/dt-bindings/power/marvell,pxa1908-power.h
ARM/Mediatek RTC DRIVER
M: Eddie Huang <eddie.huang@mediatek.com>
diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig
index 4d56475f94fc1e28823fe6aee626a96847d4e6d5..68a9641fc649a23013b2d8a9e9f5ecb31d623abb 100644
--- a/drivers/clk/Kconfig
+++ b/drivers/clk/Kconfig
@@ -511,6 +511,7 @@ source "drivers/clk/imx/Kconfig"
source "drivers/clk/ingenic/Kconfig"
source "drivers/clk/keystone/Kconfig"
source "drivers/clk/mediatek/Kconfig"
+source "drivers/clk/mmp/Kconfig"
source "drivers/clk/meson/Kconfig"
source "drivers/clk/mstar/Kconfig"
source "drivers/clk/microchip/Kconfig"
diff --git a/drivers/clk/mmp/Kconfig b/drivers/clk/mmp/Kconfig
new file mode 100644
index 0000000000000000000000000000000000000000..9dca5b50fd15a1d2ca71163c649a51592da15021
--- /dev/null
+++ b/drivers/clk/mmp/Kconfig
@@ -0,0 +1,14 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+config COMMON_CLK_PXA1908
+ bool "Clock driver for Marvell PXA1908"
+ depends on ARCH_MMP || COMPILE_TEST
+ depends on OF
+ default y if ARCH_MMP && ARM64
+ select PM
+ select PM_GENERIC_DOMAINS
+ select PM_GENERIC_DOMAINS_OF
+ select REGMAP_MMIO
+ help
+ This driver supports the Marvell PXA1908 SoC clocks. The SoC's power
+ domains are also supported by the driver.
diff --git a/drivers/clk/mmp/Makefile b/drivers/clk/mmp/Makefile
index 062cd87fa8ddcc6808b6236f8c4dd524aaf02030..0b9ad29087ff23b8dc247bfd38f0e55382e16759 100644
--- a/drivers/clk/mmp/Makefile
+++ b/drivers/clk/mmp/Makefile
@@ -11,4 +11,7 @@ obj-$(CONFIG_MACH_MMP_DT) += clk-of-pxa168.o clk-of-pxa910.o
obj-$(CONFIG_COMMON_CLK_MMP2) += clk-of-mmp2.o clk-pll.o pwr-island.o
obj-$(CONFIG_COMMON_CLK_MMP2_AUDIO) += clk-audio.o
-obj-$(CONFIG_ARCH_MMP) += clk-of-pxa1928.o clk-pxa1908-apbc.o clk-pxa1908-apbcp.o clk-pxa1908-apmu.o clk-pxa1908-mpmu.o
+obj-$(CONFIG_COMMON_CLK_PXA1908) += clk-pxa1908-apbc.o clk-pxa1908-apbcp.o \
+ clk-pxa1908-mpmu.o clk-pxa1908-apmu.o pxa1908-power-domains.o
+
+obj-$(CONFIG_ARCH_MMP) += clk-of-pxa1928.o
diff --git a/drivers/clk/mmp/clk-pxa1908-apmu.c b/drivers/clk/mmp/clk-pxa1908-apmu.c
index d3a070687fc5b9fb5338f377f82e7664ca0aac29..3d4494cfc9bc28e1e614a11f56aa3d211fb6ec26 100644
--- a/drivers/clk/mmp/clk-pxa1908-apmu.c
+++ b/drivers/clk/mmp/clk-pxa1908-apmu.c
@@ -98,7 +98,7 @@ static int pxa1908_apmu_probe(struct platform_device *pdev)
pxa1908_axi_periph_clk_init(pxa_unit);
- return 0;
+ return pxa1908_pd_register(&pdev->dev);
}
static const struct of_device_id pxa1908_apmu_match_table[] = {
diff --git a/drivers/clk/mmp/clk.h b/drivers/clk/mmp/clk.h
index c83cec169ddc5e3fcd0561cf857f248178c25b68..6d3d089a0372fa48c8f61aceacdd1b2059f2c8dd 100644
--- a/drivers/clk/mmp/clk.h
+++ b/drivers/clk/mmp/clk.h
@@ -258,4 +258,6 @@ struct generic_pm_domain *mmp_pm_domain_register(const char *name,
u32 power_on, u32 reset, u32 clock_enable,
unsigned int flags, spinlock_t *lock);
+int pxa1908_pd_register(struct device *dev);
+
#endif
diff --git a/drivers/clk/mmp/pxa1908-power-domains.c b/drivers/clk/mmp/pxa1908-power-domains.c
new file mode 100644
index 0000000000000000000000000000000000000000..9f698a17e5a920d0472b74fce137b42cae0569d2
--- /dev/null
+++ b/drivers/clk/mmp/pxa1908-power-domains.c
@@ -0,0 +1,253 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright 2025 Duje Mihanović <duje@dujemihanovic.xyz>
+ */
+
+#include <linux/container_of.h>
+#include <linux/mfd/syscon.h>
+#include <linux/mod_devicetable.h>
+#include <linux/platform_device.h>
+#include <linux/pm_domain.h>
+#include <linux/regmap.h>
+#include <linux/units.h>
+
+#include <dt-bindings/power/marvell,pxa1908-power.h>
+
+#include "clk.h"
+
+/* VPU, GPU, ISP */
+#define APMU_PWR_CTRL_REG 0xd8
+#define APMU_PWR_BLK_TMR_REG 0xdc
+#define APMU_PWR_STATUS_REG 0xf0
+
+/* DSI */
+#define APMU_DEBUG 0x88
+#define DSI_PHY_DVM_MASK BIT(31)
+
+#define POWER_ON_LATENCY_US 300
+#define POWER_OFF_LATENCY_US 20
+
+#define NR_DOMAINS 5
+
+struct pxa1908_pd_ctrl {
+ struct genpd_onecell_data onecell_data;
+ struct generic_pm_domain *domains[NR_DOMAINS];
+ struct regmap *base;
+};
+
+struct pxa1908_pd_data {
+ u32 reg_clk_res_ctrl;
+ u32 hw_mode;
+ u32 pwr_state;
+ bool keep_on;
+ int id;
+};
+
+struct pxa1908_pd {
+ const struct pxa1908_pd_data data;
+ struct pxa1908_pd_ctrl *ctrl;
+ struct generic_pm_domain genpd;
+ struct device *dev;
+ bool initialized;
+ int num_clks;
+};
+
+static bool pxa1908_pd_is_on(struct pxa1908_pd *pd)
+{
+ struct pxa1908_pd_ctrl *ctrl = pd->ctrl;
+
+ return regmap_test_bits(ctrl->base, APMU_PWR_STATUS_REG, pd->data.pwr_state);
+}
+
+static int pxa1908_pd_power_on(struct generic_pm_domain *genpd)
+{
+ struct pxa1908_pd *pd = container_of(genpd, struct pxa1908_pd, genpd);
+ struct pxa1908_pd_ctrl *ctrl = pd->ctrl;
+ const struct pxa1908_pd_data *data = &pd->data;
+ unsigned int status;
+ int ret = 0;
+
+ regmap_set_bits(ctrl->base, data->reg_clk_res_ctrl, data->hw_mode);
+ if (data->id != PXA1908_POWER_DOMAIN_ISP)
+ regmap_write(ctrl->base, APMU_PWR_BLK_TMR_REG, 0x20001fff);
+ regmap_set_bits(ctrl->base, APMU_PWR_CTRL_REG, data->pwr_state);
+
+ usleep_range(POWER_ON_LATENCY_US, POWER_ON_LATENCY_US * 2);
+
+ ret = regmap_read_poll_timeout(ctrl->base, APMU_PWR_STATUS_REG, status,
+ status & data->pwr_state, 6, 25 * USEC_PER_MSEC);
+ if (ret == -ETIMEDOUT)
+ dev_err(pd->dev, "timed out powering on domain '%s'\n", pd->genpd.name);
+
+ return ret;
+}
+
+static int pxa1908_pd_power_off(struct generic_pm_domain *genpd)
+{
+ struct pxa1908_pd *pd = container_of(genpd, struct pxa1908_pd, genpd);
+ struct pxa1908_pd_ctrl *ctrl = pd->ctrl;
+ const struct pxa1908_pd_data *data = &pd->data;
+ unsigned int status;
+ int ret;
+
+ regmap_clear_bits(ctrl->base, APMU_PWR_CTRL_REG, data->pwr_state);
+
+ usleep_range(POWER_OFF_LATENCY_US, POWER_OFF_LATENCY_US * 2);
+
+ ret = regmap_read_poll_timeout(ctrl->base, APMU_PWR_STATUS_REG, status,
+ !(status & data->pwr_state), 6, 25 * USEC_PER_MSEC);
+ if (ret == -ETIMEDOUT) {
+ dev_err(pd->dev, "timed out powering off domain '%s'\n", pd->genpd.name);
+ return ret;
+ }
+
+ return regmap_clear_bits(ctrl->base, data->reg_clk_res_ctrl, data->hw_mode);
+}
+
+static inline int pxa1908_dsi_power_on(struct generic_pm_domain *genpd)
+{
+ struct pxa1908_pd *pd = container_of(genpd, struct pxa1908_pd, genpd);
+ struct pxa1908_pd_ctrl *ctrl = pd->ctrl;
+
+ return regmap_set_bits(ctrl->base, APMU_DEBUG, DSI_PHY_DVM_MASK);
+}
+
+static inline int pxa1908_dsi_power_off(struct generic_pm_domain *genpd)
+{
+ struct pxa1908_pd *pd = container_of(genpd, struct pxa1908_pd, genpd);
+ struct pxa1908_pd_ctrl *ctrl = pd->ctrl;
+
+ return regmap_clear_bits(ctrl->base, APMU_DEBUG, DSI_PHY_DVM_MASK);
+}
+
+#define DOMAIN(_id, _name, ctrl, mode, state) \
+ [_id] = { \
+ .data = { \
+ .reg_clk_res_ctrl = ctrl, \
+ .hw_mode = BIT(mode), \
+ .pwr_state = BIT(state), \
+ .id = _id, \
+ }, \
+ .genpd = { \
+ .name = _name, \
+ .power_on = pxa1908_pd_power_on, \
+ .power_off = pxa1908_pd_power_off, \
+ }, \
+ }
+
+static struct pxa1908_pd domains[NR_DOMAINS] = {
+ DOMAIN(PXA1908_POWER_DOMAIN_VPU, "vpu", 0xa4, 19, 2),
+ DOMAIN(PXA1908_POWER_DOMAIN_GPU, "gpu", 0xcc, 11, 0),
+ DOMAIN(PXA1908_POWER_DOMAIN_GPU2D, "gpu2d", 0xf4, 11, 6),
+ DOMAIN(PXA1908_POWER_DOMAIN_ISP, "isp", 0x38, 15, 4),
+ [PXA1908_POWER_DOMAIN_DSI] = {
+ .genpd = {
+ .name = "dsi",
+ .power_on = pxa1908_dsi_power_on,
+ .power_off = pxa1908_dsi_power_off,
+ /*
+ * TODO: There is no DSI driver written yet and until then we probably
+ * don't want to power off the DSI PHY ever.
+ */
+ .flags = GENPD_FLAG_ALWAYS_ON,
+ },
+ .data = {
+ /* See above. */
+ .keep_on = true,
+ },
+ },
+};
+
+static void pxa1908_pd_cleanup(struct pxa1908_pd_ctrl *ctrl)
+{
+ struct pxa1908_pd *pd;
+ int ret;
+
+ for (int i = NR_DOMAINS - 1; i >= 0; i--) {
+ pd = &domains[i];
+
+ if (!pd->initialized)
+ continue;
+
+ ret = pm_genpd_remove(&pd->genpd);
+ if (ret)
+ dev_err(pd->dev, "failed to remove domain '%s': %d\n",
+ pd->genpd.name, ret);
+ if (pxa1908_pd_is_on(pd) && !pd->data.keep_on)
+ pxa1908_pd_power_off(&pd->genpd);
+ }
+}
+
+static int
+pxa1908_pd_init(struct pxa1908_pd_ctrl *ctrl, int id, struct device *dev)
+{
+ struct pxa1908_pd *pd = &domains[id];
+ int ret;
+
+ pd->dev = dev;
+ pd->ctrl = ctrl;
+ ctrl->domains[id] = &pd->genpd;
+
+ /* Make sure the state of the hardware is synced with the domain table above. */
+ if (pd->data.keep_on) {
+ ret = pd->genpd.power_on(&pd->genpd);
+ if (ret) {
+ dev_err(dev, "failed to power on domain '%s': %d\n", pd->genpd.name, ret);
+ return ret;
+ }
+ } else {
+ if (pxa1908_pd_is_on(pd)) {
+ dev_warn(dev,
+ "domain '%s' is on despite being default off; powering off\n",
+ pd->genpd.name);
+
+ ret = pxa1908_pd_power_off(&pd->genpd);
+ if (ret) {
+ dev_err(dev, "failed to power off domain '%s': %d\n",
+ pd->genpd.name, ret);
+ return ret;
+ }
+ }
+ }
+
+ ret = pm_genpd_init(&pd->genpd, NULL, !pd->data.keep_on);
+ if (ret) {
+ dev_err(dev, "domain '%s' failed to initialize: %d\n", pd->genpd.name, ret);
+ return ret;
+ }
+
+ pd->initialized = true;
+
+ return 0;
+}
+
+int pxa1908_pd_register(struct device *dev)
+{
+ struct pxa1908_pd_ctrl *ctrl;
+ int ret;
+
+ ctrl = devm_kzalloc(dev, sizeof(*ctrl), GFP_KERNEL);
+ if (!ctrl)
+ return -ENOMEM;
+
+ ctrl->base = syscon_node_to_regmap(dev->of_node);
+ if (IS_ERR(ctrl->base)) {
+ dev_err(dev, "no regmap available\n");
+ return PTR_ERR(ctrl->base);
+ }
+
+ ctrl->onecell_data.domains = ctrl->domains;
+ ctrl->onecell_data.num_domains = NR_DOMAINS;
+
+ for (int i = 0; i < NR_DOMAINS; i++) {
+ ret = pxa1908_pd_init(ctrl, i, dev);
+ if (ret)
+ goto err;
+ }
+
+ return of_genpd_add_provider_onecell(dev->of_node, &ctrl->onecell_data);
+
+err:
+ pxa1908_pd_cleanup(ctrl);
+ return ret;
+}
--
2.50.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 4/4] arm64: dts: marvell: pxa1908: Add power domains
2025-08-21 11:17 [PATCH v2 0/4] Marvell PXA1908 power domains Duje Mihanović
` (2 preceding siblings ...)
2025-08-21 11:17 ` [PATCH v2 3/4] clk: mmp: Add PXA1908 power domain driver Duje Mihanović
@ 2025-08-21 11:17 ` Duje Mihanović
3 siblings, 0 replies; 11+ messages in thread
From: Duje Mihanović @ 2025-08-21 11:17 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Ulf Hansson
Cc: David Wronek, Karel Balej, phone-devel, ~postmarketos/upstreaming,
linux-arm-kernel, linux-clk, devicetree, linux-kernel, linux-pm,
Duje Mihanović
Update the APMU clock controller's compatible to allow the new power
domain driver to probe. Also add the first two power domain consumers:
IOMMU (fixes probing) and framebuffer.
Signed-off-by: Duje Mihanović <duje@dujemihanovic.xyz>
---
v2:
- Drop power controller node
- &pd -> &apmu
---
arch/arm64/boot/dts/marvell/mmp/pxa1908-samsung-coreprimevelte.dts | 1 +
arch/arm64/boot/dts/marvell/mmp/pxa1908.dtsi | 5 ++++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/marvell/mmp/pxa1908-samsung-coreprimevelte.dts b/arch/arm64/boot/dts/marvell/mmp/pxa1908-samsung-coreprimevelte.dts
index 47a4f01a7077bfafe2cc50d0e59c37685ec9c2e9..d61922f326a4654a45ab4312ea512ac1b8b01c50 100644
--- a/arch/arm64/boot/dts/marvell/mmp/pxa1908-samsung-coreprimevelte.dts
+++ b/arch/arm64/boot/dts/marvell/mmp/pxa1908-samsung-coreprimevelte.dts
@@ -23,6 +23,7 @@ chosen {
fb0: framebuffer@17177000 {
compatible = "simple-framebuffer";
reg = <0 0x17177000 0 (480 * 800 * 4)>;
+ power-domains = <&apmu PXA1908_POWER_DOMAIN_DSI>;
width = <480>;
height = <800>;
stride = <(480 * 4)>;
diff --git a/arch/arm64/boot/dts/marvell/mmp/pxa1908.dtsi b/arch/arm64/boot/dts/marvell/mmp/pxa1908.dtsi
index cf2b9109688ce560eec8a1397251ead68d78a239..ae85b90eeb408a8f4014ec7b60048ae1fd3d4044 100644
--- a/arch/arm64/boot/dts/marvell/mmp/pxa1908.dtsi
+++ b/arch/arm64/boot/dts/marvell/mmp/pxa1908.dtsi
@@ -3,6 +3,7 @@
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/marvell,pxa1908.h>
+#include <dt-bindings/power/marvell,pxa1908-power.h>
/ {
model = "Marvell Armada PXA1908";
@@ -79,6 +80,7 @@ smmu: iommu@c0010000 {
#iommu-cells = <1>;
interrupts = <GIC_SPI 78 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 78 IRQ_TYPE_LEVEL_HIGH>;
+ power-domains = <&apmu PXA1908_POWER_DOMAIN_VPU>;
status = "disabled";
};
@@ -291,9 +293,10 @@ sdh2: mmc@81000 {
};
apmu: clock-controller@82800 {
- compatible = "marvell,pxa1908-apmu";
+ compatible = "marvell,pxa1908-apmu", "syscon";
reg = <0x82800 0x400>;
#clock-cells = <1>;
+ #power-domain-cells = <1>;
};
};
};
--
2.50.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v2 3/4] clk: mmp: Add PXA1908 power domain driver
2025-08-21 11:17 ` [PATCH v2 3/4] clk: mmp: Add PXA1908 power domain driver Duje Mihanović
@ 2025-08-22 9:36 ` Ulf Hansson
2025-08-22 20:55 ` Duje Mihanović
2025-08-22 13:46 ` kernel test robot
1 sibling, 1 reply; 11+ messages in thread
From: Ulf Hansson @ 2025-08-22 9:36 UTC (permalink / raw)
To: Duje Mihanović
Cc: Michael Turquette, Stephen Boyd, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, David Wronek, Karel Balej, phone-devel,
~postmarketos/upstreaming, linux-arm-kernel, linux-clk,
devicetree, linux-kernel, linux-pm
On Thu, 21 Aug 2025 at 13:19, Duje Mihanović <duje@dujemihanovic.xyz> wrote:
>
> Marvell's PXA1908 SoC has a few power domains for its VPU, GPU, image
> processor and DSI PHY. Add a driver to control these.
>
> Also create a separate Kconfig entry for the PXA1908 clock drivers to
> allow satisfying the driver's dependencies.
>
> Signed-off-by: Duje Mihanović <duje@dujemihanovic.xyz>
> ---
> v2:
> - Move to clk subsystem, instantiate the driver from the APMU clock
> driver
> - Drop clock handling
> - Squash MAINTAINERS patch
> ---
> MAINTAINERS | 5 +
> drivers/clk/Kconfig | 1 +
> drivers/clk/mmp/Kconfig | 14 ++
> drivers/clk/mmp/Makefile | 5 +-
> drivers/clk/mmp/clk-pxa1908-apmu.c | 2 +-
> drivers/clk/mmp/clk.h | 2 +
> drivers/clk/mmp/pxa1908-power-domains.c | 253 ++++++++++++++++++++++++++++++++
> 7 files changed, 280 insertions(+), 2 deletions(-)
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index daf520a13bdf6a991c0160a96620f40308c29ee0..309090a5ba6c03a2c00d3e39a896748958ffa593 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -2869,9 +2869,14 @@ ARM/Marvell PXA1908 SOC support
> M: Duje Mihanović <duje@dujemihanovic.xyz>
> L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
> S: Maintained
> +C: ircs://irc.oftc.net/pxa1908-mainline
> +F: Documentation/devicetree/bindings/clock/marvell,pxa1908.yaml
> F: arch/arm64/boot/dts/marvell/mmp/
> +F: drivers/clk/mmp/Kconfig
> F: drivers/clk/mmp/clk-pxa1908*.c
> +F: drivers/clk/mmp/pxa1908-power-domains.c
> F: include/dt-bindings/clock/marvell,pxa1908.h
> +F: include/dt-bindings/power/marvell,pxa1908-power.h
>
> ARM/Mediatek RTC DRIVER
> M: Eddie Huang <eddie.huang@mediatek.com>
> diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig
> index 4d56475f94fc1e28823fe6aee626a96847d4e6d5..68a9641fc649a23013b2d8a9e9f5ecb31d623abb 100644
> --- a/drivers/clk/Kconfig
> +++ b/drivers/clk/Kconfig
> @@ -511,6 +511,7 @@ source "drivers/clk/imx/Kconfig"
> source "drivers/clk/ingenic/Kconfig"
> source "drivers/clk/keystone/Kconfig"
> source "drivers/clk/mediatek/Kconfig"
> +source "drivers/clk/mmp/Kconfig"
> source "drivers/clk/meson/Kconfig"
> source "drivers/clk/mstar/Kconfig"
> source "drivers/clk/microchip/Kconfig"
> diff --git a/drivers/clk/mmp/Kconfig b/drivers/clk/mmp/Kconfig
> new file mode 100644
> index 0000000000000000000000000000000000000000..9dca5b50fd15a1d2ca71163c649a51592da15021
> --- /dev/null
> +++ b/drivers/clk/mmp/Kconfig
> @@ -0,0 +1,14 @@
> +# SPDX-License-Identifier: GPL-2.0-only
> +
> +config COMMON_CLK_PXA1908
> + bool "Clock driver for Marvell PXA1908"
> + depends on ARCH_MMP || COMPILE_TEST
> + depends on OF
> + default y if ARCH_MMP && ARM64
> + select PM
> + select PM_GENERIC_DOMAINS
> + select PM_GENERIC_DOMAINS_OF
> + select REGMAP_MMIO
> + help
> + This driver supports the Marvell PXA1908 SoC clocks. The SoC's power
> + domains are also supported by the driver.
> diff --git a/drivers/clk/mmp/Makefile b/drivers/clk/mmp/Makefile
> index 062cd87fa8ddcc6808b6236f8c4dd524aaf02030..0b9ad29087ff23b8dc247bfd38f0e55382e16759 100644
> --- a/drivers/clk/mmp/Makefile
> +++ b/drivers/clk/mmp/Makefile
> @@ -11,4 +11,7 @@ obj-$(CONFIG_MACH_MMP_DT) += clk-of-pxa168.o clk-of-pxa910.o
> obj-$(CONFIG_COMMON_CLK_MMP2) += clk-of-mmp2.o clk-pll.o pwr-island.o
> obj-$(CONFIG_COMMON_CLK_MMP2_AUDIO) += clk-audio.o
>
> -obj-$(CONFIG_ARCH_MMP) += clk-of-pxa1928.o clk-pxa1908-apbc.o clk-pxa1908-apbcp.o clk-pxa1908-apmu.o clk-pxa1908-mpmu.o
> +obj-$(CONFIG_COMMON_CLK_PXA1908) += clk-pxa1908-apbc.o clk-pxa1908-apbcp.o \
> + clk-pxa1908-mpmu.o clk-pxa1908-apmu.o pxa1908-power-domains.o
> +
> +obj-$(CONFIG_ARCH_MMP) += clk-of-pxa1928.o
> diff --git a/drivers/clk/mmp/clk-pxa1908-apmu.c b/drivers/clk/mmp/clk-pxa1908-apmu.c
> index d3a070687fc5b9fb5338f377f82e7664ca0aac29..3d4494cfc9bc28e1e614a11f56aa3d211fb6ec26 100644
> --- a/drivers/clk/mmp/clk-pxa1908-apmu.c
> +++ b/drivers/clk/mmp/clk-pxa1908-apmu.c
> @@ -98,7 +98,7 @@ static int pxa1908_apmu_probe(struct platform_device *pdev)
>
> pxa1908_axi_periph_clk_init(pxa_unit);
>
> - return 0;
> + return pxa1908_pd_register(&pdev->dev);
> }
>
> static const struct of_device_id pxa1908_apmu_match_table[] = {
> diff --git a/drivers/clk/mmp/clk.h b/drivers/clk/mmp/clk.h
> index c83cec169ddc5e3fcd0561cf857f248178c25b68..6d3d089a0372fa48c8f61aceacdd1b2059f2c8dd 100644
> --- a/drivers/clk/mmp/clk.h
> +++ b/drivers/clk/mmp/clk.h
> @@ -258,4 +258,6 @@ struct generic_pm_domain *mmp_pm_domain_register(const char *name,
> u32 power_on, u32 reset, u32 clock_enable,
> unsigned int flags, spinlock_t *lock);
>
> +int pxa1908_pd_register(struct device *dev);
> +
> #endif
> diff --git a/drivers/clk/mmp/pxa1908-power-domains.c b/drivers/clk/mmp/pxa1908-power-domains.c
By looking at the implementation of the power-domain code below, it
seems to me that this code is better maintained within the pmdomain
subsystem (drivers/pmdomain/pxa perhaps). May I suggest that you move
it there.
I guess the easiest way to do this is to export the
pxa1908_pd_register() function - but you could explore using the
auxiliary bus too, to instantiate a power-domain driver as an
auxiliary driver.
Other than that, the code looks good to me!
Kind regards
Uffe
> new file mode 100644
> index 0000000000000000000000000000000000000000..9f698a17e5a920d0472b74fce137b42cae0569d2
> --- /dev/null
> +++ b/drivers/clk/mmp/pxa1908-power-domains.c
> @@ -0,0 +1,253 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/*
> + * Copyright 2025 Duje Mihanović <duje@dujemihanovic.xyz>
> + */
> +
> +#include <linux/container_of.h>
> +#include <linux/mfd/syscon.h>
> +#include <linux/mod_devicetable.h>
> +#include <linux/platform_device.h>
> +#include <linux/pm_domain.h>
> +#include <linux/regmap.h>
> +#include <linux/units.h>
> +
> +#include <dt-bindings/power/marvell,pxa1908-power.h>
> +
> +#include "clk.h"
> +
> +/* VPU, GPU, ISP */
> +#define APMU_PWR_CTRL_REG 0xd8
> +#define APMU_PWR_BLK_TMR_REG 0xdc
> +#define APMU_PWR_STATUS_REG 0xf0
> +
> +/* DSI */
> +#define APMU_DEBUG 0x88
> +#define DSI_PHY_DVM_MASK BIT(31)
> +
> +#define POWER_ON_LATENCY_US 300
> +#define POWER_OFF_LATENCY_US 20
> +
> +#define NR_DOMAINS 5
> +
> +struct pxa1908_pd_ctrl {
> + struct genpd_onecell_data onecell_data;
> + struct generic_pm_domain *domains[NR_DOMAINS];
> + struct regmap *base;
> +};
> +
> +struct pxa1908_pd_data {
> + u32 reg_clk_res_ctrl;
> + u32 hw_mode;
> + u32 pwr_state;
> + bool keep_on;
> + int id;
> +};
> +
> +struct pxa1908_pd {
> + const struct pxa1908_pd_data data;
> + struct pxa1908_pd_ctrl *ctrl;
> + struct generic_pm_domain genpd;
> + struct device *dev;
> + bool initialized;
> + int num_clks;
> +};
> +
> +static bool pxa1908_pd_is_on(struct pxa1908_pd *pd)
> +{
> + struct pxa1908_pd_ctrl *ctrl = pd->ctrl;
> +
> + return regmap_test_bits(ctrl->base, APMU_PWR_STATUS_REG, pd->data.pwr_state);
> +}
> +
> +static int pxa1908_pd_power_on(struct generic_pm_domain *genpd)
> +{
> + struct pxa1908_pd *pd = container_of(genpd, struct pxa1908_pd, genpd);
> + struct pxa1908_pd_ctrl *ctrl = pd->ctrl;
> + const struct pxa1908_pd_data *data = &pd->data;
> + unsigned int status;
> + int ret = 0;
> +
> + regmap_set_bits(ctrl->base, data->reg_clk_res_ctrl, data->hw_mode);
> + if (data->id != PXA1908_POWER_DOMAIN_ISP)
> + regmap_write(ctrl->base, APMU_PWR_BLK_TMR_REG, 0x20001fff);
> + regmap_set_bits(ctrl->base, APMU_PWR_CTRL_REG, data->pwr_state);
> +
> + usleep_range(POWER_ON_LATENCY_US, POWER_ON_LATENCY_US * 2);
> +
> + ret = regmap_read_poll_timeout(ctrl->base, APMU_PWR_STATUS_REG, status,
> + status & data->pwr_state, 6, 25 * USEC_PER_MSEC);
> + if (ret == -ETIMEDOUT)
> + dev_err(pd->dev, "timed out powering on domain '%s'\n", pd->genpd.name);
> +
> + return ret;
> +}
> +
> +static int pxa1908_pd_power_off(struct generic_pm_domain *genpd)
> +{
> + struct pxa1908_pd *pd = container_of(genpd, struct pxa1908_pd, genpd);
> + struct pxa1908_pd_ctrl *ctrl = pd->ctrl;
> + const struct pxa1908_pd_data *data = &pd->data;
> + unsigned int status;
> + int ret;
> +
> + regmap_clear_bits(ctrl->base, APMU_PWR_CTRL_REG, data->pwr_state);
> +
> + usleep_range(POWER_OFF_LATENCY_US, POWER_OFF_LATENCY_US * 2);
> +
> + ret = regmap_read_poll_timeout(ctrl->base, APMU_PWR_STATUS_REG, status,
> + !(status & data->pwr_state), 6, 25 * USEC_PER_MSEC);
> + if (ret == -ETIMEDOUT) {
> + dev_err(pd->dev, "timed out powering off domain '%s'\n", pd->genpd.name);
> + return ret;
> + }
> +
> + return regmap_clear_bits(ctrl->base, data->reg_clk_res_ctrl, data->hw_mode);
> +}
> +
> +static inline int pxa1908_dsi_power_on(struct generic_pm_domain *genpd)
> +{
> + struct pxa1908_pd *pd = container_of(genpd, struct pxa1908_pd, genpd);
> + struct pxa1908_pd_ctrl *ctrl = pd->ctrl;
> +
> + return regmap_set_bits(ctrl->base, APMU_DEBUG, DSI_PHY_DVM_MASK);
> +}
> +
> +static inline int pxa1908_dsi_power_off(struct generic_pm_domain *genpd)
> +{
> + struct pxa1908_pd *pd = container_of(genpd, struct pxa1908_pd, genpd);
> + struct pxa1908_pd_ctrl *ctrl = pd->ctrl;
> +
> + return regmap_clear_bits(ctrl->base, APMU_DEBUG, DSI_PHY_DVM_MASK);
> +}
> +
> +#define DOMAIN(_id, _name, ctrl, mode, state) \
> + [_id] = { \
> + .data = { \
> + .reg_clk_res_ctrl = ctrl, \
> + .hw_mode = BIT(mode), \
> + .pwr_state = BIT(state), \
> + .id = _id, \
> + }, \
> + .genpd = { \
> + .name = _name, \
> + .power_on = pxa1908_pd_power_on, \
> + .power_off = pxa1908_pd_power_off, \
> + }, \
> + }
> +
> +static struct pxa1908_pd domains[NR_DOMAINS] = {
> + DOMAIN(PXA1908_POWER_DOMAIN_VPU, "vpu", 0xa4, 19, 2),
> + DOMAIN(PXA1908_POWER_DOMAIN_GPU, "gpu", 0xcc, 11, 0),
> + DOMAIN(PXA1908_POWER_DOMAIN_GPU2D, "gpu2d", 0xf4, 11, 6),
> + DOMAIN(PXA1908_POWER_DOMAIN_ISP, "isp", 0x38, 15, 4),
> + [PXA1908_POWER_DOMAIN_DSI] = {
> + .genpd = {
> + .name = "dsi",
> + .power_on = pxa1908_dsi_power_on,
> + .power_off = pxa1908_dsi_power_off,
> + /*
> + * TODO: There is no DSI driver written yet and until then we probably
> + * don't want to power off the DSI PHY ever.
> + */
> + .flags = GENPD_FLAG_ALWAYS_ON,
> + },
> + .data = {
> + /* See above. */
> + .keep_on = true,
> + },
> + },
> +};
> +
> +static void pxa1908_pd_cleanup(struct pxa1908_pd_ctrl *ctrl)
> +{
> + struct pxa1908_pd *pd;
> + int ret;
> +
> + for (int i = NR_DOMAINS - 1; i >= 0; i--) {
> + pd = &domains[i];
> +
> + if (!pd->initialized)
> + continue;
> +
> + ret = pm_genpd_remove(&pd->genpd);
> + if (ret)
> + dev_err(pd->dev, "failed to remove domain '%s': %d\n",
> + pd->genpd.name, ret);
> + if (pxa1908_pd_is_on(pd) && !pd->data.keep_on)
> + pxa1908_pd_power_off(&pd->genpd);
> + }
> +}
> +
> +static int
> +pxa1908_pd_init(struct pxa1908_pd_ctrl *ctrl, int id, struct device *dev)
> +{
> + struct pxa1908_pd *pd = &domains[id];
> + int ret;
> +
> + pd->dev = dev;
> + pd->ctrl = ctrl;
> + ctrl->domains[id] = &pd->genpd;
> +
> + /* Make sure the state of the hardware is synced with the domain table above. */
> + if (pd->data.keep_on) {
> + ret = pd->genpd.power_on(&pd->genpd);
> + if (ret) {
> + dev_err(dev, "failed to power on domain '%s': %d\n", pd->genpd.name, ret);
> + return ret;
> + }
> + } else {
> + if (pxa1908_pd_is_on(pd)) {
> + dev_warn(dev,
> + "domain '%s' is on despite being default off; powering off\n",
> + pd->genpd.name);
> +
> + ret = pxa1908_pd_power_off(&pd->genpd);
> + if (ret) {
> + dev_err(dev, "failed to power off domain '%s': %d\n",
> + pd->genpd.name, ret);
> + return ret;
> + }
> + }
> + }
> +
> + ret = pm_genpd_init(&pd->genpd, NULL, !pd->data.keep_on);
> + if (ret) {
> + dev_err(dev, "domain '%s' failed to initialize: %d\n", pd->genpd.name, ret);
> + return ret;
> + }
> +
> + pd->initialized = true;
> +
> + return 0;
> +}
> +
> +int pxa1908_pd_register(struct device *dev)
> +{
> + struct pxa1908_pd_ctrl *ctrl;
> + int ret;
> +
> + ctrl = devm_kzalloc(dev, sizeof(*ctrl), GFP_KERNEL);
> + if (!ctrl)
> + return -ENOMEM;
> +
> + ctrl->base = syscon_node_to_regmap(dev->of_node);
> + if (IS_ERR(ctrl->base)) {
> + dev_err(dev, "no regmap available\n");
> + return PTR_ERR(ctrl->base);
> + }
> +
> + ctrl->onecell_data.domains = ctrl->domains;
> + ctrl->onecell_data.num_domains = NR_DOMAINS;
> +
> + for (int i = 0; i < NR_DOMAINS; i++) {
> + ret = pxa1908_pd_init(ctrl, i, dev);
> + if (ret)
> + goto err;
> + }
> +
> + return of_genpd_add_provider_onecell(dev->of_node, &ctrl->onecell_data);
> +
> +err:
> + pxa1908_pd_cleanup(ctrl);
> + return ret;
> +}
>
> --
> 2.50.1
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 3/4] clk: mmp: Add PXA1908 power domain driver
2025-08-21 11:17 ` [PATCH v2 3/4] clk: mmp: Add PXA1908 power domain driver Duje Mihanović
2025-08-22 9:36 ` Ulf Hansson
@ 2025-08-22 13:46 ` kernel test robot
1 sibling, 0 replies; 11+ messages in thread
From: kernel test robot @ 2025-08-22 13:46 UTC (permalink / raw)
To: Duje Mihanović, Michael Turquette, Stephen Boyd, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Ulf Hansson
Cc: Paul Gazzillo, Necip Fazil Yildiran, oe-kbuild-all, David Wronek,
Karel Balej, phone-devel, ~postmarketos/upstreaming,
linux-arm-kernel, linux-clk, devicetree, linux-kernel, linux-pm,
Duje Mihanović
Hi Duje,
kernel test robot noticed the following build warnings:
[auto build test WARNING on c17b750b3ad9f45f2b6f7e6f7f4679844244f0b9]
url: https://github.com/intel-lab-lkp/linux/commits/Duje-Mihanovi/dt-bindings-clock-marvell-pxa1908-Add-syscon-compatible-to-apmu/20250821-192805
base: c17b750b3ad9f45f2b6f7e6f7f4679844244f0b9
patch link: https://lore.kernel.org/r/20250821-pxa1908-genpd-v2-3-eba413edd526%40dujemihanovic.xyz
patch subject: [PATCH v2 3/4] clk: mmp: Add PXA1908 power domain driver
config: m68k-kismet-CONFIG_PM-CONFIG_COMMON_CLK_PXA1908-0-0 (https://download.01.org/0day-ci/archive/20250822/202508222109.6oqAqWW7-lkp@intel.com/config)
reproduce: (https://download.01.org/0day-ci/archive/20250822/202508222109.6oqAqWW7-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202508222109.6oqAqWW7-lkp@intel.com/
kismet warnings: (new ones prefixed by >>)
>> kismet: WARNING: unmet direct dependencies detected for PM when selected by COMMON_CLK_PXA1908
WARNING: unmet direct dependencies detected for PM
Depends on [n]: !MMU [=y]
Selected by [y]:
- COMMON_CLK_PXA1908 [=y] && COMMON_CLK [=y] && (ARCH_MMP || COMPILE_TEST [=y]) && OF [=y]
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/4] dt-bindings: clock: marvell,pxa1908: Add syscon compatible to apmu
2025-08-21 11:17 ` [PATCH v2 1/4] dt-bindings: clock: marvell,pxa1908: Add syscon compatible to apmu Duje Mihanović
@ 2025-08-22 19:35 ` Rob Herring (Arm)
0 siblings, 0 replies; 11+ messages in thread
From: Rob Herring (Arm) @ 2025-08-22 19:35 UTC (permalink / raw)
To: Duje Mihanović
Cc: Michael Turquette, linux-kernel, Stephen Boyd,
~postmarketos/upstreaming, linux-clk, linux-arm-kernel,
David Wronek, phone-devel, devicetree, linux-pm, Karel Balej,
Ulf Hansson, Conor Dooley, Krzysztof Kozlowski
On Thu, 21 Aug 2025 13:17:43 +0200, Duje Mihanović wrote:
> Add required syscon compatible to the APMU controller. This is required
> for the SoC's power domain controller as the registers are shared.
>
> Also add a #power-domain-cells property as the node will serve as the
> power domain phandle.
>
> Signed-off-by: Duje Mihanović <duje@dujemihanovic.xyz>
> ---
> v2:
> - Drop simple-mfd
> - Add #power-domain-cells
> ---
> .../devicetree/bindings/clock/marvell,pxa1908.yaml | 30 +++++++++++++++++-----
> 1 file changed, 24 insertions(+), 6 deletions(-)
>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 2/4] dt-bindings: power: Add Marvell PXA1908 domains
2025-08-21 11:17 ` [PATCH v2 2/4] dt-bindings: power: Add Marvell PXA1908 domains Duje Mihanović
@ 2025-08-22 19:36 ` Rob Herring
2025-08-22 20:59 ` Duje Mihanović
0 siblings, 1 reply; 11+ messages in thread
From: Rob Herring @ 2025-08-22 19:36 UTC (permalink / raw)
To: Duje Mihanović
Cc: Michael Turquette, Stephen Boyd, Krzysztof Kozlowski,
Conor Dooley, Ulf Hansson, David Wronek, Karel Balej, phone-devel,
~postmarketos/upstreaming, linux-arm-kernel, linux-clk,
devicetree, linux-kernel, linux-pm
On Thu, Aug 21, 2025 at 01:17:44PM +0200, Duje Mihanović wrote:
> Add device tree bindings for Marvell PXA1908's power domains.
>
> Signed-off-by: Duje Mihanović <duje@dujemihanovic.xyz>
> ---
> v2:
> - Drop schema
> ---
> include/dt-bindings/power/marvell,pxa1908-power.h | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
This should be squashed into the previous patch. The Reviewed-by stands
with that.
>
> diff --git a/include/dt-bindings/power/marvell,pxa1908-power.h b/include/dt-bindings/power/marvell,pxa1908-power.h
> new file mode 100644
> index 0000000000000000000000000000000000000000..19b088351af138823505a774ff27203429fe2d97
> --- /dev/null
> +++ b/include/dt-bindings/power/marvell,pxa1908-power.h
> @@ -0,0 +1,17 @@
> +/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
> +/*
> + * Marvell PXA1908 power domains
> + *
> + * Copyright 2025, Duje Mihanović <duje@dujemihanovic.xyz>
> + */
> +
> +#ifndef __DTS_MARVELL_PXA1908_POWER_H
> +#define __DTS_MARVELL_PXA1908_POWER_H
> +
> +#define PXA1908_POWER_DOMAIN_VPU 0
> +#define PXA1908_POWER_DOMAIN_GPU 1
> +#define PXA1908_POWER_DOMAIN_GPU2D 2
> +#define PXA1908_POWER_DOMAIN_DSI 3
> +#define PXA1908_POWER_DOMAIN_ISP 4
> +
> +#endif
>
> --
> 2.50.1
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 3/4] clk: mmp: Add PXA1908 power domain driver
2025-08-22 9:36 ` Ulf Hansson
@ 2025-08-22 20:55 ` Duje Mihanović
0 siblings, 0 replies; 11+ messages in thread
From: Duje Mihanović @ 2025-08-22 20:55 UTC (permalink / raw)
To: Ulf Hansson
Cc: Michael Turquette, Stephen Boyd, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, David Wronek, Karel Balej, phone-devel,
~postmarketos/upstreaming, linux-arm-kernel, linux-clk,
devicetree, linux-kernel, linux-pm
On Friday, 22 August 2025 11:36:02 Central European Summer Time Ulf Hansson
wrote:
> By looking at the implementation of the power-domain code below, it
> seems to me that this code is better maintained within the pmdomain
> subsystem (drivers/pmdomain/pxa perhaps). May I suggest that you move
> it there.
>
> I guess the easiest way to do this is to export the
> pxa1908_pd_register() function - but you could explore using the
> auxiliary bus too, to instantiate a power-domain driver as an
> auxiliary driver.
The auxiliary bus was exactly what I needed, thanks. As for the path, I think
drivers/pmdomain/marvell would be a better fit and I'll go with that if you
don't object.
Regards,
--
Duje
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 2/4] dt-bindings: power: Add Marvell PXA1908 domains
2025-08-22 19:36 ` Rob Herring
@ 2025-08-22 20:59 ` Duje Mihanović
0 siblings, 0 replies; 11+ messages in thread
From: Duje Mihanović @ 2025-08-22 20:59 UTC (permalink / raw)
To: Rob Herring
Cc: Michael Turquette, Stephen Boyd, Krzysztof Kozlowski,
Conor Dooley, Ulf Hansson, David Wronek, Karel Balej, phone-devel,
~postmarketos/upstreaming, linux-arm-kernel, linux-clk,
devicetree, linux-kernel, linux-pm
On Friday, 22 August 2025 21:36:24 Central European Summer Time Rob Herring wrote:
> On Thu, Aug 21, 2025 at 01:17:44PM +0200, Duje Mihanović wrote:
> > Add device tree bindings for Marvell PXA1908's power domains.
> >
> > Signed-off-by: Duje Mihanović <duje@dujemihanovic.xyz>
> > ---
> > v2:
> > - Drop schema
> > ---
> >
> > include/dt-bindings/power/marvell,pxa1908-power.h | 17 +++++++++++++++++
> > 1 file changed, 17 insertions(+)
>
> This should be squashed into the previous patch. The Reviewed-by stands
> with that.
Should the resulting patch have a 'dt-bindings: power:' title prefix?
Regards,
--
Duje
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2025-08-22 20:59 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-21 11:17 [PATCH v2 0/4] Marvell PXA1908 power domains Duje Mihanović
2025-08-21 11:17 ` [PATCH v2 1/4] dt-bindings: clock: marvell,pxa1908: Add syscon compatible to apmu Duje Mihanović
2025-08-22 19:35 ` Rob Herring (Arm)
2025-08-21 11:17 ` [PATCH v2 2/4] dt-bindings: power: Add Marvell PXA1908 domains Duje Mihanović
2025-08-22 19:36 ` Rob Herring
2025-08-22 20:59 ` Duje Mihanović
2025-08-21 11:17 ` [PATCH v2 3/4] clk: mmp: Add PXA1908 power domain driver Duje Mihanović
2025-08-22 9:36 ` Ulf Hansson
2025-08-22 20:55 ` Duje Mihanović
2025-08-22 13:46 ` kernel test robot
2025-08-21 11:17 ` [PATCH v2 4/4] arm64: dts: marvell: pxa1908: Add power domains Duje Mihanović
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).