rail: Add support for EFR32XG1X devices

Currently only the 2X families of EFR32 devices have been
supported, this commit adds support for 1X families.

Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
This commit is contained in:
Yonatan Schachter 2023-08-03 12:33:49 +03:00 committed by Filip Kokosiński
parent 20113e9520
commit 267cd0bb17
5 changed files with 1475 additions and 2 deletions

View File

@ -40,16 +40,28 @@ if (${CONFIG_BOARD} STREQUAL "efr32bg27_brd2602a")
set(PRODUCT_NO "sdid205")
endif()
if(${CONFIG_SOC_GECKO_SERIES1})
zephyr_include_directories(
platform/radio/rail_lib/plugin/pa-conversions/efr32xg1x/config
platform/radio/rail_lib/chip/efr32/efr32xg1x
)
elseif(${CONFIG_SOC_GECKO_SERIES2})
zephyr_include_directories(
platform/radio/rail_lib/plugin/pa-conversions/efr32xg${GECKO_SERIES_NUMBER}/config
platform/radio/rail_lib/chip/efr32/efr32xg2x
)
else()
message(FATAL_ERROR "Unknown gecko series type. Is CONFIG_SOC_GECKO_SERIES1/2 set?")
endif()
zephyr_include_directories(
Device/SiliconLabs/${SILABS_GECKO_DEVICE}/Include
board/config/${SILABS_GECKO_BOARD}
board/inc
common/inc
emlib/inc
platform/radio/rail_lib/chip/efr32/efr32xg2x
platform/radio/rail_lib/common
platform/radio/rail_lib/plugin/pa-conversions
platform/radio/rail_lib/plugin/pa-conversions/efr32xg${GECKO_SERIES_NUMBER}/config
protocol/bluetooth//bgstack/ll/inc
service/device_init/config/s2
service/device_init/config/s2/${PRODUCT_NO}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,80 @@
/***************************************************************************//**
* @file
* @brief Power Amplifier configuration file.
*******************************************************************************
* # License
* <b>Copyright 2020 Silicon Laboratories Inc. www.silabs.com</b>
*******************************************************************************
*
* SPDX-License-Identifier: Zlib
*
* The licensor of this software is Silicon Laboratories Inc.
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
******************************************************************************/
#ifndef SL_RAIL_UTIL_PA_CONFIG_H
#define SL_RAIL_UTIL_PA_CONFIG_H
#include "rail_types.h"
// <<< Use Configuration Wizard in Context Menu >>>
// <h> PA Configuration
// <o SL_RAIL_UTIL_PA_POWER_DECI_DBM> Initial PA Power (deci-dBm, 100 = 10.0 dBm)
// <i> Default: 100
#define SL_RAIL_UTIL_PA_POWER_DECI_DBM 100
// <o SL_RAIL_UTIL_PA_RAMP_TIME_US> PA Ramp Time (microseconds)
// <0-65535:1>
// <i> Default: 10
#define SL_RAIL_UTIL_PA_RAMP_TIME_US 10
// <o SL_RAIL_UTIL_PA_VOLTAGE_MV> Milli-volts on PA supply pin (PA_VDD)
// <0-65535:1>
// <i> Default: 3300
#define SL_RAIL_UTIL_PA_VOLTAGE_MV 3300
// <o SL_RAIL_UTIL_PA_SELECTION_2P4GHZ> 2.4 GHz PA Selection
// <RAIL_TX_POWER_MODE_2P4GIG_HP=> High Power
// <RAIL_TX_POWER_MODE_2P4GIG_LP=> Low Power
// <RAIL_TX_POWER_MODE_NONE=> Disable
// <i> Default: RAIL_TX_POWER_MODE_2P4GIG_HP
#define SL_RAIL_UTIL_PA_SELECTION_2P4GHZ RAIL_TX_POWER_MODE_2P4GIG_HP
// <o SL_RAIL_UTIL_PA_SELECTION_SUBGHZ> Sub-1 GHz PA Selection
// <RAIL_TX_POWER_MODE_SUBGIG=> Enable
// <RAIL_TX_POWER_MODE_NONE=> Disable
// <i> Default: RAIL_TX_POWER_MODE_SUBGIG
#define SL_RAIL_UTIL_PA_SELECTION_SUBGHZ RAIL_TX_POWER_MODE_SUBGIG
// </h>
// <h> PA Curve Configuration
// <s.50 SL_RAIL_UTIL_PA_CURVE_HEADER> Header file containing custom PA curves
// <i> Default: "pa_curves_efr32.h"
#define SL_RAIL_UTIL_PA_CURVE_HEADER "pa_curves_efr32.h"
// <s.50 SL_RAIL_UTIL_PA_CURVE_TYPES> Header file containing PA curve types
// <i> Default: "pa_curve_types_efr32.h"
#define SL_RAIL_UTIL_PA_CURVE_TYPES "pa_curve_types_efr32.h"
// </h>
// <h> PA Calibration Configuration
// <q SL_RAIL_UTIL_PA_CALIBRATION_ENABLE> Apply PA Calibration Factory Offset
// <i> Default: 1
#define SL_RAIL_UTIL_PA_CALIBRATION_ENABLE 1
// </h>
// <<< end of configuration section >>>
#endif // SL_RAIL_UTIL_PA_CONFIG_H

View File

@ -0,0 +1,245 @@
/***************************************************************************//**
* @file
* @brief PA power conversion curves used by Silicon Labs PA power conversion
* functions.
* @details This file contains the curves needed convert PA power levels to
* dBm powers.
*******************************************************************************
* # License
* <b>Copyright 2020 Silicon Laboratories Inc. www.silabs.com</b>
*******************************************************************************
*
* SPDX-License-Identifier: Zlib
*
* The licensor of this software is Silicon Laboratories Inc.
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
******************************************************************************/
#ifndef __PA_CURVES_H_
#define __PA_CURVES_H_
#ifdef __cplusplus
extern "C" {
#endif
#define RAIL_PA_CURVES_LP_VALUES 7
#define RAIL_PA_CURVES_2P4_HP_SG_PIECEWISE_SEGMENTS 8
#define RAIL_PA_CURVES_2P4_HP_VBAT_MAX_POWER 200
#define RAIL_PA_CURVES_2P4_HP_VBAT_MIN_POWER -260
#define RAIL_PA_CURVES_2P4_HP_VBAT_CURVES \
{ { 252, 2776, -300026 }, \
{ 136, 1335, -73192 }, \
{ 83, 772, -7179 }, \
{ 50, 441, 17309 }, \
{ 41, 343, 22520 }, \
{ 22, 209, 22360 }, \
{ 14, 124, 18896 }, \
{ 7, 40, 10519 } }
#define RAIL_PA_CURVES_2P4_HP_DCDC_MAX_POWER 140
#define RAIL_PA_CURVES_2P4_HP_DCDC_MIN_POWER -260
#define RAIL_PA_CURVES_2P4_HP_DCDC_CURVES \
{ { 65535, 0, 0 }, \
{ 252, 4306, -391604 }, \
{ 117, 1435, -52495 }, \
{ 62, 610, 13579 }, \
{ 37, 331, 24456 }, \
{ 23, 224, 23902 }, \
{ 14, 140, 20330 }, \
{ 7, 37, 10371 } }
#define RAIL_PA_CURVES_SG_VBAT_MAX_POWER 200
#define RAIL_PA_CURVES_SG_VBAT_MIN_POWER -260
#define RAIL_PA_CURVES_SG_VBAT_CURVES \
{ { 248, 2757, -319913 }, \
{ 123, 1173, -64900 }, \
{ 74, 694, -8378 }, \
{ 45, 429, 12097 }, \
{ 28, 263, 18309 }, \
{ 18, 167, 18071 }, \
{ 11, 103, 15386 }, \
{ 6, 34, 9064 } }
#define RAIL_PA_CURVES_SG_DCDC_MAX_POWER 150
#define RAIL_PA_CURVES_SG_DCDC_MIN_POWER -260
#define RAIL_PA_CURVES_SG_DCDC_CURVES \
{ { 248, 9069, -1171644 }, \
{ 199, 3826, -378994 }, \
{ 92, 932, -22748 }, \
{ 50, 470, 13485 }, \
{ 31, 304, 19712 }, \
{ 18, 192, 19146 }, \
{ 11, 110, 15607 }, \
{ 5, 31, 8239 } }
#define RAIL_PA_CURVES_2P4_LP \
{ \
-125, /*! Power Level 1 */ \
-65, /*! Power Level 2 */ \
-30, /*! Power Level 3 */ \
-15, /*! Power Level 4 */ \
-7, /*! Power Level 5 */ \
-2, /*! Power Level 6 */ \
0 /*! Power Level 7 */ \
}
/**
* Macros to ease in the delcarations of the various power amplifier units
* conversion curves.
*/
#define RAIL_DECLARE_PA_2P4_HP_VBAT \
static const RAIL_TxPowerCurveSegment_t \
twoPointFourHpVbatCurves[RAIL_PA_CURVES_2P4_HP_SG_PIECEWISE_SEGMENTS] \
= RAIL_PA_CURVES_2P4_HP_VBAT_CURVES;
#define RAIL_DECLARE_PA_2P4_HP_DCDC \
static const RAIL_TxPowerCurveSegment_t \
twoPointFourHpDcdcCurves[RAIL_PA_CURVES_2P4_HP_SG_PIECEWISE_SEGMENTS] \
= RAIL_PA_CURVES_2P4_HP_DCDC_CURVES;
#define RAIL_DECLARE_PA_SG_VBAT \
static const RAIL_TxPowerCurveSegment_t \
subgigVbatCurves[RAIL_PA_CURVES_2P4_HP_SG_PIECEWISE_SEGMENTS] \
= RAIL_PA_CURVES_SG_VBAT_CURVES;
#define RAIL_DECLARE_PA_SG_DCDC \
static const RAIL_TxPowerCurveSegment_t \
subgigDcdcCurves[RAIL_PA_CURVES_2P4_HP_SG_PIECEWISE_SEGMENTS] \
= RAIL_PA_CURVES_SG_DCDC_CURVES;
// Macro to declare the variables needed to initialize
// RAIL_TxPowerCurvesConfigAlt_t for use in RAIL_InitTxPowerCurvesAlt,
// assuming battery powered operation
#define RAIL_DECLARE_TX_POWER_VBAT_CURVES_ALT \
static const RAIL_TxPowerCurveAlt_t RAIL_piecewiseDataHp = { \
RAIL_PA_CURVES_2P4_HP_VBAT_MAX_POWER, \
RAIL_PA_CURVES_2P4_HP_VBAT_MIN_POWER, \
RAIL_PA_CURVES_2P4_HP_VBAT_CURVES \
}; \
static const RAIL_TxPowerCurveAlt_t RAIL_piecewiseDataSg = { \
RAIL_PA_CURVES_SG_VBAT_MAX_POWER, \
RAIL_PA_CURVES_SG_VBAT_MIN_POWER, \
RAIL_PA_CURVES_SG_VBAT_CURVES \
}; \
static const int16_t RAIL_curves24Lp[RAIL_PA_CURVES_LP_VALUES] = \
RAIL_PA_CURVES_2P4_LP;
// *INDENT-OFF*
// Macro to declare the variables needed to initialize
// RAIL_TxPowerCurvesConfigAlt_t for use in RAIL_InitTxPowerCurvesAlt,
// assuming DCDC powered operation
#define RAIL_DECLARE_TX_POWER_DCDC_CURVES_ALT \
static const RAIL_TxPowerCurveAlt_t RAIL_piecewiseDataHp = { \
RAIL_PA_CURVES_2P4_HP_DCDC_MAX_POWER, \
RAIL_PA_CURVES_2P4_HP_DCDC_MIN_POWER, \
RAIL_PA_CURVES_2P4_HP_DCDC_CURVES, \
}; \
static const RAIL_TxPowerCurveAlt_t RAIL_piecewiseDataSg = { \
RAIL_PA_CURVES_SG_DCDC_MAX_POWER, \
RAIL_PA_CURVES_SG_DCDC_MIN_POWER, \
RAIL_PA_CURVES_SG_DCDC_CURVES \
}; \
static const int16_t RAIL_curves24Lp[RAIL_PA_CURVES_LP_VALUES] = \
RAIL_PA_CURVES_2P4_LP;
// *INDENT-OFF*
// Macro to declare the variables needed to initialize
// RAIL_TxPowerCurvesConfig_t for use in RAIL_InitTxPowerCurves,
// assuming battery powered operation
#define RAIL_DECLARE_TX_POWER_VBAT_CURVES(piecewiseSegments, curvesSg, \
curves24Hp, curves24Lp) \
static const uint8_t (piecewiseSegments) = \
RAIL_PA_CURVES_2P4_HP_SG_PIECEWISE_SEGMENTS; \
\
RAIL_DECLARE_PA_2P4_HP_VBAT; \
RAIL_DECLARE_PA_SG_VBAT; \
\
static const RAIL_TxPowerCurves_t curvesSg[1] = { \
{ RAIL_PA_CURVES_SG_VBAT_MAX_POWER, \
RAIL_PA_CURVES_SG_VBAT_MIN_POWER, \
subgigVbatCurves } \
}; \
static const RAIL_TxPowerCurves_t curves24Hp[1] = { \
{ RAIL_PA_CURVES_2P4_HP_VBAT_MAX_POWER, \
RAIL_PA_CURVES_2P4_HP_VBAT_MIN_POWER, \
twoPointFourHpVbatCurves } \
}; \
static const int16_t curves24Lp[RAIL_PA_CURVES_LP_VALUES] = \
RAIL_PA_CURVES_2P4_LP;
// *INDENT-OFF*
// Macro to declare the variables needed to initialize
// RAIL_TxPowerCurvesConfig_t for use in RAIL_InitTxPowerCurves,
// assuming DCDC powered operation
#define RAIL_DECLARE_TX_POWER_DCDC_CURVES(piecewiseSegments, curvesSg, \
curves24Hp, curves24Lp) \
static const uint8_t piecewiseSegments = \
RAIL_PA_CURVES_2P4_HP_SG_PIECEWISE_SEGMENTS; \
\
RAIL_DECLARE_PA_2P4_HP_DCDC; \
RAIL_DECLARE_PA_SG_DCDC; \
\
static const RAIL_TxPowerCurves_t curvesSg[1] = { \
{ RAIL_PA_CURVES_SG_DCDC_MAX_POWER, \
RAIL_PA_CURVES_SG_DCDC_MIN_POWER, \
subgigDcdcCurves } \
}; \
static const RAIL_TxPowerCurves_t curves24Hp[1] = { \
{ RAIL_PA_CURVES_2P4_HP_DCDC_MAX_POWER, \
RAIL_PA_CURVES_2P4_HP_DCDC_MIN_POWER, \
twoPointFourHpDcdcCurves } \
}; \
static const int16_t curves24Lp[RAIL_PA_CURVES_LP_VALUES] = \
RAIL_PA_CURVES_2P4_LP;
// *INDENT-OFF*
#define RAIL_DECLARE_TX_POWER_CURVES_CONFIG_ALT \
{ \
.curves = { \
{ \
.algorithm = RAIL_PA_ALGORITHM_PIECEWISE_LINEAR, \
.segments = RAIL_PA_CURVES_2P4_HP_SG_PIECEWISE_SEGMENTS, \
.min = RAIL_TX_POWER_LEVEL_2P4_HP_MIN, \
.max = RAIL_TX_POWER_LEVEL_2P4_HP_MAX, \
.conversion = { .powerCurve = &RAIL_piecewiseDataHp }, \
}, \
{ \
.algorithm = RAIL_PA_ALGORITHM_MAPPING_TABLE, \
.segments = 0U, \
.min = RAIL_TX_POWER_LEVEL_2P4_LP_MIN, \
.max = RAIL_TX_POWER_LEVEL_2P4_LP_MAX, \
.conversion = { .mappingTable = &RAIL_curves24Lp[0] }, \
}, \
{ \
.algorithm = RAIL_PA_ALGORITHM_PIECEWISE_LINEAR, \
.segments = RAIL_PA_CURVES_2P4_HP_SG_PIECEWISE_SEGMENTS, \
.min = RAIL_TX_POWER_LEVEL_SUBGIG_MIN, \
.max = RAIL_TX_POWER_LEVEL_SUBGIG_HP_MAX, \
.conversion = { .powerCurve = &RAIL_piecewiseDataSg }, \
}, \
} \
}
// *INDENT-OFF*
#ifdef __cplusplus
}
#endif
#endif

View File

@ -54,6 +54,46 @@ blobs:
doc-url: https://github.com/SiliconLabs/gecko_sdk
# librail
- path: gecko/platform/radio/rail_lib/autogen/librail_release/librail_efr32xg1_gcc_release.a
sha256: 776969fe3e98fc1099e31fad92f74d8791ca2069e568e079ad9bce73c9096a3e
type: lib
version: '4.1.4'
license-path: zephyr/blobs/license/Zlib.txt
url: https://github.com/SiliconLabs/gecko_sdk/raw/v4.1.4/platform/radio/rail_lib/autogen/librail_release/librail_efr32xg1_gcc_release.a
description: "Binary libraries supporting EFR32 RF subsystems"
doc-url: https://github.com/SiliconLabs/gecko_sdk
- path: gecko/platform/radio/rail_lib/autogen/librail_release/librail_efr32xg12_gcc_release.a
sha256: 33c6de9113787aa87baff8443aad00601d2831ade2bbd605f246a5b02ea3fa77
type: lib
version: '4.1.4'
license-path: zephyr/blobs/license/Zlib.txt
url: https://github.com/SiliconLabs/gecko_sdk/raw/v4.1.4/platform/radio/rail_lib/autogen/librail_release/librail_efr32xg12_gcc_release.a
description: "Binary libraries supporting EFR32 RF subsystems"
doc-url: https://github.com/SiliconLabs/gecko_sdk
- path: gecko/platform/radio/rail_lib/autogen/librail_release/librail_efr32xg13_gcc_release.a
sha256: 25af46964d0373c561ffd8cbabe6c7b0f58cd93d30ae476d60ac84cc52ff1573
type: lib
version: '4.1.4'
license-path: zephyr/blobs/license/Zlib.txt
url: https://github.com/SiliconLabs/gecko_sdk/raw/v4.1.4/platform/radio/rail_lib/autogen/librail_release/librail_efr32xg13_gcc_release.a
description: "Binary libraries supporting EFR32 RF subsystems"
doc-url: https://github.com/SiliconLabs/gecko_sdk
- path: gecko/platform/radio/rail_lib/autogen/librail_release/librail_efr32xg14_gcc_release.a
sha256: d1f4fd4e2ed814158384e8328fb6807453bae5e263bf78d6ede38889040b5381
type: lib
version: '4.1.4'
license-path: zephyr/blobs/license/Zlib.txt
url: https://github.com/SiliconLabs/gecko_sdk/raw/v4.1.4/platform/radio/rail_lib/autogen/librail_release/librail_efr32xg14_gcc_release.a
description: "Binary libraries supporting EFR32 RF subsystems"
doc-url: https://github.com/SiliconLabs/gecko_sdk
- path: gecko/platform/radio/rail_lib/autogen/librail_release/librail_efr32xg21_gcc_release.a
sha256: 3a56b8501e11a53d1a9125352d679e033ca31561a422b9c45b916f04bfee0ff7
type: lib
version: '4.1.4'
license-path: zephyr/blobs/license/Zlib.txt
url: https://github.com/SiliconLabs/gecko_sdk/raw/v4.1.4/platform/radio/rail_lib/autogen/librail_release/librail_efr32xg21_gcc_release.a
description: "Binary libraries supporting EFR32 RF subsystems"
doc-url: https://github.com/SiliconLabs/gecko_sdk
- path: gecko/platform/radio/rail_lib/autogen/librail_release/librail_efr32xg22_gcc_release.a
sha256: fe31d4bc0db19db0c442a53077d924bd330283a2a7e2012b35fef1c69cdbe4df
type: lib
@ -62,6 +102,14 @@ blobs:
url: https://github.com/SiliconLabs/gecko_sdk/raw/v4.2.4/platform/radio/rail_lib/autogen/librail_release/librail_efr32xg22_gcc_release.a
description: "Binary libraries supporting EFR32 RF subsystems"
doc-url: https://github.com/SiliconLabs/gecko_sdk
- path: gecko/platform/radio/rail_lib/autogen/librail_release/librail_efr32xg23_gcc_release.a
sha256: edc113c43b7061d78fed0a4d20e083ecaea68915c4d553bdc1e1d8f1038c7285
type: lib
version: '4.1.4'
license-path: zephyr/blobs/license/Zlib.txt
url: https://github.com/SiliconLabs/gecko_sdk/raw/v4.1.4/platform/radio/rail_lib/autogen/librail_release/librail_efr32xg23_gcc_release.a
description: "Binary libraries supporting EFR32 RF subsystems"
doc-url: https://github.com/SiliconLabs/gecko_sdk
- path: gecko/platform/radio/rail_lib/autogen/librail_release/librail_efr32xg24_gcc_release.a
sha256: 4c63380c381880dc64d1a1bcd2e9d18222cefefcdfe5ca8ca3b95a532e81b177
type: lib
@ -70,6 +118,14 @@ blobs:
url: https://github.com/SiliconLabs/gecko_sdk/raw/v4.2.4/platform/radio/rail_lib/autogen/librail_release/librail_efr32xg24_gcc_release.a
description: "Binary libraries supporting EFR32 RF subsystems"
doc-url: https://github.com/SiliconLabs/gecko_sdk
- path: gecko/platform/radio/rail_lib/autogen/librail_release/librail_efr32xg25_gcc_release.a
sha256: e12ad0d6efb4921dee98251620e5989fcba210264c45bc29335dc3a43af260e0
type: lib
version: '4.1.4'
license-path: zephyr/blobs/license/Zlib.txt
url: https://github.com/SiliconLabs/gecko_sdk/raw/v4.1.4/platform/radio/rail_lib/autogen/librail_release/librail_efr32xg25_gcc_release.a
description: "Binary libraries supporting EFR32 RF subsystems"
doc-url: https://github.com/SiliconLabs/gecko_sdk
- path: gecko/platform/radio/rail_lib/autogen/librail_release/librail_efr32xg27_gcc_release.a
sha256: b856b3d977fd777e507f5a51e1b6a8968ee088b987c1ae5ea8ee4b47602206fc
type: lib