From 054f89fd8b5798c501120209961b6f7397625f87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Mon, 25 Nov 2024 15:18:51 +0100 Subject: [PATCH] boards: nordic: nrf54h20dk: add pwm_led on cpuppr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added pwmleds node to cpuppr board devicetree and nordic-ppr snippet to allow running pwm samples. Signed-off-by: MichaƂ Stasiak --- .../nrf54h20dk/nrf54h20dk_nrf54h20_cpuppr.dts | 47 +++++++++++++++++++ .../nordic-ppr/soc/nrf54h20_cpuapp.overlay | 5 ++ 2 files changed, 52 insertions(+) diff --git a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuppr.dts b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuppr.dts index 59b53aafcb2becf..0ac0aa59815d2b6 100644 --- a/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuppr.dts +++ b/boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuppr.dts @@ -29,6 +29,46 @@ zephyr,sram = &cpuppr_code_data; zephyr,shell-uart = &uart135; }; + + leds { + compatible = "gpio-leds"; + led0: led_0 { + gpios = <&gpio2 9 GPIO_ACTIVE_HIGH>; + label = "Green LED 0"; + }; + led1: led_1 { + gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>; + label = "Green LED 1"; + }; + led2: led_2 { + gpios = <&gpio2 7 GPIO_ACTIVE_HIGH>; + label = "Green LED 2"; + }; + led3: led_3 { + gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>; + label = "Green LED 3"; + }; + }; + + pwmleds { + compatible = "pwm-leds"; + /* + * LEDs are connected to GPIO Port 9 - pins 0-3. There is no valid hardware + * configuration to pass PWM signal on pis 0 and 1. First valid config is P9.2. + * Signal on PWM130's channel 0 can be passed directly on GPIO Port 9 pin 2. + */ + pwm_led2: pwm_led_2 { + pwms = <&pwm130 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + }; + }; + + aliases { + led0 = &led0; + led1 = &led1; + led2 = &led2; + led3 = &led3; + pwm-led0 = &pwm_led2; + }; }; &cpuapp_cpuppr_ipc { @@ -56,3 +96,10 @@ pinctrl-1 = <&uart136_sleep>; pinctrl-names = "default", "sleep"; }; + +&pwm130 { + status = "okay"; + pinctrl-0 = <&pwm130_default>; + pinctrl-1 = <&pwm130_sleep>; + pinctrl-names = "default", "sleep"; +}; diff --git a/snippets/nordic-ppr/soc/nrf54h20_cpuapp.overlay b/snippets/nordic-ppr/soc/nrf54h20_cpuapp.overlay index 75128f42a13f7d6..c6df71242569432 100644 --- a/snippets/nordic-ppr/soc/nrf54h20_cpuapp.overlay +++ b/snippets/nordic-ppr/soc/nrf54h20_cpuapp.overlay @@ -10,3 +10,8 @@ &uart135 { status = "reserved"; }; + +&pwm130 { + status = "reserved"; + interrupt-parent = <&cpuppr_clic>; +};