[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <974df9ef-6cdb-cb7b-2b9d-2eddaf1171f7@xilinx.com>
Date: Wed, 11 Aug 2021 15:29:46 +0200
From: Michal Simek <michal.simek@...inx.com>
To: Linus Walleij <linus.walleij@...aro.org>,
Piyush Mehta <piyush.mehta@...inx.com>
CC: Arnd Bergmann <arnd@...db.de>, Zou Wei <zou_wei@...wei.com>,
Greg KH <gregkh@...uxfoundation.org>,
Michal Simek <michal.simek@...inx.com>,
<wendy.liang@...inx.com>, Nobuhiro Iwamatsu <iwamatsu@...auri.org>,
"Bartosz Golaszewski" <bgolaszewski@...libre.com>,
Rob Herring <robh+dt@...nel.org>, <rajan.vaja@...inx.com>,
"open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@...r.kernel.org>, git <git@...inx.com>,
"Srinivas Goud" <sgoud@...inx.com>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH V2 3/3] gpio: modepin: Add driver support for modepin GPIO
controller
Hi Linus,
On 8/11/21 2:59 PM, Linus Walleij wrote:
> Hi Piyush,
>
> thanks for your patch!
>
> Can you explain one thing to me: since this is now a GPIO driver
> that means "General Purpos Input/Output", then these bits are
> accessed like this:
>
> On Thu, Aug 5, 2021 at 7:43 PM Piyush Mehta <piyush.mehta@...inx.com> wrote:
>
>> + ret = zynqmp_pm_bootmode_read(&bootpin_val);
>
> This does not look very general purpose. These seem to be all about
> boot mode, right?
>
> So can you explain why this should be a GPIO driver at all?
>
> I understand it is sometimes convenient to describe stuff as GPIO even
> if it is not (for example to get a convenient userspace interface) but
> as maintainers
> we really need to make sure that the subsystem is not being abused
> for things not GPIO.
They are bootmode pins because that pins are designed and used by ROM to
get information which boot device should be used.
But after this is it is really behaving as generic purpose I/O pins.
Xilinx is using them for years for usb phy resets. I have also seen them
to be used for other reset functionality.
And that's exactly what we are trying to do here by this driver. Because
usb hubs/phys have reset normally connected via gpio pin which is
toggled. And we have boards where these resets are connected via these
pins or via hard gpio IP or via i2c-gpio expanders that's why IMHO this
option should be designed in the same way to have gpio reset
functionality added dwc3 and based on DT/board bootmode gpio, ps gpio,
pl gpio, i2c gpio or gpio over power regulators, etc will be used.
Please let me know if you want to get more information about it.
Thanks,
Michal
Powered by blists - more mailing lists