-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
drivers: usb: udc: add Smartbond UDC driver #79184
drivers: usb: udc: add Smartbond UDC driver #79184
Conversation
Function dma_smartbond_set_channel_status() used incorrect condition to release state lock. In initialization function dma_smartbond_init() function dma_smartbond_set_channel_status() was called for each DMA channel and tried to release lock that was never taken. Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
f375211
to
1ea1e01
Compare
cd4894c
to
9d6522e
Compare
9d6522e
to
b95e7f3
Compare
Please add |
done |
6356fe9
to
6416c0c
Compare
386b9a9
6416c0c
to
386b9a9
Compare
386b9a9
to
8294832
Compare
LOG_INF("ep 0x%02x dequeue all", ep); | ||
|
||
lock_key = irq_lock(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That looks too easy, do you need to find and cancel DMA transfers in progress?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your are right, can you give me a quick tip on how to trigger this case so I can verify that it works correctly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed (scenario when this happens not tested though).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are few, (There was a simple one using shell commands to enqueue transfers, I have to bring it back). You can try CDC ACM sample, build it with CONFIG_SHELL and CONFIG_USBD_SHELL enabled. On Zephyr side enter shell command usbd select sample_usbd
.
python3
>>> import usb
>>> dev = usb.core.find(idVendor=0x2fe3, idProduct=0x0001)
>>> dev.detach_kernel_driver(0)
>>> #to set DTR
>>> dev.ctrl_transfer(0x21, 0x22, 3, 0, 0)
0
>>> #Read all DCD and DSR notifications
>>> dev.read(0x81, 100)
array('B', [161, 32, 0, 0, 0, 0, 2, 0, 1, 0])
>>> dev.read(0x81, 100)
array('B', [161, 32, 0, 0, 0, 0, 2, 0, 3, 0])
>>> #On Zephyr side 'usbd disable' should trigger dequeue transfers for endpoint 0x01
Code adds Smartbond UDC driver to be used with USB next stack. Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
Marks boards da1469x_dk_pro and da14695_dk_usb as supporting new usb driver support Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
8294832
to
59da6f0
Compare
Code adds USB UDC driver for Smartbond device.
Code was NOT tested with ISO endpoints yet.
It was tested with console, mass, and cdc_acm applications
Additionally small fix in DMA power management was needed.
Function dma_smartbond_set_channel_status() used incorrect
condition to release state lock.
In initialization function dma_smartbond_init() function
dma_smartbond_set_channel_status() was called for each DMA
channel and tried to release lock that was never taken.
Fixes #74662
Signed-off-by: Jerzy Kasenberg jerzy.kasenberg@codecoup.pl