Commit graph

105 commits

Author SHA1 Message Date
Gerson Fernando Budke 460791278e dts: arm: atmel: samr21: Add TCC peripherals
Add TCC peripherals entries for SAMR21 SoC.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-07-04 15:13:28 -04:00
Stephanos Ioannidis 11c294d626 soc: arm: samd5x: Add device tree TCC definitions
This commit adds the device tree TCC (Timer/Counter for Control
Applications) peripheral definitions for the Atmel SAM D5x and E5x
series SoCs.

The SAM D5x/E5x series SoCs have five instances of the TCC peripheral:

TCC#  Channels  Waveform Output  Counter Size
 0       6             8            24-bit
 1       4             8            24-bit
 2       3             3            16-bit
 3       2             2            16-bit
 4       2             2            16-bit

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-07-04 07:09:28 -04:00
Michael Hope f00cf95ecc dts: arm: #include <mem.h> for the SAMD2x series
...so these can be used in board specific files.

Signed-off-by: Michael Hope <mlhx@google.com>
2020-07-01 08:15:32 -05:00
Michael Hope 4c53e5222f dts: arm: add definitions for the TCC peripherals on the SAMD21
The SAMD21 series has three timer/counters with a mix of channels and
resolutions.  Note that the SAMD20 only has TC peripherals and no TCC
peripherals which is why the changes are in samd21.dtsi.

Signed-off-by: Michael Hope <mlhx@google.com>
2020-07-01 08:10:59 -05:00
Michael Hope 0882a9cd97 dts: arm: add a name to cpu0
This allows referencing the CPU in the board-specific DTS file.

Also fix warnings by making the addresses lower case.

Signed-off-by: Michael Hope <mlhx@google.com>
2020-06-09 14:29:58 +02:00
Kumar Gala 6ae8664889 drivers: i2s: i2s_sam_ssc: Convert to devicetree
Convert i2s_sam_ssc driver to utilize devicetree.  We replace Kconfig
options for specifying the DMA configuration (channel, DMA device name)
with getting that from devicetree.  We also get pincfg from devicetree,
however we still have Kconfig sybmols to specify if the RF or RK pin is
enabled.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-07 22:24:58 -05:00
Kumar Gala 49bab484df drivers: dma: sam_xdmac: Convert to devicetree
Convert sam_xdmac driver to utilize devicetree.  As part of the
controller binding we specify that dmas should contain a channel and the
perid for the DMA transaction.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-07 22:24:58 -05:00
Kumar Gala dff8715615 drivers: ethernet: sam_gmac: rework pin config
Reworked sam_gmac driver to get pin ctrl/mux configuration information
from the device tree instead of via Kconfig and defines in soc_pinmap.h

We remove defines from soc_pinmap.h that are no longer needed due to
getting all that information from devicetree.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-04 11:32:10 -05:00
Stephanos Ioannidis d2cd8a71bd dts: arm: atmel: Add MPU node for SAM D5x and E5x
The Atmel SAM D5x and E5x series SoCs include the ARM memory protection
unit that supports up to 8 memory regions.

This commit adds the missing device tree MPU node to `samd5x.dtsi`,
which is used by both the SAM D5x and E5x series SoCs.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-05-04 17:14:35 +02:00
Kumar Gala a918d301fe drivers: adc: adc_sam0: rework devicetree support
Rework the devicetree to utilize new DT_INST macros and extract per
instance data for clocks from devicetree.

We add a property ('calib-offset') for the SAM{D,E}5x family of SoCs
that is the bit position offset from ADC0 BIASCOMP in the NVM Software
Calibration Area Mapping.  For ADC0 this is typically 0 and for ADC1
this will be 14.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-29 08:02:36 -05:00
Kumar Gala 7a15afc1d4 drivers: flash: replace DT_FLASH_DEV_NAME with DT macro
Replace DT_FLASH_DEV_NAME with DT_CHOSEN_ZEPHYR_FLASH_CONTROLLER_LABEL.
We now set zephyr,flash-controller in the chosen node of the device
tree to the flash controller device.

NOTE: For a SoCs with on die flash, this points to the controller and
      not the 'soc-nv-flash' node.  Typically the controller is the
      parent of the 'soc-nv-flash' node).

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-27 18:43:20 -05:00
Kumar Gala fe573b6e23 dts: atmel: sam0: Add clocks for ADC and TCn devices
Add clock references for ADC and TC devices.  Update the bindings for
these devices to require clocks property and update the dtsi files to
have the clock info.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-25 13:33:56 -05:00
Kumar Gala cb8ee73692 dts: atmel sam: Add pinctrl support for SAM SPI
Add pinctl support for the SAM SPI device.  We update the SPI
binding to have pinctrl-0 bindings that are expected to have
at least phandles for MISO, MOSI, and SPCK, but might also have
various chip selects as well.

The pinctrl nodes will have an 'atmel,pins' property that describes the
GPIO port, pin and periphal configuration for that pin.

We update sam*-pinctrl.dtsi files with all the various pin ctrl
configuration operations supported by the given SoC family.  These
files are based on data extracted from the Atmel ASF HAL
(in include/sam<FAMILY>/pio/*.h).

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-25 09:29:54 -05:00
Stephanos Ioannidis 845d8852a5 dts: arm: atmel: samd5x: Fix CPU compatible
The SAM D5x and E5x series SoCs include the "Cortex-M4F" core, not the
FPU-less "Cortex-M4" core.

This commit fixes the incorrect CPU compatible for the SAM D5x and E5x
SoCs (note that this file is included by `same5x.dtsi`, which is used
as the base device tree header for the SAM E5x series).

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-24 06:27:58 -05:00
Gerson Fernando Budke 65c9b34abf soc: arm: atmel_sam: sam4s: Enable MPU
Add missing definitions to enable MPU support.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-04-24 10:16:10 +02:00
Gerson Fernando Budke adcfd09b1b soc: arm: atmel_sam: sam4e: Enable MPU/FPU
Add missing definitions to enable MPU and FPU support.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-04-24 10:16:10 +02:00
Kumar Gala 94fcf2efa1 drivers: adc: adc_sam_afec: rework device tree support
Reworked adc_sam_afec driver to utilize new DT_INST macros as part of
this rework we also now get pin ctrl/mux configuration information
from the device tree instead of via Kconfig and defines in soc_pinmap.h

We remove defines from dts_fixup.h and soc_pinmap.h and associated
Kconfig symbols that are no longer needed due to getting all that
information from devicetree.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-23 06:11:26 -05:00
Kumar Gala 170d09b448 dts: atmel: sam0: Update dmac to be a proper dma controller
Move the atmel,sam0-dmac binding under the dma binding dir and add
cell information for channel and trigger source.  Update the associated
dtsi files to match these changes.

This is in prep of ATMEL SAM0 SERCOMM devices like UART, I2C, and SPI to
user proper 'dmas' property to specify the dma info to use.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-22 21:34:21 -05:00
Kumar Gala 8357005ba1 dts: atmel: sam0: Add initial clock devicetree support
Add support for the GCLK, MCLK, and PM clock controllers.  Add bindings
and devicetree nodes associated with these clock controllers.  Also add
clock references for the SERCOM peripheral set to allow those drivers
(i2c, spi, uart) to utilize this information.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-22 21:34:21 -05:00
Stephanos Ioannidis 7f2ddd371f dts: arm: atmel: Rename samd.dtsi to samd2x.dtsi
This commit renames `samd.dtsi` to `samd2x.dtsi` since this DTS header
is specific to the SAM D2x series and its derivatives (e.g. SAM R21).

Note that the SAM D5x series uses a different DTS header file (i.e.
`samd5x.dtsi`) due to the vast differences, and the future SAM D1x will
have to use a separate DTS header to be sensible anyway.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-22 13:13:38 +02:00
Kumar Gala 1b0e4124da dts: atmel sam: Add pinctrl support for SAM TWI and TWIHS I2C
Add pinctl support for the SAM TWI and TWIHS I2C devices.  We update
the TWI and TWIHS I2C bindings to have pinctrl-0 bindings that are
expected to have 2 phandles to the TWCK & TWD pinctrl nodes.

The pinctrl nodes will have an 'atmel,pins' property that describes the
GPIO port, pin and periphal configuration for that pin.

We update sam*-pinctrl.dtsi files with all the various pin ctrl
configuration operations supported by the given SoC family.  These
files are based on data extracted from the Atmel ASF HAL
(in include/sam<FAMILY>/pio/*.h).

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-21 15:46:30 -05:00
Kumar Gala bdf58d11f0 dts: atmel sam: Add pinctrl support for SAM UART and USART
Add pinctl support for the SAM UART and SAM USART devices.  We update
the UART and USART bindings to have pinctrl-0 bindings that are expected
to have 2 phandles to the RX & TX pinctrl nodes.

The pinctrl nodes will have an 'atmel,pins' property that describes the
GPIO port, pin and periphal configuration for that pin.

We add sam*-pinctrl.dtsi files with all the various pin ctrl
configuration operations supported by the given SoC family.  These
files are based on data extracted from the Atmel ASF HAL
(in include/sam<FAMILY>/pio/*.h).

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-18 17:04:08 -05:00
Kumar Gala ebbb92d330 dts: atmel sam: gpio: Add support for atmel,pins property
The atmel,pins property will be utilized to describe pin mux
configuration.  The property will be a phandle-array in which the
phandle points to the given GPIO port the pin is on, the pin number, and
the mux configuration.

This change updates the atmel,sam-gpio binding to support that
phandle-array and updates the associated SoC dtsi files as well.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-18 17:04:08 -05:00
Stephanos Ioannidis 1472b417a7 dts: atmel: Add SAM E5x GMAC instance
This commit adds a GMAC instance to the SAM E5x device tree, along with
the refactoring necessary to specify the SAM E5x-specific components.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-17 04:56:28 -05:00
Gerson Fernando Budke 0ec1df07ca dts: arm: atmel: Add SAM4E GMAC phy-connection-type
The SAM4E GMAC version can use only MII as phy-connection-type. This
update the current default RMII value to MII.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-04-17 09:23:33 +03:00
Gerson Fernando Budke 03d02fab50 dts: arm: atmel: Add SAM 4E GMAC instance
This commit adds a GMAC instance to the SAM 4E device tree.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-04-17 09:23:33 +03:00
Kumar Gala 43a7d26603 drivers: entropy: replace CONFIG_ENTROPY_NAME with DT macro
Replace CONFIG_ENTROPY_NAME with DT_CHOSEN_ZEPHYR_ENTROPY_LABEL.  We now
set zephyr,entropy in the chosen node of the device tree to the entropy
device.

This allows us to remove CONFIG_ENTROPY_NAME from dts_fixup.h.  Also
remove any other stale ENTROPY related defines in dts_fixup.h files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-13 09:14:21 -05:00
Gerson Fernando Budke d4867ff058 dts: arm: atmel: sam3x: Fix SoC compatible
Atmel SAM3X is a Cortex-M3 SoC.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-04-13 07:34:05 -05:00
Kumar Gala c5153a2d2a dts: atmel: sam: cleanup flash / sram nodes
Move flash node under flash controller and sram nodes under soc as it
is for most SoC dts files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-09 15:19:21 -05:00
Kumar Gala 90f0217543 dts: soc: atmel: sam: Add pinctl container node
Group all the GPIO controllers under a pinctl node so that we have a
container for pinmux configuration data.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-09 13:34:46 -05:00
Kumar Gala 35cad0884a dts: soc: atmel: sam: cleanup node labels to match SoC docs
Update dts files to use node labels that match Atmel SoC docs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-09 09:02:19 -05:00
Stephanos Ioannidis 24dca57938 dts: arm: atmel: Add SAM V71 GMAC instance
This commit adds a GMAC instance to the SAM V71 device tree, with the
chip revision-specific hardware queue count.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-03-31 08:08:29 -05:00
Stephanos Ioannidis fbf89a7c77 dts: arm: atmel: Add SAM E70 GMAC instance
This commit adds a GMAC instance to the SAM E70 device tree, with the
chip revision-specific hardware queue count.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-03-31 08:08:29 -05:00
Alexander Wachter b96477dd69 SoC: SAM3x and SAM4: Add the Flash Controller to the DT
This commit adds Device-Tree instances of the Flash controller
to the SAM3X, SAM4E and SAM4S series. The Flash-Controller
is used to get the unique device identifier.

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2020-02-27 21:14:54 +01:00
Gerson Fernando Budke 86ceaf26b7 dts: arm: atmel: Add sam4s spi component info
Add spi device tree component definition.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-05 14:25:23 -06:00
Gerson Fernando Budke 527ebe131d dts: arm: atmel: Add sam4e device tree
Add device tree for Atmel sam4e SoC

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-04 17:51:41 -05:00
Gerson Fernando Budke 47c034e4d9 dts: arm: atmel: Add samv71 device tree
Add device tree for Atmel samv71 SoC.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-04 08:56:19 -06:00
Benjamin Valentin edb8df102f dts: atmel_sam0: fix location of flash and sram blocks
The blocks were moved into the soc block in samd5x.dtsi,
so we also have to move them for the the actual SoC definitions
that inherit from that.

Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2020-01-30 08:44:30 -06:00
Benjamin Valentin 2fef2002e8 soc: atmel_sam0: add SAM TRNG to DTS
We can use the SAM entropy node here.

Signed-off-by: Benjamin Valentin <benpicco@googlemail.com>
2020-01-23 12:40:59 +01:00
Benjamin Valentin fc7f458ab3 flash: sam0: Define LOCK_REGIONS in dts
The amount of lock regions differs between different sam0 MCUs.

	saml10:  2
	saml11:  4
	samd2x:	16
	saml2x: 16
	samd5x: 32

ASF does not provide a definition for this, so create a new one
in dts.

Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2020-01-14 11:12:33 -05:00
Benjamin Valentin 496ace1500 soc: atmel_sam0: Add SAME54
This adds supoprt for the Atmel SAME54 SoC.

The SAME5x/SAMD5x is a line of Cortex-M4F MCUs that share peripherals
with the sam0 Cortex-M0+ and saml1x Cortex-M23 parts.

Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2019-11-06 21:18:00 -06:00
Kumar Gala dc2cb92c4a dts: Add standard alias for watchdog
Introduce a standard watchdog alias 'watchdog0' that can be utilized
by sample/test code in the future.  This helps remove the need for
CONFIG_WDT_0_NAME in dts_fixup.h files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-11-06 13:51:20 -06:00
Piotr Mienkowski c249782bbc soc: add DTS PIO module nodes for sam3x series
This commit adds DTS PIO nodes for sam3x series SoCs.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2019-09-12 13:25:30 -05:00
Kumar Gala e8524965c5 dts: Add io-channel details to ADC nodes/bindings
Update the ADC bindings to include #io-channel-cells and update the
related dts files to set #io-channel-cells.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-09-07 10:25:02 -05:00
Kumar Gala b52b1b2222 dts: arm: Remove device_type = "memory" from SRAM nodes
The true mmio-sram nodes should not have had a 'device_type' property.
Remove it from the cases that we clearly know are SRAM.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-08-06 08:59:22 -04:00
Piotr Zięcik 7d56fc35fd dts: Add information about CPU frequency to the cpu nodes
This commit adds 'clock-frequency' property to the cpu nodes.
The clock frequency specified in the added property is used
during platform configuration. Examples:

- The SWO logger uses clock frequency to configure SWO output.
- Plenty of platforms need CPU clock specified for their HAL.
- Most of devices with USB needs information about CPU clock
  in order to configure USB clock source.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-07-17 21:53:36 +02:00
Kumar Gala 0bed1007ed dts: cleanup missing #{address,size}-cells
A few i2c and spi bus nodes were missing #address-cells and #size-cells
properties.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-06-20 22:48:57 -05:00
Ulf Magnusson a84ded74ea dts: Replace status = "ok" with status = "okay"
The DT spec. only has "okay" and not "ok". The Linux kernel has around
12k "okay"s and 300 "ok"s.

The scripts/dts scripts only check for "disabled", so should be safe re.
those at least.

The replacement was done with

    git ls-files | xargs sed -i 's/status\s*=\s*"ok"/status = "okay"/'

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-06-14 19:51:13 -05:00
Derek Hageman a4f3e628e5 drivers: counter: Add SAM0 basic counter support
This adds support for the basic timer counter (TC) found on SAM0
series parts.  This driver only supports running the counter
in 32 bit wide mode.  Since this mode explicitly slaves the odd
counters to the even ones, only instances of the even ones are
defined.

Tested with tests/drivers/counter/counter_basic_api on SAMD21.

Signed-off-by: Derek Hageman <hageman@inthat.cloud>
2019-05-28 09:23:44 -04:00
Kumar Gala 9260561c63 dts: atmel: Fix node name for device_id
The node name for device_id was device_id@0 it should be
device_id@80a00c to reflect the first register region

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-05-22 15:50:39 -05:00