dts: nrf: SW PWM device node added to nRF5 devices with yaml binding

1. SW PWM device node added to common nrf5_common.dtsi
2. SW PWM node set in all nRF5x DTSI files.
   Different initial settings for nRF51 and nRF52 devices.
   Status is ok by default for nRF51.
3. Added yaml binding for Nordic SW PWM node.
4. Set codeowner of nordic dts bindings to @anangl

Signed-off-by: Gaute Gamnes <gaute.gamnes@nordicsemi.no>
This commit is contained in:
Gaute Gamnes 2019-03-12 08:50:19 +01:00 committed by Carles Cufí
parent 6af7856a66
commit 88f099c3a1
6 changed files with 92 additions and 0 deletions

View file

@ -1,6 +1,7 @@
#include <arm/armv6-m.dtsi>
#include <dt-bindings/i2c/i2c.h>
#include <dt-bindings/gpio/gpio.h>
#include "nrf5_common.dtsi"
/ {
cpus {
@ -207,3 +208,12 @@
&nvic {
arm,num-irq-priority-bits = <2>;
};
&sw_pwm {
timer-instance = <1>;
channel-count = <3>;
clock-prescaler = <0>;
ppi-base = <7>;
gpiote-base = <0>;
status = "ok";
};

View file

@ -1,6 +1,7 @@
#include <arm/armv7-m.dtsi>
#include <dt-bindings/i2c/i2c.h>
#include <dt-bindings/gpio/gpio.h>
#include "nrf5_common.dtsi"
/ {
cpus {
@ -194,3 +195,11 @@
&nvic {
arm,num-irq-priority-bits = <3>;
};
&sw_pwm {
timer-instance = <2>;
channel-count = <3>;
clock-prescaler = <0>;
ppi-base = <14>;
gpiote-base = <0>;
};

View file

@ -1,6 +1,7 @@
#include <arm/armv7-m.dtsi>
#include <dt-bindings/i2c/i2c.h>
#include <dt-bindings/gpio/gpio.h>
#include "nrf5_common.dtsi"
/ {
cpus {
@ -274,3 +275,11 @@
&nvic {
arm,num-irq-priority-bits = <3>;
};
&sw_pwm {
timer-instance = <2>;
channel-count = <3>;
clock-prescaler = <0>;
ppi-base = <14>;
gpiote-base = <0>;
};

View file

@ -1,6 +1,7 @@
#include <arm/armv7-m.dtsi>
#include <dt-bindings/i2c/i2c.h>
#include <dt-bindings/gpio/gpio.h>
#include "nrf5_common.dtsi"
/ {
cpus {
@ -350,3 +351,11 @@
&nvic {
arm,num-irq-priority-bits = <3>;
};
&sw_pwm {
timer-instance = <2>;
channel-count = <3>;
clock-prescaler = <0>;
ppi-base = <14>;
gpiote-base = <0>;
};

View file

@ -0,0 +1,8 @@
/ {
sw_pwm: sw-pwm {
compatible = "nordic,nrf-sw-pwm";
status = "disabled";
label = "SW_PWM";
};
};

View file

@ -0,0 +1,47 @@
---
title: nRF SW PWM
version: 0.1
description: >
This binding gives a base representation of the nRFx S/W PWM
properties:
compatible:
constraint: "nordic,nrf-sw-pwm"
label:
type: string
category: required
description: Human readable string describing the device (used by Zephyr for API name)
generation: define
timer-instance:
type: int
description: Timer instance to use for generating the PWM output signals
category: required
generation: define
channel-count:
type: int
description: Number of PWM channels. Limited by timer instance compare registers minus 1.
category: required
generation: define
clock-prescaler:
type: int
description: Clock prescaler for timer used for generating the PWM output signals with frequency = 16 MHz / 2^prescaler
category: required
generation: define
ppi-base:
type: int
description: PPI base used for PPI index calculation used for PWM output generation
category: required
generation: define
gpiote-base:
type: int
description: GPIOTE base used for GPIOTE index calculation used for PWM output generation
category: required
generation: define
...