Hammerhead: NFC: Enable low-power tag detect.

Also cleaned up config, set some IsoDep params correctly.

Bug: 10349921
Change-Id: I8a897c429d9d8e3b771cc36e94c0c6d0af83af44
diff --git a/nfc/libnfc-brcm-20791b05.conf b/nfc/libnfc-brcm-20791b05.conf
index 0a502df..1a266fd 100644
--- a/nfc/libnfc-brcm-20791b05.conf
+++ b/nfc/libnfc-brcm-20791b05.conf
@@ -1,4 +1,4 @@
-###############################################################################
+##############################################################################
 # Firmware patch file
 #  If the value is not set then patch download is disabled.
 FW_PATCH="/vendor/firmware/bcm2079x-b5_firmware.ncd"
@@ -19,28 +19,32 @@
 #  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={00:B9:21:01:02:FF:FF:04:A0:0F:40:00:80:02:02:10:00:00:00:31:0E:30:00:00:00:00:00:00:00:00:00:00:00:00:00:00}
+LPTD_CFG={38:B9:36:01:00:FF:FF:09:00:00:00:A0:0F:40:00:00:12:02:10:00:00:00:2D:0B:30:00:00:00:00:00:00:00:00:00:00:00:00:00:00:03:00:D0:07:00:00:08:07:00:00:C8:00:00:00:00:00:00:00}
 
 ###############################################################################
 # Startup Configuration (256 bytes maximum)
 #
 # This is applied at stack startup.
-NFA_DM_START_UP_CFG={42: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:B5:03:01:01:01:C9:03:03:0F:AB:5B:01:02:B2:04:E8:03:00:00:CF:02:02:08:B1:06:00:20:00:00:00:12:C2:02:01:C8}
+# Use for Host based CE
+NFA_DM_START_UP_CFG={45:CB:01:01:A5:01:01:CA:17:00:00:00:00:06:00:00:00:00:0F:00:00:00:00:E0:67:35:00:14:01:00:00:10:B5:03:01:03:FF:80:01:01:C9:03:03:0F:AB:5B:01:02:B2:04:E8:03:00:00:CF:02:02:08:B1:06:00:20:00:00:00:12:C2:02:00:C8}
+
+# Support UICC
+#NFA_DM_START_UP_CFG={45:CB:01:01:A5:01:01:CA:17:00:00:00:00:06:00:00:00:00:0F:00:00:00:00:E0:67:35:00:14:01:00:00:10:B5:03:01:03:FF:80:01:01:C9:03:03:0F:AB:5B:01:02:B2:04:E8:03:00:00:CF:02:02:08:B1:06:00:20:00:00:00:12:C2:02:01:88}
 
 ###############################################################################
 # Pre-Discovery Startup Configuration (256 bytes maximum)
 #
 # This is applied before starting Discovery the first time.
-NFA_DM_PRE_DISCOVERY_CFG={0A:C2:08:01:C8:00:04:40:4B:4C:00}
+# Use for Host based CE
+# Do not set NFA_DM_PRE_DISCOVERY_CFG
+
+# Support UICC
+#NFA_DM_PRE_DISCOVERY_CFG={0A:C2:08:01:88:00:04:40:4B:4C:00}
 
 ###############################################################################
 # 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
-#
 # 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
diff --git a/nfc/libnfc-brcm.conf b/nfc/libnfc-brcm.conf
index b814e00..4840a54 100644
--- a/nfc/libnfc-brcm.conf
+++ b/nfc/libnfc-brcm.conf
@@ -50,8 +50,8 @@
 
 ###############################################################################
 # Default poll duration (in ms)
-#  The defualt is 1000ms if not set (see nfc_target.h)
-#NFA_DM_DISC_DURATION_POLL=1000
+#  The defualt is 500ms if not set (see nfc_target.h)
+#NFA_DM_DISC_DURATION_POLL=500
 
 ###############################################################################
 # Startup Vendor Specific Configuration (100 bytes maximum);
@@ -73,14 +73,25 @@
 # The value is set to 3 by default as it assumes we will discover 0xF2,
 # 0xF3, and 0xF4. If a platform will exclude and SE, this value can be reduced
 # so that the stack will not wait any longer than necessary.
-#NFA_MAX_EE_SUPPORTED=3
+#
+# Use for Host based CE
+NFA_MAX_EE_SUPPORTED=0
+
+# Use for UICC support
+# NFA_MAX_EE_SUPPORTED=3
 
 ###############################################################################
 # 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=0x00
+# one of them (e.g. 0xF4).  This can be set to 0 if there are no SE on the
+# system in order to skip SE initialization.
+#
+# Use for Host based CE
+ACTIVE_SE=0x0
+
+# Use for UICC support
+#ACTIVE_SE=0xF3
 
 ###############################################################################
 # Configure the NFC Extras to open and use a static pipe.  If the value is
@@ -101,7 +112,7 @@
 # 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_B.
-UICC_LISTEN_TECH_MASK=0x01
+#UICC_LISTEN_TECH_MASK=0x01
 
 ###############################################################################
 # AID for Empty Select command
@@ -128,7 +139,7 @@
 # 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
-P2P_LISTEN_TECH_MASK=0xC5
+#P2P_LISTEN_TECH_MASK=0xC5
 
 ###############################################################################
 # Maximum Number of Credits to be allowed by the NFCC
@@ -162,14 +173,6 @@
 #SPD_MAX_RETRY_COUNT=3
 
 ###############################################################################
-# Patch RAM Version Checking
-# By default the stack will reject any attempt to download a patch where major
-# version is < the one that is in NVM.  If this config item is set to 1 then
-# this version check is skipped.
-#
-#SPD_IGNORE_VERSION=0
-
-###############################################################################
 # transport driver
 #
 # TRANSPORT_DRIVER=<driver>
@@ -230,3 +233,15 @@
 #   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
+
+###############################################################################
+# Configuration for the RF discovery frequency for each technology. The values mean
+# frequency for NFC Technology A
+#                   Technology B
+#                   Technology F
+#                   Proprietary Technology/15693
+#                   Proprietary Technology/B-Prime
+#                   Proprietary Technology/Kovio
+#                   Technology A active mode
+#                   Technology F active mode
+#POLL_FREQUENCY={01:01:01:01:01:01:01:01}