Cypress Wifi Linux FMAC Driver Package - README
===============================================

Package Version
---------------
v4.14-2018_0321


Release Date
------------
2018-03-21


Description
-----------
This is Cypress's Linux brcmfmac driver and firmware support package.
Brcmfmac is an open-source driver project.

Files in this release:
* Backports package (cypress-backports-v4.14_2018_0321-module-src.tar.gz)
* Firmware/clm_blob files (cypress-firmware-v4.14-2018_0312.tar.gz)
* Cypress fmac patch files (cypress-patch-v4.14_2018_0321.tar.gz)
* Device tree files (cypress-devicetree-v4.11_2017_0818.tar.gz)
* hostapd/wpa_supplicant patch (cypress-hostap_2_6-2018_0312.tar.gz)
* README

For more information about the Linux brcmfmac project, see:

[brcm80211 Wireless Wiki](https://wireless.wiki.kernel.org/en/users/drivers/brcm80211)

For more information about Linux backports project, see:

[Linux Backports Project](https://backports.wiki.kernel.org/index.php/Main_Page)


Supported Feature
-----------------
* Concurrnet APSTA
* P2P
* Out-of-band (OOB) interrupt
* CLM Download (4373/43455/4343w/4354/4356)
* Wake on Wireless LAN
* Voice Enterprise (43455)
* PMF


Test Environment
----------------
* ARM (MCIMX6SX-SDB)
   * Linux v4.1.15 (NXP imx-4.1.15_2.0.0_ga)
   * backports
* x86
   * Linux v4.12


Firmware Versions
-----------------
| Chip      | FW Version    |
|-----------|---------------|
| 43455     | 7.45.151      |
| 4343W     | 7.45.98.45    |
| 4373      | 13.10.246.112 |
| 4356-pcie | 7.35.180.185  |
| 4354      | 7.35.349.37   |
| 4339      | 6.37.39.92    |
| 43340     | 6.10.190.72   |
| 43362     | 5.90.242      |
| 43012     | 13.10.271.77  |


Instructions
------------
The patch files in this package are based on Linux v4.14, so older kernels
need use backports package. Below are examples of how to use this package
with an older kernel or linux-stable v4.14.

### Using backports with an older kernel (v3.0+)

Linux kernel image and cypress driver modules need to be built separately.
Below is the example of using with iMX Linux v4.1.15:

#### Build the kernel image
```bash
#1. Have the BSP kernel source available
   wget http://git.freescale.com/git/cgit.cgi/imx/linux-imx.git/snapshot/linux-imx-rel_imx_4.1.15_2.0.0_ga.tar.gz
   tar zxvf linux-imx-rel_imx_4.1.15_2.0.0_ga.tar.gz
#2. Set up build environment and kernel configuration
   cd linux-imx-rel_imx_4.1.15_2.0.0_ga
   source /opt/poky/1.8/environment-setup-cortexa7hf-vfp-neon-poky-linux-gnueabi
   make imx_v7_defconfig
#3. Edit .config and build cfg80211 as module
#     CONFIG_CFG80211=m
#     CONFIG_BCMDHD=n
#4. Build the Linux kernel image
   make oldconfig
   make zImage -j 8
#5. The kernel image is available here
   arch/arm/boot/zImage
```

#### Build the cypress driver/backports modules
```bash
#1. Untar the Cypress backports package
    tar zxvf cypress-backports-*.tar.gz
    cd v4.14-backports
#2. (Native) compile local tools and generate .config (in a new terminal
#   without sourcing Yoctol toolchain settings)
    bash
    MY_KERNEL=<the 4.1.15 kernel path>
    make KLIB=$MY_KERNEL KLIB_BUILD=$MY_KERNEL defconfig-brcmfmac
#3. (Cross) compile kernel modules
    source /opt/poky/1.8/environment-setup-cortexa7hf-vfp-neon-poky-linux-gnueabi
    make KLIB=$MY_KERNEL KLIB_BUILD=$MY_KERNEL modules
#4. The kernel modules are available here
#      compat/compat.ko
#      net/wireless/cfg80211.ko
#      drivers/net/wireless/broadcom/brcm80211/brcmutil/brcmutil.ko
#      drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko
```

#### Device tree
```bash
#1. Untar the cypress devicetree package
    tar zxvf cypress-devicetree-*.tar.gz
#2. Find your board's dtb file, for example
#      cypress-devicetree/iMX6SX/4.1.15/imx6sx-sdb-btwifi-fmac.dtb
```
Note: If your board's dtb is not available in the cypress devicetree
      package, please refer to the available dts/dtsi files and create
      them for your board, then compile them for the dtb file. iMX dts
      files are located in linux-imx/arch/arm/boot/dts/ folder of the
      Linux kernel tree. Below command compiles a dtb file
```bash
    make ARCH=arm <devicetree name>.dtb
```

#### Load the cypress wifi driver
```bash
#1. Copy your boards's zImage and dtb files to the target board
    bash
    TARGET_IP=<target board IP>
    scp <dtb file> root@$TARGET_IP:/run/media/mmcblk1p1/cy.dtb
    scp <zImage file> root@$TARGET_IP:/run/media/mmcblk1p1/zImage_cy
#2. Copy firmware files to the target board
    tar zxvf cypress-firmware*.tar.gz
    scp firmware/* root@$TARGET_IP:/lib/firmware/brcm
#3. Copy your nvram file (from board vendor) to the target board and rename it
    scp <nvram file> root@$TARGET_IP:/lib/firmware/brcm/<fw name>.txt
#      (fw name is your chip's *.bin file name in the cypress firmware package)
#4. Copy cypress kernel modules to the target board
    scp <module files> root@$TARGET_IP:/lib/modules/4.1.15
#5. (iMX console) Press ctrl-c after target boot to enter u-boot and configure it
#   for the new zImage/dtb files
   env print image fdt_file
   setenv image zImage_cy
   setenv fdt_file cy.dtb
   saveenv
   env print image fdt_file
   reset
#6. (iMX console) Boot up the target board with the above zImage and insmod cypress modules
    insmod /lib/modules/4.1.15/compat.ko
    insmod /lib/modules/4.1.15/cfg80211.ko
    insmod /lib/modules/4.1.15/brcmutil.ko
    insmod /lib/modules/4.1.15/brcmfmac.ko
```
Note: More on fmac driver [firmware/nvram install](https://wireless.wiki.kernel.org/en/users/drivers/brcm80211#firmware_installation1)

### Using Linux Stable v4.14
```bash
#1. Download Linux stable kernel source
    wget https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/snapshot/linux-stable-4.14.tar.gz
    tar zxvf linux-stable-4.14.tar.gz
#2. In Linux root folder, untar/apply cypress patches with below bash commands
    cd linux-stable-4.14
    tar zxvf cypress-patch*.tar.gz
    for i in cypress-patch/*.patch; do patch -p1 < $i; done
#3. Set kernel .config and enable below options, then compile kernel image
#      CONFIG_BRCMUTIL=y
#      CONFIG_BRCMFMAC=y
#      CONFIG_BRCMFMAC_SDIO=y
#      CONFIG_BRCMFMAC_PROTO_BCDC=y
#      CONFIG_BRCMFMAC_PCIE=y
#      CONFIG_BRCMFMAC_PROTO_MSGBUF=y
#4. (optional) Backup original firmware files
    cp /lib/firmware/brcm /lib/firmware/brcm-bak -r
#5. Update firmware files in /lib/firmware/brcm
    tar zxvf cypress-firmware*.tar.gz
    cp firmware/* /lib/firmware/brcm
#6. Boot the system with the new kernel image
```



Cypress Wifi Linux FMAC Driver Package - Release Notes
======================================================

FMAC Driver Changes
-------------------
* CLM download support/fix (0001, 0009)
* 4373 support (0002)
* device tree related changes (0003)
* bug fixes (0004, 0006, 0010)
* 43012 support (0005, 0007, 0012, 0013, 0017)
* 43455 support (0008)
* throughput enhancement (0011, 0019)
* Fast roaming support (0014)
* 43428 support (0015)
* AP isolation support (0016)
* Wake on Wirelss LAN fix (0018, 0021, 0022)
* EAP restriction setting (0020)


FMAC Driver Patch List
----------------------
* 0001-brcmfmac-add-CLM-download-support.patch [v4.15-rc1]
* 0002-brcmfmac-Set-F2-blksz-and-Watermark-to-256-for-4373.patch
* 0003-brcmfmac-Add-sg-parameters-dts-parsing.patch
* 0004-brcmfmac-return-EPERM-when-getting-error-in-vendor-c.patch [v4.16-rc1]
* 0005-brcmfmac-Add-support-for-CYW43012-SDIO-chipset.patch
* 0006-brcmfmac-set-apsta-to-1-when-AP-start-on-primary-int.patch
* 0007-brcmfmac-Saverestore-support-changes-for-43012.patch
* 0008-brcmfmac-Support-43455-save-restore-SR-feature-if-FW.patch [v4.16-rc1]
* 0009-brcmfmac-fix-CLM-load-error-for-legacy-chips-when-us.patch [v4.15-rc9]
* 0010-brcmfmac-enlarge-buffer-size-of-caps-to-512-bytes.patch [v4.16-rc1]
* 0011-brcmfmac-calling-skb_orphan-before-sending-skb-to-SD.patch
* 0012-brcmfmac-43012-Update-F2-Watermark-to-0x60-to-fix-DM.patch
* 0013-brcmfmac-DS1-Exit-should-re-download-the-firmware.patch
* 0014-brcmfmac-add-FT-based-AKMs-in-brcmf_set_key_mgmt-for.patch
* 0015-brcmfmac-Add-support-for-43428-SDIO-device-ID.patch
* 0016-brcmfmac-support-AP-isolation.patch
* 0017-brcmfmac-do-not-print-ulp_sdioctrl-get-error.patch
* 0018-brcmfmac-fix-system-warning-message-during-wowl-susp.patch
* 0019-brcmfmac-add-a-module-parameter-to-set-scheduling-pr.patch
* 0020-brcmfmac-make-firmware-eap_restrict-a-module-paramet.patch
* 0021-brcmfmac-Support-wake-on-ping-packet.patch
* 0022-brcmfmac-Remove-WOWL-configuration-in-disconnect-sta.patch

Note: [*] is the upstream tag containing the patch


Firmware Changes
----------------
* 43455
   * --- 7.45.151 ---
   * Disable AMPDU host reorder
   * Fix for KRACK replay fail
   * Enhancement of BW detection capability
   * Enable GTKOE
   * KCC certification - Fix for Korea type3 detection failure
   * Software antenna diversity support
   * --- 7.45.132 ---

* 4343W
   * --- 7.45.98.45 ---
   * Disable AMPDU host reorder
   * Fix for GTK vulnerability issue
   * Fixed CERT11/WMM failures
   * Enabled 802.11r support
   * Enable CLM download support
   * --- 7.45.98.38 ---

* 4373
   * --- 13.10.246.112 ---
   * PMF bug fixes
   * Disable AMPDU host reorder
   * Fix for USB control endpoint transfer issues and random scan failures
   * --- 13.10.246.79 ---

* 4356-pcie
   * --- 7.35.180.185 ---
   * Disable AMPDU host reorder
   * Enable CLM download support
   * --- 7.35.180.176 ---

* 4354
   * --- 7.35.349.37 ---
   * Disable AMPDU host reorder
   * Fix for GTK reinstallation
   * Enable CLM download support
   * --- 7.35.349.28 ---

* 4339
   * --- 6.37.39.92 ---
   * Disable AMPDU host reorder
   * --- 6.37.39.80 ---

* 43340
   * --- 6.10.190.72 ---
   * CLM updates.
   * --- 6.10.190.70 ---

* 43362
   * --- 5.90.242 ---
   * Fix for GTK vulnerability issue
   * p2p GO creation failure fix
   * --- 5.90.240 ---

* 43012
   * --- 13.10.271.77 ---
   * Fix for KRACK issues
   * 11N certification fixes
   * PHY EVM improvements
   * --- 13.10.271.57 ---


Known Issues
------------
