qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/7] hw/net/can/xlnx-versal-canfd: Miscellaneous fixes
@ 2024-08-27  3:49 Doug Brown
  2024-08-27  3:49 ` [PATCH v2 1/7] hw/net/can/xlnx-versal-canfd: Fix interrupt level Doug Brown
                   ` (8 more replies)
  0 siblings, 9 replies; 21+ messages in thread
From: Doug Brown @ 2024-08-27  3:49 UTC (permalink / raw)
  To: Francisco Iglesias, Pavel Pisa
  Cc: Jason Wang, Paolo Bonzini, qemu-devel, Doug Brown

This series fixes several problems I ran into while trying to simulate
the AMD/Xilinx Versal CANFD controller in the xlnx-versal-virt machine
using Xilinx's v6.6_LTS_2024.1 kernel. With all of these patches
applied, everything works correctly alongside actual CAN devices.

- IRQs were accidentally not being delivered due to having a level other
  than 1. The IRQ count in /proc/interrupts in Linux was stuck at 0.
- Incoming CAN FD frames were being treated as non-FD.
- The CAN IDs were garbled in both RX and TX directions.
- The ESI and BRS flags were not being handled.
- The byte ordering was wrong in the data in both directions.
- Incoming CAN FD frames with DLC = 1-7 weren't handled correctly.
- The FIFO read_index and store_index wrapping logic was incorrect.

I don't have any actual Versal hardware to compare behavior against, but
with these changes, it plays nicely with SocketCAN on the host system.

Changes in v2:
- Added handling of ESI and BRS flags, ensured frame->flags is initialized
- Switched to use common can_dlc2len() and can_len2dlc() functions
- Added fix for FIFO wrapping problems I observed during stress testing

Doug Brown (7):
  hw/net/can/xlnx-versal-canfd: Fix interrupt level
  hw/net/can/xlnx-versal-canfd: Fix CAN FD flag check
  hw/net/can/xlnx-versal-canfd: Translate CAN ID registers
  hw/net/can/xlnx-versal-canfd: Handle flags correctly
  hw/net/can/xlnx-versal-canfd: Fix byte ordering
  hw/net/can/xlnx-versal-canfd: Simplify DLC conversions
  hw/net/can/xlnx-versal-canfd: Fix FIFO issues

 hw/net/can/xlnx-versal-canfd.c | 173 ++++++++++++++-------------------
 1 file changed, 72 insertions(+), 101 deletions(-)

-- 
2.34.1



^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2024-09-09 13:56 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-27  3:49 [PATCH v2 0/7] hw/net/can/xlnx-versal-canfd: Miscellaneous fixes Doug Brown
2024-08-27  3:49 ` [PATCH v2 1/7] hw/net/can/xlnx-versal-canfd: Fix interrupt level Doug Brown
2024-08-29 13:08   ` Pavel Pisa
2024-08-27  3:49 ` [PATCH v2 2/7] hw/net/can/xlnx-versal-canfd: Fix CAN FD flag check Doug Brown
2024-08-29 13:09   ` Pavel Pisa
2024-08-27  3:49 ` [PATCH v2 3/7] hw/net/can/xlnx-versal-canfd: Translate CAN ID registers Doug Brown
2024-08-29 13:11   ` Pavel Pisa
2024-08-27  3:49 ` [PATCH v2 4/7] hw/net/can/xlnx-versal-canfd: Handle flags correctly Doug Brown
2024-08-29 13:13   ` Pavel Pisa
2024-08-27  3:49 ` [PATCH v2 5/7] hw/net/can/xlnx-versal-canfd: Fix byte ordering Doug Brown
2024-08-29 13:15   ` Pavel Pisa
2024-08-27  3:49 ` [PATCH v2 6/7] hw/net/can/xlnx-versal-canfd: Simplify DLC conversions Doug Brown
2024-08-29 13:17   ` Pavel Pisa
2024-09-04 23:33   ` Francisco Iglesias
2024-08-27  3:49 ` [PATCH v2 7/7] hw/net/can/xlnx-versal-canfd: Fix FIFO issues Doug Brown
2024-08-29 13:24   ` Pavel Pisa
2024-08-30  0:11     ` Doug Brown
2024-09-06 16:35   ` Francisco Iglesias
2024-09-06 14:36 ` [PATCH v2 0/7] hw/net/can/xlnx-versal-canfd: Miscellaneous fixes Peter Maydell
2024-09-06 15:48   ` Francisco Iglesias
2024-09-09 13:55 ` Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).