Skip to content

Commit 5403d8a

Browse files
committed
base: ship both ACPI tables (P-states + C-states)
Testing with SSDT-PST alone showed cpuidle come up empty, so SSDT-CST does supply the C-states and belongs in the package. The 'Could not resolve symbol \_PR.C000' messages are not caused by it — they still appear with the table removed, so they come from the board's own firmware.
1 parent 3c1e88f commit 5403d8a

4 files changed

Lines changed: 132 additions & 6 deletions

File tree

scripts/build-debs-ci.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ put $P 0644 system/etc/skel/.config/conky/skillfish.conf etc/skel/.
9898
put $P 0755 system/usr/local/bin/skillfish-acpi-pstates usr/local/bin/skillfish-acpi-pstates
9999
put $P 0644 system/usr/share/skillfish/acpi/SSDT-PST.aml usr/share/skillfish/acpi/SSDT-PST.aml
100100
put $P 0644 system/usr/share/skillfish/acpi/SSDT-PST.dsl usr/share/skillfish/acpi/SSDT-PST.dsl
101+
put $P 0644 system/usr/share/skillfish/acpi/SSDT-CST.aml usr/share/skillfish/acpi/SSDT-CST.aml
102+
put $P 0644 system/usr/share/skillfish/acpi/SSDT-CST.dsl usr/share/skillfish/acpi/SSDT-CST.dsl
101103
ctrl $P "systemd, libnotify-bin, python3, cpio" "SkillFishOS base - hardware watchdog + freeze detector + 8-core unlock"
102104
# base needs its own postinst: enable the watchdog and the freeze check.
103105
# NOTE: core-unlock is only *enabled* (never --now): it warm-reboots the machine when

system/usr/local/bin/skillfish-acpi-pstates

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,18 @@
1111
# the board still peaks at ~3500 with the table loaded). What it buys is idle: the
1212
# cores drop to 800 MHz instead of sitting near 1400, which frees thermal budget.
1313
#
14-
# Table from mendesrr/bc250-acpi-fix-updated-8c (covers P000..P00F = 16 threads).
15-
# Only SSDT-PST is installed: the companion SSDT-CST targets \_PR.C000..C009, which
16-
# do not exist in this DSDT, so it only produced ACPI BIOS errors while the kernel's
17-
# own C-states worked anyway.
14+
# Tables from mendesrr/bc250-acpi-fix-updated-8c (they cover P000..P00F = 16 threads).
15+
# Both are installed: SSDT-PST gives the P-states, SSDT-CST the idle C-states — tested
16+
# without CST and cpuidle came up empty, so it does real work here. The
17+
# "Could not resolve symbol \_PR.C000" messages in dmesg are NOT from these tables:
18+
# they still appear with CST removed, so they come from the board's own firmware.
1819
#
1920
# skillfish-acpi-pstates enable (default)
2021
# skillfish-acpi-pstates disable
2122
# skillfish-acpi-pstates status
2223
set -e
23-
AML=/usr/share/skillfish/acpi/SSDT-PST.aml
24+
AMLDIR=/usr/share/skillfish/acpi
25+
AML="$AMLDIR/SSDT-PST.aml"
2426
CPIO=/boot/SkillFishOS-acpi.cpio
2527
GRUBDEF=/etc/default/grub
2628
ACTION="${1:-enable}"
@@ -53,7 +55,7 @@ case "$ACTION" in
5355
# the kernel looks for the tables at this exact path inside the early cpio
5456
tmp=$(mktemp -d)
5557
mkdir -p "$tmp/kernel/firmware/acpi"
56-
cp "$AML" "$tmp/kernel/firmware/acpi/"
58+
cp "$AMLDIR"/SSDT-*.aml "$tmp/kernel/firmware/acpi/"
5759
(cd "$tmp" && find kernel | cpio -H newc --create --quiet) > "$CPIO"
5860
rm -rf "$tmp"
5961
sed -i '/^GRUB_EARLY_INITRD_LINUX_CUSTOM=/d' "$GRUBDEF"
990 Bytes
Binary file not shown.
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
// SSDT-P-CST-ALIAS-3S.dsl
2+
DefinitionBlock ("", "SSDT", 2, "HACK", "P_CST3", 0x00000001)
3+
{
4+
// Firmware objects we’re augmenting
5+
External (\_PR, DeviceObj)
6+
External (\_PR.P000, ProcessorObj)
7+
External (\_PR.P001, ProcessorObj)
8+
External (\_PR.P002, ProcessorObj)
9+
External (\_PR.P003, ProcessorObj)
10+
External (\_PR.P004, ProcessorObj)
11+
External (\_PR.P005, ProcessorObj)
12+
External (\_PR.P006, ProcessorObj)
13+
External (\_PR.P007, ProcessorObj)
14+
External (\_PR.P008, ProcessorObj)
15+
External (\_PR.P009, ProcessorObj)
16+
External (\_PR.P00A, ProcessorObj)
17+
External (\_PR.P00B, ProcessorObj)
18+
External (\_PR.P00C, ProcessorObj)
19+
External (\_PR.P00D, ProcessorObj)
20+
External (\_PR.P00E, ProcessorObj)
21+
External (\_PR.P00F, ProcessorObj)
22+
23+
// 3-state C-state package mirroring your Zen2 laptop values
24+
Method (PCST, 0, NotSerialized)
25+
{
26+
Return (Package ()
27+
{
28+
0x03, // number of C-states
29+
30+
// C1: FFixedHW, BitWidth=0x02, BitOffset=0x02, Lat=0x0001, Power=0
31+
Package ()
32+
{
33+
ResourceTemplate ()
34+
{
35+
Register (FFixedHW,
36+
0x02, // Bit Width
37+
0x02, // Bit Offset
38+
0x0000000000000000, // Address
39+
/* AccessSize omitted for FFixedHW */
40+
)
41+
},
42+
0x01, // C1 type
43+
0x0001, // Latency (us)
44+
0x00000000 // Power (mW)
45+
},
46+
47+
// C2: SystemIO @0x414, AccessSize=1, Lat=0x015E, Power=0
48+
Package ()
49+
{
50+
ResourceTemplate ()
51+
{
52+
Register (SystemIO,
53+
0x08, // Bit Width
54+
0x00, // Bit Offset
55+
0x0000000000000414, // Address
56+
0x01 // Access Size
57+
)
58+
},
59+
0x02, // C2 type
60+
0x015E, // Latency (us)
61+
0x00000000 // Power (mW)
62+
},
63+
64+
// C3: SystemIO @0x415, AccessSize=1, Lat=0x0190, Power=0
65+
Package ()
66+
{
67+
ResourceTemplate ()
68+
{
69+
Register (SystemIO,
70+
0x08, // Bit Width
71+
0x00, // Bit Offset
72+
0x0000000000000415, // Address
73+
0x01 // Access Size
74+
)
75+
},
76+
0x03, // C3 type
77+
0x0190, // Latency (us)
78+
0x00000000 // Power (mW)
79+
}
80+
})
81+
}
82+
83+
// Add _CST to each vendor processor
84+
Scope (\_PR.P000) { Method (_CST, 0, NotSerialized) { Return (PCST()) } }
85+
Scope (\_PR.P001) { Method (_CST, 0, NotSerialized) { Return (PCST()) } }
86+
Scope (\_PR.P002) { Method (_CST, 0, NotSerialized) { Return (PCST()) } }
87+
Scope (\_PR.P003) { Method (_CST, 0, NotSerialized) { Return (PCST()) } }
88+
Scope (\_PR.P004) { Method (_CST, 0, NotSerialized) { Return (PCST()) } }
89+
Scope (\_PR.P005) { Method (_CST, 0, NotSerialized) { Return (PCST()) } }
90+
Scope (\_PR.P006) { Method (_CST, 0, NotSerialized) { Return (PCST()) } }
91+
Scope (\_PR.P007) { Method (_CST, 0, NotSerialized) { Return (PCST()) } }
92+
Scope (\_PR.P008) { Method (_CST, 0, NotSerialized) { Return (PCST()) } }
93+
Scope (\_PR.P009) { Method (_CST, 0, NotSerialized) { Return (PCST()) } }
94+
Scope (\_PR.P00A) { Method (_CST, 0, NotSerialized) { Return (PCST()) } }
95+
Scope (\_PR.P00B) { Method (_CST, 0, NotSerialized) { Return (PCST()) } }
96+
Scope (\_PR.P00C) { Method (_CST, 0, NotSerialized) { Return (PCST()) } }
97+
Scope (\_PR.P00D) { Method (_CST, 0, NotSerialized) { Return (PCST()) } }
98+
Scope (\_PR.P00E) { Method (_CST, 0, NotSerialized) { Return (PCST()) } }
99+
Scope (\_PR.P00F) { Method (_CST, 0, NotSerialized) { Return (PCST()) } }
100+
101+
// Keep the C000..C00F aliases so other AML resolves cleanly
102+
Scope (\_PR)
103+
{
104+
Alias (\_PR.P000, C000)
105+
Alias (\_PR.P001, C001)
106+
Alias (\_PR.P002, C002)
107+
Alias (\_PR.P003, C003)
108+
Alias (\_PR.P004, C004)
109+
Alias (\_PR.P005, C005)
110+
Alias (\_PR.P006, C006)
111+
Alias (\_PR.P007, C007)
112+
Alias (\_PR.P008, C008)
113+
Alias (\_PR.P009, C009)
114+
Alias (\_PR.P00A, C00A)
115+
Alias (\_PR.P00B, C00B)
116+
Alias (\_PR.P00C, C00C)
117+
Alias (\_PR.P00D, C00D)
118+
Alias (\_PR.P00E, C00E)
119+
Alias (\_PR.P00F, C00F)
120+
}
121+
}
122+

0 commit comments

Comments
 (0)