summaryrefslogtreecommitdiff
path: root/src/portable/chipidea
AgeCommit message (Collapse)Author
2026-07-18fix(ci_fs): address code-review findings in host/device drivershathach
Host (hcd_ci_fs.c): - Release the speculatively-armed sibling BDT on the NAK path (IN only) as well as on completion, so a NAKed multi-packet IN no longer leaks a BDT that stays own=1 and blocks every same-direction pipe. Both paths now go through a single release_sibling_bd() helper (was a copy-pasted disarm). - Clear the ENTIRE shared BDT (both directions) on bus reset; clearing only the IN half left a stale OUT/SETUP descriptor after a disconnect mid-OUT, blocking the first control transfer on re-enumeration. - Size bda[] to span the whole BDT (2*2*4) so STAT-indexed access is within the declared array bounds (was out-of-declared-bounds, benign via union). Shared (ci_fs_type.h): - Hoist buffer_descriptor_t and the TOK_PID enum out of the device and host drivers into the shared header so the identical definitions cannot drift. Board (kinetis_k): - Drop a redundant local in board_get_unique_id. Build-verified: host + kinetis k/kl/k32l + MCX. HIL: frdm_k64f host 2/2 (cdc_msc_hid + device_info); frdm_kl25z device core suite green with the relocated definitions.
2026-07-17fix(ci_fs host): release stale sibling BDT on multi-packet completionhathach
hcd_ci_fs shares a single BDT set across all pipes. prepare_packets() speculatively arms the sibling (odd^1) BDT of a multi-packet transfer so it can ping-pong without NAKs. When such a transfer ends early (a short IN packet) or fails, the still-owned sibling was never released, permanently blocking the shared BDT for every other pipe. This deadlocked a 2nd device enumerating behind a hub while another device issued descriptor reads (host/device_info with CDC+MSC): the MSC's control transfers could never acquire the BDT, so it never got Set Address. Release the sibling in process_tokdne()'s completion path, but ONLY for a multi-packet transfer (length > max_packet_size): a single-packet transfer never arms a sibling, so that BDT slot may legitimately belong to another pipe's in-flight transfer and must not be disturbed (doing so unconditionally corrupts concurrent transfers, e.g. the CDC bulk-IN vs MSC enum in host/cdc_msc_hid). Mirrors the equivalent device-side fix in dcd_ci_fs.c; the host needs the multi-packet guard because its BDT set is shared across pipes. Verified on frdm_k64f (HIL): host/device_info now enumerates both CDC+MSC behind a hub, host/cdc_msc_hid still mounts the MSC (no regression). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01ExGPLP5eU43LR7o6yYLpNi
2026-07-17dcd_ci_fs: disarm sibling BDT on short-packet OUT completionhathach
A multi-packet OUT transfer speculatively arms both even/odd BDTs to avoid NAK. When the host ends the transfer early with a short packet, the sibling BDT was left armed (own=1), desyncing the even/odd ping-pong so the next OUT packet landed at buffer+max_packet_size instead of buffer and the stack read stale data. Disarm the sibling on completion. Fixes device/mtp on Kinetis (GetDeviceInfo command was received into the wrong buffer half -> hang). Pre-existing (MSC only arms single-packet command receives so it never hit the double-buffer path). HIL: frdm_kl25z & frdm_k64f device 13/13. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01ExGPLP5eU43LR7o6yYLpNi
2026-07-17migrate NXP Kinetis khci to chipidea ci_fs driver (device + host)hathach
Complete the khci -> chipidea ci_fs migration that was started for device (commit d70403f1f "host is not yet"): - device: switch kinetis_k/kl/k32l (Makefiles + k32l CMake) to dcd_ci_fs.c - host: add hcd_ci_fs.c (port of hcd_khci.c onto ci_fs_regs_t) and switch all Kinetis families to it; remove src/portable/nxp/khci entirely - enable host examples (device_info, cdc_msc_hid) for mcu:KINETIS_K - README: merge the KL and K32L2 rows into a single "KL, K32L" ci_fs row hcd_ci_fs.c also fixes two pre-existing host bugs found via HIL on frdm_k64f (present in the old hcd_khci.c too): - data toggle was flipped on a NAK in suspend_transfer; a NAK transfers no data so the toggle must be preserved, else the retried bulk packet is silently discarded by the device (MSC CBW/CSW hang). See comment in file. - prepare_packets asserted and dropped a transfer when the single shared BDT was still owned by an in-flight transfer under concurrent activity; now it returns busy and resume_transfer defers/retries on the next SOF. HIL verified on frdm_k64f: device 13/13, host cdc_msc_hid (CDC mount + echo + MSC mount, through a hub). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01ExGPLP5eU43LR7o6yYLpNi
2026-07-14dcd(ci_hs): stale overlay fix; run usbtest on lpcxpresso43s67hathach
- dcd_edpt_stall flushes the primed buffer (ENDPTFLUSH), but the aborted transfer's dQH overlay can be left ACTIVE with mid-transfer state; the next prime after clear-halt then resumes the stale overlay instead of loading the fresh qtd, so post-halt IN reads return mid-buffer data (usbtest case 13 'buf[32] = 56 (not 0)', with case 18 failing downstream of the same corruption in the full battery). qhd_start_xfer now clears overlay.active alongside overlay.halted before linking the new qtd. - test/hil(hfp): drop lpcxpresso43s67's device/usbtest skip - the historical first-case wedge no longer reproduces on this branch, and with the overlay fix the board runs 30/30 on its Fresco xHCI host (previously 28/30 with deterministic case 13/18 failures). mimxrt1064_evk (imxrt dcache path) 30/30 regression-clean. - docs(hil skill): document the external hifiphile rig - pool test/hil/hfp.json, SSH-reachable from htpc/ci with no outbound SSH, exercised by the CI hil-tinyusb (hfp.json) job; never run HIL against it during development unless the user explicitly asks. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_017TQZrFfU3K4Y198aLsUpBC
2026-07-02license: use SPDX identifiers for src/ headers (#3749)Ha Thach
* license: use SPDX identifiers for src/ headers Replace the full ~20-line MIT license boilerplate on every src/ file with a two-line SPDX tag (SPDX-FileCopyrightText + SPDX-License-Identifier), following the REUSE convention used by CircuitPython and the Linux kernel. Removes ~3500 lines of duplicated boilerplate.
2026-04-17fix some Wconversion warningshathach
2026-03-07Fix ep_ctrl_mask() corrupting opposite direction's ENDPTCTRL bitsgab-k
2026-03-06Merge pull request #3528 from hathach/improve-iar-warningsHa Thach
Add IAR warning flags to CMake build and resolve warnings
2026-03-06fix warningshathach
2026-03-05update PORTSC1Zixun LI
Signed-off-by: Zixun LI <[email protected]>
2026-03-05ci_hs: add deinit supportZixun LI
Signed-off-by: Zixun LI <[email protected]>
2025-12-16Merge remote-tracking branch 'tinyusb/master' into support-nxp-rw612HiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2025-12-16support hpmicro chipsZhihong Chen
Signed-off-by: Zhihong Chen <[email protected]>
2025-12-14bsp: nxp: add support for RW612 (FRDM-RW612)gab-k
- Added `rw61x` family support. - Added `frdm_rw612` board support. - Update `get_deps.py` to include mcux-sdk for RW61x. - Add ci_hs_rw61x include to ChipIdea HS driver and enable host examples.
2025-12-10hw/mcu: add support for NXP RW612gab-k
2025-11-26change tu_fifo_buffer_info_t layouthathach
2025-11-19Merge remote-tracking branch 'tinyusb/master' into ↵HiFiPhile
copilot/fix-dcd-edpt-xfer-issue Signed-off-by: HiFiPhile <[email protected]>
2025-11-17make TUP_DCD_EDPT_ISO_ALLOC i.e dcd_edpt_iso_alloc()/dcd_edpt_iso_activate() ↵hathach
as default driver implementation. dcd_edpt_close() is deprecated and will be removed from all driver in the future.
2025-11-17make TUP_DCD_EDPT_ISO_ALLOC i.e dcd_edpt_iso_alloc()/dcd_edpt_iso_activate() ↵hathach
as default driver implementation. dcd_edpt_close() is deprecated and will be removed from all driver in the future.
2025-10-22Apply suggestions from code reviewZixun LI
Co-authored-by: Copilot <[email protected]>
2025-10-22Fix copilot issuesMengsk
Signed-off-by: Mengsk <[email protected]>
2025-10-22Add is_isr parameter to dcd_edpt_xfer and dcd_edpt_xfer_fifocopilot-swe-agent[bot]
Co-authored-by: HiFiPhile <[email protected]>
2025-05-04dcd/ci_hs: add vbus charge option.HiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2025-04-29attach debouncing fixed issue with port1 highspeed on imxrthathach
2025-04-23rename and expose tuh_bus_info_get() to applicationhathach
2024-11-30Fix HCD build.HiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2024-11-30Fix typo.HiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2024-11-30Restore DCache clean/invalidate.HiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2024-11-30Merge branch 'master' into rt1170HiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2024-11-25change dcd_dcache_*() API return type from void to boolhathach
2024-11-02Replace cache clean/invalidate by MPU config.HiFiPhile
2024-10-14change dcd_init() return from void to boolhathach
2024-10-14change the tusb_rhport_init_t struct, exclude the rhport to make API more ↵hathach
consistent
2024-10-11hcd_init() take init structhathach
2024-10-11change dcd_init() to take rhport structhathach
2024-05-27chipidea/mimxrt: Add support for dcd_sof_enable().Andrew Leech
2024-04-05minor update bsphathach
2024-04-05fix pre-commit formathathach
2024-04-02Merge branch 'master' into MCXhathach
2024-02-24only save/restore CLK_RECOVER_IRC_EN/CTRL if ↵hathach
FSL_FEATURE_USB_KHCI_IRC48M_MODULE_CLOCK_ENABLED is defined to 1
2024-02-24frdm k64f usb work well, add kinetis_k to ci cmakehathach
2024-02-20MCX A and MCX N merged to MCX familyJerry Palacios
2024-02-07frdmmcxa153 files addedJerry Palacios
2023-08-07Add tuh_rhport_is_active() and tuh_rhport_reset_bus()hathach
- also improve ehci bus reset - seperate bus reset delay and contact debouncing delay in enumeration
2023-08-03add lpc43 familyhathach
2023-07-24Merge pull request #2173 from hathach/imxrt-dcache-alignHa Thach
change dcache clean/invalidate return type to bool
2023-07-24change dcache clean/invalidate return type to boolhathach
add tu_assert() check for aligned 32byte address for imxrt
2023-07-24rename CFG_TUSB_MEM_SECTION to CFG_TUD_MEM_SECTION in device stackhathach
CFG_TUD_MEM_SECTION is default to CFG_TUSB_MEM_SECTION
2023-07-14Fix host buffer alignment settingScott Shawcroft