Jump to content

Lenovo ThinkPad T420 with UEFI Only


Go to solution Solved by tluck,
5,249 posts in this topic

Recommended Posts

On 5/10/2021 at 3:21 AM, Hervé said:

Has anyone ever tried to inject compatibility with Apple's SD card reader 14e4:16bc for the Ricoh SD card reader?

 

It works for various O2 models fitted to several Dell Latitude laptops and was understood/claimed to work for Ricoh readers fitted to T420/T430 but we never got confirmation for those.

 

The following properties can be injected

  • either in a patched DSDT through a DSM method under the SD card reader's ACPI device:

                   Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
                   {
                        If (LEqual (Arg2, Zero))
                        {
                            Return (Buffer (One)
                            {
                                 0x03                                           
                            })
                        }
                        Return (Package ()
                        {
                            "AAPL,slot-name",                     // Optional
                            Buffer (0x09)                         // Optional
                            {                                     // Optional
                                "Built-in"                        // Optional
                            },                                    // Optional
                            "device_type",                        // Optional
                            Buffer (0x11)                         // Optional
                            {                                     // Optional
                                "Media Controller"                // Optional
                            },                                    // Optional
                            "model",                              // Optional
                            Buffer ()                             // Optional
                            {                                     // Optional
                                "<specify your model here>"       // Optional
                            },                                    // Optional
                            "compatible", 
                            Buffer (0x0D)
                            {
                                "pci14e4,16bc"
                            }
                        })
                    }
  • or through the bootloader config (Clover, OpenCore) at the SD card's IO location PciRoot(0x0)/Pci(...)/... :

compatible        pci14e4,16bc        STRING
AAPL,slot-name    built-in            STRING    // Optional
model             <model here>        STRING    // optional
device_type       Media controller    STRING    // Optional

 

hmm... interestingly a device shows up by adding this method, but when i put an SD card in the slot nothing happened.

Built in SD Card Reader:

 

  Vendor ID: 0x1180

  Device ID: 0xe823

  Subsystem Vendor ID: 0x17aa

  Subsystem ID: 0x21ce

  Revision: 0x0005

  Link Width: x1

  Link Speed: 2.5 GT/s

 

With no other stuff that could interfere, like an add-on kext?

 

The claim might have been a red herring though, hence why I was asking.

Thank you for checking anyway, I'll update our info at OSXL on the matter.

  • Like 1
Posted (edited)
On 5/12/2021 at 11:11 AM, Hervé said:

With no other stuff that could interfere, like an add-on kext?

 

The claim might have been a red herring though, hence why I was asking.

Thank you for checking anyway, I'll update our info at OSXL on the matter.

test1: use inject the method - sees an internal card reader but non-functional

test2: use Voodoo kext - get an external generic card reader - which say it has an un-initialted/unformatted sd card (but that's not true as it is formatted) so doesn't work - can't read/write to it.
 

I gave up on this effort for this box years ago since using USB card reader is very common and cheap.

Edited by tluck

Hi @tluck. I'm struggling with a x220. I know it's not a t420 but I think they have the same mobo (I mean same chipset and everything).

I got GUI freezes (mouse still moves) and artifacts. Artifacts are not that many so I can live with them. But GUI freezes are ultra annoying.

Did you manage to get rid of GUI freezes on your t420 ? They are HD3000, right ? 

I found some OC config.plist with ReservedMemory "HD3000: IGPU memory corruption errata". DO you know what that is and if it works ?

ThinkPad X220 vs. ThinkPad T420.

Very close indeed, Sandy Bridge and HD3000 graphics.

 

There was a recent thread on that Reserved Memory thingie but I'm pretty sure it leads nowhere:

https://www.insanelymac.com/forum/topic/347708-opencore-sampleplisthd3000-igpu-memory-coruption-errata/

 

Did you try the VRAM increase?

Posted (edited)
5 hours ago, Jief_Machak said:

Hi @tluck. I'm struggling with a x220. I know it's not a t420 but I think they have the same mobo (I mean same chipset and everything).

I got GUI freezes (mouse still moves) and artifacts. Artifacts are not that many so I can live with them. But GUI freezes are ultra annoying.

Did you manage to get rid of GUI freezes on your t420 ? They are HD3000, right ? 

I found some OC config.plist with ReservedMemory "HD3000: IGPU memory corruption errata". DO you know what that is and if it works ?

Hey Jief,

yeah from a Hack perspective X220 and T420 are the same.

 

if you look in the system log and see a bunch of br-sync messages then you have hit typical problem with HD3000. 

2 things help
16 GB of memory

EDID replacement and/or LCD replacement - AUO are very problematic.

so we have more options for 1600x900. but for 1368 there are some EDIDs that will help fix this problem.

 

my bundle supports Sierra, High Sierra, Mojave and Catalina (Mojave and Catalina are installed via Dosdude1 method)

 

my T420 16GB with LG LCD never freezes and very very rare to see artifacts

my T420 8GB with AUO LCD doesnt freeze but has some artifacts.

 

not sure if helps or not but i do patch my NVRAM to have 1024GB vs normal 512GB.

again patches are available in my example in github. https://github.com/tluck/Lenovo-T420-Clover

 

 

 

Edited by tluck
3 hours ago, tluck said:

Hey Jief,

yeah from a Hack perspective X220 and T420 are the same.

 

if you look in the system log and see a bunch of br-sync messages then you have hit typical problem with HD3000. 

2 things help
16 GB of memory

EDID replacement and/or LCD replacement - AUO are very problematic.

so we have more options for 1600x900. but for 1368 there are some EDIDs that will help fix this problem.

 

my bundle supports Sierra, High Sierra, Mojave and Catalina (Mojave and Catalina are installed via Dosdude1 method)

 

my T420 16GB with LG LCD never freezes and very very rare to see artifacts

my T420 8GB with AUO LCD doesnt freeze but has some artifacts.

 

not sure if helps or not but i do patch my NVRAM to have 1024GB vs normal 512GB.

again patches are available in my example in github. https://github.com/tluck/Lenovo-T420-Clover

 

 

 

If did this "log show --last boot | grep br-sync" and found nothing. But I do have this typical problems !

 

Do you also change VRAMMethod in info.plist ?

 

You mean the physical LCD has an effect ? How do I know if it's AUO ?

@Jief_Machak

I never messed with VRAMMethod since just replacing the EDID was working.

 

yes. replaced the physical LCD. my son broke the screen and i replaced with beautiful glossy LG for about $45 and it never hangs.

The EDID will tell you make and model

MAKE: LG = 30e4

MODEL: 366 (byte swapped)

 

ioreg -l|grep yEDID

    | |   | | |       "IODisplayEDID" = <00ffffffffffff0030e466030000000000150104901f117802fc45955855922820505400000001010101010101010101010101010101582f40f861843c30a060350035ae1000001a901f40f861843c30a060350035ae1000001a000000fe00334e505236803134305744320a00000000000041319e0110000002010a202000a7>

AUO=06af

Model: 213e

ioreg -l|grep yEDID

    | |   | | |       "IODisplayEDID" = <00ffffffffffff0006af3e210000000021140104901f11780261959c59528f2621505400000001010101010101010101010101010101f82a409a61840c30402a330035ae10000018a51c409a61840c30402a330035ae10000018000000fe0041554f0a202020202020202020000000fe004231343052573032205631200a00d0>

 

then i built matching Override files which

$ ls -l /System/Library/Displays/Contents/Resources/Overrides/DisplayVendorID-30e4

total 32

-rw-r--r--  1 tluck  wheel  3975 Dec 31  2016 DisplayProductID-2e2

-rw-r--r--  1 tluck  wheel  3754 Mar  8  2020 DisplayProductID-2e3

-rw-r--r--  1 tluck  wheel  3975 Mar  8  2020 DisplayProductID-366

-rw-r--r--  1 tluck  wheel   579 Jan  4  2017 DisplayProductID-50b

 

sorry it would be BRSYNC that indicates the gfx hang.

2018-02-04 02:42:00.705849+0300 0x545      Default     0x0                  0      0    kernel: (AppleIntelHD3000Graphics)     BRSYNC: (0x22040) = 0x0
2018-02-04 02:42:01.285151+0300 0x12e3     Default     0x0                  0      0    kernel: (AppleIntelHD3000Graphics)     BRSYNC: (0x22040) = 0x
2 hours ago, tluck said:

@Jief_Machak

I never messed with VRAMMethod since just replacing the EDID was working.

 

yes. replaced the physical LCD. my son broke the screen and i replaced with beautiful glossy LG for about $45 and it never hangs.

The EDID will tell you make and model

MAKE: LG = 30e4

MODEL: 366 (byte swapped)

 

ioreg -l|grep yEDID

    | |   | | |       "IODisplayEDID" = <00ffffffffffff0030e466030000000000150104901f117802fc45955855922820505400000001010101010101010101010101010101582f40f861843c30a060350035ae1000001a901f40f861843c30a060350035ae1000001a000000fe00334e505236803134305744320a00000000000041319e0110000002010a202000a7>

AUO=06af

Model: 213e

ioreg -l|grep yEDID

    | |   | | |       "IODisplayEDID" = <00ffffffffffff0006af3e210000000021140104901f11780261959c59528f2621505400000001010101010101010101010101010101f82a409a61840c30402a330035ae10000018a51c409a61840c30402a330035ae10000018000000fe0041554f0a202020202020202020000000fe004231343052573032205631200a00d0>

 

then i built matching Override files which

$ ls -l /System/Library/Displays/Contents/Resources/Overrides/DisplayVendorID-30e4

total 32

-rw-r--r--  1 tluck  wheel  3975 Dec 31  2016 DisplayProductID-2e2

-rw-r--r--  1 tluck  wheel  3754 Mar  8  2020 DisplayProductID-2e3

-rw-r--r--  1 tluck  wheel  3975 Mar  8  2020 DisplayProductID-366

-rw-r--r--  1 tluck  wheel   579 Jan  4  2017 DisplayProductID-50b

 

sorry it would be BRSYNC that indicates the gfx hang.


2018-02-04 02:42:00.705849+0300 0x545      Default     0x0                  0      0    kernel: (AppleIntelHD3000Graphics)     BRSYNC: (0x22040) = 0x0
2018-02-04 02:42:01.285151+0300 0x12e3     Default     0x0                  0      0    kernel: (AppleIntelHD3000Graphics)     BRSYNC: (0x22040) = 0x

So, I'm a bit lost.

For you, the gfx hang is caused by the physical LCD, or by a wrong EDID ?

Posted (edited)
2 hours ago, Jief_Machak said:

So, I'm a bit lost.

For you, the gfx hang is caused by the physical LCD, or by a wrong EDID ?

in my experience the gfx hang problem is related to a broken or incompatible EDID (from the AUO display).

the fix is to inject a compatible EDID. 
LG displays seem to work quite well (using the EDID from the LCD).  So taking/injecting the EDID from an LG display has proven to fix AUO issues in this case. 

 

for many years, on macOS 10.9-10.12 this approach was workable and glitch-free
however, in HighSierra some glitches (and hangs) came back on my box with AUO display. LG has no problems.
for Mojave and Catalina there is no HD 3000 support, but we use the older gfx frames and HighSierra kexts.

 

more memory - 16 GB vs 4 or 8 - seems to remove/reduce artifacts.

 

bottom line: inject/replace the EDID with a compatible one.

Edited by tluck

Wow, since so much time I'm looking, and I never saw anyone talking about EDID. But it makes sense.

Artifact is not huge problems. If 10.12 could be hangs free, I may downgrade to 10.12.

How to I find a good EDID ? X220 are 1368x768 panels.

Do you have a 1368x768 LG panel ?

11 hours ago, Jief_Machak said:

Wow, since so much time I'm looking, and I never saw anyone talking about EDID. But it makes sense.

Artifact is not huge problems. If 10.12 could be hangs free, I may downgrade to 10.12.

How to I find a good EDID ? X220 are 1368x768 panels.

Do you have a 1368x768 LG panel ?

yeah. replacing the EDID was an amazing thing discovered around 2013/2014... 

 

10.12 Sierra is solid, for me HighSiera -> Catalina are all great. Some see more artifacts etc.
I dont have that size on my boxes, but there is a config.1368x768.plist in my repo that may provide an alternative EDID for you. 
Frankly, its been so long since I created that particular config I can not recall where that EDID came from... 

EDID basically defines the screen's capabilities to the GPU so I'm a little sceptical about re-using the data pertaining to a given screen on a different one. It's a bit like injecting the DSDT of a given computer on a totally different one if I may push that far...

 

I'd opt for experimentations with SwitchResX on the other hand.

https://osxlatitude.com/forums/topic/7914-dell-latitude-e6220-with-i5-2520m-hd3000-and-1366x768-lcd-mavericksyosemiteel-capitansierrahigh-sierramojavecatalina/?do=findComment&comment=96340

On 5/21/2021 at 8:38 PM, tluck said:

yeah. replacing the EDID was an amazing thing discovered around 2013/2014... 

 

10.12 Sierra is solid, for me HighSiera -> Catalina are all great. Some see more artifacts etc.
I dont have that size on my boxes, but there is a config.1368x768.plist in my repo that may provide an alternative EDID for you. 
Frankly, its been so long since I created that particular config I can not recall where that EDID came from... 

Ok, I'm trying your EDID. Let's see.

Booted fine.

Do you know a way to check if I still got gfx hangs ? Like, is there something that make it hangs all the time, or is it just random ?

Same for artefact : is there a test ?

On 5/21/2021 at 2:13 PM, Hervé said:

EDID basically defines the screen's capabilities to the GPU so I'm a little sceptical about re-using the data pertaining to a given screen on a different one. It's a bit like injecting the DSDT of a given computer on a totally different one if I may push that far...

 

I'd opt for experimentations with SwitchResX on the other hand.

https://osxlatitude.com/forums/topic/7914-dell-latitude-e6220-with-i5-2520m-hd3000-and-1366x768-lcd-mavericksyosemiteel-capitansierrahigh-sierramojavecatalina/?do=findComment&comment=96340

the EDID injection method has worked about 5-6 years here without problems. but sure, you need a similar EDID that may have slight differences in the timings. the EDIDs i posted are from LCD panels (1600x900) that are known to be compatible T420 screen replacements. after Inject the LG EDID into the box with AUO -  voila - happiness.  but of course, this may not be the only way to get a good EDID (SwitchResX for example) 
 

On 5/22/2021 at 9:38 PM, Jief_Machak said:

Ok, I'm trying your EDID. Let's see.

Booted fine.

Do you know a way to check if I still got gfx hangs ? Like, is there something that make it hangs all the time, or is it just random ?

Same for artefact : is there a test ?

both a bit random. artifacts are more common.

gfx hangs - will show up in syslogs as BRSYNC messages.
artifacts - i can often make them show up by using remote desktop, or starting terminal on my AUO LCD box. 

  • 5 weeks later...

Fellows, I want to use my T420 for some more time, don´t really need a M1 MBA with all bells and whistles.

As Catalina will be the last version which can be used more or less safely, I was looking for an alternative for mail and web browsing.
Elementary did spring to mind and its running fine on a 128GB mSATA now.

Just one little nag remains in Catalina.
The OS keeps telling me this at boot time: "The disk you inserted was not readable by this computer - Initialise… / Ignore / Eject"

Does anybody know how to get rid of this nag screen, telling Catalina to ignore the mSATA?

On 6/22/2021 at 10:58 PM, goodguess said:

Fellows, I want to use my T420 for some more time, don´t really need a M1 MBA with all bells and whistles.

As Catalina will be the last version which can be used more or less safely, I was looking for an alternative for mail and web browsing.
Elementary did spring to mind and its running fine on a 128GB mSATA now.

Just one little nag remains in Catalina.
The OS keeps telling me this at boot time: "The disk you inserted was not readable by this computer - Initialise… / Ignore / Eject"

Does anybody know how to get rid of this nag screen, telling Catalina to ignore the mSATA?

Look up documentation for "vifs", you can probably configure it in a way that it doesn't automatically try to mount the mSATA.

 

Using sudo vifs opens /etc/fstab in a text editor, the file is used to configure mount options for volumes.

adding this line works for me for a similar usecase: UUID=REPLACE_WITH_VOLUME_IDENTIFIER none auto noatime,noauto,ro

There's a lot more to update than just OpenCore.efi. You need to download the entire set of folders and replace boot file, drivers, resources, tools, etc. The updated resources are not in the package of course but in acidanthera's OcBinaryData GitHub repo. Make sure you're aligned on the versions.

There's a lot more to update than just OpenCore.efi. You need to download the entire set of folders and replace boot file, drivers, resources, tools, etc. The updated resources are not in the package of course but in acidanthera's OcBinaryData GitHub repo. Make sure you're aligned on the versions.

I'm aware.

Of course i’m replacing all the binaries with updated versions.

What i mean is the OpenCore.efi file is what makes the boot fail, all the other files work, even the new drivers work fine when i switch back to the older OpenCore.efi file provided in tlucks repository.

I’m thinking either some recent change in opencore broke compatibility with the t420 or tluck made some changes to source code to make it work in the first place.
On 6/24/2021 at 9:03 AM, ShroomKing said:

@tluck sorry for the strange question, where do you get the OpenCore binaries?

 

I have tried to update OpenCore with files from https://github.com/acidanthera/OpenCorePkg but after replacing OpenCore.efi it doesn't boot.

 

Have you made any changes to source code to make it work?

In my github repo, there is a full set of files for Clover AND OC (both of which I compile - so yes the OC verions is a custom version) -  one change in OC a while back broke it - so i have a work around.

 

the change is line 92 of Library/OcMainLib/OpenCoreNvram.c: 

 

    gRT->SetVariable (
      OC_VERSION_VARIABLE_NAME,
      &gOcVendorVariableGuid,
_      OPEN_CORE_NVRAM_ATTR,
+      Config->Nvram.WriteFlash ? OPEN_CORE_NVRAM_NV_ATTR : OPEN_CORE_NVRAM_ATTR,
      AsciiStrLen (Version),
      (VOID *) Version
      );
 

Edited by tluck
  • Like 1
×
×
  • Create New...