Search Linux Wireless

Re: ThinkPad T470 and NXP PN5xx (PN547 or PN548)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 9, 2019 at 3:46 PM Sedat Dilek <sedat.dilek@xxxxxxxxx> wrote:
>
> Hi,
>
> I am here on Debian/buster AMD64 and Linux v5.1 final.
>
> I have successfully installed and tested the NXP NFC driver from
> Lenovo under Windows 10 as a first step (see [1] and [2]).
>
> As a testcase I used my YubiKey which was recognized via NFC and I
> could automatically register at the YubiKey demo website.
>
> Under Linux v5.1 I have activated all sort of CONFIG_NFC_XXX as
> modules if available (see below and attached files).
>
> I am not sure if I need to load the PN544 (I2C) driver?
>
> I can see in /sys ...
>
> # cd /sys/bus/i2c/devices/i2c-NXP1001:00
>
> # ls -alhR
> .:
> total 0
> drwxr-xr-x 3 root root    0 May  9 14:34 .
> drwxr-xr-x 5 root root    0 May  9 14:34 ..
> lrwxrwxrwx 1 root root    0 May  9 14:34 firmware_node ->
> ../../../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:79/NXP1001:00
> -r--r--r-- 1 root root 4.0K May  9 14:34 modalias
> -r--r--r-- 1 root root 4.0K May  9 14:34 name
> drwxr-xr-x 2 root root    0 May  9 14:34 power
> lrwxrwxrwx 1 root root    0 May  9 14:34 subsystem -> ../../../../../../bus/i2c
> -rw-r--r-- 1 root root 4.0K May  9 14:34 uevent
>
> ./power:
> total 0
> drwxr-xr-x 2 root root    0 May  9 14:34 .
> drwxr-xr-x 3 root root    0 May  9 14:34 ..
> -rw-r--r-- 1 root root 4.0K May  9 14:46 async
> -rw-r--r-- 1 root root 4.0K May  9 14:46 autosuspend_delay_ms
> -rw-r--r-- 1 root root 4.0K May  9 14:46 control
> -r--r--r-- 1 root root 4.0K May  9 14:46 runtime_active_kids
> -r--r--r-- 1 root root 4.0K May  9 14:46 runtime_active_time
> -r--r--r-- 1 root root 4.0K May  9 14:46 runtime_enabled
> -r--r--r-- 1 root root 4.0K May  9 14:46 runtime_status
> -r--r--r-- 1 root root 4.0K May  9 14:46 runtime_suspended_time
> -r--r--r-- 1 root root 4.0K May  9 14:46 runtime_usage
>
> # cat name
> NXP1001:00
>
> # cat modalias
> acpi:NXP1001:
>
> # cat uevent
> MODALIAS=acpi:NXP1001:
>
> So, I installed i2c-tools and played with it...
>
> # i2cdetect -l | sort
> i2c-0   i2c             Synopsys DesignWare I2C adapter         I2C adapter
> i2c-1   smbus           SMBus I801 adapter at efa0              SMBus adapter
> i2c-2   i2c             i915 gmbus dpc                          I2C adapter
> i2c-3   i2c             i915 gmbus dpb                          I2C adapter
> i2c-4   i2c             i915 gmbus dpd                          I2C adapter
> i2c-5   i2c             DPDDC-A                                 I2C adapter
> i2c-6   i2c             DPDDC-B                                 I2C adapter
> i2c-7   i2c             DPDDC-C                                 I2C adapter
>
> This seems to be /dev/i2c-0 according to some postings I found in the
> Wild Wild Web.
>
> # i2cdetect 0
> Warning: Can't use SMBus Quick Write command, will skip some addresses
> WARNING! This program can confuse your I2C bus, cause data loss and worse!
> I will probe file /dev/i2c-0.
> I will probe address range 0x03-0x77.
> Continue? [Y/n] y
>      0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
> 00:
> 10:
> 20:
> 30: -- -- -- -- -- -- -- --
> 40:
> 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> 60:
> 70:
>
> En plus, I played with linux_libnfc-nci from NXP Git which provides a
> demo binary (see [3]).
>
> # cd /opt/libnfc-nci/sbin/
>
> # ./nfcDemoApp poll
> #########################################################################################
> ##                                       NFC demo
>                 ##
> #########################################################################################
> ##                                 Poll mode activated
>                 ##
> #########################################################################################
>                               ... press enter to quit ...
>
> NfcService Init Failed
> Leaving ...
>
> Also, no luck with NFC tools like...
>
> # nfc-list
> nfc-list uses libnfc 1.7.1
> No NFC device found.
>
> # nfc-scan-device
> nfc-scan-device uses libnfc 1.7.1
> No NFC device found.
>
> Playing with the pn544_i2c module and rfkill...
>
> # modprobe -v pn544_i2c
> insmod /lib/modules/5.1.0-1-amd64-cbl-asmgoto/kernel/net/nfc/nfc.ko
> insmod /lib/modules/5.1.0-1-amd64-cbl-asmgoto/kernel/net/nfc/hci/hci.ko
> insmod /lib/modules/5.1.0-1-amd64-cbl-asmgoto/kernel/drivers/nfc/pn544/pn544.ko
> insmod /lib/modules/5.1.0-1-amd64-cbl-asmgoto/kernel/lib/crc-ccitt.ko
> insmod /lib/modules/5.1.0-1-amd64-cbl-asmgoto/kernel/drivers/nfc/pn544/pn544_i2c.ko
>
> # lsmod | egrep 'nfc|rfkill|pn544' | sort
> crc_ccitt              16384  1 pn544_i2c
> hci                    61440  2 pn544_i2c,pn544
> nfc                   122880  3 pn544_i2c,pn544,hci
> pn544                  24576  1 pn544_i2c
> pn544_i2c              24576  0
> rfkill                 32768  10 nfc,bluetooth,thinkpad_acpi,cfg80211
>
> # dmesg | tail
> ...
> [ 5163.475363] nfc: nfc_init: NFC Core ver 0.1
> [ 5163.475521] NET: Registered protocol family 39
>
> # rfkill list
> 0: tpacpi_bluetooth_sw: Bluetooth
>         Soft blocked: no
>         Hard blocked: no
> 1: phy0: Wireless LAN
>         Soft blocked: no
>         Hard blocked: no
> 2: hci0: Bluetooth
>         Soft blocked: no
>         Hard blocked: no
>
> Sorry, I had so much URLs open...
> Somewhere I read to activate GPIO and VEN.
> Not sure if I need some sort of DTS file?
>
> The NXP NFC Windows driver lists (I have both firmware files copied to Linux)...
> [Firmware.CopyFiles]
> NXPPN548FW.DAT
> NXPPN547FW.DAT
>
> Last question: Do I need these firmware files installed?
> Rename them?
> Which directory - /lib/firmware?
>
> I ran out of ideas...
>
> Do you need more informations?
>
> I have attached my linux-config and the dmesg output.
>
> Thanks in advance.
>
> Kind regards,
> - Sedat -
>
> [1] https://pcsupport.lenovo.com/us/de/products/laptops-and-netbooks/thinkpad-t-series-laptops/thinkpad-t470/downloads
> [2] https://download.lenovo.com/pccbbs/mobiles/n1qnb04w.txt
> [3] https://github.com/NXPNFCLinux/linux_libnfc-nci
> [4] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/nfc/nfc-hci.txt
> [5] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/nfc/nfc-pn544.txt
>
> P.S.: Some interesting outputs and files
>
> [ LINUX-CONFIG ]
>
> $ grep NFC /boot/config-5.1.0-1-amd64-cbl-asmgoto | sort
> CONFIG_IP_VS_NFCT=y
> CONFIG_MLX5_EN_RXNFC=y
> CONFIG_NFC_DIGITAL=m
> CONFIG_NFC_FDP_I2C=m
> CONFIG_NFC_FDP=m
> CONFIG_NFC_HCI=m
> CONFIG_NFC=m
> CONFIG_NFC_MEI_PHY=m
> CONFIG_NFC_MICROREAD_I2C=m
> CONFIG_NFC_MICROREAD=m
> CONFIG_NFC_MICROREAD_MEI=m
> CONFIG_NFC_MRVL_I2C=m
> CONFIG_NFC_MRVL=m
> CONFIG_NFC_MRVL_SPI=m
> CONFIG_NFC_MRVL_UART=m
> CONFIG_NFC_MRVL_USB=m
> CONFIG_NFC_NCI=m
> CONFIG_NFC_NCI_SPI=m
> CONFIG_NFC_NCI_UART=m
> CONFIG_NFC_NXP_NCI_I2C=m
> CONFIG_NFC_NXP_NCI=m
> CONFIG_NFC_PN533_I2C=m
> CONFIG_NFC_PN533=m
> CONFIG_NFC_PN533_USB=m
> CONFIG_NFC_PN544_I2C=m
> CONFIG_NFC_PN544=m
> CONFIG_NFC_PN544_MEI=m
> CONFIG_NFC_PORT100=m
> CONFIG_NFC_S3FWRN5_I2C=m
> CONFIG_NFC_S3FWRN5=m
> CONFIG_NFC_SHDLC=y
> CONFIG_NFC_SIM=m
> CONFIG_NFC_ST21NFCA_I2C=m
> CONFIG_NFC_ST21NFCA=m
> CONFIG_NFC_ST95HF=m
> CONFIG_NFC_ST_NCI_I2C=m
> CONFIG_NFC_ST_NCI=m
> CONFIG_NFC_ST_NCI_SPI=m
> CONFIG_NFC_TRF7970A=m
> # Near Field Communication (NFC) devices
>
> [ WINDOWS 10 INF DRIVER ]
>
> $ cat NxpNfcClientDriver.inf
> ��;
> ; NxpNfcClientDriver.inf
> ;
>
> [Version]
> Signature="$Windows NT$"
> Class=Proximity
> ClassGuid={5630831C-06C9-4856-B327-F5D32586E060}
> Provider=%ManufacturerName%
> CatalogFile=NxpNfcClientDriver.cat
> DriverVer=03/30/2018,12.0.3.0
>
> [Manufacturer]
> %ManufacturerName%=Standard,NTamd64
>
> [Standard.NTamd64]
> %DeviceName%=MyDevice_Install,ACPI\NXP1000
> %DeviceName%=MyDevice_Install,ACPI\NXP1001
> %DeviceName%=MyDevice_Install,ACPI\NXP1002
> %DeviceName%=MyDevice_Install,ACPI\NXP1003
> %DeviceName%=MyDevice_Install,ACPI\NXP7471
> %DeviceName%=MyDevice_Install,ACPI\NXP8013
> %DeviceName%=MyDevice_Install,ACPI\NXP3001
>
> [SourceDisksNames]
> 1=%DiskName%
>
> [SourceDisksFiles]
> NxpNfcClientDriver.dll=1
> NXPPN548FW.DAT=1
> NXPPN547FW.DAT=1
>
> ; =================== UMDF Device ==================================
>
> [MyDevice_Install.NT]
> CopyFiles=UMDriverCopy,Firmware.CopyFiles
> AddReg=NxpNfpProviderProximityCustomValuesRegister
>
> [MyDevice_Install.NT.hw]
> AddReg=NxpNfcClientDriver_AddReg
>
> [MyDevice_Install.NT.Services]
> AddService=WUDFRd,0x000001fa,WUDFRD_ServiceInstall
>
> [MyDevice_Install.NT.CoInstallers]
> AddReg=CoInstallers_AddReg
>
> [MyDevice_Install.NT.Wdf]
> UmdfService=NxpNfcClientDriver,NxpNfcClientDriver_Install
> UmdfServiceOrder=NxpNfcClientDriver
> UmdfDirectHardwareAccess=AllowDirectHardwareAccess
> UmdfFileObjectPolicy=AllowNullAndUnknownFileObjects
> UmdfImpersonationLevel=Impersonation
>
> [NxpNfcClientDriver_Install]
> UmdfLibraryVersion=2.0.0
> ServiceBinary=%12%\UMDF\NxpNfcClientDriver.dll
> UmdfExtensions=NfcCx0102
>
> [NxpNfcClientDriver_AddReg]
> HKR,FirmwareMap,"8",0x00020000,"%%SystemRoot%%\System32\NXPPN547FW.dat"
> ; HW version of PN547 is 8
> HKR,FirmwareMap,"10",0x00020000,"%%SystemRoot%%\System32\NXPPN548FW.dat"
> ; HW version of PN548 is 10
> HKR,NxpNfcClientDriver, "RfConfigData",            0x00000001, 00
> HKR,NxpNfcClientDriver, "EEPROMConfigBlob",        0x00000001, 00
> HKR,NxpNfcClientDriver, "RfSessionMgmt",           0x00010001, 1
> HKR,NxpNfcClientDriver, "KeepRfData",              0x00010001, 1
>
> ; ============== custom registry sections ==================
>
> [NxpNfpProviderProximityCustomValuesRegister]
> HKLM,"SYSTEM\CurrentControlSet\Proximity\","Dummy",0x00000010,0
>
>
> [NxpNfpProviderProximityCustomValuesRegister.Security]
> "D:P(A;OICI;GA;;;LS)(A;;GA;;;BA)(A;;GA;;;SY)"
>
> [WUDFRD_ServiceInstall]
> DisplayName=%WudfRdDisplayName%
> ServiceType=1
> StartType=3
> ErrorControl=1
> ServiceBinary=%12%\WUDFRd.sys
>
> [CoInstallers_AddReg]
> HKR,,CoInstallers32,0x00010000,"WUDFCoinstaller.dll"
>
>
> [DestinationDirs]
> UMDriverCopy=12,UMDF ; copy to Drivers\UMDF
> Firmware.CopyFiles=11
>
> [UMDriverCopy]
> NxpNfcClientDriver.dll,,,0x100
>
> [Firmware.CopyFiles]
> NXPPN548FW.DAT
> NXPPN547FW.DAT
>
> [ControlFlags]
> ExcludeFromSelect=*
>
> ; =================== Generic ==================================
>
> [Strings]
> ManufacturerName="NXP Semiconductors"
> DiskName="NxpNfcClientDriver Installation Disk"
> WudfRdDisplayName="NxpNfcClientDriver"
> DeviceName="NxpNfcClientDriver"
>
> - EOT -

[ CC Cristian and Jeremy of NXP ]

What Linux-kernel configs do I need that PN544 I2C NFC driver works?

Additionally, I have set CONFIG_I2C_GPIO=m.

What else is important to be activated?

Thanks.

- Sedat -

Attachment: config-5.1.0-1-amd64-cbl-asmgoto_I2C_GPIO-m
Description: Binary data


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux