From 74b24029ab345c6ac62411cad34390ba1b30a043 Mon Sep 17 00:00:00 2001 From: Gerson Fernando Budke Date: Sat, 14 Dec 2024 13:00:44 +0100 Subject: [PATCH 1/6] dts: atmel: sam0: Normalize dtsi nodes Keep a consistent order on the nodes definitions to make it easy to read between all the SoC series. Signed-off-by: Gerson Fernando Budke (cherry picked from commit 6f1f598a72ae4e3bdc59c671acbd3d0bb38b4664) --- dts/arm/atmel/samc21.dtsi | 12 ++++-- dts/arm/atmel/samc2x.dtsi | 40 ++++++++++++++------ dts/arm/atmel/samd21.dtsi | 4 +- dts/arm/atmel/samd2x.dtsi | 33 +++++++++++----- dts/arm/atmel/samd5x.dtsi | 79 ++++++++++++++++++++++++++------------- dts/arm/atmel/same5x.dtsi | 10 +++-- dts/arm/atmel/saml21.dtsi | 4 +- dts/arm/atmel/saml2x.dtsi | 34 ++++++++++++----- dts/arm/atmel/samr21.dtsi | 10 +++-- dts/arm/atmel/samr34.dtsi | 14 ++++--- 10 files changed, 164 insertions(+), 76 deletions(-) diff --git a/dts/arm/atmel/samc21.dtsi b/dts/arm/atmel/samc21.dtsi index 095e98437f05b1..979ca0683468e2 100644 --- a/dts/arm/atmel/samc21.dtsi +++ b/dts/arm/atmel/samc21.dtsi @@ -15,15 +15,17 @@ soc { adc1: adc@42004800 { compatible = "atmel,sam0-adc"; - status = "disabled"; reg = <0x42004800 0x30>; interrupts = <26 0>; interrupt-names = "resrdy"; clocks = <&gclk 34>, <&mclk 0x1c 18>; clock-names = "GCLK", "MCLK"; + status = "disabled"; + + #io-channel-cells = <1>; + gclk = <0>; prescaler = <4>; - #io-channel-cells = <1>; }; sercom4: sercom@42001400 { @@ -51,9 +53,10 @@ interrupt-names = "int0"; clocks = <&gclk 26>, <&mclk 0x10 8>; clock-names = "GCLK", "MCLK"; + status = "disabled"; + bosch,mram-cfg = <0x0 28 8 3 3 0 1 1>; divider = <12>; - status = "disabled"; }; can1: can@42002000 { @@ -63,9 +66,10 @@ interrupt-names = "int0"; clocks = <&gclk 27>, <&mclk 0x10 9>; clock-names = "GCLK", "MCLK"; + status = "disabled"; + bosch,mram-cfg = <0x0 28 8 3 3 0 1 1>; divider = <12>; - status = "disabled"; }; }; }; diff --git a/dts/arm/atmel/samc2x.dtsi b/dts/arm/atmel/samc2x.dtsi index a0e57c5c75f191..3c61d1d664a33a 100644 --- a/dts/arm/atmel/samc2x.dtsi +++ b/dts/arm/atmel/samc2x.dtsi @@ -25,9 +25,10 @@ #size-cells = <0>; cpu0: cpu@0 { - device_type = "cpu"; compatible = "arm,cortex-m0+"; reg = <0>; + + device_type = "cpu"; }; }; @@ -63,13 +64,15 @@ compatible = "atmel,sam0-nvmctrl"; reg = <0x41004000 0x22>; interrupts = <6 0>; - lock-regions = <16>; #address-cells = <1>; #size-cells = <1>; + lock-regions = <16>; + flash0: flash@0 { compatible = "soc-nv-flash"; + write-block-size = <4>; }; }; @@ -77,12 +80,14 @@ mclk: mclk@40000800 { compatible = "atmel,samc2x-mclk"; reg = <0x40000800 0x400>; + #clock-cells = <2>; }; gclk: gclk@40001c00 { compatible = "atmel,samc2x-gclk"; reg = <0x40001c00 0x400>; + #clock-cells = <1>; }; @@ -107,20 +112,23 @@ compatible = "atmel,sam0-dmac"; reg = <0x41006000 0x50>; interrupts = <7 0>; + #dma-cells = <2>; }; adc0: adc@42004400 { compatible = "atmel,sam0-adc"; - status = "disabled"; reg = <0x42004400 0x30>; interrupts = <25 0>; interrupt-names = "resrdy"; clocks = <&gclk 33>, <&mclk 0x1c 17>; clock-names = "GCLK", "MCLK"; + status = "disabled"; + + #io-channel-cells = <1>; + gclk = <0>; prescaler = <4>; - #io-channel-cells = <1>; }; sercom0: sercom@42000400 { @@ -194,32 +202,39 @@ pinctrl: pinctrl@41000000 { compatible = "atmel,sam0-pinctrl"; + ranges = <0x41000000 0x41000000 0x180>; + #address-cells = <1>; #size-cells = <1>; - ranges = <0x41000000 0x41000000 0x180>; porta: gpio@41000000 { compatible = "atmel,sam0-gpio"; reg = <0x41000000 0x80>; - gpio-controller; - #gpio-cells = <2>; + #atmel,pin-cells = <2>; + #gpio-cells = <2>; + + gpio-controller; }; portb: gpio@41000080 { compatible = "atmel,sam0-gpio"; reg = <0x41000080 0x80>; - gpio-controller; - #gpio-cells = <2>; + #atmel,pin-cells = <2>; + #gpio-cells = <2>; + + gpio-controller; }; portc: gpio@41000100 { compatible = "atmel,sam0-gpio"; reg = <0x41000100 0x80>; - gpio-controller; - #gpio-cells = <2>; + #atmel,pin-cells = <2>; + #gpio-cells = <2>; + + gpio-controller; }; }; @@ -227,8 +242,9 @@ compatible = "atmel,sam0-rtc"; reg = <0x40002400 0x1C>; interrupts = <3 0>; - clock-generator = <0>; status = "disabled"; + + clock-generator = <0>; }; }; }; diff --git a/dts/arm/atmel/samd21.dtsi b/dts/arm/atmel/samd21.dtsi index f8b12ed570ae90..fa24b4b75b762f 100644 --- a/dts/arm/atmel/samd21.dtsi +++ b/dts/arm/atmel/samd21.dtsi @@ -14,9 +14,10 @@ soc { usb0: usb@41005000 { compatible = "atmel,sam0-usb"; - status = "disabled"; reg = <0x41005000 0x1000>; interrupts = <7 0>; + status = "disabled"; + num-bidir-endpoints = <8>; }; @@ -24,6 +25,7 @@ compatible = "atmel,sam0-dmac"; reg = <0x41004800 0x50>; interrupts = <6 0>; + #dma-cells = <2>; }; diff --git a/dts/arm/atmel/samd2x.dtsi b/dts/arm/atmel/samd2x.dtsi index c247daffc1a516..4e13589ec7d865 100644 --- a/dts/arm/atmel/samd2x.dtsi +++ b/dts/arm/atmel/samd2x.dtsi @@ -25,9 +25,10 @@ #size-cells = <0>; cpu0: cpu@0 { - device_type = "cpu"; compatible = "arm,cortex-m0+"; reg = <0>; + + device_type = "cpu"; }; }; @@ -63,13 +64,15 @@ compatible = "atmel,sam0-nvmctrl"; reg = <0x41004000 0x22>; interrupts = <5 0>; - lock-regions = <16>; #address-cells = <1>; #size-cells = <1>; + lock-regions = <16>; + flash0: flash@0 { compatible = "soc-nv-flash"; + write-block-size = <4>; }; }; @@ -78,12 +81,14 @@ compatible = "atmel,samd2x-pm"; reg = <0x40000400 0x400>; interrupts = <0 0>; + #clock-cells = <2>; }; gclk: gclk@40000c00 { compatible = "atmel,samd2x-gclk"; reg = <0x40000c00 0x400>; + #clock-cells = <1>; }; @@ -148,29 +153,34 @@ tc4: tc@42003000 { compatible = "atmel,sam0-tc32"; reg = <0x42003000 0x20>; + status = "disabled"; }; pinctrl: pinctrl@41004400 { compatible = "atmel,sam0-pinctrl"; + ranges = <0x41004400 0x41004400 0x100>; + #address-cells = <1>; #size-cells = <1>; - ranges = <0x41004400 0x41004400 0x100>; porta: gpio@41004400 { compatible = "atmel,sam0-gpio"; reg = <0x41004400 0x80>; - gpio-controller; - #gpio-cells = <2>; + #atmel,pin-cells = <2>; + #gpio-cells = <2>; + gpio-controller; }; portb: gpio@41004480 { compatible = "atmel,sam0-gpio"; reg = <0x41004480 0x80>; - gpio-controller; - #gpio-cells = <2>; + #atmel,pin-cells = <2>; + #gpio-cells = <2>; + + gpio-controller; }; }; @@ -178,27 +188,30 @@ compatible = "atmel,sam0-rtc"; reg = <0x40001400 0x1C>; interrupts = <3 0>; - clock-generator = <0>; status = "disabled"; + + clock-generator = <0>; }; adc: adc@42004000 { compatible = "atmel,sam0-adc"; reg = <0x42004000 0x2B>; + #io-channel-cells = <1>; + /* * 2.1 MHz max, so clock it with the * 8 MHz GCLK / 4 = 2 MHz */ gclk = <3>; prescaler = <4>; - #io-channel-cells = <1>; }; dac0: dac@42004800 { compatible = "atmel,sam0-dac"; - status = "disabled"; reg = <0x42004800 0x10>; + status = "disabled"; + #io-channel-cells = <0>; }; }; diff --git a/dts/arm/atmel/samd5x.dtsi b/dts/arm/atmel/samd5x.dtsi index b64abc5de4554c..16bc9681512812 100644 --- a/dts/arm/atmel/samd5x.dtsi +++ b/dts/arm/atmel/samd5x.dtsi @@ -20,12 +20,14 @@ #size-cells = <0>; cpu0: cpu@0 { - device_type = "cpu"; compatible = "arm,cortex-m4f"; reg = <0>; + #address-cells = <1>; #size-cells = <1>; + device_type = "cpu"; + mpu: mpu@e000ed90 { compatible = "arm,armv7m-mpu"; reg = <0xe000ed90 0x40>; @@ -91,12 +93,14 @@ mclk: mclk@40000800 { compatible = "atmel,samd5x-mclk"; reg = <0x40000800 0x400>; + #clock-cells = <2>; }; gclk: gclk@40001c00 { compatible = "atmel,samd5x-gclk"; reg = <0x40001c00 0x400>; + #clock-cells = <1>; }; @@ -104,13 +108,15 @@ compatible = "atmel,sam0-nvmctrl"; reg = <0x41004000 0x22>; interrupts = <29 0>, <30 0>; - lock-regions = <32>; #address-cells = <1>; #size-cells = <1>; + lock-regions = <32>; + flash0: flash@0 { compatible = "soc-nv-flash"; + write-block-size = <8>; }; }; @@ -119,6 +125,7 @@ compatible = "atmel,sam0-dmac"; reg = <0x4100A000 0x50>; interrupts = <31 0>, <32 0>, <33 0>, <34 0>, <35 0>; + #dma-cells = <2>; }; @@ -161,118 +168,128 @@ compatible = "atmel,sam0-sercom"; reg = <0x40003000 0x40>; interrupts = <46 0>, <47 0>, <48 0>, <49 0>; - status = "disabled"; clocks = <&gclk 7>, <&mclk 0x14 12>; clock-names = "GCLK", "MCLK"; + status = "disabled"; }; sercom1: sercom@40003400 { compatible = "atmel,sam0-sercom"; reg = <0x40003400 0x40>; interrupts = <50 0>, <51 0>, <52 0>, <53 0>; - status = "disabled"; clocks = <&gclk 8>, <&mclk 0x14 13>; clock-names = "GCLK", "MCLK"; + status = "disabled"; }; sercom2: sercom@41012000 { compatible = "atmel,sam0-sercom"; reg = <0x41012000 0x40>; interrupts = <54 0>, <55 0>, <56 0>, <57 0>; - status = "disabled"; clocks = <&gclk 23>, <&mclk 0x18 9>; clock-names = "GCLK", "MCLK"; + status = "disabled"; }; sercom3: sercom@41014000 { compatible = "atmel,sam0-sercom"; reg = <0x41014000 0x40>; interrupts = <58 0>, <59 0>, <60 0>, <61 0>; - status = "disabled"; clocks = <&gclk 24>, <&mclk 0x18 10>; clock-names = "GCLK", "MCLK"; + status = "disabled"; }; sercom4: sercom@43000000 { compatible = "atmel,sam0-sercom"; reg = <0x43000000 0x40>; interrupts = <62 0>, <63 0>, <64 0>, <65 0>; - status = "disabled"; clocks = <&gclk 34>, <&mclk 0x20 0>; clock-names = "GCLK", "MCLK"; + status = "disabled"; }; sercom5: sercom@43000400 { compatible = "atmel,sam0-sercom"; reg = <0x43000400 0x40>; interrupts = <66 0>, <67 0>, <68 0>, <69 0>; - status = "disabled"; clocks = <&gclk 35>, <&mclk 0x20 1>; clock-names = "GCLK", "MCLK"; + status = "disabled"; }; sercom6: sercom@43000800 { compatible = "atmel,sam0-sercom"; reg = <0x43000800 0x40>; interrupts = <70 0>, <71 0>, <72 0>, <73 0>; - status = "disabled"; clocks = <&gclk 36>, <&mclk 0x20 2>; clock-names = "GCLK", "MCLK"; + status = "disabled"; }; sercom7: sercom@43000c00 { compatible = "atmel,sam0-sercom"; reg = <0x43000C00 0x40>; interrupts = <74 0>, <75 0>, <76 0>, <77 0>; - status = "disabled"; clocks = <&gclk 37>, <&mclk 0x20 3>; clock-names = "GCLK", "MCLK"; + status = "disabled"; }; pinctrl: pinctrl@41008000 { compatible = "atmel,sam0-pinctrl"; + ranges = <0x41008000 0x41008000 0x200>; + #address-cells = <1>; #size-cells = <1>; - ranges = <0x41008000 0x41008000 0x200>; porta: gpio@41008000 { compatible = "atmel,sam0-gpio"; reg = <0x41008000 0x80>; - gpio-controller; - #gpio-cells = <2>; + #atmel,pin-cells = <2>; + #gpio-cells = <2>; + + gpio-controller; }; portb: gpio@41008080 { compatible = "atmel,sam0-gpio"; reg = <0x41008080 0x80>; - gpio-controller; - #gpio-cells = <2>; + #atmel,pin-cells = <2>; + #gpio-cells = <2>; + + gpio-controller; }; portc: gpio@41008100 { compatible = "atmel,sam0-gpio"; reg = <0x41008100 0x80>; - gpio-controller; - #gpio-cells = <2>; + #atmel,pin-cells = <2>; + #gpio-cells = <2>; + + gpio-controller; }; portd: gpio@41008180 { compatible = "atmel,sam0-gpio"; reg = <0x41008180 0x80>; - gpio-controller; - #gpio-cells = <2>; + #atmel,pin-cells = <2>; + #gpio-cells = <2>; + + gpio-controller; }; }; usb0: usb@41000000 { compatible = "atmel,sam0-usb"; - status = "disabled"; reg = <0x41000000 0x1000>; interrupts = <80 0>, <81 0>, <82 0>, <83 0>; + status = "disabled"; + num-bidir-endpoints = <8>; }; @@ -286,8 +303,9 @@ compatible = "atmel,sam0-rtc"; reg = <0x40002400 0x1C>; interrupts = <11 0>; - clock-generator = <0>; status = "disabled"; + + clock-generator = <0>; }; adc0: adc@43001c00 { @@ -295,6 +313,10 @@ reg = <0x43001C00 0x4A>; interrupts = <118 0>, <119 0>; interrupt-names = "overrun", "resrdy"; + clocks = <&gclk 40>, <&mclk 0x20 7>; + clock-names = "GCLK", "MCLK"; + + #io-channel-cells = <1>; /* * 16 MHz max, source clock must not exceed 100 MHz. @@ -304,9 +326,6 @@ */ gclk = <2>; prescaler = <4>; - #io-channel-cells = <1>; - clocks = <&gclk 40>, <&mclk 0x20 7>; - clock-names = "GCLK", "MCLK"; calib-offset = <0>; }; @@ -315,6 +334,10 @@ reg = <0x43002000 0x4A>; interrupts = <120 0>, <121 0>; interrupt-names = "overrun", "resrdy"; + clocks = <&gclk 41>, <&mclk 0x20 8>; + clock-names = "GCLK", "MCLK"; + + #io-channel-cells = <1>; /* * 16 MHz max, source clock must not exceed 100 MHz. @@ -324,9 +347,6 @@ */ gclk = <2>; prescaler = <4>; - #io-channel-cells = <1>; - clocks = <&gclk 41>, <&mclk 0x20 8>; - clock-names = "GCLK", "MCLK"; calib-offset = <14>; }; @@ -369,6 +389,7 @@ <90 0>, <91 0>; clocks = <&gclk 25>, <&mclk 0x18 11>; clock-names = "GCLK", "MCLK"; + channels = <6>; counter-size = <24>; }; @@ -379,6 +400,7 @@ interrupts = <92 0>, <93 0>, <94 0>, <95 0>, <96 0>; clocks = <&gclk 25>, <&mclk 0x18 12>; clock-names = "GCLK", "MCLK"; + channels = <4>; counter-size = <24>; }; @@ -389,6 +411,7 @@ interrupts = <97 0>, <98 0>, <99 0>, <100 0>; clocks = <&gclk 29>, <&mclk 0x1c 3>; clock-names = "GCLK", "MCLK"; + channels = <3>; counter-size = <16>; }; @@ -399,6 +422,7 @@ interrupts = <101 0>, <102 0>, <103 0>; clocks = <&gclk 29>, <&mclk 0x1c 4>; clock-names = "GCLK", "MCLK"; + channels = <2>; counter-size = <16>; }; @@ -409,6 +433,7 @@ interrupts = <104 0>, <105 0>, <106 0>; clocks = <&gclk 38>, <&mclk 0x20 4>; clock-names = "GCLK", "MCLK"; + channels = <2>; counter-size = <16>; }; diff --git a/dts/arm/atmel/same5x.dtsi b/dts/arm/atmel/same5x.dtsi index 750094cfafef9e..9df4876736a9c9 100644 --- a/dts/arm/atmel/same5x.dtsi +++ b/dts/arm/atmel/same5x.dtsi @@ -14,15 +14,17 @@ reg = <0x42000800 0x400>; interrupts = <84 0>; interrupt-names = "gmac"; + status = "disabled"; + num-queues = <1>; local-mac-address = [00 00 00 00 00 00]; - status = "disabled"; }; mdio: mdio@42000800 { compatible = "atmel,sam-mdio"; reg = <0x42000800 0x400>; status = "disabled"; + #address-cells = <1>; #size-cells = <0>; }; @@ -34,9 +36,10 @@ interrupt-names = "int0", "int1"; clocks = <&gclk 27>, <&mclk 0x10 17>; clock-names = "GCLK", "MCLK"; + status = "disabled"; + bosch,mram-cfg = <0x0 128 64 64 64 64 32 32>; divider = <12>; - status = "disabled"; }; can1: can@42000400 { @@ -46,9 +49,10 @@ interrupt-names = "int0", "int1"; clocks = <&gclk 28>, <&mclk 0x10 18>; clock-names = "GCLK", "MCLK"; + status = "disabled"; + bosch,mram-cfg = <0x0 128 64 64 64 64 32 32>; divider = <12>; - status = "disabled"; }; }; }; diff --git a/dts/arm/atmel/saml21.dtsi b/dts/arm/atmel/saml21.dtsi index 524c28d3d2defa..e41541750f1d93 100644 --- a/dts/arm/atmel/saml21.dtsi +++ b/dts/arm/atmel/saml21.dtsi @@ -10,9 +10,10 @@ soc { usb0: usb@41000000 { compatible = "atmel,sam0-usb"; - status = "disabled"; reg = <0x41000000 0x1000>; interrupts = <6 0>; + status = "disabled"; + num-bidir-endpoints = <8>; }; @@ -20,6 +21,7 @@ compatible = "atmel,sam0-dmac"; reg = <0x44000400 0x50>; interrupts = <5 0>; + #dma-cells = <2>; }; diff --git a/dts/arm/atmel/saml2x.dtsi b/dts/arm/atmel/saml2x.dtsi index 2bad616c81af94..47ad26b78c2e37 100644 --- a/dts/arm/atmel/saml2x.dtsi +++ b/dts/arm/atmel/saml2x.dtsi @@ -26,9 +26,10 @@ #size-cells = <0>; cpu0: cpu@0 { - device_type = "cpu"; compatible = "arm,cortex-m0+"; reg = <0>; + + device_type = "cpu"; }; }; @@ -50,14 +51,16 @@ compatible = "atmel,sam0-nvmctrl"; reg = <0x41004000 0x22>; interrupts = <4 0>; - lock-regions = <16>; #address-cells = <1>; #size-cells = <1>; + lock-regions = <16>; + flash0: flash@0 { compatible = "soc-nv-flash"; reg = <0 0x40000>; + write-block-size = <4>; }; }; @@ -66,18 +69,21 @@ compatible = "atmel,saml2x-pm"; reg = <0x40000400 0x400>; interrupts = <0 0>; + #clock-cells = <2>; }; mclk: mclk@40000400 { compatible = "atmel,saml2x-mclk"; reg = <0x40000400 0x400>; + #clock-cells = <2>; }; gclk: gclk@40001800 { compatible = "atmel,saml2x-gclk"; reg = <0x40001800 0x400>; + #clock-cells = <1>; }; @@ -85,6 +91,7 @@ compatible = "atmel,sam0-dmac"; reg = <0x44000400 0x400>; interrupts = <5 0>; + #dma-cells = <2>; }; @@ -143,25 +150,29 @@ pinctrl: pinctrl@40002800 { compatible = "atmel,sam0-pinctrl"; + ranges = <0x40002800 0x40002800 0x100>; + #address-cells = <1>; #size-cells = <1>; - ranges = <0x40002800 0x40002800 0x100>; porta: gpio@40002800 { compatible = "atmel,sam0-gpio"; reg = <0x40002800 0x80>; - gpio-controller; - #gpio-cells = <2>; + #atmel,pin-cells = <2>; + #gpio-cells = <2>; + gpio-controller; }; portb: gpio@40002880 { compatible = "atmel,sam0-gpio"; reg = <0x40002880 0x80>; - gpio-controller; - #gpio-cells = <2>; + #atmel,pin-cells = <2>; + #gpio-cells = <2>; + + gpio-controller; }; }; @@ -169,27 +180,30 @@ compatible = "atmel,sam0-rtc"; reg = <0x40002000 0x1c>; interrupts = <2 0>; - clock-generator = <0>; status = "disabled"; + + clock-generator = <0>; }; adc: adc@43000c00 { compatible = "atmel,sam0-adc"; reg = <0x43000c00 0x30>; + #io-channel-cells = <1>; + /* * 16 MHz max, so clock it with the * 48 MHz DFLL / 2 / 2 = 12 MHz */ gclk = <3>; prescaler = <2>; - #io-channel-cells = <1>; }; dac: dac@42003000 { compatible = "atmel,sam0-dac"; - status = "disabled"; reg = <0x42003000 0x1a>; + status = "disabled"; + #io-channel-cells = <0>; }; diff --git a/dts/arm/atmel/samr21.dtsi b/dts/arm/atmel/samr21.dtsi index 786597c3ca31fa..ddf505ee798cd6 100644 --- a/dts/arm/atmel/samr21.dtsi +++ b/dts/arm/atmel/samr21.dtsi @@ -14,9 +14,10 @@ soc { usb0: usb@41005000 { compatible = "atmel,sam0-usb"; - status = "disabled"; reg = <0x41005000 0x1000>; interrupts = <7 0>; + status = "disabled"; + num-bidir-endpoints = <8>; }; @@ -24,6 +25,7 @@ compatible = "atmel,sam0-dmac"; reg = <0x41004800 0x50>; interrupts = <6 0>; + #dma-cells = <2>; }; @@ -33,9 +35,11 @@ portc: gpio@41004500 { compatible = "atmel,sam0-gpio"; reg = <0x41004500 0x80>; - gpio-controller; - #gpio-cells = <2>; + #atmel,pin-cells = <2>; + #gpio-cells = <2>; + + gpio-controller; }; }; diff --git a/dts/arm/atmel/samr34.dtsi b/dts/arm/atmel/samr34.dtsi index 17164005d99392..756f501e430c8f 100644 --- a/dts/arm/atmel/samr34.dtsi +++ b/dts/arm/atmel/samr34.dtsi @@ -23,9 +23,10 @@ portc: gpio@40002900 { compatible = "atmel,sam0-gpio"; reg = <0x40002900 0x80>; - gpio-controller; - #gpio-cells = <2>; + #atmel,pin-cells = <2>; + #gpio-cells = <2>; + gpio-controller; }; }; }; @@ -37,19 +38,22 @@ /* SERCOM4 is used to interface with the internal LoRa radio */ compatible = "atmel,sam0-spi"; status = "disabled"; + + #address-cells = <1>; + #size-cells = <0>; + dipo = <0>; dopo = <1>; cs-gpios = <&portb 31 GPIO_ACTIVE_LOW>; - #address-cells = <1>; - #size-cells = <0>; pinctrl-0 = <&sercom4_default>; pinctrl-names = "default"; lora: sx1276@0 { compatible = "semtech,sx1276"; - status = "disabled"; reg = <0>; + status = "disabled"; + reset-gpios = <&portb 15 GPIO_ACTIVE_LOW>; /* nRST */ dio-gpios = <&portb 16 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>, /* DIO0 */ From 1a3ce89f35a51edb48ffe3986e25de56c37c26e3 Mon Sep 17 00:00:00 2001 From: Gerson Fernando Budke Date: Sat, 14 Dec 2024 13:06:53 +0100 Subject: [PATCH 2/6] dts: atmel: sam0: Explicity disable nodes When running tests on sam0 platform was detected that pinctrl for ADC were not defined for some boards. To force an error at build time nodes should be explicity disabled. This explicity disable nodes on devicetree that require some user configuration. In addition, the adc feature were excluded in some boards and samr21-xpro was correct updated. Signed-off-by: Gerson Fernando Budke (cherry picked from commit 162f728787976ed483886242915e8584ec79df41) --- boards/atmel/sam0/samd20_xpro/samd20_xpro.yaml | 4 +++- boards/atmel/sam0/samd21_xpro/samd21_xpro.yaml | 2 +- .../atmel/sam0/samr21_xpro/samr21_xpro-pinctrl.dtsi | 8 +++++++- boards/atmel/sam0/samr21_xpro/samr21_xpro.dts | 6 ++++++ boards/atmel/sam0/samr21_xpro/samr21_xpro.yaml | 3 ++- dts/arm/atmel/samc2x.dtsi | 4 ++++ dts/arm/atmel/samd20.dtsi | 3 +++ dts/arm/atmel/samd21.dtsi | 5 +++++ dts/arm/atmel/samd2x.dtsi | 1 + dts/arm/atmel/samd5x.dtsi | 12 ++++++++++++ dts/arm/atmel/saml21.dtsi | 4 ++++ dts/arm/atmel/saml2x.dtsi | 3 +++ dts/arm/atmel/samr21.dtsi | 3 +++ 13 files changed, 54 insertions(+), 4 deletions(-) diff --git a/boards/atmel/sam0/samd20_xpro/samd20_xpro.yaml b/boards/atmel/sam0/samd20_xpro/samd20_xpro.yaml index 548bd6c462a885..1db726120e1477 100644 --- a/boards/atmel/sam0/samd20_xpro/samd20_xpro.yaml +++ b/boards/atmel/sam0/samd20_xpro/samd20_xpro.yaml @@ -1,3 +1,6 @@ +# Copyright (c) 2024 Gerson Fernando Budke +# SPDX-License-Identifier: Apache-2.0 + identifier: samd20_xpro name: SAM D20 Xplained Pro type: mcu @@ -9,7 +12,6 @@ toolchain: flash: 256 ram: 32 supported: - - adc - flash - gpio - i2c diff --git a/boards/atmel/sam0/samd21_xpro/samd21_xpro.yaml b/boards/atmel/sam0/samd21_xpro/samd21_xpro.yaml index c41c94432857c6..e1e8e08bdbb78d 100644 --- a/boards/atmel/sam0/samd21_xpro/samd21_xpro.yaml +++ b/boards/atmel/sam0/samd21_xpro/samd21_xpro.yaml @@ -1,6 +1,7 @@ # Copyright (c) 2018 Bryan O'Donoghue # Copyright (c) 2024 Gerson Fernando Budke # SPDX-License-Identifier: Apache-2.0 + identifier: samd21_xpro name: SAM D21 Xplained Pro type: mcu @@ -12,7 +13,6 @@ toolchain: flash: 256 ram: 32 supported: - - adc - counter - dma - gpio diff --git a/boards/atmel/sam0/samr21_xpro/samr21_xpro-pinctrl.dtsi b/boards/atmel/sam0/samr21_xpro/samr21_xpro-pinctrl.dtsi index de5b64f0f8cfd9..81f7bce508abc2 100644 --- a/boards/atmel/sam0/samr21_xpro/samr21_xpro-pinctrl.dtsi +++ b/boards/atmel/sam0/samr21_xpro/samr21_xpro-pinctrl.dtsi @@ -1,11 +1,17 @@ /* - * Copyright (c) 2022, Gerson Fernando Budke + * Copyright (c) 2022-2024, Gerson Fernando Budke * SPDX-License-Identifier: Apache-2.0 */ #include &pinctrl { + adc_default: adc_default { + group1 { + pinmux = ; + }; + }; + pwm_default: pwm_default { group1 { pinmux = ; diff --git a/boards/atmel/sam0/samr21_xpro/samr21_xpro.dts b/boards/atmel/sam0/samr21_xpro/samr21_xpro.dts index 01ed0e8826ce38..e53fdc80f554d4 100644 --- a/boards/atmel/sam0/samr21_xpro/samr21_xpro.dts +++ b/boards/atmel/sam0/samr21_xpro/samr21_xpro.dts @@ -106,6 +106,12 @@ clock-frequency = <48000000>; }; +&adc { + status = "okay"; + pinctrl-0 = <&adc_default>; + pinctrl-names = "default"; +}; + &tcc0 { status = "okay"; compatible = "atmel,sam0-tcc-pwm"; diff --git a/boards/atmel/sam0/samr21_xpro/samr21_xpro.yaml b/boards/atmel/sam0/samr21_xpro/samr21_xpro.yaml index 25ce756d667c9c..b61a8209edb273 100644 --- a/boards/atmel/sam0/samr21_xpro/samr21_xpro.yaml +++ b/boards/atmel/sam0/samr21_xpro/samr21_xpro.yaml @@ -1,6 +1,7 @@ # Copyright (c) 2019 Benjamin Valentin -# Copyright (c) 2019-2024 Gerson Fernando Budke +# Copyright (c) 2019-2024 Gerson Fernando Budke # SPDX-License-Identifier: Apache-2.0 + identifier: samr21_xpro name: SAM R21 Xplained Pro type: mcu diff --git a/dts/arm/atmel/samc2x.dtsi b/dts/arm/atmel/samc2x.dtsi index 3c61d1d664a33a..6709b456db16a5 100644 --- a/dts/arm/atmel/samc2x.dtsi +++ b/dts/arm/atmel/samc2x.dtsi @@ -112,6 +112,7 @@ compatible = "atmel,sam0-dmac"; reg = <0x41006000 0x50>; interrupts = <7 0>; + status = "disabled"; #dma-cells = <2>; }; @@ -173,6 +174,7 @@ interrupts = <17 0>; clocks = <&gclk 28>, <&mclk 0x1c 9>; clock-names = "GCLK", "MCLK"; + status = "disabled"; channels = <4>; counter-size = <24>; @@ -184,6 +186,7 @@ interrupts = <18 0>; clocks = <&gclk 28>, <&mclk 0x1c 10>; clock-names = "GCLK", "MCLK"; + status = "disabled"; channels = <4>; counter-size = <24>; @@ -195,6 +198,7 @@ interrupts = <19 0>; clocks = <&gclk 29>, <&mclk 0x1c 11>; clock-names = "GCLK", "MCLK"; + status = "disabled"; channels = <2>; counter-size = <16>; diff --git a/dts/arm/atmel/samd20.dtsi b/dts/arm/atmel/samd20.dtsi index 01af6c4e4503de..8e367d9fd9ad20 100644 --- a/dts/arm/atmel/samd20.dtsi +++ b/dts/arm/atmel/samd20.dtsi @@ -20,6 +20,7 @@ interrupts = <13 0>; clocks = <&gclk 0x13>, <&pm 0x20 8>; clock-names = "GCLK", "PM"; + status = "disabled"; }; tc2: tc@42002800 { @@ -28,6 +29,7 @@ interrupts = <15 0>; clocks = <&gclk 0x14>, <&pm 0x20 10>; clock-names = "GCLK", "PM"; + status = "disabled"; }; tc6: tc@42003800 { @@ -36,6 +38,7 @@ interrupts = <19 0>; clocks = <&gclk 0x16>, <&pm 0x20 14>; clock-names = "GCLK", "PM"; + status = "disabled"; }; }; }; diff --git a/dts/arm/atmel/samd21.dtsi b/dts/arm/atmel/samd21.dtsi index fa24b4b75b762f..3466b0ddd9a930 100644 --- a/dts/arm/atmel/samd21.dtsi +++ b/dts/arm/atmel/samd21.dtsi @@ -25,6 +25,7 @@ compatible = "atmel,sam0-dmac"; reg = <0x41004800 0x50>; interrupts = <6 0>; + status = "disabled"; #dma-cells = <2>; }; @@ -35,6 +36,7 @@ interrupts = <21 0>; clocks = <&gclk 0x1d>, <&pm 0x20 14>; clock-names = "GCLK", "PM"; + status = "disabled"; }; tcc0: tcc@42002000 { @@ -43,6 +45,7 @@ interrupts = <15 0>; clocks = <&gclk 26>, <&pm 0x20 8>; clock-names = "GCLK", "PM"; + status = "disabled"; channels = <4>; counter-size = <24>; @@ -54,6 +57,7 @@ interrupts = <16 0>; clocks = <&gclk 26>, <&pm 0x20 9>; clock-names = "GCLK", "PM"; + status = "disabled"; channels = <2>; counter-size = <24>; @@ -65,6 +69,7 @@ interrupts = <17 0>; clocks = <&gclk 27>, <&pm 0x20 10>; clock-names = "GCLK", "PM"; + status = "disabled"; channels = <2>; counter-size = <16>; diff --git a/dts/arm/atmel/samd2x.dtsi b/dts/arm/atmel/samd2x.dtsi index 4e13589ec7d865..f0ffe589734680 100644 --- a/dts/arm/atmel/samd2x.dtsi +++ b/dts/arm/atmel/samd2x.dtsi @@ -196,6 +196,7 @@ adc: adc@42004000 { compatible = "atmel,sam0-adc"; reg = <0x42004000 0x2B>; + status = "disabled"; #io-channel-cells = <1>; diff --git a/dts/arm/atmel/samd5x.dtsi b/dts/arm/atmel/samd5x.dtsi index 16bc9681512812..29d9c4474e4a73 100644 --- a/dts/arm/atmel/samd5x.dtsi +++ b/dts/arm/atmel/samd5x.dtsi @@ -125,6 +125,7 @@ compatible = "atmel,sam0-dmac"; reg = <0x4100A000 0x50>; interrupts = <31 0>, <32 0>, <33 0>, <34 0>, <35 0>; + status = "disabled"; #dma-cells = <2>; }; @@ -315,6 +316,7 @@ interrupt-names = "overrun", "resrdy"; clocks = <&gclk 40>, <&mclk 0x20 7>; clock-names = "GCLK", "MCLK"; + status = "disabled"; #io-channel-cells = <1>; @@ -336,6 +338,7 @@ interrupt-names = "overrun", "resrdy"; clocks = <&gclk 41>, <&mclk 0x20 8>; clock-names = "GCLK", "MCLK"; + status = "disabled"; #io-channel-cells = <1>; @@ -356,6 +359,7 @@ interrupts = <107 0>; clocks = <&gclk 9>, <&mclk 0x14 14>; clock-names = "GCLK", "MCLK"; + status = "disabled"; }; tc2: tc@4101a000 { @@ -364,6 +368,7 @@ interrupts = <109 0>; clocks = <&gclk 26>, <&mclk 0x18 13>; clock-names = "GCLK", "MCLK"; + status = "disabled"; }; tc4: tc@42001400 { @@ -372,6 +377,7 @@ interrupts = <111 0>; clocks = <&gclk 30>, <&mclk 0x1c 5>; clock-names = "GCLK", "MCLK"; + status = "disabled"; }; tc6: tc@43001400 { @@ -380,6 +386,7 @@ interrupts = <113 0>; clocks = <&gclk 39>, <&mclk 0x20 5>; clock-names = "GCLK", "MCLK"; + status = "disabled"; }; tcc0: tcc@41016000 { @@ -389,6 +396,7 @@ <90 0>, <91 0>; clocks = <&gclk 25>, <&mclk 0x18 11>; clock-names = "GCLK", "MCLK"; + status = "disabled"; channels = <6>; counter-size = <24>; @@ -400,6 +408,7 @@ interrupts = <92 0>, <93 0>, <94 0>, <95 0>, <96 0>; clocks = <&gclk 25>, <&mclk 0x18 12>; clock-names = "GCLK", "MCLK"; + status = "disabled"; channels = <4>; counter-size = <24>; @@ -411,6 +420,7 @@ interrupts = <97 0>, <98 0>, <99 0>, <100 0>; clocks = <&gclk 29>, <&mclk 0x1c 3>; clock-names = "GCLK", "MCLK"; + status = "disabled"; channels = <3>; counter-size = <16>; @@ -422,6 +432,7 @@ interrupts = <101 0>, <102 0>, <103 0>; clocks = <&gclk 29>, <&mclk 0x1c 4>; clock-names = "GCLK", "MCLK"; + status = "disabled"; channels = <2>; counter-size = <16>; @@ -433,6 +444,7 @@ interrupts = <104 0>, <105 0>, <106 0>; clocks = <&gclk 38>, <&mclk 0x20 4>; clock-names = "GCLK", "MCLK"; + status = "disabled"; channels = <2>; counter-size = <16>; diff --git a/dts/arm/atmel/saml21.dtsi b/dts/arm/atmel/saml21.dtsi index e41541750f1d93..cfdc274dc8ff8d 100644 --- a/dts/arm/atmel/saml21.dtsi +++ b/dts/arm/atmel/saml21.dtsi @@ -21,6 +21,7 @@ compatible = "atmel,sam0-dmac"; reg = <0x44000400 0x50>; interrupts = <5 0>; + status = "disabled"; #dma-cells = <2>; }; @@ -31,6 +32,7 @@ interrupts = <14 0>; clocks = <&gclk 25>, <&mclk 0x1c 5>; clock-names = "GCLK", "MCLK"; + status = "disabled"; channels = <4>; counter-size = <24>; @@ -42,6 +44,7 @@ interrupts = <15 0>; clocks = <&gclk 25>, <&mclk 0x1c 6>; clock-names = "GCLK", "MCLK"; + status = "disabled"; channels = <4>; counter-size = <24>; @@ -53,6 +56,7 @@ interrupts = <16 0>; clocks = <&gclk 26>, <&mclk 0x1c 7>; clock-names = "GCLK", "MCLK"; + status = "disabled"; channels = <2>; counter-size = <16>; diff --git a/dts/arm/atmel/saml2x.dtsi b/dts/arm/atmel/saml2x.dtsi index 47ad26b78c2e37..4b58f1f4128a39 100644 --- a/dts/arm/atmel/saml2x.dtsi +++ b/dts/arm/atmel/saml2x.dtsi @@ -91,6 +91,7 @@ compatible = "atmel,sam0-dmac"; reg = <0x44000400 0x400>; interrupts = <5 0>; + status = "disabled"; #dma-cells = <2>; }; @@ -146,6 +147,7 @@ tc4: tc@43000800 { compatible = "atmel,sam0-tc32"; reg = <0x43000800 0x34>; + status = "disabled"; }; pinctrl: pinctrl@40002800 { @@ -188,6 +190,7 @@ adc: adc@43000c00 { compatible = "atmel,sam0-adc"; reg = <0x43000c00 0x30>; + status = "disabled"; #io-channel-cells = <1>; diff --git a/dts/arm/atmel/samr21.dtsi b/dts/arm/atmel/samr21.dtsi index ddf505ee798cd6..f099f8a72082d6 100644 --- a/dts/arm/atmel/samr21.dtsi +++ b/dts/arm/atmel/samr21.dtsi @@ -54,6 +54,7 @@ interrupts = <15 0>; clocks = <&gclk 26>, <&pm 0x20 8>; clock-names = "GCLK", "PM"; + status = "disabled"; channels = <4>; counter-size = <24>; @@ -65,6 +66,7 @@ interrupts = <16 0>; clocks = <&gclk 26>, <&pm 0x20 9>; clock-names = "GCLK", "PM"; + status = "disabled"; channels = <2>; counter-size = <24>; @@ -76,6 +78,7 @@ interrupts = <17 0>; clocks = <&gclk 27>, <&pm 0x20 10>; clock-names = "GCLK", "PM"; + status = "disabled"; channels = <2>; counter-size = <16>; From b79cc94d356d9eb890790efb9a762a9a170f62a6 Mon Sep 17 00:00:00 2001 From: Gerson Fernando Budke Date: Sat, 14 Dec 2024 13:35:59 +0100 Subject: [PATCH 3/6] dts: atmel: sam0: Fix aliases and chosen nodes Reorder and add missing aliases and chosen nodes. Signed-off-by: Gerson Fernando Budke (cherry picked from commit 748bbd012b262d66308f7f8571c1179a9f5ced10) --- dts/arm/atmel/samc21.dtsi | 2 ++ dts/arm/atmel/samc2x.dtsi | 30 +++++++++++++------------- dts/arm/atmel/samd21.dtsi | 4 ++++ dts/arm/atmel/samd2x.dtsi | 29 ++++++++++++------------- dts/arm/atmel/samd5x.dtsi | 45 ++++++++++++++++++--------------------- dts/arm/atmel/saml21.dtsi | 6 ++++++ dts/arm/atmel/saml2x.dtsi | 14 ++++++++++++ dts/arm/atmel/samr21.dtsi | 4 ++++ dts/arm/atmel/samr34.dtsi | 2 ++ 9 files changed, 82 insertions(+), 54 deletions(-) diff --git a/dts/arm/atmel/samc21.dtsi b/dts/arm/atmel/samc21.dtsi index 979ca0683468e2..f54b5672e750c3 100644 --- a/dts/arm/atmel/samc21.dtsi +++ b/dts/arm/atmel/samc21.dtsi @@ -8,6 +8,8 @@ / { aliases { + adc-1 = &adc1; + sercom-4 = &sercom4; sercom-5 = &sercom5; }; diff --git a/dts/arm/atmel/samc2x.dtsi b/dts/arm/atmel/samc2x.dtsi index 6709b456db16a5..a1a78112487c20 100644 --- a/dts/arm/atmel/samc2x.dtsi +++ b/dts/arm/atmel/samc2x.dtsi @@ -13,6 +13,21 @@ / { aliases { + adc-0 = &adc0; + + port-a = &porta; + port-b = &portb; + port-c = &portc; + + sercom-0 = &sercom0; + sercom-1 = &sercom1; + sercom-2 = &sercom2; + sercom-3 = &sercom3; + + tcc-0 = &tcc0; + tcc-1 = &tcc1; + tcc-2 = &tcc2; + watchdog0 = &wdog; }; @@ -44,21 +59,6 @@ <0x0080A048 0x4>; }; - aliases { - port-a = &porta; - port-b = &portb; - port-c = &portc; - - sercom-0 = &sercom0; - sercom-1 = &sercom1; - sercom-2 = &sercom2; - sercom-3 = &sercom3; - - tcc-0 = &tcc0; - tcc-1 = &tcc1; - tcc-2 = &tcc2; - }; - soc { nvmctrl: nvmctrl@41004000 { compatible = "atmel,sam0-nvmctrl"; diff --git a/dts/arm/atmel/samd21.dtsi b/dts/arm/atmel/samd21.dtsi index 3466b0ddd9a930..c4692ffa9e50b4 100644 --- a/dts/arm/atmel/samd21.dtsi +++ b/dts/arm/atmel/samd21.dtsi @@ -9,6 +9,10 @@ / { aliases { tc-6 = &tc6; + + tcc-0 = &tcc0; + tcc-1 = &tcc1; + tcc-2 = &tcc2; }; soc { diff --git a/dts/arm/atmel/samd2x.dtsi b/dts/arm/atmel/samd2x.dtsi index f0ffe589734680..d40e558f73283a 100644 --- a/dts/arm/atmel/samd2x.dtsi +++ b/dts/arm/atmel/samd2x.dtsi @@ -13,6 +13,20 @@ / { aliases { + adc-0 = &adc; + + port-a = &porta; + port-b = &portb; + + sercom-0 = &sercom0; + sercom-1 = &sercom1; + sercom-2 = &sercom2; + sercom-3 = &sercom3; + sercom-4 = &sercom4; + sercom-5 = &sercom5; + + tc-4 = &tc4; + watchdog0 = &wdog; }; @@ -44,21 +58,6 @@ <0x0080A048 0x4>; }; - aliases { - port-a = &porta; - port-b = &portb; - adc-0 = &adc; - - sercom-0 = &sercom0; - sercom-1 = &sercom1; - sercom-2 = &sercom2; - sercom-3 = &sercom3; - sercom-4 = &sercom4; - sercom-5 = &sercom5; - - tc-4 = &tc4; - }; - soc { nvmctrl: nvmctrl@41004000 { compatible = "atmel,sam0-nvmctrl"; diff --git a/dts/arm/atmel/samd5x.dtsi b/dts/arm/atmel/samd5x.dtsi index 29d9c4474e4a73..12593682eaec7d 100644 --- a/dts/arm/atmel/samd5x.dtsi +++ b/dts/arm/atmel/samd5x.dtsi @@ -11,30 +11,6 @@ #include / { - chosen { - zephyr,flash-controller = &nvmctrl; - }; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - cpu0: cpu@0 { - compatible = "arm,cortex-m4f"; - reg = <0>; - - #address-cells = <1>; - #size-cells = <1>; - - device_type = "cpu"; - - mpu: mpu@e000ed90 { - compatible = "arm,armv7m-mpu"; - reg = <0xe000ed90 0x40>; - }; - }; - }; - aliases { adc-0 = &adc0; adc-1 = &adc1; @@ -69,6 +45,27 @@ chosen { zephyr,entropy = &trng; + zephyr,flash-controller = &nvmctrl; + }; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu0: cpu@0 { + compatible = "arm,cortex-m4f"; + reg = <0>; + + #address-cells = <1>; + #size-cells = <1>; + + device_type = "cpu"; + + mpu: mpu@e000ed90 { + compatible = "arm,armv7m-mpu"; + reg = <0xe000ed90 0x40>; + }; + }; }; soc { diff --git a/dts/arm/atmel/saml21.dtsi b/dts/arm/atmel/saml21.dtsi index cfdc274dc8ff8d..bea13b3267b290 100644 --- a/dts/arm/atmel/saml21.dtsi +++ b/dts/arm/atmel/saml21.dtsi @@ -7,6 +7,12 @@ #include / { + aliases { + tcc-0 = &tcc0; + tcc-1 = &tcc1; + tcc-2 = &tcc2; + }; + soc { usb0: usb@41000000 { compatible = "atmel,sam0-usb"; diff --git a/dts/arm/atmel/saml2x.dtsi b/dts/arm/atmel/saml2x.dtsi index 4b58f1f4128a39..43fe94dd82ac69 100644 --- a/dts/arm/atmel/saml2x.dtsi +++ b/dts/arm/atmel/saml2x.dtsi @@ -13,6 +13,20 @@ / { aliases { + adc-0 = &adc; + + port-a = &porta; + port-b = &portb; + + sercom-0 = &sercom0; + sercom-1 = &sercom1; + sercom-2 = &sercom2; + sercom-3 = &sercom3; + sercom-4 = &sercom4; + sercom-5 = &sercom5; + + tc-4 = &tc4; + watchdog0 = &wdog; }; diff --git a/dts/arm/atmel/samr21.dtsi b/dts/arm/atmel/samr21.dtsi index f099f8a72082d6..774f42a18bcb33 100644 --- a/dts/arm/atmel/samr21.dtsi +++ b/dts/arm/atmel/samr21.dtsi @@ -9,6 +9,10 @@ / { aliases { port-c = &portc; + + tcc-0 = &tcc0; + tcc-1 = &tcc1; + tcc-2 = &tcc2; }; soc { diff --git a/dts/arm/atmel/samr34.dtsi b/dts/arm/atmel/samr34.dtsi index 756f501e430c8f..351e02bb1e1d0a 100644 --- a/dts/arm/atmel/samr34.dtsi +++ b/dts/arm/atmel/samr34.dtsi @@ -13,6 +13,8 @@ / { aliases { + port-c = &portc; + lora0 = &lora; }; From 1d27317d090b84a95b0ed93ba1e342aaa53580ec Mon Sep 17 00:00:00 2001 From: Gerson Fernando Budke Date: Sat, 14 Dec 2024 14:42:48 +0100 Subject: [PATCH 4/6] dts: atmel: saml21: Exclude DMA node The DMA is already defined on the base header. This exclude the duplicated node. Signed-off-by: Gerson Fernando Budke (cherry picked from commit 2e7599eac61abb2feec0741a0106357e013e8f36) --- dts/arm/atmel/saml21.dtsi | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/dts/arm/atmel/saml21.dtsi b/dts/arm/atmel/saml21.dtsi index bea13b3267b290..e6e11dc75d6f9b 100644 --- a/dts/arm/atmel/saml21.dtsi +++ b/dts/arm/atmel/saml21.dtsi @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Argentum Systems Ltd. + * Copyright (c) 2024 Gerson Fernando Budke * * SPDX-License-Identifier: Apache-2.0 */ @@ -23,15 +24,6 @@ num-bidir-endpoints = <8>; }; - dmac: dmac@44000400 { - compatible = "atmel,sam0-dmac"; - reg = <0x44000400 0x50>; - interrupts = <5 0>; - status = "disabled"; - - #dma-cells = <2>; - }; - tcc0: tcc@42001400 { compatible = "atmel,sam0-tcc"; reg = <0x42001400 0x80>; From ca943e23e8b0e09eb2324b1687928d6e2cc61ded Mon Sep 17 00:00:00 2001 From: Gerson Fernando Budke Date: Sat, 14 Dec 2024 14:45:06 +0100 Subject: [PATCH 5/6] dts: atmel: saml2x: Define USB node The saml2x series provide USB to all SoC series. This moves the USB node from saml21.dtsi to the base file saml2x.dtsi. Signed-off-by: Gerson Fernando Budke (cherry picked from commit 34fc01e0089620e340a1bc9cc9f76795f87acd01) --- dts/arm/atmel/saml21.dtsi | 9 --------- dts/arm/atmel/saml2x.dtsi | 10 ++++++++++ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/dts/arm/atmel/saml21.dtsi b/dts/arm/atmel/saml21.dtsi index e6e11dc75d6f9b..6e015b5772cc9e 100644 --- a/dts/arm/atmel/saml21.dtsi +++ b/dts/arm/atmel/saml21.dtsi @@ -15,15 +15,6 @@ }; soc { - usb0: usb@41000000 { - compatible = "atmel,sam0-usb"; - reg = <0x41000000 0x1000>; - interrupts = <6 0>; - status = "disabled"; - - num-bidir-endpoints = <8>; - }; - tcc0: tcc@42001400 { compatible = "atmel,sam0-tcc"; reg = <0x42001400 0x80>; diff --git a/dts/arm/atmel/saml2x.dtsi b/dts/arm/atmel/saml2x.dtsi index 43fe94dd82ac69..d9191c03a1321e 100644 --- a/dts/arm/atmel/saml2x.dtsi +++ b/dts/arm/atmel/saml2x.dtsi @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Argentum Systems Ltd. + * Copyright (c) 2024 Gerson Fernando Budke * * SPDX-License-Identifier: Apache-2.0 */ @@ -229,6 +230,15 @@ reg = <0x42003800 0x24>; interrupts = <27 0>; }; + + usb0: usb@41000000 { + compatible = "atmel,sam0-usb"; + reg = <0x41000000 0x1000>; + interrupts = <6 0>; + status = "disabled"; + + num-bidir-endpoints = <8>; + }; }; }; From b49ad0c52487137bd14b516fa3704c004136e7a2 Mon Sep 17 00:00:00 2001 From: Gerson Fernando Budke Date: Sat, 14 Dec 2024 14:47:50 +0100 Subject: [PATCH 6/6] dts: atmel: samr21: Use samd21 as base The samr21 is a samd21 with a builtin at86rf233 radio. Use the samd21 as base for these SoC and drop all duplicated nodes. Signed-off-by: Gerson Fernando Budke (cherry picked from commit 01fc0a750a6ecf8fec64d22908b1619dda7249f6) --- dts/arm/atmel/samr21.dtsi | 109 +------------------------------------- 1 file changed, 2 insertions(+), 107 deletions(-) diff --git a/dts/arm/atmel/samr21.dtsi b/dts/arm/atmel/samr21.dtsi index 774f42a18bcb33..85686c1d37bc67 100644 --- a/dts/arm/atmel/samr21.dtsi +++ b/dts/arm/atmel/samr21.dtsi @@ -1,38 +1,18 @@ /* * Copyright (c) 2019 Benjamin Valentin + * Copyright (c) 2024 Gerson Fernando Budke * * SPDX-License-Identifier: Apache-2.0 */ -#include +#include / { aliases { port-c = &portc; - - tcc-0 = &tcc0; - tcc-1 = &tcc1; - tcc-2 = &tcc2; }; soc { - usb0: usb@41005000 { - compatible = "atmel,sam0-usb"; - reg = <0x41005000 0x1000>; - interrupts = <7 0>; - status = "disabled"; - - num-bidir-endpoints = <8>; - }; - - dmac: dmac@41004800 { - compatible = "atmel,sam0-dmac"; - reg = <0x41004800 0x50>; - interrupts = <6 0>; - - #dma-cells = <2>; - }; - pinctrl: pinctrl@41004400 { ranges = <0x41004400 0x41004400 0x180>; @@ -51,90 +31,5 @@ compatible = "atmel,sam0-pinmux"; reg = <0x41004500 0x80>; }; - - tcc0: tcc@42002000 { - compatible = "atmel,sam0-tcc"; - reg = <0x42002000 0x80>; - interrupts = <15 0>; - clocks = <&gclk 26>, <&pm 0x20 8>; - clock-names = "GCLK", "PM"; - status = "disabled"; - - channels = <4>; - counter-size = <24>; - }; - - tcc1: tcc@42002400 { - compatible = "atmel,sam0-tcc"; - reg = <0x42002400 0x80>; - interrupts = <16 0>; - clocks = <&gclk 26>, <&pm 0x20 9>; - clock-names = "GCLK", "PM"; - status = "disabled"; - - channels = <2>; - counter-size = <24>; - }; - - tcc2: tcc@42002800 { - compatible = "atmel,sam0-tcc"; - reg = <0x42002800 0x80>; - interrupts = <17 0>; - clocks = <&gclk 27>, <&pm 0x20 10>; - clock-names = "GCLK", "PM"; - status = "disabled"; - - channels = <2>; - counter-size = <16>; - }; }; }; - -&sercom0 { - interrupts = <9 0>; - clocks = <&gclk 0x14>, <&pm 0x20 2>; - clock-names = "GCLK", "PM"; -}; - -&sercom1 { - interrupts = <10 0>; - clocks = <&gclk 0x15>, <&pm 0x20 3>; - clock-names = "GCLK", "PM"; -}; - -&sercom2 { - interrupts = <11 0>; - clocks = <&gclk 0x16>, <&pm 0x20 4>; - clock-names = "GCLK", "PM"; -}; - -&sercom3 { - interrupts = <12 0>; - clocks = <&gclk 0x17>, <&pm 0x20 5>; - clock-names = "GCLK", "PM"; -}; - -&sercom4 { - interrupts = <13 0>; - clocks = <&gclk 0x18>, <&pm 0x20 6>; - clock-names = "GCLK", "PM"; -}; - -&sercom5 { - interrupts = <14 0>; - clocks = <&gclk 0x19>, <&pm 0x20 7>; - clock-names = "GCLK", "PM"; -}; - -&tc4 { - interrupts = <19 0>; - clocks = <&gclk 0x1c>, <&pm 0x20 12>; - clock-names = "GCLK", "PM"; -}; - -&adc { - clocks = <&gclk 0x1e>, <&pm 0x20 16>; - clock-names = "GCLK", "PM"; - interrupts = <23 0>; - interrupt-names = "resrdy"; -};