From patchwork Wed Oct 10 14:20:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Murphy X-Patchwork-Id: 148551 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp923979lji; Wed, 10 Oct 2018 07:21:15 -0700 (PDT) X-Google-Smtp-Source: ACcGV627U0XoZifgeO470Y4NGbERsdxZzZ+HtfIUS9HyQA0gtQFucvesjKo9bEsDD1xqm1t0nC6e X-Received: by 2002:a17:902:aa47:: with SMTP id c7-v6mr34100064plr.100.1539181275240; Wed, 10 Oct 2018 07:21:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539181275; cv=none; d=google.com; s=arc-20160816; b=u/iA184ltMjp0z7JAnJJFoz8DcuTE99D/fhKP32JZRJ84248QTlNjdRFeP+unclnw3 xA8QRSOJQE2/jqwkL3efm0W7ssl5gZfWLcvMQAZYIUCHoEeSZgoMQBOdJJ1dnfGj9wi+ hqfVpMb6FXE4XdDtNpNf2CmJ4N3Rmf4HD4epgFtv5h+T0RoZCxcFsfNrmY1XwdOgt6vs h2sT6WSRDWyMCcs0i3H4E+A9cXuqyZppJQwEFtDP4imaEFJC8srzdo2jIUs6wpL0u/+i X6Mid7O5czwjaaaD27HevzzZ6e0FA5pHJJOiODtHjR01cxJMm2GGUvmPGVW/EKkRq4l/ QO0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=At5xssb5PLPYf8oMrAyyajQD1xZlFZKccX7Uu2FAURY=; b=fTLVOFe0+CNN0p+yW0AI4/2DC4nmAW/mIU1Qi6wBYJyeh8janAm/aYbzuye6HNUnpg JhMDZtaXhekyzzg5Lc7vAsYxhal3om7578JyjKq3yb5T/49ZtNv7q4MR+WhCpWB1syXb 9ezxnegddRJ6cBjriQ+wzTIDY2VTuInezpIVFSw/DfU0zWWjneDBhn1N0zpiM/Fs/+j5 z//mw2ypNGS+rHDYZRNKgoBg6/478IuDjIbotWKjCPPzioJJXO4qamsvTMa73hSRZ3f2 sWHQXqzXugP9qXUNoSvAA0ln1Tq6WIquI88Uz+vp8Fm5J/ytXPKVBycTBe8yyb7OxV7v VpwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Y9CSHlUr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v9-v6si29113811pfj.167.2018.10.10.07.21.14; Wed, 10 Oct 2018 07:21:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Y9CSHlUr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727344AbeJJVnf (ORCPT + 32 others); Wed, 10 Oct 2018 17:43:35 -0400 Received: from lelv0143.ext.ti.com ([198.47.23.248]:49498 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726649AbeJJVnd (ORCPT ); Wed, 10 Oct 2018 17:43:33 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id w9AEKwaE040849; Wed, 10 Oct 2018 09:20:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1539181258; bh=At5xssb5PLPYf8oMrAyyajQD1xZlFZKccX7Uu2FAURY=; h=From:To:CC:Subject:Date; b=Y9CSHlUrZAu9HFWJXaQ366BXDdLttJKFGCM7OkCrhoh52W8Wm04xSkqa0Q3MVLYD2 ydzk5lISknYhPlMVyILGUbndObKc4b19VFzQgCtgBfdQhPrJwj4/EXDXZfIpBPiO/N an/uiZMXIhoTaVIt5BKUuPu9MAXvRZOLfmPIubwQ= Received: from DLEE115.ent.ti.com (dlee115.ent.ti.com [157.170.170.26]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w9AEKwGb028437; Wed, 10 Oct 2018 09:20:58 -0500 Received: from DLEE100.ent.ti.com (157.170.170.30) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Wed, 10 Oct 2018 09:20:58 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE100.ent.ti.com (157.170.170.30) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Wed, 10 Oct 2018 09:20:57 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w9AEKv71021342; Wed, 10 Oct 2018 09:20:57 -0500 Received: from localhost (a0272616local-lt.dhcp.ti.com [172.22.138.183]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id w9AEKvx06334; Wed, 10 Oct 2018 09:20:57 -0500 (CDT) From: Dan Murphy To: , , CC: , , , Dan Murphy Subject: [RFC PATCH 0/3] M_CAN Framework rework Date: Wed, 10 Oct 2018 09:20:52 -0500 Message-ID: <20181010142055.25271-1-dmurphy@ti.com> X-Mailer: git-send-email 2.12.2 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org All This patch series creates a m_can core framework that devices can register to. The m_can core manages the Bosch IP and CAN frames. Each device that is registered is responsible for managing device specific functions. This rewrite was suggested in a device driver submission for the TCAN4x5x device Reference upstream post: https://lore.kernel.org/patchwork/patch/984163/ For instance the TCAN device is a SPI device that uses a specific data payload to determine writes and reads. In addition the device has a reset input as well as a wakeup pin. The register offset of the m_can registers differs and must be set by the device attached to the core. The m_can core will use iomapped writes and reads as the default mechanism for writing and reading. The device driver can provide over rides for this. This patch series is not complete as it does not handle the CAN interrupts nor can perform a CAN write. If this patch series is deemed acceptable I will finish debugging the driver and post a non RFC series. Finally I did attempt to reduce the first patch with various git format patch directives but none seemed to reduce the patch. Dan Dan Murphy (3): can: m_can: Create m_can core to leverage common code dt-bindings: can: tcan4x5x: Add DT bindings for TCAN4x5X driver can: tcan4x5x: Add tcan4x5x driver to the kernel .../devicetree/bindings/net/can/tcan4x5x.txt | 34 + drivers/net/can/m_can/Kconfig | 18 + drivers/net/can/m_can/Makefile | 4 +- drivers/net/can/m_can/m_can.c | 1683 +---------------- .../net/can/m_can/{m_can.c => m_can_core.c} | 479 +++-- drivers/net/can/m_can/m_can_core.h | 100 + drivers/net/can/m_can/tcan4x5x.c | 321 ++++ 7 files changed, 722 insertions(+), 1917 deletions(-) create mode 100644 Documentation/devicetree/bindings/net/can/tcan4x5x.txt copy drivers/net/can/m_can/{m_can.c => m_can_core.c} (83%) create mode 100644 drivers/net/can/m_can/m_can_core.h create mode 100644 drivers/net/can/m_can/tcan4x5x.c -- 2.19.0