From patchwork Wed Jun 13 14:37:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jonas Mark (BT-FIR/ENG1-Grb)" X-Patchwork-Id: 928902 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=de.bosch.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=de.bosch.com header.i=@de.bosch.com header.b="hkMzT4/J"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 415Trv0KbRz9s47 for ; Thu, 14 Jun 2018 00:38:39 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935866AbeFMOi0 (ORCPT ); Wed, 13 Jun 2018 10:38:26 -0400 Received: from de-out1.bosch-org.com ([139.15.230.186]:40976 "EHLO de-out1.bosch-org.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935842AbeFMOiT (ORCPT ); Wed, 13 Jun 2018 10:38:19 -0400 Received: from fe0vm1650.rbesz01.com (unknown [139.15.230.188]) by si0vms0216.rbdmz01.com (Postfix) with ESMTPS id 415TrT5blSz1XLFsv; Wed, 13 Jun 2018 16:38:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=de.bosch.com; s=2015-01-21; t=1528900697; bh=xKWvSJAExCFYwQPkF9cpeARYs1KgGM4+MQ0/Lt2hetU=; l=10; h=From:From:Reply-To:Sender; b=hkMzT4/Jcl+9EBh0ZdB3+S+M23K+QHsBdXbGWY8WrjYnMM4P/zEyUs5Ck3ceeVXq8 5iOOYphx8uG89S8sSJvTWjvEJdsTMk6jFd3B8a4L0dQIFAad8l7TUKcd90BYac9R2I 9Jo5pUvYP3lYWiTJWSqxKWmhhib7X78DXMWPRXAM= Received: from fe0vm7918.rbesz01.com (unknown [10.58.172.176]) by fe0vm1650.rbesz01.com (Postfix) with ESMTPS id 415TrT5DSQz1Cf; Wed, 13 Jun 2018 16:38:17 +0200 (CEST) X-AuditID: 0a3aad10-40fff70000000ee7-11-5b212c676bd6 Received: from fe0vm1652.rbesz01.com ( [10.58.173.29]) (using TLS with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by fe0vm7918.rbesz01.com (SMG Outbound) with SMTP id 2A.7E.03815.76C212B5; Wed, 13 Jun 2018 16:38:31 +0200 (CEST) Received: from SI-HUB1000.de.bosch.com (si-hub1000.de.bosch.com [10.4.103.106]) by fe0vm1652.rbesz01.com (Postfix) with ESMTPS id 415TrT3c3rzBpBV; Wed, 13 Jun 2018 16:38:17 +0200 (CEST) Received: from luchador.grb-fir.grb.de.bosch.com (10.19.187.97) by SI-HUB1000.de.bosch.com (10.4.103.106) with Microsoft SMTP Server id 14.3.319.2; Wed, 13 Jun 2018 16:38:17 +0200 From: Mark Jonas To: Wolfgang Grandegger , Marc Kleine-Budde CC: , , , , , , , , , , Mark Jonas Subject: [PATCH v2 5/5] spi, can, char: add companion DT binding documentation Date: Wed, 13 Jun 2018 16:37:21 +0200 Message-ID: <1528900641-18677-6-git-send-email-mark.jonas@de.bosch.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1528900641-18677-1-git-send-email-mark.jonas@de.bosch.com> References: <1528224240-30786-1-git-send-email-mark.jonas@de.bosch.com> <1528900641-18677-1-git-send-email-mark.jonas@de.bosch.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA22Sb1BUVRjGOXuX3bsrtw53Ad+WWOQyTs2GCBVyldL65I4mWTM2ozTR3bjs brEL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eQWvb1hxYP91xrKeT/PO 5vN09pfpF9ZsTCp99wPFQ9Pn6lKunb/q3bzPkvekUZO6bHKVwf+S40LW0bc7xsLfda5U3XpW XxFE1sNZvjcYpWjlco2EIHL/AdSBc1pcBAAA Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Zhu Yi Signed-off-by: Zhu Yi Signed-off-by: Mark Jonas --- .../devicetree/bindings/spi/bosch,companion.txt | 82 ++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 Documentation/devicetree/bindings/spi/bosch,companion.txt diff --git a/Documentation/devicetree/bindings/spi/bosch,companion.txt b/Documentation/devicetree/bindings/spi/bosch,companion.txt new file mode 100644 index 0000000..5ded325 --- /dev/null +++ b/Documentation/devicetree/bindings/spi/bosch,companion.txt @@ -0,0 +1,82 @@ +Bosch Companion SPI slave device + +The functionality bases on an external peripheral chip named Companion. +It offers two CAN interfaces, each has 8 prioritized transmit FIFOs as +well as one receive FIFO. Besides CAN, undisclosed additional functions +can be accessed through the char device. + +A standard SPI interface with two additional lines for flow control is +used. The Companion chip is the SPI slave. + +The driver suite consists of three separate drivers. The following +diagram illustrates the dependencies in layers. + + /dev/companion SocketCAN User Space +------------------------------------------------------------------- + +----------------+ +---------------+ + | companion-char | | companion-can | + +----------------+ +---------------+ + +----------------------------------+ + | companion-spi | + +----------------------------------+ + +----------------------------------+ + | standard SPI subsystem | + +----------------------------------+ Linux Kernel +------------------------------------------------------------------- + | | | | | | Hardware + CS-+ | | | | +-BUSY + CLK--+ | | +---REQUEST + MOSI---+ | + MISO-----+ + +Required properties: + +- compatible : must be "bosch,companion-spi" +- interrupt-parent : the phandle of the GPIO controller +- interrupts : (GPIO) interrupt to which 'request-gpios' is + connected to +- request-gpios : GPIO pin to request SPI master to receive data +- busy-gpios : GPIO pin to indicate SPI slave is busy +- cs-gpios : GPIO pin to select SPI slave + +Optional properties: + +The controller supports at most 2 CAN and 1 char device subnodes. When +optionally specify the subnodes, the following properties are required: + +- CAN subnode + - compatible : must be "bosch,companion-can" + - clock-frequency: CAN device clock in Hz + - port : must be 0 or 1 + +- Char device subnode + - compatible : must be "bosch,companion-char" + +Example: + +&ecspi1 { + companion-spi@0 { + compatible = "bosch,companion-spi"; + interrupt-parent = <&gpio1>; + interrupts = <26 IRQ_TYPE_EDGE_FALLING>; + request-gpios = <&gpio1 26 GPIO_ACTIVE_LOW>; + busy-gpios = <&gpio1 27 GPIO_ACTIVE_LOW>; + cs-gpios = <&gpio4 9 GPIO_ACTIVE_LOW>; + + companion-can0 { + compatible = "bosch,companion-can"; + clock-frequency = <28000000>; + port = <0>; + }; + + companion-can1 { + compatible = "bosch,companion-can"; + clock-frequency = <28000000>; + port = <1>; + }; + + companion-char { + compatible = "bosch,companion-char"; + }; + }; +};