[ltp] X240 NFC

Bjørn Mork linux-thinkpad@linux-thinkpad.org
Thu, 20 Mar 2014 10:24:22 +0100


Leon Weber <leon@leonweber.de> writes:

> Outputs of lspci and lsusb aren’t very helpful to me, thereâ€=
™s nothing
> there that I’d recognize as NFC. 

I don't know much about this at all, but I did notice this part of the
Windows8 driver readme at
http://download.lenovo.com/ibmdl/pub/pc/pccbbs/mobiles/giwn08ww.txt :

  Device name                 Device name in the Device Manager
  -----------------------     ---------------------------------
  Broadcom NFC Controller     NFC SMBus Device


Which probably explains why you don't see the device on PCI or USB: It
is connected to the SMBus. Which is the name of the chipset I2C bus
you'll typically find as PCI device 1f.3 on Intel chipsets.

> Any suggestions?  What make of NFC module does Lenovo build into the
> X240 (and the othe Haswell Thinkpads)?  Are there any Linux drivers
> available?

You may find more hints in the Windows driver.  Look through the .inf
file(s), run "strings" on the binaries, or dissamble them.

Or install the i2c-tools package and run i2cdetect and i2cdump on the
SMBus.  Or take a look at the sensors-detect script from the lmsensors
package for how to run chip detection on that bus.

Note that these tools may do things the firmware developers didn't
anticipate, and should therefore be considered somewhat dangerous.
You'd better be prepared for a motherboard replacement as an unlikely,
but still remotely possible, outcome...  Do read the manual pages
first. One of the i2cdetect options is documented as known to corrupt
the eeprom of some Thinkpads.  There is no need to try that option ;-)

i2cdump is even more risky.  In theory you shouldn't try that without
knowing what chip you are talking to. It is still one of the few ways to
explore unknown chips, and can be used with some care. 

This is the way SMBus drivers always have been developed, and without
docs it is the only way AFAIK.

Sample run on my X301 looks like this (just to show how to find the
chips on the SMBus - there is no NFC chip here of course):

nemi:/tmp# modprobe i2c-dev
nemi:/tmp# i2cdetect -l
i2c-0   i2c             i915 gmbus ssc                          I2C adapter
i2c-1   i2c             i915 gmbus vga                          I2C adapter
i2c-2   i2c             i915 gmbus panel                        I2C adapter
i2c-3   i2c             i915 gmbus dpc                          I2C adapter
i2c-4   i2c             i915 gmbus dpb                          I2C adapter
i2c-5   i2c             i915 gmbus dpd                          I2C adapter
i2c-6   i2c             DPDDC-B                                 I2C adapter
i2c-7   i2c             DPDDC-D                                 I2C adapter
i2c-8   smbus           SMBus I801 adapter at 1c60              SMBus adapter
nemi:/tmp# i2cdetect 8
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-8.
I will probe address range 0x03-0x77.
Continue? [Y/n] 
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- 08 -- -- -- 0c -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- 44 -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- 5c -- -- -- 
60: -- 61 -- -- 64 -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         



Bjørn