Skip to content

Commit

Permalink
save srrc testing build
Browse files Browse the repository at this point in the history
  • Loading branch information
vegano1 committed Aug 3, 2023
1 parent 66fee44 commit 1f1b0b8
Show file tree
Hide file tree
Showing 31 changed files with 1,699 additions and 0 deletions.
129 changes: 129 additions & 0 deletions build/SetUp.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
/** @file SetUp.ini
*
* Copyright 2017-2020 NXP
*
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code ("Materials") are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide copyright
* and trade secret laws and treaty provisions. No part of the Materials may be
* used, copied, reproduced, modified, published, uploaded, posted,
* transmitted, distributed, or disclosed in any way without NXP's prior
* express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*/
RAWUART_Mode 0: HCI_Mode, 1: MBT_Mode, 2:RAWUART_Mode
[BT_INTF]
RAWUR_PORT = /dev/ttyUSB0
RAWUR_BAUDRATE = 115200
RAWUR_Mode = 0
;for UDP routine implementation
[DutIp]
DutIf= 1 ;0 - UART
;1 - ETH
DutIpAddress = 192.168.100.10
HostIpAddress = 192.168.0.100
Protocol = TCP
;Protocol = UDP
[DutInitSet]
;0 - EEPROM support
;1 - NO_EEPROM support
;2 - OTP support
NO_EEPROM=1
NoEepromBtFlexFileName = BtCalData_ext.conf
NoEepromWlanFlexFileName = WlanCalData_ext.conf
maxWait=50000 ;ms
Delay = 1 ;ms
SpiDelay = 0 ;ms
retry =1
TimeOut = 50000 ;ms for UDP routine implementation
EXTERNAL_LDO=0
ETH_PORT = mlan0
[HW_CONFIG]
FEM_FILENAME=FEM_8797.ini
LNA_MODE=0x0102 ;force to bypass mode
E2Prom_IfType=2 ;1 - SPI
;2 - I2C
E2Prom_AddrLen=1
E2Prom_DeviceType=1 ;1 - EEPROM
;2 - FLASH
;3 - OTP
[COMSET]
ComNo = 3
BaudRate = 115200
byParity = 0
byStopBits = 1
byByteSize = 8
; -------------------------------------------------------------
; RSSI calibration parameters setting for 11G and 11A band
; -------------------------------------------------------------
[RSSI_CAL]
;BSSID = 00.01.22.03.04.50 ; Agilent N4010
BSSID = 01.00.00.C0.FF.EE ; LP IQxel
RSSI_CalPwrLevel = -40 ; RSSI cal reference power LNA on (dBm)
RSSI_CalPwrLevelStart = -40 ; RSSI cal power level start from (dBm)
RSSI_CalPwrLevelStop = -54 ; RSSI cal power level end at (dBm)
RSSI_CalPwrLevelStep = 2 ; RSSI cal power decreases setp in dB
RSSI_CalDataRate_Nb = 1 ; Number of RSSI cal data rates, refer to [Data Rate Table]
RSSI_CalDataRate_0 = 4 ; 1st RSSI cal datarate
RSSI_CalDataRate_1 = 6 ; 2nd RSSI caldatarate
RSSI_CalDataRate_2 = 20 ; 3rd RSSI caldatarate
RSSI_CalDataRate_3 = 21 ; 4th RSSI caldatarate
[BANDG_SUB0]
RSSI_CalChannelNb = 1 ; Number of RSSI Cal Channel
RSSI_CalChannel_0 = 6 ; 1st RSSI Cal Channel
RSSI_CalChannel_1 = 7 ; 2nd RSSI Cal Channel
RSSI_CalChannel_2 = 13 ; 3rd RSSI Cal Channel
[BANDA_SUB0]
RSSI_CalChannelNb = 0 ; Number of RSSI Cal Channel
RSSI_CalChannel_0 = 16 ; 1st RSSI Cal Channel
RSSI_CalChannel_1 = 184 ; 2nd RSSI Cal Channel
RSSI_CalChannel_2 = 192 ; 3rd RSSI Cal Channel
[BANDA_SUB1]
RSSI_CalChannelNb = 1 ; Number of RSSI Cal Channel
RSSI_CalChannel_0 = 48 ; 1st RSSI Cal Channel
RSSI_CalChannel_1 = 36 ; 2nd RSSI Cal Channel
RSSI_CalChannel_2 = 64 ; 3rd RSSI Cal Channel
[BANDA_SUB2]
RSSI_CalChannelNb = 1 ; Number of RSSI Cal Channel
RSSI_CalChannel_0 = 100 ; 1st RSSI Cal Channel
RSSI_CalChannel_1 = 120 ; 2nd RSSI Cal Channel
RSSI_CalChannel_2 = 140 ; 3rd RSSI Cal Channel
[BANDA_SUB3]
RSSI_CalChannelNb = 1 ; Number of RSSI Cal Channel
RSSI_CalChannel_0 = 149 ; 1st RSSI Cal Channel
RSSI_CalChannel_1 = 157 ; 2nd RSSI Cal Channel
RSSI_CalChannel_2 = 165 ; 3rd RSSI Cal Channel
[DEBUG]
debuglog = 0
IfSpy =0
WriteTemplate =0
ByPassVhtRateChk=0
1 change: 1 addition & 0 deletions build/conf/bblayers.conf
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ BBLAYERS ?= " \
${TOPDIR}/../layers/meta-yocto/meta-poky \
${TOPDIR}/../layers/openembedded-core/meta \
"
BBLAYERS += " ${TOPDIR}/../layers/meta-toradex-wifi"
2 changes: 2 additions & 0 deletions build/conf/local.conf
Original file line number Diff line number Diff line change
Expand Up @@ -287,3 +287,5 @@ YARN_CACHE_DIR = ""
ELECTRON_CACHE_DIR = ""
SIGNING_KEY = ""
DATADOG_API_KEY = ""
MACHINEOVERRIDES =. "default-nxp-proprietary-driver:"
MACHINEOVERRIDES =. "mfg-mode:"
17 changes: 17 additions & 0 deletions layers/meta-toradex-wifi/COPYING.MIT
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
119 changes: 119 additions & 0 deletions layers/meta-toradex-wifi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
This layer adds support for the NXP proprietary wifi drivers that can be enabled instead of the mainline mwifiex drivers.
It adds a blacklisting mechanism for the modules making it simple to choose what module to
use based on the modprobe configuration files.

This layer also includes support for enabling the manufacturing mode for the NXP wifi drivers, that can be used
for lab testing and it depends on proprietary files that come from NXP.

Toradex makes this files available to customers under NDA, please contact your TSE or FAE for information on how to get access
to the necessary files.

Please see the corresponding sections below for details.

Supported SOMS:
- colibri-imx6ull: interface-diversity-sd-sd
- colibri-imx8x: interface-diversity-pcie-usb
- verdin-imx8mm: interface-diversity-sd-sd
- verdin-imx8mp: interface-diversity-sd-uart
- apalis-imx8: interface-diversity-pcie-usb

# How to install

## Setup layer
The first step is to clone this layer in your own yocto layers directory. This can be done manually or by using repo:

```
$ export LAYER_DIR=<full-path-to-your-toradex-bsp-layer-directory>
$ export BUILD_DIR=<full-path-to-your-toradex-bsp-build-directory>
$ export TORADEX_WIFI_BRANCH=<selected-wifi-branch>
$ cd ${LAYER_DIR}
$ mkdir ../.repo/local_manifests
$ cat > ../.repo/local_manifests/toradex-wifi.xml << EOF
<?xml version="1.0" encoding="UTF-8" ?>
<manifest>
<remote fetch="https://github.com/toradex/" name="toradex-wifi"/>
<project name="meta-toradex-wifi" remote="toradex-wifi" revision="$TORADEX_WIFI_BRANCH" path="layers/meta-toradex-wifi"/>
</manifest>
EOF
$ repo sync meta-toradex-wifi
```

## Decompress the archive with the proprietary drivers downloaded from Toradex:

```
# source your yocto environment file
$ . export
$ cd $BBPATH
$ tar xf proprietary_drivers_nxp_wifi.tar
```

After this, you should have a `wifi-archive` directory on the topdir of your yocto build.

## Enable the layer in your build:

```
$ cd $BBPATH/layers/meta-toradex-wifi
$ ./install_layer.sh
```

The `install_layer.sh` script will setup all the necessary variables to enable the layer and to build and enable the
proprietary drivers by default. Consult this script if you want to know the details of this operation.

## Configure
There are a few configuration options available with this layer. These options are specified in your local.conf or auto.conf file using the MACHINEOVERRIDES variable.

To set the default driver to be used at runtime to the mlan driver, add the following to your config file:

```
MACHINEOVERRIDES =. "default-nxp-proprietary-driver:"
```

To enable manufacturing mode, use the above setting to default to the mlan driver and add the following to your config file:

```
MACHINEOVERRIDES =. "mfg-mode:"
```

## Build

With the above setup, your normal bitbake builds should work and the logic in the layer will set everything else up for you.

```
$ bitbake tdx-reference-minimal-image
```

## Runtime

The toradex-wifi-config recipe will install the /etc/modprobe.d/toradex-wifi-config.conf file with contents similar to the following:

```
# blacklist mlan bt8xxx
# install mlan /bin/false
# install bt8xxx /bin/false
blacklist mwifiex mwifiex_sdio btmrvl btmrvl_sdio
install mwifiex /bin/false
install btmrvl /bin/false
```

To switch between drivers, simply comment out one set of entries, and uncomment the other. Then you will need to reboot.

## Manufacturing Mode

If your build has been configured for manufacturing mode, you will have a binary executable named labtool in the /home/root directory.

# Dependencies

URI: git://git.toradex.com/meta-toradex-bsp-common
branch: dunfell-5.x.y
revision: HEAD

URI: git://git.openembedded.org/bitbake
branch: dunfell
revision: HEAD

URI: git://git.openembedded.org/openembedded-core
layers: meta
branch: dunfell
revision: HEAD

Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#
# Settings for using the NXP proprietary driver with Toradex BSP builds.
#
# Usage:
# Inherit this class
# Add overrides to add features:
# MACHINEOVERRIDES =. "mfg-mode:"
# MACHINEOVERRIDES =. "default-nxp-proprietary-driver:"
#

MACHINEOVERRIDES_prepend_colibri-imx6ull = "interface-diversity-sd-sd:"
MACHINEOVERRIDES_prepend_colibri-imx8x = "interface-diversity-pcie-usb:"
MACHINEOVERRIDES_prepend_verdin-imx8mm = "interface-diversity-sd-sd:"
MACHINEOVERRIDES_prepend_verdin-imx8mp = "interface-diversity-sd-uart:"
MACHINEOVERRIDES_prepend_apalis-imx8 = "interface-diversity-pcie-usb:"

MACHINE_EXTRA_RDEPENDS_append_interface-diversity-sd-uart = " \
kernel-module-mlan \
kernel-module-moal \
kernel-module-wifimrvl \
toradex-wifi-config \
"

MACHINE_EXTRA_RDEPENDS_append_interface-diversity-sd-sd = " \
kernel-module-mlan \
kernel-module-sd8xxx \
kernel-module-bt8xxx \
kernel-module-wifimrvl \
kernel-module-btmrvl \
nxp-wifi-bt-firmware \
toradex-wifi-config \
"
MACHINE_EXTRA_RDEPENDS_append_interface-diversity-pcie-usb = " \
kernel-module-mlan \
kernel-module-pcie8xxx \
kernel-module-bt8xxx \
kernel-module-wifimrvl \
kernel-module-btmrvl \
nxp-wifi-bt-firmware \
toradex-wifi-config \
"

IMAGE_INSTALL_append_mfg-mode = " labtool "

addhandler toradex_wifi_sanity_handler
toradex_wifi_sanity_handler[eventmask] = "bb.event.ParseCompleted"
python toradex_wifi_sanity_handler() {
if "mfg-mode:" in d.getVar('OVERRIDES') and "default-nxp-proprietary-driver:" not in d.getVar('OVERRIDES'):
bb.fatal("Building for Wi-Fi manufacturing mode requires using the NXP proprietary driver as the default.")
}

# Default value for parsing. This will need to be overridden by the user.
NXP_PROPRIETARY_DRIVER_LOCATION ??= "http://example.com"
13 changes: 13 additions & 0 deletions layers/meta-toradex-wifi/conf/layer.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# We have a conf and classes directory, add to BBPATH
BBPATH .= ":${LAYERDIR}"

# We have recipes-* directories, add to BBFILES
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
${LAYERDIR}/recipes-*/*/*.bbappend"

BBFILE_COLLECTIONS += "meta-toradex-wifi"
BBFILE_PATTERN_meta-toradex-wifi = "^${LAYERDIR}/"
BBFILE_PRIORITY_meta-toradex-wifi = "25"

LAYERDEPENDS_meta-toradex-wifi = "core toradex-bsp-common-layer"
LAYERSERIES_COMPAT_meta-toradex-wifi = "dunfell"
19 changes: 19 additions & 0 deletions layers/meta-toradex-wifi/install_layer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

echo 'BBLAYERS += " ${TOPDIR}/../layers/meta-toradex-wifi"' >> build/conf/bblayers.conf
echo 'INHERIT += "toradex-wifi-nxp-proprietary-driver"' >> build/conf/auto.conf
echo 'NXP_PROPRIETARY_DRIVER_LOCATION = "file:///${TOPDIR}/wifi-archive"' >> build/conf/auto.conf

cat << EOF >> build/conf/auto.conf
NXP_PROPRIETARY_DRIVER_FILENAME_interface-diversity-pcie-usb = "PCIE-WLAN-USB-BT-8997-U16-X86-W16.88.10.p173-16.26.10.p173-C4X16698_V4-MGPL.zip"
NXP_PROPRIETARY_DRIVER_SHA256_interface-diversity-pcie-usb="24edfcc985c9c7710c7a8f96de8e8b5ed3037c76126c48a49486f4e517ab5335"
NXP_PROPRIETARY_DRIVER_FILENAME_interface-diversity-sd-sd= "SD-WLAN-SD-BT-8997-U16-MMC-W16.68.10.p162-16.26.10.p162-C4X16693_V4-MGPL.zip"
NXP_PROPRIETARY_DRIVER_SHA256_interface-diversity-sd-sd="37426f9e57974d064ad8edd37adbd3b7fbeb8efd5fb7471cc35a919de51b0d15"
NXP_PROPRIETARY_DRIVER_FILENAME_interface-diversity-sd-uart= "SD-WLAN-UART-BT-8997-LNX_5_15_71-IMX8-16.92.21.p55.3-16.92.21.p55.3-MM5X16366.P5-MGPL.zip"
NXP_PROPRIETARY_DRIVER_SHA256_interface-diversity-sd-uart="2b2f4557dfb5b793c74141a4ed32ae75c9705225c58f1cf15d7947878a9fd66b"
NXP_PROPRIETARY_MFG_TOOL_FILENAME="MFG-W8997-MF-LABTOOL-ANDROID-1.1.0.188.0-16.80.205.p208.zip"
NXP_PROPRIETARY_MFG_TOOL_SHA256="599031b9040c3a501f656a30f85308b9a1929ed5d1f7c40f14c370298f8ba8f9"
EOF

echo 'MACHINEOVERRIDES =. "default-nxp-proprietary-driver:"' >> build/conf/local.conf
echo '#MACHINEOVERRIDES =. "mfg-mode:"' >> build/conf/local.conf
Loading

0 comments on commit 1f1b0b8

Please sign in to comment.