From: Lukasz Majewski <lukma@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v5 3/6] ARM: dts: imx: Provide 'gpio-ranges' for mxs_gpio driver
Date: Mon, 24 Jun 2019 11:56:30 +0200 [thread overview]
Message-ID: <20190624115630.71756d46@jawa> (raw)
In-Reply-To: <98e3aa7e-ed35-b5a6-bbb7-287c22271cca@denx.de>
On Wed, 19 Jun 2019 17:05:15 +0200
Marek Vasut <marex@denx.de> wrote:
> On 6/19/19 4:53 PM, Lukasz Majewski wrote:
> > On Wed, 19 Jun 2019 16:32:57 +0200
> > Marek Vasut <marex@denx.de> wrote:
> >
> >> On 6/19/19 4:19 PM, Lukasz Majewski wrote:
> >>> Hi Marek,
> >>>
> >>>> On 6/19/19 2:27 PM, Lukasz Majewski wrote:
> >>>>> Those properties are U-Boot specific as the mxs gpio Linux
> >>>>> driver (up to version v5.1.11) is not supporting them.
> >>>>>
> >>>>> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> >>>>
> >>>> [...]
> >>>>
> >>>>> +&gpio4 {
> >>>>> + gpio-ranges = <&pinctrl 120 0 21>;
> >>>>
> >>>> Are you sure the GPIO controller offset is 120 here ? Shouldn't
> >>>> that be 0 , while the pin controller offset should be 120 ? Some
> >>>> for the others ?
> >>>
> >>> Please find following excerpt from the documentation [1]:
> >>>
> >>> The format is: <[pin controller phandle], [GPIO controller
> >>> offset], [pin controller offset], [number of pins]>;
> >>>
> >>> Example:
> >>>
> >>> gpio-ranges = <&foo 0 20 10>, <&bar 10 50 20>;
> >>>
> >>> This means:
> >>> - pins 20..29 on pin controller "foo" is mapped to GPIO line 0..9
> >>> and
> >>> - pins 50..69 on pin controller "bar" is mapped to GPIO line
> >>> 10..29
> >>>
> >>>
> >>> The 120 is the GPIO controller offset (logical one) [*] and
> >>> corresponds to the final GPIO number.
> >>>
> >>> Then we do have the "pin controller offset" which is the pin
> >>> number start index per controller (like gpio0, gpio1, gpioN). In
> >>> my case it is always 0.
> >>
> >> I think you have these two swapped. The pin controller is the
> >> super-node here, hence each GPIO block is at offset N in the pin
> >> controller pin space. Each GPIO block then has GPIOs, which either
> >> start from 0 or M within the GPIO block pin space (in MXS case,
> >> this is always 0).
> >
> > Yes, correct. This shall be <&pinctrl 0 120 21>
> >
> > I will prepare v6.
>
> And update the GPIO controller driver accordingly.
>
Only the DTS file needs update as I'm not using those particular
entries for setting up the DM gpio controller.
The driver code doesn't need update.
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190624/4ccb560e/attachment.sig>
next prev parent reply other threads:[~2019-06-24 9:56 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-19 12:27 [U-Boot] [PATCH v5 0/6] DM: Convert i.MX28 gpio, pinmux, spi and eth drivers to DM/DTS Lukasz Majewski
2019-06-19 12:27 ` [U-Boot] [PATCH v5 1/6] ARM: dts: imx: Copy imx28 device tree related files from Linux kernel (v5.1.11) Lukasz Majewski
2019-06-19 13:41 ` Marek Vasut
2019-06-19 12:27 ` [U-Boot] [PATCH v5 2/6] net: fec: Enable support for i.MX28 DM_ETH in the fec_mxc.c driver Lukasz Majewski
2019-06-19 13:42 ` Marek Vasut
2019-06-19 12:27 ` [U-Boot] [PATCH v5 3/6] ARM: dts: imx: Provide 'gpio-ranges' for mxs_gpio driver Lukasz Majewski
2019-06-19 13:41 ` Marek Vasut
2019-06-19 14:19 ` Lukasz Majewski
2019-06-19 14:32 ` Marek Vasut
2019-06-19 14:53 ` Lukasz Majewski
2019-06-19 15:05 ` Marek Vasut
2019-06-24 9:56 ` Lukasz Majewski [this message]
2019-06-19 12:27 ` [U-Boot] [PATCH v5 4/6] gpio: mxs: Add support for DM/DTS in the mxs_gpio.c driver (DM_GPIO) Lukasz Majewski
2019-06-19 13:42 ` Marek Vasut
2019-06-19 12:27 ` [U-Boot] [PATCH v5 5/6] pinctrl: mxs: Add support for i.MX2[38] mxs pinctrl driver Lukasz Majewski
2019-06-19 13:42 ` Marek Vasut
2019-06-19 12:27 ` [U-Boot] [PATCH v5 6/6] spi: mxs: Add support DM/DTS for i.MX28 mxs SPI driver (DM_SPI conversion) Lukasz Majewski
2019-06-19 13:51 ` Marek Vasut
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=20190624115630.71756d46@jawa \
--to=lukma@denx.de \
--cc=u-boot@lists.denx.de \
/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