-
Notifications
You must be signed in to change notification settings - Fork 7.6k
drivers: usb: dwc2: esp32: Add support #85600
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
base: main
Are you sure you want to change the base?
Conversation
4353128
to
5843cdc
Compare
The following west manifest projects have changed revision in this Pull Request:
✅ All manifest checks OK Note: This message is automatically posted and updated by the Manifest GitHub Action. |
5843cdc
to
a3360fa
Compare
a3360fa
to
2d10bca
Compare
static void udc_dwc2_irq_enable_func_##n(const struct device *dev) \ | ||
{ \ | ||
IRQ_CONNECT(DT_INST_IRQN(n), \ | ||
DT_INST_IRQ(n, priority), \ | ||
udc_dwc2_isr_handler, \ | ||
DEVICE_DT_INST_GET(n), \ | ||
DW_IRQ_FLAGS(n)); \ | ||
\ | ||
irq_enable(DT_INST_IRQN(n)); \ | ||
} \ | ||
\ | ||
static void udc_dwc2_irq_disable_func_##n(const struct device *dev) \ | ||
{ \ | ||
irq_disable(DT_INST_IRQN(n)); \ | ||
} \ | ||
UDC_DWC2_IRQ_DT_INST_DEFINE(n) \ |
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.
Looks like a stray change that was not justified in the commit message. Anyway, I do not agree with it, you should use irq_enable()/irq_disable().
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.
for the time being we are using Espressif's interrupt allocator
I thought about turning it into a quirk
API call, but it would be probably disliked as a solution
do you have a different suggestion?
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.
I do not understand the problem with irq_enable/irq_disable. How was it accepted not to use generic API for your platform? Are you working on fixing it?
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.
I did some checking, and the current behavior for ESP Xtensa chips is: Zephyr's API is used to control non-muxed interrupt lines (such as wifi, systimer). Most peripherals such as USB allow routing sources through an interrupt matrix and for this, the interrupt controller API is used. I'm not sure how much this deviates from the standard implementation, but I believe significant changes would be needed to otherwise accommodate this.
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.
@jfischer-no, for esp32 device, we still need the irq calls in there, otherwise it is no-go for now. Would you review it again?
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.
I still cannot find an explanation as to why your platform cannot use generic functions, or why this has not been done all the time is supported in Zephyr.
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.
ESP chips use an interrupt controller peripheral to route interrupt sources coming from each peripheral to the CPU's IRQ lines. For this reason we implement an interrupt controller driver and call it's API directly from all ESP drivers. A few peripherals have their interrupt source lines connected directly to the CPU IRQ's, thus having dedicated lines (e.g. wifi). As USB OTG is routed using the Interrupt Matrix peripheral we need to connect it's interrupt source to the IRQ accessing HAL LL calls. As this can't be accomplished using Zephyr's irq_connect()
without making significant changes to the way we manage interrupts, we are asking to treat interrupt allocation as a quirk
for the time being. We are already discussing internally if we should rework the interrupt system implementation and we did a review recently, so this will still be an ongoing work for us. Also, we are still not implementing static interrupt allocation even for IRQ lines that are static and don't need routing.
samples/subsys/usb/cdc_acm/boards/esp32s3_devkitm_procpu.overlay
Outdated
Show resolved
Hide resolved
@jfischer-no |
2d10bca
to
f764216
Compare
efae400
efae400
to
5cdf02d
Compare
5cdf02d
to
cecbed3
Compare
CI fix #92314 |
cecbed3
to
a11a757
Compare
Add USB device driver support for ESP32 devices with USB-OTG peripheral. Signed-off-by: Raffael Rostagno <[email protected]>
Limit RX FIFO size allocation to a percentage of the total SPRAM available, to cap allocation according to memory size. Signed-off-by: Raffael Rostagno <[email protected]>
Add USB-OTG peripheral support to ESP32S3. Signed-off-by: Raffael Rostagno <[email protected]>
Add default zephyr_udc0 label for USB-OTG. Signed-off-by: Raffael Rostagno <[email protected]>
a11a757
to
60ee567
Compare
Add USB mass storage sample overlay for esp32s3_devkitm board. Signed-off-by: Raffael Rostagno <[email protected]>
60ee567
to
de96473
Compare
|
Add USB device driver support for ESP32 devices with USB-OTG peripheral.