gs_usb.h: document GS_CAN_FEATURE_REQ_USB_QUIRK_LPC546XX

The documents a workaround for a NXP chip errata on LPC546xx
controllers (Errata sheet LPC546xx / USB.15).

According to the document corruption can occur when the following
conditions are met:
* A TX (IN) transfer happens after a RX (OUT) transfer.
* The RX (OUT) transfer length is 4 + N * 16 (N >= 0) bytes.

Even though the struct gs_host_frame has a size of 76 bytes for a FD
frame, which does not apply to the above rule, corruption could be
seen.

Adding a dummy byte to break the second condition also on transfer
lengths with 4 + N * 8 bytes reliably circumvents USB transfer data
corruption.

The firmware can now request this quirk by setting
GS_CAN_FEATURE_REQ_USB_QUIRK_LPC546XX.
This commit is contained in:
Marc Kleine-Budde 2021-12-30 14:32:48 +01:00 committed by fenugrec
parent 41f9e7d64f
commit fea8b8603f

View File

@ -43,6 +43,7 @@ THE SOFTWARE.
/* #define GS_CAN_FEATURE_USER_ID (1<<6) */
#define GS_CAN_MODE_PAD_PKTS_TO_MAX_PKT_SIZE (1<<7)
#define GS_CAN_MODE_FD (1<<8) /* switch device to CAN-FD mode */
/* #define GS_CAN_FEATURE_REQ_USB_QUIRK_LPC546XX (1<<9) */
#define GS_CAN_FEATURE_LISTEN_ONLY (1<<0)
#define GS_CAN_FEATURE_LOOP_BACK (1<<1)
@ -53,6 +54,10 @@ THE SOFTWARE.
#define GS_CAN_FEATURE_USER_ID (1<<6)
#define GS_CAN_FEATURE_PAD_PKTS_TO_MAX_PKT_SIZE (1<<7)
#define GS_CAN_FEATURE_FD (1<<8) /* device supports CAN-FD */
/* request workaround for LPC546XX erratum USB.15:
* let host driver add a padding byte to each USB frame
*/
#define GS_CAN_FEATURE_REQ_USB_QUIRK_LPC546XX (1<<9)
#define GS_CAN_FLAG_OVERFLOW (1<<0)
#define GS_CAN_FLAG_FD (1<<1) /* is a CAN-FD frame */