* [PATCH v3 0/6] pwm: Update PWM_PXA driver for SpacemiT K1
@ 2025-04-29 8:50 Guodong Xu
2025-04-29 8:50 ` [PATCH v3 1/6] dt-bindings: pwm: marvell,pxa-pwm: Add SpacemiT K1 PWM support Guodong Xu
` (8 more replies)
0 siblings, 9 replies; 21+ messages in thread
From: Guodong Xu @ 2025-04-29 8:50 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, heikki.krogerus
Cc: elder, linux-pwm, devicetree, linux-kernel, linux-riscv, spacemit,
guodong
This patchset adds support for the SpacemiT K1 SoC in the PWM_PXA driver
and updates related device tree bindings. The changes enable PWM
functionality on the K1 platform through driver enhancements,
configuration updates, and device tree additions.
Functionality has been verified on the Banana Pi BPI-F3 board using PWM14,
configured as a pwm-backlight. Per community feedback, the actual
pwm-backlight node is not included in this patchset but can be found in
patch 7 of the v1 series, with modification of pwms property to 4-cell
format to match updated binding (#pwm-cells = <3>) since v3.
+ pwms = <&pwm14 0 2000 0>;
This patchset is based on [spacemit/for-next]
base: https://github.com/spacemit-com/linux for-next
Plus the following dependencies:
1. Clock controller driver, posted by Heylen Chu (v8), with most of it has
been accepted:
https://lore.kernel.org/all/20250416135406.16284-1-heylenay@4d2.org/
2. Reset controller driver, posted by Alex Elder (v5):
https://lore.kernel.org/all/20250418145401.2603648-1-elder@riscstar.com/
Major differences between v3 and v2:
- Patch 1:
- Added: Reviewed-by: Rob Herring (Arm) <robh@kernel.org> # v2.
- When compatible string contains "spacemit,k1-pwm",
#pwm-cells must be 3.
- Patch 2:
- Dropped the addition of a reset_control field to struct pxa_pwm_chip.
- Using a local variable in pwm_probe() instead.
- Patch 3:
- In k1.dtsi, changed #pwm-cells = <1> to <3>.
Major differences between v2 and v1:
- Dropped the addition of spacemit,k1-pwm as a compatible string in the
PWM_PXA driver; instead, it now falls back to marvell,pxa910-pwm.
- Removed pinctrl settings for all PWM nodes (pwm0-pwm14); only the
pwm14_1 configuration is included in this version.
- Changed PWM_PXA from built-in to a loadable module (=m) in the
riscv defconfig.
v2 consists of the following patches:
Patch 1: Add spacemit,k1-pwm compatible string (with fallback to
marvell,pxa910-pwm) and support optional resets property.
Patch 2: Add reset controller support to the PWM_PXA driver.
Patch 3: Add device tree nodes for all 20 PWM instances on K1.
Patch 4: Add pinctrl settings for PWM14.
Patch 5: Add ARCH_SPACEMIT dependency to the PWM_PXA Kconfig entry.
Patch 6: Enable PWM and PWM_PXA in riscv defconfig for SpacemiT K1.
v2:
https://lore.kernel.org/all/20250420070251.378950-1-guodong@riscstar.com/
v1:
https://lore.kernel.org/all/20250411131423.3802611-1-guodong@riscstar.com/
Best regards,
Guodong Xu
Guodong Xu (6):
dt-bindings: pwm: marvell,pxa-pwm: Add SpacemiT K1 PWM support
pwm: pxa: add optional reset control
riscv: dts: spacemit: add PWM support for K1 SoC
riscv: dts: spacemit: add pwm14_1 pinctrl setting
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 | 35 +++-
arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi | 7 +
arch/riscv/boot/dts/spacemit/k1.dtsi | 180 ++++++++++++++++++
arch/riscv/configs/defconfig | 2 +
drivers/pwm/Kconfig | 2 +-
drivers/pwm/pwm-pxa.c | 7 +
6 files changed, 225 insertions(+), 8 deletions(-)
base-commit: cb9c3aeae509b36afbdf46942a7a0a0dfc856ce7
prerequisite-patch-id: a5d2fb43fd88525fa6c8ee767c31adfee87f1012
prerequisite-patch-id: 8a8d0eefd0b4423d87f3c093b451a0fa60622ec4
prerequisite-patch-id: 30f92f93e5b3577bde61424303f21c709a715ec5
prerequisite-patch-id: d774b8281b5c6a822445365ee94925e1ab6c7a93
prerequisite-patch-id: 54a4f5d065eb9f212fd99efec6e7e06abbb9bad8
prerequisite-patch-id: 93962be60d1b58a98d947edf51b4af9edf513785
prerequisite-patch-id: 5f53f8bf16fb067628092daebc4831293261aa01
--
2.43.0
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH v3 1/6] dt-bindings: pwm: marvell,pxa-pwm: Add SpacemiT K1 PWM support
2025-04-29 8:50 [PATCH v3 0/6] pwm: Update PWM_PXA driver for SpacemiT K1 Guodong Xu
@ 2025-04-29 8:50 ` Guodong Xu
2025-04-29 8:50 ` [PATCH v3 2/6] pwm: pxa: add optional reset control Guodong Xu
` (7 subsequent siblings)
8 siblings, 0 replies; 21+ messages in thread
From: Guodong Xu @ 2025-04-29 8:50 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, heikki.krogerus
Cc: elder, linux-pwm, devicetree, linux-kernel, linux-riscv, spacemit,
guodong
The SpacemiT K1 SoC reuses the Marvell PXA910-compatible PWM controller
with one notable difference: the addition of a resets property. To make
the device tree pass schema validation (make dtbs_check W=3), this patch
updates the binding to accept spacemit,k1-pwm as a compatible string, when
used in conjunction with the fallback marvell,pxa910-pwm.
Support for the optional resets property is also added, as it is required
by the K1 integration but was not present in the original Marvell bindings.
Since the PWM reset line may be deasserted during the early bootloader
stage, making the resets property optional avoids potential
double-deassertion, which could otherwise cause flickering on displays
that use PWM for backlight control.
Additionally, this patch adjusts the required value of the #pwm-cells
property for the new compatible string:
- For "spacemit,k1-pwm", #pwm-cells must be set to 3.
- For existing Marvell compatibles, #pwm-cells remains 1.
Background of #pwm-cells change is by an ongoing community discussion
about increasing the #pwm-cells value from 1 to 3 for all Marvell PXA PWM
devices. These devices are currently the only ones whose bindings do not
pass the line index as the first argument. See [1] for further details.
[1] https://lore.kernel.org/all/cover.1738842938.git.u.kleine-koenig@baylibre.com/
Reviewed-by: Rob Herring (Arm) <robh@kernel.org> # v2
Signed-off-by: Guodong Xu <guodong@riscstar.com>
---
v3: When compatible string contains "spacemit,k1-pwm", #pwm-cells must be 3
Added Reviewed-by: Rob Herring (Arm) <robh@kernel.org> # v2
v2: Accept spacemit,k1-pwm as a compatible string, when used in conjunction
with the fallback marvell,pxa910-pwm
.../bindings/pwm/marvell,pxa-pwm.yaml | 35 +++++++++++++++----
1 file changed, 28 insertions(+), 7 deletions(-)
diff --git a/Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml b/Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml
index 9ee1946dc2e1..8df327e52810 100644
--- a/Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml
+++ b/Documentation/devicetree/bindings/pwm/marvell,pxa-pwm.yaml
@@ -11,26 +11,47 @@ maintainers:
allOf:
- $ref: pwm.yaml#
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: spacemit,k1-pwm
+ then:
+ properties:
+ "#pwm-cells":
+ const: 3
+ else:
+ properties:
+ "#pwm-cells":
+ const: 1
+ description: |
+ Used for specifying the period length in nanoseconds.
properties:
compatible:
- enum:
- - marvell,pxa250-pwm
- - marvell,pxa270-pwm
- - marvell,pxa168-pwm
- - marvell,pxa910-pwm
+ oneOf:
+ - enum:
+ - marvell,pxa250-pwm
+ - marvell,pxa270-pwm
+ - marvell,pxa168-pwm
+ - marvell,pxa910-pwm
+ - items:
+ - const: spacemit,k1-pwm
+ - const: marvell,pxa910-pwm
reg:
# Length should be 0x10
maxItems: 1
"#pwm-cells":
- # Used for specifying the period length in nanoseconds
- const: 1
+ description: Number of cells in a pwm specifier.
clocks:
maxItems: 1
+ resets:
+ maxItems: 1
+
required:
- compatible
- reg
--
2.43.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v3 2/6] pwm: pxa: add optional reset control
2025-04-29 8:50 [PATCH v3 0/6] pwm: Update PWM_PXA driver for SpacemiT K1 Guodong Xu
2025-04-29 8:50 ` [PATCH v3 1/6] dt-bindings: pwm: marvell,pxa-pwm: Add SpacemiT K1 PWM support Guodong Xu
@ 2025-04-29 8:50 ` Guodong Xu
2025-04-29 8:50 ` [PATCH v3 3/6] riscv: dts: spacemit: add PWM support for K1 SoC Guodong Xu
` (6 subsequent siblings)
8 siblings, 0 replies; 21+ messages in thread
From: Guodong Xu @ 2025-04-29 8:50 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, heikki.krogerus
Cc: elder, linux-pwm, devicetree, linux-kernel, linux-riscv, spacemit,
guodong
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>
---
v3: Dropped the addition of a reset_control field to the struct pxa_pwm_chip
Using a local variable for reset in pwm_probe() instead
v2: No change
drivers/pwm/pwm-pxa.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/pwm/pwm-pxa.c b/drivers/pwm/pwm-pxa.c
index 430bd6a709e9..f6a862531601 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>
@@ -160,6 +161,7 @@ static int pwm_probe(struct platform_device *pdev)
const struct platform_device_id *id = platform_get_device_id(pdev);
struct pwm_chip *chip;
struct pxa_pwm_chip *pc;
+ struct reset_control *rst;
int ret = 0;
if (IS_ENABLED(CONFIG_OF) && id == NULL)
@@ -179,6 +181,11 @@ static int pwm_probe(struct platform_device *pdev)
if (IS_ERR(pc->clk))
return PTR_ERR(pc->clk);
+ rst = devm_reset_control_get_optional_exclusive_deasserted(&pdev->dev,
+ NULL);
+ if (IS_ERR(rst))
+ return PTR_ERR(rst);
+
chip->ops = &pxa_pwm_ops;
if (IS_ENABLED(CONFIG_OF))
--
2.43.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v3 3/6] riscv: dts: spacemit: add PWM support for K1 SoC
2025-04-29 8:50 [PATCH v3 0/6] pwm: Update PWM_PXA driver for SpacemiT K1 Guodong Xu
2025-04-29 8:50 ` [PATCH v3 1/6] dt-bindings: pwm: marvell,pxa-pwm: Add SpacemiT K1 PWM support Guodong Xu
2025-04-29 8:50 ` [PATCH v3 2/6] pwm: pxa: add optional reset control Guodong Xu
@ 2025-04-29 8:50 ` Guodong Xu
2025-04-29 8:50 ` [PATCH v3 4/6] riscv: dts: spacemit: add pwm14_1 pinctrl setting Guodong Xu
` (5 subsequent siblings)
8 siblings, 0 replies; 21+ messages in thread
From: Guodong Xu @ 2025-04-29 8:50 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, heikki.krogerus
Cc: elder, linux-pwm, devicetree, linux-kernel, linux-riscv, spacemit,
guodong
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>
---
v3: Changed #pwm-cells from <1> to <3>
v2: Changed compatible string with the fallback marvell,pxa910-pwm
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 f4afb35dc6bc..99bf7a3f5458 100644
--- a/arch/riscv/boot/dts/spacemit/k1.dtsi
+++ b/arch/riscv/boot/dts/spacemit/k1.dtsi
@@ -580,5 +580,185 @@ sec_uart1: serial@f0612000 {
reg-io-width = <4>;
status = "reserved"; /* for TEE usage */
};
+
+ pwm0: pwm@d401a000 {
+ compatible = "spacemit,k1-pwm", "marvell,pxa910-pwm";
+ reg = <0x0 0xd401a000 0x0 0x10>;
+ #pwm-cells = <3>;
+ clocks = <&syscon_apbc CLK_PWM0>;
+ resets = <&syscon_apbc RESET_PWM0>;
+ status = "disabled";
+ };
+
+ pwm1: pwm@d401a400 {
+ compatible = "spacemit,k1-pwm", "marvell,pxa910-pwm";
+ reg = <0x0 0xd401a400 0x0 0x10>;
+ #pwm-cells = <3>;
+ clocks = <&syscon_apbc CLK_PWM1>;
+ resets = <&syscon_apbc RESET_PWM1>;
+ status = "disabled";
+ };
+
+ pwm2: pwm@d401a800 {
+ compatible = "spacemit,k1-pwm", "marvell,pxa910-pwm";
+ reg = <0x0 0xd401a800 0x0 0x10>;
+ #pwm-cells = <3>;
+ clocks = <&syscon_apbc CLK_PWM2>;
+ resets = <&syscon_apbc RESET_PWM2>;
+ status = "disabled";
+ };
+
+ pwm3: pwm@d401ac00 {
+ compatible = "spacemit,k1-pwm", "marvell,pxa910-pwm";
+ reg = <0x0 0xd401ac00 0x0 0x10>;
+ #pwm-cells = <3>;
+ clocks = <&syscon_apbc CLK_PWM3>;
+ resets = <&syscon_apbc RESET_PWM3>;
+ status = "disabled";
+ };
+
+ pwm4: pwm@d401b000 {
+ compatible = "spacemit,k1-pwm", "marvell,pxa910-pwm";
+ reg = <0x0 0xd401b000 0x0 0x10>;
+ #pwm-cells = <3>;
+ clocks = <&syscon_apbc CLK_PWM4>;
+ resets = <&syscon_apbc RESET_PWM4>;
+ status = "disabled";
+ };
+
+ pwm5: pwm@d401b400 {
+ compatible = "spacemit,k1-pwm", "marvell,pxa910-pwm";
+ reg = <0x0 0xd401b400 0x0 0x10>;
+ #pwm-cells = <3>;
+ clocks = <&syscon_apbc CLK_PWM5>;
+ resets = <&syscon_apbc RESET_PWM5>;
+ status = "disabled";
+ };
+
+ pwm6: pwm@d401b800 {
+ compatible = "spacemit,k1-pwm", "marvell,pxa910-pwm";
+ reg = <0x0 0xd401b800 0x0 0x10>;
+ #pwm-cells = <3>;
+ clocks = <&syscon_apbc CLK_PWM6>;
+ resets = <&syscon_apbc RESET_PWM6>;
+ status = "disabled";
+ };
+
+ pwm7: pwm@d401bc00 {
+ compatible = "spacemit,k1-pwm", "marvell,pxa910-pwm";
+ reg = <0x0 0xd401bc00 0x0 0x10>;
+ #pwm-cells = <3>;
+ clocks = <&syscon_apbc CLK_PWM7>;
+ resets = <&syscon_apbc RESET_PWM7>;
+ status = "disabled";
+ };
+
+ pwm8: pwm@d4020000 {
+ compatible = "spacemit,k1-pwm", "marvell,pxa910-pwm";
+ reg = <0x0 0xd4020000 0x0 0x10>;
+ #pwm-cells = <3>;
+ clocks = <&syscon_apbc CLK_PWM8>;
+ resets = <&syscon_apbc RESET_PWM8>;
+ status = "disabled";
+ };
+
+ pwm9: pwm@d4020400 {
+ compatible = "spacemit,k1-pwm", "marvell,pxa910-pwm";
+ reg = <0x0 0xd4020400 0x0 0x10>;
+ #pwm-cells = <3>;
+ clocks = <&syscon_apbc CLK_PWM9>;
+ resets = <&syscon_apbc RESET_PWM9>;
+ status = "disabled";
+ };
+
+ pwm10: pwm@d4020800 {
+ compatible = "spacemit,k1-pwm", "marvell,pxa910-pwm";
+ reg = <0x0 0xd4020800 0x0 0x10>;
+ #pwm-cells = <3>;
+ clocks = <&syscon_apbc CLK_PWM10>;
+ resets = <&syscon_apbc RESET_PWM10>;
+ status = "disabled";
+ };
+
+ pwm11: pwm@d4020c00 {
+ compatible = "spacemit,k1-pwm", "marvell,pxa910-pwm";
+ reg = <0x0 0xd4020c00 0x0 0x10>;
+ #pwm-cells = <3>;
+ clocks = <&syscon_apbc CLK_PWM11>;
+ resets = <&syscon_apbc RESET_PWM11>;
+ status = "disabled";
+ };
+
+ pwm12: pwm@d4021000 {
+ compatible = "spacemit,k1-pwm", "marvell,pxa910-pwm";
+ reg = <0x0 0xd4021000 0x0 0x10>;
+ #pwm-cells = <3>;
+ clocks = <&syscon_apbc CLK_PWM12>;
+ resets = <&syscon_apbc RESET_PWM12>;
+ status = "disabled";
+ };
+
+ pwm13: pwm@d4021400 {
+ compatible = "spacemit,k1-pwm", "marvell,pxa910-pwm";
+ reg = <0x0 0xd4021400 0x0 0x10>;
+ #pwm-cells = <3>;
+ clocks = <&syscon_apbc CLK_PWM13>;
+ resets = <&syscon_apbc RESET_PWM13>;
+ status = "disabled";
+ };
+
+ pwm14: pwm@d4021800 {
+ compatible = "spacemit,k1-pwm", "marvell,pxa910-pwm";
+ reg = <0x0 0xd4021800 0x0 0x10>;
+ #pwm-cells = <3>;
+ clocks = <&syscon_apbc CLK_PWM14>;
+ resets = <&syscon_apbc RESET_PWM14>;
+ status = "disabled";
+ };
+
+ pwm15: pwm@d4021c00 {
+ compatible = "spacemit,k1-pwm", "marvell,pxa910-pwm";
+ reg = <0x0 0xd4021c00 0x0 0x10>;
+ #pwm-cells = <3>;
+ clocks = <&syscon_apbc CLK_PWM15>;
+ resets = <&syscon_apbc RESET_PWM15>;
+ status = "disabled";
+ };
+
+ pwm16: pwm@d4022000 {
+ compatible = "spacemit,k1-pwm", "marvell,pxa910-pwm";
+ reg = <0x0 0xd4022000 0x0 0x10>;
+ #pwm-cells = <3>;
+ clocks = <&syscon_apbc CLK_PWM16>;
+ resets = <&syscon_apbc RESET_PWM16>;
+ status = "disabled";
+ };
+
+ pwm17: pwm@d4022400 {
+ compatible = "spacemit,k1-pwm", "marvell,pxa910-pwm";
+ reg = <0x0 0xd4022400 0x0 0x10>;
+ #pwm-cells = <3>;
+ clocks = <&syscon_apbc CLK_PWM17>;
+ resets = <&syscon_apbc RESET_PWM17>;
+ status = "disabled";
+ };
+
+ pwm18: pwm@d4022800 {
+ compatible = "spacemit,k1-pwm", "marvell,pxa910-pwm";
+ reg = <0x0 0xd4022800 0x0 0x10>;
+ #pwm-cells = <3>;
+ clocks = <&syscon_apbc CLK_PWM18>;
+ resets = <&syscon_apbc RESET_PWM18>;
+ status = "disabled";
+ };
+
+ pwm19: pwm@d4022c00 {
+ compatible = "spacemit,k1-pwm", "marvell,pxa910-pwm";
+ reg = <0x0 0xd4022c00 0x0 0x10>;
+ #pwm-cells = <3>;
+ clocks = <&syscon_apbc CLK_PWM19>;
+ resets = <&syscon_apbc RESET_PWM19>;
+ status = "disabled";
+ };
};
};
--
2.43.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v3 4/6] riscv: dts: spacemit: add pwm14_1 pinctrl setting
2025-04-29 8:50 [PATCH v3 0/6] pwm: Update PWM_PXA driver for SpacemiT K1 Guodong Xu
` (2 preceding siblings ...)
2025-04-29 8:50 ` [PATCH v3 3/6] riscv: dts: spacemit: add PWM support for K1 SoC Guodong Xu
@ 2025-04-29 8:50 ` Guodong Xu
2025-05-26 16:54 ` Uwe Kleine-König
2025-04-29 8:50 ` [PATCH v3 5/6] pwm: Kconfig: add depends on ARCH_SPACEMIT to PWM_PXA Guodong Xu
` (4 subsequent siblings)
8 siblings, 1 reply; 21+ messages in thread
From: Guodong Xu @ 2025-04-29 8:50 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, heikki.krogerus
Cc: elder, linux-pwm, devicetree, linux-kernel, linux-riscv, spacemit,
guodong
This patch adds the option 1 (hence the name pwm14_1) pinctrl
configuration for PWM14 on the SpacemiT K1 SoC.
PWM14 option 1 is used for PWM-based backlight control on MIPI displays.
This configuration is present on all existing K1 development boards,
such as the Banana Pi BPI-F3 and the Milk-V Jupiter.
For reference, a more complete list of PWM0-PWM19 pinctrl configurations
including all options can be found in [1].
Note: Since the corresponding functionality for other pins is not yet
in use or ready for upstreaming, this patch includes only the pwm14_1
setting.
[1] https://lore.kernel.org/all/20250411131423.3802611-7-guodong@riscstar.com/
Signed-off-by: Guodong Xu <guodong@riscstar.com>
---
v3: No change
v2: Discard pwm0-pwm19 pinctrl configurations, and adds only pwm14_1_cfg
arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi b/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi
index 283663647a86..195eb8874f3c 100644
--- a/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi
+++ b/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi
@@ -20,4 +20,11 @@ uart0-2-pins {
drive-strength = <32>;
};
};
+ pwm14_1_cfg: pwm14-1-cfg {
+ pwm14-1-pins {
+ pinmux = <K1_PADCONF(44, 4)>;
+ bias-pull-up = <0>;
+ drive-strength = <32>;
+ };
+ };
};
--
2.43.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v3 5/6] pwm: Kconfig: add depends on ARCH_SPACEMIT to PWM_PXA
2025-04-29 8:50 [PATCH v3 0/6] pwm: Update PWM_PXA driver for SpacemiT K1 Guodong Xu
` (3 preceding siblings ...)
2025-04-29 8:50 ` [PATCH v3 4/6] riscv: dts: spacemit: add pwm14_1 pinctrl setting Guodong Xu
@ 2025-04-29 8:50 ` Guodong Xu
2025-04-29 8:50 ` [PATCH v3 6/6] riscv: defconfig: Enable PWM support for SpacemiT K1 SoC Guodong Xu
` (3 subsequent siblings)
8 siblings, 0 replies; 21+ messages in thread
From: Guodong Xu @ 2025-04-29 8:50 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, heikki.krogerus
Cc: elder, linux-pwm, devicetree, linux-kernel, linux-riscv, spacemit,
guodong
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>
---
v3: No change
v2: No change
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] 21+ messages in thread
* [PATCH v3 6/6] riscv: defconfig: Enable PWM support for SpacemiT K1 SoC
2025-04-29 8:50 [PATCH v3 0/6] pwm: Update PWM_PXA driver for SpacemiT K1 Guodong Xu
` (4 preceding siblings ...)
2025-04-29 8:50 ` [PATCH v3 5/6] pwm: Kconfig: add depends on ARCH_SPACEMIT to PWM_PXA Guodong Xu
@ 2025-04-29 8:50 ` Guodong Xu
2025-07-07 22:29 ` Yixun Lan
2025-05-14 7:21 ` [PATCH v3 0/6] pwm: Update PWM_PXA driver for SpacemiT K1 Guodong Xu
` (2 subsequent siblings)
8 siblings, 1 reply; 21+ messages in thread
From: Guodong Xu @ 2025-04-29 8:50 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, heikki.krogerus
Cc: elder, linux-pwm, devicetree, linux-kernel, linux-riscv, spacemit,
guodong
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>
---
v3: No change
v2: Changed PWM_PXA from built-in to a loadable module (=m)
arch/riscv/configs/defconfig | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/riscv/configs/defconfig b/arch/riscv/configs/defconfig
index 3c8e16d71e17..3c4d9bb8f01e 100644
--- a/arch/riscv/configs/defconfig
+++ b/arch/riscv/configs/defconfig
@@ -257,6 +257,8 @@ CONFIG_RPMSG_CTRL=y
CONFIG_RPMSG_VIRTIO=y
CONFIG_PM_DEVFREQ=y
CONFIG_IIO=y
+CONFIG_PWM=y
+CONFIG_PWM_PXA=m
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] 21+ messages in thread
* Re: [PATCH v3 0/6] pwm: Update PWM_PXA driver for SpacemiT K1
2025-04-29 8:50 [PATCH v3 0/6] pwm: Update PWM_PXA driver for SpacemiT K1 Guodong Xu
` (5 preceding siblings ...)
2025-04-29 8:50 ` [PATCH v3 6/6] riscv: defconfig: Enable PWM support for SpacemiT K1 SoC Guodong Xu
@ 2025-05-14 7:21 ` Guodong Xu
2025-05-26 17:22 ` Uwe Kleine-König
2025-07-08 14:33 ` (subset) " Yixun Lan
8 siblings, 0 replies; 21+ messages in thread
From: Guodong Xu @ 2025-05-14 7:21 UTC (permalink / raw)
To: Uwe Kleine-König, Rob Herring, Krzysztof Kozlowski, conor+dt,
Paul Walmsley, Palmer Dabbelt, Albert Ou, alex, Yixun Lan,
Philipp Zabel, drew, Inochi Amaoto, geert+renesas, heylenay, tglx,
hal.feng, unicorn_wang, duje.mihanovic, heikki.krogerus
Cc: Alex Elder, linux-pwm, devicetree, linux-kernel, linux-riscv,
spacemit
Hi, All
On Tue, Apr 29, 2025 at 4:51 PM Guodong Xu <guodong@riscstar.com> wrote:
>
> This patchset adds support for the SpacemiT K1 SoC in the PWM_PXA driver
> and updates related device tree bindings. The changes enable PWM
> functionality on the K1 platform through driver enhancements,
> configuration updates, and device tree additions.
>
Gentle ping, any comments or concerns on this patchset?
Any feedback would be greatly appreciated.
Thanks in advance!
Best regards,
Guodong
> Functionality has been verified on the Banana Pi BPI-F3 board using PWM14,
> configured as a pwm-backlight. Per community feedback, the actual
> pwm-backlight node is not included in this patchset but can be found in
> patch 7 of the v1 series, with modification of pwms property to 4-cell
> format to match updated binding (#pwm-cells = <3>) since v3.
>
> + pwms = <&pwm14 0 2000 0>;
>
> This patchset is based on [spacemit/for-next]
> base: https://github.com/spacemit-com/linux for-next
>
> Plus the following dependencies:
> 1. Clock controller driver, posted by Heylen Chu (v8), with most of it has
> been accepted:
> https://lore.kernel.org/all/20250416135406.16284-1-heylenay@4d2.org/
> 2. Reset controller driver, posted by Alex Elder (v5):
> https://lore.kernel.org/all/20250418145401.2603648-1-elder@riscstar.com/
>
> Major differences between v3 and v2:
> - Patch 1:
> - Added: Reviewed-by: Rob Herring (Arm) <robh@kernel.org> # v2.
> - When compatible string contains "spacemit,k1-pwm",
> #pwm-cells must be 3.
> - Patch 2:
> - Dropped the addition of a reset_control field to struct pxa_pwm_chip.
> - Using a local variable in pwm_probe() instead.
> - Patch 3:
> - In k1.dtsi, changed #pwm-cells = <1> to <3>.
>
> Major differences between v2 and v1:
> - Dropped the addition of spacemit,k1-pwm as a compatible string in the
> PWM_PXA driver; instead, it now falls back to marvell,pxa910-pwm.
> - Removed pinctrl settings for all PWM nodes (pwm0-pwm14); only the
> pwm14_1 configuration is included in this version.
> - Changed PWM_PXA from built-in to a loadable module (=m) in the
> riscv defconfig.
>
> v2 consists of the following patches:
> Patch 1: Add spacemit,k1-pwm compatible string (with fallback to
> marvell,pxa910-pwm) and support optional resets property.
> Patch 2: Add reset controller support to the PWM_PXA driver.
> Patch 3: Add device tree nodes for all 20 PWM instances on K1.
> Patch 4: Add pinctrl settings for PWM14.
> Patch 5: Add ARCH_SPACEMIT dependency to the PWM_PXA Kconfig entry.
> Patch 6: Enable PWM and PWM_PXA in riscv defconfig for SpacemiT K1.
>
> v2:
> https://lore.kernel.org/all/20250420070251.378950-1-guodong@riscstar.com/
>
> v1:
> https://lore.kernel.org/all/20250411131423.3802611-1-guodong@riscstar.com/
>
> Best regards,
> Guodong Xu
>
> Guodong Xu (6):
> dt-bindings: pwm: marvell,pxa-pwm: Add SpacemiT K1 PWM support
> pwm: pxa: add optional reset control
> riscv: dts: spacemit: add PWM support for K1 SoC
> riscv: dts: spacemit: add pwm14_1 pinctrl setting
> 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 | 35 +++-
> arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi | 7 +
> arch/riscv/boot/dts/spacemit/k1.dtsi | 180 ++++++++++++++++++
> arch/riscv/configs/defconfig | 2 +
> drivers/pwm/Kconfig | 2 +-
> drivers/pwm/pwm-pxa.c | 7 +
> 6 files changed, 225 insertions(+), 8 deletions(-)
>
>
> base-commit: cb9c3aeae509b36afbdf46942a7a0a0dfc856ce7
> prerequisite-patch-id: a5d2fb43fd88525fa6c8ee767c31adfee87f1012
> prerequisite-patch-id: 8a8d0eefd0b4423d87f3c093b451a0fa60622ec4
> prerequisite-patch-id: 30f92f93e5b3577bde61424303f21c709a715ec5
> prerequisite-patch-id: d774b8281b5c6a822445365ee94925e1ab6c7a93
> prerequisite-patch-id: 54a4f5d065eb9f212fd99efec6e7e06abbb9bad8
> prerequisite-patch-id: 93962be60d1b58a98d947edf51b4af9edf513785
> prerequisite-patch-id: 5f53f8bf16fb067628092daebc4831293261aa01
> --
> 2.43.0
>
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v3 4/6] riscv: dts: spacemit: add pwm14_1 pinctrl setting
2025-04-29 8:50 ` [PATCH v3 4/6] riscv: dts: spacemit: add pwm14_1 pinctrl setting Guodong Xu
@ 2025-05-26 16:54 ` Uwe Kleine-König
2025-05-26 21:52 ` Yixun Lan
0 siblings, 1 reply; 21+ messages in thread
From: Uwe Kleine-König @ 2025-05-26 16:54 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, heikki.krogerus, elder, linux-pwm,
devicetree, linux-kernel, linux-riscv, spacemit
[-- Attachment #1: Type: text/plain, Size: 641 bytes --]
On Tue, Apr 29, 2025 at 04:50:46PM +0800, Guodong Xu wrote:
> diff --git a/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi b/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi
> index 283663647a86..195eb8874f3c 100644
> --- a/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi
> +++ b/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi
> @@ -20,4 +20,11 @@ uart0-2-pins {
> drive-strength = <32>;
> };
> };
> + pwm14_1_cfg: pwm14-1-cfg {
> + pwm14-1-pins {
> + pinmux = <K1_PADCONF(44, 4)>;
> + bias-pull-up = <0>;
> + drive-strength = <32>;
> + };
> + };
There is a newline expected before the pwm14-1-cfg node, isn't there?
Best regards
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v3 0/6] pwm: Update PWM_PXA driver for SpacemiT K1
2025-04-29 8:50 [PATCH v3 0/6] pwm: Update PWM_PXA driver for SpacemiT K1 Guodong Xu
` (6 preceding siblings ...)
2025-05-14 7:21 ` [PATCH v3 0/6] pwm: Update PWM_PXA driver for SpacemiT K1 Guodong Xu
@ 2025-05-26 17:22 ` Uwe Kleine-König
2025-05-27 2:41 ` Guodong Xu
2025-07-08 14:33 ` (subset) " Yixun Lan
8 siblings, 1 reply; 21+ messages in thread
From: Uwe Kleine-König @ 2025-05-26 17:22 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, heikki.krogerus, elder, linux-pwm,
devicetree, linux-kernel, linux-riscv, spacemit
[-- Attachment #1: Type: text/plain, Size: 2046 bytes --]
Hello,
On Tue, Apr 29, 2025 at 04:50:42PM +0800, Guodong Xu wrote:
> This patchset adds support for the SpacemiT K1 SoC in the PWM_PXA driver
> and updates related device tree bindings. The changes enable PWM
> functionality on the K1 platform through driver enhancements,
> configuration updates, and device tree additions.
>
> Functionality has been verified on the Banana Pi BPI-F3 board using PWM14,
> configured as a pwm-backlight. Per community feedback, the actual
> pwm-backlight node is not included in this patchset but can be found in
> patch 7 of the v1 series, with modification of pwms property to 4-cell
> format to match updated binding (#pwm-cells = <3>) since v3.
>
> + pwms = <&pwm14 0 2000 0>;
>
> This patchset is based on [spacemit/for-next]
> base: https://github.com/spacemit-com/linux for-next
>
> Plus the following dependencies:
> 1. Clock controller driver, posted by Heylen Chu (v8), with most of it has
> been accepted:
> https://lore.kernel.org/all/20250416135406.16284-1-heylenay@4d2.org/
> 2. Reset controller driver, posted by Alex Elder (v5):
> https://lore.kernel.org/all/20250418145401.2603648-1-elder@riscstar.com/
It's not clear to me if I have to look into this github tree and the
listed dependencies. My impression is that it can go in on without these
changes. Maybe it only starts working when these are also applied, but
that shouldn't stop me applying this series, right?
There is a patch in pwm/for-6.16-rc1 (namely commit df08fff8add2 ("pwm:
pxa: Improve using dev_err_probe()")) that conflicts with this series.
I applied patches 1, 2 and 5 on top of my pwm/for-nexxt branch resolving
that conflict and rewording the commit log of patch 5. The result was
pushed to
https://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux.git pwm/pxa-spacemit
. If you confirm that you're happy with my modifications and it's
correct to apply them without the listed dependencies I will add the
patches to my queue for 6.17-rc1.
Best regards
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 484 bytes --]
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v3 4/6] riscv: dts: spacemit: add pwm14_1 pinctrl setting
2025-05-26 16:54 ` Uwe Kleine-König
@ 2025-05-26 21:52 ` Yixun Lan
2025-05-27 2:48 ` Guodong Xu
0 siblings, 1 reply; 21+ messages in thread
From: Yixun Lan @ 2025-05-26 21:52 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, heikki.krogerus, elder,
linux-pwm, devicetree, linux-kernel, linux-riscv, spacemit
Hi Guodong, Uwe,
On 18:54 Mon 26 May , Uwe Kleine-König wrote:
> On Tue, Apr 29, 2025 at 04:50:46PM +0800, Guodong Xu wrote:
> > diff --git a/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi b/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi
> > index 283663647a86..195eb8874f3c 100644
> > --- a/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi
> > +++ b/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi
> > @@ -20,4 +20,11 @@ uart0-2-pins {
> > drive-strength = <32>;
> > };
> > };
> > + pwm14_1_cfg: pwm14-1-cfg {
> > + pwm14-1-pins {
> > + pinmux = <K1_PADCONF(44, 4)>;
> > + bias-pull-up = <0>;
> > + drive-strength = <32>;
> > + };
> > + };
>
> There is a newline expected before the pwm14-1-cfg node, isn't there?
>
Right, I could amend this and fix it while applying this patch
(so if there is no other serious issue, no need to resend)
--
Yixun Lan (dlan)
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v3 0/6] pwm: Update PWM_PXA driver for SpacemiT K1
2025-05-26 17:22 ` Uwe Kleine-König
@ 2025-05-27 2:41 ` Guodong Xu
2025-05-27 9:03 ` Uwe Kleine-König
0 siblings, 1 reply; 21+ messages in thread
From: Guodong Xu @ 2025-05-27 2:41 UTC (permalink / raw)
To: Uwe Kleine-König
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, heikki.krogerus, elder, linux-pwm,
devicetree, linux-kernel, linux-riscv, spacemit
On Tue, May 27, 2025 at 1:22 AM Uwe Kleine-König <ukleinek@kernel.org> wrote:
>
> Hello,
>
> On Tue, Apr 29, 2025 at 04:50:42PM +0800, Guodong Xu wrote:
> > This patchset adds support for the SpacemiT K1 SoC in the PWM_PXA driver
> > and updates related device tree bindings. The changes enable PWM
> > functionality on the K1 platform through driver enhancements,
> > configuration updates, and device tree additions.
> >
> > Functionality has been verified on the Banana Pi BPI-F3 board using PWM14,
> > configured as a pwm-backlight. Per community feedback, the actual
> > pwm-backlight node is not included in this patchset but can be found in
> > patch 7 of the v1 series, with modification of pwms property to 4-cell
> > format to match updated binding (#pwm-cells = <3>) since v3.
> >
> > + pwms = <&pwm14 0 2000 0>;
> >
> > This patchset is based on [spacemit/for-next]
> > base: https://github.com/spacemit-com/linux for-next
> >
> > Plus the following dependencies:
> > 1. Clock controller driver, posted by Heylen Chu (v8), with most of it has
> > been accepted:
> > https://lore.kernel.org/all/20250416135406.16284-1-heylenay@4d2.org/
> > 2. Reset controller driver, posted by Alex Elder (v5):
> > https://lore.kernel.org/all/20250418145401.2603648-1-elder@riscstar.com/
>
> It's not clear to me if I have to look into this github tree and the
> listed dependencies. My impression is that it can go in on without these
> changes. Maybe it only starts working when these are also applied, but
> that shouldn't stop me applying this series, right?
>
Thanks Uwe for the review.
The dependency is in patch 3, where I added the PWM nodes (pwm0-pwm19) to
k1.dtsi. These nodes reference RESET_PWM0 to RESET_PWM19, which are only
defined after applying the spacemit reset patchset (Patch 1/6),
available here:
https://lore.kernel.org/all/20250513215345.3631593-2-elder@riscstar.com/
You're right that patches 1, 2, and 5 do not depend on that reset series
and can be applied independently.
> There is a patch in pwm/for-6.16-rc1 (namely commit df08fff8add2 ("pwm:
> pxa: Improve using dev_err_probe()")) that conflicts with this series.
> I applied patches 1, 2 and 5 on top of my pwm/for-nexxt branch resolving
> that conflict and rewording the commit log of patch 5. The result was
> pushed to
>
> https://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux.git pwm/pxa-spacemit
>
I've reviewed the three patches in pwm/pxa-spacemit, and they look good
to me.
Thanks again for handling the conflict and rewording the commit log.
> . If you confirm that you're happy with my modifications and it's
> correct to apply them without the listed dependencies I will add the
> patches to my queue for 6.17-rc1.
>
Yeah. And I confirm that they can be applied without the reset
dependencies.
Thanks.
BR,
Guodong
> Best regards
> Uwe
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v3 4/6] riscv: dts: spacemit: add pwm14_1 pinctrl setting
2025-05-26 21:52 ` Yixun Lan
@ 2025-05-27 2:48 ` Guodong Xu
2025-05-27 3:27 ` Yixun Lan
0 siblings, 1 reply; 21+ messages in thread
From: Guodong Xu @ 2025-05-27 2:48 UTC (permalink / raw)
To: Yixun Lan, Uwe Kleine-König
Cc: robh, krzk+dt, conor+dt, paul.walmsley, palmer, aou, alex,
p.zabel, drew, inochiama, geert+renesas, heylenay, tglx, hal.feng,
unicorn_wang, duje.mihanovic, heikki.krogerus, elder, linux-pwm,
devicetree, linux-kernel, linux-riscv, spacemit
On Tue, May 27, 2025 at 5:52 AM Yixun Lan <dlan@gentoo.org> wrote:
>
> Hi Guodong, Uwe,
>
> On 18:54 Mon 26 May , Uwe Kleine-König wrote:
> > On Tue, Apr 29, 2025 at 04:50:46PM +0800, Guodong Xu wrote:
> > > diff --git a/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi b/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi
> > > index 283663647a86..195eb8874f3c 100644
> > > --- a/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi
> > > +++ b/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi
> > > @@ -20,4 +20,11 @@ uart0-2-pins {
> > > drive-strength = <32>;
> > > };
> > > };
> > > + pwm14_1_cfg: pwm14-1-cfg {
> > > + pwm14-1-pins {
> > > + pinmux = <K1_PADCONF(44, 4)>;
> > > + bias-pull-up = <0>;
> > > + drive-strength = <32>;
> > > + };
> > > + };
> >
> > There is a newline expected before the pwm14-1-cfg node, isn't there?
> >
> Right, I could amend this and fix it while applying this patch
> (so if there is no other serious issue, no need to resend)
>
Thanks, Yixun.
By the way, do you plan to take patches 3 and 4 of this series into
your tree? They only apply if the SpacemiT reset patchset is applied
first.
BR,
Guodong
> --
> Yixun Lan (dlan)
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v3 4/6] riscv: dts: spacemit: add pwm14_1 pinctrl setting
2025-05-27 2:48 ` Guodong Xu
@ 2025-05-27 3:27 ` Yixun Lan
2025-05-27 4:36 ` Guodong Xu
0 siblings, 1 reply; 21+ messages in thread
From: Yixun Lan @ 2025-05-27 3:27 UTC (permalink / raw)
To: Guodong Xu
Cc: Uwe Kleine-König, robh, krzk+dt, conor+dt, paul.walmsley,
palmer, aou, alex, p.zabel, drew, inochiama, geert+renesas,
heylenay, tglx, hal.feng, unicorn_wang, duje.mihanovic,
heikki.krogerus, elder, linux-pwm, devicetree, linux-kernel,
linux-riscv, spacemit
Hi Guodong,
On 10:48 Tue 27 May , Guodong Xu wrote:
> On Tue, May 27, 2025 at 5:52 AM Yixun Lan <dlan@gentoo.org> wrote:
> >
> > Hi Guodong, Uwe,
> >
> > On 18:54 Mon 26 May , Uwe Kleine-König wrote:
> > > On Tue, Apr 29, 2025 at 04:50:46PM +0800, Guodong Xu wrote:
> > > > diff --git a/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi b/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi
> > > > index 283663647a86..195eb8874f3c 100644
> > > > --- a/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi
> > > > +++ b/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi
> > > > @@ -20,4 +20,11 @@ uart0-2-pins {
> > > > drive-strength = <32>;
> > > > };
> > > > };
> > > > + pwm14_1_cfg: pwm14-1-cfg {
> > > > + pwm14-1-pins {
> > > > + pinmux = <K1_PADCONF(44, 4)>;
> > > > + bias-pull-up = <0>;
> > > > + drive-strength = <32>;
> > > > + };
> > > > + };
> > >
> > > There is a newline expected before the pwm14-1-cfg node, isn't there?
> > >
> > Right, I could amend this and fix it while applying this patch
> > (so if there is no other serious issue, no need to resend)
> >
>
> Thanks, Yixun.
>
> By the way, do you plan to take patches 3 and 4 of this series into
> your tree? They only apply if the SpacemiT reset patchset is applied
> first.
>
Yes, exactly. The dts patch will go through SpacemiT SoC tree, and we
have to wait untill reset patch series applied.
--
Yixun Lan (dlan)
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v3 4/6] riscv: dts: spacemit: add pwm14_1 pinctrl setting
2025-05-27 3:27 ` Yixun Lan
@ 2025-05-27 4:36 ` Guodong Xu
0 siblings, 0 replies; 21+ messages in thread
From: Guodong Xu @ 2025-05-27 4:36 UTC (permalink / raw)
To: Yixun Lan
Cc: Uwe Kleine-König, robh, krzk+dt, conor+dt, paul.walmsley,
palmer, aou, alex, p.zabel, drew, inochiama, geert+renesas,
heylenay, tglx, hal.feng, unicorn_wang, duje.mihanovic,
heikki.krogerus, elder, linux-pwm, devicetree, linux-kernel,
linux-riscv, spacemit
On Tue, May 27, 2025 at 11:27 AM Yixun Lan <dlan@gentoo.org> wrote:
>
> Hi Guodong,
>
> On 10:48 Tue 27 May , Guodong Xu wrote:
> > On Tue, May 27, 2025 at 5:52 AM Yixun Lan <dlan@gentoo.org> wrote:
> > >
> > > Hi Guodong, Uwe,
> > >
> > > On 18:54 Mon 26 May , Uwe Kleine-König wrote:
> > > > On Tue, Apr 29, 2025 at 04:50:46PM +0800, Guodong Xu wrote:
> > > > > diff --git a/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi b/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi
> > > > > index 283663647a86..195eb8874f3c 100644
> > > > > --- a/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi
> > > > > +++ b/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi
> > > > > @@ -20,4 +20,11 @@ uart0-2-pins {
> > > > > drive-strength = <32>;
> > > > > };
> > > > > };
> > > > > + pwm14_1_cfg: pwm14-1-cfg {
> > > > > + pwm14-1-pins {
> > > > > + pinmux = <K1_PADCONF(44, 4)>;
> > > > > + bias-pull-up = <0>;
> > > > > + drive-strength = <32>;
> > > > > + };
> > > > > + };
> > > >
> > > > There is a newline expected before the pwm14-1-cfg node, isn't there?
> > > >
> > > Right, I could amend this and fix it while applying this patch
> > > (so if there is no other serious issue, no need to resend)
> > >
> >
> > Thanks, Yixun.
> >
> > By the way, do you plan to take patches 3 and 4 of this series into
> > your tree? They only apply if the SpacemiT reset patchset is applied
> > first.
> >
> Yes, exactly. The dts patch will go through SpacemiT SoC tree, and we
> have to wait untill reset patch series applied.
>
Appreciate you taking care of this, and thanks for the update.
> --
> Yixun Lan (dlan)
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v3 0/6] pwm: Update PWM_PXA driver for SpacemiT K1
2025-05-27 2:41 ` Guodong Xu
@ 2025-05-27 9:03 ` Uwe Kleine-König
0 siblings, 0 replies; 21+ messages in thread
From: Uwe Kleine-König @ 2025-05-27 9:03 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, heikki.krogerus, elder, linux-pwm,
devicetree, linux-kernel, linux-riscv, spacemit
[-- Attachment #1: Type: text/plain, Size: 545 bytes --]
Hello Guodong,
On Tue, May 27, 2025 at 10:41:20AM +0800, Guodong Xu wrote:
> You're right that patches 1, 2, and 5 do not depend on that reset series
> and can be applied independently.
>
> > [...]
>
> Yeah. And I confirm that they can be applied without the reset
> dependencies.
Thanks for the confirmation, pushed as is to
https://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux.git pwm/for-nexxt
(i.e. as material for the 6.17-rc1 merge window as the PWM PR for
6.16-rc1 is already sent).
Best regards
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v3 6/6] riscv: defconfig: Enable PWM support for SpacemiT K1 SoC
2025-04-29 8:50 ` [PATCH v3 6/6] riscv: defconfig: Enable PWM support for SpacemiT K1 SoC Guodong Xu
@ 2025-07-07 22:29 ` Yixun Lan
2025-07-08 16:50 ` Conor Dooley
0 siblings, 1 reply; 21+ messages in thread
From: Yixun Lan @ 2025-07-07 22:29 UTC (permalink / raw)
To: Conor Dooley
Cc: Guodong Xu, ukleinek, robh, krzk+dt, paul.walmsley, palmer, aou,
alex, p.zabel, drew, inochiama, geert+renesas, heylenay, tglx,
hal.feng, unicorn_wang, duje.mihanovic, heikki.krogerus, elder,
linux-pwm, devicetree, linux-kernel, linux-riscv, spacemit
Hi Conor,
Can you take this patch? I've checked with riscv's tree for-next
branch, it's still applicable and meet the "savedefconfig" criteria.
Thanks
On 16:50 Tue 29 Apr , 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>
Reviewed-by: Yixun Lan <dlan@gentoo.org>
> ---
> v3: No change
> v2: Changed PWM_PXA from built-in to a loadable module (=m)
>
> arch/riscv/configs/defconfig | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/riscv/configs/defconfig b/arch/riscv/configs/defconfig
> index 3c8e16d71e17..3c4d9bb8f01e 100644
> --- a/arch/riscv/configs/defconfig
> +++ b/arch/riscv/configs/defconfig
> @@ -257,6 +257,8 @@ CONFIG_RPMSG_CTRL=y
> CONFIG_RPMSG_VIRTIO=y
> CONFIG_PM_DEVFREQ=y
> CONFIG_IIO=y
> +CONFIG_PWM=y
> +CONFIG_PWM_PXA=m
> CONFIG_THEAD_C900_ACLINT_SSWI=y
> CONFIG_PHY_SUN4I_USB=m
> CONFIG_PHY_STARFIVE_JH7110_DPHY_RX=m
> --
> 2.43.0
>
--
Yixun Lan (dlan)
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: (subset) [PATCH v3 0/6] pwm: Update PWM_PXA driver for SpacemiT K1
2025-04-29 8:50 [PATCH v3 0/6] pwm: Update PWM_PXA driver for SpacemiT K1 Guodong Xu
` (7 preceding siblings ...)
2025-05-26 17:22 ` Uwe Kleine-König
@ 2025-07-08 14:33 ` Yixun Lan
2025-07-09 6:37 ` Yixun Lan
8 siblings, 1 reply; 21+ messages in thread
From: Yixun Lan @ 2025-07-08 14:33 UTC (permalink / raw)
To: 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, heikki.krogerus,
Guodong Xu
Cc: Yixun Lan, elder, linux-pwm, devicetree, linux-kernel,
linux-riscv, spacemit
On Tue, 29 Apr 2025 16:50:42 +0800, Guodong Xu wrote:
> This patchset adds support for the SpacemiT K1 SoC in the PWM_PXA driver
> and updates related device tree bindings. The changes enable PWM
> functionality on the K1 platform through driver enhancements,
> configuration updates, and device tree additions.
>
> Functionality has been verified on the Banana Pi BPI-F3 board using PWM14,
> configured as a pwm-backlight. Per community feedback, the actual
> pwm-backlight node is not included in this patchset but can be found in
> patch 7 of the v1 series, with modification of pwms property to 4-cell
> format to match updated binding (#pwm-cells = <3>) since v3.
>
> [...]
Applied, thanks!
[3/6] riscv: dts: spacemit: add PWM support for K1 SoC
https://github.com/spacemit-com/linux/commit/9aebdfc21f755e0d2766683aa251435fb656ea47
[4/6] riscv: dts: spacemit: add pwm14_1 pinctrl setting
https://github.com/spacemit-com/linux/commit/8709d51024068d4c81dc785d63169d283d147cf3
Best regards,
--
Yixun Lan
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v3 6/6] riscv: defconfig: Enable PWM support for SpacemiT K1 SoC
2025-07-07 22:29 ` Yixun Lan
@ 2025-07-08 16:50 ` Conor Dooley
0 siblings, 0 replies; 21+ messages in thread
From: Conor Dooley @ 2025-07-08 16:50 UTC (permalink / raw)
To: Yixun Lan
Cc: Guodong Xu, ukleinek, robh, krzk+dt, paul.walmsley, palmer, aou,
alex, p.zabel, drew, inochiama, geert+renesas, heylenay, tglx,
hal.feng, unicorn_wang, duje.mihanovic, heikki.krogerus, elder,
linux-pwm, devicetree, linux-kernel, linux-riscv, spacemit
[-- Attachment #1: Type: text/plain, Size: 224 bytes --]
On Mon, Jul 07, 2025 at 10:29:10PM +0000, Yixun Lan wrote:
> Hi Conor,
> Can you take this patch? I've checked with riscv's tree for-next
> branch, it's still applicable and meet the "savedefconfig" criteria.
Sure, done.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: (subset) [PATCH v3 0/6] pwm: Update PWM_PXA driver for SpacemiT K1
2025-07-08 14:33 ` (subset) " Yixun Lan
@ 2025-07-09 6:37 ` Yixun Lan
2025-07-10 6:33 ` Guodong Xu
0 siblings, 1 reply; 21+ messages in thread
From: Yixun Lan @ 2025-07-09 6:37 UTC (permalink / raw)
To: 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, heikki.krogerus,
Guodong Xu
Cc: elder, linux-pwm, devicetree, linux-kernel, linux-riscv, spacemit
Hi Guodong,
On 22:33 Tue 08 Jul , Yixun Lan wrote:
>
> On Tue, 29 Apr 2025 16:50:42 +0800, Guodong Xu wrote:
> > This patchset adds support for the SpacemiT K1 SoC in the PWM_PXA driver
> > and updates related device tree bindings. The changes enable PWM
> > functionality on the K1 platform through driver enhancements,
> > configuration updates, and device tree additions.
> >
> > Functionality has been verified on the Banana Pi BPI-F3 board using PWM14,
> > configured as a pwm-backlight. Per community feedback, the actual
> > pwm-backlight node is not included in this patchset but can be found in
> > patch 7 of the v1 series, with modification of pwms property to 4-cell
> > format to match updated binding (#pwm-cells = <3>) since v3.
> >
> > [...]
>
> Applied, thanks!
>
> [3/6] riscv: dts: spacemit: add PWM support for K1 SoC
> https://github.com/spacemit-com/linux/commit/9aebdfc21f755e0d2766683aa251435fb656ea47
found have to re-arrange the nodes according to ascending order of unit address,
so here is new version I've pushed, just FYI, please check (should have
no functionality changes)
https://github.com/spacemit-com/linux/commit/66f56c7a64213948341521b5310064586a05c80e
> [4/6] riscv: dts: spacemit: add pwm14_1 pinctrl setting
> https://github.com/spacemit-com/linux/commit/8709d51024068d4c81dc785d63169d283d147cf3
--
Yixun Lan (dlan)
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: (subset) [PATCH v3 0/6] pwm: Update PWM_PXA driver for SpacemiT K1
2025-07-09 6:37 ` Yixun Lan
@ 2025-07-10 6:33 ` Guodong Xu
0 siblings, 0 replies; 21+ messages in thread
From: Guodong Xu @ 2025-07-10 6:33 UTC (permalink / raw)
To: Yixun Lan
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, heikki.krogerus, elder,
linux-pwm, devicetree, linux-kernel, linux-riscv, spacemit
On Wed, Jul 9, 2025 at 2:37 PM Yixun Lan <dlan@gentoo.org> wrote:
>
> Hi Guodong,
>
> On 22:33 Tue 08 Jul , Yixun Lan wrote:
> >
> > On Tue, 29 Apr 2025 16:50:42 +0800, Guodong Xu wrote:
> > > This patchset adds support for the SpacemiT K1 SoC in the PWM_PXA driver
> > > and updates related device tree bindings. The changes enable PWM
> > > functionality on the K1 platform through driver enhancements,
> > > configuration updates, and device tree additions.
> > >
> > > Functionality has been verified on the Banana Pi BPI-F3 board using PWM14,
> > > configured as a pwm-backlight. Per community feedback, the actual
> > > pwm-backlight node is not included in this patchset but can be found in
> > > patch 7 of the v1 series, with modification of pwms property to 4-cell
> > > format to match updated binding (#pwm-cells = <3>) since v3.
> > >
> > > [...]
> >
> > Applied, thanks!
> >
> > [3/6] riscv: dts: spacemit: add PWM support for K1 SoC
> > https://github.com/spacemit-com/linux/commit/9aebdfc21f755e0d2766683aa251435fb656ea47
>
> found have to re-arrange the nodes according to ascending order of unit address,
> so here is new version I've pushed, just FYI, please check (should have
> no functionality changes)
> https://github.com/spacemit-com/linux/commit/66f56c7a64213948341521b5310064586a05c80e
Looks good. Thanks Yixun.
>
> > [4/6] riscv: dts: spacemit: add pwm14_1 pinctrl setting
> > https://github.com/spacemit-com/linux/commit/8709d51024068d4c81dc785d63169d283d147cf3
>
> --
> Yixun Lan (dlan)
^ permalink raw reply [flat|nested] 21+ messages in thread
end of thread, other threads:[~2025-07-10 6:33 UTC | newest]
Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-29 8:50 [PATCH v3 0/6] pwm: Update PWM_PXA driver for SpacemiT K1 Guodong Xu
2025-04-29 8:50 ` [PATCH v3 1/6] dt-bindings: pwm: marvell,pxa-pwm: Add SpacemiT K1 PWM support Guodong Xu
2025-04-29 8:50 ` [PATCH v3 2/6] pwm: pxa: add optional reset control Guodong Xu
2025-04-29 8:50 ` [PATCH v3 3/6] riscv: dts: spacemit: add PWM support for K1 SoC Guodong Xu
2025-04-29 8:50 ` [PATCH v3 4/6] riscv: dts: spacemit: add pwm14_1 pinctrl setting Guodong Xu
2025-05-26 16:54 ` Uwe Kleine-König
2025-05-26 21:52 ` Yixun Lan
2025-05-27 2:48 ` Guodong Xu
2025-05-27 3:27 ` Yixun Lan
2025-05-27 4:36 ` Guodong Xu
2025-04-29 8:50 ` [PATCH v3 5/6] pwm: Kconfig: add depends on ARCH_SPACEMIT to PWM_PXA Guodong Xu
2025-04-29 8:50 ` [PATCH v3 6/6] riscv: defconfig: Enable PWM support for SpacemiT K1 SoC Guodong Xu
2025-07-07 22:29 ` Yixun Lan
2025-07-08 16:50 ` Conor Dooley
2025-05-14 7:21 ` [PATCH v3 0/6] pwm: Update PWM_PXA driver for SpacemiT K1 Guodong Xu
2025-05-26 17:22 ` Uwe Kleine-König
2025-05-27 2:41 ` Guodong Xu
2025-05-27 9:03 ` Uwe Kleine-König
2025-07-08 14:33 ` (subset) " Yixun Lan
2025-07-09 6:37 ` Yixun Lan
2025-07-10 6:33 ` 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).