* [PATCH 0/9] pwm: Update PWM_PXA driver for SpacemiT K1
@ 2025-04-11 13:14 Guodong Xu
2025-04-11 13:14 ` [PATCH 1/9] dt-bindings: pwm: marvell,pxa: add optional property resets Guodong Xu
` (8 more replies)
0 siblings, 9 replies; 33+ messages in thread
From: Guodong Xu @ 2025-04-11 13:14 UTC (permalink / raw)
To: ukleinek, robh, krzk+dt, conor+dt, paul.walmsley, palmer, aou,
alex, dlan, p.zabel, drew, inochiama, geert+renesas, heylenay,
tglx, hal.feng, unicorn_wang, duje.mihanovic
Cc: elder, linux-pwm, devicetree, linux-kernel, linux-riscv, spacemit
This patchset updates the PWM_PXA driver and related device tree
bindings to support the SpacemiT K1 SoC. The changes include
modifications to driver support, configuration options, and device tree
bindings, enabling PWM functionality on the SpacemiT K1 platform.
It has been verified on the Banana Pi BPI-F3 board using PWM14, which is
specified as a pwm-backlight. The related device tree nodes are set to
"disabled" in patch 7, as a reference for future use when the display
driver is upstreamed and can be enabled all-together.
It is built upon:
1) the clock controller driver that Haylen Chu
currently has sent out for review at v6:
https://lore.kernel.org/lkml/20250401172434.6774-1-heylenay@4d2.org/
2) the reset controller driver that Alex Elder
currently has sent for review at v3:
https://lore.kernel.org/lkml/20250409211741.1171584-1-elder@riscstar.com/
It consists of the following patches:
Patch 1: Add optional resets property to PXA PWM bindings.
Patch 2: Add reset control support in the PXA PWM driver.
Patch 3: Add spacemit,k1-pwm compatible string to DT bindings.
Patch 4: Extend PXA PWM driver to support SpacemiT K1.
Patch 5: Add 20 PWM nodes for K1 in the device tree.
Patch 6: Add pinctrl settings for PWM0 to PWM19.
Patch 7: Add PWM14 backlight support for BPI-F3 board.
Patch 8: Add ARCH_SPACEMIT dependency to PWM_PXA Kconfig.
Patch 9: Enable PWM and PWM_PXA in riscv defconfig for SpacemiT K1.
- Guodong Xu
Guodong Xu (9):
dt-bindings: pwm: marvell,pxa: add optional property resets
pwm: pxa: add optional reset control
dt-bindings: pwm: marvell,pxa: add support to spacemit K1
pwm: pxa: add support for spacemit K1
riscv: dts: spacemit: add PWM support for K1 SoC
riscv: dts: spacemit: Add pinctrl configurations for PWM0-PWM19
riscv: dts: spacemit: Add PWM14 backlight support for BPI-F3
pwm: Kconfig: add depends on ARCH_SPACEMIT to PWM_PXA
riscv: defconfig: Enable PWM support for SpacemiT K1 SoC
.../bindings/pwm/marvell,pxa-pwm.yaml | 4 +
.../boot/dts/spacemit/k1-bananapi-f3.dts | 32 ++
arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi | 315 ++++++++++++++++++
arch/riscv/boot/dts/spacemit/k1.dtsi | 180 ++++++++++
arch/riscv/configs/defconfig | 2 +
drivers/pwm/Kconfig | 2 +-
drivers/pwm/pwm-pxa.c | 16 +-
7 files changed, 546 insertions(+), 5 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] 33+ messages in thread
* [PATCH 1/9] dt-bindings: pwm: marvell,pxa: add optional property resets
2025-04-11 13:14 [PATCH 0/9] pwm: Update PWM_PXA driver for SpacemiT K1 Guodong Xu
@ 2025-04-11 13:14 ` Guodong Xu
2025-04-11 16:44 ` Conor Dooley
2025-04-11 13:14 ` [PATCH 2/9] pwm: pxa: add optional reset control Guodong Xu
` (7 subsequent siblings)
8 siblings, 1 reply; 33+ messages in thread
From: Guodong Xu @ 2025-04-11 13:14 UTC (permalink / raw)
To: ukleinek, robh, krzk+dt, conor+dt, paul.walmsley, palmer, aou,
alex, dlan, p.zabel, drew, inochiama, geert+renesas, heylenay,
tglx, hal.feng, unicorn_wang, duje.mihanovic
Cc: elder, linux-pwm, devicetree, linux-kernel, linux-riscv, spacemit
Add an optional resets property for the Marvell PWM PXA binding.
Signed-off-by: Guodong Xu <guodong@riscstar.com>
---
Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml b/Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml
index 9ee1946dc2e1..9640d4b627c2 100644
--- a/Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml
+++ b/Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml
@@ -31,6 +31,9 @@ properties:
clocks:
maxItems: 1
+ resets:
+ maxItems: 1
+
required:
- compatible
- reg
--
2.43.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH 2/9] pwm: pxa: add optional reset control
2025-04-11 13:14 [PATCH 0/9] pwm: Update PWM_PXA driver for SpacemiT K1 Guodong Xu
2025-04-11 13:14 ` [PATCH 1/9] dt-bindings: pwm: marvell,pxa: add optional property resets Guodong Xu
@ 2025-04-11 13:14 ` Guodong Xu
2025-04-11 13:14 ` [PATCH 3/9] dt-bindings: pwm: marvell,pxa: add support to spacemit K1 Guodong Xu
` (6 subsequent siblings)
8 siblings, 0 replies; 33+ messages in thread
From: Guodong Xu @ 2025-04-11 13:14 UTC (permalink / raw)
To: ukleinek, robh, krzk+dt, conor+dt, paul.walmsley, palmer, aou,
alex, dlan, p.zabel, drew, inochiama, geert+renesas, heylenay,
tglx, hal.feng, unicorn_wang, duje.mihanovic
Cc: elder, linux-pwm, devicetree, linux-kernel, linux-riscv, spacemit
Support optional reset control for the PWM PXA driver.
During the probe, it acquires the reset controller using
devm_reset_control_get_optional_exclusive_deasserted() to get and deassert
the reset controller to enable the PWM channel.
Signed-off-by: Guodong Xu <guodong@riscstar.com>
---
drivers/pwm/pwm-pxa.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/drivers/pwm/pwm-pxa.c b/drivers/pwm/pwm-pxa.c
index 430bd6a709e9..dd9c6af0f672 100644
--- a/drivers/pwm/pwm-pxa.c
+++ b/drivers/pwm/pwm-pxa.c
@@ -25,6 +25,7 @@
#include <linux/io.h>
#include <linux/pwm.h>
#include <linux/of.h>
+#include <linux/reset.h>
#include <asm/div64.h>
@@ -49,10 +50,10 @@ MODULE_DEVICE_TABLE(platform, pwm_id_table);
#define PWMDCR_FD (1 << 10)
struct pxa_pwm_chip {
- struct device *dev;
-
- struct clk *clk;
- void __iomem *mmio_base;
+ struct device *dev;
+ struct clk *clk;
+ void __iomem *mmio_base;
+ struct reset_control *reset;
};
static inline struct pxa_pwm_chip *to_pxa_pwm_chip(struct pwm_chip *chip)
@@ -179,6 +180,11 @@ static int pwm_probe(struct platform_device *pdev)
if (IS_ERR(pc->clk))
return PTR_ERR(pc->clk);
+ pc->reset = devm_reset_control_get_optional_exclusive_deasserted(
+ &pdev->dev, NULL);
+ if (IS_ERR(pc->reset))
+ return PTR_ERR(pc->reset);
+
chip->ops = &pxa_pwm_ops;
if (IS_ENABLED(CONFIG_OF))
--
2.43.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH 3/9] dt-bindings: pwm: marvell,pxa: add support to spacemit K1
2025-04-11 13:14 [PATCH 0/9] pwm: Update PWM_PXA driver for SpacemiT K1 Guodong Xu
2025-04-11 13:14 ` [PATCH 1/9] dt-bindings: pwm: marvell,pxa: add optional property resets Guodong Xu
2025-04-11 13:14 ` [PATCH 2/9] pwm: pxa: add optional reset control Guodong Xu
@ 2025-04-11 13:14 ` Guodong Xu
2025-04-11 16:43 ` Conor Dooley
2025-04-11 13:14 ` [PATCH 4/9] pwm: pxa: add support for " Guodong Xu
` (5 subsequent siblings)
8 siblings, 1 reply; 33+ messages in thread
From: Guodong Xu @ 2025-04-11 13:14 UTC (permalink / raw)
To: ukleinek, robh, krzk+dt, conor+dt, paul.walmsley, palmer, aou,
alex, dlan, p.zabel, drew, inochiama, geert+renesas, heylenay,
tglx, hal.feng, unicorn_wang, duje.mihanovic
Cc: elder, linux-pwm, devicetree, linux-kernel, linux-riscv, spacemit
Add "spacemit,k1-pwm" as a compatible string to support the PWM
controller on the SpacemiT K1 platform.
Signed-off-by: Guodong Xu <guodong@riscstar.com>
---
Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml b/Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml
index 9640d4b627c2..1e3cabf6a89a 100644
--- a/Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml
+++ b/Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml
@@ -19,6 +19,7 @@ properties:
- marvell,pxa270-pwm
- marvell,pxa168-pwm
- marvell,pxa910-pwm
+ - spacemit,k1-pwm
reg:
# Length should be 0x10
--
2.43.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH 4/9] pwm: pxa: add support for spacemit K1
2025-04-11 13:14 [PATCH 0/9] pwm: Update PWM_PXA driver for SpacemiT K1 Guodong Xu
` (2 preceding siblings ...)
2025-04-11 13:14 ` [PATCH 3/9] dt-bindings: pwm: marvell,pxa: add support to spacemit K1 Guodong Xu
@ 2025-04-11 13:14 ` Guodong Xu
2025-04-11 13:14 ` [PATCH 5/9] riscv: dts: spacemit: add PWM support for K1 SoC Guodong Xu
` (4 subsequent siblings)
8 siblings, 0 replies; 33+ messages in thread
From: Guodong Xu @ 2025-04-11 13:14 UTC (permalink / raw)
To: ukleinek, robh, krzk+dt, conor+dt, paul.walmsley, palmer, aou,
alex, dlan, p.zabel, drew, inochiama, geert+renesas, heylenay,
tglx, hal.feng, unicorn_wang, duje.mihanovic
Cc: elder, linux-pwm, devicetree, linux-kernel, linux-riscv, spacemit
Add SpacemiT K1 support to the PWM PXA driver by extending the
of_match table with the appropriate compatible string.
Signed-off-by: Guodong Xu <guodong@riscstar.com>
---
drivers/pwm/pwm-pxa.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/pwm/pwm-pxa.c b/drivers/pwm/pwm-pxa.c
index dd9c6af0f672..3835eba824b9 100644
--- a/drivers/pwm/pwm-pxa.c
+++ b/drivers/pwm/pwm-pxa.c
@@ -37,6 +37,7 @@ static const struct platform_device_id pwm_id_table[] = {
{ "pxa27x-pwm", HAS_SECONDARY_PWM },
{ "pxa168-pwm", 0 },
{ "pxa910-pwm", 0 },
+ { "spacemit-k1-pwm", 0 },
{ },
};
MODULE_DEVICE_TABLE(platform, pwm_id_table);
@@ -149,6 +150,7 @@ static const struct of_device_id pwm_of_match[] = {
{ .compatible = "marvell,pxa270-pwm", .data = &pwm_id_table[0]},
{ .compatible = "marvell,pxa168-pwm", .data = &pwm_id_table[0]},
{ .compatible = "marvell,pxa910-pwm", .data = &pwm_id_table[0]},
+ { .compatible = "spacemit,k1-pwm", .data = &pwm_id_table[0]},
{ }
};
MODULE_DEVICE_TABLE(of, pwm_of_match);
--
2.43.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH 5/9] riscv: dts: spacemit: add PWM support for K1 SoC
2025-04-11 13:14 [PATCH 0/9] pwm: Update PWM_PXA driver for SpacemiT K1 Guodong Xu
` (3 preceding siblings ...)
2025-04-11 13:14 ` [PATCH 4/9] pwm: pxa: add support for " Guodong Xu
@ 2025-04-11 13:14 ` Guodong Xu
2025-04-11 13:14 ` [PATCH 6/9] riscv: dts: spacemit: Add pinctrl configurations for PWM0-PWM19 Guodong Xu
` (3 subsequent siblings)
8 siblings, 0 replies; 33+ messages in thread
From: Guodong Xu @ 2025-04-11 13:14 UTC (permalink / raw)
To: ukleinek, robh, krzk+dt, conor+dt, paul.walmsley, palmer, aou,
alex, dlan, p.zabel, drew, inochiama, geert+renesas, heylenay,
tglx, hal.feng, unicorn_wang, duje.mihanovic
Cc: elder, linux-pwm, devicetree, linux-kernel, linux-riscv, spacemit
The SpacemiT K1 SoC features a PWM controller with 20 independent
channels. Add the corresponding 20 PWM nodes to the device tree.
Signed-off-by: Guodong Xu <guodong@riscstar.com>
---
arch/riscv/boot/dts/spacemit/k1.dtsi | 180 +++++++++++++++++++++++++++
1 file changed, 180 insertions(+)
diff --git a/arch/riscv/boot/dts/spacemit/k1.dtsi b/arch/riscv/boot/dts/spacemit/k1.dtsi
index c0cc4b99c935..609135cb5282 100644
--- a/arch/riscv/boot/dts/spacemit/k1.dtsi
+++ b/arch/riscv/boot/dts/spacemit/k1.dtsi
@@ -556,5 +556,185 @@ sec_uart1: serial@f0612000 {
reg-io-width = <4>;
status = "reserved"; /* for TEE usage */
};
+
+ pwm0: pwm@d401a000 {
+ compatible = "spacemit,k1-pwm";
+ reg = <0x0 0xd401a000 0x0 0x10>;
+ #pwm-cells = <1>;
+ clocks = <&syscon_apbc CLK_PWM0>;
+ resets = <&syscon_apbc RESET_PWM0>;
+ status = "disabled";
+ };
+
+ pwm1: pwm@d401a400 {
+ compatible = "spacemit,k1-pwm";
+ reg = <0x0 0xd401a400 0x0 0x10>;
+ #pwm-cells = <1>;
+ clocks = <&syscon_apbc CLK_PWM1>;
+ resets = <&syscon_apbc RESET_PWM1>;
+ status = "disabled";
+ };
+
+ pwm2: pwm@d401a800 {
+ compatible = "spacemit,k1-pwm";
+ reg = <0x0 0xd401a800 0x0 0x10>;
+ #pwm-cells = <1>;
+ clocks = <&syscon_apbc CLK_PWM2>;
+ resets = <&syscon_apbc RESET_PWM2>;
+ status = "disabled";
+ };
+
+ pwm3: pwm@d401ac00 {
+ compatible = "spacemit,k1-pwm";
+ reg = <0x0 0xd401ac00 0x0 0x10>;
+ #pwm-cells = <1>;
+ clocks = <&syscon_apbc CLK_PWM3>;
+ resets = <&syscon_apbc RESET_PWM3>;
+ status = "disabled";
+ };
+
+ pwm4: pwm@d401b000 {
+ compatible = "spacemit,k1-pwm";
+ reg = <0x0 0xd401b000 0x0 0x10>;
+ #pwm-cells = <1>;
+ clocks = <&syscon_apbc CLK_PWM4>;
+ resets = <&syscon_apbc RESET_PWM4>;
+ status = "disabled";
+ };
+
+ pwm5: pwm@d401b400 {
+ compatible = "spacemit,k1-pwm";
+ reg = <0x0 0xd401b400 0x0 0x10>;
+ #pwm-cells = <1>;
+ clocks = <&syscon_apbc CLK_PWM5>;
+ resets = <&syscon_apbc RESET_PWM5>;
+ status = "disabled";
+ };
+
+ pwm6: pwm@d401b800 {
+ compatible = "spacemit,k1-pwm";
+ reg = <0x0 0xd401b800 0x0 0x10>;
+ #pwm-cells = <1>;
+ clocks = <&syscon_apbc CLK_PWM6>;
+ resets = <&syscon_apbc RESET_PWM6>;
+ status = "disabled";
+ };
+
+ pwm7: pwm@d401bc00 {
+ compatible = "spacemit,k1-pwm";
+ reg = <0x0 0xd401bc00 0x0 0x10>;
+ #pwm-cells = <1>;
+ clocks = <&syscon_apbc CLK_PWM7>;
+ resets = <&syscon_apbc RESET_PWM7>;
+ status = "disabled";
+ };
+
+ pwm8: pwm@d4020000 {
+ compatible = "spacemit,k1-pwm";
+ reg = <0x0 0xd4020000 0x0 0x10>;
+ #pwm-cells = <1>;
+ clocks = <&syscon_apbc CLK_PWM8>;
+ resets = <&syscon_apbc RESET_PWM8>;
+ status = "disabled";
+ };
+
+ pwm9: pwm@d4020400 {
+ compatible = "spacemit,k1-pwm";
+ reg = <0x0 0xd4020400 0x0 0x10>;
+ #pwm-cells = <1>;
+ clocks = <&syscon_apbc CLK_PWM9>;
+ resets = <&syscon_apbc RESET_PWM9>;
+ status = "disabled";
+ };
+
+ pwm10: pwm@d4020800 {
+ compatible = "spacemit,k1-pwm";
+ reg = <0x0 0xd4020800 0x0 0x10>;
+ #pwm-cells = <1>;
+ clocks = <&syscon_apbc CLK_PWM10>;
+ resets = <&syscon_apbc RESET_PWM10>;
+ status = "disabled";
+ };
+
+ pwm11: pwm@d4020c00 {
+ compatible = "spacemit,k1-pwm";
+ reg = <0x0 0xd4020c00 0x0 0x10>;
+ #pwm-cells = <1>;
+ clocks = <&syscon_apbc CLK_PWM11>;
+ resets = <&syscon_apbc RESET_PWM11>;
+ status = "disabled";
+ };
+
+ pwm12: pwm@d4021000 {
+ compatible = "spacemit,k1-pwm";
+ reg = <0x0 0xd4021000 0x0 0x10>;
+ #pwm-cells = <1>;
+ clocks = <&syscon_apbc CLK_PWM12>;
+ resets = <&syscon_apbc RESET_PWM12>;
+ status = "disabled";
+ };
+
+ pwm13: pwm@d4021400 {
+ compatible = "spacemit,k1-pwm";
+ reg = <0x0 0xd4021400 0x0 0x10>;
+ #pwm-cells = <1>;
+ clocks = <&syscon_apbc CLK_PWM13>;
+ resets = <&syscon_apbc RESET_PWM13>;
+ status = "disabled";
+ };
+
+ pwm14: pwm@d4021800 {
+ compatible = "spacemit,k1-pwm";
+ reg = <0x0 0xd4021800 0x0 0x10>;
+ #pwm-cells = <1>;
+ clocks = <&syscon_apbc CLK_PWM14>;
+ resets = <&syscon_apbc RESET_PWM14>;
+ status = "disabled";
+ };
+
+ pwm15: pwm@d4021c00 {
+ compatible = "spacemit,k1-pwm";
+ reg = <0x0 0xd4021c00 0x0 0x10>;
+ #pwm-cells = <1>;
+ clocks = <&syscon_apbc CLK_PWM15>;
+ resets = <&syscon_apbc RESET_PWM15>;
+ status = "disabled";
+ };
+
+ pwm16: pwm@d4022000 {
+ compatible = "spacemit,k1-pwm";
+ reg = <0x0 0xd4022000 0x0 0x10>;
+ #pwm-cells = <1>;
+ clocks = <&syscon_apbc CLK_PWM16>;
+ resets = <&syscon_apbc RESET_PWM16>;
+ status = "disabled";
+ };
+
+ pwm17: pwm@d4022400 {
+ compatible = "spacemit,k1-pwm";
+ reg = <0x0 0xd4022400 0x0 0x10>;
+ #pwm-cells = <1>;
+ clocks = <&syscon_apbc CLK_PWM17>;
+ resets = <&syscon_apbc RESET_PWM17>;
+ status = "disabled";
+ };
+
+ pwm18: pwm@d4022800 {
+ compatible = "spacemit,k1-pwm";
+ reg = <0x0 0xd4022800 0x0 0x10>;
+ #pwm-cells = <1>;
+ clocks = <&syscon_apbc CLK_PWM18>;
+ resets = <&syscon_apbc RESET_PWM18>;
+ status = "disabled";
+ };
+
+ pwm19: pwm@d4022c00 {
+ compatible = "spacemit,k1-pwm";
+ reg = <0x0 0xd4022c00 0x0 0x10>;
+ #pwm-cells = <1>;
+ clocks = <&syscon_apbc CLK_PWM19>;
+ resets = <&syscon_apbc RESET_PWM19>;
+ status = "disabled";
+ };
};
};
--
2.43.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH 6/9] riscv: dts: spacemit: Add pinctrl configurations for PWM0-PWM19
2025-04-11 13:14 [PATCH 0/9] pwm: Update PWM_PXA driver for SpacemiT K1 Guodong Xu
` (4 preceding siblings ...)
2025-04-11 13:14 ` [PATCH 5/9] riscv: dts: spacemit: add PWM support for K1 SoC Guodong Xu
@ 2025-04-11 13:14 ` Guodong Xu
2025-04-11 22:50 ` Inochi Amaoto
2025-04-11 13:14 ` [PATCH 7/9] riscv: dts: spacemit: Add PWM14 backlight support for BPI-F3 Guodong Xu
` (2 subsequent siblings)
8 siblings, 1 reply; 33+ messages in thread
From: Guodong Xu @ 2025-04-11 13:14 UTC (permalink / raw)
To: ukleinek, robh, krzk+dt, conor+dt, paul.walmsley, palmer, aou,
alex, dlan, p.zabel, drew, inochiama, geert+renesas, heylenay,
tglx, hal.feng, unicorn_wang, duje.mihanovic
Cc: elder, linux-pwm, devicetree, linux-kernel, linux-riscv, spacemit
Add pinctrl configurations for PWM0 to PWM19 in the SpacemiT K1
device tree source file. Each PWM instance is assigned multiple
pinmux configurations corresponding to different GPIOs and
function modes.
Configurations include:
- Mapping GPIOs to appropriate pinctrl nodes for PWM functionality
- Specifying bias-pull-up and drive-strength attributes
These updates ensure proper pin multiplexing and drive strength
settings for PWM signals on the SpacemiT K1 SoC when selected.
Signed-off-by: Guodong Xu <guodong@riscstar.com>
---
arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi | 315 +++++++++++++++++++
1 file changed, 315 insertions(+)
diff --git a/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi b/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi
index 283663647a86..294e05409933 100644
--- a/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi
+++ b/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi
@@ -20,4 +20,319 @@ uart0-2-pins {
drive-strength = <32>;
};
};
+ pwm0_0_cfg: pwm0-0-cfg {
+ pwm0-0-pins {
+ pinmux = <K1_PADCONF(104, 5)>;
+ bias-pull-up = <0>;
+ drive-strength = <19>;
+ };
+ };
+ pwm0_1_cfg: pwm0-1-cfg {
+ pwm0-1-pins {
+ pinmux = <K1_PADCONF(14, 3)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm0_2_cfg: pwm0-2-cfg {
+ pwm0-2-pins {
+ pinmux = <K1_PADCONF(22, 4)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm1_0_cfg: pwm1-0-cfg {
+ pwm1-0-pins {
+ pinmux = <K1_PADCONF(105, 5)>;
+ bias-pull-up = <0>;
+ drive-strength = <19>;
+ };
+ };
+ pwm1_1_cfg: pwm1-1-cfg {
+ pwm1-1-pins {
+ pinmux = <K1_PADCONF(29, 3)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm1_2_cfg: pwm1-2-cfg {
+ pwm1-2-pins {
+ pinmux = <K1_PADCONF(23, 4)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm2_0_cfg: pwm2-0-cfg {
+ pwm2-0-pins {
+ pinmux = <K1_PADCONF(106, 5)>;
+ bias-pull-up = <0>;
+ drive-strength = <19>;
+ };
+ };
+ pwm2_1_cfg: pwm2-1-cfg {
+ pwm2-1-pins {
+ pinmux = <K1_PADCONF(22, 2)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm2_2_cfg: pwm2-2-cfg {
+ pwm2-2-pins {
+ pinmux = <K1_PADCONF(30, 3)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm2_3_cfg: pwm2-3-cfg {
+ pwm2-3-pins {
+ pinmux = <K1_PADCONF(24, 4)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm3_0_cfg: pwm3-0-cfg {
+ pwm3-0-pins {
+ pinmux = <K1_PADCONF(107, 5)>;
+ bias-pull-up = <0>;
+ drive-strength = <19>;
+ };
+ };
+ pwm3_1_cfg: pwm3-1-cfg {
+ pwm3-1-pins {
+ pinmux = <K1_PADCONF(33, 3)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm3_2_cfg: pwm3-2-cfg {
+ pwm3-2-pins {
+ pinmux = <K1_PADCONF(25, 4)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm4_0_cfg: pwm4-0-cfg {
+ pwm4-0-pins {
+ pinmux = <K1_PADCONF(108, 5)>;
+ bias-pull-up = <0>;
+ drive-strength = <19>;
+ };
+ };
+ pwm4_1_cfg: pwm4-1-cfg {
+ pwm4-1-pins {
+ pinmux = <K1_PADCONF(34, 3)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm5_0_cfg: pwm5-0-cfg {
+ pwm5-0-pins {
+ pinmux = <K1_PADCONF(109, 5)>;
+ bias-pull-up = <0>;
+ drive-strength = <19>;
+ };
+ };
+ pwm5_1_cfg: pwm5-1-cfg {
+ pwm5-1-pins {
+ pinmux = <K1_PADCONF(35, 3)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm6_0_cfg: pwm6-0-cfg {
+ pwm6-0-pins {
+ pinmux = <K1_PADCONF(88, 4)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm6_1_cfg: pwm6-1-cfg {
+ pwm6-1-pins {
+ pinmux = <K1_PADCONF(36, 3)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm7_0_cfg: pwm7-0-cfg {
+ pwm7-0-pins {
+ pinmux = <K1_PADCONF(92, 2)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm7_1_cfg: pwm7-1-cfg {
+ pwm7-1-pins {
+ pinmux = <K1_PADCONF(37, 2)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm8_0_cfg: pwm8-0-cfg {
+ pwm8-0-pins {
+ pinmux = <K1_PADCONF(0, 3)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm8_1_cfg: pwm8-1-cfg {
+ pwm8-1-pins {
+ pinmux = <K1_PADCONF(38, 4)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm9_0_cfg: pwm9-0-cfg {
+ pwm9-0-pins {
+ pinmux = <K1_PADCONF(1, 3)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm9_1_cfg: pwm9-1-cfg {
+ pwm9-1-pins {
+ pinmux = <K1_PADCONF(39, 4)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm10_0_cfg: pwm10-0-cfg {
+ pwm10-0-pins {
+ pinmux = <K1_PADCONF(2, 3)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm10_1_cfg: pwm10-1-cfg {
+ pwm10-1-pins {
+ pinmux = <K1_PADCONF(40, 4)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm11_0_cfg: pwm11-0-cfg {
+ pwm11-0-pins {
+ pinmux = <K1_PADCONF(3, 3)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm11_1_cfg: pwm11-1-cfg {
+ pwm11-1-pins {
+ pinmux = <K1_PADCONF(41, 4)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm12_0_cfg: pwm12-0-cfg {
+ pwm12-0-pins {
+ pinmux = <K1_PADCONF(4, 3)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm12_1_cfg: pwm12-1-cfg {
+ pwm12-1-pins {
+ pinmux = <K1_PADCONF(42, 4)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm13_0_cfg: pwm13-0-cfg {
+ pwm13-0-pins {
+ pinmux = <K1_PADCONF(5, 3)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm13_1_cfg: pwm13-1-cfg {
+ pwm13-1-pins {
+ pinmux = <K1_PADCONF(43, 4)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm14_0_cfg: pwm14-0-cfg {
+ pwm14-0-pins {
+ pinmux = <K1_PADCONF(6, 3)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm14_1_cfg: pwm14-1-cfg {
+ pwm14-1-pins {
+ pinmux = <K1_PADCONF(44, 4)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm15_0_cfg: pwm15-0-cfg {
+ pwm15-0-pins {
+ pinmux = <K1_PADCONF(7, 3)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm15_1_cfg: pwm15-1-cfg {
+ pwm15-1-pins {
+ pinmux = <K1_PADCONF(45, 4)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm16_0_cfg: pwm16-0-cfg {
+ pwm16-0-pins {
+ pinmux = <K1_PADCONF(9, 3)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm16_1_cfg: pwm16-1-cfg {
+ pwm16-1-pins {
+ pinmux = <K1_PADCONF(46, 4)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm17_0_cfg: pwm17-0-cfg {
+ pwm17-0-pins {
+ pinmux = <K1_PADCONF(10, 3)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm17_1_cfg: pwm17-1-cfg {
+ pwm17-1-pins {
+ pinmux = <K1_PADCONF(53, 2)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm18_0_cfg: pwm18-0-cfg {
+ pwm18-0-pins {
+ pinmux = <K1_PADCONF(11, 3)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm18_1_cfg: pwm18-1-cfg {
+ pwm18-1-pins {
+ pinmux = <K1_PADCONF(57, 4)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm19_0_cfg: pwm19-0-cfg {
+ pwm19-0-pins {
+ pinmux = <K1_PADCONF(13, 3)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
+ pwm19_1_cfg: pwm19-1-cfg {
+ pwm19-1-pins {
+ pinmux = <K1_PADCONF(63, 4)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
};
--
2.43.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH 7/9] riscv: dts: spacemit: Add PWM14 backlight support for BPI-F3
2025-04-11 13:14 [PATCH 0/9] pwm: Update PWM_PXA driver for SpacemiT K1 Guodong Xu
` (5 preceding siblings ...)
2025-04-11 13:14 ` [PATCH 6/9] riscv: dts: spacemit: Add pinctrl configurations for PWM0-PWM19 Guodong Xu
@ 2025-04-11 13:14 ` Guodong Xu
2025-04-11 14:05 ` Yixun Lan
` (2 more replies)
2025-04-11 13:14 ` [PATCH 8/9] pwm: Kconfig: add depends on ARCH_SPACEMIT to PWM_PXA Guodong Xu
2025-04-11 13:14 ` [PATCH 9/9] riscv: defconfig: Enable PWM support for SpacemiT K1 SoC Guodong Xu
8 siblings, 3 replies; 33+ messages in thread
From: Guodong Xu @ 2025-04-11 13:14 UTC (permalink / raw)
To: ukleinek, robh, krzk+dt, conor+dt, paul.walmsley, palmer, aou,
alex, dlan, p.zabel, drew, inochiama, geert+renesas, heylenay,
tglx, hal.feng, unicorn_wang, duje.mihanovic
Cc: elder, linux-pwm, devicetree, linux-kernel, linux-riscv, spacemit
Add a PWM-based backlight node for the Banana Pi BPI-F3 board,
using PWM14. The backlight is defined as a 'pwm-backlight' device with
brightness levels and a default brightness setting. PWM14 is assigned
a period length of 2000 nanoseconds.
This configuration was used to verify PWM driver changes, with PWM14
tested and its waveform confirmed as correct.
The node status is set to "disabled", and should be enabled when the
display driver is ready.
Signed-off-by: Guodong Xu <guodong@riscstar.com>
---
.../boot/dts/spacemit/k1-bananapi-f3.dts | 32 +++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
index 816ef1bc358e..d04b57ddeb46 100644
--- a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
+++ b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
@@ -28,6 +28,32 @@ led1 {
default-state = "on";
};
};
+
+ pwm_bl: lcd_backlight {
+ compatible = "pwm-backlight";
+
+ pwms = <&pwm14 2000>;
+ brightness-levels = <
+ 0 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40
+ 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40
+ 40 40 40 40 40 40 40 40 40 41 42 43 44 45 46 47
+ 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
+ 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
+ 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
+ 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
+ 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
+ 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
+ 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
+ 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
+ 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
+ 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
+ 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223
+ 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239
+ 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255
+ >;
+ default-brightness-level = <100>;
+ status = "disabled";
+ };
};
&uart0 {
@@ -35,3 +61,9 @@ &uart0 {
pinctrl-0 = <&uart0_2_cfg>;
status = "okay";
};
+
+&pwm14 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pwm14_1_cfg>;
+ status = "disabled";
+};
--
2.43.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH 8/9] pwm: Kconfig: add depends on ARCH_SPACEMIT to PWM_PXA
2025-04-11 13:14 [PATCH 0/9] pwm: Update PWM_PXA driver for SpacemiT K1 Guodong Xu
` (6 preceding siblings ...)
2025-04-11 13:14 ` [PATCH 7/9] riscv: dts: spacemit: Add PWM14 backlight support for BPI-F3 Guodong Xu
@ 2025-04-11 13:14 ` Guodong Xu
2025-04-11 13:14 ` [PATCH 9/9] riscv: defconfig: Enable PWM support for SpacemiT K1 SoC Guodong Xu
8 siblings, 0 replies; 33+ messages in thread
From: Guodong Xu @ 2025-04-11 13:14 UTC (permalink / raw)
To: ukleinek, robh, krzk+dt, conor+dt, paul.walmsley, palmer, aou,
alex, dlan, p.zabel, drew, inochiama, geert+renesas, heylenay,
tglx, hal.feng, unicorn_wang, duje.mihanovic
Cc: elder, linux-pwm, devicetree, linux-kernel, linux-riscv, spacemit
The SpacemiT K1 SoC uses PWM_PXA driver.
Update the Kconfig file for the PWM_PXA driver to allow
the SpacemiT K1 SoC to use it.
Signed-off-by: Guodong Xu <guodong@riscstar.com>
---
drivers/pwm/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig
index 4731d5b90d7e..6731669e724e 100644
--- a/drivers/pwm/Kconfig
+++ b/drivers/pwm/Kconfig
@@ -493,7 +493,7 @@ config PWM_PCA9685
config PWM_PXA
tristate "PXA PWM support"
- depends on ARCH_PXA || ARCH_MMP || COMPILE_TEST
+ depends on ARCH_PXA || ARCH_MMP || ARCH_SPACEMIT || COMPILE_TEST
depends on HAS_IOMEM
help
Generic PWM framework driver for PXA.
--
2.43.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH 9/9] riscv: defconfig: Enable PWM support for SpacemiT K1 SoC
2025-04-11 13:14 [PATCH 0/9] pwm: Update PWM_PXA driver for SpacemiT K1 Guodong Xu
` (7 preceding siblings ...)
2025-04-11 13:14 ` [PATCH 8/9] pwm: Kconfig: add depends on ARCH_SPACEMIT to PWM_PXA Guodong Xu
@ 2025-04-11 13:14 ` Guodong Xu
2025-04-11 22:52 ` Inochi Amaoto
8 siblings, 1 reply; 33+ messages in thread
From: Guodong Xu @ 2025-04-11 13:14 UTC (permalink / raw)
To: ukleinek, robh, krzk+dt, conor+dt, paul.walmsley, palmer, aou,
alex, dlan, p.zabel, drew, inochiama, geert+renesas, heylenay,
tglx, hal.feng, unicorn_wang, duje.mihanovic
Cc: elder, linux-pwm, devicetree, linux-kernel, linux-riscv, spacemit
Enable CONFIG_PWM and CONFIG_PWM_PXA in the defconfig
to support the PWM controller used on the SpacemiT K1 SoC.
Signed-off-by: Guodong Xu <guodong@riscstar.com>
---
arch/riscv/configs/defconfig | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/riscv/configs/defconfig b/arch/riscv/configs/defconfig
index 4888529df1d8..9bd972867e0a 100644
--- a/arch/riscv/configs/defconfig
+++ b/arch/riscv/configs/defconfig
@@ -259,6 +259,8 @@ CONFIG_RPMSG_CTRL=y
CONFIG_RPMSG_VIRTIO=y
CONFIG_PM_DEVFREQ=y
CONFIG_IIO=y
+CONFIG_PWM=y
+CONFIG_PWM_PXA=y
CONFIG_THEAD_C900_ACLINT_SSWI=y
CONFIG_PHY_SUN4I_USB=m
CONFIG_PHY_STARFIVE_JH7110_DPHY_RX=m
--
2.43.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* Re: [PATCH 7/9] riscv: dts: spacemit: Add PWM14 backlight support for BPI-F3
2025-04-11 13:14 ` [PATCH 7/9] riscv: dts: spacemit: Add PWM14 backlight support for BPI-F3 Guodong Xu
@ 2025-04-11 14:05 ` Yixun Lan
2025-04-11 14:23 ` Alex Elder
2025-04-11 22:54 ` Inochi Amaoto
2025-04-14 5:58 ` Uwe Kleine-König
2 siblings, 1 reply; 33+ messages in thread
From: Yixun Lan @ 2025-04-11 14:05 UTC (permalink / raw)
To: Guodong Xu
Cc: ukleinek, robh, krzk+dt, conor+dt, paul.walmsley, palmer, aou,
alex, p.zabel, drew, inochiama, geert+renesas, heylenay, tglx,
hal.feng, unicorn_wang, duje.mihanovic, elder, linux-pwm,
devicetree, linux-kernel, linux-riscv, spacemit
On 21:14 Fri 11 Apr , Guodong Xu wrote:
> Add a PWM-based backlight node for the Banana Pi BPI-F3 board,
> using PWM14. The backlight is defined as a 'pwm-backlight' device with
> brightness levels and a default brightness setting. PWM14 is assigned
> a period length of 2000 nanoseconds.
>
> This configuration was used to verify PWM driver changes, with PWM14
> tested and its waveform confirmed as correct.
>
> The node status is set to "disabled", and should be enabled when the
> display driver is ready.
>
.. see comments below
> Signed-off-by: Guodong Xu <guodong@riscstar.com>
> ---
> .../boot/dts/spacemit/k1-bananapi-f3.dts | 32 +++++++++++++++++++
> 1 file changed, 32 insertions(+)
>
> diff --git a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
> index 816ef1bc358e..d04b57ddeb46 100644
> --- a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
> +++ b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
> @@ -28,6 +28,32 @@ led1 {
> default-state = "on";
> };
> };
> +
> + pwm_bl: lcd_backlight {
> + compatible = "pwm-backlight";
> +
> + pwms = <&pwm14 2000>;
> + brightness-levels = <
> + 0 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40
> + 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40
> + 40 40 40 40 40 40 40 40 40 41 42 43 44 45 46 47
> + 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
> + 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
> + 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
> + 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
> + 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
> + 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
> + 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
> + 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
> + 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
> + 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
> + 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223
> + 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239
> + 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255
> + >;
> + default-brightness-level = <100>;
> + status = "disabled";
I'm confused, has DT in board file with disabled status doesn't make sense?
it doesn't really useful for placeholder, even worse that functionality may not
verified, so I'd suggest sending along with display driver while at it..
> + };
> };
>
> &uart0 {
> @@ -35,3 +61,9 @@ &uart0 {
> pinctrl-0 = <&uart0_2_cfg>;
> status = "okay";
> };
> +
> +&pwm14 {
> + pinctrl-names = "default";
> + pinctrl-0 = <&pwm14_1_cfg>;
..
> + status = "disabled";
ditto
> +};
> --
> 2.43.0
>
--
Yixun Lan (dlan)
Gentoo Linux Developer
GPG Key ID AABEFD55
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH 7/9] riscv: dts: spacemit: Add PWM14 backlight support for BPI-F3
2025-04-11 14:05 ` Yixun Lan
@ 2025-04-11 14:23 ` Alex Elder
2025-04-11 14:45 ` Yixun Lan
2025-04-11 23:28 ` Inochi Amaoto
0 siblings, 2 replies; 33+ messages in thread
From: Alex Elder @ 2025-04-11 14:23 UTC (permalink / raw)
To: Yixun Lan, Guodong Xu
Cc: ukleinek, robh, krzk+dt, conor+dt, paul.walmsley, palmer, aou,
alex, p.zabel, drew, inochiama, geert+renesas, heylenay, tglx,
hal.feng, unicorn_wang, duje.mihanovic, linux-pwm, devicetree,
linux-kernel, linux-riscv, spacemit
On 4/11/25 9:05 AM, Yixun Lan wrote:
>
> On 21:14 Fri 11 Apr , Guodong Xu wrote:
>> Add a PWM-based backlight node for the Banana Pi BPI-F3 board,
>> using PWM14. The backlight is defined as a 'pwm-backlight' device with
>> brightness levels and a default brightness setting. PWM14 is assigned
>> a period length of 2000 nanoseconds.
>>
>> This configuration was used to verify PWM driver changes, with PWM14
>> tested and its waveform confirmed as correct.
>>
>> The node status is set to "disabled", and should be enabled when the
>> display driver is ready.
>>
> .. see comments below
>> Signed-off-by: Guodong Xu <guodong@riscstar.com>
>> ---
>> .../boot/dts/spacemit/k1-bananapi-f3.dts | 32 +++++++++++++++++++
>> 1 file changed, 32 insertions(+)
>>
>> diff --git a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
>> index 816ef1bc358e..d04b57ddeb46 100644
>> --- a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
>> +++ b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
>> @@ -28,6 +28,32 @@ led1 {
>> default-state = "on";
>> };
>> };
>> +
>> + pwm_bl: lcd_backlight {
>> + compatible = "pwm-backlight";
>> +
>> + pwms = <&pwm14 2000>;
>> + brightness-levels = <
>> + 0 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40
>> + 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40
>> + 40 40 40 40 40 40 40 40 40 41 42 43 44 45 46 47
>> + 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
>> + 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
>> + 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
>> + 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
>> + 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
>> + 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
>> + 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
>> + 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
>> + 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
>> + 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
>> + 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223
>> + 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239
>> + 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255
>> + >;
>> + default-brightness-level = <100>;
>> + status = "disabled";
> I'm confused, has DT in board file with disabled status doesn't make sense?
> it doesn't really useful for placeholder, even worse that functionality may not
> verified, so I'd suggest sending along with display driver while at it..
I think I suggested he include this. Guodong tested PWM using
a backlight on a display connected to a Banana Pi PBI-F3 board.
The above numbers come directly from the downstream code, which
uses this PWM consistently as a display back light.
But you're right, the exact set of numbers to use is dependent
on the display used, so it's better to add them when the display
gets integrated.
The pwm14 node could update still be added here, but that too
might as well wait until there's something to use it. So I
think this patch can just be dropped.
-Alex
>
>> + };
>> };
>>
>> &uart0 {
>> @@ -35,3 +61,9 @@ &uart0 {
>> pinctrl-0 = <&uart0_2_cfg>;
>> status = "okay";
>> };
>> +
>> +&pwm14 {
>> + pinctrl-names = "default";
>> + pinctrl-0 = <&pwm14_1_cfg>;
> ..
>> + status = "disabled";
> ditto
>
>> +};
>> --
>> 2.43.0
>>
>
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH 7/9] riscv: dts: spacemit: Add PWM14 backlight support for BPI-F3
2025-04-11 14:23 ` Alex Elder
@ 2025-04-11 14:45 ` Yixun Lan
2025-04-11 23:28 ` Inochi Amaoto
1 sibling, 0 replies; 33+ messages in thread
From: Yixun Lan @ 2025-04-11 14:45 UTC (permalink / raw)
To: Alex Elder
Cc: Guodong Xu, ukleinek, robh, krzk+dt, conor+dt, paul.walmsley,
palmer, aou, alex, p.zabel, drew, inochiama, geert+renesas,
heylenay, tglx, hal.feng, unicorn_wang, duje.mihanovic, linux-pwm,
devicetree, linux-kernel, linux-riscv, spacemit
Hi Alex,
On 09:23 Fri 11 Apr , Alex Elder wrote:
> On 4/11/25 9:05 AM, Yixun Lan wrote:
> >
> > On 21:14 Fri 11 Apr , Guodong Xu wrote:
> >> Add a PWM-based backlight node for the Banana Pi BPI-F3 board,
> >> using PWM14. The backlight is defined as a 'pwm-backlight' device with
> >> brightness levels and a default brightness setting. PWM14 is assigned
> >> a period length of 2000 nanoseconds.
> >>
> >> This configuration was used to verify PWM driver changes, with PWM14
> >> tested and its waveform confirmed as correct.
> >>
> >> The node status is set to "disabled", and should be enabled when the
> >> display driver is ready.
> >>
> > .. see comments below
> >> Signed-off-by: Guodong Xu <guodong@riscstar.com>
> >> ---
> >> .../boot/dts/spacemit/k1-bananapi-f3.dts | 32 +++++++++++++++++++
> >> 1 file changed, 32 insertions(+)
> >>
> >> diff --git a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
> >> index 816ef1bc358e..d04b57ddeb46 100644
> >> --- a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
> >> +++ b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
> >> @@ -28,6 +28,32 @@ led1 {
> >> default-state = "on";
> >> };
> >> };
> >> +
> >> + pwm_bl: lcd_backlight {
> >> + compatible = "pwm-backlight";
> >> +
> >> + pwms = <&pwm14 2000>;
> >> + brightness-levels = <
> >> + 0 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40
> >> + 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40
> >> + 40 40 40 40 40 40 40 40 40 41 42 43 44 45 46 47
> >> + 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
> >> + 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
> >> + 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
> >> + 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
> >> + 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
> >> + 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
> >> + 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
> >> + 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
> >> + 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
> >> + 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
> >> + 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223
> >> + 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239
> >> + 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255
> >> + >;
> >> + default-brightness-level = <100>;
> >> + status = "disabled";
> > I'm confused, has DT in board file with disabled status doesn't make sense?
> > it doesn't really useful for placeholder, even worse that functionality may not
> > verified, so I'd suggest sending along with display driver while at it..
>
> I think I suggested he include this. Guodong tested PWM using
> a backlight on a display connected to a Banana Pi PBI-F3 board.
> The above numbers come directly from the downstream code, which
> uses this PWM consistently as a display back light.
>
> But you're right, the exact set of numbers to use is dependent
> on the display used, so it's better to add them when the display
> gets integrated.
>
Ok
> The pwm14 node could update still be added here, but that too
> might as well wait until there's something to use it. So I
> think this patch can just be dropped.
>
thanks for the explanation
--
Yixun Lan (dlan)
Gentoo Linux Developer
GPG Key ID AABEFD55
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH 3/9] dt-bindings: pwm: marvell,pxa: add support to spacemit K1
2025-04-11 13:14 ` [PATCH 3/9] dt-bindings: pwm: marvell,pxa: add support to spacemit K1 Guodong Xu
@ 2025-04-11 16:43 ` Conor Dooley
2025-04-12 4:00 ` Guodong Xu
0 siblings, 1 reply; 33+ messages in thread
From: Conor Dooley @ 2025-04-11 16:43 UTC (permalink / raw)
To: Guodong Xu
Cc: ukleinek, robh, krzk+dt, conor+dt, paul.walmsley, palmer, aou,
alex, dlan, p.zabel, drew, inochiama, geert+renesas, heylenay,
tglx, hal.feng, unicorn_wang, duje.mihanovic, elder, linux-pwm,
devicetree, linux-kernel, linux-riscv, spacemit
[-- Attachment #1: Type: text/plain, Size: 992 bytes --]
On Fri, Apr 11, 2025 at 09:14:17PM +0800, Guodong Xu wrote:
> Add "spacemit,k1-pwm" as a compatible string to support the PWM
> controller on the SpacemiT K1 platform.
>
> Signed-off-by: Guodong Xu <guodong@riscstar.com>
> ---
> Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml b/Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml
> index 9640d4b627c2..1e3cabf6a89a 100644
> --- a/Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml
> +++ b/Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml
> @@ -19,6 +19,7 @@ properties:
> - marvell,pxa270-pwm
> - marvell,pxa168-pwm
> - marvell,pxa910-pwm
> + - spacemit,k1-pwm
The driver doesn't appear to handle this differently to existing
compatibles, why is a fallback not used?
>
> reg:
> # Length should be 0x10
> --
> 2.43.0
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH 1/9] dt-bindings: pwm: marvell,pxa: add optional property resets
2025-04-11 13:14 ` [PATCH 1/9] dt-bindings: pwm: marvell,pxa: add optional property resets Guodong Xu
@ 2025-04-11 16:44 ` Conor Dooley
2025-04-15 8:52 ` Philipp Zabel
0 siblings, 1 reply; 33+ messages in thread
From: Conor Dooley @ 2025-04-11 16:44 UTC (permalink / raw)
To: Guodong Xu
Cc: ukleinek, robh, krzk+dt, conor+dt, paul.walmsley, palmer, aou,
alex, dlan, p.zabel, drew, inochiama, geert+renesas, heylenay,
tglx, hal.feng, unicorn_wang, duje.mihanovic, elder, linux-pwm,
devicetree, linux-kernel, linux-riscv, spacemit
[-- Attachment #1: Type: text/plain, Size: 944 bytes --]
On Fri, Apr 11, 2025 at 09:14:15PM +0800, Guodong Xu wrote:
> Add an optional resets property for the Marvell PWM PXA binding.
>
> Signed-off-by: Guodong Xu <guodong@riscstar.com>
> ---
> Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml b/Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml
> index 9ee1946dc2e1..9640d4b627c2 100644
> --- a/Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml
> +++ b/Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml
> @@ -31,6 +31,9 @@ properties:
> clocks:
> maxItems: 1
>
> + resets:
> + maxItems: 1
Do any of the currently supported devices use a reset? If not, then add
this in tandem with the new compatible and only allow it there please.
> +
> required:
> - compatible
> - reg
> --
> 2.43.0
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH 6/9] riscv: dts: spacemit: Add pinctrl configurations for PWM0-PWM19
2025-04-11 13:14 ` [PATCH 6/9] riscv: dts: spacemit: Add pinctrl configurations for PWM0-PWM19 Guodong Xu
@ 2025-04-11 22:50 ` Inochi Amaoto
2025-04-14 16:42 ` Samuel Holland
0 siblings, 1 reply; 33+ messages in thread
From: Inochi Amaoto @ 2025-04-11 22:50 UTC (permalink / raw)
To: Guodong Xu, ukleinek, robh, krzk+dt, conor+dt, paul.walmsley,
palmer, aou, alex, dlan, p.zabel, drew, inochiama, geert+renesas,
heylenay, tglx, hal.feng, unicorn_wang, duje.mihanovic
Cc: elder, linux-pwm, devicetree, linux-kernel, linux-riscv, spacemit
On Fri, Apr 11, 2025 at 09:14:20PM +0800, Guodong Xu wrote:
> Add pinctrl configurations for PWM0 to PWM19 in the SpacemiT K1
> device tree source file. Each PWM instance is assigned multiple
> pinmux configurations corresponding to different GPIOs and
> function modes.
>
> Configurations include:
> - Mapping GPIOs to appropriate pinctrl nodes for PWM functionality
> - Specifying bias-pull-up and drive-strength attributes
>
> These updates ensure proper pin multiplexing and drive strength
> settings for PWM signals on the SpacemiT K1 SoC when selected.
>
> Signed-off-by: Guodong Xu <guodong@riscstar.com>
> ---
> arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi | 315 +++++++++++++++++++
> 1 file changed, 315 insertions(+)
>
I think this is too much, I think it is necessary to leave
already used one.
Regards,
Inochi
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH 9/9] riscv: defconfig: Enable PWM support for SpacemiT K1 SoC
2025-04-11 13:14 ` [PATCH 9/9] riscv: defconfig: Enable PWM support for SpacemiT K1 SoC Guodong Xu
@ 2025-04-11 22:52 ` Inochi Amaoto
2025-04-12 4:02 ` Guodong Xu
0 siblings, 1 reply; 33+ messages in thread
From: Inochi Amaoto @ 2025-04-11 22:52 UTC (permalink / raw)
To: Guodong Xu, ukleinek, robh, krzk+dt, conor+dt, paul.walmsley,
palmer, aou, alex, dlan, p.zabel, drew, inochiama, geert+renesas,
heylenay, tglx, hal.feng, unicorn_wang, duje.mihanovic
Cc: elder, linux-pwm, devicetree, linux-kernel, linux-riscv, spacemit
On Fri, Apr 11, 2025 at 09:14:23PM +0800, Guodong Xu wrote:
> Enable CONFIG_PWM and CONFIG_PWM_PXA in the defconfig
> to support the PWM controller used on the SpacemiT K1 SoC.
>
> Signed-off-by: Guodong Xu <guodong@riscstar.com>
> ---
> arch/riscv/configs/defconfig | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/riscv/configs/defconfig b/arch/riscv/configs/defconfig
> index 4888529df1d8..9bd972867e0a 100644
> --- a/arch/riscv/configs/defconfig
> +++ b/arch/riscv/configs/defconfig
> @@ -259,6 +259,8 @@ CONFIG_RPMSG_CTRL=y
> CONFIG_RPMSG_VIRTIO=y
> CONFIG_PM_DEVFREQ=y
> CONFIG_IIO=y
> +CONFIG_PWM=y
> +CONFIG_PWM_PXA=y
Why not m? This can reduce the Image size.
> CONFIG_THEAD_C900_ACLINT_SSWI=y
> CONFIG_PHY_SUN4I_USB=m
> CONFIG_PHY_STARFIVE_JH7110_DPHY_RX=m
> --
> 2.43.0
>
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH 7/9] riscv: dts: spacemit: Add PWM14 backlight support for BPI-F3
2025-04-11 13:14 ` [PATCH 7/9] riscv: dts: spacemit: Add PWM14 backlight support for BPI-F3 Guodong Xu
2025-04-11 14:05 ` Yixun Lan
@ 2025-04-11 22:54 ` Inochi Amaoto
2025-04-14 5:58 ` Uwe Kleine-König
2 siblings, 0 replies; 33+ messages in thread
From: Inochi Amaoto @ 2025-04-11 22:54 UTC (permalink / raw)
To: Guodong Xu, ukleinek, robh, krzk+dt, conor+dt, paul.walmsley,
palmer, aou, alex, dlan, p.zabel, drew, inochiama, geert+renesas,
heylenay, tglx, hal.feng, unicorn_wang, duje.mihanovic
Cc: elder, linux-pwm, devicetree, linux-kernel, linux-riscv, spacemit
On Fri, Apr 11, 2025 at 09:14:21PM +0800, Guodong Xu wrote:
> Add a PWM-based backlight node for the Banana Pi BPI-F3 board,
> using PWM14. The backlight is defined as a 'pwm-backlight' device with
> brightness levels and a default brightness setting. PWM14 is assigned
> a period length of 2000 nanoseconds.
>
> This configuration was used to verify PWM driver changes, with PWM14
> tested and its waveform confirmed as correct.
>
> The node status is set to "disabled", and should be enabled when the
> display driver is ready.
>
> Signed-off-by: Guodong Xu <guodong@riscstar.com>
> ---
> .../boot/dts/spacemit/k1-bananapi-f3.dts | 32 +++++++++++++++++++
> 1 file changed, 32 insertions(+)
>
> diff --git a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
> index 816ef1bc358e..d04b57ddeb46 100644
> --- a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
> +++ b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
> @@ -28,6 +28,32 @@ led1 {
> default-state = "on";
> };
> };
> +
> + pwm_bl: lcd_backlight {
> + compatible = "pwm-backlight";
> +
> + pwms = <&pwm14 2000>;
> + brightness-levels = <
> + 0 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40
> + 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40
> + 40 40 40 40 40 40 40 40 40 41 42 43 44 45 46 47
> + 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
> + 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
> + 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
> + 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
> + 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
> + 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
> + 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
> + 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
> + 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
> + 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
> + 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223
> + 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239
> + 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255
> + >;
Can we simplify this level matrix? I see it is continous in most cases.
Regards,
Inochi
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH 7/9] riscv: dts: spacemit: Add PWM14 backlight support for BPI-F3
2025-04-11 14:23 ` Alex Elder
2025-04-11 14:45 ` Yixun Lan
@ 2025-04-11 23:28 ` Inochi Amaoto
2025-04-12 4:22 ` Guodong Xu
1 sibling, 1 reply; 33+ messages in thread
From: Inochi Amaoto @ 2025-04-11 23:28 UTC (permalink / raw)
To: Alex Elder, Yixun Lan, Guodong Xu
Cc: ukleinek, robh, krzk+dt, conor+dt, paul.walmsley, palmer, aou,
alex, p.zabel, drew, inochiama, geert+renesas, heylenay, tglx,
hal.feng, unicorn_wang, duje.mihanovic, linux-pwm, devicetree,
linux-kernel, linux-riscv, spacemit
On Fri, Apr 11, 2025 at 09:23:29AM -0500, Alex Elder wrote:
> On 4/11/25 9:05 AM, Yixun Lan wrote:
> >
> > On 21:14 Fri 11 Apr , Guodong Xu wrote:
> > > Add a PWM-based backlight node for the Banana Pi BPI-F3 board,
> > > using PWM14. The backlight is defined as a 'pwm-backlight' device with
> > > brightness levels and a default brightness setting. PWM14 is assigned
> > > a period length of 2000 nanoseconds.
> > >
> > > This configuration was used to verify PWM driver changes, with PWM14
> > > tested and its waveform confirmed as correct.
> > >
> > > The node status is set to "disabled", and should be enabled when the
> > > display driver is ready.
> > >
> > .. see comments below
> > > Signed-off-by: Guodong Xu <guodong@riscstar.com>
> > > ---
> > > .../boot/dts/spacemit/k1-bananapi-f3.dts | 32 +++++++++++++++++++
> > > 1 file changed, 32 insertions(+)
> > >
> > > diff --git a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
> > > index 816ef1bc358e..d04b57ddeb46 100644
> > > --- a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
> > > +++ b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
> > > @@ -28,6 +28,32 @@ led1 {
> > > default-state = "on";
> > > };
> > > };
> > > +
> > > + pwm_bl: lcd_backlight {
> > > + compatible = "pwm-backlight";
> > > +
> > > + pwms = <&pwm14 2000>;
> > > + brightness-levels = <
> > > + 0 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40
> > > + 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40
> > > + 40 40 40 40 40 40 40 40 40 41 42 43 44 45 46 47
> > > + 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
> > > + 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
> > > + 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
> > > + 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
> > > + 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
> > > + 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
> > > + 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
> > > + 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
> > > + 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
> > > + 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
> > > + 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223
> > > + 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239
> > > + 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255
> > > + >;
> > > + default-brightness-level = <100>;
> > > + status = "disabled";
> > I'm confused, has DT in board file with disabled status doesn't make sense?
> > it doesn't really useful for placeholder, even worse that functionality may not
> > verified, so I'd suggest sending along with display driver while at it..
>
> I think I suggested he include this. Guodong tested PWM using
> a backlight on a display connected to a Banana Pi PBI-F3 board.
> The above numbers come directly from the downstream code, which
> uses this PWM consistently as a display back light.
>
> But you're right, the exact set of numbers to use is dependent
> on the display used, so it's better to add them when the display
> gets integrated.
>
> The pwm14 node could update still be added here, but that too
> might as well wait until there's something to use it. So I
> think this patch can just be dropped.
>
If this patch will be applied as it is after applying the display
driver. I recommend to preserve this patch, but move out of this
series and resend it as RFC. If this is only for test purpose, it
is better to move this into the cover letter and address it is for
testing.
In most case, patches with some unmeet dependency should follow
maintainer's request, or has specific purposes. It also needed to
be marked as RFC.
Regards,
Inochi
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH 3/9] dt-bindings: pwm: marvell,pxa: add support to spacemit K1
2025-04-11 16:43 ` Conor Dooley
@ 2025-04-12 4:00 ` Guodong Xu
0 siblings, 0 replies; 33+ messages in thread
From: Guodong Xu @ 2025-04-12 4:00 UTC (permalink / raw)
To: Conor Dooley
Cc: ukleinek, robh, krzk+dt, conor+dt, paul.walmsley, palmer, aou,
alex, dlan, p.zabel, drew, inochiama, geert+renesas, heylenay,
tglx, hal.feng, unicorn_wang, duje.mihanovic, elder, linux-pwm,
devicetree, linux-kernel, linux-riscv, spacemit
On Sat, Apr 12, 2025 at 12:43 AM Conor Dooley <conor@kernel.org> wrote:
>
> On Fri, Apr 11, 2025 at 09:14:17PM +0800, Guodong Xu wrote:
> > Add "spacemit,k1-pwm" as a compatible string to support the PWM
> > controller on the SpacemiT K1 platform.
> >
> > Signed-off-by: Guodong Xu <guodong@riscstar.com>
> > ---
> > Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml b/Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml
> > index 9640d4b627c2..1e3cabf6a89a 100644
> > --- a/Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml
> > +++ b/Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml
> > @@ -19,6 +19,7 @@ properties:
> > - marvell,pxa270-pwm
> > - marvell,pxa168-pwm
> > - marvell,pxa910-pwm
> > + - spacemit,k1-pwm
>
> The driver doesn't appear to handle this differently to existing
> compatibles, why is a fallback not used?
>
The only difference in the SpacemiT K1 PWM controller is the addition of
a resets line. This property is not used by any existing PXA-based platforms.
Since resets is defined as optional, I agree that continuing to use
the existing marvell,pxa... compatible string is reasonable.
I'll update the next version accordingly and include an explanation of this
decision in the commit message.
-Guodong
> >
> > reg:
> > # Length should be 0x10
> > --
> > 2.43.0
> >
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH 9/9] riscv: defconfig: Enable PWM support for SpacemiT K1 SoC
2025-04-11 22:52 ` Inochi Amaoto
@ 2025-04-12 4:02 ` Guodong Xu
0 siblings, 0 replies; 33+ messages in thread
From: Guodong Xu @ 2025-04-12 4:02 UTC (permalink / raw)
To: Inochi Amaoto
Cc: ukleinek, robh, krzk+dt, conor+dt, paul.walmsley, palmer, aou,
alex, dlan, p.zabel, drew, geert+renesas, heylenay, tglx,
hal.feng, unicorn_wang, duje.mihanovic, elder, linux-pwm,
devicetree, linux-kernel, linux-riscv, spacemit
On Sat, Apr 12, 2025 at 6:52 AM Inochi Amaoto <inochiama@gmail.com> wrote:
>
> On Fri, Apr 11, 2025 at 09:14:23PM +0800, Guodong Xu wrote:
> > Enable CONFIG_PWM and CONFIG_PWM_PXA in the defconfig
> > to support the PWM controller used on the SpacemiT K1 SoC.
> >
> > Signed-off-by: Guodong Xu <guodong@riscstar.com>
> > ---
> > arch/riscv/configs/defconfig | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/arch/riscv/configs/defconfig b/arch/riscv/configs/defconfig
> > index 4888529df1d8..9bd972867e0a 100644
> > --- a/arch/riscv/configs/defconfig
> > +++ b/arch/riscv/configs/defconfig
> > @@ -259,6 +259,8 @@ CONFIG_RPMSG_CTRL=y
> > CONFIG_RPMSG_VIRTIO=y
> > CONFIG_PM_DEVFREQ=y
> > CONFIG_IIO=y
> > +CONFIG_PWM=y
>
> > +CONFIG_PWM_PXA=y
>
> Why not m? This can reduce the Image size.
>
Thanks Inochi. It's better to use m.
I will fix that in the next version.
-Guodong
> > CONFIG_THEAD_C900_ACLINT_SSWI=y
> > CONFIG_PHY_SUN4I_USB=m
> > CONFIG_PHY_STARFIVE_JH7110_DPHY_RX=m
> > --
> > 2.43.0
> >
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH 7/9] riscv: dts: spacemit: Add PWM14 backlight support for BPI-F3
2025-04-11 23:28 ` Inochi Amaoto
@ 2025-04-12 4:22 ` Guodong Xu
0 siblings, 0 replies; 33+ messages in thread
From: Guodong Xu @ 2025-04-12 4:22 UTC (permalink / raw)
To: Inochi Amaoto
Cc: Alex Elder, Yixun Lan, ukleinek, robh, krzk+dt, conor+dt,
paul.walmsley, palmer, aou, alex, p.zabel, drew, geert+renesas,
heylenay, tglx, hal.feng, unicorn_wang, duje.mihanovic, linux-pwm,
devicetree, linux-kernel, linux-riscv, spacemit
On Sat, Apr 12, 2025 at 7:28 AM Inochi Amaoto <inochiama@gmail.com> wrote:
>
> On Fri, Apr 11, 2025 at 09:23:29AM -0500, Alex Elder wrote:
> > On 4/11/25 9:05 AM, Yixun Lan wrote:
> > >
> > > On 21:14 Fri 11 Apr , Guodong Xu wrote:
> > > > Add a PWM-based backlight node for the Banana Pi BPI-F3 board,
> > > > using PWM14. The backlight is defined as a 'pwm-backlight' device with
> > > > brightness levels and a default brightness setting. PWM14 is assigned
> > > > a period length of 2000 nanoseconds.
> > > >
> > > > This configuration was used to verify PWM driver changes, with PWM14
> > > > tested and its waveform confirmed as correct.
> > > >
> > > > The node status is set to "disabled", and should be enabled when the
> > > > display driver is ready.
> > > >
> > > .. see comments below
> > > > Signed-off-by: Guodong Xu <guodong@riscstar.com>
> > > > ---
> > > > .../boot/dts/spacemit/k1-bananapi-f3.dts | 32 +++++++++++++++++++
> > > > 1 file changed, 32 insertions(+)
> > > >
> > > > diff --git a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
> > > > index 816ef1bc358e..d04b57ddeb46 100644
> > > > --- a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
> > > > +++ b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
> > > > @@ -28,6 +28,32 @@ led1 {
> > > > default-state = "on";
> > > > };
> > > > };
> > > > +
> > > > + pwm_bl: lcd_backlight {
> > > > + compatible = "pwm-backlight";
> > > > +
> > > > + pwms = <&pwm14 2000>;
> > > > + brightness-levels = <
> > > > + 0 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40
> > > > + 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40
> > > > + 40 40 40 40 40 40 40 40 40 41 42 43 44 45 46 47
> > > > + 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
> > > > + 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
> > > > + 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
> > > > + 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
> > > > + 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
> > > > + 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
> > > > + 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
> > > > + 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
> > > > + 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
> > > > + 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
> > > > + 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223
> > > > + 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239
> > > > + 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255
> > > > + >;
> > > > + default-brightness-level = <100>;
> > > > + status = "disabled";
> > > I'm confused, has DT in board file with disabled status doesn't make sense?
> > > it doesn't really useful for placeholder, even worse that functionality may not
> > > verified, so I'd suggest sending along with display driver while at it..
> >
> > I think I suggested he include this. Guodong tested PWM using
> > a backlight on a display connected to a Banana Pi PBI-F3 board.
> > The above numbers come directly from the downstream code, which
> > uses this PWM consistently as a display back light.
> >
> > But you're right, the exact set of numbers to use is dependent
> > on the display used, so it's better to add them when the display
> > gets integrated.
> >
> > The pwm14 node could update still be added here, but that too
> > might as well wait until there's something to use it. So I
> > think this patch can just be dropped.
> >
>
I checked the existing boards based on SpacemiT K1 Soc, all of them are
following the same pinmux design of using pwm14 (and pinctrl group 1,
ie. pwm14_1_cfg) as the display backlight control.
That's why the code relating to pwm14, in my opinion, could be useful to
others.
> If this patch will be applied as it is after applying the display
> driver. I recommend to preserve this patch, but move out of this
> series and resend it as RFC. If this is only for test purpose, it
> is better to move this into the cover letter and address it is for
> testing.
>
Yes, it's for test purpose. So, let me move the code snippet into the
cover letter in my next version.
-Guodong
> In most case, patches with some unmeet dependency should follow
> maintainer's request, or has specific purposes. It also needed to
> be marked as RFC.
>
> Regards,
> Inochi
>
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH 7/9] riscv: dts: spacemit: Add PWM14 backlight support for BPI-F3
2025-04-11 13:14 ` [PATCH 7/9] riscv: dts: spacemit: Add PWM14 backlight support for BPI-F3 Guodong Xu
2025-04-11 14:05 ` Yixun Lan
2025-04-11 22:54 ` Inochi Amaoto
@ 2025-04-14 5:58 ` Uwe Kleine-König
2025-04-14 8:03 ` Yixun Lan
2 siblings, 1 reply; 33+ messages in thread
From: Uwe Kleine-König @ 2025-04-14 5:58 UTC (permalink / raw)
To: Guodong Xu
Cc: robh, krzk+dt, conor+dt, paul.walmsley, palmer, aou, alex, dlan,
p.zabel, drew, inochiama, geert+renesas, heylenay, tglx, hal.feng,
unicorn_wang, duje.mihanovic, elder, linux-pwm, devicetree,
linux-kernel, linux-riscv, spacemit
[-- Attachment #1: Type: text/plain, Size: 373 bytes --]
Hello,
On Fri, Apr 11, 2025 at 09:14:21PM +0800, Guodong Xu wrote:
> +&pwm14 {
> + pinctrl-names = "default";
> + pinctrl-0 = <&pwm14_1_cfg>;
> + status = "disabled";
> +};
I wonder if the pinctrl properties can better be added to the SoC's
.dtsi file. (Only applies if this is a canonical choice, i.e. there is
no other possible output configuration.)
Best regards
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH 7/9] riscv: dts: spacemit: Add PWM14 backlight support for BPI-F3
2025-04-14 5:58 ` Uwe Kleine-König
@ 2025-04-14 8:03 ` Yixun Lan
0 siblings, 0 replies; 33+ messages in thread
From: Yixun Lan @ 2025-04-14 8:03 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Guodong Xu, robh, krzk+dt, conor+dt, paul.walmsley, palmer, aou,
alex, p.zabel, drew, inochiama, geert+renesas, heylenay, tglx,
hal.feng, unicorn_wang, duje.mihanovic, elder, linux-pwm,
devicetree, linux-kernel, linux-riscv, spacemit
Hi Uwe,
On 07:58 Mon 14 Apr , Uwe Kleine-König wrote:
> Hello,
>
> On Fri, Apr 11, 2025 at 09:14:21PM +0800, Guodong Xu wrote:
> > +&pwm14 {
> > + pinctrl-names = "default";
> > + pinctrl-0 = <&pwm14_1_cfg>;
> > + status = "disabled";
> > +};
>
> I wonder if the pinctrl properties can better be added to the SoC's
> .dtsi file. (Only applies if this is a canonical choice, i.e. there is
> no other possible output configuration.)
>
I'd agree it's a good idea and should follow, but unfortunately in the
practical case, all pwm able to route to at least two different pins..
https://developer.spacemit.com/documentation?token=YiJZwXA2Ri4nJikV9E1cp6nqnMh
see section: 4.5 Multi-Function I/O Pin Assignments
--
Yixun Lan (dlan)
Gentoo Linux Developer
GPG Key ID AABEFD55
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH 6/9] riscv: dts: spacemit: Add pinctrl configurations for PWM0-PWM19
2025-04-11 22:50 ` Inochi Amaoto
@ 2025-04-14 16:42 ` Samuel Holland
0 siblings, 0 replies; 33+ messages in thread
From: Samuel Holland @ 2025-04-14 16:42 UTC (permalink / raw)
To: Inochi Amaoto, Guodong Xu, ukleinek, robh, krzk+dt, conor+dt,
paul.walmsley, palmer, aou, alex, dlan, p.zabel, drew,
geert+renesas, heylenay, tglx, hal.feng, unicorn_wang,
duje.mihanovic
Cc: elder, linux-pwm, devicetree, linux-kernel, linux-riscv, spacemit
Hi Inochi,
On 2025-04-11 5:50 PM, Inochi Amaoto wrote:
> On Fri, Apr 11, 2025 at 09:14:20PM +0800, Guodong Xu wrote:
>> Add pinctrl configurations for PWM0 to PWM19 in the SpacemiT K1
>> device tree source file. Each PWM instance is assigned multiple
>> pinmux configurations corresponding to different GPIOs and
>> function modes.
>>
>> Configurations include:
>> - Mapping GPIOs to appropriate pinctrl nodes for PWM functionality
>> - Specifying bias-pull-up and drive-strength attributes
>>
>> These updates ensure proper pin multiplexing and drive strength
>> settings for PWM signals on the SpacemiT K1 SoC when selected.
>>
>> Signed-off-by: Guodong Xu <guodong@riscstar.com>
>> ---
>> arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi | 315 +++++++++++++++++++
>> 1 file changed, 315 insertions(+)
>>
>
> I think this is too much, I think it is necessary to leave
> already used one.
If your concern is about compiled DTB size, you can use /omit-if-no-ref/ for
each of these nodes, so only the pinmux nodes actually referenced by a
controller are included in the DTB.
Regards,
Samuel
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH 1/9] dt-bindings: pwm: marvell,pxa: add optional property resets
2025-04-11 16:44 ` Conor Dooley
@ 2025-04-15 8:52 ` Philipp Zabel
2025-04-15 9:54 ` Guodong Xu
0 siblings, 1 reply; 33+ messages in thread
From: Philipp Zabel @ 2025-04-15 8:52 UTC (permalink / raw)
To: Conor Dooley, Guodong Xu
Cc: ukleinek, robh, krzk+dt, conor+dt, paul.walmsley, palmer, aou,
alex, dlan, drew, inochiama, geert+renesas, heylenay, tglx,
hal.feng, unicorn_wang, duje.mihanovic, elder, linux-pwm,
devicetree, linux-kernel, linux-riscv, spacemit
On Fr, 2025-04-11 at 17:44 +0100, Conor Dooley wrote:
> On Fri, Apr 11, 2025 at 09:14:15PM +0800, Guodong Xu wrote:
> > Add an optional resets property for the Marvell PWM PXA binding.
> >
> > Signed-off-by: Guodong Xu <guodong@riscstar.com>
> > ---
> > Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml b/Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml
> > index 9ee1946dc2e1..9640d4b627c2 100644
> > --- a/Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml
> > +++ b/Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml
> > @@ -31,6 +31,9 @@ properties:
> > clocks:
> > maxItems: 1
> >
> > + resets:
> > + maxItems: 1
>
> Do any of the currently supported devices use a reset? If not, then add
> this in tandem with the new compatible and only allow it there please.
Also, if spacemit,k1-pwm can not work without the reset being
deasserted, mark it as required.
The driver can still use reset_control_get_optional.
regards
Philipp
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH 1/9] dt-bindings: pwm: marvell,pxa: add optional property resets
2025-04-15 8:52 ` Philipp Zabel
@ 2025-04-15 9:54 ` Guodong Xu
2025-04-15 10:12 ` Yixun Lan
0 siblings, 1 reply; 33+ messages in thread
From: Guodong Xu @ 2025-04-15 9:54 UTC (permalink / raw)
To: Philipp Zabel
Cc: Conor Dooley, ukleinek, robh, krzk+dt, conor+dt, paul.walmsley,
palmer, aou, alex, dlan, drew, inochiama, geert+renesas, heylenay,
tglx, hal.feng, unicorn_wang, duje.mihanovic, elder, linux-pwm,
devicetree, linux-kernel, linux-riscv, spacemit
On Tue, Apr 15, 2025 at 4:53 PM Philipp Zabel <p.zabel@pengutronix.de> wrote:
>
> On Fr, 2025-04-11 at 17:44 +0100, Conor Dooley wrote:
> > On Fri, Apr 11, 2025 at 09:14:15PM +0800, Guodong Xu wrote:
> > > Add an optional resets property for the Marvell PWM PXA binding.
> > >
> > > Signed-off-by: Guodong Xu <guodong@riscstar.com>
> > > ---
> > > Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml | 3 +++
> > > 1 file changed, 3 insertions(+)
> > >
> > > diff --git a/Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml b/Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml
> > > index 9ee1946dc2e1..9640d4b627c2 100644
> > > --- a/Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml
> > > +++ b/Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml
> > > @@ -31,6 +31,9 @@ properties:
> > > clocks:
> > > maxItems: 1
> > >
> > > + resets:
> > > + maxItems: 1
> >
> > Do any of the currently supported devices use a reset? If not, then add
> > this in tandem with the new compatible and only allow it there please.
>
> Also, if spacemit,k1-pwm can not work without the reset being
> deasserted, mark it as required.
>
Thank you Philipp. spacemit,k1-pwm can not work without the reset.
I will add that in the next version.
-Guodong
> The driver can still use reset_control_get_optional.
>
> regards
> Philipp
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH 1/9] dt-bindings: pwm: marvell,pxa: add optional property resets
2025-04-15 9:54 ` Guodong Xu
@ 2025-04-15 10:12 ` Yixun Lan
2025-04-15 12:11 ` Alex Elder
0 siblings, 1 reply; 33+ messages in thread
From: Yixun Lan @ 2025-04-15 10:12 UTC (permalink / raw)
To: Guodong Xu
Cc: Philipp Zabel, Conor Dooley, ukleinek, robh, krzk+dt, conor+dt,
paul.walmsley, palmer, aou, alex, drew, inochiama, geert+renesas,
heylenay, tglx, hal.feng, unicorn_wang, duje.mihanovic, elder,
linux-pwm, devicetree, linux-kernel, linux-riscv, spacemit
Hi Philipp,
On 17:54 Tue 15 Apr , Guodong Xu wrote:
> On Tue, Apr 15, 2025 at 4:53 PM Philipp Zabel <p.zabel@pengutronix.de> wrote:
> >
> > On Fr, 2025-04-11 at 17:44 +0100, Conor Dooley wrote:
> > > On Fri, Apr 11, 2025 at 09:14:15PM +0800, Guodong Xu wrote:
> > > > Add an optional resets property for the Marvell PWM PXA binding.
> > > >
> > > > Signed-off-by: Guodong Xu <guodong@riscstar.com>
> > > > ---
> > > > Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml | 3 +++
> > > > 1 file changed, 3 insertions(+)
> > > >
> > > > diff --git a/Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml b/Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml
> > > > index 9ee1946dc2e1..9640d4b627c2 100644
> > > > --- a/Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml
> > > > +++ b/Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml
> > > > @@ -31,6 +31,9 @@ properties:
> > > > clocks:
> > > > maxItems: 1
> > > >
> > > > + resets:
> > > > + maxItems: 1
> > >
> > > Do any of the currently supported devices use a reset? If not, then add
> > > this in tandem with the new compatible and only allow it there please.
> >
> > Also, if spacemit,k1-pwm can not work without the reset being
> > deasserted, mark it as required.
If I inerpret correctly, only reset requires explicitly being de-asserted,
need to mark as required? that's being said, if reset comes out as de-asserted
by default after power reset, then not necessary?
(in other cases, some device block is in asserted state by default)
thanks
> >
>
> Thank you Philipp. spacemit,k1-pwm can not work without the reset.
> I will add that in the next version.
>
> -Guodong
>
> > The driver can still use reset_control_get_optional.
> >
> > regards
> > Philipp
--
Yixun Lan (dlan)
Gentoo Linux Developer
GPG Key ID AABEFD55
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH 1/9] dt-bindings: pwm: marvell,pxa: add optional property resets
2025-04-15 10:12 ` Yixun Lan
@ 2025-04-15 12:11 ` Alex Elder
2025-04-15 12:28 ` Yixun Lan
0 siblings, 1 reply; 33+ messages in thread
From: Alex Elder @ 2025-04-15 12:11 UTC (permalink / raw)
To: Yixun Lan, Guodong Xu
Cc: Philipp Zabel, Conor Dooley, ukleinek, robh, krzk+dt, conor+dt,
paul.walmsley, palmer, aou, alex, drew, inochiama, geert+renesas,
heylenay, tglx, hal.feng, unicorn_wang, duje.mihanovic, linux-pwm,
devicetree, linux-kernel, linux-riscv, spacemit
On 4/15/25 5:12 AM, Yixun Lan wrote:
> Hi Philipp,
>
> On 17:54 Tue 15 Apr , Guodong Xu wrote:
>> On Tue, Apr 15, 2025 at 4:53 PM Philipp Zabel <p.zabel@pengutronix.de> wrote:
>>>
>>> On Fr, 2025-04-11 at 17:44 +0100, Conor Dooley wrote:
>>>> On Fri, Apr 11, 2025 at 09:14:15PM +0800, Guodong Xu wrote:
>>>>> Add an optional resets property for the Marvell PWM PXA binding.
>>>>>
>>>>> Signed-off-by: Guodong Xu <guodong@riscstar.com>
>>>>> ---
>>>>> Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml | 3 +++
>>>>> 1 file changed, 3 insertions(+)
>>>>>
>>>>> diff --git a/Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml b/Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml
>>>>> index 9ee1946dc2e1..9640d4b627c2 100644
>>>>> --- a/Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml
>>>>> +++ b/Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml
>>>>> @@ -31,6 +31,9 @@ properties:
>>>>> clocks:
>>>>> maxItems: 1
>>>>>
>>>>> + resets:
>>>>> + maxItems: 1
>>>>
>>>> Do any of the currently supported devices use a reset? If not, then add
>>>> this in tandem with the new compatible and only allow it there please.
>>>
>>> Also, if spacemit,k1-pwm can not work without the reset being
>>> deasserted, mark it as required.
>
> If I inerpret correctly, only reset requires explicitly being de-asserted,
> need to mark as required? that's being said, if reset comes out as de-asserted
> by default after power reset, then not necessary?
> (in other cases, some device block is in asserted state by default)
We can often benefit from the state that the boot loader has left
things in, but I think it's better not to assume it if possible.
I suppose it might not be required though.
Anyway, the reset line is available to use; why not require it?
-Alex
> thanks
>>>
>>
>> Thank you Philipp. spacemit,k1-pwm can not work without the reset.
>> I will add that in the next version.
>>
>> -Guodong
>>
>>> The driver can still use reset_control_get_optional.
>>>
>>> regards
>>> Philipp
>
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH 1/9] dt-bindings: pwm: marvell,pxa: add optional property resets
2025-04-15 12:11 ` Alex Elder
@ 2025-04-15 12:28 ` Yixun Lan
2025-04-16 5:18 ` Uwe Kleine-König
0 siblings, 1 reply; 33+ messages in thread
From: Yixun Lan @ 2025-04-15 12:28 UTC (permalink / raw)
To: Alex Elder
Cc: Guodong Xu, Philipp Zabel, Conor Dooley, ukleinek, robh, krzk+dt,
conor+dt, paul.walmsley, palmer, aou, alex, drew, inochiama,
geert+renesas, heylenay, tglx, hal.feng, unicorn_wang,
duje.mihanovic, linux-pwm, devicetree, linux-kernel, linux-riscv,
spacemit
Hi Alex,
On 07:11 Tue 15 Apr , Alex Elder wrote:
> On 4/15/25 5:12 AM, Yixun Lan wrote:
> > Hi Philipp,
> >
> > On 17:54 Tue 15 Apr , Guodong Xu wrote:
> >> On Tue, Apr 15, 2025 at 4:53 PM Philipp Zabel <p.zabel@pengutronix.de> wrote:
> >>>
> >>> On Fr, 2025-04-11 at 17:44 +0100, Conor Dooley wrote:
> >>>> On Fri, Apr 11, 2025 at 09:14:15PM +0800, Guodong Xu wrote:
> >>>>> Add an optional resets property for the Marvell PWM PXA binding.
> >>>>>
> >>>>> Signed-off-by: Guodong Xu <guodong@riscstar.com>
> >>>>> ---
> >>>>> Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml | 3 +++
> >>>>> 1 file changed, 3 insertions(+)
> >>>>>
> >>>>> diff --git a/Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml b/Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml
> >>>>> index 9ee1946dc2e1..9640d4b627c2 100644
> >>>>> --- a/Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml
> >>>>> +++ b/Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml
> >>>>> @@ -31,6 +31,9 @@ properties:
> >>>>> clocks:
> >>>>> maxItems: 1
> >>>>>
> >>>>> + resets:
> >>>>> + maxItems: 1
> >>>>
> >>>> Do any of the currently supported devices use a reset? If not, then add
> >>>> this in tandem with the new compatible and only allow it there please.
> >>>
> >>> Also, if spacemit,k1-pwm can not work without the reset being
> >>> deasserted, mark it as required.
> >
> > If I inerpret correctly, only reset requires explicitly being de-asserted,
> > need to mark as required? that's being said, if reset comes out as de-asserted
> > by default after power reset, then not necessary?
> > (in other cases, some device block is in asserted state by default)
>
> We can often benefit from the state that the boot loader has left
> things in, but I think it's better not to assume it if possible.
right, I agree mostly
> I suppose it might not be required though.
>
> Anyway, the reset line is available to use; why not require it?
>
maybe there are cases that users don't want to issue a reset..
so, want to make it optional.. I can think one example that,
display controller is up and working from bootloader to linux,
reset it will got a flicker picture..
anyway, my question was trying to understand the policy of
writting DTS hehind..
>
> > thanks
> >>>
> >>
> >> Thank you Philipp. spacemit,k1-pwm can not work without the reset.
> >> I will add that in the next version.
> >>
> >> -Guodong
> >>
> >>> The driver can still use reset_control_get_optional.
> >>>
> >>> regards
> >>> Philipp
> >
>
--
Yixun Lan (dlan)
Gentoo Linux Developer
GPG Key ID AABEFD55
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH 1/9] dt-bindings: pwm: marvell,pxa: add optional property resets
2025-04-15 12:28 ` Yixun Lan
@ 2025-04-16 5:18 ` Uwe Kleine-König
2025-04-16 11:33 ` Alex Elder
0 siblings, 1 reply; 33+ messages in thread
From: Uwe Kleine-König @ 2025-04-16 5:18 UTC (permalink / raw)
To: Yixun Lan
Cc: Alex Elder, Guodong Xu, Philipp Zabel, Conor Dooley, robh,
krzk+dt, conor+dt, paul.walmsley, palmer, aou, alex, drew,
inochiama, geert+renesas, heylenay, tglx, hal.feng, unicorn_wang,
duje.mihanovic, linux-pwm, devicetree, linux-kernel, linux-riscv,
spacemit
[-- Attachment #1: Type: text/plain, Size: 587 bytes --]
Hello,
On Tue, Apr 15, 2025 at 12:28:07PM +0000, Yixun Lan wrote:
> maybe there are cases that users don't want to issue a reset..
> so, want to make it optional.. I can think one example that,
> display controller is up and working from bootloader to linux,
> reset it will got a flicker picture..
Agreed. You can just deassert the reset at probe time. That shouldn't
interfere with a PWM that is already producing an output.
> GPG Key ID AABEFD55
If you advertise your OpenPGP certificate, I recommend using the long
id. See for example https://keys.openpgp.org/search?q=AABEFD55.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH 1/9] dt-bindings: pwm: marvell,pxa: add optional property resets
2025-04-16 5:18 ` Uwe Kleine-König
@ 2025-04-16 11:33 ` Alex Elder
2025-04-16 14:56 ` Uwe Kleine-König
0 siblings, 1 reply; 33+ messages in thread
From: Alex Elder @ 2025-04-16 11:33 UTC (permalink / raw)
To: Uwe Kleine-König, Yixun Lan
Cc: Guodong Xu, Philipp Zabel, Conor Dooley, robh, krzk+dt, conor+dt,
paul.walmsley, palmer, aou, alex, drew, inochiama, geert+renesas,
heylenay, tglx, hal.feng, unicorn_wang, duje.mihanovic, linux-pwm,
devicetree, linux-kernel, linux-riscv, spacemit
On 4/16/25 12:18 AM, Uwe Kleine-König wrote:
> Hello,
>
> On Tue, Apr 15, 2025 at 12:28:07PM +0000, Yixun Lan wrote:
>> maybe there are cases that users don't want to issue a reset..
>> so, want to make it optional.. I can think one example that,
>> display controller is up and working from bootloader to linux,
>> reset it will got a flicker picture..
>
> Agreed. You can just deassert the reset at probe time. That shouldn't
> interfere with a PWM that is already producing an output.
I think you're saying reset can be a required property, to be
harmlessly deasserted at probe time? Yixun was suggesting it
should not be required, because it might already be deasserted.
Anyway, I don't feel strongly either way. Maybe the DTS
maintainers can recommend what to do.
-Alex
>
>> GPG Key ID AABEFD55
>
> If you advertise your OpenPGP certificate, I recommend using the long
> id. See for example https://keys.openpgp.org/search?q=AABEFD55.
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH 1/9] dt-bindings: pwm: marvell,pxa: add optional property resets
2025-04-16 11:33 ` Alex Elder
@ 2025-04-16 14:56 ` Uwe Kleine-König
0 siblings, 0 replies; 33+ messages in thread
From: Uwe Kleine-König @ 2025-04-16 14:56 UTC (permalink / raw)
To: Alex Elder
Cc: Yixun Lan, Guodong Xu, Philipp Zabel, Conor Dooley, robh, krzk+dt,
conor+dt, paul.walmsley, palmer, aou, alex, drew, inochiama,
geert+renesas, heylenay, tglx, hal.feng, unicorn_wang,
duje.mihanovic, linux-pwm, devicetree, linux-kernel, linux-riscv,
spacemit
[-- Attachment #1: Type: text/plain, Size: 1305 bytes --]
Hello Alex,
On Wed, Apr 16, 2025 at 06:33:42AM -0500, Alex Elder wrote:
> On 4/16/25 12:18 AM, Uwe Kleine-König wrote:
> > Hello,
> >
> > On Tue, Apr 15, 2025 at 12:28:07PM +0000, Yixun Lan wrote:
> > > maybe there are cases that users don't want to issue a reset..
> > > so, want to make it optional.. I can think one example that,
> > > display controller is up and working from bootloader to linux,
> > > reset it will got a flicker picture..
> >
> > Agreed. You can just deassert the reset at probe time. That shouldn't
> > interfere with a PWM that is already producing an output.
>
> I think you're saying reset can be a required property, to be
> harmlessly deasserted at probe time? Yixun was suggesting it
> should not be required, because it might already be deasserted.
>
> Anyway, I don't feel strongly either way. Maybe the DTS
> maintainers can recommend what to do.
IMHO you shouldn't have to modify the dts if you want to initialize a
display in the bootloader and than boot flicker-free into Linux.
If the only thing you do with the reset is
devm_reset_control_get_optional_shared_deasserted() (or a variant of
it), everything should work just fine.
I'm not a DTS maintainer, but still have my opinion and recommend that.
:-)
Best regards
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 33+ messages in thread
end of thread, other threads:[~2025-04-16 14:56 UTC | newest]
Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-11 13:14 [PATCH 0/9] pwm: Update PWM_PXA driver for SpacemiT K1 Guodong Xu
2025-04-11 13:14 ` [PATCH 1/9] dt-bindings: pwm: marvell,pxa: add optional property resets Guodong Xu
2025-04-11 16:44 ` Conor Dooley
2025-04-15 8:52 ` Philipp Zabel
2025-04-15 9:54 ` Guodong Xu
2025-04-15 10:12 ` Yixun Lan
2025-04-15 12:11 ` Alex Elder
2025-04-15 12:28 ` Yixun Lan
2025-04-16 5:18 ` Uwe Kleine-König
2025-04-16 11:33 ` Alex Elder
2025-04-16 14:56 ` Uwe Kleine-König
2025-04-11 13:14 ` [PATCH 2/9] pwm: pxa: add optional reset control Guodong Xu
2025-04-11 13:14 ` [PATCH 3/9] dt-bindings: pwm: marvell,pxa: add support to spacemit K1 Guodong Xu
2025-04-11 16:43 ` Conor Dooley
2025-04-12 4:00 ` Guodong Xu
2025-04-11 13:14 ` [PATCH 4/9] pwm: pxa: add support for " Guodong Xu
2025-04-11 13:14 ` [PATCH 5/9] riscv: dts: spacemit: add PWM support for K1 SoC Guodong Xu
2025-04-11 13:14 ` [PATCH 6/9] riscv: dts: spacemit: Add pinctrl configurations for PWM0-PWM19 Guodong Xu
2025-04-11 22:50 ` Inochi Amaoto
2025-04-14 16:42 ` Samuel Holland
2025-04-11 13:14 ` [PATCH 7/9] riscv: dts: spacemit: Add PWM14 backlight support for BPI-F3 Guodong Xu
2025-04-11 14:05 ` Yixun Lan
2025-04-11 14:23 ` Alex Elder
2025-04-11 14:45 ` Yixun Lan
2025-04-11 23:28 ` Inochi Amaoto
2025-04-12 4:22 ` Guodong Xu
2025-04-11 22:54 ` Inochi Amaoto
2025-04-14 5:58 ` Uwe Kleine-König
2025-04-14 8:03 ` Yixun Lan
2025-04-11 13:14 ` [PATCH 8/9] pwm: Kconfig: add depends on ARCH_SPACEMIT to PWM_PXA Guodong Xu
2025-04-11 13:14 ` [PATCH 9/9] riscv: defconfig: Enable PWM support for SpacemiT K1 SoC Guodong Xu
2025-04-11 22:52 ` Inochi Amaoto
2025-04-12 4:02 ` Guodong Xu
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).