Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable/Disable IME by CMOS option #76

Closed
wants to merge 3 commits into from
Closed

Conversation

crawfxrd
Copy link
Member

@crawfxrd crawfxrd commented Sep 10, 2021

Replace the Kconfig option to disable IME with a CMOS option.

  • KBL boards use me_cleaner, so don't set the option at all
  • TGL boards default to enabled
  • Other boards default to disabled

Value can be changed with nvramtool:

sudo nvramtool -w ime_state={Enable,Disable}

Changing state requires a global reset, so the next boot after enabling/disabling will power off the machine.


Tested on oryp6 with the following change, to always dump the ME state:

diff --git a/src/soc/intel/cannonlake/me.c b/src/soc/intel/cannonlake/me.c
index 7bbe1ae730..6b831dc11e 100644
--- a/src/soc/intel/cannonlake/me.c
+++ b/src/soc/intel/cannonlake/me.c
@@ -103,8 +103,8 @@ void dump_me_status(void *unused)
        union me_hfsts5 hfsts5;
        union me_hfsts6 hfsts6;
 
-       if (!is_cse_enabled())
-               return;
+       //if (!is_cse_enabled())
+       //      return;
 
        hfsts1.data = me_read_config32(PCI_ME_HFSTS1);
        hfsts2.data = me_read_config32(PCI_ME_HFSTS2);

Then checked cbmem console (cbmem -c) to see the current working state and current operating mode.


Concerns: This might break on TGL because the CMOS bit is currently 0 (Disable). At the least, this would mean no C10 residency on TGL-U. And since we haven't figured out the issue on gaze16, poweroff/suspend will break.


Resolves: system76/firmware-open#219
Resolves: system76/firmware-open#197

Upstream: CB:57541

@crawfxrd crawfxrd marked this pull request as ready for review September 10, 2021 19:34
@crawfxrd crawfxrd requested review from jackpot51 and a team September 10, 2021 19:34
@jacobgkau
Copy link
Member

Concerns: This might break on TGL because the CMOS bit is currently 0 (Disable). At the least, this would mean no C10 residency on TGL-U. And since we haven't figured out the issue on gaze16, poweroff/suspend will break.

This does seem to prevent galp5 from suspending, if that's what a lack of C10 residency looks like. The power LED never blinks.

Add function to have CSME firmware enter Soft Temporary Disable mode,
and a corresponding function to put it back into Normal mode. A global
reset is required for the CSME to change modes.

Reference:
- Intel doc #612229 (CSME 15.0 BIOS Specification)

Change-Id: I1a5021b21dde407d4d813a0b1fff10e74ab356ed
Signed-off-by: Tim Crawford <tcrawford@system76.com>
@crawfxrd
Copy link
Member Author

The power LED never blinks.

Yes, CPU_C10_GATE# doesn't assert when the IME kernel is disabled, so the LED won't blink.

This should output 0:

cat /sys/devices/system/cpu/cpuidle/low_power_idle_cpu_residency_us

And then you should be able to see which states it's reaching with this:

sudo cat /sys/kernel/debug/pmc_core/package_cstate_show

@crawfxrd
Copy link
Member Author

Could probably just use an inverted enum (0=Enabled, 1=Disabled) for TGL to preserve the behavior.

Change-Id: Id1c04b23470221630c0faafb21f956f7365c677e
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Change-Id: I17e48d415dd0cd566caf0d53fd46550a89e1ed86
Signed-off-by: Tim Crawford <tcrawford@system76.com>
@crawfxrd crawfxrd marked this pull request as draft September 13, 2021 18:43
@crawfxrd
Copy link
Member Author

I'll try to get some feedback from upstream before making an incompatible change downstream.

@crawfxrd crawfxrd mentioned this pull request Sep 17, 2021
28 tasks
@crawfxrd crawfxrd closed this Oct 28, 2021
@crawfxrd crawfxrd deleted the cmos-disable-ime branch October 28, 2021 02:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants