diff --git a/BoardConfig.mk b/BoardConfig.mk index 47c1acc..4737c2b 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -176,6 +176,7 @@ TARGET_RECOVERY_QCOM_RTC_FIX := true # Nfc BOARD_NFC_HAL_SUFFIX := w7 +BOARD_NFC_CHIPSET := pn547 # SELinux BOARD_SEPOLICY_DIRS += \ diff --git a/device_w7.mk b/device_w7.mk index cc1feb5..6976eb3 100644 --- a/device_w7.mk +++ b/device_w7.mk @@ -46,7 +46,8 @@ PRODUCT_COPY_FILES += \ frameworks/native/data/etc/android.hardware.audio.low_latency.xml:system/etc/permissions/android.hardware.audio.low_latency.xml \ frameworks/native/data/etc/android.hardware.bluetooth_le.xml:system/etc/permissions/android.hardware.bluetooth_le.xml \ frameworks/native/data/etc/android.hardware.nfc.xml:system/etc/permissions/android.hardware.nfc.xml \ - frameworks/native/data/etc/android.hardware.nfc.hce.xml:system/etc/permissions/android.hardware.nfc.hce.xml + frameworks/native/data/etc/android.hardware.nfc.hce.xml:system/etc/permissions/android.hardware.nfc.hce.xml \ + frameworks/native/data/etc/com.android.nfc_extras.xml:system/etc/permissions/com.android.nfc_extras.xml # Configs PRODUCT_COPY_FILES += \ @@ -81,6 +82,8 @@ PRODUCT_COPY_FILES += \ device/lge/w7/prebuilt/etc/izat.conf:system/etc/izat.conf \ device/lge/w7/prebuilt/etc/boot_fixup:system/etc/boot_fixup \ device/lge/w7/prebuilt/etc/libnfc-brcm.conf:system/etc/libnfc-brcm.conf \ + device/lge/w7/prebuilt/etc/nfc-nci.conf:system/etc/nfc-nci.conf \ + device/lge/w7/prebuilt/etc/libnfc-nxp.conf:system/etc/libnfc-nxp.conf \ device/lge/w7/prebuilt/etc/nfcee_access.xml:system/etc/nfcee_access.xml \ device/lge/w7/prebuilt/etc/quipc.conf:system/etc/quipc.conf \ device/lge/w7/prebuilt/etc/init.d/10nfc_checker:system/etc/init.d/10nfc_checker @@ -357,10 +360,10 @@ PRODUCT_PROPERTY_OVERRIDES += \ # NFC packages PRODUCT_PACKAGES += \ - nfc.default \ - libnfc \ - libnfc_jni \ - Nfc + NfcNci \ + Tag \ + nfc_nci.w7 \ + com.android.nfc_extras NFCEE_ACCESS_PATH := device/lge/w7/prebuilt/etc/nfcee_access.xml diff --git a/prebuilt/etc/init.d/10nfc_checker b/prebuilt/etc/init.d/10nfc_checker index 4916be1..a38fc91 100644 --- a/prebuilt/etc/init.d/10nfc_checker +++ b/prebuilt/etc/init.d/10nfc_checker @@ -6,5 +6,7 @@ if [ "$model" = "LG-D410" ] || ["$model" = "LG-D405" ] || ["$model" = "LG-D405n mount -o remount,rw /system rm -rf /system/etc/permissions/android.hardware.nfc.xml rm -rf /system/etc/permissions/android.hardware.nfc.hce.xml + rm -rf /system/lib/hw/nfc_nci.w7.so + rm -rf /system/app/NfcNci.apk mount -o remount,ro /system fi diff --git a/prebuilt/etc/libnfc-brcm.conf b/prebuilt/etc/libnfc-brcm.conf index d0dbf1e..ce161b0 100644 --- a/prebuilt/etc/libnfc-brcm.conf +++ b/prebuilt/etc/libnfc-brcm.conf @@ -1,90 +1,313 @@ -## this file is used by NFC Hardware Abstraction Layer at external/libnfc-nci/halimpl/ +## this file is used by Broadcom's Hardware Abstraction Layer at external/libnfc-nci/halimpl/ ############################################################################### -#chip hardware version -#supported features -NFC_BUILD_ID = V2.1.S.01.01.01.01.1105000707.1112132050 -# Application logging mask -APPL_TRACE_LEVEL=0x00 -PROTOCOL_TRACE_LEVEL=0x00000000 +# Application options +APPL_TRACE_LEVEL=0xFF +PROTOCOL_TRACE_LEVEL=0xFFFFFFFF -##################################################################################### +############################################################################### +# performance measurement +# Change this setting to control how often USERIAL log the performance (throughput) +# data on read/write/poll +# defailt is to log performance dara for every 100 read or write +#REPORT_PERFORMANCE_MEASURE=100 + +############################################################################### # File used for NFA storage NFA_STORAGE="/data/nfc" +############################################################################### +# Snooze Mode Settings +# +# By default snooze mode is enabled. Set SNOOZE_MODE_CFG byte[0] to 0 +# to disable. +# +# If SNOOZE_MODE_CFG is not provided, the default settings are used: +# They are as follows: +# 8 Sleep Mode (0=Disabled 1=UART 8=SPI/I2C) +# 0 Idle Threshold Host +# 0 Idle Threshold HC +# 0 NFC Wake active mode (0=ActiveLow 1=ActiveHigh) +# 1 Host Wake active mode (0=ActiveLow 1=ActiveHigh) +# +#SNOOZE_MODE_CFG={08:00:00:00:01} + +############################################################################### +# Insert a delay in milliseconds after NFC_WAKE and before write to NFCC NFC_WAKE_DELAY=20 -#default -NFA_DM_START_UP_CFG={17:80:01:00:08:01:01:11:01:01:AF:02:00:07:AF:02:01:07:C0:01:01:BF:01:02} -##################################################################################### -# listen to the following technology(s). -# The bits are defined as tNFA_TECHNOLOGY_MASK in nfa_api.h. -# Default is NFA_TECHNOLOGY_MASK_A | NFA_TECHNOLOGY_MASK_B. +############################################################################### +# Various Delay settings (in ms) used in USERIAL +# POWER_ON_DELAY +# Delay after turning on chip, before writing to transport (default 300) +# PRE_POWER_OFF_DELAY +# Delay after deasserting NFC-Wake before turn off chip (default 0) +# POST_POWER_OFF_DELAY +# Delay after turning off chip, before USERIAL_close returns (default 0) +# +#POWER_ON_DELAY=300 +#PRE_POWER_OFF_DELAY=0 +#POST_POWER_OFF_DELAY=0 -UICC_LISTEN_TECH_MASK=0x07 -# Protocol mask for NFC-A technology protocols(T1T,T2T and 4A). -# The bits (for NFC A protocol mask)are defined in nfa_api.h. -# Default is T4AT -# 0x01- T1T, 0x02- T2T, 0x04- T4AT -NFCA_PROTOCOL_MASK=0x04 ############################################################################### -# Force tag polling for the following technology(s). -# The bits are defined as tNFA_TECHNOLOGY_MASK in nfa_api.h. -# Default is NFA_TECHNOLOGY_MASK_A | NFA_TECHNOLOGY_MASK_B | -# NFA_TECHNOLOGY_MASK_F | NFA_TECHNOLOGY_MASK_ISO15693 | -# NFA_TECHNOLOGY_MASK_B_PRIME | NFA_TECHNOLOGY_MASK_A_ACTIVE | -# NFA_TECHNOLOGY_MASK_F_ACTIVE. +# LPTD mode configuration +# byte[0] is the length of the remaining bytes in this value +# if set to 0, LPTD params will NOT be sent to NFCC (i.e. disabled). +# byte[1] is the param id it should be set to B9. +# byte[2] is the length of the LPTD parameters +# byte[3] indicates if LPTD is enabled +# if set to 0, LPTD will be disabled (parameters will still be sent). +# byte[4-n] are the LPTD parameters. +# By default, LPTD is enabled and default settings are used. +# See nfc_hal_dm_cfg.c for defaults +LPTD_CFG={23:B9:21:01:02:FF:FF:04:A0:0F:40:00:80:02:02:10:00:00:00:31:0C:30:00:00:00:00:00:00:00:00:00:00:00:00:00:00} + +############################################################################### +# Startup Configuration (100 bytes maximum) +# +# For the 0xCA parameter, byte[9] (marked by 'AA') is for UICC0, and byte[10] (marked by BB) is +# for UICC1. The values are defined as: +# 0 : UICCx only supports ISO_DEP in low power mode. +# 2 : UICCx only supports Mifare in low power mode. +# 3 : UICCx supports both ISO_DEP and Mifare in low power mode. # -# 0x01- A, 0x02- B, 0x04- F, 0x20- Kovio -POLLING_TECH_MASK=0x27 +# AA BB +NFA_DM_START_UP_CFG={1F:CB:01:01:A5:01:01:CA:14:00:00:00:00:06:E8:03:00:00:00:00:00:00:00:00:00:00:00:00:00:80:01:01} -# Force P2P to only listen for the following technology(s). +############################################################################### +# Startup Vendor Specific Configuration (100 bytes maximum); +# byte[0] TLV total len = 0x5 +# byte[1] NCI_MTS_CMD|NCI_GID_PROP = 0x2f +# byte[2] NCI_MSG_FRAME_LOG = 0x9 +# byte[3] 2 +# byte[4] 0=turn off RF frame logging; 1=turn on +# byte[5] 0=turn off SWP frame logging; 1=turn on +# NFA_DM_START_UP_VSC_CFG={05:2F:09:02:01:01} + +############################################################################### +# Antenna Configuration - This data is used when setting 0xC8 config item +# at startup (before discovery is started). If not used, no value is sent. +# +# The settings for this value are documented here: +# http://wcgbu.broadcom.com/wpan/PM/Project%20Document%20Library/bcm20791B0/ +# Design/Doc/PHY%20register%20settings/BCM20791-B2-1027-02_PHY_Recommended_Reg_Settings.xlsx +# This document is maintained by Paul Forshaw. +# +# The values marked as ?? should be tweaked per antenna or customer/app: +# {20:C8:1E:06:??:00:??:??:??:00:??:24:00:1C:00:75:00:77:00:76:00:1C:00:03:00:0A:00:??:01:00:00:40:04} +# array[0] = 0x20 is length of the payload from array[1] to the end +# array[1] = 0xC8 is PREINIT_DSP_CFG +#PREINIT_DSP_CFG={20:C8:1E:06:1F:00:0F:03:3C:00:04:24:00:1C:00:75:00:77:00:76:00:1C:00:03:00:0A:00:48:01:00:00:40:04} + +############################################################################### +# Configure crystal frequency when internal LPO can't detect the frequency. +#XTAL_FREQUENCY=0 +############################################################################### +# Configure the default Destination Gate used by HCI (the default is 4, which +# is the ETSI loopback gate. +NFA_HCI_DEFAULT_DEST_GATE=0xF0 + +############################################################################### +# Configure the single default SE to use. The default is to use the first +# SE that is detected by the stack. This value might be used when the phone +# supports multiple SE (e.g. 0xF3 and 0xF4) but you want to force it to use +# one of them (e.g. 0xF4). +#ACTIVE_SE=0xF3 + +############################################################################### +# Configure the NFC Extras to open and use a static pipe. If the value is +# not set or set to 0, then the default is use a dynamic pipe based on a +# destination gate (see NFA_HCI_DEFAULT_DEST_GATE). Note there is a value +# for each UICC (where F3="UICC0" and F4="UICC1") +#NFA_HCI_STATIC_PIPE_ID_F3=0x70 +#NFA_HCI_STATIC_PIPE_ID_01=0x19 +NFA_HCI_STATIC_PIPE_ID_C0=0x19 +############################################################################### +# When disconnecting from Oberthur secure element, perform a warm-reset of +# the secure element to deselect the applet. +# The default hex value of the command is 0x3. If this variable is undefined, +# then this feature is not used. +OBERTHUR_WARM_RESET_COMMAND=0x03 + +############################################################################### +# Force UICC to only listen to the following technology(s). # The bits are defined as tNFA_TECHNOLOGY_MASK in nfa_api.h. -# Default is NFA_TECHNOLOGY_MASK_A | NFA_TECHNOLOGY_MASK_F | -# NFA_TECHNOLOGY_MASK_A_ACTIVE | NFA_TECHNOLOGY_MASK_F_ACTIVE -# 0x01- NFC DEP A , 0x04:- NFC DEP F -P2P_LISTEN_TECH_MASK=0x05 +# Default is NFA_TECHNOLOGY_MASK_A | NFA_TECHNOLOGY_MASK_B | NFA_TECHNOLOGY_MASK_F +UICC_LISTEN_TECH_MASK=0xC7 + +############################################################################### +# Allow UICC to be powered off if there is no traffic. +# Timeout is in ms. If set to 0, then UICC will not be powered off. +#UICC_IDLE_TIMEOUT=30000 +UICC_IDLE_TIMEOUT=0 + +############################################################################### +# AID for Empty Select command +# If specified, this AID will be substituted when an Empty SELECT command is +# detected. The first byte is the length of the AID. Maximum length is 16. +AID_FOR_EMPTY_SELECT={08:A0:00:00:01:51:00:00:00} +############################################################################### +# Maximum Number of Credits to be allowed by the NFCC +# This value overrides what the NFCC specifices allowing the host to have +# the control to work-around transport limitations. If this value does +# not exist or is set to 0, the NFCC will provide the number of credits. +MAX_RF_DATA_CREDITS=1 + +############################################################################### +# This setting allows you to disable registering the T4t Virtual SE that causes +# the NFCC to send PPSE requests to the DH. +# The default setting is enabled (i.e. T4t Virtual SE is registered). +#REGISTER_VIRTUAL_SE=1 + +############################################################################### +# When screen is turned off, specify the desired power state of the controller. +# 0: power-off-sleep state; DEFAULT +# 1: full-power state +# 2: screen-off card-emulation (CE4/CE3/CE1 modes are used) +SCREEN_OFF_POWER_STATE=1 ############################################################################### # Firmware patch file # If the value is not set then patch download is disabled. -FW_PATCH="/system/etc/firmware/Signedrompatch.bin" +FW_PATCH="/vendor/firmware/bcm2079x_firmware.ncd" + ############################################################################### -# Firmware patch file -#FW_PRE_PATCH="/system/etc/firmware/Signedromprepatch.bin" -NVM_FILE_PATH="/system/etc/firmware/nfc_test.bin" -FUSED_NVM_FILE_PATH="/system/etc/firmware/fused_nvm.bin" +# Firmware pre-patch file (sent before the above patch file) +# If the value is not set then pre-patch is not used. +FW_PRE_PATCH="/vendor/firmware/bcm2079x_pre_firmware.ncd" + +############################################################################### +# Firmware patch format +# 1 = HCD +# 2 = NCD (default) +#NFA_CONFIG_FORMAT=2 + +############################################################################### +# SPD Debug mode +# If set to 1, any failure of downloading a patch will trigger a hard-stop +#SPD_DEBUG=0 + ############################################################################### +# SPD Max Retry Count +# The number of attempts to download a patch before giving up (defualt is 3). +# Note, this resets after a power-cycle. +#SPD_MAX_RETRY_COUNT=3 +############################################################################### +# transport driver +# +# TRANSPORT_DRIVER= # -TRANSPORT_DRIVER="/dev/nfc-nci" +# where can be, for example: +# "/dev/ttyS" (UART) +# "/dev/bcmi2cnfc" (I2C) +# "hwtun" (HW Tunnel) +# "/dev/bcmspinfc" (SPI) +# "/dev/btusb0" (BT USB) +TRANSPORT_DRIVER="/dev/bcm2079x" ############################################################################### # power control driver +# Specify a kernel driver that support ioctl commands to control NFC_EN and +# NFC_WAKE gpio signals. +# +# POWER_CONTRL_DRIVER= +# where can be, for example: +# "/dev/nfcpower" +# "/dev/bcmi2cnfc" (I2C) +# "/dev/bcmspinfc" (SPI) +# i2c and spi driver may be used to control NFC_EN and NFC_WAKE signal +POWER_CONTROL_DRIVER="/dev/bcm2079x" -POWER_CONTROL_DRIVER="/dev/nfc-nci" +############################################################################### +# I2C transport driver options +# +BCMI2CNFC_ADDRESS=0 ############################################################################### -# Maximum Number of Credits to be allowed by the NFCC -MAX_RF_DATA_CREDITS=1 +# I2C transport driver try to read multiple packets in read() if data is available +# remove the comment below to enable this feature +#READ_MULTIPLE_PACKETS=1 + ############################################################################### -#Patch and nvm update flags -# These flags needs to be set to enable the patch update and nvm update mechanism -# of middleware +# SPI transport driver options +#SPI_NEGOTIATION={0A:F0:00:01:00:00:00:FF:FF:00:00} + +############################################################################### +# UART transport driver options +# +# PORT=1,2,3,... +# BAUD=115200, 19200, 9600, 4800, +# DATABITS=8, 7, 6, 5 +# PARITY="even" | "odd" | "none" +# STOPBITS="0" | "1" | "1.5" | "2" + +#UART_PORT=2 +#UART_BAUD=115200 +#UART_DATABITS=8 +#UART_PARITY="none" +#UART_STOPBITS="1" + ############################################################################### -PATCH_UPDATE_ENABLE_FLAG=0x01 -NVM_UPDATE_ENABLE_FLAG=0x00 -FUSED_NVM_UPDATE_ENABLE_FLAG=0x00 -PM_ENABLE_FLAG=0x01 -SCREEN_OFF_POWER_STATE=0x01 +# Insert a delay in microseconds per byte after a write to NFCC. +# after writing a block of data to the NFCC, delay this an amopunt of time before +# writing next block of data. the delay is calculated as below +# NFC_WRITE_DELAY * (number of byte written) / 1000 milliseconds +# e.g. after 259 bytes is written, delay (259 * 20 / 1000) 5 ms before next write +NFC_WRITE_DELAY=20 + ############################################################################### -# Time out value for closing the connection opened for patch download +# Maximum Number of Credits to be allowed by the NFCC +# This value overrides what the NFCC specifices allowing the host to have +# the control to work-around transport limitations. If this value does +# not exist or is set to 0, the NFCC will provide the number of credits. +MAX_RF_DATA_CREDITS=1 + ############################################################################### -PATCH_DNLD_NFC_HAL_CMD_TOUT=4000 -PATCH_VERSION=21 +# Antenna Configuration - This data is used when setting 0xC8 config item +# at startup (before discovery is started). If not used, no value is sent. +# +# The settings for this value are documented here: +# http://wcgbu.broadcom.com/wpan/PM/Project%20Document%20Library/bcm20791B0/ +# Design/Doc/PHY%20register%20settings/BCM20791-B2-1027-02_PHY_Recommended_Reg_Settings.xlsx +# This document is maintained by Paul Forshaw. +# +# The values marked as ?? should be tweaked per antenna or customer/app: +# {20:C8:1E:06:??:00:??:??:??:00:??:24:00:1C:00:75:00:77:00:76:00:1C:00:03:00:0A:00:??:01:00:00:40:04} +# array[0] = 0x20 is length of the payload from array[1] to the end +# array[1] = 0xC8 is PREINIT_DSP_CFG +#PREINIT_DSP_CFG={20:C8:1E:06:1F:00:0F:03:3C:00:04:24:00:1C:00:75:00:77:00:76:00:1C:00:03:00:0A:00:48:01:00:00:40:04} + + ############################################################################### -#Default listen mode routing table -# This is the default listen mode routing configuration for NFCC. -# Default is for ISO DEP and NFC DEP -DEFAULT_LISTEN_MODE_ROUTING={00:02:0A:01:03:01:01:04:01:03:00:01:05} +# Force tag polling for the following technology(s). +# The bits are defined as tNFA_TECHNOLOGY_MASK in nfa_api.h. +# Default is NFA_TECHNOLOGY_MASK_A | NFA_TECHNOLOGY_MASK_B | +# NFA_TECHNOLOGY_MASK_F | NFA_TECHNOLOGY_MASK_ISO15693 | +# NFA_TECHNOLOGY_MASK_B_PRIME | NFA_TECHNOLOGY_MASK_KOVIO | +# NFA_TECHNOLOGY_MASK_A_ACTIVE | NFA_TECHNOLOGY_MASK_F_ACTIVE. +# +# Notable bits: +# NFA_TECHNOLOGY_MASK_A 0x01 /* NFC Technology A */ +# NFA_TECHNOLOGY_MASK_B 0x02 /* NFC Technology B */ +# NFA_TECHNOLOGY_MASK_F 0x04 /* NFC Technology F */ +# NFA_TECHNOLOGY_MASK_ISO15693 0x08 /* Proprietary Technology */ +# NFA_TECHNOLOGY_MASK_KOVIO 0x20 /* Proprietary Technology */ +# NFA_TECHNOLOGY_MASK_A_ACTIVE 0x40 /* NFC Technology A active mode */ +# NFA_TECHNOLOGY_MASK_F_ACTIVE 0x80 /* NFC Technology F active mode */ +POLLING_TECH_MASK=0xEF + ############################################################################### +# Force P2P to only listen for the following technology(s). +# The bits are defined as tNFA_TECHNOLOGY_MASK in nfa_api.h. +# Default is NFA_TECHNOLOGY_MASK_A | NFA_TECHNOLOGY_MASK_F | +# NFA_TECHNOLOGY_MASK_A_ACTIVE | NFA_TECHNOLOGY_MASK_F_ACTIVE +# +# Notable bits: +# NFA_TECHNOLOGY_MASK_A 0x01 /* NFC Technology A */ +# NFA_TECHNOLOGY_MASK_F 0x04 /* NFC Technology F */ +# NFA_TECHNOLOGY_MASK_A_ACTIVE 0x40 /* NFC Technology A active mode */ +# NFA_TECHNOLOGY_MASK_F_ACTIVE 0x80 /* NFC Technology F active mode */ +P2P_LISTEN_TECH_MASK=0xC4 + +PRESERVE_STORAGE=0x01 diff --git a/prebuilt/etc/libnfc-nxp.conf b/prebuilt/etc/libnfc-nxp.conf new file mode 100644 index 0000000..2972add --- /dev/null +++ b/prebuilt/etc/libnfc-nxp.conf @@ -0,0 +1,338 @@ +## This file is used by NFC NXP NCI HAL(external/libnfc-nci/halimpl/pn547) +## and NFC Service Java Native Interface Extensions (packages/apps/Nfc/nci/jni/extns/pn547) + +############################################################################### +# Application options +# Logging Levels +# NXPLOG_DEFAULT_LOGLEVEL 0x01 +# ANDROID_LOG_DEBUG 0x03 +# ANDROID_LOG_WARN 0x02 +# ANDROID_LOG_ERROR 0x01 +# ANDROID_LOG_SILENT 0x00 +# +NXPLOG_EXTNS_LOGLEVEL=0x03 +NXPLOG_NCIHAL_LOGLEVEL=0x03 +NXPLOG_NCIX_LOGLEVEL=0x03 +NXPLOG_NCIR_LOGLEVEL=0x03 +NXPLOG_FWDNLD_LOGLEVEL=0x03 +NXPLOG_TML_LOGLEVEL=0x03 + +############################################################################### +# Extension for Mifare reader enable +# 0x00 - Disabled +# 0x01 - Enabled +MIFARE_READER_ENABLE=0x01 + +############################################################################### +# File location for Firmware +#FW_STORAGE="/vendor/firmware/libpn547_fw.so" + +############################################################################### +# System clock source selection configuration +# CLK_SRC_XTAL - 0x01 +# CLK_SRC_PLL - 0x02 +NXP_SYS_CLK_SRC_SEL=0x02 + +############################################################################### +# System clock frequency selection configuration for PLL +# CLK_FREQ_13MHZ - 0x01 +# CLK_FREQ_19_2MHZ - 0x02 +# CLK_FREQ_24MHZ - 0x03 +# CLK_FREQ_26MHZ - 0x04 +# CLK_FREQ_38_4MHZ - 0x05 +# CLK_FREQ_52MHZ - 0x06 +NXP_SYS_CLK_FREQ_SEL=0x02 + +############################################################################### +# The timeout value to be used for clock request acknowledgment +# min value = 0x01 to max = 0x0A +NXP_SYS_CLOCK_TO_CFG=0x02 + +############################################################################### +# NXP proprietary settings +NXP_ACT_PROP_EXTN={2F, 02, 00} + +############################################################################### +# NFC forum profile settings +NXP_NFC_PROFILE_EXTN={20, 02, 05, 01, A0, 44, 01, 00} +############################################################################### +# Standby enable settings +# 0x00 - Disabled +# 0x01 - Enabled +NXP_CORE_STANDBY={2F, 00, 01, 01} + +############################################################################### +# NXP RF configuration settings for ALM/PLM settings +NXP_RF_CONF_BLK_1={ + 20, 02, F7, 21, + A0, 0E, 01, 01, + A0, 0D, 03, 00, 40, 04, + A0, 0D, 03, 04, 43, 20, + A0, 0D, 03, 04, FF, 05, + A0, 0D, 06, 06, 44, A3, 90, 03, 00, + A0, 0D, 06, 06, 30, CF, 00, 08, 00, + A0, 0D, 06, 06, 2F, 8F, 05, 80, 0C, + A0, 0D, 04, 06, 03, 00, 6E, + A0, 0D, 03, 06, 48, 1A, + A0, 0D, 03, 06, 43, A0, + A0, 0D, 06, 06, 42, 00, 00, F6, FA, + A0, 0D, 06, 06, 41, 80, 00, 00, 00, + A0, 0D, 03, 06, 37, 18, + A0, 0D, 03, 06, 16, 00, + A0, 0D, 03, 06, 15, 00, + A0, 0D, 06, 06, FF, 05, 00, 00, 00, + A0, 0D, 06, 08, 44, 00, 00, 00, 00, + A0, 0D, 06, 20, 4A, 00, 00, 00, 00, + A0, 0D, 06, 20, 42, 88, 10, FF, FF, + A0, 0D, 03, 20, 16, 00, + A0, 0D, 03, 20, 15, 00, + A0, 0D, 06, 22, 44, 22, 00, 02, 00, + A0, 0D, 06, 22, 2D, 50, 44, 0C, 00, + A0, 0D, 04, 32, 03, 40, 3D, + A0, 0D, 06, 32, 42, 00, 00, FF, FF, + A0, 0D, 03, 32, 16, 00, + A0, 0D, 03, 32, 15, 01, + A0, 0D, 03, 32, 0D, 22, + A0, 0D, 03, 32, 14, 22, + A0, 0D, 06, 32, 4A, 30, 0F, 01, 1F, + A0, 0D, 06, 34, 2D, 24, 77, 0C, 00, + A0, 0D, 06, 34, 44, 21, 00, 02, 00, + A0, 0D, 06, 35, 44, 21, 00, 02, 00 +} + +NXP_RF_CONF_BLK_2={ + 20, 02, F4, 1F, + A0, 0D, 06, 38, 4A, 53, 07, 01, 1B, + A0, 0D, 06, 38, 42, 68, 10, FF, FF, + A0, 0D, 03, 38, 16, 00, + A0, 0D, 03, 38, 15, 00, + A0, 0D, 06, 3A, 2D, 15, 47, 0D, 00, + A0, 0D, 06, 3C, 4A, 52, 07, 01, 1B, + A0, 0D, 06, 3C, 42, 68, 10, FF, FF, + A0, 0D, 03, 3C, 16, 00, + A0, 0D, 03, 3C, 15, 00, + A0, 0D, 06, 3E, 2D, 15, 47, 0D, 00, + A0, 0D, 06, 40, 42, F0, 10, FF, FF, + A0, 0D, 03, 40, 0D, 02, + A0, 0D, 03, 40, 14, 02, + A0, 0D, 06, 40, 4A, 12, 07, 00, 00, + A0, 0D, 03, 40, 16, 00, + A0, 0D, 03, 40, 15, 00, + A0, 0D, 06, 42, 2D, 15, 47, 0D, 00, + A0, 0D, 06, 46, 44, 21, 00, 02, 00, + A0, 0D, 06, 46, 2D, 05, 47, 0E, 00, + A0, 0D, 06, 44, 4A, 33, 07, 01, 07, + A0, 0D, 06, 44, 42, 88, 10, FF, FF, + A0, 0D, 03, 44, 16, 00, + A0, 0D, 03, 44, 15, 00, + A0, 0D, 06, 4A, 44, 22, 00, 02, 00, + A0, 0D, 06, 4A, 2D, 05, 37, 0C, 00, + A0, 0D, 06, 48, 4A, 33, 07, 01, 07, + A0, 0D, 06, 48, 42, 88, 10, FF, FF, + A0, 0D, 03, 48, 16, 00, + A0, 0D, 03, 48, 15, 00, + A0, 0D, 06, 4E, 44, 22, 00, 02, 00, + A0, 0D, 06, 4E, 2D, 05, 37, 0C, 00 +} +NXP_RF_CONF_BLK_3={ + 20, 02, F7, 1E, + A0, 0D, 06, 4C, 4A, 33, 07, 01, 07, + A0, 0D, 06, 4C, 42, 88, 10, FF, FF, + A0, 0D, 03, 4C, 16, 00, + A0, 0D, 03, 4C, 15, 00, + A0, 0D, 06, 52, 44, 22, 00, 02, 00, + A0, 0D, 06, 52, 2D, 05, 25, 0C, 00, + A0, 0D, 06, 50, 42, 90, 10, FF, FF, + A0, 0D, 06, 50, 4A, 11, 0F, 01, 07, + A0, 0D, 03, 50, 16, 00, + A0, 0D, 03, 50, 15, 00, + A0, 0D, 06, 56, 2D, 05, 9E, 0C, 00, + A0, 0D, 06, 56, 44, 22, 00, 02, 00, + A0, 0D, 06, 5C, 2D, 05, 69, 0C, 00, + A0, 0D, 06, 5C, 44, 21, 00, 02, 00, + A0, 0D, 06, 54, 42, 88, 10, FF, FF, + A0, 0D, 06, 54, 4A, 33, 07, 01, 07, + A0, 0D, 03, 54, 16, 00, + A0, 0D, 03, 54, 15, 00, + A0, 0D, 06, 5A, 42, 90, 10, FF, FF, + A0, 0D, 06, 5A, 4A, 31, 07, 01, 07, + A0, 0D, 03, 5A, 16, 00, + A0, 0D, 03, 5A, 15, 00, + A0, 0D, 06, 98, 2F, AF, 05, 80, 0F, + A0, 0D, 06, 9A, 42, 00, 00, FF, FF, + A0, 0D, 06, 30, 44, A3, 90, 03, 00, + A0, 0D, 06, 6C, 44, A3, 90, 03, 00, + A0, 0D, 06, 6C, 30, CF, 00, 08, 00, + A0, 0D, 06, 6C, 2F, 8F, 05, 80, 0C, + A0, 0D, 06, 70, 2F, 8F, 05, 80, 12, + A0, 0D, 06, 70, 30, CF, 00, 08, 00 +} +NXP_RF_CONF_BLK_4={ + 20, 02, F7, 1E, + A0, 0D, 06, 74, 2F, 8F, 05, 80, 12, + A0, 0D, 06, 74, 30, DF, 00, 07, 00, + A0, 0D, 06, 78, 2F, 1F, 06, 80, 01, + A0, 0D, 06, 78, 30, 3F, 00, 04, 00, + A0, 0D, 06, 78, 44, A2, 90, 03, 00, + A0, 0D, 03, 78, 47, 00, + A0, 0D, 06, 7C, 2F, AF, 05, 80, 0F, + A0, 0D, 06, 7C, 30, CF, 00, 07, 00, + A0, 0D, 06, 7C, 44, A3, 90, 03, 00, + A0, 0D, 06, 7D, 30, CF, 00, 08, 00, + A0, 0D, 06, 80, 2F, AF, 05, 80, 90, + A0, 0D, 06, 80, 44, A3, 90, 03, 00, + A0, 0D, 06, 84, 2F, AF, 05, 80, 92, + A0, 0D, 06, 84, 44, A3, 90, 03, 00, + A0, 0D, 06, 88, 2F, 7F, 04, 80, 10, + A0, 0D, 06, 88, 30, 5F, 00, 16, 00, + A0, 0D, 03, 88, 47, 00, + A0, 0D, 06, 88, 44, A1, 90, 03, 00, + A0, 0D, 03, 0C, 48, 1A, + A0, 0D, 03, 10, 43, 20, + A0, 0D, 06, 6A, 42, F8, 10, FF, FF, + A0, 0D, 03, 6A, 16, 00, + A0, 0D, 03, 6A, 15, 01, + A0, 0D, 06, 6A, 4A, 30, 0F, 01, 1F, + A0, 0D, 06, 8C, 42, 88, 10, FF, FF, + A0, 0D, 06, 8C, 4A, 33, 07, 01, 07, + A0, 0D, 03, 8C, 16, 00, + A0, 0D, 03, 8C, 15, 00, + A0, 0D, 06, 92, 42, 90, 10, FF, FF, + A0, 0D, 06, 92, 4A, 31, 07, 01, 07 +} + +############################################################################### +# Core configuration extensions +# It includes +# A002 - Clock Request +# 0x00 - Disabled +# 0x01 - Enabled +# A003 - Clock Selection +# Please refer to User Manual +# A004 - Clock Time Out +# Defined in ms +# A00E - Load Modulation Mode +# 0x00 - PLM +# 0x01 - ALM +# A012 - SWP interface 2 configuration +# 0x00 - SWP +# 0x02 - DWP +# Please refer to User Manual +# A040-A043 - Ultra Low Power Tag Detector +# Please refer to Application Note of ULPTD +# A05E - Jewel Reader +# Please refer to User Manual +# A0CD - SWP S1 line behavior +# Defined S1 High time out during Activation sequence +# A0EC - SWP1 interface +# 0x00 - Disabled +# 0x01 - Enabled +# A0ED - SWP2 interface +# 0x00 - Disabled +# 0x01 - Enabled +NXP_CORE_CONF_EXTN_PM={20, 02, 30, 0B, + A0, 02, 01, 01, + A0, 03, 01, 11, + A0, 04, 01, 02, + A0, 06, 01, 01, + A0, 11, 04, CD, 67, 22, 01, + A0, 5E, 01, 01, + A0, CD, 01, 0F, + A0, EC, 01, 01, + A0, ED, 01, 00, + A0, CB, 01, 78, + A0, CE, 01, 7F +} + +NXP_CORE_CONF_EXTN_XTAL={20, 02, 30, 0B, + A0, 02, 01, 00, + A0, 03, 01, 08, + A0, 04, 01, 02, + A0, 06, 01, 01, + A0, 11, 04, 14, 0B, B8, 14, + A0, 5E, 01, 01, + A0, CD, 01, 0F, + A0, EC, 01, 01, + A0, ED, 01, 00, + A0, CB, 01, 78, + A0, CE, 01, 7F +} + +NXP_CORE_CONF_EXTN={20, 02, 2C, 0A, + A0, 02, 01, 01, + A0, 03, 01, 11, + A0, 04, 01, 02, + A0, 11, 04, CD, 67, 22, 01, + A0, 5E, 01, 01, + A0, CD, 01, 0F, + A0, EC, 01, 01, + A0, ED, 01, 00, + A0, CB, 01, 78, + A0, CE, 01, 7F +} + +############################################################################### +# apply Low Power Polling(LPM) Algorithm, detecting RF field using short-term single carrier +# NORMAL Polling : {20, 02, 11, 04, A0, 40, 01, 00, A0, 41, 01, 04, A0, 42, 01, 19, A0, 43, 01, 50} +# LPM Polling : {20, 02, 11, 04, A0, 40, 01, 01, A0, 41, 01, 04, A0, 42, 01, 19, A0, 43, 01, 00} +# HYBRID Polling : {20, 02, 11, 04, A0, 40, 01, 01, A0, 41, 01, 04, A0, 42, 01, 19, A0, 43, 01, 04} + +NXP_POLLING_MODE={20, 02, 11, 04, + A0, 40, 01, 01, + A0, 41, 01, 04, + A0, 42, 01, 19, + A0, 43, 01, 04 +} + +############################################################################### +# Core configuration settings +NXP_CORE_CONF={ 20, 02, 2B, 0D, + 18, 01, 01, + 21, 01, 00, + 28, 01, 00, + 30, 01, 08, + 31, 01, 03, + 33, 04, 01, 02, 03, 04, + 50, 01, 02, + 54, 01, 06, + 5B, 01, 02, + 60, 01, 0E, + 80, 01, 01, + 81, 01, 01, + 82, 01, 0E + } + +############################################################################### +# Mifare Classic Key settings +#NXP_CORE_MFCKEY_SETTING={20, 02, 25,04, A0, 51, 06, A0, A1, A2, A3, A4, A5, +# A0, 52, 06, D3, F7, D3, F7, D3, F7, +# A0, 53, 06, FF, FF, FF, FF, FF, FF, +# A0, 54, 06, 00, 00, 00, 00, 00, 00} + +############################################################################### +# Default SE Options +# No secure element 0x00 +# eSE 0x01 +# UICC 0x02 + +NXP_DEFAULT_SE=0x02 + +############################################################################### +NXP_DEFAULT_NFCEE_TIMEOUT=0x06 + +############################################################################### +#Enable SWP full power mode when phone is power off +NXP_SWP_FULL_PWR_ON=0x00 + +############################################################################### +#Chip type +#PN547C2 0x01 +#PN65T 0x02 +NXP_NFC_CHIP=0x01 + +############################################################################### +#SWP Reader feature +#Timeout in seconds +NXP_SWP_RD_START_TIMEOUT=0x0A +#Timeout in seconds +NXP_SWP_RD_TAG_OP_TIMEOUT=0x01 diff --git a/prebuilt/etc/nfc-nci.conf b/prebuilt/etc/nfc-nci.conf new file mode 100644 index 0000000..d0dbf1e --- /dev/null +++ b/prebuilt/etc/nfc-nci.conf @@ -0,0 +1,90 @@ +## this file is used by NFC Hardware Abstraction Layer at external/libnfc-nci/halimpl/ + +############################################################################### +#chip hardware version +#supported features +NFC_BUILD_ID = V2.1.S.01.01.01.01.1105000707.1112132050 +# Application logging mask +APPL_TRACE_LEVEL=0x00 +PROTOCOL_TRACE_LEVEL=0x00000000 + +##################################################################################### +# File used for NFA storage +NFA_STORAGE="/data/nfc" + +NFC_WAKE_DELAY=20 + +#default +NFA_DM_START_UP_CFG={17:80:01:00:08:01:01:11:01:01:AF:02:00:07:AF:02:01:07:C0:01:01:BF:01:02} +##################################################################################### +# listen to the following technology(s). +# The bits are defined as tNFA_TECHNOLOGY_MASK in nfa_api.h. +# Default is NFA_TECHNOLOGY_MASK_A | NFA_TECHNOLOGY_MASK_B. + +UICC_LISTEN_TECH_MASK=0x07 +# Protocol mask for NFC-A technology protocols(T1T,T2T and 4A). +# The bits (for NFC A protocol mask)are defined in nfa_api.h. +# Default is T4AT +# 0x01- T1T, 0x02- T2T, 0x04- T4AT +NFCA_PROTOCOL_MASK=0x04 +############################################################################### +# Force tag polling for the following technology(s). +# The bits are defined as tNFA_TECHNOLOGY_MASK in nfa_api.h. +# Default is NFA_TECHNOLOGY_MASK_A | NFA_TECHNOLOGY_MASK_B | +# NFA_TECHNOLOGY_MASK_F | NFA_TECHNOLOGY_MASK_ISO15693 | +# NFA_TECHNOLOGY_MASK_B_PRIME | NFA_TECHNOLOGY_MASK_A_ACTIVE | +# NFA_TECHNOLOGY_MASK_F_ACTIVE. +# +# 0x01- A, 0x02- B, 0x04- F, 0x20- Kovio +POLLING_TECH_MASK=0x27 + +# Force P2P to only listen for the following technology(s). +# The bits are defined as tNFA_TECHNOLOGY_MASK in nfa_api.h. +# Default is NFA_TECHNOLOGY_MASK_A | NFA_TECHNOLOGY_MASK_F | +# NFA_TECHNOLOGY_MASK_A_ACTIVE | NFA_TECHNOLOGY_MASK_F_ACTIVE +# 0x01- NFC DEP A , 0x04:- NFC DEP F +P2P_LISTEN_TECH_MASK=0x05 + +############################################################################### +# Firmware patch file +# If the value is not set then patch download is disabled. +FW_PATCH="/system/etc/firmware/Signedrompatch.bin" +############################################################################### +# Firmware patch file +#FW_PRE_PATCH="/system/etc/firmware/Signedromprepatch.bin" +NVM_FILE_PATH="/system/etc/firmware/nfc_test.bin" +FUSED_NVM_FILE_PATH="/system/etc/firmware/fused_nvm.bin" +############################################################################### + +# +TRANSPORT_DRIVER="/dev/nfc-nci" + +############################################################################### +# power control driver + +POWER_CONTROL_DRIVER="/dev/nfc-nci" + +############################################################################### +# Maximum Number of Credits to be allowed by the NFCC +MAX_RF_DATA_CREDITS=1 +############################################################################### +#Patch and nvm update flags +# These flags needs to be set to enable the patch update and nvm update mechanism +# of middleware +############################################################################### +PATCH_UPDATE_ENABLE_FLAG=0x01 +NVM_UPDATE_ENABLE_FLAG=0x00 +FUSED_NVM_UPDATE_ENABLE_FLAG=0x00 +PM_ENABLE_FLAG=0x01 +SCREEN_OFF_POWER_STATE=0x01 +############################################################################### +# Time out value for closing the connection opened for patch download +############################################################################### +PATCH_DNLD_NFC_HAL_CMD_TOUT=4000 +PATCH_VERSION=21 +############################################################################### +#Default listen mode routing table +# This is the default listen mode routing configuration for NFCC. +# Default is for ISO DEP and NFC DEP +DEFAULT_LISTEN_MODE_ROUTING={00:02:0A:01:03:01:01:04:01:03:00:01:05} +############################################################################### diff --git a/prebuilt/gps.conf b/prebuilt/gps.conf deleted file mode 100644 index 55acdab..0000000 --- a/prebuilt/gps.conf +++ /dev/null @@ -1,156 +0,0 @@ -#Test -#NTP_SERVER=time.gpsonextra.net -#Asia -# NTP_SERVER=asia.pool.ntp.org -#Europe -NTP_SERVER=europe.pool.ntp.org -NTP_SERVER_SCA=south-america.pool.ntp.org -NTP_SERVER_AME=asia.pool.ntp.org -NTP_SERVER_AU=oceania.pool.ntp.org -NTP_SERVER_CN=cn.pool.ntp.org -#North America -# NTP_SERVER=north-america.pool.ntp.org -#Korea -#NTP_SERVER=0.kr.pool.ntp.org -#JP -# NTP_SERVER=3.jp.pool.ntp.org - -XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra2.bin -XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra2.bin -XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra2.bin - -# DEBUG LEVELS: 0 - none, 1 - Error, 2 - Warning, 3 - Info -# 4 - Debug, 5 - Verbose -#DEBUG_LEVEL = 3 -DEBUG_LEVEL = 5 - -# Intermediate position report, 1=enable, 0=disable -INTERMEDIATE_POS=0 - -# supl version 1.0 -SUPL_VER=0x10000 -# supl version 2.0 -#SUPL_VER=0x20000 - -#VDF supl version -SUPL_VER_262_2=0x20000 -SUPL_VER_214_1=0x20000 -SUPL_VER_222_10=0x20000 - -# Error Estimate -# _SET = 1 -# _CLEAR = 0 -ERR_ESTIMATE=0 - -# GPS Capabilities bit mask -# SCHEDULING = 1 -# MSB = 2 -# MSA = 4 -# ON_DEMAND_TIME=0x10 -# ULP = 0x20 -# default = MSA | MSB | SCHEDULING | ULP | ON_DEMAND_TIME -# CAPABILITIES=0x37 -CAPABILITIES=0x37 - -# Accuracy threshold for intermediate positions -# less accurate positions are ignored, 0 for passing all positions -# ACCURACY_THRES=5000 - -################################ -##### AGPS server settings ##### -################################ - -# FOR SUPL SUPPORT, set the following -# SUPL_HOST=supl.host.com or IP -# SUPL_PORT=1234 -SUPL_HOST=supl.google.com -SUPL_PORT=7276 - -#VDF supl server and port -SUPL_HOST_262_2=supl.vodafone.com -SUPL_PORT_262_2=7275 -SUPL_HOST_214_1=supl.vodafone.com -SUPL_PORT_214_1=7275 -SUPL_HOST_222_10=supl.vodafone.com -SUPL_PORT_222_10=7275 -SUPL_HOST_204_4=supl.vodafone.com -SUPL_PORT_204_4=7275 -SUPL_HOST_268_1=supl.vodafone.com -SUPL_PORT_268_1=7275 -SUPL_HOST_226_1=supl.vodafone.com -SUPL_PORT_226_1=7275 -SUPL_HOST_202_5=supl.vodafone.com -SUPL_PORT_202_5=7275 -SUPL_HOST_530_1=supl.vodafone.com -SUPL_PORT_530_1=7275 - -#UNF host,port -SUPL_HOST_UNF=supl.iusacell.com -SUPL_PORT_UNF=7275 - -#SFR supl server and port -SUPL_PORT_208_10=7275 - -# FOR C2K PDE SUPPORT, set the following -# C2K_HOST=c2k.pde.com or IP -# C2K_PORT=1234 - -################################ -# Indoor Positioning Settings -################################ -# 0: QUIPC disabled, 1: QUIPC enabled, 2: forced QUIPC only -QUIPC_ENABLED = 0 - -################################ -# EXTRA SETTINGS -################################ -# Enable or Disable Wiper (1=Enable, 0=Disable) -#ENABLE_WIPER=1 -ENABLE_WIPER=0 -# NMEA provider (1=Modem Processor, 0=Application Processor) -#NMEA_PROVIDER=0 -NMEA_PROVIDER=1 - -#################################### -# LTE Positioning Profile Settings -#################################### -# 0: Enable RRLP on LTE(Default) -# 1: Enable LPP_User_Plane on LTE -# 2: Enable LPP_Control_Plane -# 3: Enable both LPP_User_Plane and LPP_Control_Plane -LPP_PROFILE = 0 - -################################################## -# Select Positioning Protocol on A-GLONASS system -################################################## -# 0x1: RRC CPlane -# 0x2: RRLP UPlane -# 0x4: LLP Uplane -A_GLONASS_POS_PROTOCOL_SELECT = 0 - -################################ -# LGE EXTRA SETTINGS -################################ -VENDOR=GLOBAL -LGE_TLS_MODE=0 - -#VDF tls mode -LGE_TLS_MODE_262_2=1 -LGE_TLS_MODE_214_1=1 -LGE_TLS_MODE_222_10=1 -LGE_TLS_MODE_204_4=1 -LGE_TLS_MODE_268_1=1 -LGE_TLS_MODE_226_1=1 -LGE_TLS_MODE_202_5=1 -LGE_TLS_MODE_530_1=1 - -#UNF tls mode -LGE_TLS_MODE_UNF=1 - -#SFR tls mode -LGE_TLS_MODE_208_10=1 - -LGE_GPS_POSITION_MODE=1 - -#UNF position mode -LGE_GPS_POSITION_MODE_UNF=0 diff --git a/proprietary-blobs.txt b/proprietary-blobs.txt index 1f4406d..e1f0992 100644 --- a/proprietary-blobs.txt +++ b/proprietary-blobs.txt @@ -262,4 +262,4 @@ vendor/lib/hw/flp.default.so -vendor/lib/libdisp-aba.so -vendor/lib/libcneapiclient.so -lib/libcnefeatureconfig.so - +vendor/firmware/libpn547_fw.so diff --git a/rootdir/init.zetaw.rc b/rootdir/init.zetaw.rc index e5369b6..f2a9100 100755 --- a/rootdir/init.zetaw.rc +++ b/rootdir/init.zetaw.rc @@ -58,6 +58,8 @@ on init symlink /storage/usbdisk /usbdisk symlink /storage/usbdisk /mnt/usbdisk + # NFC fix + symlink /dev/pn547 /dev/pn544 # SD Enc setprop ro.ssbd.session /dev/block/platform/msm_sdcc.1/by-name/eksst diff --git a/rootdir/ueventd.w7ds.rc b/rootdir/ueventd.w7ds.rc index e59552f..76dedf1 100644 --- a/rootdir/ueventd.w7ds.rc +++ b/rootdir/ueventd.w7ds.rc @@ -187,6 +187,7 @@ #nfc permissions /dev/nfc-nci 0660 nfc nfc +/dev/pn547 0660 nfc nfc # UIO devices /dev/uio0 0660 system system