===============================================================================
			U S E R  M A N U A L

 Copyright (C) 2003-2014, Marvell International Ltd.

 This software file (the "File") is distributed by Marvell International
 Ltd. under the terms of the GNU General Public License Version 2, June 1991
 (the "License").  You may use, redistribute and/or modify this File in
 accordance with the terms and conditions of the License, a copy of which
 is available along with the File in the gpl.txt file or by writing to
 the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 02111-1307 or on the worldwide web at http://www.gnu.org/licenses/gpl.txt.

 THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
 IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
 ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
 this warranty disclaimer.

===============================================================================

1) FOR DRIVER BUILD

	Goto source code directory mbtc_src/.
		make [clean] build
	The driver binary can be found in ../bin_xxxx_btchar directory.

2) FOR DRIVER INSTALL

	a) Copy sd8787.bin | ... to /lib/firmware/mrvl/ directory,
	   create the directory if it doesn't exist.
	b) Install bluetooth driver,
		insmod bt8787.ko | mbt8787.ko | ... [fw_name=mrvl/sd8xxx.bin]
	c) Uninstall bluetooth driver,
		rmmod bt8xxx | mbt8xxx

	There are some other parameters for debugging purpose etc. Use modinfo to check details.
	  drvdbg=<bit mask of driver debug message control>
	  psmode=1|0 <enable PS mode (default) | disable PS mode>
	  bt_name=<BT interface name>
	  fm_name=<FM interface name>
	  nfc_name=<NFC interface name>
	  mbt_pm_keep_power=1|0 <PM keep power in suspend (default) | PM no power in suspend>
	  req_fw_nowait=0|1 <use request_firmware API (default) | use request_firmware_nowait API>
	  init_cfg=<init config (MAC addresses, registers etc.) file name>
		e.g. copy bt_init_cfg.conf to firmware directory, init_cfg=mrvl/bt_init_cfg.conf
      bt_mac=xx:xx:xx:xx:xx:xx <override the MAC address (in hex)>
      cal_cfg=<BT CAL data config file name>
		e.g. copy bt_cal_data.conf to firmware directory, cal_cfg=mrvl/bt_cal_data.conf
      cal_cfg_ext=<CAL data config file name>
		e.g. copy cal_data.conf to firmware directory, cal_cfg_ext=mrvl/cal_data.conf

	Note: On some platforms (e.g. PXA910/920) double quotation marks ("") need to used
	for module parameters.
		insmod mbt8xxx.ko "<para1> <para2> ..."

3) cat /proc/mbt/mbtcharx/status
	This command is used to get driver status.

4) cat /proc/mbt/mbtcharx/config
	This command is used to get the current driver settings.

5) proc commands to config bluetooth parameters

drvdbg=[n]
	This command is used to set the bit mask of driver debug message control.

	bit 0:  MSG  		PRINTM(MSG,...)
	bit 1:  FATAL		PRINTM(FATAL,...)
	bit 2:  ERROR		PRINTM(ERROR,...)
	bit 3:  DATA 		PRINTM(DATA,...)
	bit 4:  CMD  		PRINTM(CMD,...)
	bit 5:  EVENT		PRINTM(EVENT,...)
	bit 6:  INTR		PRINTM(INTR,...)
	...
	bit 16: DAT_D		PRINTM(DAT_D,...), DBG_HEXDUMP(DAT_D,...)
	bit 17: CMD_D		PRINTM(CMD_D,...), DBG_HEXDUMP(CMD_D,...)
	...
	bit 28: ENTRY		PRINTM(ENTRY,...), ENTER(), LEAVE()
	bit 29: WARN 		PRINTM(WARN,...)
	bit 30: INFO 		PRINTM(INFO,...)

	Usage:
		echo "drvdbg=0x7" > /proc/mbt/mbtcharx/config		#enable MSG,FATAL,ERROR messages

gpio_gap=[n]
	This command is used to configure the host sleep parameters.

	bit 8:0  -- Gap
	bit 16:8 -- GPIO
	where GPIO is the pin number of GPIO used to wakeup the host. It could be any valid
		GPIO pin# (e.g. 0-7) or 0xff (Interface, e.g. SDIO will be used instead).
	where Gap is the gap in milliseconds between wakeup signal and wakeup event
		or 0xff for special setting when GPIO is used to wakeup host.

	Usage:
		echo "gpio_gap=0xff80" > /proc/mbt/mbtcharx/config   	# use Interface (e.g. SDIO)
		echo "hscfgcmd=1" > /proc/mbt/mbtcharx/config		# gap = 0x80

		echo "gpio_gap=0x03ff" > /proc/mbt/mbtcharx/config   	# use gpio 3
		echo "hscfgcmd=1" > /proc/mbt/mbtcharx/config		# and special host sleep mode

psmode=[n]
	This command is used to enable/disable auto sleep mode

	where the option is:
			1 	-- Enable auto sleep mode
			0 	-- Disable auto sleep mode

	Usage:
		echo "psmode=1" > /proc/mbt/mbtcharx/config			#enable power save mode
		echo "idle_timeout=0x0100" > /proc/mbt/mbtcharx/config		#configure idle, timeout value in ms
		echo "pscmd=1" > /proc/mbt/mbtcharx/config

		echo "psmode=0" > /proc/mbt/mbtcharx/config			#disable power save mode
		echo "pscmd=1" > /proc/mbt/mbtcharx/config

sdio_pull_cfg=[n]
	This command is used to configure the delay values for pull up and pull down the SDIO lines.

   	where value is:
	        bit 15:0  -- Pull up delay in microsecond
	        bit 31:16 -- Pull down delay in microsecond
	        0xffff disables PullUp and PullDown in BT controller

	Usage:
		echo "sdio_pull_cfg=0x00020002" > /proc/mbt/mbtcharx/config   	# Enable sdio pull control
		echo "sdio_pull_ctrl=1" > /proc/mbt/mbtcharx/config             # configure sdio pull up delay to 2 microseconds
                                                                        # configure sdio pull down delay to 2 microseconds

		echo "sdio_pull_cfg=0xffffffff" > /proc/mbt/mbtcharx/config   	# Disable sdio pull control
		echo "sdio_pull_ctrl=1" > /proc/mbt/mbtcharx/config

6) cat /proc/mbt/mbtcharx/debug
	This command is used to get driver debug parameters.

7) proc command to config debug parameters

sdcmd52rw=<func> <reg> [data]
	This command is used to read/write a controller register in
	Secure Digital I/O Interfaces.

	func: The function number to use (0-7)
	reg:  The address of the register
	data: The value to write, read if the value is absent

	For SDIO MMC driver, only function 0 and BT function (2/3) access is allowed.
	And there is a limitation for function 0 write, only vendor specific CCCR
	registers (0xf0 -0xff) are permiited.

	Usage:
		echo "sdcmd52rw= 2 3 0xf" > /proc/mbt/mbtcharx/debug	# write 0xf to func 2 address 3
		echo "sdcmd52rw= 0 4" > /proc/mbt/mbtcharx/debug    	# read func 0 address 4

Issue debug_dump command through proc.
	Usage:
		echo "debug_dump" > /proc/mbt/mbtcharx/debug		# dump driver internal debug status.
	Use dmesg or cat /var/log/debug to check driver debug messages.

proc command to enable BT test mode
    Usage:
        echo "test_mode=1" > /proc/mbt/mbtcharx/config   #enable BT test mode

==============================================================================
			U S E R  M A N U A L  F O R  F M A P P

1) FOR TOOL BUILD

	a) Enter directory
	b) make
	c) After building, the executable binary "fmapp" is in the directory

2) FOR TOOL RUN

	a) chmod 777 fmapp (optional)
	b) Run fmapp utility based on usage below
		Usage: fmapp <Options> devicename [command content]
		devicename example: mfmchar0

	Options:
		-h: Display help
		-v: Verbose

3) TEST EXAMPLES
	./fmapp mfmchar0 0x02 0x03
