Contribute
Register

Lenovo B570e (Last remaining fixes)

Status
Not open for further replies.
Both disabled by default due to potential issue with ECDT.
Appropriate changes made to the USB power injection guide.



A bit of nonsense.
Not likely to have both EC0 and H_EC as active EC objects (I have never seen a computer with dual-EC).
And if you did (sometimes one or the other is disabled with _STA=0), renaming them both to EC would cause panic if they are in the same scope.
DSDT does have EC0 which i renamed to EC for USB power Injection.
while analyzing other SSDT's i saw that SSDT-0 has H_EC which then i enabled that patch too. so i wonder if it is ok ?
i attached the ACPi Tables to check them.
 

Attachments

  • DSDT.aml
    39 KB · Views: 142
  • SSDT-0.aml
    5.6 KB · Views: 150
  • SSDT-1.aml
    2.5 KB · Views: 152
  • SSDT-2.aml
    677 bytes · Views: 154
DSDT does have EC0 which i renamed to EC for USB power Injection.
while analyzing other SSDT's i saw that SSDT-0 has H_EC which then i enabled that patch too. so i wonder if it is ok ?
i attached the ACPi Tables to check them.

The H_EC references in the SSDTs are a different thing. I think under Windows and probably Linux, it provides an H_EC [Host EC] device automatically, that these SSDTs are calling into. Either way (EC or H_EC) the code in SSDT-0 is not going to work, because you will find H_EC is defined nowhere, therefore not existing when running macOS/OS X.

As per USB power injection guide, you should check your ACPI/origin for ECDT.aml. If you have one, you can't rename EC0->EC and instead should use the Fake EC SSDT.
 
Last edited:
The H_EC references in the SSDTs are a different thing. I think under Windows and probably Linux, it provides an H_EC [Host EC] device automatically, that these SSDTs are calling into. Either way (EC or H_EC) the code in SSDT-0 is not going to work, because you will find H_EC is defined nowhere, therefore not existing when running macOS/OS X.

As per USB power injection guide, you should check your ACPI/origin for ECDT.aml. If you have one, you can't rename EC0->EC and instead should use the Fake EC SSDT.
I don't see ECDT.aml on my Origin folder (none of my laptops have that) so I assume I'm good as it is.
USB ports are working fine too so I don't see any issues related to that.

So what you are saying is that I don't need the H_EC rename at all ?

Also while looking at your laptop repos I did see some renames/patches for ACPIsensors.kext on the SSDT-HACK(s).dsl
Why are they for ?

Another question too, what should be the correct key for cmd (command) key on Mac
ALT key or Windows Logo Key ?

On both laptops ALT key is the cmd key while on external keyboard the Windows Logo works as the cmd key, which should be the correct one ?
 
So what you are saying is that I don't need the H_EC rename at all ?

Correct.
You stated your active EC was EC0 and that you're renaming EC0->EC.
So... you're done, no need to mess with H_EC.

Also while looking at your laptop repos I did see some renames/patches for ACPIsensors.kext on the SSDT-HACK(s).dsl
Why are they for ?

You will need to be specific about what you're referring to.

Another question too, what should be the correct key for cmd (command) key on Mac
ALT key or Windows Logo Key ?

In my mind, it is the Alt key.
Look at a real Mac keyboard and you'll see the physical layout correponds.

On both laptops ALT key is the cmd key while on external keyboard the Windows Logo works as the cmd key, which should be the correct one ?

You can change it on the external in SysPrefs->Keyboard->Modifier Keys.
 
Correct.
You stated your active EC was EC0 and that you're renaming EC0->EC.
So... you're done, no need to mess with H_EC.
Ok will remove it.
You will need to be specific about what you're referring to
Im refering to this as example your u430:
Code:
//
// ACPISensors configuration (ACPISensors.kext is not installed by default)
//

    Device (SMCD)
    {
        Name (_HID, "FAN00000") // _HID: Hardware ID
        // ACPISensors.kext configuration
        //    Name (TACH, Package()
        //    {
        //        "System Fan", "FAN0",
        //    })
        Name (TEMP, Package()
        {
            "CPU Heatsink", "TCPU",
            //"Ambient", "TAMB",
            //"Mainboard", "TSYS",
            //"CPU Proximity", "TCPP",
        })
        //Name (KLVN, 1)
        // Actual methods to implement fan/temp readings/control
        //    Method (FAN0, 0, Serialized)
        //    {
        //    }
        Method (TCPU, 0, Serialized)
        {
            //Return (\_TZ.TZ00._TMP())
            //Return(Divide(Subtract(\_TZ.TZ00._TMP(), 2732), 10))
            If (\_SB.PCI0.LPCB.EC.ECOK) { Local0 = \_SB.PCI0.LPCB.EC.RTMP }
            Else { Local0 = 0x1a }
            Return(Local0)
        }
        //Method (TAMB, 0, Serialized) // Ambient Temp
        //{
        //}
    }

//
i assume that with this code you add identifiers to the kext so for example the kext can read/find your temp sensor,heat sink,etc.
is that correct ?
you did also add TCPU method, that's what i don't understand and that Ambient Temp.
So is there any documentation of the kext on how to add these Identifiers so i can read ACPI Spec and add the names from my ACPI to detect correct temperatures etc.
In my mind, it is the Alt key.
Look at a real Mac keyboard and you'll see the physical layout correponds.
So on laptop its correct : CMD is the Alt key
You can change it on the external in SysPrefs->Keyboard->Modifier Keys.
Thank you, Yes that's what i exactly needed, it hurts to adjust to that (Win instead of Alt for cmd) change when im sitting on my table with external Display and mice + keyboard connected. (Desktop mode on laptop).
 
Im refering to this as example your u430:
Code:
//
// ACPISensors configuration (ACPISensors.kext is not installed by default)
//

    Device (SMCD)
    {
        Name (_HID, "FAN00000") // _HID: Hardware ID
        // ACPISensors.kext configuration
        //    Name (TACH, Package()
        //    {
        //        "System Fan", "FAN0",
        //    })
        Name (TEMP, Package()
        {
            "CPU Heatsink", "TCPU",
            //"Ambient", "TAMB",
            //"Mainboard", "TSYS",
            //"CPU Proximity", "TCPP",
        })
        //Name (KLVN, 1)
        // Actual methods to implement fan/temp readings/control
        //    Method (FAN0, 0, Serialized)
        //    {
        //    }
        Method (TCPU, 0, Serialized)
        {
            //Return (\_TZ.TZ00._TMP())
            //Return(Divide(Subtract(\_TZ.TZ00._TMP(), 2732), 10))
            If (\_SB.PCI0.LPCB.EC.ECOK) { Local0 = \_SB.PCI0.LPCB.EC.RTMP }
            Else { Local0 = 0x1a }
            Return(Local0)
        }
        //Method (TAMB, 0, Serialized) // Ambient Temp
        //{
        //}
    }

//

That code adds a sensor and code for the CPU heatsink for interface with ACPISensors.kext and reporting of the heat sink temp via HWMonitor.app.

you did also add TCPU method, that's what i don't understand and that Ambient Temp.

TCPU is the code that fetches the temperature data for "CPU Heatsink".
The others are unimplemented, therefore commented out.

So is there any documentation of the kext on how to add these Identifiers so i can read ACPI Spec and add the names from my ACPI to detect correct temperatures etc.

Read ACPISensors.kext source code.
Or build on examples.
 
That code adds a sensor and code for the CPU heatsink for interface with ACPISensors.kext and reporting of the heat sink temp via HWMonitor.app.



TCPU is the code that fetches the temperature data for "CPU Heatsink".
The others are unimplemented, therefore commented out.



Read ACPISensors.kext source code.
Or build on examples.
OK thnx for the clarifications,

While browsing your SSDT-HACK.dsl i also noticed other interesting things that i forgot that they are possible:
  1. My laptops does Generate ACPI - EC queries on FN Buttons(which i used to determine brightness keys) previously from the guide.
My question is: what is the code for PrintScreen & (is it possible to map the windows print screen to work as mac print screen)
What is the code for Mirrorring/Video
not sure if i have seen those on the backlight control guide.
Any reference where i can look at for these ?

Also i saw the you have other things like standard buttons & FN + Shortcut Buttons would like to know what was the implementation from them.
In my case i have FN Lock always active so whenever i press Fxx keys the FN shortcut is always on without having to press FN since i use them more than the Standard F1-12 keys, i actually am not sure what are the exact shortcut for F1-F12 on Mac since i got used to the Windows ones i never got interested to look at them on the macOS side but anyway, my question from this :
Should also the F1 - F12 be re-mapped (same as FN shortcuts ) in order to work for hackintoshes ?

2. i also see you add pin configurations into SSDT for CodecCommander or into config.plist in some cases.
What are the benefits of it instead of audio injector.kext or Patched AppleHDA, is still required to install a DummyHDA (audio Injector) ?
Also whatever the case how can i dump the PinConfigurations and add them into SSDT/Config.plist.
 
My question is: what is the code for PrintScreen & (is it possible to map the windows print screen to work as mac print screen)

Yes. I do it in the u430 repo.

What is the code for Mirrorring/Video

Refer to the u430 repo. It is implemented there (and the Probook).

Also i saw the you have other things like standard buttons & FN + Shortcut Buttons would like to know what was the implementation from them.

What specifically are you referring to?

2. i also see you add pin configurations into SSDT for CodecCommander or into config.plist in some cases.
What are the benefits of it instead of audio injector.kext or Patched AppleHDA, is still required to install a DummyHDA (audio Injector) ?

I decided to use CodecCommander for the pin configs, as it is easier to read the pin configs and experiment with them with them specified as a 32-bit value instead of 4 separate verbs, each 8-bit.

Also whatever the case how can i dump the PinConfigurations and add them into SSDT/Config.plist.

I use gen_ahhcd.sh from the CodecCommander repo to generate the SSDT from pinconfig data extracted from patched AppleHDA or AppleHDA injectors (via extract_hda.sh)
 
Refer to the u430 repo. It is implemented there (and the Probook).
Looking at this part of the code:
Code:
               "Custom ADB Map", Package()
                {
                    Package(){},
                    "e063=3f", // Apple Fn
                    "e064=6b", // F14
                    "e065=71", // F15
                    "e068=4f", // F18
                    "e0f2=65", // special F9
                    "e0fb=6b", // brightness down (was =91)
                    "e0fc=71", // brightness up (was =90)
                    "e06a=70", // video mirror
                },
                "Custom PS2 Map", Package()
                {
                    Package(){},
                    "e037=64", // PrtSc=F13
                },
i did take notes of all my FN Buttons what EC Code they generate but for their assignment i took reference from LudacrisVP T440S Guide "which was at Yosemite times" and 90% of them were similar to mine, just corrected the EC Queries generated on mine so for Mirror/Video this is the code it was when i copied it from him:
[code]
        Method (_Q19, 0, NotSerialized)  // Projector / Mirror mode
        {
            Notify (KBD, 0x046E)
            Notify (KBD, 0x04EE)
        }
so my question what should be the code : "e06a=70", // video mirror be on Notify (KBD, 0x046E)(KBD,0x04EE) instead ?
Is there any sort of converting needed to be done ?
And what was the actual function of the KBD,0x046E) since it never had any effect when i pressed it.
What specifically are you referring to?
Im refering to this:
Code:
               "Function Keys Special", Package()
                {
                    Package(){},
                    // The following 12 items map Fn+fkeys to Fn+fkeys
                    "e020=e020",
                    "e02e=e02e",
                    "e030=e030",
                    "e064=e064",
                    "e065=e065",
                    "e066=e028",
                    "e067=e067",
                    "e068=e068",
                    "e069=e0f0",
                    "e06a=e06a",
                    "e06b=e0fb",
                    "e06c=e0fc",
                    // The following 12 items map fkeys to fkeys
                    "3b=3b",
                    "3c=3c",
                    "3d=3d",
                    "3e=3e",
                    "3f=3f",
                    "40=40",
                    "41=41",
                    "42=42",
                    "43=43",
                    "44=44",
                    "57=57",
                    "58=58",
                },
                "Function Keys Standard", Package()
                {
                    Package(){},
                    // The following 12 items map Fn+fkeys to fkeys
                    "e020=3b",
                    "e02e=3c",
                    "e030=3d",
                    "e064=3e",
                    "e065=3f",
                    "e066=40",
                    "e067=41",
                    "e068=42",
                    "e069=e0f2",
                    "e06a=44",
                    "e06b=57",
                    "e06c=58",
                    // The following 12 items map fkeys to Fn+fkeys
                    "3b=e020",
                    "3c=e02e",
                    "3d=e030",
                    "3e=e064",
                    "3f=e065",
                    "40=e028",
                    "41=e067",
                    "42=e068",
                    "43=e0f1",
                    "44=e06a",
                    "57=e0fb",
                    "58=e0fc",
                },
            },
        })

        External(\_SB.PCI0.LPCB.EC.XQ94, MethodObj)

        // RKAB/RKAC called for PS2 code e0fb/e0fc (brightness is mapped to it)
        Method(RKAB, 1)
        {
            // if screen is turned off, turn it on...
            If (LNot(\_SB.PCI0.LPCB.EC.BLIS))
            {
                Store (1, \_SB.PCI0.LPCB.EC.BLIS)
                \_SB.PCI0.LPCB.EC.XQ94()
                \_SB.PCI0.LPCB.EC._Q41()
            }
        }
        Method(RKAC, 1) { RKAB(Arg0) }
        // RKA0 called for PS2 code e0f0 (mapped from normal Fn+F9)
        // RKA1 called for PS2 code e0f1 (mapped from F9, with keys swapped)
        // RKA2 called for PS2 code e0f2 (mapped from Fn+F9, with keys swapped)
        Method (RKA0, 1)
        {
            If (Arg0)
            {
                // normal action for Fn+F9 (without keys swapped, toggle screen)
                \_SB.PCI0.LPCB.EC.XQ94()
                \_SB.PCI0.LPCB.EC._Q41()
            }
        }
        Method(RKA1, 1)
        {
            If (Arg0)
            {
                // F9 with keys swapped, do what EC would do (toggle screen)
                Store(LNot(\_SB.PCI0.LPCB.EC.BLIS), \_SB.PCI0.LPCB.EC.BLIS)
                RKA0(Arg0)
            }
        }
        Method(RKA2, 1)
        {
            If (Arg0)
            {
                // Fn+F9 with keys swapped, undo what EC would do (avoid toggling screen)
                Store(LNot(\_SB.PCI0.LPCB.EC.BLIS), \_SB.PCI0.LPCB.EC.BLIS)
            }
        }
    }
I decided to use CodecCommander for the pin configs, as it is easier to read the pin configs and experiment with them with them specified as a 32-bit value instead of 4 separate verbs, each 8-bit.
Seems to be a much better implementation & less time consuming on every way i look at it.
I use gen_ahhcd.sh from the CodecCommander repo to generate the SSDT from pinconfig data extracted from patched AppleHDA or AppleHDA injectors (via extract_hda.sh)
Will take a look at it and try to implement on my L440 - into SSDT & (since B570e has no issues without CodecCommander) i guess i can put PinConfigs into the Device/Properties.

I definetly found new things to work with on my laptops till weekend (even though i planned to update my L440 Guide) and create a new L440 Guide on High Sierra Section, i guess ill have to skip it for next weekend (unless i manage to workout all of these new things) before weekend.
 
so my question what should be the code : "e06a=70", // video mirror be on Notify (KBD, 0x046E)(KBD,0x04EE) instead ?

The specific PS2 to ADB map you need depends on what your EC queries are doing with regard to notify.
They just have to match.


Is there any sort of converting needed to be done ?
And what was the actual function of the KBD,0x046E) since it never had any effect when i pressed it.

If you're referring to notifies on the keyboard object from ACPI, that allows you to send (PS2) keystrokes from ACPI.

Im refering to this:
Code:
               "Function Keys Special", Package()
                {
                    Package(){},
                    // The following 12 items map Fn+fkeys to Fn+fkeys
                    "e020=e020",
                    "e02e=e02e",
                    "e030=e030",
                    "e064=e064",
                    "e065=e065",
                    "e066=e028",
                    "e067=e067",
                    "e068=e068",
                    "e069=e0f0",
                    "e06a=e06a",
                    "e06b=e0fb",
                    "e06c=e0fc",
                    // The following 12 items map fkeys to fkeys
                    "3b=3b",
                    "3c=3c",
                    "3d=3d",
                    "3e=3e",
                    "3f=3f",
                    "40=40",
                    "41=41",
                    "42=42",
                    "43=43",
                    "44=44",
                    "57=57",
                    "58=58",
                },
                "Function Keys Standard", Package()
                {
                    Package(){},
                    // The following 12 items map Fn+fkeys to fkeys
                    "e020=3b",
                    "e02e=3c",
                    "e030=3d",
                    "e064=3e",
                    "e065=3f",
                    "e066=40",
                    "e067=41",
                    "e068=42",
                    "e069=e0f2",
                    "e06a=44",
                    "e06b=57",
                    "e06c=58",
                    // The following 12 items map fkeys to Fn+fkeys
                    "3b=e020",
                    "3c=e02e",
                    "3d=e030",
                    "3e=e064",
                    "3f=e065",
                    "40=e028",
                    "41=e067",
                    "42=e068",
                    "43=e0f1",
                    "44=e06a",
                    "57=e0fb",
                    "58=e0fc",
                },
            },
        })

If "Function Keys Special/Standard" are specified, it used to enable an option for switching in SysPrefs->Keyboard.
But now that has been removed.

Seems to be a much better implementation & less time consuming on every way i look at it.

At the time I added the feature to CodecCommander, I was doing quite a bit of experimentation with the u430 pinconfigs.
I found it very tedious, time consuming, and error-prone to change pinconfigs with the PinConfigDefault verbs.
So, I added support in CodecCommander to set the pinconfigs there.
It is easier to read and modify, but is a bit experimental.

Will take a look at it and try to implement on my L440 - into SSDT & (since B570e has no issues without CodecCommander) i guess i can put PinConfigs into the Device/Properties.

I found PinConfigs in Device/Properties (or any other method of injecting) does not work.
You have to actual set the pinconfigs in the HDA chip.
 
Status
Not open for further replies.
Back
Top