[coreboot] rfkill explanation

Charles Devereaux coreboot at guylhem.net
Sun Nov 2 05:07:07 CET 2014


Hello

After studying thinkpad-acpi.c subdrivers, here are the ACPI entries which
are
missing in src/ec/lenovo/h8/acpi/ec.asl to enable a proper rfkill support
on a
X60 (which will be created by thinkpad-acpi) :
 - GWAN
 - SWAN
 - GBDC
 - SBDC

Why? Because for example with thinkpad-acpi bluetooth subdriver,
bluetooth_init will do:
        acpi_evalf(hkey_handle, &status, "GBDC", "qd");

If GBDC does not return the proper status, bluetooth is supposed to not be
present.
If it returns the correct status, the proper rfkill entry will be created:
        res = tpacpi_new_rfkill(TPACPI_RFK_BLUETOOTH_SW_ID,
                                &bluetooth_tprfk_ops,
                                RFKILL_TYPE_BLUETOOTH,
                                TPACPI_RFK_BLUETOOTH_SW_NAME,
                                true);

As these 4 ACPI entries are missing, bluetooth rfkill is provided by the
bluetooth driver instead of thinkpad-acpi.

Why is that bad? Because thinkpad-acpi would use SBDC to set the status and
actually save power (also toggling the bluetooth led which is nice)

The same thing applies to WWAN, only with GBDC/SBDC. Also, it's then much
more important, as a GPS module consume more power than Bluetooth.

All that is quite clear. The next part is not so clear, as it came from my
understanding of the original DSDT.

The ACPI entries seem to be handled this way:

GWAN: get wwan status -> WGFL and WPWS-> H8DR-> _SB.PCI0.LPC.EC.DCWW ||
ShiftRight (And (\RBEC (0x3A), 0x40), 0x06)

SWAN: set wwan status -> WPWC (and the power-on default is stored in NVRAM:
WGSV)

GBDC: get bluetooth status -> WGFL and BPWS-> H8DR-> _SB.PCI0.LPC.EC.DCBD
|| ShiftRight (And (\RBEC (0x3A), 0x10), 0x04)

SBDC: set bluetooth status -> BPWC (and the power-on default is stored in
NVRAM: BLTH)

WGFL seems to be some bitmask for bluetooth (0x20) and wwan (0x02), maybe
to store their current status?
It affects _SB.PCI0.LPC.EC.HKEY.BPWC and _SB.PCI0.LPC.EC.HKEY.WPWC

The function of _SB.PCI0.LPC.EC.HKEY.BPWC/_SB.PCI0.LPC.EC.HKEY.WPWC and
_SB.PCI0.LPC.EC.DCWW/_SB.PCI0.LPC.EC.DCBD is unclear to be. I guess it
control the module power and the LED state.

I hope the above can be useful to someone to fix
src/ec/lenovo/h8/acpi/ec.asl

BTW, the KBLT entry is present in ec.asl,  but shouldn't be always on, as
there is no thinklight on the x60t (only on the X60 proper IIRC)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20141102/21aa25a4/attachment.html>


More information about the coreboot mailing list