From: "Rafał Miłecki" <zajec5@gmail.com>
To: Tony Lindgren <tony@atomide.com>
Cc: "Linus Walleij" <linus.walleij@linaro.org>,
"Rob Herring" <robh+dt@kernel.org>,
"Andy Shevchenko" <andy.shevchenko@gmail.com>,
linux-gpio@vger.kernel.org, devicetree@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
"Florian Fainelli" <f.fainelli@gmail.com>,
bcm-kernel-feedback-list@broadcom.com,
"Rafał Miłecki" <rafal@milecki.pl>
Subject: Re: [PATCH 2/5] dt-bindings: pinctrl: brcm,ns-pinmux: extend example
Date: Tue, 23 Nov 2021 08:56:01 +0100 [thread overview]
Message-ID: <2fb0593a-208f-a732-843b-b6723633e208@gmail.com> (raw)
In-Reply-To: <YZyahbYwMFz7baTu@atomide.com>
On 23.11.2021 08:38, Tony Lindgren wrote:
> 200* Rafał Miłecki <zajec5@gmail.com> [211118 13:30]:
>> @@ -83,6 +83,33 @@ examples:
>> reg = <0x1800c1c0 0x24>;
>> reg-names = "cru_gpio_control";
>>
>> + pins {
>> + #address-cells = <1>;
>> + #size-cells = <0>;
>> +
>> + pin@4 {
>> + reg = <4>;
>> + label = "i2c_scl";
>> + };
>> +
>> + pin@5 {
>> + reg = <5>;
>> + label = "i2c_sda";
>> + };
>> + };
>
> The reg property should indicate the hardware offset from the device base
> address. The reg values above for 4 and 5 seem to be indexed instead :)
> Please update to use real register offsets from the 0x1800c1c0 base
> instead. If a reg offset + bit offset are needed, the #address-cells or
> #pinctrl-cells can be used.
It's true those are "reg"s are PINS indexes and not actual hw registers.
That concept of changing "reg" context is nothing new here however. It's
used in many other places.
Some examples:
1. net/mdio-mux.yaml
"reg" is used for "The sub-bus number" (not actual hw register)
2. usb/usb-device.yaml
"reg" is used for USB port index on USB hub
3. spi/spi-controller.yaml
"reg" is used for "Chip select used by the device."
4. mtd/partitions/partition.yaml
"reg" is used for "partition's offset and size within the flash"
Does it mean above "reg" usages are all incorrect and binding "reg" in
such way is deprecated? This is something totally new to me, can you
confirm that, please?
> The main problem using an index is that you need to keep it in sync
> between the dts and device driver. And if a new SoC variant adds an entry
> between the registers, you end up having to renumber the index.
I don't understand that part. That index ("reg" value in above example)
is actual PIN number. It's expected to match hw datasheets. Order
doesn't matter there.
If new hw revision adds PIN 2, I could just add pin@2 { ... };
next prev parent reply other threads:[~2021-11-23 7:56 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-18 13:21 [PATCH 0/5] pinctrl: allow storing pins, groups & functions in DT Rafał Miłecki
2021-11-18 13:21 ` [PATCH 1/5] dt-bindings: pinctrl: support specifying pins, groups & functions Rafał Miłecki
2021-11-18 13:21 ` [PATCH 2/5] dt-bindings: pinctrl: brcm,ns-pinmux: extend example Rafał Miłecki
2021-11-18 22:09 ` Rob Herring
2021-11-19 6:24 ` Rafał Miłecki
2021-11-23 7:38 ` Tony Lindgren
2021-11-23 7:56 ` Rafał Miłecki [this message]
2021-11-23 8:01 ` Rafał Miłecki
2021-11-23 9:15 ` Tony Lindgren
2021-11-23 13:51 ` Rafał Miłecki
2021-11-18 13:21 ` [PATCH 3/5] pinctrl: add helpers reading pins, groups & functions from DT Rafał Miłecki
2021-11-18 13:57 ` Andy Shevchenko
2021-11-18 14:17 ` Rafał Miłecki
2021-11-18 16:22 ` Andy Shevchenko
2021-11-21 23:53 ` Linus Walleij
2021-11-18 13:21 ` [PATCH 4/5] pinctrl: bcm: pinctrl-ns: supoprt DT specified pins, groups & functions Rafał Miłecki
2021-11-18 13:21 ` [PATCH 5/5] ARM: dts: BCM5301X: add pinctrl " Rafał Miłecki
2021-11-18 13:52 ` [PATCH 0/5] pinctrl: allow storing pins, groups & functions in DT Andy Shevchenko
2021-11-18 13:59 ` Rafał Miłecki
2021-11-18 16:30 ` Andy Shevchenko
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=2fb0593a-208f-a732-843b-b6723633e208@gmail.com \
--to=zajec5@gmail.com \
--cc=andy.shevchenko@gmail.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=devicetree@vger.kernel.org \
--cc=f.fainelli@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=rafal@milecki.pl \
--cc=robh+dt@kernel.org \
--cc=tony@atomide.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;
as well as URLs for NNTP newsgroup(s).