Skip to content

Commit

Permalink
mb/system76/meer9: Add power_on_after_fail
Browse files Browse the repository at this point in the history
Configure SuperIO for BIOS control of power loss behavior and add CMOS
option to allow user control.

Enum 1 is used instead of 7 as the `Keep` option does not seem to work
on meer9. The same setting via SIO control (CRE4) does work, though.

Change-Id: I9a215f5b0ab131a93afc1d8e41f608a263284ad0
Signed-off-by: Tim Crawford <[email protected]>
  • Loading branch information
crawfxrd committed Feb 4, 2025
1 parent 01d1204 commit 01f4c5b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/mainboard/system76/meer9/bootblock.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ static void superio_init(void)
// GPIO 87 set high
pnp_write_config(dev, 0xF1, 0x80); // Default is 0xFF

printk(BIOS_DEBUG, "configure ACPI (logical device A)\n");
dev = PNP_DEV(0x2E, 0x0A);
pnp_set_logical_device(dev);
// User-defined resume state after power loss
pnp_write_config(dev, 0xE4, 0x60); // Default is 0x00

printk(BIOS_DEBUG, "configure hardware monitor (logical device B)\n");
dev = PNP_DEV(0x2E, 0x0B);
pnp_set_logical_device(dev);
Expand Down
1 change: 1 addition & 0 deletions src/mainboard/system76/meer9/cmos.default
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
boot_option=Fallback
debug_level=Debug
me_state=Enable
power_on_after_fail=Disable
9 changes: 9 additions & 0 deletions src/mainboard/system76/meer9/cmos.layout
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ entries
# RTC_CLK_ALTCENTURY
400 8 r 0 century

# TODO: Use enum 7 to allow `Keep`
409 2 e 1 power_on_after_fail
412 4 e 6 debug_level
416 1 e 2 me_state
417 3 h 0 me_state_counter
Expand All @@ -22,6 +24,9 @@ entries

enumerations

1 0 Disable
1 1 Enable

2 0 Enable
2 1 Disable

Expand All @@ -38,6 +43,10 @@ enumerations
6 7 Debug
6 8 Spew

7 0 Disable
7 1 Enable
7 2 Keep

checksums

checksum 408 799 984

0 comments on commit 01f4c5b

Please sign in to comment.