initramfs for ACPI tables on x86

Daniel Golle daniel at makrotopia.org
Thu Sep 30 06:04:12 PDT 2021


On Thu, Sep 30, 2021 at 02:49:57PM +0200, Florian Eckert wrote:
> Since the update of kernel from 5.4 to 5.10 in the openwrt master branch
> [1],
> I have problems with additional hardware on the I2C (SMBus) of my APU3.
> 
> The Linux upstream removed the platform data support for my I2C IO-Expander
> mcp23s08 [3].
> Because of this change I could not use my own written platform device
> specification anymore.
> 
> This is common for this kind of device on x86 which does not support
> device-tree.
> See for exaple the platform init on the x86 geode board.[5]
> 
> If the device supports ACPI, this is now the why to do this [6].
> I am still in the process of building the SSDT ACPI table for the i2c
> mcp23s08 device connect to the SMBus.
> 
> As I now know we could load these SSTD into the kernel during operation or
> via an initrd on boot.
> 
> As far as I have seen, no initrd is loaded during normal operation [4] on
> OpenWrt.
> 
> Is there any way to create an initrd to load the ACPI tables and then mount
> the initrd so the kernel can load this kind of files?
> What would this look like in OpenWrt?

I think it should be just as fine to load them early during boot,
ie. place a script in /lib/preinit/ which does that.

On boards with coreboot like the apu3 the best would probably be to
fix ACPI tables supplied by the BIOS (or swap SeaBIOS for an UEFI
implementation like Tianocore at the same time) instead of patching
things using Linux at runtime.


> 
> On other target we have the device-tree but on X86 this is not possible and
> we could only use ACPI for this kind of task.
> To do this the acpica package is needed to generate an SSDT [7]
> 
> The initramfs that are created now run completely in RAM and are intended
> for development purposes only.
> 
> Does anyone have any experience or has already deal with this topic of ACPI
> and inird in OpenWrt?
> I would be happy if someone shares their thoughts with me.
> 
> --
> Regards Florian
> 
> [1] https://git.openwrt.org/?p=openwrt/openwrt.git;a=blobdiff;f=target/linux/x86/Makefile;h=fbad527e0ac3239647a9d1eabcaf8fd751396973;hp=0ab322d8bc4fd31a75cb16dba8665b1db315398f;hb=64be0eadc17988f29d0a4b89569840d917746498;hpb=c9042202ad39e447a21afd91ec777bbc6cc8b72c
> [2] https://pcengines.ch/apu.htm
> [3] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/drivers/pinctrl/pinctrl-mcp23s08.c?h=v5.10.70&id=6aba6ed879b3471903c8ada28ba968a268df6143
> [4] https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=target/linux/x86/image/grub-pc.cfg;hb=fa13dd658f59df41b9184d4dc15a5b29530e7c2c
> [5] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/arch/x86/platform/geode/alix.c?h=v5.10.70
> [6] https://www.youtube.com/watch?v=nlKjUAv3RL0&ab_channel=OSDNConf
> [7] https://github.com/openwrt/packages/pull/16775
> 
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list