From: Danny Wood Date: Thu, 25 Apr 2019 15:46:55 +0000 (+0100) Subject: a5xelte: Add NFC configuration X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f237b69707522c0a80610e5deba2921622831da6;p=GitHub%2FLineageOS%2Fandroid_device_samsung_a5xelte.git a5xelte: Add NFC configuration Change-Id: I11719627a749a80a31afcc0cf2c2b2fba620d794 --- diff --git a/configs/nfc/libnfc-sec-hal.conf b/configs/nfc/libnfc-sec-hal.conf new file mode 100644 index 0000000..d1929ae --- /dev/null +++ b/configs/nfc/libnfc-sec-hal.conf @@ -0,0 +1,40 @@ +############################ +## NFC device is going to sleep mode after SLEEP_TIMEOUT(ms) and the device needs +## wakeup delay(ms) when it is going to wake up from sleep mode. +SLEEP_TIMEOUT=1000 +WAKEUP_DELAY=20 + +############################ +## Paths +## F/W image +FW_IMAGE="/vendor/firmware/sec_s3fwrn5s_firmware.bin" +## Reg file +RFREG_FILE="/etc/sec_s3fwrn5s_rfreg.bin" +## Power driver +POWER_DRIVER="/dev/sec-nfc" +## Transport driver +TRANS_DRIVER="/dev/sec-nfc" + +############################ +## TRACE_LEVEL (0: only err, 1: and debug, 2: trace also) +## DATA TRACE level (0: not display, 1: simply, 2: all of data trace) +TRACE_LEVEL=2 +DATA_TRACE=2 + +############################ +# F/W Download Option +# 0 : Download for different version +# 1 : Download for upper version +# 2 : Force Download +FW_UPDATE_MODE=2 + +############################ +## FW Base Address for S3FWRN5S (0x3000) +FW_BASE_ADDRESS=0x3000 + +############################ +## Clock option for 26MHz PLL (02 01 01) +FW_CFG_CLK_TYPE=0x02 +FW_CFG_CLK_SPEED=0x01 +FW_CFG_CLK_REQ=0x01 + diff --git a/configs/nfc/libnfc-sec.conf b/configs/nfc/libnfc-sec.conf new file mode 100644 index 0000000..adbc729 --- /dev/null +++ b/configs/nfc/libnfc-sec.conf @@ -0,0 +1,151 @@ +############################################################################### +# NFC Configuration for NON-HAL component S3FWRN5 +# Samsung Electronics, System LSI Division +# Update Date : 2014/11/11 +# eSE : NFC Standalone +# Region : Other Region +# F/W Version dependency : NONE +# This file contains below +# 1) Default routing information : eSE + UICC (Active SE = 0x02) +# 2) Partial AID setting : Disable +# 3) UICC listen tech mask : 0x03 (Type A / B) +# 4) Listen tech mask for P2P : 0xC4 (Disable 106kbps passive P2P) +# 5) Poll tech mask : 0xEF (Enable All tech - B prime is not supported) +# 6) eSE warm reset : Enabled +# 7) Other Information + +################################################################################ +# 1) Default routing information +# SPRINT : DEFAULT_ISODEP_ROUTE=0x02 (eSE only) / ACTIVE_SE=0x02 +# Other region : DEFAULT_ISODEP_ROUTE=0x03 (UICC) / ACTIVE_SE=0x03 +DEFAULT_ISODEP_ROUTE=0x03 +ACTIVE_SE=0x03 + +############################################################################### +# 2) Partial AID setting : Only used for ATT / TMO / VZW +# This configuration may be changed by MNO specific requirement. +# Description +# 1st byte : NCI Length +# 2nd byte : Number of set +# 3rd~ bytes : Partial matching order +# Matching value : Full matching = 0x00, Subset Matching = 0x01, Superset Matching : 0x02, Pattern Matching : 0x03 +# ex) 2f 39 03 02 01 02 --> order : full matching - subset matching - superset matching PARTIAL_AID={03:02:01:02} +# PARTIAL_AID={02:01:02} + +############################################################################### +# Guide for tech mask +# The bits are defined as tNFA_TECHNOLOGY_MASK in nfa_api.h. +# Notable bits: +# NFA_TECHNOLOGY_MASK_A 0x01 +# NFA_TECHNOLOGY_MASK_B 0x02 +# NFA_TECHNOLOGY_MASK_F 0x04 +# NFA_TECHNOLOGY_MASK_ISO15693 0x08 +# NFA_TECHNOLOGY_MASK_B_PRIME 0x10 +# NFA_TECHNOLOGY_MASK_KOVIO 0x20 +# NFA_TECHNOLOGY_MASK_A_ACTIVE 0x40 +# NFA_TECHNOLOGY_MASK_F_ACTIVE 0x80 +# Example : +# Polling mask for A / B / F / V(15693) / Kovio / Active A / Active F +# NFA_TECHNOLOGY_MASK_A | NFA_TECHNOLOGY_MASK_B | +# NFA_TECHNOLOGY_MASK_F | NFA_TECHNOLOGY_MASK_ISO15693 | +# NFA_TECHNOLOGY_MASK_A_ACTIVE | NFA_TECHNOLOGY_MASK_F_ACTIVE. +# 0x01 | 0x02 | 0x04 | 0x08 | 0x20 | 0x40 +# => POLLING_TECH_MASK=0xEF + +############################################################################### +# 3) UICC listen tech mask +# Force UICC to only listen to the following technology(s). +# Default is NFA_TECHNOLOGY_MASK_A | NFA_TECHNOLOGY_MASK_B. +# If this option is blocked by # comment, default value will be applied +# Guide for each region +# SPRINT : UICC_LISTEN_TECH_MASK=0x01 (Type A only) +# HK : UICC_LISTEN_TECH_MASK=0x07 (Enable Type F card) +# Other region : UICC_LISTEN_TECH_MASK=0x03 (Default value) +UICC_LISTEN_TECH_MASK=0x03 + +############################################################################### +# 4) Listen tech mask for P2P +# Force tag polling for the following technology(s). +# Default is NFA_TECHNOLOGY_MASK_A | NFA_TECHNOLOGY_MASK_B | +# NFA_TECHNOLOGY_MASK_F | NFA_TECHNOLOGY_MASK_ISO15693 | +# NFA_TECHNOLOGY_MASK_A_ACTIVE | NFA_TECHNOLOGY_MASK_F_ACTIVE. +# Current Setting : Enable all poll tech +POLLING_TECH_MASK=0xEF + +############################################################################### +# 5) Poll tech mask +# 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 +# For HK, P2P_LISTEN_TECH_MASK may be 0xC0 for enhance type F card success ratio +P2P_LISTEN_TECH_MASK=0xC4 + +############################################################################### +# 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 + +############################################################################### +# 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. +# 6) OBERTHUR_WARM_RESET_COMMAND must be enabled for all eSE model +OBERTHUR_WARM_RESET_COMMAND=0x03 + +############################################################################### +# 7) Other Information +# It will be checked in next version. +############################################################################### + +############################################################################### +# Application options +APPL_TRACE_LEVEL=0xFF +PROTOCOL_TRACE_LEVEL=0xFFFFFFFF + +PRESERVE_STORAGE=1 + +# File used for NFA storage +NFA_STORAGE="/data/nfc" + +############################################################################### +# power control driver +# Specify a kernel driver that support ioctl commands to control NFC_EN and +# NFC_WAKE gpio signals. +# +# POWER_CONTRL_DRIVER= +# i2c and spi driver may be used to control NFC_EN and NFC_WAKE signal +POWER_CONTROL_DRIVER="/dev/sec-nfc" + +############################################################################### +# transport driver +# +# TRANSPORT_DRIVER= +# +# where can be, for example: +# "/dev/ttyS" (UART) +# "/dev/bcmi2cnfc" (I2C) +# "hwtun" (HW Tunnel) +# "/dev/bcmspinfc" (SPI) +# "/dev/btusb0" (BT USB) +TRANSPORT_DRIVER="/dev/sec-nfc" + +############################################################################### +# Default poll duration (in ms) +# The defualt is 500ms if not set (see nfc_target.h) same as M project +NFA_DM_DISC_DURATION_POLL=500 + +############################################################################### +# 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) +# 3: FPM CE in snooze mode, Switch Off, Battery Off still available. +SCREEN_OFF_POWER_STATE=3 + +############################################################################### +# NCI Hal Module name +NCI_HAL_MODULE="nfc_nci" \ No newline at end of file diff --git a/configs/nfc/nfcee_access.xml b/configs/nfc/nfcee_access.xml new file mode 100644 index 0000000..5b7bf36 --- /dev/null +++ b/configs/nfc/nfcee_access.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/device.mk b/device.mk index 5b5cbbd..d4fc68f 100644 --- a/device.mk +++ b/device.mk @@ -55,6 +55,23 @@ PRODUCT_COPY_FILES += \ $(LOCAL_PATH)/keylayout/gpio_keys.kl:system/usr/keylayout/gpio_keys.kl \ $(LOCAL_PATH)/keylayout/sec_touchkey.kl:system/usr/keylayout/sec_touchkey.kl +# NFC +PRODUCT_COPY_FILES += \ + $(LOCAL_PATH)/configs/nfc/libnfc-sec-hal.conf:system/etc/libnfc-sec-hal.conf \ + $(LOCAL_PATH)/configs/nfc/libnfc-sec.conf:system/etc/libnfc-brcm.conf \ + $(LOCAL_PATH)/configs/nfc/nfcee_access.xml:system/etc/nfcee_access.xml + +PRODUCT_PACKAGES += \ + libnfc-nci \ + libnfc_nci_jni \ + NfcNci \ + Tag \ + com.android.nfc_extras \ + android.hardware.nfc@1.0-impl + +PRODUCT_PROPERTY_OVERRIDES += \ + ro.nfc.sec_hal=true + # Permissions PRODUCT_COPY_FILES += \ frameworks/native/data/etc/android.hardware.bluetooth_le.xml:system/etc/permissions/android.hardware.bluetooth_le.xml \