Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1794509imm; Thu, 14 Jun 2018 04:06:25 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKzSbjwWmxi1mj/KkYH0CEw0H0mSVwf8k7f+/DSQQwkVDBhRW5uTClc1bB7mIxgMRGcBHmb X-Received: by 2002:a17:902:3181:: with SMTP id x1-v6mr364918plb.198.1528974385601; Thu, 14 Jun 2018 04:06:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528974385; cv=none; d=google.com; s=arc-20160816; b=FNDdliWfqslV14UPWd9VJJLm1eX46Da/7eQMGcUlLwBFgq3QyDnXJJd7sLzTwVbAUD 8kn+Xo/m8PWKPLKIXr+yhMUN5RWuRGhoXKoRCXZuJ0k5ZeaI0uA/BsxgLsvI9IkovUi5 hehWyMVZU/ZYh/8KsAHwkggwvr6D7jBzVaCAJ7fc81vuthNzMLosKwq5M4xRWsXs41Js 9G3XzfKlMEyCD2tsya1eQMp9fNErFmvtTC7a957RHiovBGmlFpviBiN6DLCCqfN1L2ms G0BghH41vA/Uv64AWE9b3k4suHn6Wr6E4QhSnTbZXEP6h45/pIHrCP2Kx99VcUu2wsZt PIKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=dhZgzzPpZqB159/2m9CZ1xZ3+/LkFVkgMbDs91BZUBE=; b=elyiIR21DafaRiNgmUVEtq1iKd7TAiAaib4HlB8stau7LGcfxdMzStJE4uLwrZOnp6 dB0ScMqEO3Ob9T88s/q2n28WKTiFAD2ZPiCHiVdrd1hanP3WN4A0rffTDyLcluoZMSOB ORRUX+X87sNt/OkOmR5YNMU3Si5GFOnLYX4CGyPaV7RA8fK86RAMOEX8M3uqEpw9Oz2N DBi1eJvaGQXk1Lezgmx77KJH043gTyJysSLSWMZfV5fAfa/+XAGnnKkjo9C/I1SRq2wj sc4SNeQ+0Ey77DJ8fQefmq7XzAhHWOscf5GT2Cdz8DJXhlVUsCcY3FH1hZ3pPQnYjPWO 9bog== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t187-v6si4217359pgc.163.2018.06.14.04.06.11; Thu, 14 Jun 2018 04:06:25 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755206AbeFNLFt (ORCPT + 99 others); Thu, 14 Jun 2018 07:05:49 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:10038 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754976AbeFNLFr (ORCPT ); Thu, 14 Jun 2018 07:05:47 -0400 Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie2.idc.renesas.com with ESMTP; 14 Jun 2018 20:05:45 +0900 Received: from relmlii1.idc.renesas.com (relmlii1.idc.renesas.com [10.200.68.65]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id 9CE6B754C9; Thu, 14 Jun 2018 20:05:45 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.51,222,1526310000"; d="scan'208";a="282525870" Received: from unknown (HELO be1yocto.ree.adwin.renesas.com) ([172.29.43.62]) by relmlii1.idc.renesas.com with ESMTP; 14 Jun 2018 20:05:42 +0900 From: Michel Pollet To: linux-renesas-soc@vger.kernel.org, Simon Horman Cc: phil.edworthy@renesas.com, Michel Pollet , Michel Pollet , Linus Walleij , Rob Herring , Mark Rutland , linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 2/5] dt-bindings: clock: renesas,r9a06g032-pinctrl: documentation Date: Thu, 14 Jun 2018 12:00:18 +0100 Message-Id: <1528974029-29617-3-git-send-email-michel.pollet@bp.renesas.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1528974029-29617-1-git-send-email-michel.pollet@bp.renesas.com> References: <1528974029-29617-1-git-send-email-michel.pollet@bp.renesas.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The Renesas R9A06G032 PINCTRL node description. Signed-off-by: Michel Pollet --- .../bindings/pinctrl/renesas,r9a06g032-pinctrl.txt | 124 +++++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 Documentation/devicetree/bindings/pinctrl/renesas,r9a06g032-pinctrl.txt diff --git a/Documentation/devicetree/bindings/pinctrl/renesas,r9a06g032-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/renesas,r9a06g032-pinctrl.txt new file mode 100644 index 0000000..f63696f --- /dev/null +++ b/Documentation/devicetree/bindings/pinctrl/renesas,r9a06g032-pinctrl.txt @@ -0,0 +1,124 @@ +Renesas RZ/A1 combined Pin and GPIO controller + +The Renesas SoCs of the RZ/A1 family feature a combined Pin and GPIO controller, +named "Ports" in the hardware reference manual. +Pin multiplexing and GPIO configuration is performed on a per-pin basis +writing configuration values to per-port register sets. +Each "port" features up to 16 pins, each of them configurable for GPIO +function (port mode) or in alternate function mode. +Up to 8 different alternate function modes exist for each single pin. + +Pin controller node +------------------- + +Required properties: + - compatible: should be: + - "renesas,r9a05g032-pinctrl" + - reg + address base and length of the memory area where the pin controller + hardware is mapped to. + +Example: + pinctrl: pinctrl@40067000 { + compatible = "renesas,r9a06g032-pinctrl"; + reg = <0x40067000 0x1000>, <0x51000000 0x800>; + clocks = <&sysctrl R9A06G032_HCLK_PINCONFIG>; + clock-names = "bus"; + status = "okay"; + }; + + +Sub-nodes +--------- + The child nodes of the pin controller node describe a pin multiplexing + group that can be used by driver nodes. + + A pin multiplexing sub-node describes how to configure a set of + (or a single) pin in some desired alternate function mode. + A single sub-node may define several pin configurations. + + The allowed generic formats for a pin multiplexing sub-node are the + following ones: + + Client sub-nodes shall refer to pin multiplexing sub-nodes using the phandle + of the most external one. + + Eg. + + client-1 { + ... + pinctrl-0 = <&node-1>; + ... + }; + + client-2 { + ... + pinctrl-0 = <&node-2>; + ... + }; + + Required properties: + - renesas,rzn1-pinctrl: + Array of integers representing each 'pin' and it's configuration. + + A 'pin number' does not correspond 1:1 to the hardware manual notion of + PL_GPIO directly. Numbers 0...169 are PL_GPIOs, however there is also two + extra 170 and 171 that corresponds to the MDIO0 and MDIO1 bus config. + + A 'function' also does not correspond 1:1 to the hardware manual. There + are 2 levels of pin muxing, Level 1, level 2 -- to this are added the + MDIO configurations. + + Helper macros to ease assembling the pin index and function identifier + are provided by the pin controller header file at: + + +Example #1: + A simple case configuring only the function for a given 'pin' works as follow: + #include + &pinctrl { + pinsuart0: pinsuart0 { + renesas,rzn1-pinmux-ids = < + RZN1_MUX(103, UART0_I) /* UART0_TXD */ + RZN1_MUX(104, UART0_I) /* UART0_RXD */ + >; + }; + }; + + &uart0 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&pinsuart0>; + }; + Note that in this case the other functions of the pins are not changed. + +Example #2: + Here we also set the pullups on the RXD pin: + &pinctrl { + pinsuart0: pinsuart0 { + renesas,rzn1-pinmux-ids = < + RZN1_MUX(103, UART0_I) /* UART0_TXD */ + RZN1_MUX_PUP(104, UART0_I) /* UART0_RXD */ + >; + }; + }; + There are many alternative macros to set the pullup/down/none and the drive + strenght in the r9a06g032-pinctrl.h header file. + +Example #3: + The Soc has two configurable MDIO muxes, these can also be configured + with this interface using the 'special' MDIO constants: + + &pinctrl { + mdio_mux: mdiomux { + renesas,rzn1-pinmux-ids = < + RZN1_MUX(RZN1_MDIO_BUS0, RZN1_FUNC_MDIO_MUX_MAC0) + RZN1_MUX(RZN1_MDIO_BUS1, RZN1_FUNC_MDIO_MUX_SWITCH) + >; + }; + }; + Clearly the pull/up/none and drive constants will be ignored, even if + specified. + +Note that Renesas provides an extensive webapp that can generates a device tree +file for your board. See their website for this part number for details. -- 2.7.4