Jump to content

Lenovo ThinkPad T420 with UEFI Only


K0gen
 Share

5,282 posts in this topic

Recommended Posts

@ag6952563 - this is how i converted over 

 

EmuVariableUefi-64.efi migration to native NVRAM

1) Before updating if you are still using EmuVariable.efi, run this command see and then save current nvram values:
nvram -p
nvram -xp > ~/nvram.plist
2) Update the ESP with new Clover version (from zip or pkg) - uncheck EmuVariableUEFI-64 driver option.
3) Rename (or remove) EmuVariable driver the ESP so it will not be loaded on next boot, if there is one still in the Clover driver kexts directory. 
Note: manually mount ESP on /Volumes/EFI or /Volumes/ESP, if not already mounted and then run:
mv /Volumes/ESP/EFI/CLOVER/drivers64UEFI/EmuVariableUEFI-64.efi /Volumes/ESP/EFI/CLOVER/drivers64UEFI/EmuVariableUEFI-64.efi.NU
4) Reboot and restore previous nvram values and remove Clover NVRam variable. You should see some variables already in there.
nvram -p
sudo nvram -xf ~/nvram.plist
sudo nvram -d Clover.NVRamDisk
5) Reboot
 

  • Like 4
Link to comment
Share on other sites

I update it but It display error : winflash flash bios is not an upgrade (same or older version number)

I've managed to make a typo in the flash_custom.bat .. it should be '/sa' not '/ca', as in .. skip all (checks). Should be same command set as in the Readme.

  • Like 2
Link to comment
Share on other sites

Hi folks, quick question.

On T420, does the screen come alive normally when you had the laptop sleeping with a LID closed and you open the LID, having no external displays connected? Here the laptop resumes from sleep when opening the LID, but the screen stays dark until you hit something on the keyboard or touchpad/trackpoint (HID tickle). Just curious if I need to hunt this down it being a common issue or this has been addressed for T420 ?

Link to comment
Share on other sites

I've followed your guide and everything works great, but I have one small issue.

 

When I "Shut Down" OS X while I'm logged in (from the Apple logo menu), instead of shutting down, it reboots.

 

Shutting down from the login screen works fine. Logging off and shutting down from the login screen also works fine. "shutdown -h now" while logged in results in a reboot.

 

It worked fine for a while, until I restored Carbon Copy Cloner backup to move to upgrade from an HDD to an SSD.

 

I've restored your configuration files to my EFI partition, but it keeps happening. Other ACPI stuff like sleep works fine.

 

What could be causing this issue?


Hi folks, quick question.

On T420, does the screen come alive normally when you had the laptop sleeping with a LID closed and you open the LID, having no external displays connected? Here the laptop resumes from sleep when opening the LID, but the screen stays dark until you hit something on the keyboard or touchpad/trackpoint (HID tickle). Just curious if I need to hunt this down it being a common issue or this has been addressed for T420 ?

 

From the guide: "Add boot option darkwake=0 if you would like to disable power nap and have the lid wake the gfx instead of hitting extra key."

Link to comment
Share on other sites

Hi folks, quick question.

On T420, does the screen come alive normally when you had the laptop sleeping with a LID closed and you open the LID, having no external displays connected? Here the laptop resumes from sleep when opening the LID, but the screen stays dark until you hit something on the keyboard or touchpad/trackpoint (HID tickle). Just curious if I need to hunt this down it being a common issue or this has been addressed for T420 ?

It's exactly what you describe, on my T420s it's true.

 

I've followed your guide and everything works great, but I have one small issue.

 

When I "Shut Down" OS X while I'm logged in (from the Apple logo menu), instead of shutting down, it reboots.

I also have the same problem at first when I installed 10.11.4, and after updating to 10.11.5 the problem is gone

Link to comment
Share on other sites

From the guide: "Add boot option darkwake=0 if you would like to disable power nap and have the lid wake the gfx instead of hitting extra key."

Thanks. While that worked, I still wonder why that flag is needed as I don't have it on my DELL and yet the LID wake works wonders.

 

It's more like there's a notification to IGPU missing somewhere when waking up using the LID, as SLPB gets notified by LID to wake the machine up, but display driver is sitting there doing nothing until you HID tickle. Will try to debug ACPI calls to see the difference ...

Link to comment
Share on other sites

So here's the gist. 


 

Having started executing _WAK upon wake it determines waking from S3. 

If Intel IGD graphics are in use, as determined by \VIGD, it then signals IGD that all LID devices have awoken by calling GLIS and passing the evaluation of _LID as an arg to it. Which _LID returns the value of a EC register HPLD (H = H8 = EC, P = Probe, LD = LID). This value happens to be 1 on wake, meaning internal (LFP) LID is open.
GLIS notifies IGPU with 0, but it does not notify the LID device itself, an extra notification has to be issued.

 

If you look at _Q2B, which is responsible for preparing the system for sleep when LID is closed, it calls GLIS followed by a status change notification to LID. Never happens in _WAK tough ...

 

So add that an voila, no darwake nor HID tickle is required to wake display when you open the LID.

 

 

        If (LEqual (Arg0, 0x03))
        {
            ...
            If (\VIGD)
            {      
                \_SB.PCI0.IGPU.GLIS (\_SB.LID._LID ())
                If (\WVIS)
                {
                    \VBTD ()
                }
            }
            Else
            {
                If (\WVIS)
                {
                    \_SB.PCI0.IGPU.GLIS (\_SB.LID._LID ())
                    \VBTD ()
                }
            }
           
            Notify (\_SB.LID, 0x80)  // Having called IGD GLIS, signal the LID to wake
            \VCMS (0x01, \_SB.LID._LID ())
            \AWON (0x00)

 

For some reason for \_OS “Vista”, IGPU has to be aware LID is wake regardless… think it’s just that the Vista driver is retarded like that and does not report \VIGD to ACPI properly. Also, something tells me that _Q2A was meant to be called during wake from LID, but it's not as the firmware is rubbish and instead a cr@pton of things are done in _WAK.

 

Next challenge, understand how in the world this thing signals EC to update brightness level for soft/cold boot as it’s clearly not doing it at present.


  • Like 4
Link to comment
Share on other sites

very cool. this has bothered me for awhile. i have 3 lenovo boxes and all behave slightly different in regards to lid sleep/wake. if you can post your dsdt, once you get it ironed out,  i will update the T420 and T420s DSDT files in the zip.

 

lenovo T460, lid open will wake. lid close shut turns off LCD but doesn't initiate sleep.

lenovo g780, the opposite.

  • Like 3
Link to comment
Share on other sites

hmm. on the brightness. i am using IntelBacklight with a XOPT=6

 

this kext with a simple PNLF is working ok. seems to store the levels in NVRAM for next boot etc? seems to sleep wake and keep brightness set right.

Link to comment
Share on other sites

hmm. on the brightness. i am using IntelBacklight with a XOPT=6

 

this kext with a simple PNLF is working ok. seems to store the levels in NVRAM for next boot etc? seems to sleep wake and keep brightness set right.

I am not sure if XOPT is even relevant now for the new kext, but I realize why you mention it.

 

I was on about some other brightness however .. the one laptop boots up with on every reboot. It appears that Lenovo are doing something utterly dumb here where they boot with the backlight on the panel set to 100% brightness... and I am inclined to think this is because they evaluate _BCL at BIOS level and using _BCM to set the panel to whatever elements 0 and 1 return from the BRTW package at \_SB.PCI0.LPC.EC. Here 0 being default level when on AC power and 1 being the default for DC power. And these just happen to be 0x64. You get my drift...

 

On DELL, the level is written to SystemIO by EC queries and is then used by BIOS on every boot. So once you can translate the IGD PWM values to match exactly with levels used by the BIOS you get a consistent backligt during cold/soft boots. What this means is that regardless of the level IntelBacklight (or ACPIBacklight) has stored in nvram, BIOS would have the equivalent value and you won't have any dimming or sudden brightness jumps once either of the aforementioned kexts loads.

 

Reading around, it seems like Lenovo never implemented something similar and just default to 100% on every boot, which just burns your retinas when you need to enter BIOS or snoop around the boot manager in the middle of the night. 

Link to comment
Share on other sites

Hi! I have problem when I try connect two external monitors. First monitor I connect via VGA and after sleep->wakeup cycle it works great. Second monitor I connect using DisplayPort->HDMI  adapter. It also works great, but only if I not connect VGA monitor. If I connect two monitors in same time none of them work, just black screens, but they shows in settings.

post-828455-0-59953900-1468824309_thumb.png

Link to comment
Share on other sites

Here's some info on Coreboot on the T420: https://www.coreboot.org/Board:lenovo/t420

 

Beyond that, the talk is kind of spotty. There's this thread discussing Ivy Bridge (IVB) on the T420: https://www.bios-mods.com/forum/Thread-Lenovo-T420-Ivy-Bridge-Support-i7-3540M

 

There are multiple sources speaking of Ivy Bridge support, including this: http://comments.gmane.org/gmane.linux.bios/81825- but not a lot of people appear to have actually done the mod.

I am actually one of the few that flashed coreboot on their T420. I do have an Ivy Bridge CPU in it. Unfortunately, Clover insta-crashes but Chameleon seems to work OK. I haven't been able to get OS X running since I lack the time to mess around with it, but if @tluck is interested I could mess around with it after I come back from holidays.

post-469829-0-52332700-1468842739_thumb.png 

 

 

Link to comment
Share on other sites

yup. 10.11.6 no issues.

 

so, just for run, i created a test disk with the macOS Sierra Public Beta 1 (10.12.0) -- and things look very good at first test. 

 

pretty much everything works! even the audio patches still work. however, the sound buttons on the laptop did not control volume?

  • Like 3
Link to comment
Share on other sites

@thegreatcactii - well. glad to hear you got OSX installed.

 

i can only think that you boot UEFI from the USB, then you may not have gotten the bits on the HD EFI exactly as on the USB. 

or wondering about your boot order? have you set it boot UEFI first?

 

check your ESP tree when you mount it.

 

you should see

/EFI/CLOVER/...

/EFI/BOOT/BOOTX64.efi

Link to comment
Share on other sites

where can i found my platform ID?

something like 0x0a260006

is this needed, my T420 works well lol?

---

 

i found this information about DSDT

 

needed? or not?

 

 

 

# OS Check fix - Emulate windows 8 or higher:

into method label _INI parent_label \_SB code_regex If\s+\(\\_OSI\s+\(\"Windows\s2013\"\)\) replace_matched
begin If(LOr(_OSI("Darwin"),_OSI("Windows 2013"))) end;

 

#T440s Fn key fix

# _Q15 (Fn+F5) brightness down key
into method label _Q15 replace_content
begin
    Notify(\_SB.PCI0.LPC.KBD, 0x0205)\n
    Notify(\_SB.PCI0.LPC.KBD, 0x0285)\n
end;

# _Q14 (Fn+F6) brightness up key
into method label _Q14 replace_content
begin
    Notify(\_SB.PCI0.LPC.KBD, 0x0206)\n
    Notify(\_SB.PCI0.LPC.KBD, 0x0286)\n
end;

# _Q6A (Fn+F4) Microphone Mute key
into method label _Q6A replace_content
begin
    Notify(\_SB.PCI0.LPC.KBD, 0x0168)\n
    Notify(\_SB.PCI0.LPC.KBD, 0x01e8)\n
end;

# _Q16 (Fn+F7) Projector / Mirror mode key
into method label _Q16 replace_content
begin
    Notify(\_SB.PCI0.LPC.KBD, 0x026e)\n
    Notify(\_SB.PCI0.LPC.KBD, 0x02ee)\n
end;

# _Q64 (Fn+F8) Wireless disable key
into method label _Q64 replace_content
begin
    Notify(\_SB.PCI0.LPC.KBD, 0x0169)\n
    Notify(\_SB.PCI0.LPC.KBD, 0x01e9)\n
end;

# _Q66 (Fn+F9) Settings key
into method label _Q66 replace_content
begin
    Notify(\_SB.PCI0.LPC.KBD, 0x0164)\n
    Notify(\_SB.PCI0.LPC.KBD, 0x01e4)\n
end;

# _Q67 (Fn+F10) Spotlight key
into method label _Q67 replace_content
begin
    Notify(\_SB.PCI0.LPC.KBD, 0x0165)\n
    Notify(\_SB.PCI0.LPC.KBD, 0x01e5)\n
end;

# _Q68 (Fn+F11) App switcher key
into method label _Q68 replace_content
begin
    Notify(\_SB.PCI0.LPC.KBD, 0x0166)\n
    Notify(\_SB.PCI0.LPC.KBD, 0x01e6)\n
end;

# _Q69 (Fn+F12) Launchpad key
into method label _Q69 replace_content
begin
    Notify(\_SB.PCI0.LPC.KBD, 0x0167)\n
    Notify(\_SB.PCI0.LPC.KBD, 0x01e7)\n
end;

 

 

Edited by Allan
Spoiler tag - Added
Link to comment
Share on other sites

on the T420 - we have sandy bridge and the id that you listed looks like a frame buffer id. we use id=1 for MBP8,1 and we don't really need specify a frame buffer id explicitly. a

 

yup i have seen these mappings - i am trying to hack my new T460 and am using that list or something like it - these may come in handy on Sierra for the T420 which seems which may need some new mappings.

  • Like 1
Link to comment
Share on other sites

@thegreatcactii - well. glad to hear you got OSX installed.

 

i can only think that you boot UEFI from the USB, then you may not have gotten the bits on the HD EFI exactly as on the USB. 

or wondering about your boot order? have you set it boot UEFI first?

 

check your ESP tree when you mount it.

 

you should see

/EFI/CLOVER/...

/EFI/BOOT/BOOTX64.efi

I ended up getting it to work. For some reason it just wasn't installing it on the ESP even though I selected it. I manually mounted the EFI partition and it found it this time. Thanks!

Link to comment
Share on other sites

 Share

×
×
  • Create New...