Skip to content

Conversation

@benpicco
Copy link
Contributor

The USB peripheral is the same as in previous SAM0 MCUs, but the clock setup is different.

split off from #14685

@benpicco benpicco added area: USB Universal Serial Bus platform: Microchip SAM Microchip SAM Platform (formerly Atmel SAM) labels Oct 23, 2019
@benpicco benpicco requested a review from galak October 23, 2019 10:47
@zephyrbot
Copy link

zephyrbot commented Oct 23, 2019

All checks passed.

checkpatch (informational only, not a failure)

-:52: WARNING:SPACE_BEFORE_TAB: please, no space before tabs
#52: FILE: drivers/usb/device/usb_dc_sam0.c:181:
+#define SAM0_USB_IRQ_CONNECT(n) ^I^I^I^I\$

-:53: WARNING:SUSPECT_CODE_INDENT: suspect code indent for conditional statements (8, 8)
#53: FILE: drivers/usb/device/usb_dc_sam0.c:182:
+	do {							\
+	IRQ_CONNECT(DT_INST_0_ATMEL_SAM0_USB_IRQ_##n,		\

- total: 0 errors, 2 warnings, 100 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

Your patch has style problems, please review.

NOTE: Ignored message types: AVOID_EXTERNS BRACES CONFIG_EXPERIMENTAL CONST_STRUCT DATE_TIME FILE_PATH_CHANGES MINMAX NETWORKING_BLOCK_COMMENT_STYLE PRINTK_WITHOUT_KERN_LEVEL SPLIT_STRING VOLATILE

NOTE: If any of the errors are false positives, please report
      them to the maintainers.

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

@benpicco benpicco requested a review from Sizurka October 30, 2019 13:03
Copy link
Contributor

@jfischer-no jfischer-no left a comment

Choose a reason for hiding this comment

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

Please split it in three commits: changes for PAD? settings, changes for clock setup, and changes for IRQ connect and enable.

Newer SoCs like SAME54 have multiple IRQs for the USB peripheral.
Automatically enable all IRQs configured in the DTS.

Signed-off-by: Benjamin Valentin <[email protected]>
On newer sam0 SoCs peripherals are enabled through the MCLK
instead of the PM register.

Use the MCLK register if it's availiable.

Signed-off-by: Benjamin Valentin <[email protected]>
Newer SoCs like SAME54 provide dedicated registers to store
the USB trim configuration.

Use those registers if they are defined in ASF to access the
calibration data.

Signed-off-by: Benjamin Valentin <[email protected]>
@benpicco
Copy link
Contributor Author

benpicco commented Nov 6, 2019

Ok, I've split up the commit.

@stephanosio stephanosio added this to the v2.2.0 milestone Nov 22, 2019
@carlescufi carlescufi merged commit 2ffb8dd into zephyrproject-rtos:master Dec 11, 2019
@benpicco benpicco deleted the same54-usb branch December 11, 2019 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: USB Universal Serial Bus platform: Microchip SAM Microchip SAM Platform (formerly Atmel SAM)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants