Closed xiumuyusky closed 4 years ago
As you can see in the code, the FC00
and FC01
variables are external located in SB.PCI0.LPCB.EC
, so while the OS parse this SSDT table, it goes through all DSDT and SSDT tables to find such variables. But there are no declarations about those variables in CLEVO's origin tables, that's why we need to add them.
The EmbeddedControl OperationRegion describes all the information retrieved from the Embedded Controller, where the information about fan speed lays. And you should add the corresponding offsets and lengths for values we want.
In short, first find the Field under the OperationRegion with the type EmbeddedControl in DSDT, then add the variable definitions in it, such as for the example in the readme, the EC Field code is (there should be some declarations already)
OperationRegion (EC81, EmbeddedControl, Zero, 0xFF)
Field (EC81, ByteAcc, Lock, Preserve)
{
...
}
and add this
Offset (0xD0),
FC00, 8,
FC01, 8, // CPU Fan Speed, only CPU fan speed as you only used FAN0 in the SSDT
to make it
OperationRegion (EC81, EmbeddedControl, Zero, 0xFF)
Field (EC81, ByteAcc, Lock, Preserve)
{
...
Offset (0xD0),
FC00, 8,
FC01, 8,
...
}
So now the OS knows there are a byte FC00
variable at offset 0xD0
and a byte FC01
variable at offset 0xD8
, which will be used in the FAN0
method.
As you can see in the code, the
FC00
andFC01
variables are external located inSB.PCI0.LPCB.EC
, so while the OS parse this SSDT table, it goes through all DSDT and SSDT tables to find such variables. But there are no declarations about those variables in CLEVO's origin tables, that's why we need to add them.The EmbeddedControl OperationRegion describes all the information retrieved from the Embedded Controller, where the information about fan speed lays. And you should add the corresponding offsets and lengths for values we want.
In short, first find the Field under the OperationRegion with the type EmbeddedControl in DSDT, then add the variable definitions in it, such as for the example in the readme, the EC Field code is (there should be some declarations already)
OperationRegion (EC81, EmbeddedControl, Zero, 0xFF) Field (EC81, ByteAcc, Lock, Preserve) { ... }
and add this
Offset (0xD0), FC00, 8, FC01, 8, // CPU Fan Speed, only CPU fan speed as you only used FAN0 in the SSDT
to make it
OperationRegion (EC81, EmbeddedControl, Zero, 0xFF) Field (EC81, ByteAcc, Lock, Preserve) { ... Offset (0xD0), FC00, 8, FC01, 8, ... }
So now the OS knows there are a byte
FC00
variable at offset0xD0
and a byteFC01
variable at offset0xD8
, which will be used in theFAN0
method.
First, thx for your reply. I know the meaning you said and i have tried it when i use clover and succeed to get the fan monitor. But now i change to opencore and drop the custom DSDT. So i just want to know how to put these OperationRegion and the SSDT-fan together. I tried but failed when i just add it into SSDT and there was a error. I deleted the ()in these values (ex. _SB.PCI0.LPCB.EC.FC01 ()) and no error was there but made no sense (no value showed in IStat).
Well the OperationRegion can not be redefined, so if you'd like to not use custom DSDT, you may refer to Rehabman's patch guide about battery, they both modifies the EC Field so it's completely same.
P.S. In my view, it's not necessary to use complex patches and SSDTs instead of custom DSDT. OpenCore replaces DSDT table as long as you have DSDT aml file provided, so DSDT patches are only more convenient on BIOS settings changes/updates, but as DSDT patches itself relies on the disassemble results, it's always best to re-disassemble when DSDT changes.
Yean I know, thx for your sharing
I followed your steps and made my SSDT like this, now need some help during the last step. Hope for your advice, thx. DefinitionBlock ("", "SSDT", 2, "hack", "_SMCD", 0x00000000) { External (SB.PCI0.LPCB.EC.ECOK, MethodObj) // 0 Arguments External (SB.PCI0.LPCB.EC.FC00, MethodObj) // 0 Arguments External (SB.PCI0.LPCB.EC__.FC01, MethodObj) // 0 Arguments External (SB.WMI_.WMBB, MethodObj) // 3 Arguments
}