hw/arm/sabrelite: Add FlexCAN support
Status from this message: Applied to target-arm.next, thanks.
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v6 Latest7 patches 1 replyApplied
- v57 patches 2 repliesSuperseded
- v47 patches 4 repliesSuperseded
Earlier versions · 3
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v3 | 7 patches | 14 replies | Superseded | |
| v2 | 7 patches | 14 replies | Superseded | |
| v1 | 6 patches | 10 replies | Superseded |
Changes in v6 from the cover letter
- fixed buffer overflow due to unchecked input in flexcan_enabled_mailbox_count
- rebased onto latest master
- Link to v5: https://lore.kernel.org/qemu-devel/[email protected]/
Patches in v6 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/7 | hw/arm/sabrelite: Open code DEFINE_MACHINE_ARMhw/ | +18 | 0 replies | |
| 2/7 | hw/arm/sabrelite: Introduce class SabreliteMachineStatehw/ | +18 | 0 replies | |
| 3/7 | hw/misc/imx6_ccm: Add PLL3 and CAN clockhw/ hw/ include/ +1 more | +31 | 0 replies | |
| 4/7 | hw/net/can/flexcan: NXP FlexCAN core emulationMAINTAINERS hw/ hw/ +4 more | +1770 | 0 replies | |
| 5/7 | hw/arm: Plug FlexCAN into FSL_IMX6 and Sabrelitehw/ hw/ hw/ +1 more | +60 | 0 replies | |
| 6/7 | tests: Add qtests for FlexCANMAINTAINERS tests/ tests/ | +423 | 0 replies | |
| 7/7 | docs/arm/sabrelite: Mention FlexCAN supportdocs/ docs/ | +25 | 0 replies |
Reviews trailers per patch
All 7 patches have a Reviewed-by or Acked-by.
| Patch | Pavel Pisa | Bernhard Beschow |
|---|---|---|
| 1/7 | T-b R-b | R-b |
| 2/7 | T-b R-b | R-b |
| 3/7 | T-b R-b | R-b |
| 4/7 | T-b R-b | R-b |
| 5/7 | T-b R-b | R-b |
| 6/7 | T-b R-b | R-b |
| 7/7 | T-b R-b | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v6 0/7] hw/arm/sabrelite: Add FlexCAN support
This series adds emulation of the FlexCAN CAN controller, version 2, found in NXP i.MX6 series SoCs. The controller is integrated into fsl-imx6 and the Sabrelite ARM board.
The chip has two FlexCAN controllers, but the Linux Sabrelite device tree enables only one by default. Linux kernel with both controllers enabled has been tested to work properly (using a custom device tree).
See docs/system/devices/can.rst for an example of QEMU command line invocation.
More information about the implementation can be found in my bachelor thesis [1].
Changes from v5:
- fixed buffer overflow due to unchecked input in flexcan_enabled_mailbox_count
- rebased onto latest master
- Link to v5: https://lore.kernel.org/qemu-devel/[email protected]/
Changes from v4 to v5:
- renamed can in fsl-imx6 to flexcan
- corrected attribution for definitions borrowed from the Linux kernel
- rebased onto latest master
- Link to v4: https://lore.kernel.org/qemu-devel/[email protected]/
Changes from v3 to v4:
- corrected attribution for definitions borrowed from the Linux kernel
- rebased onto latest master
- Link to v3: https://lore.kernel.org/qemu-devel/[email protected]/
Changes from v2 to v3:
- moved variable declarations to the top-of-the-block
- cleanup
- removed redundant license boilerplate
- rebased onto latest master
- Link to v2: https://lore.kernel.org/qemu-devel/[email protected]/
Changes from v1 to v2:
- removed DPRINTF (turned into traces or guest errors)
- removed gotos and unnecessary continues
- register memory region shortened to actual length w/o padding
- make flexcan_* fns private
- used DEVICE(s)->canonical_path instead of allocating new strings
- changed DEVICE_NATIVE_ENDIAN to DEVICE_LITTLE_ENDIAN
- removed ugly USE macro
- used enums instead of define sequences in flexcan.c
- fixed FlexCAN KConfig conf (fixes build on non-arm-softmmu)
- fixed style and other issues from Bernhard's review
- better wording in docs
- rebased onto latest master
- Link to v1: https://lore.kernel.org/qemu-devel/[email protected]
Thanks Bernhard Beschow for the review and his patience. I borrowed some fixes from his flexcan branch at [2].
[1] http://dspace.cvut.cz/bitstream/handle/10467/122654/F3-BP-2025-Bobek-Matyas-BP_Bobek_FlexCAN_final_4.pdf
[2] https://github.com/shentok/qemu/tree/flexcan
Matyáš Bobek (7):
hw/arm/sabrelite: Open code DEFINE_MACHINE_ARM hw/arm/sabrelite: Introduce class SabreliteMachineState hw/misc/imx6_ccm: Add PLL3 and CAN clock hw/net/can/flexcan: NXP FlexCAN core emulation hw/arm: Plug FlexCAN into FSL_IMX6 and Sabrelite
tests: Add qtests for FlexCAN docs/arm/sabrelite: Mention FlexCAN support
MAINTAINERS | 9 + docs/system/arm/sabrelite.rst | 1 + docs/system/devices/can.rst | 24 + hw/arm/Kconfig | 1 + hw/arm/fsl-imx6.c | 29 + hw/arm/sabrelite.c | 68 +- hw/misc/imx6_ccm.c | 24 + hw/misc/trace-events | 2 + hw/net/Kconfig | 5 + hw/net/can/flexcan.c | 1396 +++++++++++++++++++++++++++++++++ hw/net/can/flexcan_regs.h | 197 +++++ hw/net/can/meson.build | 1 + hw/net/can/trace-events | 18 + include/hw/arm/fsl-imx6.h | 6 + include/hw/misc/imx6_ccm.h | 4 + include/hw/misc/imx_ccm.h | 1 + include/hw/net/flexcan.h | 145 ++++ tests/qtest/flexcan-test.c | 421 ++++++++++ tests/qtest/meson.build | 1 + 19 files changed, 2343 insertions(+), 10 deletions(-) create mode 100644 hw/net/can/flexcan.c create mode 100644 hw/net/can/flexcan_regs.h create mode 100644 include/hw/net/flexcan.h create mode 100644 tests/qtest/flexcan-test.c
Signature · 1 line
2.54.0