Fix arm64 32bit pcc for cpu-freq scaling
This PR is to fix cpu frequency scaling in some arm64 platform
1): the current acpi_pcc.c do not handle for **reg->BitWidth = 32** case,therefore some arm64 platform failed with Data aligment abort when init cppc
2): the current acpi_pcc.c mis-use mask when write new cpu freq into pcc channel
```c
static ACPI_STATUS
pcc_send_command(struct pcc_subspace *ss, ACPI_GENERIC_ADDRESS *reg,
uint32_t command, int flags, ACPI_INTEGER val)
{
...
if ((flags & PCC_WRITE) != 0) {
mask = __BITS(reg->BitOffset + reg->BitWidth - 1,
reg->BitOffset);
ACPI_MOVE_64_TO_64(&tmp, data + reg->Address);
tmp &= mask; // shall be 'tmp &= ~mask;' here
tmp |= __SHIFTIN(val, mask);
ACPI_MOVE_64_TO_64(data + reg->Address, &tmp);
}
}
```
- I verify the code in my ARM64 pc with ubench before and after cpu-freq scale
- My build is
```
./build.sh -U -u -j12 -O /usr/obj.aarch64 -m evbarm -a aarch64 release
```
- My test platform is
```
arm64# uname -a
NetBSD arm64 10.1_STABLE NetBSD 10.1_STABLE (GENERIC64) #14: Tue Jul 8 06:26:17 CST 2025
```
- cpu-freq scale

- scale freq to 2500MHz

- scale freq to 625MHz

合并状态:未合并 0 条评论