mt7621 GPIO mapping mystery

Arınç ÜNAL arinc.unal at arinc9.com
Sun Jan 22 10:24:58 PST 2023


On 22.01.2023 20:44, Daniel Santos wrote:
> 
> On 1/22/23 00:23, Arınç ÜNAL wrote:
>> On 22 January 2023 02:02:04 GMT+03:00, Daniel Santos 
>> <daniel.santos at pobox.com> wrote:
>>> On 1/21/23 15:19, Arınç ÜNAL wrote:
>>>> On 21.01.2023 21:32, Daniel Santos wrote:
>>>>> ... You can use this to see what the valid values are for each 
>>>>> group, because until this all goes yaml, there's nothing to tell 
>>>>> you if you've used an invalid value.
>>>> Speaking of which:
>>>>
>>>> https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git/commit/?h=for-next&id=4e5410668af5475681793df2bb8c7d8dc6f9c327
>>>>
>>>> https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git/commit/?h=for-next&id=0c9a567651c3b5d433429da2c7d8e8406ddf1076
>>>>
>>>> https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git/commit/?h=for-next&id=b4ac84395820eaa0b99ec56816e53c9386ca8b38
>>>>
>>>> https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git/commit/?h=for-next&id=d648fd64e10d9d1609146d0c4e47b0f5988e2a2b
>>>>
>>>> https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git/commit/?h=for-next&id=844bca60927f3aae6baafafb1edd218b624254a1
>>>>
>>>> Arınç
>>> OH FUCK YES!!!  Arınç, you and I are friends now!! :D
>> Haha hello there!
>>
>> Arınç
> 
> I don't want to spam the group with this, but you have no idea how much 
> bullshit I've been through that turned out to be a mistake in my device 
> tree file for which there was no warning about. I almost re-wrote the 
> ramips arch code over it, but I had to pull myself back when it was 
> clear that it was unnecessary for my project and hard to justify billing 
> for it. I have that ADHD thing, so I have to stay on track.

Glad to read this helps you tremendously. By the way, you didn't CC 
anyone else so the list didn't receive it ;).

> 
> Anyway, I'm really pleased to see this and it reminds me that I have a 
> lot of kernel patches I need to submit both to OpenWRT and upstream, 
> including fixing a command line bug for ramips.

Speaking of fixing stuff, if you take a look at the yaml 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 your 
DT is actually for.

Therefore, the binding will allow all groups listed for that function. 
For example if your SoC is mt7620, you can only use the refclk function 
for the mdio group. If you were to put "spi cs1" as the function there, 
you wouldn't get a warning.

I want to fix this by actually separating mt7628/mt7688 from mt7620 on 
the pinctrl driver, then split the dt-binding, but I don't know C good 
enough to do this myself.

I have a lot of things I can actually do right now on my task list which 
could take more than a year (if nothing new is added on top) to 
complete, so I'm very slowly learning it. It's also the first 
programming language I ever attempt to learn so understanding the logic 
of programming is another challenge I've got to deal with.

I'd appreciate it greatly if you could help me out on this as you seem 
to know C.

However, I have to send a mail to pinctrl mailing list, see if I can 
justify breaking the ABI with the maintainers since we would be changing 
the compatible string for certain SoCs. I've done it once.

Arınç



More information about the openwrt-devel mailing list