mt7621 GPIO mapping mystery

Lukas Zeller luz at plan44.ch
Sun Jan 22 02:03:33 PST 2023


Hi Bas,

> On 21 Jan 2023, at 22:53, Bas Mevissen <abuse at basmevissen.nl> wrote:
> 
>> On 2023-01-21 22:42, Lukas Zeller wrote:
>> That really looks like a great solution with all advantages combined!
>> I agree this is better than patching, I just did not realize it was
>> possible at all to modularize dt overlay functionality this way.
> 
> It is a thing very commonly done on RPi "hats" to change the pin config on the extension header.

Yes, RPi has DT overlays, but AFAIK these are merged by the rpi-specific bootloader according to what config.txt says, before starting the linux kernel. I don't think RPi offers a way to add overlays after boot via configfs by default.

Many other platforms don't have a bootloader which allows that pre-boot overlay loading. U-boot can do it [1], but it depends on how it is built, and replacing u-boot on a given target is more demanding than installing a kernel module.

So the dtbocfg loadable module as recommended by Tomasz enables DT overlays even for targets which don't have such functionality in the boot loader, just by installing a package, which is nice and a pretty generic solution. It is not totally generic because it requires the kernel to be built with CONFIG_OF_OVERLAY set, which seems not to be the default in most targets.

> You may find some documentation and examples there that may help you.

Indeed, due to the popularity of overlays in the RPi space, there are a lot of examples.

Lukas

[1] : https://u-boot.readthedocs.io/en/latest/usage/fdt_overlays.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.openwrt.org/pipermail/openwrt-devel/attachments/20230122/e80327be/attachment.sig>


More information about the openwrt-devel mailing list