summaryrefslogtreecommitdiff
path: root/port/musb
AgeCommit message (Collapse)Author
2026-10-08fix(port/musb): Use the mapped channel in usbh_kill_urb on SiFli 52/56zelong_666
usbh_kill_urb() derived both the channel to mask and the channel to flush from the endpoint number ((urb->ep->bEndpointAddress & 0x0f) and bEndpointAddress itself), which only holds when the channel number equals the endpoint number. When MUSB_SIFLI_EP_MAP is in use the channel is assigned by sifli_ep_map_alloc(): the SiFli 52/56 host channels are pooled per direction (IN ch1..ch4, OUT ch5..ch7), so e.g. EP1 OUT lives on ch5 and EP2 OUT on ch6. Masking by endpoint number therefore clears the interrupt enable of an unrelated channel and leaves the aborted channel's interrupt armed, and musb_fifo_flush() is asked to clean the FIFO of a different endpoint than the one the URB was using. Take the channel from pipe->chidx, which is the channel the URB was submitted on, and rebuild the byte musb_fifo_flush() expects (direction in bit7, channel in bits 6:0). Non-mapped MUSB ports keep their previous behaviour. EP0 is unaffected either way: with chidx 0 and bEndpointAddress 0 both forms resolve to bit 0 and byte 0.
2026-10-08fix(port/musb): Re-arm the EP0 TX interrupt in musb_control_urb_initzelong_666
The data channels re-arm their interrupt enable in their own musb_bulk_urb_init()/musb_intr_urb_init()/musb_iso_urb_init(), but the EP0 path never did: TXIE.EP0 was only ever set once, in usb_hc_init(). usbh_kill_urb() masks the interrupt of the channel that owns the abandoned URB, and EP0 always lives on channel 0, so aborting a single control transfer clears TXIE.EP0 for good. Every later control transfer then completes in the hardware but never raises an EP0 interrupt, so usbh_submit_urb() runs into errout_timeout (-USB_ERR_TIMEOUT) and enumeration can never succeed again until the next usb_hc_init(). Seen on a host that lost its peer in the middle of enumeration (phone reboot or re-plug): one control transfer timed out during the port reset and every following one repeated "Failed to get device descriptor, errorcode:-14" forever, until the board was rebooted. Arming TXIE.EP0 here keeps EP0 symmetric with the data channels, so a single timed-out control transfer no longer disables EP0 for the rest of the session.
2026-09-26update(port): change low level api from weak to extern, users must implement ↵sakumisu
this Signed-off-by: sakumisu <[email protected]>
2026-09-23fix(port): safely check urb->hcpriv validation in usbh_kill_urbsakumisu
Signed-off-by: sakumisu <[email protected]>
2026-09-21fix(port/musb): Fix EP1 channel conflict on SiFli 52/56 serieszelong_666
On the SiFli 52/56 series the MUSB host channels are direction-limited (ch2-ch4 are IN-only, ch5-ch7 are OUT-only, ch1 can do both; ch0 is EP0), but the first-free channel allocation is direction-blind and can assign a channel that cannot carry the transfer. Allocate channels through a per-direction endpoint map instead: each (direction, endpoint number) pair keeps a dedicated channel from the correct pool while its URBs are in flight, and the slot is freed when the pipe is released. Busy and map-failure collisions are logged. Fixes USB tethering transfer failures with phones whose RNDIS data endpoints are EP1 IN + EP1 OUT (e.g. OPPO) or numbered above 7 (e.g. EP14/EP15; numbers 1-15 all work since they only live in the 4-bit TEP field). The generic musb_pipe_alloc() path is kept for other MUSB ports.
2026-09-17docs: update docsakumisu
Signed-off-by: sakumisu <[email protected]>
2026-09-09fix(port/musb): Fix MUSB host TX/RX FIFO flush failXiaoming Xi
musb_fifo_flush() selected the CSR side for device role, which is opposite to the host direction. Now IN endpoints (host RX) flush RXCSR, OUT endpoints (host TX) flush TXCSR, and EP0 writes the FLUSHFIFO bit in the csr0 high byte, so a timed-out/killed bulk OUT no longer leaves TXPKTRDY and the FIFO uncleaned.
2026-08-03fix(security): add check for sem&mq&thread and delete remain sources if ↵sakumisu
alloc fail Signed-off-by: sakumisu <[email protected]>
2026-06-30update(port/musb/usb_glue_sifli): add zephyr supportsakumisu
Signed-off-by: sakumisu <[email protected]>
2026-05-22fix(port/musb/usb_glue_sifli): fix phy and reset configsakumisu
Signed-off-by: sakumisu <[email protected]>
2026-02-03fix(port/musb/usb_hc_musb): fix stall to stalledsakumisu
Signed-off-by: sakumisu <[email protected]>
2026-01-28docs: release v1.6.0v1.6.0sakumisu
Signed-off-by: sakumisu <[email protected]>
2026-01-18feat(musb): add support for ti microcontroller with musb ipMDLZCOOL
2026-01-18fix(musb): fix `musb_pipe_alloc` missing `bus` parameter, and fix host ↵MDLZCOOL
checks in irq Includes: - add `struct usbh_bus *bus` parameter to `musb_pipe_alloc` - correct call in `usbh_submit_urb` - correct host checks in irq
2025-11-27update(port/musb/usb_hc_musb): reenable pipe alloc & freesakumisu
Signed-off-by: sakumisu <[email protected]>
2025-08-11feat: Add MUSB IP without multipoint feature supportHalfSweet
2025-08-07fix(port/musb/usb_hc_musb): add rxmap & txmap configsakumisu
Signed-off-by: sakumisu <[email protected]>
2025-08-06feat(port): add urb->complete in usbh_kill_urbsakumisu
Signed-off-by: sakumisu <[email protected]>
2025-08-05update(port/musb): add mode checksakumisu
Signed-off-by: sakumisu <[email protected]>
2025-08-02docs: update readmesakumisu
Signed-off-by: sakumisu <[email protected]>
2025-07-30Revert "fix(port): reset sem when pipe free"sakumisu
This reverts commit ccd435496036cdceebb6d35df3edeb16695b0548.
2025-07-28update(port/musb/usb_hc_musb): check urb for iso to support iso latersakumisu
Signed-off-by: sakumisu <[email protected]>
2025-07-28update(port/musb): If ep control register group exists, do not use epidx ↵sakumisu
register Signed-off-by: sakumisu <[email protected]>
2025-07-28update(port): remove all ips CONFIG_USBDEV_EP_NUM & CONFIG_USBHOST_PIPE_NUMsakumisu
Signed-off-by: sakumisu <[email protected]>
2025-07-27fix(port): reset sem when pipe freesakumisu
Signed-off-by: sakumisu <[email protected]>
2025-07-27Fix a bug where the channel might not be releasedudoudou
2025-07-13feat: support siflisakumisu
Signed-off-by: sakumisu <[email protected]>
2025-05-10update(port): add sof supportsakumisu
Signed-off-by: sakumisu <[email protected]>
2025-05-10update(port/musb/usb_hc_musb): flush and disable ep intr in usbh_kill_urbsakumisu
Signed-off-by: sakumisu <[email protected]>
2025-05-10update(port): add USB_ASSERT_MSG for ep num checksakumisu
Signed-off-by: sakumisu <[email protected]>
2025-05-09fix(port/musb/usb_dc_musb): enable USB_TXCSRH1_MODE for in epsakumisu
Signed-off-by: sakumisu <[email protected]>
2025-05-06update: add USB_ASSERT_MSG for common casesakumisu
Signed-off-by: sakumisu <[email protected]>
2025-01-25fix(port/musb/usb_hc_musb): fix musb_write_packet size with ↵sakumisu
urb->transfer_buffer_length Signed-off-by: sakumisu <[email protected]>
2024-08-21fix: fix -Wunused-parameter warning with -Wextra cflagsakumisu
2024-07-26feat(port): add remote wakeup apisakumisu
2024-07-15update(port/musb/usb_hc_musb): add portpower bit for commit e4b56ceesakumisu
2024-07-09fix(port/musb/usb_dc_musb.c): usbd_ep_is_stalled api err.liuhy
2024-07-08feat(port): implement usbd_ep_is_stalled apisakumisu
2024-06-28fix(port): enter section before alloc pipesakumisu
2024-06-15update(port/musb): config fifo from fifo table, add beken and es32 gluesakumisu
2024-06-14remove ununsed codesakumisu
2024-06-09update port readmesakumisu
2024-06-09update(port/musb/usb_dc_musb): remove ununsed codesakumisu
2024-06-06fix(port/musb/usbh_hc_musb): fix missing leave critical when return with errorsakumisu
2024-05-14update(port/musb): add sunxi glue for checksakumisu
2024-04-29remove port param in usbd_get_port_speedsakumisu
2024-04-23update missing licensesakumisu
2024-04-19clear urb timeout after take sem, follow 76f58b93sakumisu
2024-04-18do not clear timeout in irq,urb init will sometime call irq before take semsakumisu
2024-03-28mark errorcode with USB_ERR_SHUTDOWN when kill urbsakumisu