From patchwork Wed Mar 9 10:24:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 8544931 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 500E39F46A for ; Wed, 9 Mar 2016 10:34:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4F70020251 for ; Wed, 9 Mar 2016 10:34:29 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4E6C420138 for ; Wed, 9 Mar 2016 10:34:28 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1adbQ5-0002JD-Bu; Wed, 09 Mar 2016 10:32:45 +0000 Received: from mail-wm0-x22a.google.com ([2a00:1450:400c:c09::22a]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1adbIw-0002DC-1Z for linux-arm-kernel@lists.infradead.org; Wed, 09 Mar 2016 10:25:27 +0000 Received: by mail-wm0-x22a.google.com with SMTP id l68so64221947wml.1 for ; Wed, 09 Mar 2016 02:25:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=W95NHTitJMbBK5GCdjiCAjK9o9KMBkgNg8pr+krD//I=; b=rR4ARz3KdDcMQpsSL8OoMNwMYIjGGO4h9ZlT/dkfL8hs3yAk+pCjgwQt3slHkwTDx+ tzYrfnSOdFD6tiH6kqnRbBYbF3ux5xkghWUBQia9dMHFIpemS7U3NnfrFMEeXndBhrZ8 iG8VpaCSkXFq1dr7lHq4FBmZNkvZOEWjkbIbw2iK4F0yBNXM+hUB8w2tk9o1ikyX+M72 8cmoGIXnYpgzI3FYF5NvICUYnke7UP1HD+EdS0Zo9QHZ/yz0sOfCJJwEtonIAwL3c677 cAlw2gYXWz+kOeWwhkvReGZyOnHsBxjiRyodB990QNxGQjmwfkv86fPoSdxin3RqRP5J ++4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=W95NHTitJMbBK5GCdjiCAjK9o9KMBkgNg8pr+krD//I=; b=dWWAlxoUCI7vz3EFpTlNYklut89PubB8zQK5XsD7YGwaNU5sS9ukY/cKlmvoRAsOzA d9wOlCsKxXiRn03IDxqNwx0d285qyWXatnAyOZMf6G6FYD9xKn9bs8WSqAwP4SuYn7vZ 56NfcMOTEhRkPebHRYoB07tZ7aYOClaWq5+1LwHIvRq9hTo+89VsBE2i4FPnLDyp47/J 2fquDJW4L+1VQLfSpCC/PeNp5Yge5ELbXauDchDTKAj53bc7vJZHvs3/zAFttq4+CtRN Dpw/5L6qaMEwKibhhjv0EADL1rL5Mt4WPZC7aUqeU8UkWn7RZoZ0wFuxrXjspwthVI0O H6rA== X-Gm-Message-State: AD7BkJJ6qsx7KU4n0OH5+l3mL8iwO9UnNpaRxfzufdgMIq0azdd8TuwZiw12aIlEVnWe1f2X X-Received: by 10.28.172.194 with SMTP id v185mr23803326wme.21.1457519102077; Wed, 09 Mar 2016 02:25:02 -0800 (PST) Received: from localhost.localdomain ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id n66sm7648305wmg.20.2016.03.09.02.25.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 09 Mar 2016 02:25:01 -0800 (PST) From: Neil Armstrong To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linus.walleij@linaro.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v2 12/18] dt-bindings: Add PLX Technology OXNAS pinctrl and gpio bindings Date: Wed, 9 Mar 2016 11:24:14 +0100 Message-Id: <1457519060-6038-13-git-send-email-narmstrong@baylibre.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1457519060-6038-1-git-send-email-narmstrong@baylibre.com> References: <1457005210-18485-1-git-send-email-narmstrong@baylibre.com> <1457519060-6038-1-git-send-email-narmstrong@baylibre.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160309_022522_436280_1157D9DC X-CRM114-Status: GOOD ( 17.73 ) X-Spam-Score: -1.9 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Neil Armstrong Acked-by: Rob Herring --- .../devicetree/bindings/gpio/gpio_oxnas.txt | 27 ++++++ .../bindings/pinctrl/plxtech,pinctrl.txt | 100 +++++++++++++++++++++ 2 files changed, 127 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpio/gpio_oxnas.txt create mode 100644 Documentation/devicetree/bindings/pinctrl/plxtech,pinctrl.txt diff --git a/Documentation/devicetree/bindings/gpio/gpio_oxnas.txt b/Documentation/devicetree/bindings/gpio/gpio_oxnas.txt new file mode 100644 index 0000000..cbb03c4 --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/gpio_oxnas.txt @@ -0,0 +1,27 @@ +PLX Technology OXNAS SoC GPIO Controller +========================================== + +Required properties: +- compatible: "oxsemi,ox810se-gpio". +- reg: Should contain GPIO controller registers location and length +- interrupts: Should be the port interrupt shared by all the pins. +- #gpio-cells: Should be two. The first cell is the pin number and + the second cell is used to specify optional parameters (currently + unused). +- gpio-controller: Marks the device node as a GPIO controller. + +optional properties: +- #gpio-lines: Number of gpio if absent 32. + + +Example: + gpio0: gpio@000000 { + compatible = "oxsemi,ox810se-gpio"; + reg = <0x000000 0x100000>; + interrupts = <21>; + #gpio-cells = <2>; + gpio-controller; + interrupt-controller; + #interrupt-cells = <2>; + #gpio-lines = <32>; + }; diff --git a/Documentation/devicetree/bindings/pinctrl/plxtech,pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/plxtech,pinctrl.txt new file mode 100644 index 0000000..0c5051a --- /dev/null +++ b/Documentation/devicetree/bindings/pinctrl/plxtech,pinctrl.txt @@ -0,0 +1,100 @@ +PLX Technology OXNAS SoC Pinmux Controller +========================================== + +The OXNAS Pinmux Controller, enables the IC to share one PAD to several +functional blocks. The sharing is done by multiplexing the PAD input/output +signals. For each PAD there are up to 8 muxing options (called periph modes). +Since different modules require different PAD settings +(like pull up, keeper, etc) the contoller controls also the PAD settings +parameters. + +Please refer to pinctrl-bindings.txt in this directory for details of the +common pinctrl bindings used by client devices, including the meaning of the +phrase "pin configuration node". + +OXNAS pin configuration node is a node of a group of pins which can be +used for a specific device or function. This node represents both mux and config +of the pins in that group. The 'pins' selects the function mode(also named pin +mode) this pin can work on and the 'config' configures various pad settings +such as pull-up, multi drive, etc. + +Required properties for iomux controller: +- compatible: "oxsemi,ox810se-pinctrl" +- plxtech,mux-mask: array of mask (periph per bank) to describe if a pin can be + configured in this periph mode. All the periph and bank need to be describe. +- plxtech,sys-ctrl: a phandle to the system controller syscon node + +How to create such array: + +Each column will represent the possible peripheral of the pinctrl +Each line will represent a pio bank + +For example : +Peripheral: 2 ( A and B) +Bank: 2 (A, B and C) +=> + + /* A B */ + 0xffffffff 0xffc00c3b /* pioA */ + 0xffffffff 0x7fff3ccf /* pioB */ + +For each peripheral/bank we will descibe in a u32 if a pin can be +configured in it by putting 1 to the pin bit (1 << pin) + +Required properties for pin configuration node: +- plxtech,pins: 4 integers array, represents a group of pins mux and config + setting. The format is plxtech,pins = . + The PERIPH 0 means gpio, PERIPH 1 is periph A, PERIPH 2 is periph B... + PIN_BANK 0 is pioA, PIN_BANK 1 is pioB... + +Bits used for CONFIG: + - None Yet + +Examples: + +pinctrl: pinctrl { + compatible = "oxsemi,ox810se-pinctrl", "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + ranges; + + /* Regmap for sys registers */ + plxtech,sys-ctrl = <&sys>; + + /* Default, all-open mux-map */ + plxtech,mux-mask = < + 0xFFFFFFFF 0xFFFFFFFF 0xFFFFFFFF 0xFFFFFFFF 0xFFFFFFFF + 0xFFFFFFFF 0xFFFFFFFF 0xFFFFFFFF 0xFFFFFFFF 0xFFFFFFFF + >; + + uart0 { + pinctrl_uart0: uart0 { + plxtech,pins = <0 31 3 0 + 0 32 3 0>; + }; + pinctrl_uart0_modem: uart0_modem { + plxtech,pins = <0 27 3 0 + 0 28 3 0 + 0 29 3 0 + 0 30 3 0 + 0 33 3 0 + 0 34 3 0>; + }; + }; +}; + +uart0: uart@200000 { + compatible = "ns16550a"; + reg = <0x200000 0x100000>; + clocks = <&sysclk>; + interrupts = <23>; + reg-shift = <0>; + fifo-size = <16>; + reg-io-width = <1>; + current-speed = <115200>; + no-loopback-test; + status = "disabled"; + resets = <&reset 17>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_uart0>; +};