mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-09-06 09:55:55 +00:00
docs/can: convert to restructuredText
Buglink: https://gitlab.com/qemu-project/qemu/-/issues/527 Signed-off-by: Lucas Ramage <lucas.ramage@infinite-omicron.com> Message-id: 20220105205628.5491-1-oxr463@gmx.us Reviewed-by: Peter Maydell <peter.maydell@linaro.org> [PMM: Move to docs/system/devices/ rather than top-level; fix a pre-existing typo in passing] Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
3cda85b203
commit
87f14eaa51
|
@ -82,6 +82,7 @@ Emulated Devices
|
|||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
devices/can.rst
|
||||
devices/ivshmem.rst
|
||||
devices/net.rst
|
||||
devices/nvme.rst
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
QEMU CAN bus emulation support
|
||||
==============================
|
||||
|
||||
CAN Bus Emulation Support
|
||||
=========================
|
||||
The CAN bus emulation provides mechanism to connect multiple
|
||||
emulated CAN controller chips together by one or multiple CAN busses
|
||||
(the controller device "canbus" parameter). The individual busses
|
||||
|
@ -32,34 +31,39 @@ emulated environment for testing and RTEMS GSoC slot has been donated
|
|||
to work on CAN hardware emulation on QEMU.
|
||||
|
||||
Examples how to use CAN emulation for SJA1000 based boards
|
||||
==========================================================
|
||||
|
||||
----------------------------------------------------------
|
||||
When QEMU with CAN PCI support is compiled then one of the next
|
||||
CAN boards can be selected
|
||||
|
||||
(1) CAN bus Kvaser PCI CAN-S (single SJA1000 channel) boad. QEMU startup options
|
||||
(1) CAN bus Kvaser PCI CAN-S (single SJA1000 channel) board. QEMU startup options::
|
||||
|
||||
-object can-bus,id=canbus0
|
||||
-device kvaser_pci,canbus=canbus0
|
||||
Add "can-host-socketcan" object to connect device to host system CAN bus
|
||||
|
||||
Add "can-host-socketcan" object to connect device to host system CAN bus::
|
||||
|
||||
-object can-host-socketcan,id=canhost0,if=can0,canbus=canbus0
|
||||
|
||||
(2) CAN bus PCM-3680I PCI (dual SJA1000 channel) emulation
|
||||
(2) CAN bus PCM-3680I PCI (dual SJA1000 channel) emulation::
|
||||
|
||||
-object can-bus,id=canbus0
|
||||
-device pcm3680_pci,canbus0=canbus0,canbus1=canbus0
|
||||
|
||||
another example:
|
||||
Another example::
|
||||
|
||||
-object can-bus,id=canbus0
|
||||
-object can-bus,id=canbus1
|
||||
-device pcm3680_pci,canbus0=canbus0,canbus1=canbus1
|
||||
|
||||
(3) CAN bus MIOe-3680 PCI (dual SJA1000 channel) emulation
|
||||
(3) CAN bus MIOe-3680 PCI (dual SJA1000 channel) emulation::
|
||||
|
||||
-device mioe3680_pci,canbus0=canbus0
|
||||
|
||||
|
||||
The ''kvaser_pci'' board/device model is compatible with and has been tested with
|
||||
''kvaser_pci'' driver included in mainline Linux kernel.
|
||||
the ''kvaser_pci'' driver included in mainline Linux kernel.
|
||||
The tested setup was Linux 4.9 kernel on the host and guest side.
|
||||
Example for qemu-system-x86_64:
|
||||
|
||||
Example for qemu-system-x86_64::
|
||||
|
||||
qemu-system-x86_64 -accel kvm -kernel /boot/vmlinuz-4.9.0-4-amd64 \
|
||||
-initrd ramdisk.cpio \
|
||||
|
@ -69,7 +73,7 @@ Example for qemu-system-x86_64:
|
|||
-device kvaser_pci,canbus=canbus0 \
|
||||
-nographic -append "console=ttyS0"
|
||||
|
||||
Example for qemu-system-arm:
|
||||
Example for qemu-system-arm::
|
||||
|
||||
qemu-system-arm -cpu arm1176 -m 256 -M versatilepb \
|
||||
-kernel kernel-qemu-arm1176-versatilepb \
|
||||
|
@ -84,24 +88,23 @@ Example for qemu-system-arm:
|
|||
The CAN interface of the host system has to be configured for proper
|
||||
bitrate and set up. Configuration is not propagated from emulated
|
||||
devices through bus to the physical host device. Example configuration
|
||||
for 1 Mbit/s
|
||||
for 1 Mbit/s::
|
||||
|
||||
ip link set can0 type can bitrate 1000000
|
||||
ip link set can0 up
|
||||
|
||||
Virtual (host local only) can interface can be used on the host
|
||||
side instead of physical interface
|
||||
side instead of physical interface::
|
||||
|
||||
ip link add dev can0 type vcan
|
||||
|
||||
The CAN interface on the host side can be used to analyze CAN
|
||||
traffic with "candump" command which is included in "can-utils".
|
||||
traffic with "candump" command which is included in "can-utils"::
|
||||
|
||||
candump can0
|
||||
|
||||
CTU CAN FD support examples
|
||||
===========================
|
||||
|
||||
---------------------------
|
||||
This open-source core provides CAN FD support. CAN FD drames are
|
||||
delivered even to the host systems when SocketCAN interface is found
|
||||
CAN FD capable.
|
||||
|
@ -113,7 +116,7 @@ on the board.
|
|||
Example how to connect the canbus0-bus (virtual wire) to the host
|
||||
Linux system (SocketCAN used) and to both CTU CAN FD cores emulated
|
||||
on the corresponding PCI card expects that host system CAN bus
|
||||
is setup according to the previous SJA1000 section.
|
||||
is setup according to the previous SJA1000 section::
|
||||
|
||||
qemu-system-x86_64 -enable-kvm -kernel /boot/vmlinuz-4.19.52+ \
|
||||
-initrd ramdisk.cpio \
|
||||
|
@ -125,7 +128,7 @@ is setup according to the previous SJA1000 section.
|
|||
-device ctucan_pci,canbus0=canbus0-bus,canbus1=canbus0-bus \
|
||||
-nographic
|
||||
|
||||
Setup of CTU CAN FD controller in a guest Linux system
|
||||
Setup of CTU CAN FD controller in a guest Linux system::
|
||||
|
||||
insmod ctucanfd.ko || modprobe ctucanfd
|
||||
insmod ctucanfd_pci.ko || modprobe ctucanfd_pci
|
||||
|
@ -150,19 +153,19 @@ Setup of CTU CAN FD controller in a guest Linux system
|
|||
/bin/ip link set $ifc up
|
||||
done
|
||||
|
||||
The test can run for example
|
||||
The test can run for example::
|
||||
|
||||
candump can1
|
||||
|
||||
in the guest system and next commands in the host system for basic CAN
|
||||
in the guest system and next commands in the host system for basic CAN::
|
||||
|
||||
cangen can0
|
||||
|
||||
for CAN FD without bitrate switch
|
||||
for CAN FD without bitrate switch::
|
||||
|
||||
cangen can0 -f
|
||||
|
||||
and with bitrate switch
|
||||
and with bitrate switch::
|
||||
|
||||
cangen can0 -b
|
||||
|
||||
|
@ -170,29 +173,16 @@ The test can be run viceversa, generate messages in the guest system and capture
|
|||
in the host one and much more combinations.
|
||||
|
||||
Links to other resources
|
||||
========================
|
||||
------------------------
|
||||
|
||||
(1) CAN related projects at Czech Technical University, Faculty of Electrical Engineering
|
||||
http://canbus.pages.fel.cvut.cz/
|
||||
(2) Repository with development can-pci branch at Czech Technical University
|
||||
https://gitlab.fel.cvut.cz/canbus/qemu-canbus
|
||||
(3) RTEMS page describing project
|
||||
https://devel.rtems.org/wiki/Developer/Simulators/QEMU/CANEmulation
|
||||
(4) RTLWS 2015 article about the project and its use with CANopen emulation
|
||||
http://cmp.felk.cvut.cz/~pisa/can/doc/rtlws-17-pisa-qemu-can.pdf
|
||||
(5) GNU/Linux, CAN and CANopen in Real-time Control Applications
|
||||
Slides from LinuxDays 2017 (include updated RTLWS 2015 content)
|
||||
https://www.linuxdays.cz/2017/video/Pavel_Pisa-CAN_canopen.pdf
|
||||
(6) Linux SocketCAN utilities
|
||||
https://github.com/linux-can/can-utils/
|
||||
(7) CTU CAN FD project including core VHDL design, Linux driver,
|
||||
test utilities etc.
|
||||
https://gitlab.fel.cvut.cz/canbus/ctucanfd_ip_core
|
||||
(8) CTU CAN FD Core Datasheet Documentation
|
||||
http://canbus.pages.fel.cvut.cz/ctucanfd_ip_core/Progdokum.pdf
|
||||
(9) CTU CAN FD Core System Architecture Documentation
|
||||
http://canbus.pages.fel.cvut.cz/ctucanfd_ip_core/ctu_can_fd_architecture.pdf
|
||||
(10) CTU CAN FD Driver Documentation
|
||||
http://canbus.pages.fel.cvut.cz/ctucanfd_ip_core/driver_doc/ctucanfd-driver.html
|
||||
(11) Integration with PCIe interfacing for Intel/Altera Cyclone IV based board
|
||||
https://gitlab.fel.cvut.cz/canbus/pcie-ctu_can_fd
|
||||
(1) `CAN related projects at Czech Technical University, Faculty of Electrical Engineering <http://canbus.pages.fel.cvut.cz>`_
|
||||
(2) `Repository with development can-pci branch at Czech Technical University <https://gitlab.fel.cvut.cz/canbus/qemu-canbus>`_
|
||||
(3) `RTEMS page describing project <https://devel.rtems.org/wiki/Developer/Simulators/QEMU/CANEmulation>`_
|
||||
(4) `RTLWS 2015 article about the project and its use with CANopen emulation <http://cmp.felk.cvut.cz/~pisa/can/doc/rtlws-17-pisa-qemu-can.pdf>`_
|
||||
(5) `GNU/Linux, CAN and CANopen in Real-time Control Applications Slides from LinuxDays 2017 (include updated RTLWS 2015 content) <https://www.linuxdays.cz/2017/video/Pavel_Pisa-CAN_canopen.pdf>`_
|
||||
(6) `Linux SocketCAN utilities <https://github.com/linux-can/can-utils>`_
|
||||
(7) `CTU CAN FD project including core VHDL design, Linux driver, test utilities etc. <https://gitlab.fel.cvut.cz/canbus/ctucanfd_ip_core>`_
|
||||
(8) `CTU CAN FD Core Datasheet Documentation <http://canbus.pages.fel.cvut.cz/ctucanfd_ip_core/Progdokum.pdf>`_
|
||||
(9) `CTU CAN FD Core System Architecture Documentation <http://canbus.pages.fel.cvut.cz/ctucanfd_ip_core/ctu_can_fd_architecture.pdf>`_
|
||||
(10) `CTU CAN FD Driver Documentation <http://canbus.pages.fel.cvut.cz/ctucanfd_ip_core/driver_doc/ctucanfd-driver.html>`_
|
||||
(11) `Integration with PCIe interfacing for Intel/Altera Cyclone IV based board <https://gitlab.fel.cvut.cz/canbus/pcie-ctu_can_fd>`_
|
Loading…
Reference in a new issue