public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: "Petr Štetiar" <ynezz@true.cz>
Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	"Russell King" <linux@arm.linux.org.uk>,
	"Kumar Gala" <galak@codeaurora.org>,
	"Ian Campbell" <ijc+devicetree@hellion.org.uk>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Pawel Moll" <pawel.moll@arm.com>,
	"Sascha Hauer" <kernel@pengutronix.de>,
	"Shawn Guo" <shawnguo@kernel.org>,
	"Richard Zhu" <Richard.Zhu@freescale.com>,
	"Lucas Stach" <l.stach@pengutronix.de>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	linux-pci@vger.kernel.org, "Tim Harvey" <tharvey@gateworks.com>,
	"Krzysztof Hałasa" <khalasa@piap.pl>,
	"Fabio Estevam" <festevam@gmail.com>,
	"Marcel Ziswiler" <marcel.ziswiler@toradex.com>,
	stefan@agner.ch
Subject: Re: [PATCH v3 2/2] PCI: imx6: Add reset-gpio-active-high boolean property to DT
Date: Mon, 11 Apr 2016 08:38:10 -0500	[thread overview]
Message-ID: <20160411133810.GA15094@rob-hp-laptop> (raw)
In-Reply-To: <1459946207-11923-1-git-send-email-ynezz@true.cz>

On Wed, Apr 06, 2016 at 02:36:47PM +0200, Petr Štetiar wrote:
> Currently the reset-gpio DT property which controls the PCI bus device
> reset signal defaults to active-low reset sequence (L=reset state,
> H=operation state) plus the code in reset function isn't GPIO polarity
> aware - it doesn't matter if the defined reset-gpio is active-low or
> active-high, it will always result into active-low reset sequence.
> 
> I've tried to fix it properly and changed the reset-gpio reset sequence
> to be polarity aware, but this patch has been accepted and then reverted
> as it has introduced few backward incompatible issues:
> 
> 1. Some of the DTBs as for example imx6qdl-sabresd, doesn't define
> reset-gpio polarity correctly:
> 
>   reset-gpio = <&gpio7 12 0>;
> 
> which means, that it's defined as active-high, but in reality it's
> active-low, thus it wouldn't work without DTS fix.
> 
> 2. The logic in reset function is inverted:
> 
> 	gpio_set_value_cansleep(imx6_pcie->reset_gpio, 0)
> 	msleep(100);
> 	gpio_set_value_cansleep(imx6_pcie->reset_gpio, 1);
> 
> so even if some of the i.MX6 boards had reset-gpio polarity defined
> correctly in their DTSes, they would stop working.
> 
> As we can't break old DTBs, we can't fix them and that's why we need to
> introduce this new DT reset-gpio-active-high boolean property, so we can
> support boards with active-high reset sequence.
> 
> This active-high reset sequence is for example needed on Apalis SoMs,
> where GPIO1_IO28, used to PCIe reset is not connected directly to PERST#
> PCIe signal, but it's ORed with RESETBMCU coming off the PMIC, and thus
> is inverted, active-high.
> 
> Signed-off-by: Petr Štetiar <ynezz@true.cz>
> ---
>  Changes since v1:
> 
>   * Added documentation of reset-gpio and reset-gpio-active-high DT properties
>   * Removed unnecessary double negation of GPIO value
> 
>  Changes since v2:
> 
>   * Changed commit message so it explains in more detail why we need new DT
>     property
>   * Changed PHY to 'bus device' in binding's documentation
> 
>  Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.txt |  6 ++++++
>  drivers/pci/host/pci-imx6.c                              | 14 +++++++++++---
>  2 files changed, 17 insertions(+), 3 deletions(-)

Acked-by: Rob Herring <robh@kernel.org>

  parent reply	other threads:[~2016-04-11 13:38 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-01 12:41 [PATCH] ARM: imx6: Fix PCIe reset gpio polarity on Toradex Apalis Petr Štetiar
2016-04-01 12:41 ` [PATCH 1/2] ARM: dts: imx6: Fix PCIe reset gpio polarity on Toradex Apalis Ixora Petr Štetiar
2016-04-01 12:41 ` [PATCH 2/2] PCI: imx6: Add reset-gpio-active-high boolean property to DT Petr Štetiar
     [not found]   ` <1459514508-8557-3-git-send-email-ynezz-knWk7/PSn+s@public.gmane.org>
2016-04-05 15:46     ` Fabio Estevam
2016-04-06  8:11       ` Petr Štetiar
2016-04-06  9:34       ` [PATCH v2 " Petr Štetiar
     [not found]         ` <1459935244-10077-1-git-send-email-ynezz-knWk7/PSn+s@public.gmane.org>
2016-04-06  9:48           ` Lucas Stach
2016-04-06 12:36             ` [PATCH v3 " Petr Štetiar
     [not found]               ` <1459946207-11923-1-git-send-email-ynezz-knWk7/PSn+s@public.gmane.org>
2016-04-06 12:40                 ` Lucas Stach
2016-04-11 13:38               ` Rob Herring [this message]
2016-04-14 15:28               ` Tim Harvey
2016-04-20  0:48 ` [PATCH] ARM: imx6: Fix PCIe reset gpio polarity on Toradex Apalis Bjorn Helgaas

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=20160411133810.GA15094@rob-hp-laptop \
    --to=robh@kernel.org \
    --cc=Richard.Zhu@freescale.com \
    --cc=bhelgaas@google.com \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=kernel@pengutronix.de \
    --cc=khalasa@piap.pl \
    --cc=l.stach@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=marcel.ziswiler@toradex.com \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=shawnguo@kernel.org \
    --cc=stefan@agner.ch \
    --cc=tharvey@gateworks.com \
    --cc=ynezz@true.cz \
    /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