Skip to content

Instantly share code, notes, and snippets.

@HeySora
Last active March 29, 2024 12:57
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HeySora/d720554aa5564a7800de8eca45403ef7 to your computer and use it in GitHub Desktop.
Save HeySora/d720554aa5564a7800de8eca45403ef7 to your computer and use it in GitHub Desktop.
WWAN SSDT for ThinkPad T490s (Fibocom L850-GL)
// This SSDT is essentially sending "CAP_EXP+10.w=0052" as well as a RST() call
// in order to switch the Fibocom WWAN card to USB mode.
// This is fully working on my ThinkPad T490s (20NX*), but I cannot guarantee
// that this code will work for you as well. Read below for instructions for other brands.
// There might be issues when going out of sleep mode? I vaguely recall
// having rare issues in these cases. Going in sleep mode and going out fixed it.
// There are probably better ways to do something like this...
// Please note that you need to remove the FCC Lock of your card!
// -HeySora <@HeeySora / heysora.net>
// FOR OTHER BRANDS / OTHER MODELS
// "CAP_EXP+10", on my system, is located at the PCI address "@80", which is 0x50 in hex.
// This is the 0x50 you see in the OperationRegion declaration below.
// In order to find your actual PCI address (which should NOT be different, but just in case...),
// you first need to use Linux, and find your PCI address (e.g.: 0000:3b:00.0) via `lspci`, and
// then execute this command (replacing "0000:3b:00.0" with your own PCI address!)
// setpci -v -s 0000:3b:00.0 "CAP_EXP+10.w"
// On my end, the result is "0000:3b:00.0 (cap 10 @70) @80 = 0142"
// The interesting info, here, is that "@80", being the address of "CAP_EXP+10".
// Convert that value to hexadecimal (80 => 0x50), then put it in the OperationRegion.
DefinitionBlock("", "SSDT", 2, "HeySora", "WWAN", 0)
{
// WWAN card, at least in my own DSDT. Your mileage may vary.
// If yours is different, simply replace all occurences of "RP07"!
External (_SB.PCI0.RP07, DeviceObj)
External (_SB.PCI0.RP07.PXSX._RST, MethodObj)
// OS Is Darwin?
External (OSDW, MethodObj) // 0 Arguments
Scope(_SB.PCI0.RP07)
{
// Dummy OperationRegion + Field, in order to be able to write to the proper byte.
OperationRegion (AAAA, PCI_Config, 0x50, 0x02)
Field (AAAA, AnyAcc, NoLock, Preserve)
{
BBBB, 16,
}
Method (PINI, 0, NotSerialized)
{
// Only act if it is running on macOS.
If (OSDW ())
{
// Set the actual byte
BBBB = 0x52
// Reset the WWAN card, effectively restarting it into USB mode.
\_SB.PCI0.RP07.PXSX._RST ()
}
}
}
}
@BloodLancet
Copy link

does this works on lenovo t580?

@HeySora
Copy link
Author

HeySora commented Jun 18, 2023

As long as your card is a Fibocom L850-GL, it should with no issues.

The memory offsets might be different, which is why I provided instructions using Linux to figure out your own offsets, as well as what to change in the code. Please refer to the // FOR OTHER BRANDS / OTHER MODELS section.

@BloodLancet
Copy link

i got an error while trying to compile dsl
32, 6156, Invalid OEM ID (Length cannot exceed 6 characters)
any suggestion?

@HeySora
Copy link
Author

HeySora commented Aug 8, 2023

i got an error while trying to compile dsl 32, 6156, Invalid OEM ID (Length cannot exceed 6 characters) any suggestion?

@BloodLancet Huh, I've never seen that error before. Simply swap this line:

DefinitionBlock("", "SSDT", 2, "HeySora", "WWAN", 0)

with a shorter OEM name (4th parameter of the DefinitionBlock), such as

DefinitionBlock("", "SSDT", 2, "Sora", "WWAN", 0)

@BloodLancet
Copy link

i got an error while trying this command setpci -v -s 0000:3b:00.0 "CAP_EXP+10.w"
in my lspci i got : 03:00.0 Wireless controller [0d40]: Intel Corporation XMM7360 LTE Advanced Modem (rev 01)
i'm not quite familiar with linux, may i get some help here?

@HeySora
Copy link
Author

HeySora commented Aug 9, 2023

If what you're getting out of lspci is "0000:03:00.0", then you need to do setpci -v -s 0000:03:00.0 "CAP_EXP+10.w".
The 0000:3b:00.0 part is what needs to be replaced with whatever address lspci gives you.

@BloodLancet
Copy link

I got setpci: 0000:03:00.0: Instance #0 of Capabilty 0010 not found - there are no capabilities with that id

@HeySora
Copy link
Author

HeySora commented Aug 9, 2023

Please make sure you are typing the command correctly and not adding spaces where there shouldn't be. The syntax has to strictly match.
I unfortunately cannot assist you further, as I do not own your model of laptop.

@Einstonoy
Copy link

Einstonoy commented Aug 12, 2023

Hey man, I got the same response like 'BloodLancet':Instance #0 of Capabilty 0010 not found - there are no capabilities with that id.
I try a lot but it remains same, could you explain the meaning of "CAP_EXP+10.w" and what exact the effect mean, is there another way to get this offset by command like "CAP_PM" or "CAP_MSI", it is really frustrated that I have been stuck in things like this for days, hope you could help me.
Anyway, thinks a lot for your good work.

@Einstonoy
Copy link

I doubt the @80 you mentioned in the dsl file means the decimal No. shows in Ubuntu, the first No. I got by lspci and setpci is 40, however hexadecimal 0x28 then was used, but it ends bad, remains no work

@HeySora
Copy link
Author

HeySora commented Aug 13, 2023

If you cannot find any capability called CAP_EXP, that means you have a variant of L850-GL that is not compatible with USB-MBIM; which unfortunately makes your hardware not compatible with this SSDT. There is nothing that can be do neto assist, as this SSDT focuses on the (vast) majority of L850-GL/XMM7360 modems that are able to switch into USB-MBIM.

Without that capability, your card cannot be used on macOS, period.

@Einstonoy
Copy link

Alright then, I would purchase a usb model like em7430 to realize the wwan function, but now I should mod the bios and release the white list first. It seems the only way to get wwan function in my laptop in different OS (MacOS, Ubuntu and Win).

@dolame
Copy link

dolame commented Mar 27, 2024

how can I find my device's value is "RP07" or other

@limin9988
Copy link

limin9988 commented Mar 29, 2024

awesome work , mind share how to remove the fcc lock?thanx in advance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment