From patchwork Thu Sep 3 21:37:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Pisa X-Patchwork-Id: 1357072 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=cmp.felk.cvut.cz Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjFGK6dtWz9sTK for ; Fri, 4 Sep 2020 08:04:41 +1000 (AEST) Received: from localhost ([::1]:39784 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDxLT-0002hp-P3 for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2020 18:04:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39290) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDwx9-0004PK-P5 for qemu-devel@nongnu.org; Thu, 03 Sep 2020 17:39:31 -0400 Received: from relay.felk.cvut.cz ([2001:718:2:1611:0:1:0:70]:35516) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDwx6-00042U-Rn for qemu-devel@nongnu.org; Thu, 03 Sep 2020 17:39:31 -0400 Received: from cmp.felk.cvut.cz (haar.felk.cvut.cz [147.32.84.19]) by relay.felk.cvut.cz (8.15.2/8.15.2) with ESMTP id 083LcNoI031667; Thu, 3 Sep 2020 23:38:23 +0200 (CEST) (envelope-from pisa@cmp.felk.cvut.cz) Received: from haar.felk.cvut.cz (localhost [127.0.0.1]) by cmp.felk.cvut.cz (8.14.0/8.12.3/SuSE Linux 0.6) with ESMTP id 083LcMWB025218; Thu, 3 Sep 2020 23:38:22 +0200 Received: (from pisa@localhost) by haar.felk.cvut.cz (8.14.0/8.13.7/Submit) id 083LcMjb025217; Thu, 3 Sep 2020 23:38:22 +0200 From: pisa@cmp.felk.cvut.cz To: qemu-devel@nongnu.org, Paolo Bonzini Subject: [PATCH v2 0/7] CTU CAN FD core support Date: Thu, 3 Sep 2020 23:37:17 +0200 Message-Id: X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-FELK-MailScanner-Information: X-MailScanner-ID: 083LcNoI031667 X-FELK-MailScanner: Found to be clean X-FELK-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-0.098, required 6, BAYES_00 -0.50, KHOP_HELO_FCRDNS 0.40, SPF_HELO_NONE 0.00, SPF_NONE 0.00) X-FELK-MailScanner-From: pisa@cmp.felk.cvut.cz X-FELK-MailScanner-Watermark: 1599773906.10116@Bdef7FVpcZDu1YlvxW/4lw Received-SPF: none client-ip=2001:718:2:1611:0:1:0:70; envelope-from=pisa@cmp.felk.cvut.cz; helo=relay.felk.cvut.cz X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/03 17:39:24 X-ACL-Warn: Detected OS = ??? X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marek Vasut , Vikram Garhwal , Jiri Novak , Stefan Hajnoczi , Deniz Eren , Markus Armbruster , Oleksij Rempel , Konrad Frederic , Jan Kiszka , Jan Charvat , Oliver Hartkopp , Ondrej Ille , Pavel Pisa Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Pavel Pisa CTU CAN FD is an open source soft core written in VHDL. It originated in 2015 as Ondrej Ille's project at the Department of Measurement of FEE at CTU. Integration for Xilinx Zynq and Intel based SoCs is available as well as support for PCIe integration of the core. The core sources https://gitlab.fel.cvut.cz/canbus/ctucanfd_ip_core The controller model and QEMU CAN subsystem extension to CAN FD has been implemented in frame of bachelor theses of Jan Charvat. The development branch ctu-canfd in CTU local project repository https://gitlab.fel.cvut.cz/canbus/qemu-canbus More CAN bus related project from Czech Technical University in Prague, Faculty of Electrical Engineering at http://canbus.pages.fel.cvut.cz/ Patches v2 updates: - CTU CAN FD IP core emulation tested on x86 host with big-endian MIPS MALTA target as well. This helped t correct Linux driver to support big-endian systems. - CTU CAN FD IP core emulation updated to pass CAN frame data correctly on big-endian host systems. Big-endian host not tested, would required whole QEMU build for MIPS MALTA or big-endian POWER and run it nested emulation, because I have no access to Linux based big-endian system capable for QEMU build. - Makefile.objs changes applied to meson.build and Kconfig. - The common CAN support update for CAN FD tested and reviewed by Vikram Garhwal from Xilinx. They base their CAN FD controllers emulation on our work. - Vikram Garhwal agrees to help with common QEMU CAN bus infrastructure reviews. I add him and myself into maintainers. - Corrected SJA1000 dependencies in Kconfig after (probably) automated switch to meson build from make build. Please, let me know if somebody from recipients list does no longer have interrest in QEMU CAN bus emulation and I would remove you from recipients list to not load you by uniteresting content in future. Jan Charvat (5): net/can: Initial host SocketCan support for CAN FD. hw/net/can: sja1000 ignore CAN FD frames net/can: Add can_dlc2len and can_len2dlc for CAN FD. hw/net/can/ctucafd: Add CTU CAN FD core register definitions. hw/net/can: CTU CAN FD IP open hardware core emulation. Pavel Pisa (2): hw/net/can: Documentation for CTU CAN FD IP open hardware core emulation. hw/net/can: Correct Kconfig dependencies after switch to meson build. MAINTAINERS | 9 + docs/can.txt | 113 +++- hw/net/Kconfig | 16 +- hw/net/can/can_sja1000.c | 31 +- hw/net/can/ctu_can_fd_frame.h | 189 +++++++ hw/net/can/ctu_can_fd_regs.h | 971 ++++++++++++++++++++++++++++++++++ hw/net/can/ctucan_core.c | 696 ++++++++++++++++++++++++ hw/net/can/ctucan_core.h | 127 +++++ hw/net/can/ctucan_pci.c | 280 ++++++++++ hw/net/can/meson.build | 2 + include/net/can_emu.h | 12 +- net/can/can_core.c | 36 ++ net/can/can_socketcan.c | 47 +- 13 files changed, 2505 insertions(+), 24 deletions(-) create mode 100644 hw/net/can/ctu_can_fd_frame.h create mode 100644 hw/net/can/ctu_can_fd_regs.h create mode 100644 hw/net/can/ctucan_core.c create mode 100644 hw/net/can/ctucan_core.h create mode 100644 hw/net/can/ctucan_pci.c