CPU frequency scaling on x86 AMD SOC (APU2 etc.)

Hi, I'd like to run OpenWRT on an embedded system (a re-purposed commercial firewall) which uses an AMD GX-416RA SOC, 1.6GHz quad-core. This box will replace several other devices with the aim to reduce overall network power usage. It's important to me to get overall power consumption down to a minimum, as electricity is expensive here.

The device has an AMI Aptio v4.5 BIOS, however the BIOS support for ACPI power management is not functional. As recent Linux kernels seem to depend solely on ACPI for CPU frequency scaling, I've looking into how to fix the problem.

I've spent several days working on the BIOS itself, hoping I could make the necessary edits to the binary dump, using AMIBCP, using SPI and a chip-clip. However that effort has so far been fruitless. I've also looked into running a modified DSDT (starting with info on the Arch Wiki) however that also looks unfeasible.

'Back in the day', we used to have 'AMD Powernow' as an alternative to ACPI for frequency scaling on AMD CPU's. Would it be possible to bring that back into play on OpenWRT in 2022 ?

Also, its possible that with some custom kernel parameters I may be able to get the scaling working, but I'm not sufficiently familiar with Linux to do this unassisted.

Any general advice on this topic or suggestions on a way forward would be very much appreciated !

Tips for getting cheap used x86-based firewall with full Gbit NAT (a PC Engines APU) if you are in the US covers the APUs, among other devices.

Bumping for another reply.........

To bring back powernow drivers you would need to recompile the kernel with their symbol enabled, see the cpufreq drivers from Linux upstream https://github.com/torvalds/linux/blob/master/drivers/cpufreq/Kconfig.x86
Assuming those old powernow drivers do cover your hardware still, read the description from the link above and check what generation is that processor.

And then you would put those symbols in this file (the x86 target, and 64bit subrarget kernel config in OpenWrt) https://github.com/openwrt/openwrt/blob/master/target/linux/x86/64/config-5.10
and then recompile an OpenWrt image from source.

In general, it's probably better if you do some testing with a fully-fledged Linux distro first like Arch or Debian (as those will have most of the drivers available without needing a kernel recompile) and then when you have understood what is needed and/or what kernel parameters, you can try to replicate (or ask assistance) for OpenWrt.

1 Like

Thanks for the comprehensive reply. I'd assumed something like might be the case. I've already got Arch installed on this device for testing purposes but of course 'powernow' is long deprecated there also.

I've found some other BIOS failings on this device, so TBH I need to consider whether its worth the effort, since alternative hardware may be cheaper if I put a proper value on my time !

Debian is great for software archeology as they usually provide old releases back to the beginning of time and also have the old releases package repos should still be up.