public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Christian Lamparter <chunkeey@gmail.com>
Cc: Mark Rutland <mark.rutland@arm.com>,
	devicetree@vger.kernel.org, David Brown <david.brown@linaro.org>,
	Stephen Boyd <sboyd@kernel.org>,
	linux-arm-msm@vger.kernel.org,
	Linus Walleij <linus.walleij@linaro.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	linux-gpio@vger.kernel.org,
	Sven Eckelmann <sven.eckelmann@openmesh.com>,
	Andy Gross <andy.gross@linaro.org>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v5 1/4] dt-bindings: pinctrl: qcom: add gpio-ranges, gpio-reserved-ranges
Date: Tue, 22 May 2018 11:29:46 -0500	[thread overview]
Message-ID: <20180522162946.GA25556@rob-hp-laptop> (raw)
In-Reply-To: <910e5a85a6a8020069996e2ff397c93e9c5fe18c.1526935804.git.chunkeey@gmail.com>

On Mon, May 21, 2018 at 10:57:36PM +0200, Christian Lamparter wrote:
> This patch adds the gpio-ranges and gpio-reserved-ranges property
> definitions to the binding text files supported by the pinctrl-msm
> driver framework.
> 
> gpio-ranges:
> For DT-based platforms the pinctrl-msm framework currently relies
> on the deprecated-for-DT gpiochip_add_pin_range() function to add
> the range of GPIOs to be handled by the pin controller. Due to
> interactions within gpiolib code, this causes the pinctrl-msm
> driver to bail out (-517) during boot when a gpio-hog is declared.
> This can be fatal and cause the system to not boot or reset
> (for a detailed explanation and call-trace, refer to patch:
> "pinctrl: msm: fix gpio-hog related boot issues" in this series).
> 
> gpio-reserved-ranges:
> The binding has been added as a precaution since the TrustZone
> firmware (aka QSEE), which is running as the hypervisor, might
> have reserved certain, but undisclosed pins. Hence reading or
> writing to the registers for those pins will cause an
> XPU violation and this subsequently crashes the kernel.
> 
> Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
> ---
>  .../bindings/pinctrl/qcom,apq8064-pinctrl.txt         |  6 ++++++
>  .../bindings/pinctrl/qcom,apq8084-pinctrl.txt         | 11 +++++++++++
>  .../bindings/pinctrl/qcom,ipq4019-pinctrl.txt         |  6 ++++++
>  .../bindings/pinctrl/qcom,ipq8064-pinctrl.txt         |  6 ++++++
>  .../bindings/pinctrl/qcom,ipq8074-pinctrl.txt         | 10 ++++++++++
>  .../bindings/pinctrl/qcom,mdm9615-pinctrl.txt         | 11 +++++++++++
>  .../bindings/pinctrl/qcom,msm8660-pinctrl.txt         |  6 ++++++
>  .../bindings/pinctrl/qcom,msm8916-pinctrl.txt         | 11 +++++++++++
>  .../bindings/pinctrl/qcom,msm8960-pinctrl.txt         | 11 +++++++++++
>  .../bindings/pinctrl/qcom,msm8974-pinctrl.txt         |  6 ++++++
>  .../bindings/pinctrl/qcom,msm8994-pinctrl.txt         | 11 +++++++++++
>  .../bindings/pinctrl/qcom,msm8996-pinctrl.txt         | 11 +++++++++++
>  12 files changed, 106 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/pinctrl/qcom,apq8064-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/qcom,apq8064-pinctrl.txt
> index a752a4716486..7f78c6bb4e35 100644
> --- a/Documentation/devicetree/bindings/pinctrl/qcom,apq8064-pinctrl.txt
> +++ b/Documentation/devicetree/bindings/pinctrl/qcom,apq8064-pinctrl.txt
> @@ -10,6 +10,11 @@ Required properties:
>  - #gpio-cells : Should be two.
>                  The first cell is the gpio pin number and the
>                  second cell is used for optional parameters.
> +- gpio-ranges: Range of pins managed by the GPIO controller.

Just 'see gpio.txt' is sufficient unless you can say how many entries.

> +
> +Optional properties:
> +
> +- gpio-reserved-ranges: Range of pins reserved by the TrustZone TEE.

ditto.

>  
>  Please refer to ../gpio/gpio.txt and ../interrupt-controller/interrupts.txt for
>  a general description of GPIO and interrupt bindings.
> @@ -67,6 +72,7 @@ Example:
>  
>  		pinctrl-names = "default";
>  		pinctrl-0 = <&gsbi5_uart_default>;
> +		gpio-ranges = <&msmgpio 0 0 90>;
>  
>  		gsbi5_uart_default: gsbi5_uart_default {
>  			mux {
> diff --git a/Documentation/devicetree/bindings/pinctrl/qcom,apq8084-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/qcom,apq8084-pinctrl.txt
> index c4ea61ac56f2..362f32b945af 100644
> --- a/Documentation/devicetree/bindings/pinctrl/qcom,apq8084-pinctrl.txt
> +++ b/Documentation/devicetree/bindings/pinctrl/qcom,apq8084-pinctrl.txt
> @@ -40,6 +40,16 @@ MSM8960 platform.
>  	Definition: must be 2. Specifying the pin number and flags, as defined
>  		    in <dt-bindings/gpio/gpio.h>
>  
> +- gpio-ranges:
> +	Usage: required
> +	Value type: <prop-encoded-array>

But this is phandle with 3 cells.

Still, you don't need to redefine standard properties here. Just need to 
know optional vs. required and any constraints you can define (e.g. 
allowed values, number of values, etc.)


Same comments apply to the rest.

Rob

      parent reply	other threads:[~2018-05-22 16:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-21 20:57 [PATCH v5 1/4] dt-bindings: pinctrl: qcom: add gpio-ranges, gpio-reserved-ranges Christian Lamparter
2018-05-21 20:57 ` [PATCH v5 2/4] pinctrl: msm: fix gpio-hog related boot issues Christian Lamparter
2018-05-21 20:57   ` [PATCH v5 3/4] ARM: dts: qcom: add gpio-ranges property Christian Lamparter
2018-05-21 20:57     ` [PATCH v5 4/4] gpiolib: discourage gpiochip_add_pin[group]_range for DT pinctrls Christian Lamparter
2018-05-24  8:07       ` Linus Walleij
2018-05-24  8:05     ` [PATCH v5 3/4] ARM: dts: qcom: add gpio-ranges property Linus Walleij
2018-05-24  8:04   ` [PATCH v5 2/4] pinctrl: msm: fix gpio-hog related boot issues Linus Walleij
2018-05-22 16:29 ` Rob Herring [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180522162946.GA25556@rob-hp-laptop \
    --to=robh@kernel.org \
    --cc=andy.gross@linaro.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=chunkeey@gmail.com \
    --cc=david.brown@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=sboyd@kernel.org \
    --cc=sven.eckelmann@openmesh.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox