From: "Arınç ÜNAL" <arinc.unal@arinc9.com>
To: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
linux-mediatek@lists.infradead.org, linux-mips@vger.kernel.org,
linux-gpio@vger.kernel.org, devicetree@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Matthias Brugger <matthias.bgg@gmail.com>,
Sean Wang <sean.wang@kernel.org>,
William Dean <williamsukatube@gmail.com>,
Daniel Golle <daniel@makrotopia.org>,
Daniel Santos <daniel.santos@pobox.com>,
Luiz Angelo Daros de Luca <luizluca@gmail.com>,
Frank Wunderlich <frank-w@public-files.de>,
Landen Chao <Landen.Chao@mediatek.com>,
DENG Qingfang <dqfext@gmail.com>,
Sean Wang <sean.wang@mediatek.com>,
erkin.bozoglu@xeront.com
Subject: Re: [RFC PATCH 00/16] pinctrl: ralink: fix ABI, improve driver, move to mediatek, improve dt-bindings
Date: Thu, 23 Feb 2023 09:01:59 +0300 [thread overview]
Message-ID: <286c6f85-8c5c-907f-a77b-b0c62e97a18a@arinc9.com> (raw)
In-Reply-To: <CAMhs-H8cKG_aQaE_JBuEfchQ4jNZT5NRPEypywWFuFtsc2MiZg@mail.gmail.com>
On 23.02.2023 07:58, Sergio Paracuellos wrote:
> Hi Arınç,
>
> All of this looks pretty good to me. You did a really big effort with
> this series. Thanks for doing this!
>
> On Wed, Feb 22, 2023 at 7:39 PM <arinc9.unal@gmail.com> wrote:
>>
>> This is an ambitious effort I've been wanting to do for months.
>>
>> Straight off the bat, I'm fixing the ABI that I broke a while back, by
>> reintroducing the ralink,rt2880-pinmux compatible string.
>>
>> If you take a look at the schema for mt7620 and rt305x, some functions got
>> multiple lists for groups. Like refclk on mt7620. Because mt7620 and
>> mt7628/mt7688 SoCs use the same compatible string, it's impossible to
>> differentiate on the binding which SoC a devicetree is actually for.
>> Therefore, the binding will allow all groups listed for that function. For
>> example, if the SoC is mt7620, only the refclk function for the mdio group
>> can be used. If one were to put "spi cs1" as the function there, there
>> wouldn't be a warning.
>>
>> I address this by introducing new compatible strings for these SoCs, then
>> split the schemas. I also separate mt7628/mt7688 from mt7620 pinctrl
>> subdriver in the process.
>>
>> I wanted to split the rt305x driver too but too much code would be reused
>> so I backed down from that.
>>
>> Ralink was acquired by MediaTek in 2011. These SoCs have been rebranded as
>> MediaTek. We're moving the Ralink pinctrl driver to MediaTek, and rename
>> the schemas to mediatek.
>>
>> I've renamed the ralink core driver to mtmips. I decided to call the core
>> mtmips as I've seen folks from MediaTek use the same name when they added
>> support for MT7621 pinctrl on U-Boot. Feel free to comment on this.
>>
>> The MTMIPS pinctrl driver requires rt_sysc_membase from
>> arch/mips/ralink/of.c, so, for COMPILE_TEST to be useful, RALINK must be
>> selected. These headers, asm/mach-ralink/ralink_regs.h and
>> asm/mach-ralink/mt7620.h, from arch/mips/include are also required but
>> they can easily be included:
>>
>> ifeq ($(CONFIG_COMPILE_TEST),y)
>> CFLAGS_pinctrl-mtmips.o += -I$(srctree)/arch/mips/include
>> endif
>>
>> Sergio, do you see a way to make the pinctrl driver independent of
>> architecture code? At least avoid using rt_sysc_membase.
>
> The only really dependent architecture code in these drivers now is
> because of the use of
> 'rt_sysc_r32()' and 'rt_sysc_w32()' in 'ralink_pmx_group_enable()'
> function [0]. This is just to set the gpio mode. The read and write
> registers here SYSC_REG_GPIO_MODE and SYSC_REG_GPIO_MODE2 are in the
> system controller area. In all single ralink platform 'sysc' nodes
> should be a syscon that can be accessed from the driver side. That way
> you can just get those syscon areas via regmap APIs and properly read
> and write desired registers. For the mt7621.dtsi file, the node is
> already a syscon [1]. Other ralink device tree files should also be
> modified to include this in its 'sysc' node (I think in openWRT dts
> files at least for mt7620 is already included). You have to add that
> in all of them since 'ralink_pmx_group_enable()' is common code for
> all. I think this can be done in a different patch series. I can help
> you to do this after this series is reviewed and accepted.
Awesome, thanks a lot! Note to self, "depends on RALINK" menu entries
should be changed to "depends on OF" when this happens.
Arınç
prev parent reply other threads:[~2023-02-23 6:02 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-22 18:39 arinc9.unal
2023-02-22 18:39 ` [RFC PATCH 01/16] pinctrl: ralink: reintroduce ralink,rt2880-pinmux compatible string arinc9.unal
2023-02-22 18:39 ` [RFC PATCH 02/16] pinctrl: ralink: add mediatek compatible strings arinc9.unal
2023-02-22 18:39 ` [RFC PATCH 03/16] pinctrl: ralink: rt305x: add compatible string for every SoC arinc9.unal
2023-02-22 18:39 ` [RFC PATCH 04/16] pinctrl: ralink: mt7620: split out to mt76x8 arinc9.unal
2023-02-22 18:39 ` [RFC PATCH 05/16] pinctrl: ralink: move to mediatek as mtmips arinc9.unal
2023-02-22 18:39 ` [RFC PATCH 06/16] pinctrl: mediatek: remove OF_GPIO as reverse dependency arinc9.unal
2023-02-22 18:39 ` [RFC PATCH 07/16] dt-bindings: pinctrl: ralink: add new compatible strings arinc9.unal
2023-02-27 17:33 ` Rob Herring
2023-02-28 16:46 ` Arınç ÜNAL
2023-03-01 2:44 ` Rob Herring
2023-03-01 8:15 ` Arınç ÜNAL
2023-03-02 8:28 ` Krzysztof Kozlowski
2023-03-02 9:17 ` Arınç ÜNAL
2023-03-02 9:58 ` Krzysztof Kozlowski
2023-03-02 10:22 ` Arınç ÜNAL
2023-03-02 10:29 ` Krzysztof Kozlowski
2023-03-02 10:47 ` Arınç ÜNAL
2023-03-02 11:36 ` Krzysztof Kozlowski
2023-03-02 11:50 ` Arınç ÜNAL
2023-03-03 7:05 ` Krzysztof Kozlowski
2023-03-03 7:44 ` Arınç ÜNAL
2023-03-03 7:53 ` Krzysztof Kozlowski
2023-03-03 8:03 ` Arınç ÜNAL
2023-03-02 22:33 ` Arınç ÜNAL
2023-02-22 18:39 ` [RFC PATCH 08/16] dt-bindings: pinctrl: ralink: rename to mediatek arinc9.unal
2023-02-22 18:39 ` [RFC PATCH 09/16] dt-bindings: pinctrl: mediatek: rt305x: split binding arinc9.unal
2023-02-27 17:38 ` Rob Herring
2023-02-28 8:24 ` Krzysztof Kozlowski
2023-02-22 18:39 ` [RFC PATCH 10/16] dt-bindings: pinctrl: mediatek: mt7620: " arinc9.unal
2023-02-27 18:21 ` Rob Herring
2023-02-28 19:38 ` Arınç ÜNAL
2023-02-22 18:39 ` [RFC PATCH 11/16] MAINTAINERS: move ralink pinctrl to mediatek mips pinctrl arinc9.unal
2023-02-22 18:39 ` [RFC PATCH 12/16] dt-bindings: pinctrl: mediatek: mt6795: rename to mediatek,mt6795-pinctrl arinc9.unal
2023-02-27 18:22 ` Rob Herring
2023-02-22 18:39 ` [RFC PATCH 13/16] dt-bindings: pinctrl: mediatek: mt8186: rename to mediatek,mt8186-pinctrl arinc9.unal
2023-02-27 18:23 ` Rob Herring
2023-02-22 18:39 ` [RFC PATCH 14/16] dt-bindings: pinctrl: mediatek: mt8192: rename to mediatek,mt8192-pinctrl arinc9.unal
2023-02-27 18:24 ` Rob Herring
2023-02-22 18:39 ` [RFC PATCH 15/16] dt-bindings: pinctrl: mediatek: mt8195: rename to mediatek,mt8195-pinctrl arinc9.unal
2023-02-27 18:24 ` Rob Herring
2023-02-22 18:39 ` [RFC PATCH 16/16] dt-bindings: pinctrl: mediatek: improve schemas arinc9.unal
2023-02-27 18:28 ` Rob Herring
2023-02-23 4:58 ` [RFC PATCH 00/16] pinctrl: ralink: fix ABI, improve driver, move to mediatek, improve dt-bindings Sergio Paracuellos
2023-02-23 6:01 ` Arınç ÜNAL [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=286c6f85-8c5c-907f-a77b-b0c62e97a18a@arinc9.com \
--to=arinc.unal@arinc9.com \
--cc=Landen.Chao@mediatek.com \
--cc=daniel.santos@pobox.com \
--cc=daniel@makrotopia.org \
--cc=devicetree@vger.kernel.org \
--cc=dqfext@gmail.com \
--cc=erkin.bozoglu@xeront.com \
--cc=frank-w@public-files.de \
--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-mediatek@lists.infradead.org \
--cc=linux-mips@vger.kernel.org \
--cc=luizluca@gmail.com \
--cc=matthias.bgg@gmail.com \
--cc=robh+dt@kernel.org \
--cc=sean.wang@kernel.org \
--cc=sean.wang@mediatek.com \
--cc=sergio.paracuellos@gmail.com \
--cc=williamsukatube@gmail.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
all inboxes | Powered by JetHome®