initramfs for ACPI tables on x86

Alberto Bursi bobafetthotmail at gmail.com
Fri Oct 1 01:02:11 PDT 2021



On 30/09/21 15:04, Daniel Golle wrote:
> 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.


you can also load tables from configfs (if you enable that on kernel 
compile time).
See the kernel documentation about this feature
https://www.kernel.org/doc/html/latest/admin-guide/acpi/ssdt-overlays.html


>>
>> 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.

This isn't a fix, he has added hardware on I2C that is not on standard 
on APU3.

Although yes he could compile a custom coreboot with this ACPI table 
modification baked in.

-Alberto



More information about the openwrt-devel mailing list