From patchwork Wed Jun 10 07:44:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manivannan Sadhasivam X-Patchwork-Id: 187728 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp254000ilo; Wed, 10 Jun 2020 00:44:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLlOCi1uXhPoO8tunICyH1bM2jOuYKKsU6SPfL0asKOyu9xHQzgWsm1ka4btsNHceBIfOP X-Received: by 2002:a17:906:2e83:: with SMTP id o3mr2115663eji.312.1591775098775; Wed, 10 Jun 2020 00:44:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591775098; cv=none; d=google.com; s=arc-20160816; b=uFKhioC5weqlBLpPCwepNcIP6vAoSyAAOTqvO/bCr41bg9oqFpllutZsEW4MYbAzLC AI0KUgFzAYx7M+2vqhl4EWTqE3bdtJmza3NCAFgk3EtQ7irf3piAZqbHo52SxY37m+xv vlGxSWtUQR5INbOx+8AKtNVCm0H/cknby/SiTMtF9oXuET9UTko+tSjmLfH/IOqk3dYv 9sDCvPXX7DXMDPna0LTcrSbF2hJp3tQ2Ai3hOrOerIp/QS+H+Sii+4Awuy9Sdy5U1eTa 1nnhNAfIXcA8l7ji1/E7YT0JuTld5kfGn7/HdlDFP9eHIpQMxC0ao6t//pQlFVoomd6f c4lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=3N8ySBXCAGSToWzkhjg9Ns1STm80jOJIgncP/xxN3eY=; b=c6o+NGJ7bsSfC4gdIymg/lxV9N32JCeQmoNMDC+TxorEktZCVxPD6H/jD90sqHYDj1 o/j7DJ8vQXgXrjB5kbaTSMqFe05RP55cJmEV99JKm5NVJVfkQWUBS86qRl+rqMROqwTd hNRmvTJ813yyVXD+8M0cMJS5Qzi6r3dcnsn2h8dMLBoaTqJzAvmQSWTkn1Z836pSKRzO /bx05JUMZIV+KETfyBWP+c4ZANpq6PeTL1gJmCi1tBicgX13bGSh5k2X28CQYkCKhet2 mbntXF7ukbn5MUThpxett771OCDDxoZ77RsWKYLIbY9nq5/iRXSB7pAtsHj+csUSUyCj iTvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xoSGSnf+; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rh3si12124413ejb.539.2020.06.10.00.44.58; Wed, 10 Jun 2020 00:44:58 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xoSGSnf+; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726553AbgFJHo4 (ORCPT + 9 others); Wed, 10 Jun 2020 03:44:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726506AbgFJHoz (ORCPT ); Wed, 10 Jun 2020 03:44:55 -0400 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E7DCC08C5C1 for ; Wed, 10 Jun 2020 00:44:55 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id s10so628690pgm.0 for ; Wed, 10 Jun 2020 00:44:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=3N8ySBXCAGSToWzkhjg9Ns1STm80jOJIgncP/xxN3eY=; b=xoSGSnf+KLwKshKMBjlYrdmyp9I/mKgs/ehf+r0czh6W2sBdz19OUpRNf2jQNbZ8eI XkpysDx8EabZpnTU0HzEI/WZZPkbYy6KjWFQPNuGSlDBhar4Rim+IjgczRpmssPjGaFq 5q+EEIbBcHSXNKMOCUpXLtEVG1qvGo9eU766WhzeR7aL/XssyIVigCIRHKMCWPBiOhr4 JfdZ8qF3+/t9Gt3fAM9CmfdZYsK7qNR0xNu9WCYztpKPmUxdeoiZWjekG5yH7MTzKmP/ dwSSvI89/7/RxJqGYOFBW9hIxiwSogU/vjrni1TdE7bcElzLght6o7xpzpwUEl+hEVk6 D16A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=3N8ySBXCAGSToWzkhjg9Ns1STm80jOJIgncP/xxN3eY=; b=QTr4rSZ7WqAzXDmurCOoBeXAW3Celcyow8khjGIVUjsTQQmelWLMYeloaencTVAq19 +KYQk0U1wOsWT9Sz2LLRmCIF+ScwXcjWtOKCATaFwC4Z6SsM0Q+o/jDT/OBUe09FEs15 7abb/0u/g19FE1O4FIgorvHkZTAe/q6EFjO2d60fHejiPq4dCe8awMpInY4CMXvk/yoP Fi0AeFc19qTPN6ojDciVqQDMphQzFD1abX5c9jRsI2+lZveovRB1vTy6ryYCgywEO5/D FBbe3xjMUBcvs/xWWNkORoaiMvIGyvV9RaeQXl9+p58/LNqnuFul9Wd7iMEVFmburRGg XAnA== X-Gm-Message-State: AOAM533nb68771P2uuEd22idH8/KNYeikxOE5e5h+3rxJwYm/SS3jXqJ NHcF4f0LjKcC6/7dQDCXmr3d X-Received: by 2002:aa7:859a:: with SMTP id w26mr1547654pfn.10.1591775094260; Wed, 10 Jun 2020 00:44:54 -0700 (PDT) Received: from Mani-XPS-13-9360.localdomain ([2409:4072:630f:1dba:c41:a14e:6586:388a]) by smtp.gmail.com with ESMTPSA id a20sm11516795pff.147.2020.06.10.00.44.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jun 2020 00:44:53 -0700 (PDT) From: Manivannan Sadhasivam To: wg@grandegger.com, mkl@pengutronix.de Cc: kernel@martin.sperl.org, linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Manivannan Sadhasivam Subject: [PATCH 0/6] Add Microchip MCP25XXFD CAN driver Date: Wed, 10 Jun 2020 13:14:36 +0530 Message-Id: <20200610074442.10808-1-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hello, This series adds CAN network driver support for Microchip MCP25XXFD CAN Controller with MCP2517FD as the target controller version. This series is mostly inspired (or taken) from the previous iterations posted by Martin Sperl. I've trimmed down the parts which are not necessary for the initial version to ease review. Still the series is relatively huge but I hope to get some reviews (post -rcX ofc!). Link to the origial series posted by Martin: https://www.spinics.net/lists/devicetree/msg284462.html I've not changed the functionality much but done some considerable amount of cleanups and also preserved the authorship of Martin for all the patches he has posted earlier. This series has been tested on 96Boards RB3 platform by myself and Martin has tested the previous version on Rpi3 with external MCP2517FD controller. Thanks, Mani Manivannan Sadhasivam (1): MAINTAINERS: Add entry for Microchip MCP25XXFD CAN network driver Martin Sperl (5): dt-bindings: can: Document devicetree bindings for MCP25XXFD can: mcp25xxfd: Add Microchip MCP25XXFD CAN-FD driver infrastructure can: mcp25xxfd: Add support for CAN reception can: mcp25xxfd: Add CAN transmission support can: mcp25xxfd: Optimize TEF read by avoiding unnecessary SPI transfers .../bindings/net/can/microchip,mcp25xxfd.yaml | 82 +++ MAINTAINERS | 8 + drivers/net/can/spi/Kconfig | 2 + drivers/net/can/spi/Makefile | 2 + drivers/net/can/spi/mcp25xxfd/Kconfig | 5 + drivers/net/can/spi/mcp25xxfd/Makefile | 11 + .../net/can/spi/mcp25xxfd/mcp25xxfd_base.c | 177 +++++ .../net/can/spi/mcp25xxfd/mcp25xxfd_base.h | 14 + drivers/net/can/spi/mcp25xxfd/mcp25xxfd_can.c | 538 ++++++++++++++ drivers/net/can/spi/mcp25xxfd/mcp25xxfd_can.h | 52 ++ .../can/spi/mcp25xxfd/mcp25xxfd_can_fifo.c | 305 ++++++++ .../can/spi/mcp25xxfd/mcp25xxfd_can_fifo.h | 16 + .../net/can/spi/mcp25xxfd/mcp25xxfd_can_id.h | 69 ++ .../net/can/spi/mcp25xxfd/mcp25xxfd_can_int.c | 674 ++++++++++++++++++ .../net/can/spi/mcp25xxfd/mcp25xxfd_can_int.h | 18 + .../can/spi/mcp25xxfd/mcp25xxfd_can_priv.h | 144 ++++ .../net/can/spi/mcp25xxfd/mcp25xxfd_can_rx.c | 233 ++++++ .../net/can/spi/mcp25xxfd/mcp25xxfd_can_rx.h | 18 + .../net/can/spi/mcp25xxfd/mcp25xxfd_can_tx.c | 653 +++++++++++++++++ .../net/can/spi/mcp25xxfd/mcp25xxfd_can_tx.h | 86 +++ drivers/net/can/spi/mcp25xxfd/mcp25xxfd_cmd.c | 226 ++++++ drivers/net/can/spi/mcp25xxfd/mcp25xxfd_cmd.h | 84 +++ drivers/net/can/spi/mcp25xxfd/mcp25xxfd_crc.c | 31 + drivers/net/can/spi/mcp25xxfd/mcp25xxfd_crc.h | 15 + drivers/net/can/spi/mcp25xxfd/mcp25xxfd_ecc.c | 74 ++ drivers/net/can/spi/mcp25xxfd/mcp25xxfd_ecc.h | 16 + drivers/net/can/spi/mcp25xxfd/mcp25xxfd_int.c | 71 ++ drivers/net/can/spi/mcp25xxfd/mcp25xxfd_int.h | 15 + .../net/can/spi/mcp25xxfd/mcp25xxfd_priv.h | 50 ++ .../net/can/spi/mcp25xxfd/mcp25xxfd_regs.h | 661 +++++++++++++++++ 30 files changed, 4350 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/can/microchip,mcp25xxfd.yaml create mode 100644 drivers/net/can/spi/mcp25xxfd/Kconfig create mode 100644 drivers/net/can/spi/mcp25xxfd/Makefile create mode 100644 drivers/net/can/spi/mcp25xxfd/mcp25xxfd_base.c create mode 100644 drivers/net/can/spi/mcp25xxfd/mcp25xxfd_base.h create mode 100644 drivers/net/can/spi/mcp25xxfd/mcp25xxfd_can.c create mode 100644 drivers/net/can/spi/mcp25xxfd/mcp25xxfd_can.h create mode 100644 drivers/net/can/spi/mcp25xxfd/mcp25xxfd_can_fifo.c create mode 100644 drivers/net/can/spi/mcp25xxfd/mcp25xxfd_can_fifo.h create mode 100644 drivers/net/can/spi/mcp25xxfd/mcp25xxfd_can_id.h create mode 100644 drivers/net/can/spi/mcp25xxfd/mcp25xxfd_can_int.c create mode 100644 drivers/net/can/spi/mcp25xxfd/mcp25xxfd_can_int.h create mode 100644 drivers/net/can/spi/mcp25xxfd/mcp25xxfd_can_priv.h create mode 100644 drivers/net/can/spi/mcp25xxfd/mcp25xxfd_can_rx.c create mode 100644 drivers/net/can/spi/mcp25xxfd/mcp25xxfd_can_rx.h create mode 100644 drivers/net/can/spi/mcp25xxfd/mcp25xxfd_can_tx.c create mode 100644 drivers/net/can/spi/mcp25xxfd/mcp25xxfd_can_tx.h create mode 100644 drivers/net/can/spi/mcp25xxfd/mcp25xxfd_cmd.c create mode 100644 drivers/net/can/spi/mcp25xxfd/mcp25xxfd_cmd.h create mode 100644 drivers/net/can/spi/mcp25xxfd/mcp25xxfd_crc.c create mode 100644 drivers/net/can/spi/mcp25xxfd/mcp25xxfd_crc.h create mode 100644 drivers/net/can/spi/mcp25xxfd/mcp25xxfd_ecc.c create mode 100644 drivers/net/can/spi/mcp25xxfd/mcp25xxfd_ecc.h create mode 100644 drivers/net/can/spi/mcp25xxfd/mcp25xxfd_int.c create mode 100644 drivers/net/can/spi/mcp25xxfd/mcp25xxfd_int.h create mode 100644 drivers/net/can/spi/mcp25xxfd/mcp25xxfd_priv.h create mode 100644 drivers/net/can/spi/mcp25xxfd/mcp25xxfd_regs.h -- 2.17.1