From cb70800f6130a47da1b1e6e24e00860585022010 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kopy=C5=9Bci=C5=84ski?= Date: Mon, 23 Oct 2023 09:58:51 +0200 Subject: [PATCH] nimble: add sysconfig for enabling additional PHYs Three new configs are introduced: BLE_ADDITIONAL_PHY that enables additional PHY and two configs that specify what additional PHY shall be enabled (2M or CODED) --- .../targets/nordic_pca10095_blehci/syscfg.yml | 6 ++++-- .github/test_build_apps_syscfg.yml | 5 +++-- apps/blestress/syscfg.yml | 7 +++++-- apps/dtm/syscfg.yml | 6 ++++-- babblesim/targets/edtthci/syscfg.yml | 4 +++- nimble/controller/syscfg.yml | 4 ++-- nimble/syscfg.yml | 19 +++++++++++++++++++ targets/dialog_cmac/syscfg.yml | 4 ++-- targets/nordic_pca10095_net-blehci/syscfg.yml | 5 +++-- .../targets/nordic_pca10040_blehci/syscfg.yml | 3 ++- .../targets/nordic_pca10056_blehci/syscfg.yml | 3 ++- .../targets/nordic_pca10059_blehci/syscfg.yml | 3 ++- .../nordic_pca10095_app_blehci/syscfg.yml | 3 ++- .../nordic_pca10095_net_blehci/syscfg.yml | 4 +++- 14 files changed, 56 insertions(+), 20 deletions(-) diff --git a/.github/targets/nordic_pca10095_blehci/syscfg.yml b/.github/targets/nordic_pca10095_blehci/syscfg.yml index 3ffe99c7db..f322fbcc5e 100644 --- a/.github/targets/nordic_pca10095_blehci/syscfg.yml +++ b/.github/targets/nordic_pca10095_blehci/syscfg.yml @@ -19,10 +19,12 @@ syscfg.vals: BLE_MAX_CONNECTIONS: 4 + BLE_ADDITIONAL_PHY: 1 + BLE_PHY_2M: 1 + BLE_PHY_CODED: 1 + BLE_LL_CFG_FEAT_DATA_LEN_EXT: 1 - BLE_LL_CFG_FEAT_LE_2M_PHY: 1 - BLE_LL_CFG_FEAT_LE_CODED_PHY: 1 BLE_LL_CFG_FEAT_LL_PRIVACY: 1 BLE_LL_CONN_INIT_MAX_TX_BYTES: 251 BLE_LL_CONN_INIT_SLOTS: 4 diff --git a/.github/test_build_apps_syscfg.yml b/.github/test_build_apps_syscfg.yml index 169dfa7235..f1b0be6c11 100644 --- a/.github/test_build_apps_syscfg.yml +++ b/.github/test_build_apps_syscfg.yml @@ -51,10 +51,11 @@ syscfg.vals: BLE_SM_SC: 1 BLE_STORE_MAX_BONDS: 5 BLE_EATT_CHAN_NUM: 2 + BLE_ADDITIONAL_PHY: 1 + BLE_PHY_2M: 1 + BLE_PHY_CODED: 1 # controller - BLE_LL_CFG_FEAT_LE_2M_PHY: 1 - BLE_LL_CFG_FEAT_LE_CODED_PHY: 1 BLE_LL_CFG_FEAT_LL_PRIVACY: 1 BLE_LL_CONN_INIT_MAX_TX_BYTES: 251 BLE_LL_DTM: 1 diff --git a/apps/blestress/syscfg.yml b/apps/blestress/syscfg.yml index 5e16ed1f41..82519c1318 100644 --- a/apps/blestress/syscfg.yml +++ b/apps/blestress/syscfg.yml @@ -74,11 +74,14 @@ syscfg.vals: # L2CAP COC SDU buffers in RX endpoint BLE_L2CAP_COC_SDU_BUFF_COUNT: 1 + # Enable additional PHYs + BLE_ADDITIONAL_PHY: 1 + # Enable 2M PHY - BLE_LL_CFG_FEAT_LE_2M_PHY: 1 + BLE_PHY_2M: 1 # Enable CODED PHY - BLE_LL_CFG_FEAT_LE_CODED_PHY: 1 + BLE_PHY_CODED: 1 # Whether to save data to sys/config, or just keep it in RAM. BLE_STORE_CONFIG_PERSIST: 0 diff --git a/apps/dtm/syscfg.yml b/apps/dtm/syscfg.yml index b88c387a11..bc773117b4 100644 --- a/apps/dtm/syscfg.yml +++ b/apps/dtm/syscfg.yml @@ -22,7 +22,9 @@ syscfg.vals: CONSOLE_HISTORY: ram CONSOLE_HISTORY_RAM_HISTORY_SIZE: 50 + BLE_ADDITIONAL_PHY: 1 + BLE_PHY_2M: 1 + BLE_PHY_CODED: 1 + BLE_LL_DTM: 1 BLE_LL_DTM_EXTENSIONS: 1 - BLE_LL_CFG_FEAT_LE_2M_PHY: 1 - BLE_LL_CFG_FEAT_LE_CODED_PHY: 1 diff --git a/babblesim/targets/edtthci/syscfg.yml b/babblesim/targets/edtthci/syscfg.yml index 0476ccf36b..0eff5d5f09 100644 --- a/babblesim/targets/edtthci/syscfg.yml +++ b/babblesim/targets/edtthci/syscfg.yml @@ -34,7 +34,6 @@ syscfg.vals: BLE_LL_CFG_FEAT_DATA_LEN_EXT: 1 BLE_LL_CFG_FEAT_LL_PRIVACY: 1 BLE_LL_CFG_FEAT_LE_CSA2: 1 - BLE_LL_CFG_FEAT_LE_2M_PHY: 1 # BLE_LL_CFG_FEAT_LE_CODED_PHY: 1 # not modeled in bsim BLE_LL_CFG_FEAT_LL_EXT_ADV: 1 BLE_LL_CFG_FEAT_LL_PERIODIC_ADV: 1 @@ -42,6 +41,9 @@ syscfg.vals: BLE_LL_CFG_FEAT_CTRL_TO_HOST_FLOW_CONTROL: 1 BLE_LL_CFG_FEAT_LL_SCA_UPDATE: 1 + BLE_ADDITIONAL_PHY: 1 + BLE_PHY_2M: 1 + BLE_ROLE_CENTRAL: 1 BLE_ROLE_PERIPHERAL: 1 BLE_ROLE_BROADCASTER: 1 diff --git a/nimble/controller/syscfg.yml b/nimble/controller/syscfg.yml index 8a28b1c528..5988e807f2 100644 --- a/nimble/controller/syscfg.yml +++ b/nimble/controller/syscfg.yml @@ -287,12 +287,12 @@ syscfg.defs: BLE_LL_CFG_FEAT_LE_2M_PHY: description: > This option is used to enable/disable support for the 2Mbps PHY. - value: '0' + value: MYNEWT_VAL(BLE_PHY_2M) BLE_LL_CFG_FEAT_LE_CODED_PHY: description: > This option is used to enable/disable support for the coded PHY. - value: '0' + value: MYNEWT_VAL(BLE_PHY_CODED) BLE_LL_CFG_FEAT_LL_EXT_ADV: description: > diff --git a/nimble/syscfg.yml b/nimble/syscfg.yml index eaaec96896..8578391d32 100644 --- a/nimble/syscfg.yml +++ b/nimble/syscfg.yml @@ -130,6 +130,25 @@ syscfg.defs: This enables LE Connection Subrating feature value: 0 + BLE_ADDITIONAL_PHY: + description: > + This enables support for addtitional PHY (2M or CODED) + value: 0 + + BLE_PHY_2M: + description: > + This enables support for addtitional 2M PHY + value: 0 + restrictions: + - 'BLE_ADDITIONAL_PHY if 1' + + BLE_PHY_CODED: + description: > + This enables support for addtitional CODED PHY + value: 0 + restrictions: + - 'BLE_ADDITIONAL_PHY if 1' + # Allow periodic sync transfer only if 5.1 or higher syscfg.restrictions: - "'BLE_PERIODIC_ADV_SYNC_TRANSFER == 0' || 'BLE_VERSION >= 51'" diff --git a/targets/dialog_cmac/syscfg.yml b/targets/dialog_cmac/syscfg.yml index f73d4e01ba..f2c2b49dc5 100644 --- a/targets/dialog_cmac/syscfg.yml +++ b/targets/dialog_cmac/syscfg.yml @@ -51,9 +51,9 @@ syscfg.vals: BLE_MULTI_ADV_INSTANCES: 4 BLE_MAX_PERIODIC_SYNCS: 4 BLE_MAX_CONNECTIONS: 4 + BLE_ADDITIONAL_PHY: 1 + BLE_PHY_2M: 1 BLE_LL_CFG_FEAT_DATA_LEN_EXT: 1 - BLE_LL_CFG_FEAT_LE_2M_PHY: 1 - BLE_LL_CFG_FEAT_LE_CODED_PHY: 0 BLE_LL_CFG_FEAT_LL_PRIVACY: 1 BLE_LL_CFG_FEAT_LL_SCA_UPDATE: 1 BLE_LL_CFG_FEAT_LL_ENHANCED_CONN_UPDATE: 1 diff --git a/targets/nordic_pca10095_net-blehci/syscfg.yml b/targets/nordic_pca10095_net-blehci/syscfg.yml index b679e9ae7a..d307e65385 100644 --- a/targets/nordic_pca10095_net-blehci/syscfg.yml +++ b/targets/nordic_pca10095_net-blehci/syscfg.yml @@ -23,8 +23,9 @@ syscfg.vals: MSYS_1_BLOCK_COUNT: 12 MSYS_1_BLOCK_SIZE: 292 BLE_LL_CFG_FEAT_DATA_LEN_EXT: 1 - BLE_LL_CFG_FEAT_LE_2M_PHY: 1 - BLE_LL_CFG_FEAT_LE_CODED_PHY: 1 + BLE_ADDITIONAL_PHY: 1 + BLE_PHY_2M: 1 + BLE_PHY_CODED: 1 BLE_LL_CFG_FEAT_LL_PRIVACY: 1 BLE_LL_CFG_FEAT_CTRL_TO_HOST_FLOW_CONTROL: 1 BLE_LL_CONN_INIT_MAX_TX_BYTES: 251 diff --git a/tools/hci_throughput/targets/nordic_pca10040_blehci/syscfg.yml b/tools/hci_throughput/targets/nordic_pca10040_blehci/syscfg.yml index 1c2bbee274..a8da251d2b 100644 --- a/tools/hci_throughput/targets/nordic_pca10040_blehci/syscfg.yml +++ b/tools/hci_throughput/targets/nordic_pca10040_blehci/syscfg.yml @@ -19,7 +19,8 @@ syscfg.vals: BLE_LL_CFG_FEAT_DATA_LEN_EXT: 1 - BLE_LL_CFG_FEAT_LE_2M_PHY: 1 + BLE_ADDITIONAL_PHY: 1 + BLE_PHY_2M: 1 BLE_LL_HCI_VS_EVENT_ON_ASSERT: 1 MSYS_1_BLOCK_COUNT: 80 MSYS_1_BLOCK_SIZE: 308 diff --git a/tools/hci_throughput/targets/nordic_pca10056_blehci/syscfg.yml b/tools/hci_throughput/targets/nordic_pca10056_blehci/syscfg.yml index 1c65d055bb..580b68ef4c 100644 --- a/tools/hci_throughput/targets/nordic_pca10056_blehci/syscfg.yml +++ b/tools/hci_throughput/targets/nordic_pca10056_blehci/syscfg.yml @@ -18,8 +18,9 @@ # syscfg.vals: + BLE_ADDITIONAL_PHY: 1 + BLE_PHY_2M: 1 BLE_LL_CFG_FEAT_DATA_LEN_EXT: 1 - BLE_LL_CFG_FEAT_LE_2M_PHY: 1 BLE_LL_HCI_VS_EVENT_ON_ASSERT: 1 BLE_TRANSPORT_HS: usb USBD_VID: 0xDCAB diff --git a/tools/hci_throughput/targets/nordic_pca10059_blehci/syscfg.yml b/tools/hci_throughput/targets/nordic_pca10059_blehci/syscfg.yml index 6fc26b9db1..54bb70a14c 100644 --- a/tools/hci_throughput/targets/nordic_pca10059_blehci/syscfg.yml +++ b/tools/hci_throughput/targets/nordic_pca10059_blehci/syscfg.yml @@ -19,7 +19,8 @@ syscfg.vals: BLE_LL_CFG_FEAT_DATA_LEN_EXT: 1 - BLE_LL_CFG_FEAT_LE_2M_PHY: 1 + BLE_ADDITIONAL_PHY: 1 + BLE_PHY_2M: 1 BLE_LL_HCI_VS_EVENT_ON_ASSERT: 1 BLE_TRANSPORT_HS: usb USBD_VID: 0xDCAB diff --git a/tools/hci_throughput/targets/nordic_pca10095_app_blehci/syscfg.yml b/tools/hci_throughput/targets/nordic_pca10095_app_blehci/syscfg.yml index c7ff62bba0..5f64d85169 100644 --- a/tools/hci_throughput/targets/nordic_pca10095_app_blehci/syscfg.yml +++ b/tools/hci_throughput/targets/nordic_pca10095_app_blehci/syscfg.yml @@ -38,5 +38,6 @@ syscfg.vals: IPC_NRF5340_BUF_SZ: 3072 BLE_LL_CFG_FEAT_DATA_LEN_EXT: 1 - BLE_LL_CFG_FEAT_LE_2M_PHY: 1 + BLE_ADDITIONAL_PHY: 1 + BLE_PHY_2M: 1 BLE_LL_HCI_VS_EVENT_ON_ASSERT: 1 diff --git a/tools/hci_throughput/targets/nordic_pca10095_net_blehci/syscfg.yml b/tools/hci_throughput/targets/nordic_pca10095_net_blehci/syscfg.yml index 7f0b5b60f8..4674ca07dd 100644 --- a/tools/hci_throughput/targets/nordic_pca10095_net_blehci/syscfg.yml +++ b/tools/hci_throughput/targets/nordic_pca10095_net_blehci/syscfg.yml @@ -23,8 +23,10 @@ syscfg.vals: BLE_LL_SCA: 50 OS_CRASH_FILE_LINE: 1 + BLE_ADDITIONAL_PHY: 1 + BLE_PHY_2M: 1 + BLE_LL_CFG_FEAT_DATA_LEN_EXT: 1 - BLE_LL_CFG_FEAT_LE_2M_PHY: 1 BLE_LL_HCI_VS_EVENT_ON_ASSERT: 1 BLE_TRANSPORT_ACL_COUNT: 80