From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Johan Jonker <jbx6244@gmail.com>, Rob Herring <robh@kernel.org>
Cc: linus.walleij@linaro.org, brgl@bgdev.pl,
krzysztof.kozlowski+dt@linaro.org, heiko@sntech.de,
linux-gpio@vger.kernel.org, devicetree@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org,
kever.yang@rock-chips.com, sjg@chromium.org,
philipp.tomsich@vrull.eu
Subject: Re: [PATCH v1 1/4] dt-bindings: gpio: rockchip,gpio-bank: add compatible string per SoC
Date: Wed, 18 Jan 2023 19:32:12 +0100 [thread overview]
Message-ID: <a60e7f50-c39f-07e5-7238-e3a4031b45a4@linaro.org> (raw)
In-Reply-To: <f624fcf3-f8f1-68c0-eab0-43bcda3cbe90@gmail.com>
On 18/01/2023 18:12, Johan Jonker wrote:
>
>
> On 1/18/23 16:32, Rob Herring wrote:
>> On Wed, Jan 18, 2023 at 01:13:23PM +0100, Johan Jonker wrote:
>>> Currently all Rockchip gpio nodes have the same compatible.
>>> Replace all the compatibles in gpio nodes to be able to
>>> give them a consistent ID independent from probe order or alias.
>>
>> I fail to see how the compatible change affects probe order or aliases.
>> It is also an ABI break if there is not the existing compatible as a
>> fallback. State the problem you are trying to solve with this change,
>> not just what your solution is.
>
> Hi Rob,
>
> Since the yaml conversion of rockchip,gpio-bank.yaml we have generic "gpio" names instead of "gpio-1".
> For both Linux and U-boot there's a need for a consisted ID order between the nodes.
Still do not see how compatible is related to this.
>
> The kernel has no logic to decide between the first compatible and the fallback.
> A fallback doesn't have ability to add/select "data" with probe, but have to use
> of_device_is_compatible(np, "rockchip,rk3188-gpio-bank") for "15" SoCs instead.
>
> I can produce a serie with fall back.
> Let us know how to move forward here.
>
> Kind regards,
>
> Johan Jonker
>
>
> ===
> Linux driver behavior:
>
> id = of_alias_get_id(np, "gpio");
> if (id < 0)
> id = gpio++;
>
> Problems:
> Alias not always available in existing DT files(not part of the binding)
> Probe order is not guarantied and possible number gap for rk3066a between gpio4 and gpio6.
> (id counter gives not consistent result)
Again, how compatible is related to this?
>
> ===
> U-boot rk_gpio.c current behavior:
>
> end = strrchr(dev->name, '@');
> priv->bank = trailing_strtoln(dev->name, end);
> priv->name[0] = 'A' + priv->bank;
> uc_priv->bank_name = priv->name;
>
> Problems:
> Crash when node name has no "gpio-1" format
>
> U-boot rk-gpio proposed:
>
> priv->name[0] = 'A' + dev_seq(dev);
> uc_priv->bank_name = priv->name;
>
> Problems:
> Reduced FDT's and rk3066a gives number gaps.
>
> ===
>
> My proposal:
>
> struct lookup_table rk_gpio_rk3188_data[] = {
> {0x2000a000, "A"},
> {0x2003c000, "B"},
> {0x2003e000, "C"},
> {0x20080000, "D"},
> };
>
> { .compatible = "rockchip,rk3188-gpio-bank", .data = &rk_gpio_rk3188_data },
Which you did not do... Your patch is doing something entirely else.
Best regards,
Krzysztof
prev parent reply other threads:[~2023-01-18 18:32 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-18 12:13 [PATCH v1 1/4] dt-bindings: gpio: rockchip,gpio-bank: add compatible string per SoC Johan Jonker
2023-01-18 12:14 ` [PATCH v1 2/4] gpio: gpio-rockchip: " Johan Jonker
2023-01-18 14:14 ` Bartosz Golaszewski
2023-01-18 15:35 ` Krzysztof Kozlowski
2023-01-18 12:15 ` [PATCH v1 3/4] ARM: dts: rockchip: replace compatible gpio nodes Johan Jonker
2023-01-18 12:15 ` [PATCH v1 4/4] arm64: " Johan Jonker
2023-01-18 15:32 ` [PATCH v1 1/4] dt-bindings: gpio: rockchip,gpio-bank: add compatible string per SoC Rob Herring
2023-01-18 17:12 ` Johan Jonker
2023-01-18 18:32 ` Krzysztof Kozlowski [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=a60e7f50-c39f-07e5-7238-e3a4031b45a4@linaro.org \
--to=krzysztof.kozlowski@linaro.org \
--cc=brgl@bgdev.pl \
--cc=devicetree@vger.kernel.org \
--cc=heiko@sntech.de \
--cc=jbx6244@gmail.com \
--cc=kever.yang@rock-chips.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=philipp.tomsich@vrull.eu \
--cc=robh@kernel.org \
--cc=sjg@chromium.org \
/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).