Commit Graph

2989 Commits

Author SHA1 Message Date
hathach 7211dd18b4
more dcache fix 2023-05-19 13:42:26 +07:00
hathach 5dae5e1292
ehci fix dcache clean when control endpoint failed 2023-05-19 13:32:49 +07:00
hathach f26a93908e
only clean/invalidate dcache on imxrt if memory is not in DTCM 2023-05-19 10:56:52 +07:00
hathach ec4bd39a92
refactor ehci: add attached_buffer for dcache invalidate for IN transfer 2023-05-18 16:41:06 +07:00
hathach 27acaa013b
refactor ehci, since usbh only queue 1 TD per queue head 2023-05-18 15:44:08 +07:00
hathach 49e2aabc81
EHCI more improvement
- more dcache clean/invalidate
- extract init_periodic_list()
- improve isr list handling
2023-05-18 13:45:38 +07:00
hathach a0aea52a11
more cache, fix an similar issue with OHCI when removing an queue head 2023-05-18 12:39:53 +07:00
hathach e4f4ad5bc3
use weak local for dcache function to skip if() 2023-05-18 10:21:11 +07:00
hathach a3e017bfd2
EHCI adding dcahe support, passing enumertaion 2023-05-18 10:04:48 +07:00
hathach eb89df4115
adding hcd_dcache_clean/hcd_dcache_invalidate 2023-05-17 16:14:35 +07:00
hathach a9aa0e3a1a
fix error on EHCI causes xfer error in non-queued qhd which cause memory fault 2023-05-16 11:10:44 +07:00
hathach 1e998ce3bd
usbd: fix control transfer issue for chipidea hs when previous status and new setup complete in the same isr frame
change usbd edpt busy/stalled/claimed value to 0/1 instead of
(true/false) since they are 1-bit field.
2023-05-16 11:09:23 +07:00
hathach 2c48050993
add various check for disconncted device, also fix #1511 un-roll recursive hub removal with usbh queue 2023-05-16 11:09:22 +07:00
hathach 1c4f22a54c
EHCI: fix xfer failed with disconnected device as stalled
- change CFG_TUH_ENDPOINT_MAX to 16 (max endpoint pair per device) if
not defined
- change QHD_MAX for EHCI, should be user configurable and more
optimized in the future
2023-05-16 11:09:22 +07:00
hathach 206d63e038
correct EHCI reporting failed xfer (instead of stalled) when device is unplugged 2023-05-16 11:09:21 +07:00
hathach c0e4c02b9d allow imxrt build with dual exmaples 2023-05-10 11:15:11 +07:00
hathach 77f0726361 fix ehci issue with portsc when enable port power and port reset
fix attached device not regconized if attached before power on
2023-05-09 17:32:14 +07:00
hathach 654f182176 build host examples with imx 2023-05-08 00:24:48 +07:00
hathach 6945c594d5 update all device cmake example for imx 2023-05-07 22:09:08 +07:00
hathach f15f79df5d cmake work well with imxrt 2023-05-06 15:14:54 +07:00
hathach cda5ab8b25 more temp work 2023-05-05 19:15:19 +07:00
hathach 8a9d2b4b75 wip 2023-05-04 23:29:37 +07:00
hathach 1763eede48
more update to host serial API 2023-04-28 22:14:14 +07:00
hathach fb5fe3360f
allow call tuh cdc with blocking (callback = NULL)
- tuh_cdc_set_control_line_state()
- tuh_cdc_set_baudrate()
- tuh_cdc_set_line_coding()
2023-04-28 21:50:54 +07:00
hathach 0a43a7b418
improve host serial drivers
- tuh_control_xfer() update xfer result to user_data if complete
callback = NULL (sync/blocking)
- refactor host serial driver for acm/ftdi/cp210x
2023-04-28 19:13:25 +07:00
hathach 190acc1fb0 add aligned(4) for cdc_line_coding_t 2023-04-28 11:12:03 +07:00
Jean-Baptiste Theou 8f47976639 cdc: fix line_coding aligment
While calling tud_cdc_n_get_line_coding, the structure is copied into
the destination.

Dump of assembler code for function tud_cdc_n_get_line_coding:
   0x000193f4 <+0>:	mov.w	r2, #2112	@ 0x840
0x000193f8 <+4>:	ldr	r3, [pc, #20]	@ (0x19410
<tud_cdc_n_get_line_coding+28>)
   0x000193fa <+6>:	mla	r0, r2, r0, r3
=> 0x000193fe <+10>:	ldr.w	r3, [r0, #6]
   0x00019402 <+14>:	str	r3, [r1, #0]

On some platform (tested on LPC55S28), the address needs to be 4-bytes
aligned. Without this, the address is

(gdb) p &_cdcd_itf.line_coding
$3 = (cdc_line_coding_t *) 0x40100006 <_cdcd_itf+6>

which leads to a HardFault. With this fix

(gdb) p &_cdcd_itf.line_coding
$5 = (cdc_line_coding_t *) 0x40100008 <_cdcd_itf+8>

and the function can be called properly

Signed-off-by: Jean-Baptiste Theou <jb@thing.com>
2023-04-27 15:48:15 -10:00
hathach 732686cc10 add tuh_cdc_set_baudrate() 2023-04-27 23:22:10 +07:00
hathach ee58278ed2 add code to calculate divisor from baudrate for ftdi 2023-04-27 23:08:25 +07:00
hathach 8214f0f497 clean up 2023-04-27 17:40:08 +07:00
hathach c10f52b237 forgot to add cp210x header 2023-04-27 17:39:02 +07:00
hathach 438387be8c more refactor 2023-04-27 17:32:56 +07:00
hathach 86f6fd17ed cp210x seems to work well 2023-04-27 17:09:21 +07:00
hathach a32ef1cde1 more host serial refactor 2023-04-27 16:32:42 +07:00
hathach 9698a088db refactor acm function 2023-04-27 15:29:44 +07:00
hathach 85d9925d24 refactor ftdi driver 2023-04-27 15:20:04 +07:00
hathach 293a6222f8 rename ftdi_host to ftdi_sio 2023-04-27 11:08:42 +07:00
hathach 45169d833d hacky, but ftdi work with hard code baudrate = 9600 2023-04-26 22:36:17 +07:00
Ha Thach 964e7ebf21
Merge pull request #2013 from tannewt/imx_1042
Handle iMX RT 1042 usb naming
2023-04-24 16:53:24 +07:00
Ha Thach 8ede566c41
Merge pull request #2039 from hathach/add-cmake-build
Add cmake build
2023-04-24 16:43:40 +07:00
hathach a4d5d51549 add wip note 2023-04-24 16:24:06 +07:00
hathach 5254202b20 minor update 2023-04-24 11:54:58 +07:00
hathach 0afe1b3684 example run well with cmake for imxrt 2023-04-21 18:10:28 +07:00
Jacek Fedorynski 9bf97e3e52 [rp2040] Make writes to SIE_CTRL aware of concurrent access
This commit makes it so that when setting the START_TRANS bit in the
SIE_CTRL register, along with some other bits, we first set all the
other bits, then wait some cycles, and then set the START_TRANS bit.

Doing so protects against a situation where the USB controller is
reading the register at the same time and gets an incorrect value.

This mirrors the procedure already applied to buffer control
registers.
2023-04-20 20:23:31 +02:00
Reimu NotMoe c0674142a8
Merge branch 'hathach:master' into master 2023-04-18 23:20:25 +08:00
Reimu NotMoe 9002dc7067 Use __GNUC__ macro to determine if __has_attribute is supported 2023-04-18 17:27:42 +08:00
Ha Thach c3a60ed355
Merge pull request #1920 from mikee47/fix/midi-definition
MIDI_CIN_NOTE_ON definition transposed with MIDI_CIN_NOTE_OFF
2023-04-18 10:43:52 +07:00
Reimu NotMoe fa8f3731c1 Implement TU_BSWAP{16,32} correctly for Microchip XC16 2023-04-17 21:02:12 +08:00
Reimu NotMoe d97b6d57de Fix compatibility with the latest Microchip XC16 compiler 2023-04-17 20:20:22 +08:00
Scott Shawcroft 2cda9b60c9
Handle iMX RT 1042 usb naming 2023-04-06 15:45:23 -07:00