Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

devicetree: atmel sam0: Convert UART to DT_INST and full devicetree #24572

Merged
merged 4 commits into from
Apr 23, 2020

Conversation

galak
Copy link
Collaborator

@galak galak commented Apr 21, 2020

Add clock support for MCLK, GCLK, and PM to allow SAM0 drivers to be full devicetree based. Also move to proper dma devicetree support.

@galak galak requested review from stephanosio, mnkp and nandojve April 21, 2020 20:52
@galak galak added area: Devicetree platform: Microchip SAM Microchip SAM Platform (formerly Atmel SAM) labels Apr 21, 2020
@zephyrbot
Copy link
Collaborator

zephyrbot commented Apr 21, 2020

All checks are passing now.

Tip: The bot edits this comment instead of posting a new one, so you can check the comment's history to see earlier messages.

galak added 4 commits April 22, 2020 08:14
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 <[email protected]>
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 <[email protected]>
Add a common header for SAM0 drivers to use to extract data from
devicetree.  The initial set of macros are for get the MCLK A*MASK
register address for clock enablement and a set of macros for use with
DMA to get the channel and trigger source or 0xff if there is no dmas
property.

Signed-off-by: Kumar Gala <[email protected]>
Rework the devicetree to utilize new DT_INST macros and extract per
instance data for clocks and dma from devicetree.  We update the
atmel,sam0-uart binding for dma to replace the rxdma and txdma
properties with proper 'dmas' property.

Signed-off-by: Kumar Gala <[email protected]>
@stephanosio
Copy link
Member

Verified working on SAM E54.

trigger source.

For example dmas for TX, RX on SERCOM3
dmas = <&dmac 0 0xb>, <&dmac 0 0xa>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think important add MCU model when given example. For SAMR21 SERCOM3 triggers are 0x8 and 0x7.
Not sure about dma channels, but I believe should be 1 and 0, for instance.

For example the MCU xxxx dmas for TX, RX on SERCOM3
dmas = <&dmac 1 0xb>, <&dmac 0 0xa>;

@nandojve
Copy link
Member

I tested normal UART with SAMD20 and SAMR21 using shell.
I tested async UART with SAMR21 running tests/drivers/uart/uart_async_api (#24610).

@galak galak merged commit bd639fc into zephyrproject-rtos:master Apr 23, 2020
@galak galak deleted the dt-sam0-uart branch April 23, 2020 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Boards area: Devicetree platform: Microchip SAM Microchip SAM Platform (formerly Atmel SAM)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants