From patchwork Thu Sep 3 13:35:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lars Povlsen X-Patchwork-Id: 11753601 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9BCB413B1 for ; Thu, 3 Sep 2020 13:36:07 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 71F3020716 for ; Thu, 3 Sep 2020 13:36:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="AWFi88es"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="CHwBJ+ZU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 71F3020716 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Z/7i4bTCxWnRrGdusMQWShmgmN9G0FlCzQTMRj91zKY=; b=AWFi88esgox56+PxtazrNABY2 NCK0eSovxR/O9SYoUbOgzHTrXKeF7dRe3un9irfc6VRet2DLKQ3FjSIIcDQUteDwzDNKBinnJ16Pq DiFbek9/PhmIe0i3wdonl0UFlWOKwfWd2WfdFFO5KdpCJol/Jda0HwJTEQawFbCWsw7MLFpj8jdjm q6CR/3S3GiWWw8yR/nVFOjzuSPt3GacAvA9fwqtQ03OZ5XE6GdPdBw3BSTIGPxs+AszsweTbN3mfB 0WwSAI0Fpnm2mzY6RZjkgXtXAJlGPjELziv5JstCmSxrdV69dmXUT27rKZgYDjX51AdKos14JAf+f dvx5YP4aQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDpP4-0007rb-Il; Thu, 03 Sep 2020 13:35:50 +0000 Received: from esa2.microchip.iphmx.com ([68.232.149.84]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDpP0-0007qw-N3 for linux-arm-kernel@lists.infradead.org; Thu, 03 Sep 2020 13:35:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1599140146; x=1630676146; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=XhjSQzdLpx3cLG7IPjN6/FZ2dqHvFMkU3/3chby5SGU=; b=CHwBJ+ZU/Sn4mp7uHjvlJ6KH56MTIgMdQb+r7rDOOwAEFzOn4Kw2jtGy C3KaTg/GefSM5EK5gfoPAl+XRn6mgdRcuKOcgGUYFWivckQ7EN6CbtH7c wbOtRb6jaMb4e2qVb+U/jYLxJPDae/SrzGJiCgUOwH3CiNTHGbX8n2pbJ IY2Mkb+3mP305QDngULhDPMsV7NJ23iryP/qLxc+FIc1RkAvbMB4RKuaF vwWnPIue8k9Ao738xRNcpPpdRXN9ZrMVXX/i27YgrbCw8WBzDis+U0fbU MGYQKk4C9DCc3qnJYl28/kz0kYoPDT3SDyaDwOguLKoUdtIGgDaPzNVzc Q==; IronPort-SDR: 1LS7gf6+EWFKbSgkGJcUzpuGon1lIscUl2tjUQA6Gr3Ey7Nu8yzzIkWd3wrWgWyxEC3TRVm37M rsKkup5TqL+eMZCWRAREsMhCNbSs4UygDVJkLO8N/FSNxvt5gHRgSmz+c8r42B/+cN6dg3RuL5 ZySl0IsbArTgC6FUcGdE01T0Kj9gCijbQQ254WUbQC/5dHdw5RmKskmnA5bqvT1aLKtz1uYQ9b YKIuU+PXHJHLpW2djNUziGk4OI8w3MWFndkr8BO4VbPW/7Lv/T2On5AyW7dHGp2DMByQn1yltm Q2U= X-IronPort-AV: E=Sophos;i="5.76,386,1592895600"; d="scan'208";a="87815717" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 03 Sep 2020 06:35:44 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Thu, 3 Sep 2020 06:35:03 -0700 Received: from soft-dev15.microsemi.net (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Thu, 3 Sep 2020 06:35:00 -0700 From: Lars Povlsen To: Linus Walleij , Rob Herring Subject: [PATCH v2 1/3] dt-bindings: pinctrl: Add bindings for pinctrl-mchp-sgpio driver Date: Thu, 3 Sep 2020 15:35:26 +0200 Message-ID: <20200903133528.8595-2-lars.povlsen@microchip.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200903133528.8595-1-lars.povlsen@microchip.com> References: <20200903133528.8595-1-lars.povlsen@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200903_093546_925027_494C8DEA X-CRM114-Status: GOOD ( 18.46 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.149.84 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [68.232.149.84 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Alexandre Belloni , linux-kernel@vger.kernel.org, Microchip Linux Driver Support , linux-gpio@vger.kernel.org, Lars Povlsen , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org This adds DT bindings for the Microsemi/Microchip SGPIO controller, bindings microchip,sparx5-sgpio, mscc,ocelot-sgpio and mscc,luton-sgpio. Signed-off-by: Lars Povlsen --- .../pinctrl/microchip,sparx5-sgpio.yaml | 88 +++++++++++++++++++ include/dt-bindings/gpio/mchp-sgpio.h | 19 ++++ 2 files changed, 107 insertions(+) create mode 100644 Documentation/devicetree/bindings/pinctrl/microchip,sparx5-sgpio.yaml create mode 100644 include/dt-bindings/gpio/mchp-sgpio.h -- 2.27.0 diff --git a/Documentation/devicetree/bindings/pinctrl/microchip,sparx5-sgpio.yaml b/Documentation/devicetree/bindings/pinctrl/microchip,sparx5-sgpio.yaml new file mode 100644 index 000000000000..25a50ba9e893 --- /dev/null +++ b/Documentation/devicetree/bindings/pinctrl/microchip,sparx5-sgpio.yaml @@ -0,0 +1,88 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/pinctrl/microchip,sparx5-sgpio.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Microsemi/Microchip Serial GPIO controller + +maintainers: + - Lars Povlsen + +description: | + By using a serial interface, the SIO controller significantly extend + the number of available GPIOs with a minimum number of additional + pins on the device. The primary purpose of the SIO controllers is to + connect control signals from SFP modules and to act as an LED + controller. + +properties: + $nodename: + pattern: "gpio" + + compatible: + enum: + - microchip,sparx5-sgpio + - mscc,ocelot-sgpio + - mscc,luton-sgpio + + clocks: + maxItems: 1 + + gpio-controller: true + + '#gpio-cells': + description: GPIO consumers must specify four arguments, first the + port number, then the bit number, then a input/output flag and + finally the GPIO flags (from include/dt-bindings/gpio/gpio.h). + The dt-bindings/gpio/mchp-sgpio.h file define manifest constants + PIN_INPUT and PIN_OUTPUT. + const: 4 + + gpio-ranges: + maxItems: 1 + + microchip,sgpio-port-ranges: + description: This is a sequence of tuples, defining intervals of + enabled ports in the serial input stream. The enabled ports must + match the hardware configuration in order for signals to be + properly written/read to/from the controller holding + registers. Being tuples, then number of arguments must be + even. The tuples mast be ordered (low, high) and are + inclusive. Arguments must be between 0 and 31. + $ref: /schemas/types.yaml#/definitions/uint32-array + minItems: 2 + maxItems: 64 + + microchip,sgpio-frequency: + description: The sgpio controller frequency (Hz). This dictates + the serial bitstream speed, which again affects the latency in + getting control signals back and forth between external shift + registers. The speed must be no larger than half the system + clock, and larger than zero. + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 1 + default: 12500000 + +required: + - compatible + - clocks + - gpio-controller + - '#gpio-cells' + - gpio-ranges + - microchip,sgpio-port-ranges + +examples: + - | + sgpio2: gpio@1101036c { + compatible = "microchip,sparx5-sgpio"; + pinctrl-0 = <&sgpio0_pins>; + pinctrl-names = "default"; + reg = <0x1101036c 0x100>; + clocks = <&sys_clk>; + gpio-controller; + gpio-ranges = <&sgpio0 0 0 192>; + #gpio-cells = <4>; + microchip,sgpio-port-ranges = <0 0 16 18 28 31>; + microchip,sgpio-frequency = <25000000>; + }; diff --git a/include/dt-bindings/gpio/mchp-sgpio.h b/include/dt-bindings/gpio/mchp-sgpio.h new file mode 100644 index 000000000000..61b8aa75d870 --- /dev/null +++ b/include/dt-bindings/gpio/mchp-sgpio.h @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * This header provides constants for binding the Microchip SGPIO + * driver. + * + */ + +#ifndef _DT_BINDINGS_GPIO_MCHP_SGPIO_H +#define _DT_BINDINGS_GPIO_MCHP_SGPIO_H + +#include + +/* mchp-sgpio specific pin type defines */ +#undef PIN_OUTPUT +#undef PIN_INPUT +#define PIN_OUTPUT 0 +#define PIN_INPUT 1 + +#endif