All of lore.kernel.org
 help / color / mirror / Atom feed
From: pisa@cmp.felk.cvut.cz
To: qemu-devel@nongnu.org
Cc: Stefan Hajnoczi <stefanha@gmail.com>,
	Konrad Frederic <fred.konrad@greensocs.com>,
	Deniz Eren <deniz.eren@icloud.com>,
	Oliver Hartkopp <socketcan@hartkopp.net>,
	Pavel Pisa <pisa@cmp.felk.cvut.cz>
Subject: [Qemu-devel] [PATCH 0/6] CAN bus support for QEMU (SJA1000 PCI so far)
Date: Fri,  6 Jan 2017 00:11:22 +0100	[thread overview]
Message-ID: <cover.1483655893.git.pisa@cmp.felk.cvut.cz> (raw)

From: Pavel Pisa <pisa@cmp.felk.cvut.cz>

Hello Stefan and others,

I have found some time over holidays. I have rebased patches
and checked that the CAN bus emulation works with QEMU-2.8 release.

The work has been started by Jin Yang in the frame of GSoC 2013 slot
contributed by RTEMS project which has been looking for environment
to allow develope and test CAN drivers for multiple CPU rachitectures.

I have menthored the project and then done substantial code cleanup
and update to QOM. Deniz Eren then used emulation for SJA1000 base card
driver development for other operating system and contributed
PCM-3680I support.

Some page about the project

  https://rtime.felk.cvut.cz/can/can-qemu/

RTLWS 2015 article

  http://rtime.felk.cvut.cz/publications/public/rtlws2015-qemu-can.pdf

and slides

  http://rtime.felk.cvut.cz/publications/public/rtlws2015-qemu-can-slides.pdf

GitHub repository with can-pci branch for 2.3, 2.4, 2.7 and 2.8
version if QEMU is available there

  https://github.com/CTU-IIG/qemu

There are more unsolved things in the code still (for example freeze
and migration would not work. CAN controllers use proper QOM model
but bus/interconnection emulation uses simple broadcast connection
which is required for CAN, but it is not based on QEMU bus model).

CAN-FD support would be interesting but it is missing and there
is almost zero chance that I find spare time to start such
work without more people contribute and or funded project
at university which would allow to seek between my colleagues
for cooperation.

But I believe that (even in its actual state) provided solution
is great help for embedded systems developers when they can connect
SocketCAN from one or more embedded systems running in virtual
environment together or with Linux host SocketCAN virtual
or real bus interfaces.

We have even tested our generic CANopen device configured
for CANopen 401 profile for generic I/O running in the virtual
system which can control GPIO inputs/outputs through virtual
industrial I/O card. This industrial I/O card support
would worth to be included in QEMU mainline as well but
it would require even more effort to get it into mainline
acceptable state then this CAN support even that we have
mainlined UIO and Comedi drivers for that this card hardware
to Linux mainline long time ago.

Generally QEMU can be interesting setup which allows
to test complete industrial applications in virtual
environment even before real hardware is availabe.

Best wishes and sucesfull year 2017,

Pavel

Deniz Eren (4):
  CAN bus PCM-3680I PCI (dual SJA1000 channel) emulation added.
  Fixed IRQ problem for CAN device can_pcm3680_pci.
  Minor clean-up of can_pcm3680_pci.
  CAN bus MIOe-3680 PCI (dual SJA1000 channel) emulation added.

Pavel Pisa (2):
  CAN bus simple SJA1000 PCI card emulation for QEMU
  CAN bus Kvaser PCI CAN-S (single SJA1000 channel) emulation added.

 default-configs/pci.mak   |   2 +
 hw/Makefile.objs          |   1 +
 hw/can/Makefile.objs      |   8 +
 hw/can/can_core.c         | 349 +++++++++++++++++
 hw/can/can_kvaser_pci.c   | 364 ++++++++++++++++++
 hw/can/can_mioe3680_pci.c | 325 ++++++++++++++++
 hw/can/can_pci.c          | 239 ++++++++++++
 hw/can/can_pcm3680_pci.c  | 325 ++++++++++++++++
 hw/can/can_sja1000.c      | 943 ++++++++++++++++++++++++++++++++++++++++++++++
 hw/can/can_sja1000.h      | 163 ++++++++
 include/can/can_emu.h     | 123 ++++++
 11 files changed, 2842 insertions(+)
 create mode 100644 hw/can/Makefile.objs
 create mode 100644 hw/can/can_core.c
 create mode 100644 hw/can/can_kvaser_pci.c
 create mode 100644 hw/can/can_mioe3680_pci.c
 create mode 100644 hw/can/can_pci.c
 create mode 100644 hw/can/can_pcm3680_pci.c
 create mode 100644 hw/can/can_sja1000.c
 create mode 100644 hw/can/can_sja1000.h
 create mode 100644 include/can/can_emu.h

-- 
1.9.1

             reply	other threads:[~2017-01-05 23:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-05 23:11 pisa [this message]
2017-01-05 23:11 ` [Qemu-devel] [PATCH 1/6] CAN bus simple SJA1000 PCI card emulation for QEMU pisa
2017-01-05 23:11 ` [Qemu-devel] [PATCH 2/6] CAN bus Kvaser PCI CAN-S (single SJA1000 channel) emulation added pisa
2017-01-05 23:11 ` [Qemu-devel] [PATCH 3/6] CAN bus PCM-3680I PCI (dual " pisa
2017-01-05 23:11 ` [Qemu-devel] [PATCH 4/6] Fixed IRQ problem for CAN device can_pcm3680_pci pisa
2017-01-05 23:11 ` [Qemu-devel] [PATCH 5/6] Minor clean-up of can_pcm3680_pci pisa
2017-01-05 23:11 ` [Qemu-devel] [PATCH 6/6] CAN bus MIOe-3680 PCI (dual SJA1000 channel) emulation added pisa
2017-01-05 23:22 ` [Qemu-devel] [PATCH 0/6] CAN bus support for QEMU (SJA1000 PCI so far) no-reply
2017-01-06  9:38   ` Pavel Pisa
2017-10-24 23:12 pisa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1483655893.git.pisa@cmp.felk.cvut.cz \
    --to=pisa@cmp.felk.cvut.cz \
    --cc=deniz.eren@icloud.com \
    --cc=fred.konrad@greensocs.com \
    --cc=qemu-devel@nongnu.org \
    --cc=socketcan@hartkopp.net \
    --cc=stefanha@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.