NXP

高通NFC移植

2019-07-12 11:33发布

 ------------------------------------------------------------Android-2.3.4----------------------------------------------------------------------------------------------------------------1,Z:gingerbreadsystemcore ootdirinit.rcadd the line: setprop ro.nfc.port I2C ------------------------------2,Z:gingerbreadsystemcore ootdirueventd.rcadd the line: /dev/pn544                0777   root      root ------------------------------3,Z:gingerbreaduild argetproductcore.mka. add the lines:   libnfc    libnfc_jni    Nfc    Tag    //此行暂时不加,此功能未卡模拟NfcSecureElement in the PRODUCT_PACKAGES. b. add the lines:PRODUCT_COPY_FILES :=    frameworks/base/data/etc/android.hardware.nfc.xml:system/etc/permissions/android.hardware.nfc.xml 4,Z:gingerbreadexternallibnfc-nxpincphNfcConfig.h-#define DEFAULT_SESSION           "android7"+#define DEFAULT_SESSION           "android8" -#defineDEFAULT_NFCIP_TARGET_MODE_SUPPORT     0x0FU+#defineDEFAULT_NFCIP_TARGET_MODE_SUPPORT      0x0EU 5,Z:gingerbreadexternallibnfc-nxpAndroid.mkAdd:#add to choose different project based onproduct configLOCAL_CFLAGS += -DCONFIG_VENDOR_PRODUCTLOCAL_CFLAGS += -DCONFIG_$(shell echo -n$(TARGET_HW_BOARD)| tr a-z A-Z)ifneq ($(TARGET_HW_BOARD_VER),)LOCAL_CFLAGS += -DCONFIG_$(shell echo -n$(TARGET_HW_BOARD_VER)| tr a-z A-Z)elseLOCAL_CFLAGS += -DCONFIG_$(shell echo -n$(TARGET_HW_BOARD)| tr a-z A-Z)P1endif  #zhangjl add for nfcifeq ($(TARGET_HW_BOARD),ua9600)LOCAL_CFLAGS += -DNFC_CUSTOM_CONFIG_INCLUDE# libpn544_fw.so: Copy pn544 firmwarelibrary to system/libPRODUCT_COPY_FILES +=$(LOCAL_PATH)/firmware/pn544/libpn544_fw.so:system/lib/libpn544_fw.soelse ifeq ($(TARGET_HW_BOARD),ca9600)LOCAL_CFLAGS += -DNFC_CUSTOM_CONFIG_INCLUDE# libpn544_fw.so: Copy pn544 firmwarelibrary to system/libPRODUCT_COPY_FILES +=$(LOCAL_PATH)/firmware/pn544/libpn544_fw.so:system/lib/libpn544_fw.soelse ifeq ($(TARGET_HW_BOARD),ua6308)LOCAL_CFLAGS += -DNFC_CUSTOM_CONFIG_INCLUDE# libpn544_fw.so: Copy pn544 firmwarelibrary to system/libPRODUCT_COPY_FILES +=$(LOCAL_PATH)/firmware/pn544/libpn544_fw.so:system/lib/libpn544_fw.soendif 6,Add:Z:gingerbreadexternallibnfc-nxpfirmwarepn544libpn544_fw.so 7,Z:gingerbreadexternallibnfc-nxpinc fc_custom_config.h//zhangjl modified for nfc 使用内部时钟#if defined (CONFIG_PROJECT)#define NXP_DEFAULT_INPUT_CLK           0x02U#else#define NXP_DEFAULT_INPUT_CLK           0x00U#endif   ------------------------------------------------------------linux-2.6.36-android----------------------------------------------------------------------------------------------------------------Z:gingerbreadkernelarcharmmach-msmoard-ua9600.c1. add theline: #ifdefCONFIG_PN544_NFC_WPG#include#include #endif2. add thelines://zhangjl add for pn544#ifdef CONFIG_PN544_NFC_WPG static struct pn544_i2c_platform_datapn544_pdata = {       .irq_gpio= 38,//NFC_IRQ,       .ven_gpio= 33,//NFC_EN,       .firm_gpio= 49,//NFC_FIRM,};  static struct i2c_board_info i2c_nfc_devices[]__initdata = {       {              I2C_BOARD_INFO("pn544", 0x28),              .irq = MSM_GPIO_TO_INT(38),//IRQ_EINT(38)              .platform_data = &pn544_pdata,       },           };  #endif3,Add#ifdef CONFIG_PN544_NFC_WPGstatic void __init msm7x27_init_nfc(void){       //zhangjladd for nfc       gpio_tlmm_config(GPIO_CFG(49,0,                                   GPIO_CFG_OUTPUT,GPIO_CFG_NO_PULL,                                   GPIO_CFG_2MA),GPIO_CFG_ENABLE);       gpio_tlmm_config(GPIO_CFG(33,0,                                   GPIO_CFG_OUTPUT,GPIO_CFG_NO_PULL,                                   GPIO_CFG_2MA),GPIO_CFG_ENABLE);}#endif4,add       #ifdefCONFIG_PN544_NFC_WPG              msm7x27_init_nfc();       #endif5,add#ifdef CONFIG_PN544_NFC_WPG       i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,                     i2c_nfc_devices,                     ARRAY_SIZE(i2c_nfc_devices));#endif  ------------------------------add the files below:Z:gingerbreadkerneldrivers fcpn544_wpg.c Z:gingerbreadkernelincludelinux fcpn544_wpg.h Z:gingerbreadkerneldrivers fcKconfigAdd:#zhangjl add for wpg nfc  config PN544_NFC_WPG       tristate"WPG PN544 NFC driver"       dependson I2C       selectCRC_CCITT       defaultn       ---help---         Say yes if you want WPG PN544 Near FieldCommunication driver.         This is for i2c connected version. If unsure,say N here.          To compile this driver as a module, choose mhere. The module will         be called pn544.Z:gingerbreadkerneldrivers fcMakefileAdd:#zhangjl add for wpg nfc  obj-$(CONFIG_PN544_NFC_WPG)           +=pn544_wpg.o    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////以下为卡模拟补丁,暂时不需要打///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2.Z:gingerbreadframework/basepatch-p1<1-Patch-to-add-Nfc-Secure-Element-APIs.patch 3.Z:gingerbreadpackages/apps/Nfcpatch-p1<1-Patch-to-update-Secure-Element-management-in-the-Nfc.patch 4.Z:gingerbreadpackages/appscopy NfcSecureElement