public inbox for linux-gpio@vger.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Conor Dooley <conor.dooley@microchip.com>,
	Yinbo Zhu <zhuyinbo@loongson.cn>
Cc: Conor Dooley <conor@kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <brgl@bgdev.pl>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	linux-gpio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, Jianmin Lv <lvjianmin@loongson.cn>,
	wanghongliang@loongson.cn, Liu Peibao <liupeibao@loongson.cn>,
	loongson-kernel@lists.loongnix.cn
Subject: Re: [PATCH v2 1/2] gpio: dt-bindings: add parsing of loongson gpio offset
Date: Thu, 3 Aug 2023 08:41:09 +0200	[thread overview]
Message-ID: <ca969933-c7f8-a727-3c7e-5ec3548862a0@linaro.org> (raw)
In-Reply-To: <20230803-tartar-tainted-968687047460@wendy>

On 03/08/2023 08:30, Conor Dooley wrote:
>>>>                  gpio0:gpio@0x1fe10430 {
>>>>                          compatible = "loongson,ls2k-gpio";
>>>>                          reg = <0 0x1fe10430 0 0x20>;
>>>>                          gpio-controller;
>>>>                          #gpio-cells = <2>;
>>>> 			interrupt-parent = <&liointc1>;
>>>>                          ngpios = <64>;
>>>>                          loongson,gpio-conf-offset = <0>;
>>>>                          loongson,gpio-out-offset = <0x10>;
>>>>                          loongson,gpio-in-offset = <0x8>;
>>>>                          loongson,gpio-inten-offset = <0xb0>;
>>>> 			loongson,gpio-ctrl-mode = <0x0>;
>>>>                          ...
>>>> 		  }
>>>>
>>>>                  gpio1:gpio@0x1fe10450 {
>>>>                          compatible = "loongson,ls2k-gpio";
>>>>                          reg = <0 0x1fe10450 0 0x20>;
>>>>                          gpio-controller;
>>>>                          #gpio-cells = <2>;
>>>> 			interrupt-parent = <&liointc1>;
>>>>                          ngpios = <64>;
>>>>                          loongson,gpio-conf-offset = <0>;
>>>>                          loongson,gpio-out-offset = <0x10>;
>>>>                          loongson,gpio-in-offset = <0x8>;
>>>
>>> These 3 are the same for both controllers, no?
>>> Is only the inten-offset a variable?
>>>
>>>>                          loongson,gpio-inten-offset = <0x98>;
>>>
>>> These offsets exceed the region that you've got in the reg property for
>>> this controller, do they not?
>>>
>>> Is there some sort of "miscellaneous register area" at 0x1FE104E0, or
>>> just those two interrupt registers and nothing else?
>>
>>
>> 2k500 gpio dts is just an example, like 3a5000, or more other platform,
>> above offset was different but the gpio controller was compatible.
>>
>>                 gpio: gpio@1fe00500 {
>>                         compatible = "loongson,ls2k-gpio";
>>                         reg = <0 0x1fe00500 0xc00>;
>>                         gpio-controller;
>>                         #gpio-cells = <2>;
>>                         ngpios = <16>;
>>                         loongson,gpio-conf-offset = <0x0>;
>>                         loongson,gpio-out-offset = <0x8>;
>>                         loongson,gpio-in-offset = <0xc>;
>> 			...
>> 			}
> 
> That is a different SoC and needs to have a different compatible string.
> "loongson,ls2k-foo" compatible strings were a mistake that only got past
> us because we were not aware it was a family, rather than a specific
> SoC. They certainly should not be used in isolation on a 3a5000!
> 
> Are there more than one GPIO controllers on the 3a5000? If so, what do
> those nodes look like.

Eh, even for the same SoC having different offsets suggest that
programming model is a bit different. Anyway, who designed such
hardware? Really?

Best regards,
Krzysztof


  reply	other threads:[~2023-08-03  6:41 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-31  9:10 [PATCH v2 0/2] gpio: loongson: add firmware offset parse support Yinbo Zhu
2023-07-31  9:10 ` [PATCH v2 1/2] gpio: dt-bindings: add parsing of loongson gpio offset Yinbo Zhu
2023-07-31 15:55   ` Conor Dooley
2023-08-01  6:39     ` Yinbo Zhu
2023-08-01  7:23       ` Conor Dooley
2023-08-01  8:34         ` Yinbo Zhu
2023-08-01 15:54           ` Conor Dooley
2023-08-02  1:38             ` Yinbo Zhu
2023-08-02  7:22               ` Conor Dooley
2023-08-02  7:44                 ` Yinbo Zhu
2023-08-02  7:50                   ` Conor Dooley
2023-08-02  8:37                     ` Yinbo Zhu
2023-08-02 15:36                       ` Conor Dooley
2023-08-03  1:56                         ` Yinbo Zhu
2023-08-03  6:30                           ` Conor Dooley
2023-08-03  6:41                             ` Krzysztof Kozlowski [this message]
2023-08-03  9:42                               ` Yinbo Zhu
2023-07-31  9:10 ` [PATCH v2 2/2] gpio: loongson: add firmware offset parse support Yinbo Zhu

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=ca969933-c7f8-a727-3c7e-5ec3548862a0@linaro.org \
    --to=krzysztof.kozlowski@linaro.org \
    --cc=brgl@bgdev.pl \
    --cc=conor+dt@kernel.org \
    --cc=conor.dooley@microchip.com \
    --cc=conor@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liupeibao@loongson.cn \
    --cc=loongson-kernel@lists.loongnix.cn \
    --cc=lvjianmin@loongson.cn \
    --cc=robh+dt@kernel.org \
    --cc=wanghongliang@loongson.cn \
    --cc=zhuyinbo@loongson.cn \
    /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