From 916b9fa79bf8ddd250a7167da1cf3f1f77d02eb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Pelikan?= Date: Thu, 5 Dec 2024 14:15:17 +0100 Subject: [PATCH 0001/4042] modules: hal_nordic: nrfs: DVFS cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removing unnecessary logging from DVFS reg operations. Signed-off-by: Paweł Pelikan --- modules/hal_nordic/nrfs/dvfs/ld_dvfs.c | 128 +------------------------ 1 file changed, 5 insertions(+), 123 deletions(-) diff --git a/modules/hal_nordic/nrfs/dvfs/ld_dvfs.c b/modules/hal_nordic/nrfs/dvfs/ld_dvfs.c index 57ee0bdc37514..6697229f5504f 100644 --- a/modules/hal_nordic/nrfs/dvfs/ld_dvfs.c +++ b/modules/hal_nordic/nrfs/dvfs/ld_dvfs.c @@ -40,35 +40,7 @@ void ld_dvfs_init(void) const struct dvfs_oppoint_data *opp_data = get_dvfs_oppoint_data(DVFS_FREQ_HIGH); -#if defined(CONFIG_NRFS_LOCAL_DOMAIN_DVFS_TEST) - LOG_DBG("%s", __func__); - LOG_DBG("REGW: NRF_ABB->TRIM.RINGO[%d] 0x%x, V: 0x%x", - CURR_TARG_ABB_SLOT, - (uint32_t)&NRF_ABB->TRIM.RINGO[CURR_TARG_ABB_SLOT], - opp_data->abb_ringo); - LOG_DBG("REGW: NRF_ABB->TRIM.LOCKRANGE[%d] 0x%x, V: 0x%x", - CURR_TARG_ABB_SLOT, - (uint32_t)&NRF_ABB->TRIM.LOCKRANGE[CURR_TARG_ABB_SLOT], - opp_data->abb_lockrange); - LOG_DBG("REGW: NRF_ABB->TRIM.PVTMONCYCLES[%d] 0x%x, V: 0x%x", - CURR_TARG_ABB_SLOT, - (uint32_t)&NRF_ABB->TRIM.PVTMONCYCLES[CURR_TARG_ABB_SLOT], - opp_data->abb_pvtmoncycles); - - /*For app core.*/ - LOG_DBG("REGW: NRF_APPLICATION_ABB->TRIM.RINGO[%d] 0x%x, V: 0x%x", - CURR_TARG_ABB_SLOT, - (uint32_t)&NRF_APPLICATION_ABB->TRIM.RINGO[CURR_TARG_ABB_SLOT], - opp_data->abb_ringo); - LOG_DBG("REGW: NRF_APPLICATION_ABB->TRIM.LOCKRANGE[%d] 0x%x, V: 0x%x", - CURR_TARG_ABB_SLOT, - (uint32_t)&NRF_APPLICATION_ABB->TRIM.LOCKRANGE[CURR_TARG_ABB_SLOT], - opp_data->abb_lockrange); - LOG_DBG("REGW: NRF_APPLICATION_ABB->TRIM.PVTMONCYCLES[%d] 0x%x, V: 0x%x", - CURR_TARG_ABB_SLOT, - (uint32_t)&NRF_APPLICATION_ABB->TRIM.PVTMONCYCLES[CURR_TARG_ABB_SLOT], - opp_data->abb_pvtmoncycles); -#else +#if !defined(CONFIG_NRFS_LOCAL_DOMAIN_DVFS_TEST) /* TODO: Change to NRFX Hal function when available. */ NRF_ABB->TRIM.RINGO[CURR_TARG_ABB_SLOT] = opp_data->abb_ringo; NRF_ABB->TRIM.LOCKRANGE[CURR_TARG_ABB_SLOT] = opp_data->abb_lockrange; @@ -84,12 +56,7 @@ void ld_dvfs_init(void) void ld_dvfs_clear_zbb(void) { #if defined(NRF_SECURE) -#if defined(CONFIG_NRFS_LOCAL_DOMAIN_DVFS_TEST) - LOG_DBG("%s", __func__); - LOG_DBG("REGW: NRF_ABB->CONFIG.CTRL1.MODE 0x%x, V: 0x%x", - (uint32_t)&NRF_ABB->CONFIG.CTRL1, - LD_ABB_CLR_ZBB); -#else +#if !defined(CONFIG_NRFS_LOCAL_DOMAIN_DVFS_TEST) /* TODO: Change to NRFX Hal function when available. */ NRF_ABB->CONFIG.CTRL1 &= ~(ABB_CONFIG_CTRL1_MODE_Msk); NRF_APPLICATION_ABB->CONFIG.CTRL1 &= ~(ABB_CONFIG_CTRL1_MODE_Msk); @@ -161,34 +128,7 @@ void ld_dvfs_configure_abb_for_transition(enum dvfs_frequency_setting transient_ const struct dvfs_oppoint_data *opp_data = get_dvfs_oppoint_data(transient_opp); #if defined(CONFIG_NRFS_LOCAL_DOMAIN_DVFS_TEST) - LOG_DBG("%s", __func__); LOG_DBG("transient_opp: %d, curr_targ_opp: %d", transient_opp, curr_targ_opp); - LOG_DBG("REGW: NRF_ABB->TRIM.RINGO[%d] 0x%x, V: 0x%x", - TRANSIENT_ZBB_ABB_SLOT, - (uint32_t)&NRF_ABB->TRIM.RINGO[TRANSIENT_ZBB_ABB_SLOT], - opp_data->abb_ringo); - LOG_DBG("REGW: NRF_ABB->TRIM.LOCKRANGE[%d] 0x%x, V: 0x%x", - TRANSIENT_ZBB_ABB_SLOT, - (uint32_t)&NRF_ABB->TRIM.LOCKRANGE[TRANSIENT_ZBB_ABB_SLOT], - opp_data->abb_lockrange); - LOG_DBG("REGW: NRF_ABB->TRIM.PVTMONCYCLES[%d] 0x%x, V: 0x%x", - TRANSIENT_ZBB_ABB_SLOT, - (uint32_t)&NRF_ABB->TRIM.PVTMONCYCLES[TRANSIENT_ZBB_ABB_SLOT], - opp_data->abb_pvtmoncycles); - - /* For app core.*/ - LOG_DBG("REGW: NRF_APPLICATION_ABB->TRIM.RINGO[%d] 0x%x, V: 0x%x", - TRANSIENT_ZBB_ABB_SLOT, - (uint32_t)&NRF_APPLICATION_ABB->TRIM.RINGO[TRANSIENT_ZBB_ABB_SLOT], - opp_data->abb_ringo); - LOG_DBG("REGW: NRF_APPLICATION_ABB->TRIM.LOCKRANGE[%d] 0x%x, V: 0x%x", - TRANSIENT_ZBB_ABB_SLOT, - (uint32_t)&NRF_APPLICATION_ABB->TRIM.LOCKRANGE[TRANSIENT_ZBB_ABB_SLOT], - opp_data->abb_lockrange); - LOG_DBG("REGW: NRF_APPLICATION_ABB->TRIM.PVTMONCYCLES[%d] 0x%x, V: 0x%x", - TRANSIENT_ZBB_ABB_SLOT, - (uint32_t)&NRF_APPLICATION_ABB->TRIM.PVTMONCYCLES[TRANSIENT_ZBB_ABB_SLOT], - opp_data->abb_pvtmoncycles); #else NRF_ABB->TRIM.RINGO[TRANSIENT_ZBB_ABB_SLOT] = opp_data->abb_ringo; @@ -201,42 +141,8 @@ void ld_dvfs_configure_abb_for_transition(enum dvfs_frequency_setting transient_ #endif opp_data = get_dvfs_oppoint_data(curr_targ_opp); -#if defined(CONFIG_NRFS_LOCAL_DOMAIN_DVFS_TEST) - LOG_DBG("REGW: NRF_ABB->TRIM.RINGO[%d] 0x%x, V: 0x%x", - CURR_TARG_ABB_SLOT, - (uint32_t)&NRF_ABB->TRIM.RINGO[CURR_TARG_ABB_SLOT], - opp_data->abb_ringo); - LOG_DBG("REGW: NRF_ABB->TRIM.LOCKRANGE[%d] 0x%x, V: 0x%x", - CURR_TARG_ABB_SLOT, - (uint32_t)&NRF_ABB->TRIM.LOCKRANGE[CURR_TARG_ABB_SLOT], - opp_data->abb_lockrange); - LOG_DBG("REGW: NRF_ABB->TRIM.PVTMONCYCLES[%d] 0x%x, V: 0x%x", - CURR_TARG_ABB_SLOT, - (uint32_t)&NRF_ABB->TRIM.PVTMONCYCLES[CURR_TARG_ABB_SLOT], - opp_data->abb_pvtmoncycles); - - LOG_DBG("REGW: TODO: NRF_ABB->CONFIG.CTRL4 0x%x, V: 0x%lx", - (uint32_t)&NRF_ABB->CONFIG.CTRL4, - LD_ABB_CTRL4_TRANSITION_OPERATION); - - /* For app core */ - LOG_DBG("REGW: NRF_APPLICATION_ABB->TRIM.RINGO[%d] 0x%x, V: 0x%x", - CURR_TARG_ABB_SLOT, - (uint32_t)&NRF_APPLICATION_ABB->TRIM.RINGO[CURR_TARG_ABB_SLOT], - opp_data->abb_ringo); - LOG_DBG("REGW: NRF_APPLICATION_ABB->TRIM.LOCKRANGE[%d] 0x%x, V: 0x%x", - CURR_TARG_ABB_SLOT, - (uint32_t)&NRF_APPLICATION_ABB->TRIM.LOCKRANGE[CURR_TARG_ABB_SLOT], - opp_data->abb_lockrange); - LOG_DBG("REGW: NRF_APPLICATION_ABB->TRIM.PVTMONCYCLES[%d] 0x%x, V: 0x%x", - CURR_TARG_ABB_SLOT, - (uint32_t)&NRF_APPLICATION_ABB->TRIM.PVTMONCYCLES[CURR_TARG_ABB_SLOT], - opp_data->abb_pvtmoncycles); - - LOG_DBG("REGW: TODO: NRF_APPLICATION_ABB->CONFIG.CTRL4 0x%x, V: 0x%lx", - (uint32_t)&NRF_APPLICATION_ABB->CONFIG.CTRL4, - LD_ABB_CTRL4_TRANSITION_OPERATION); -#else +#if !defined(CONFIG_NRFS_LOCAL_DOMAIN_DVFS_TEST) + NRF_ABB->TRIM.RINGO[CURR_TARG_ABB_SLOT] = opp_data->abb_ringo; NRF_ABB->TRIM.LOCKRANGE[CURR_TARG_ABB_SLOT] = opp_data->abb_lockrange; NRF_ABB->TRIM.PVTMONCYCLES[CURR_TARG_ABB_SLOT] = opp_data->abb_pvtmoncycles; @@ -281,22 +187,6 @@ int32_t ld_dvfs_configure_hsfll(enum dvfs_frequency_setting oppoint) #if defined(CONFIG_NRFS_LOCAL_DOMAIN_DVFS_TEST) LOG_DBG("%s oppoint: %d", __func__, oppoint); - LOG_DBG("REGW: NRF_HSFLL->MIRROR 0x%x, V: 0x%x", (uint32_t)&NRF_HSFLL->MIRROR, 1); - LOG_DBG("REGW: NRF_HSFLL->TRIM.COARSE 0x%x, V: 0x%x", - (uint32_t)&NRF_HSFLL->TRIM.COARSE, - hsfll_trim.coarse); - LOG_DBG("REGW: NRF_HSFLL->TRIM.FINE 0x%x, V: 0x%x", - (uint32_t)&NRF_HSFLL->TRIM.FINE, - hsfll_trim.fine); - LOG_DBG("REGW: NRF_HSFLL->MIRROR 0x%x, V: 0x%x", (uint32_t)&NRF_HSFLL->MIRROR, 0); - - LOG_DBG("REGW: NRF_HSFLL->CLOCKCTRL.MULT 0x%x, V: 0x%x", - (uint32_t)&NRF_HSFLL->CLOCKCTRL.MULT, - get_dvfs_oppoint_data(oppoint)->new_f_mult); - - LOG_DBG("REGW: NRF_HSFLL->NRF_HSFLL_TASK_FREQ_CHANGE 0x%x, V: 0x%x", - (uint32_t)NRF_HSFLL + NRF_HSFLL_TASK_FREQ_CHANGE, - 0x1); return 0; #else @@ -337,15 +227,7 @@ void ld_dvfs_scaling_background_process(bool downscaling) void ld_dvfs_scaling_finish(bool downscaling) { #if defined(NRF_SECURE) -#if defined(CONFIG_NRFS_LOCAL_DOMAIN_DVFS_TEST) - LOG_DBG("%s", __func__); - LOG_DBG("REGW: NRF_ABB->CONFIG.CTRL4 0x%x, V: 0x%lx", - (uint32_t)&NRF_ABB->CONFIG.CTRL4, - LD_ABB_CTRL4_NORMAL_OPERATION); - LOG_DBG("REGW: NRF_APPLICATION_ABB->CONFIG.CTRL4 0x%x, V: 0x%lx", - (uint32_t)&NRF_APPLICATION_ABB->CONFIG.CTRL4, - LD_ABB_CTRL4_NORMAL_OPERATION); -#else +#if !defined(CONFIG_NRFS_LOCAL_DOMAIN_DVFS_TEST) NRF_ABB->CONFIG.CTRL4 = LD_ABB_CTRL4_NORMAL_OPERATION; NRF_APPLICATION_ABB->CONFIG.CTRL4 = LD_ABB_CTRL4_NORMAL_OPERATION; #endif From 323803cc6cf79c0cf778b4ed5dfc21c0da21ada1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Pelikan?= Date: Thu, 5 Dec 2024 14:17:12 +0100 Subject: [PATCH 0002/4042] manifest: Update hal_nordic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Manifest to include latest updates. Signed-off-by: Paweł Pelikan --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index aa77157d8635b..ef2ddad50208e 100644 --- a/west.yml +++ b/west.yml @@ -189,7 +189,7 @@ manifest: groups: - hal - name: hal_nordic - revision: e0e48c4ec75595767a286389e2fcda72b21363b0 + revision: pull/264/head path: modules/hal/nordic groups: - hal From bfe58bb68d26eb2efb393ad9ea29b5d11a9a0029 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Cab=C3=A9?= Date: Tue, 3 Dec 2024 15:37:12 +0100 Subject: [PATCH 0003/4042] doc: thread-analyzer: add links to kconfigs and use definition list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes the list of Kconfig associated to the thread analyzer feature more readable and also adds links to the detailed Kconfig documentation. Signed-off-by: Benjamin Cabé --- doc/services/debugging/thread-analyzer.rst | 32 +++++++++++++--------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/doc/services/debugging/thread-analyzer.rst b/doc/services/debugging/thread-analyzer.rst index 2b41099df028a..57e433ff176c4 100644 --- a/doc/services/debugging/thread-analyzer.rst +++ b/doc/services/debugging/thread-analyzer.rst @@ -67,19 +67,25 @@ Configuration ************* Configure this module using the following options. -* ``THREAD_ANALYZER``: enable the module. -* ``THREAD_ANALYZER_USE_PRINTK``: use printk for thread statistics. -* ``THREAD_ANALYZER_USE_LOG``: use the logger for thread statistics. -* ``THREAD_ANALYZER_AUTO``: run the thread analyzer automatically. - You do not need to add any code to the application when using this option. -* ``THREAD_ANALYZER_AUTO_INTERVAL``: the time for which the module sleeps - between consecutive printing of thread analysis in automatic mode. -* ``THREAD_ANALYZER_AUTO_STACK_SIZE``: the stack for thread analyzer - automatic thread. -* ``THREAD_NAME``: enable this option in the kernel to print the name of the - thread instead of its ID. -* ``THREAD_RUNTIME_STATS``: enable this option to print thread runtime data such - as utilization (This options is automatically selected by THREAD_ANALYZER). +:kconfig:option:`CONFIG_THREAD_ANALYZER` + Enable the module. +:kconfig:option:`CONFIG_THREAD_ANALYZER_USE_PRINTK` + Use printk for thread statistics. +:kconfig:option:`CONFIG_THREAD_ANALYZER_USE_LOG` + Use the logger for thread statistics. +:kconfig:option:`CONFIG_THREAD_ANALYZER_AUTO` + Run the thread analyzer automatically. + You do not need to add any code to the application when using this option. +:kconfig:option:`CONFIG_THREAD_ANALYZER_AUTO_INTERVAL` + The time for which the module sleeps between consecutive printing of thread analysis in automatic + mode. +:kconfig:option:`CONFIG_THREAD_ANALYZER_AUTO_STACK_SIZE` + The stack for thread analyzer automatic thread. +:kconfig:option:`CONFIG_THREAD_NAME` + Print the name of the thread instead of its ID. +:kconfig:option:`CONFIG_THREAD_RUNTIME_STATS` + Print thread runtime data such as utilization. + This options is automatically selected by :kconfig:option:`CONFIG_THREAD_ANALYZER`. API documentation ***************** From 79e63e1cfd576ec596ba7fa4468cb85d0d65b896 Mon Sep 17 00:00:00 2001 From: Armin Kessler Date: Tue, 3 Dec 2024 13:08:39 +0100 Subject: [PATCH 0004/4042] scripts: twister: add esp32 runner Adds support for the `esp32` runner when using the hardware-map feature. Signed-off-by: Armin Kessler --- scripts/pylib/twister/twisterlib/handlers.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/pylib/twister/twisterlib/handlers.py b/scripts/pylib/twister/twisterlib/handlers.py index c67ec07349aad..72aaf79620301 100755 --- a/scripts/pylib/twister/twisterlib/handlers.py +++ b/scripts/pylib/twister/twisterlib/handlers.py @@ -566,10 +566,14 @@ def _create_command(self, runner, hardware): board_id = hardware.probe_id or hardware.id product = hardware.product + serial_port = hardware.serial if board_id is not None: if runner in ("pyocd", "nrfjprog", "nrfutil"): command_extra_args.append("--dev-id") command_extra_args.append(board_id) + elif runner == "esp32": + command_extra_args.append("--esp-device") + command_extra_args.append(serial_port) elif ( runner == "openocd" and product == "STM32 STLink" From 688f845b3d534ccb48b3f6b648aeb56ec678d162 Mon Sep 17 00:00:00 2001 From: Arkadiusz Balys Date: Tue, 3 Dec 2024 09:16:27 +0100 Subject: [PATCH 0005/4042] doc: releases: 4.1: Mention "imply NVS" removal in OpenThread. The NET_L2_OPENTHREAD symbol no longer implies the NVS Kconfig option. Platforms using OpenThread must explicitly enable either NVS or ZMS option. A release note and migration guide entries were added. Signed-off-by: Arkadiusz Balys --- doc/releases/migration-guide-4.1.rst | 4 ++++ doc/releases/release-notes-4.1.rst | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/releases/migration-guide-4.1.rst b/doc/releases/migration-guide-4.1.rst index 61f3d0f34c52e..a1949f82a1075 100644 --- a/doc/releases/migration-guide-4.1.rst +++ b/doc/releases/migration-guide-4.1.rst @@ -275,6 +275,10 @@ Networking rather than directly in the :c:struct:`http_client_ctx` to correctly handle concurrent requests on different HTTP/2 streams. +* The :kconfig:option:`CONFIG_NET_L2_OPENTHREAD` symbol no longer implies the + :kconfig:option:`CONFIG_NVS` Kconfig option. Platforms using OpenThread must explicitly enable + either the :kconfig:option:`CONFIG_NVS` or :kconfig:option:`CONFIG_ZMS` Kconfig option. + Other Subsystems **************** diff --git a/doc/releases/release-notes-4.1.rst b/doc/releases/release-notes-4.1.rst index 9b0810b0a1a07..70d2a699da650 100644 --- a/doc/releases/release-notes-4.1.rst +++ b/doc/releases/release-notes-4.1.rst @@ -254,7 +254,9 @@ Networking * Network Interface: -* OpenThread +* OpenThread: + + * Removed the implicit enabling of the :kconfig:option:`CONFIG_NVS` Kconfig option by the :kconfig:option:`CONFIG_NET_L2_OPENTHREAD` symbol. * PPP From b283574de7810cdb887266966821d404c6ae0726 Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Mon, 2 Dec 2024 10:15:16 +0100 Subject: [PATCH 0006/4042] drivers: all: telink-b91: select PINCTRL Select PINCTRL as needed. Signed-off-by: Gerard Marull-Paretas --- drivers/i2c/Kconfig.b91 | 1 + drivers/pwm/Kconfig.b91 | 1 + drivers/serial/Kconfig.b91 | 1 + drivers/spi/Kconfig.b91 | 1 + 4 files changed, 4 insertions(+) diff --git a/drivers/i2c/Kconfig.b91 b/drivers/i2c/Kconfig.b91 index 932e4cc693d17..aa0bc1a89b989 100644 --- a/drivers/i2c/Kconfig.b91 +++ b/drivers/i2c/Kconfig.b91 @@ -5,5 +5,6 @@ config I2C_TELINK_B91 bool "Telink Semiconductor B91 I2C driver" default y depends on DT_HAS_TELINK_B91_I2C_ENABLED + select PINCTRL help Enables Telink B91 I2C driver. diff --git a/drivers/pwm/Kconfig.b91 b/drivers/pwm/Kconfig.b91 index 9e710b4a6de13..4102483ebc02c 100644 --- a/drivers/pwm/Kconfig.b91 +++ b/drivers/pwm/Kconfig.b91 @@ -5,5 +5,6 @@ config PWM_TELINK_B91 bool "Telink Semiconductor B91 PWM driver" default y depends on DT_HAS_TELINK_B91_PWM_ENABLED + select PINCTRL help Enables Telink B91 PWM driver. diff --git a/drivers/serial/Kconfig.b91 b/drivers/serial/Kconfig.b91 index e7eb9d1f579f8..3664d1cb8e58a 100644 --- a/drivers/serial/Kconfig.b91 +++ b/drivers/serial/Kconfig.b91 @@ -9,5 +9,6 @@ config UART_TELINK_B91 depends on DT_HAS_TELINK_B91_UART_ENABLED select SERIAL_HAS_DRIVER select SERIAL_SUPPORT_INTERRUPT + select PINCTRL help This option enables the B91 serial driver. diff --git a/drivers/spi/Kconfig.b91 b/drivers/spi/Kconfig.b91 index 3cc63d3289c85..4192a6695e625 100644 --- a/drivers/spi/Kconfig.b91 +++ b/drivers/spi/Kconfig.b91 @@ -5,5 +5,6 @@ config SPI_TELINK_B91 bool "Telink Semiconductor B91 SPI driver" default y depends on DT_HAS_TELINK_B91_SPI_ENABLED + select PINCTRL help Enables Telink B91 SPI driver. From 23fad7bca0406f1598857a818aef485617773e72 Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Mon, 2 Dec 2024 10:15:38 +0100 Subject: [PATCH 0007/4042] soc: telink: tlsr: tlsr951x: remove PINCTRL defconfig Relevant drivers now select this option. Signed-off-by: Gerard Marull-Paretas --- soc/telink/tlsr/tlsr951x/Kconfig.defconfig | 3 --- 1 file changed, 3 deletions(-) diff --git a/soc/telink/tlsr/tlsr951x/Kconfig.defconfig b/soc/telink/tlsr/tlsr951x/Kconfig.defconfig index b210321b07966..777a0ac6f44e3 100644 --- a/soc/telink/tlsr/tlsr951x/Kconfig.defconfig +++ b/soc/telink/tlsr/tlsr951x/Kconfig.defconfig @@ -12,9 +12,6 @@ config RISCV_SOC_INTERRUPT_INIT config NUM_IRQS default 64 -config PINCTRL - default y - config XIP default n From 23dd86d30075016a3632fa1f772a941ef425ebf6 Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Mon, 2 Dec 2024 09:45:18 +0100 Subject: [PATCH 0008/4042] drivers: all: cc12xx_cc26xx: select PINCTRL select PINCTRL when needed instead of relying on board-level options. Signed-off-by: Gerard Marull-Paretas --- drivers/i2c/Kconfig.cc13xx_cc26xx | 1 + drivers/pwm/Kconfig.cc13xx_cc26xx_timer | 1 + drivers/serial/Kconfig.cc13xx_cc26xx | 1 + drivers/spi/Kconfig.cc13xx_cc26xx | 1 + 4 files changed, 4 insertions(+) diff --git a/drivers/i2c/Kconfig.cc13xx_cc26xx b/drivers/i2c/Kconfig.cc13xx_cc26xx index d015fdc6e870c..a8ed30fb5b9b8 100644 --- a/drivers/i2c/Kconfig.cc13xx_cc26xx +++ b/drivers/i2c/Kconfig.cc13xx_cc26xx @@ -5,5 +5,6 @@ config I2C_CC13XX_CC26XX bool "TI SimpleLink CC13xx / CC26xx I2C driver" default y depends on DT_HAS_TI_CC13XX_CC26XX_I2C_ENABLED + select PINCTRL help Enable support for I2C on the TI SimpleLink CC13xx / CC26xx series. diff --git a/drivers/pwm/Kconfig.cc13xx_cc26xx_timer b/drivers/pwm/Kconfig.cc13xx_cc26xx_timer index c111ad307fae8..11d8b90ac9ef9 100644 --- a/drivers/pwm/Kconfig.cc13xx_cc26xx_timer +++ b/drivers/pwm/Kconfig.cc13xx_cc26xx_timer @@ -5,5 +5,6 @@ config PWM_CC13XX_CC26XX_TIMER bool "TI SimpleLink CC13xx/CC26xx GPT timer PWM driver" default y depends on DT_HAS_TI_CC13XX_CC26XX_TIMER_PWM_ENABLED + select PINCTRL help Enables TI SimpleLink CC13xx/CC26xx GPT timer PWM driver. diff --git a/drivers/serial/Kconfig.cc13xx_cc26xx b/drivers/serial/Kconfig.cc13xx_cc26xx index bae19b38ffb92..4c17db3764ef0 100644 --- a/drivers/serial/Kconfig.cc13xx_cc26xx +++ b/drivers/serial/Kconfig.cc13xx_cc26xx @@ -9,5 +9,6 @@ config UART_CC13XX_CC26XX depends on DT_HAS_TI_CC13XX_CC26XX_UART_ENABLED select SERIAL_HAS_DRIVER select SERIAL_SUPPORT_INTERRUPT + select PINCTRL help Enable the TI SimpleLink CC13xx / CC26xx UART driver. diff --git a/drivers/spi/Kconfig.cc13xx_cc26xx b/drivers/spi/Kconfig.cc13xx_cc26xx index 58e6a6c02d9e0..cf64ee39a6398 100644 --- a/drivers/spi/Kconfig.cc13xx_cc26xx +++ b/drivers/spi/Kconfig.cc13xx_cc26xx @@ -7,5 +7,6 @@ config SPI_CC13XX_CC26XX bool "TI SimpleLink CC13xx / CC26xx SPI driver" default y depends on DT_HAS_TI_CC13XX_CC26XX_SPI_ENABLED + select PINCTRL help Enable support for the TI SimpleLink CC13xx / CC26xx SPI peripheral From 3708e95b561ca8c31b7f7d5b43edb3b427dc6632 Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Mon, 2 Dec 2024 09:46:15 +0100 Subject: [PATCH 0009/4042] boards: ti: cc13xx_cc26xx: remove CONFIG_PINCTRL=y It is no longer needed, as drivers select this option. Signed-off-by: Gerard Marull-Paretas --- boards/ti/cc1352p1_launchxl/cc1352p1_launchxl_defconfig | 1 - boards/ti/cc1352r1_launchxl/cc1352r1_launchxl_defconfig | 1 - boards/ti/cc1352r_sensortag/cc1352r_sensortag_defconfig | 1 - boards/ti/cc26x2r1_launchxl/cc26x2r1_launchxl_defconfig | 1 - 4 files changed, 4 deletions(-) diff --git a/boards/ti/cc1352p1_launchxl/cc1352p1_launchxl_defconfig b/boards/ti/cc1352p1_launchxl/cc1352p1_launchxl_defconfig index 42ca455ed3302..4e65416ca5373 100644 --- a/boards/ti/cc1352p1_launchxl/cc1352p1_launchxl_defconfig +++ b/boards/ti/cc1352p1_launchxl/cc1352p1_launchxl_defconfig @@ -16,7 +16,6 @@ CONFIG_CC13X2_CC26X2_BOOTLOADER_BACKDOOR_PIN=15 CONFIG_ARM_MPU=y CONFIG_HW_STACK_PROTECTION=y -CONFIG_PINCTRL=y CONFIG_GPIO=y CONFIG_SERIAL=y diff --git a/boards/ti/cc1352r1_launchxl/cc1352r1_launchxl_defconfig b/boards/ti/cc1352r1_launchxl/cc1352r1_launchxl_defconfig index 872843de16d29..3977a366b5210 100644 --- a/boards/ti/cc1352r1_launchxl/cc1352r1_launchxl_defconfig +++ b/boards/ti/cc1352r1_launchxl/cc1352r1_launchxl_defconfig @@ -14,7 +14,6 @@ CONFIG_CC13X2_CC26X2_BOOTLOADER_BACKDOOR_PIN=15 CONFIG_ARM_MPU=y CONFIG_HW_STACK_PROTECTION=y -CONFIG_PINCTRL=y CONFIG_GPIO=y CONFIG_SERIAL=y diff --git a/boards/ti/cc1352r_sensortag/cc1352r_sensortag_defconfig b/boards/ti/cc1352r_sensortag/cc1352r_sensortag_defconfig index 2cddbd5af73e2..84b07413d0c8d 100644 --- a/boards/ti/cc1352r_sensortag/cc1352r_sensortag_defconfig +++ b/boards/ti/cc1352r_sensortag/cc1352r_sensortag_defconfig @@ -13,7 +13,6 @@ CONFIG_CC13X2_CC26X2_BOOTLOADER_BACKDOOR_PIN=15 CONFIG_ARM_MPU=y CONFIG_HW_STACK_PROTECTION=y -CONFIG_PINCTRL=y CONFIG_GPIO=y CONFIG_SERIAL=y diff --git a/boards/ti/cc26x2r1_launchxl/cc26x2r1_launchxl_defconfig b/boards/ti/cc26x2r1_launchxl/cc26x2r1_launchxl_defconfig index d10e7a152e52d..f4aa8c3c54159 100644 --- a/boards/ti/cc26x2r1_launchxl/cc26x2r1_launchxl_defconfig +++ b/boards/ti/cc26x2r1_launchxl/cc26x2r1_launchxl_defconfig @@ -14,7 +14,6 @@ CONFIG_CC13X2_CC26X2_BOOTLOADER_BACKDOOR_PIN=13 CONFIG_ARM_MPU=y CONFIG_HW_STACK_PROTECTION=y -CONFIG_PINCTRL=y CONFIG_GPIO=y CONFIG_SERIAL=y From 878bc4bffae92c1a6f83b092d47af157f61acf32 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Sun, 14 Jul 2024 06:32:32 +0200 Subject: [PATCH 0010/4042] Bluetooth: Controller: Fix reschedule for ticker that yield Fix reschedule for ticker that yield such that reduce the slot window after intersection to include required ticks_slot, and we do not take the interval of the colliding ticker provided every expiry increments the interval by random amount of ticks. This is the case for primary channel advertising. Fixes commit e1cd5ba77f59 ("Bluetooth: Controller: Fix to reschedule after overlap when yielding"). Signed-off-by: Vinayak Kariappa Chettimada --- subsys/bluetooth/controller/ticker/ticker.c | 79 +++++++++++---------- 1 file changed, 42 insertions(+), 37 deletions(-) diff --git a/subsys/bluetooth/controller/ticker/ticker.c b/subsys/bluetooth/controller/ticker/ticker.c index 622134b486bf7..7806956c630ac 100644 --- a/subsys/bluetooth/controller/ticker/ticker.c +++ b/subsys/bluetooth/controller/ticker/ticker.c @@ -2484,6 +2484,17 @@ static uint8_t ticker_job_reschedule_in_window(struct ticker_instance *instance) /* Ensure that resched ticker is expired */ LL_ASSERT(ticker_resched->ticks_to_expire == 0U); + /* Use ticker's reserved time ticks_slot, else for unreserved + * tickers use the reschedule margin as ticks_slot. + */ + if (ticker_resched->ticks_slot) { + ticks_slot = ticker_resched->ticks_slot; + } else { + LL_ASSERT(TICKER_HAS_SLOT_WINDOW(ticker_resched)); + + ticks_slot = HAL_TICKER_RESCHEDULE_MARGIN; + } + /* Window start after intersection with already active node */ window_start_ticks = instance->ticks_slot_previous + HAL_TICKER_RESCHEDULE_MARGIN; @@ -2498,13 +2509,32 @@ static uint8_t ticker_job_reschedule_in_window(struct ticker_instance *instance) * and not be restricted to ticks_slot_window - ticks_drift. */ ext_data = ticker_resched->ext_data; - if (ext_data->ticks_drift < ext_data->ticks_slot_window) { + if (IS_ENABLED(CONFIG_BT_TICKER_EXT_SLOT_WINDOW_YIELD) && + ticker_resched->ticks_slot && + !ext_data->ticks_drift && + !ext_data->is_drift_in_window) { + /* Use slot window after intersection include required + * ticks_slot, and we do not take the interval of the + * colliding ticker provided every expiry increments the + * interval by random amount of ticks. + */ + ticks_slot_window = window_start_ticks + ticks_slot; + + /* Window available, proceed to calculate further + * drift + */ + ticker_id_next = ticker_resched->next; + + } else if (ext_data->ticks_drift < ext_data->ticks_slot_window) { + /* Use reduced slot window */ ticks_slot_window = ext_data->ticks_slot_window - ext_data->ticks_drift; + /* Window available, proceed to calculate further * drift */ ticker_id_next = ticker_resched->next; + } else { /* Window has been exhausted - we can't reschedule */ ticker_id_next = TICKER_NULL; @@ -2513,17 +2543,6 @@ static uint8_t ticker_job_reschedule_in_window(struct ticker_instance *instance) ticks_slot_window = 0U; } - /* Use ticker's reserved time ticks_slot, else for unreserved - * tickers use the reschedule margin as ticks_slot. - */ - if (ticker_resched->ticks_slot) { - ticks_slot = ticker_resched->ticks_slot; - } else { - LL_ASSERT(TICKER_HAS_SLOT_WINDOW(ticker_resched)); - - ticks_slot = HAL_TICKER_RESCHEDULE_MARGIN; - } - /* Try to find available slot for re-scheduling */ ticks_to_expire_offset = 0U; ticks_start_offset = 0U; @@ -2579,17 +2598,6 @@ static uint8_t ticker_job_reschedule_in_window(struct ticker_instance *instance) ticks_to_expire = 0U; } - /* Skip other pending re-schedule nodes and - * tickers with no reservation or not periodic - */ - if (TICKER_RESCHEDULE_PENDING(ticker_next) || - !ticker_next->ticks_slot || - !ticker_next->ticks_periodic) { - ticker_id_next = ticker_next->next; - - continue; - } - /* Decide if the re-scheduling ticker node fits in the * slot found - break if it fits */ @@ -2604,6 +2612,17 @@ static uint8_t ticker_job_reschedule_in_window(struct ticker_instance *instance) ticks_to_expire = 0U; } + /* Skip other pending re-schedule nodes and + * tickers with no reservation or not periodic + */ + if (TICKER_RESCHEDULE_PENDING(ticker_next) || + !ticker_next->ticks_slot || + !ticker_next->ticks_periodic) { + ticker_id_next = ticker_next->next; + + continue; + } + /* We din't find a valid slot for re-scheduling - try * the next node */ @@ -2621,20 +2640,6 @@ static uint8_t ticker_job_reschedule_in_window(struct ticker_instance *instance) /* Try at the end of the next node */ ticks_to_expire = window_start_ticks; } - } else if (IS_ENABLED(CONFIG_BT_TICKER_EXT_SLOT_WINDOW_YIELD) && - (ticker_resched->ticks_periodic < - ticker_next->ticks_periodic)) { - uint32_t ticks_slot_with_margin = ticker_resched->ticks_slot + - HAL_TICKER_RESCHEDULE_MARGIN; - - /* Try to place it before the overlap and be - * rescheduled to its next periodic interval - * for collision resolution. - */ - if (ticks_start_offset > ticks_slot_with_margin) { - ticks_to_expire = ticks_start_offset - - ticks_slot_with_margin; - } } else { /* Try at the end of the slot window. This * ensures that ticker with slot window and that From 2618aa320bee20f9ebdf4a10626e29ccd6c0d050 Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Mon, 4 Nov 2024 13:54:00 +0100 Subject: [PATCH 0011/4042] tests: Bluetooth: CAP: Acceptor bsim test use ext_adv Remove a duplicated advertising set in the CAP acceptor babblesim test. The advertising set is configured in test_start_adv. The BSIM test for the CAP acceptor used legacy instead of extended advertising. This also adds the required advertising data and validation on the CAP initiator and CAP commander. Signed-off-by: Emil Gydesen --- .../bluetooth/audio/src/cap_acceptor_test.c | 24 ++-- .../bluetooth/audio/src/cap_commander_test.c | 118 +++++++++++------- .../audio/src/cap_initiator_unicast_test.c | 118 +++++++++++------- 3 files changed, 165 insertions(+), 95 deletions(-) diff --git a/tests/bsim/bluetooth/audio/src/cap_acceptor_test.c b/tests/bsim/bluetooth/audio/src/cap_acceptor_test.c index 4a4cc6a22c135..49fbcfef5e105 100644 --- a/tests/bsim/bluetooth/audio/src/cap_acceptor_test.c +++ b/tests/bsim/bluetooth/audio/src/cap_acceptor_test.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -412,7 +413,22 @@ static struct bt_bap_scan_delegator_cb scan_delegator_cbs = { /* TODO: Expand with CAP service data */ static const struct bt_data cap_acceptor_ad[] = { BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)), - BT_DATA_BYTES(BT_DATA_UUID16_ALL, BT_UUID_16_ENCODE(BT_UUID_CAS_VAL)), + BT_DATA(BT_DATA_NAME_COMPLETE, CONFIG_BT_DEVICE_NAME, sizeof(CONFIG_BT_DEVICE_NAME) - 1), + BT_DATA_BYTES(BT_DATA_UUID16_SOME, BT_UUID_16_ENCODE(BT_UUID_ASCS_VAL), + BT_UUID_16_ENCODE(BT_UUID_CAS_VAL)), + BT_DATA_BYTES(BT_DATA_SVC_DATA16, BT_UUID_16_ENCODE(BT_UUID_CAS_VAL), + BT_AUDIO_UNICAST_ANNOUNCEMENT_TARGETED), + IF_ENABLED(CONFIG_BT_BAP_UNICAST_SERVER, + (BT_DATA_BYTES(BT_DATA_SVC_DATA16, + BT_UUID_16_ENCODE(BT_UUID_ASCS_VAL), + BT_AUDIO_UNICAST_ANNOUNCEMENT_TARGETED, + BT_BYTES_LIST_LE16(SINK_CONTEXT), + BT_BYTES_LIST_LE16(SOURCE_CONTEXT), + 0x00, /* Metadata length */), + )) + IF_ENABLED(CONFIG_BT_BAP_SCAN_DELEGATOR, + (BT_DATA_BYTES(BT_DATA_SVC_DATA16, BT_UUID_16_ENCODE(BT_UUID_BASS_VAL)), + )) }; static struct bt_csip_set_member_svc_inst *csip_set_member; @@ -733,12 +749,6 @@ static void init(void) bt_cap_stream_ops_register(&unicast_streams[i], &unicast_stream_ops); } - err = bt_le_adv_start(BT_LE_ADV_CONN_FAST_1, cap_acceptor_ad, - ARRAY_SIZE(cap_acceptor_ad), NULL, 0); - if (err != 0) { - FAIL("Advertising failed to start (err %d)\n", err); - return; - } test_start_adv(); } diff --git a/tests/bsim/bluetooth/audio/src/cap_commander_test.c b/tests/bsim/bluetooth/audio/src/cap_commander_test.c index cbd91fe265d9c..aecb6faa6a0a7 100644 --- a/tests/bsim/bluetooth/audio/src/cap_commander_test.c +++ b/tests/bsim/bluetooth/audio/src/cap_commander_test.c @@ -507,8 +507,75 @@ static struct bt_bap_broadcast_assistant_cb ba_cbs = { .add_src = bap_broadcast_assistant_add_src_cb, }; +static bool check_audio_support_and_connect_cb(struct bt_data *data, void *user_data) +{ + char addr_str[BT_ADDR_LE_STR_LEN]; + bt_addr_le_t *addr = user_data; + const struct bt_uuid *uuid; + uint16_t uuid_val; + int err; + + printk("data->type %u\n", data->type); + + if (data->type != BT_DATA_SVC_DATA16) { + return true; /* Continue parsing to next AD data type */ + } + + if (data->data_len < sizeof(uuid_val)) { + return true; /* Continue parsing to next AD data type */ + } + + /* We are looking for the CAS service data */ + uuid_val = sys_get_le16(data->data); + uuid = BT_UUID_DECLARE_16(uuid_val); + if (bt_uuid_cmp(uuid, BT_UUID_CAS) != 0) { + return true; /* Continue parsing to next AD data type */ + } + + bt_addr_le_to_str(addr, addr_str, sizeof(addr_str)); + printk("Device found: %s\n", addr_str); + + printk("Stopping scan\n"); + if (bt_le_scan_stop()) { + FAIL("Could not stop scan"); + return false; + } + + err = bt_conn_le_create(addr, BT_CONN_LE_CREATE_CONN, + BT_LE_CONN_PARAM(BT_GAP_INIT_CONN_INT_MIN, BT_GAP_INIT_CONN_INT_MIN, + 0, BT_GAP_MS_TO_CONN_TIMEOUT(4000)), + &connected_conns[connected_conn_cnt]); + if (err != 0) { + FAIL("Could not connect to peer: %d", err); + } + + return false; /* Stop parsing */ +} + +static void scan_recv_cb(const struct bt_le_scan_recv_info *info, struct net_buf_simple *buf) +{ + struct bt_conn *conn; + + conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, info->addr); + if (conn != NULL) { + /* Already connected to this device */ + bt_conn_unref(conn); + return; + } + + /* Check for connectable, extended advertising */ + if (((info->adv_props & BT_GAP_ADV_PROP_EXT_ADV) != 0) && + ((info->adv_props & BT_GAP_ADV_PROP_CONNECTABLE)) != 0) { + /* Check for TMAS support in advertising data */ + bt_data_parse(buf, check_audio_support_and_connect_cb, (void *)info->addr); + } +} + static void init(size_t acceptor_cnt) { + static struct bt_le_scan_cb scan_callbacks = { + .recv = scan_recv_cb, + }; static struct bt_conn_cb conn_cb = { .disconnected = cap_disconnected_cb, }; @@ -521,6 +588,12 @@ static void init(size_t acceptor_cnt) } bt_gatt_cb_register(&gatt_callbacks); + err = bt_le_scan_cb_register(&scan_callbacks); + if (err != 0) { + FAIL("Failed to register scan callbacks (err %d)\n", err); + return; + } + bt_conn_cb_register(&conn_cb); err = bt_cap_commander_register_cb(&cap_cb); @@ -573,56 +646,13 @@ static void init(size_t acceptor_cnt) UNSET_FLAG(flag_syncable); } -static void cap_device_found(const bt_addr_le_t *addr, int8_t rssi, uint8_t type, - struct net_buf_simple *ad) -{ - char addr_str[BT_ADDR_LE_STR_LEN]; - struct bt_conn *conn; - int err; - - /* We're only interested in connectable events */ - if (type != BT_HCI_ADV_IND && type != BT_HCI_ADV_DIRECT_IND) { - return; - } - - conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, addr); - if (conn != NULL) { - /* Already connected to this device */ - bt_conn_unref(conn); - return; - } - - bt_addr_le_to_str(addr, addr_str, sizeof(addr_str)); - printk("Device found: %s (RSSI %d)\n", addr_str, rssi); - - /* connect only to devices in close proximity */ - if (rssi < -70) { - FAIL("RSSI too low"); - return; - } - - printk("Stopping scan\n"); - if (bt_le_scan_stop()) { - FAIL("Could not stop scan"); - return; - } - - err = bt_conn_le_create(addr, BT_CONN_LE_CREATE_CONN, - BT_LE_CONN_PARAM(BT_GAP_INIT_CONN_INT_MIN, BT_GAP_INIT_CONN_INT_MIN, - 0, BT_GAP_MS_TO_CONN_TIMEOUT(4000)), - &connected_conns[connected_conn_cnt]); - if (err) { - FAIL("Could not connect to peer: %d", err); - } -} - static void scan_and_connect(void) { int err; UNSET_FLAG(flag_connected); - err = bt_le_scan_start(BT_LE_SCAN_PASSIVE, cap_device_found); + err = bt_le_scan_start(BT_LE_SCAN_PASSIVE, NULL); if (err != 0) { FAIL("Scanning failed to start (err %d)\n", err); return; diff --git a/tests/bsim/bluetooth/audio/src/cap_initiator_unicast_test.c b/tests/bsim/bluetooth/audio/src/cap_initiator_unicast_test.c index 920d4b6631778..1c6b44e80bab8 100644 --- a/tests/bsim/bluetooth/audio/src/cap_initiator_unicast_test.c +++ b/tests/bsim/bluetooth/audio/src/cap_initiator_unicast_test.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -367,8 +368,75 @@ static struct bt_gatt_cb gatt_callbacks = { .att_mtu_updated = att_mtu_updated, }; +static bool check_audio_support_and_connect_cb(struct bt_data *data, void *user_data) +{ + char addr_str[BT_ADDR_LE_STR_LEN]; + bt_addr_le_t *addr = user_data; + const struct bt_uuid *uuid; + uint16_t uuid_val; + int err; + + printk("data->type %u\n", data->type); + + if (data->type != BT_DATA_SVC_DATA16) { + return true; /* Continue parsing to next AD data type */ + } + + if (data->data_len < sizeof(uuid_val)) { + return true; /* Continue parsing to next AD data type */ + } + + /* We are looking for the CAS service data */ + uuid_val = sys_get_le16(data->data); + uuid = BT_UUID_DECLARE_16(uuid_val); + if (bt_uuid_cmp(uuid, BT_UUID_CAS) != 0) { + return true; /* Continue parsing to next AD data type */ + } + + bt_addr_le_to_str(addr, addr_str, sizeof(addr_str)); + printk("Device found: %s\n", addr_str); + + printk("Stopping scan\n"); + if (bt_le_scan_stop()) { + FAIL("Could not stop scan"); + return false; + } + + err = bt_conn_le_create(addr, BT_CONN_LE_CREATE_CONN, + BT_LE_CONN_PARAM(BT_GAP_INIT_CONN_INT_MIN, BT_GAP_INIT_CONN_INT_MIN, + 0, BT_GAP_MS_TO_CONN_TIMEOUT(4000)), + &connected_conns[connected_conn_cnt]); + if (err != 0) { + FAIL("Could not connect to peer: %d", err); + } + + return false; /* Stop parsing */ +} + +static void scan_recv_cb(const struct bt_le_scan_recv_info *info, struct net_buf_simple *buf) +{ + struct bt_conn *conn; + + conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, info->addr); + if (conn != NULL) { + /* Already connected to this device */ + bt_conn_unref(conn); + return; + } + + /* Check for connectable, extended advertising */ + if (((info->adv_props & BT_GAP_ADV_PROP_EXT_ADV) != 0) && + ((info->adv_props & BT_GAP_ADV_PROP_CONNECTABLE)) != 0) { + /* Check for TMAS support in advertising data */ + bt_data_parse(buf, check_audio_support_and_connect_cb, (void *)info->addr); + } +} + static void init(void) { + static struct bt_le_scan_cb scan_callbacks = { + .recv = scan_recv_cb, + }; int err; err = bt_enable(NULL); @@ -378,6 +446,11 @@ static void init(void) } bt_gatt_cb_register(&gatt_callbacks); + err = bt_le_scan_cb_register(&scan_callbacks); + if (err != 0) { + FAIL("Failed to register scan callbacks (err %d)\n", err); + return; + } err = bt_bap_unicast_client_register_cb(&unicast_client_cbs); if (err != 0) { @@ -404,56 +477,13 @@ static void init(void) } } -static void cap_device_found(const bt_addr_le_t *addr, int8_t rssi, uint8_t type, - struct net_buf_simple *ad) -{ - char addr_str[BT_ADDR_LE_STR_LEN]; - struct bt_conn *conn; - int err; - - /* We're only interested in connectable events */ - if (type != BT_HCI_ADV_IND && type != BT_HCI_ADV_DIRECT_IND) { - return; - } - - conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, addr); - if (conn != NULL) { - /* Already connected to this device */ - bt_conn_unref(conn); - return; - } - - bt_addr_le_to_str(addr, addr_str, sizeof(addr_str)); - printk("Device found: %s (RSSI %d)\n", addr_str, rssi); - - /* connect only to devices in close proximity */ - if (rssi < -70) { - FAIL("RSSI too low"); - return; - } - - printk("Stopping scan\n"); - if (bt_le_scan_stop()) { - FAIL("Could not stop scan"); - return; - } - - err = bt_conn_le_create(addr, BT_CONN_LE_CREATE_CONN, - BT_LE_CONN_PARAM(BT_GAP_INIT_CONN_INT_MIN, BT_GAP_INIT_CONN_INT_MIN, - 0, BT_GAP_MS_TO_CONN_TIMEOUT(4000)), - &connected_conns[connected_conn_cnt]); - if (err) { - FAIL("Could not connect to peer: %d", err); - } -} - static void scan_and_connect(void) { int err; UNSET_FLAG(flag_connected); - err = bt_le_scan_start(BT_LE_SCAN_PASSIVE, cap_device_found); + err = bt_le_scan_start(BT_LE_SCAN_PASSIVE, NULL); if (err != 0) { FAIL("Scanning failed to start (err %d)\n", err); return; From e2a871d079800eb11b9ed71ebdccf7398db80073 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Thu, 28 Nov 2024 22:03:54 +0100 Subject: [PATCH 0012/4042] Revert "tests: bsim: comment out some failing AC tests" This reverts commit 1320b3dd6616c517c6de382163eab21b69b417aa. Signed-off-by: Vinayak Kariappa Chettimada --- .../audio/test_scripts/cap_broadcast_ac_12.sh | 8 ++++---- .../audio/test_scripts/cap_broadcast_ac_14.sh | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/bsim/bluetooth/audio/test_scripts/cap_broadcast_ac_12.sh b/tests/bsim/bluetooth/audio/test_scripts/cap_broadcast_ac_12.sh index 5237a07b83df1..b7fc2721d623a 100755 --- a/tests/bsim/bluetooth/audio/test_scripts/cap_broadcast_ac_12.sh +++ b/tests/bsim/bluetooth/audio/test_scripts/cap_broadcast_ac_12.sh @@ -56,14 +56,14 @@ Execute_AC_12 8_2_2 Execute_AC_12 16_1_2 Execute_AC_12 16_2_2 Execute_AC_12 24_1_2 -# Execute_AC_12 24_2_2 # ISO receive error +Execute_AC_12 24_2_2 Execute_AC_12 32_1_2 Execute_AC_12 32_2_2 # Execute_AC_12 441_1_2 # BT_ISO_FLAGS_LOST # Execute_AC_12 441_2_2 # BT_ISO_FLAGS_LOST Execute_AC_12 48_1_2 -# Execute_AC_12 48_2_2 # ISO receive error -# Execute_AC_12 48_3_2 # ISO receive error -# Execute_AC_12 48_4_2 # ISO receive error +Execute_AC_12 48_2_2 +Execute_AC_12 48_3_2 +Execute_AC_12 48_4_2 Execute_AC_12 48_5_2 Execute_AC_12 48_6_2 diff --git a/tests/bsim/bluetooth/audio/test_scripts/cap_broadcast_ac_14.sh b/tests/bsim/bluetooth/audio/test_scripts/cap_broadcast_ac_14.sh index 9d356351e0579..6c09053a0a223 100755 --- a/tests/bsim/bluetooth/audio/test_scripts/cap_broadcast_ac_14.sh +++ b/tests/bsim/bluetooth/audio/test_scripts/cap_broadcast_ac_14.sh @@ -54,18 +54,18 @@ Execute_AC_14 48_6_1 # High reliability Execute_AC_14 8_1_2 -# Execute_AC_14 8_2_2 # ISO receive error +Execute_AC_14 8_2_2 Execute_AC_14 16_1_2 Execute_AC_14 16_2_2 -# Execute_AC_14 24_1_2 # ISO receive error -# Execute_AC_14 24_2_2 # ISO receive error -# Execute_AC_14 32_1_2 # ISO receive error +Execute_AC_14 24_1_2 +Execute_AC_14 24_2_2 +Execute_AC_14 32_1_2 Execute_AC_14 32_2_2 # Execute_AC_14 441_1_2 # BT_ISO_FLAGS_LOST # Execute_AC_14 441_2_2 # BT_ISO_FLAGS_ERROR # Execute_AC_14 48_1_2 # ISO receive error Execute_AC_14 48_2_2 -# Execute_AC_14 48_3_2 # ISO receive error -# Execute_AC_14 48_4_2 # ISO receive error +Execute_AC_14 48_3_2 +Execute_AC_14 48_4_2 # Execute_AC_14 48_5_2 # BT_ISO_FLAGS_ERROR # Execute_AC_14 48_6_2 # BT_ISO_FLAGS_ERROR From ae67271f67ca39dc883f0c9c496084d41c46c512 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Thu, 28 Nov 2024 06:10:41 +0100 Subject: [PATCH 0013/4042] Revert "test: bsim: bt: fix test scripts" This reverts commit 18119e8f6e3d735f5fbe09f443b02ef8fdb285f5. Audio tests are enabled back, but change to random number seed is retained for the multiple identity test. Signed-off-by: Vinayak Kariappa Chettimada --- tests/bsim/bluetooth/audio/test_scripts/cap_broadcast_ac_14.sh | 2 +- tests/bsim/bluetooth/audio/test_scripts/cap_unicast_ac_6_i.sh | 2 +- tests/bsim/bluetooth/audio/test_scripts/cap_unicast_ac_6_ii.sh | 2 +- tests/bsim/bluetooth/audio/test_scripts/cap_unicast_ac_7_ii.sh | 2 +- tests/bsim/bluetooth/audio/test_scripts/cap_unicast_ac_9_i.sh | 2 +- tests/bsim/bluetooth/audio/test_scripts/cap_unicast_ac_9_ii.sh | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/bsim/bluetooth/audio/test_scripts/cap_broadcast_ac_14.sh b/tests/bsim/bluetooth/audio/test_scripts/cap_broadcast_ac_14.sh index 6c09053a0a223..1b5484a42acc3 100755 --- a/tests/bsim/bluetooth/audio/test_scripts/cap_broadcast_ac_14.sh +++ b/tests/bsim/bluetooth/audio/test_scripts/cap_broadcast_ac_14.sh @@ -63,7 +63,7 @@ Execute_AC_14 32_1_2 Execute_AC_14 32_2_2 # Execute_AC_14 441_1_2 # BT_ISO_FLAGS_LOST # Execute_AC_14 441_2_2 # BT_ISO_FLAGS_ERROR -# Execute_AC_14 48_1_2 # ISO receive error +Execute_AC_14 48_1_2 Execute_AC_14 48_2_2 Execute_AC_14 48_3_2 Execute_AC_14 48_4_2 diff --git a/tests/bsim/bluetooth/audio/test_scripts/cap_unicast_ac_6_i.sh b/tests/bsim/bluetooth/audio/test_scripts/cap_unicast_ac_6_i.sh index 9370022788eca..344ebb0448b79 100755 --- a/tests/bsim/bluetooth/audio/test_scripts/cap_unicast_ac_6_i.sh +++ b/tests/bsim/bluetooth/audio/test_scripts/cap_unicast_ac_6_i.sh @@ -41,7 +41,7 @@ Execute_AC_6_I 32_2_1 # Execute_AC_6_I 441_1_1 # ASSERTION FAIL [iso_interval_us >= cig->c_sdu_interval] # Execute_AC_6_I 441_2_1 # ASSERTION FAIL [iso_interval_us >= cig->c_sdu_interval] Execute_AC_6_I 48_1_1 -# Execute_AC_6_I 48_2_1 # test timeout +Execute_AC_6_I 48_2_1 Execute_AC_6_I 48_3_1 Execute_AC_6_I 48_4_1 Execute_AC_6_I 48_5_1 diff --git a/tests/bsim/bluetooth/audio/test_scripts/cap_unicast_ac_6_ii.sh b/tests/bsim/bluetooth/audio/test_scripts/cap_unicast_ac_6_ii.sh index 6a783dcf6e0d4..e04df69690891 100755 --- a/tests/bsim/bluetooth/audio/test_scripts/cap_unicast_ac_6_ii.sh +++ b/tests/bsim/bluetooth/audio/test_scripts/cap_unicast_ac_6_ii.sh @@ -47,7 +47,7 @@ Execute_AC_6_II 32_2_1 # Execute_AC_6_II 441_1_1 # ASSERTION FAIL [iso_interval_us >= cig->c_sdu_interval] # Execute_AC_6_II 441_2_1 # ASSERTION FAIL [iso_interval_us >= cig->c_sdu_interval] Execute_AC_6_II 48_1_1 -# Execute_AC_6_II 48_2_1 # Fails at PR 79931 +Execute_AC_6_II 48_2_1 Execute_AC_6_II 48_3_1 Execute_AC_6_II 48_4_1 Execute_AC_6_II 48_5_1 diff --git a/tests/bsim/bluetooth/audio/test_scripts/cap_unicast_ac_7_ii.sh b/tests/bsim/bluetooth/audio/test_scripts/cap_unicast_ac_7_ii.sh index f2e5ab7752aae..ce6c9abdf89f8 100755 --- a/tests/bsim/bluetooth/audio/test_scripts/cap_unicast_ac_7_ii.sh +++ b/tests/bsim/bluetooth/audio/test_scripts/cap_unicast_ac_7_ii.sh @@ -47,7 +47,7 @@ Execute_AC_7_II 32_2_1 32_2_1 # Execute_AC_7_II 441_1_1 441_1_1 # ASSERTION FAIL [iso_interval_us >= cig->c_sdu_interval] # Execute_AC_7_II 441_2_1 441_2_1 # ASSERTION FAIL [iso_interval_us >= cig->c_sdu_interval] Execute_AC_7_II 48_1_1 48_1_1 -# Execute_AC_7_II 48_2_1 48_2_1 # Fails at PR 79931 +Execute_AC_7_II 48_2_1 48_2_1 Execute_AC_7_II 48_3_1 48_3_1 Execute_AC_7_II 48_4_1 48_4_1 Execute_AC_7_II 48_5_1 48_5_1 diff --git a/tests/bsim/bluetooth/audio/test_scripts/cap_unicast_ac_9_i.sh b/tests/bsim/bluetooth/audio/test_scripts/cap_unicast_ac_9_i.sh index 5c2df6dfc4f96..1a00f55e43307 100755 --- a/tests/bsim/bluetooth/audio/test_scripts/cap_unicast_ac_9_i.sh +++ b/tests/bsim/bluetooth/audio/test_scripts/cap_unicast_ac_9_i.sh @@ -43,7 +43,7 @@ Execute_AC_9_I 32_2_1 # Execute_AC_9_I 441_1_1 # ASSERTION FAIL [iso_interval_us >= cig->c_sdu_interval] # Execute_AC_9_I 441_2_1 # ASSERTION FAIL [iso_interval_us >= cig->c_sdu_interval] Execute_AC_9_I 48_1_1 -# Execute_AC_9_I 48_2_1 # test timeout +Execute_AC_9_I 48_2_1 Execute_AC_9_I 48_3_1 Execute_AC_9_I 48_4_1 Execute_AC_9_I 48_5_1 diff --git a/tests/bsim/bluetooth/audio/test_scripts/cap_unicast_ac_9_ii.sh b/tests/bsim/bluetooth/audio/test_scripts/cap_unicast_ac_9_ii.sh index 95082e2e8599c..207d81f663e74 100755 --- a/tests/bsim/bluetooth/audio/test_scripts/cap_unicast_ac_9_ii.sh +++ b/tests/bsim/bluetooth/audio/test_scripts/cap_unicast_ac_9_ii.sh @@ -47,7 +47,7 @@ Execute_AC_9_II 32_2_1 # Execute_AC_9_II 441_1_1 # ASSERTION FAIL [iso_interval_us >= cig->c_sdu_interval] # Execute_AC_9_II 441_2_1 # ASSERTION FAIL [iso_interval_us >= cig->c_sdu_interval] Execute_AC_9_II 48_1_1 -# Execute_AC_9_II 48_2_1 +Execute_AC_9_II 48_2_1 Execute_AC_9_II 48_3_1 Execute_AC_9_II 48_4_1 Execute_AC_9_II 48_5_1 From dcc717d8a21be293880dae348d412e1f22ab4e4c Mon Sep 17 00:00:00 2001 From: Audun Korneliussen Date: Thu, 17 Oct 2024 12:29:26 +0200 Subject: [PATCH 0014/4042] drivers: sensor: npm1300_charger: Updating of discharge current limit Update discharge current limit property to be aligned with the most recent npm1300 datasheet. This affects the discharge current measurement calculation, which needs to be scaled accordingly. Signed-off-by: Audun Korneliussen --- .../nordic/npm1300_charger/npm1300_charger.c | 24 +++++++++---------- .../sensor/nordic,npm1300-charger.yaml | 6 +++-- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/sensor/nordic/npm1300_charger/npm1300_charger.c b/drivers/sensor/nordic/npm1300_charger/npm1300_charger.c index f772494915ce8..eb49859f3e819 100644 --- a/drivers/sensor/nordic/npm1300_charger/npm1300_charger.c +++ b/drivers/sensor/nordic/npm1300_charger/npm1300_charger.c @@ -18,6 +18,7 @@ struct npm1300_charger_config { int32_t term_warm_microvolt; int32_t current_microamp; int32_t dischg_limit_microamp; + uint8_t dischg_limit_idx; int32_t vbus_limit_microamp; int32_t temp_thresholds[4U]; int32_t dietemp_thresholds[2U]; @@ -142,8 +143,8 @@ static const struct linear_range charger_volt_ranges[] = { /* Linear range for charger current */ static const struct linear_range charger_current_range = LINEAR_RANGE_INIT(32000, 2000, 16U, 400U); -/* Linear range for Discharge limit */ -static const struct linear_range discharge_limit_range = LINEAR_RANGE_INIT(268090, 3230, 83U, 415U); +/* Allowed values for discharge limit */ +static const uint16_t discharge_limits[] = {84U, 415U}; /* Linear range for vbusin current limit */ static const struct linear_range vbus_current_ranges[] = { @@ -197,7 +198,7 @@ static void calc_current(const struct npm1300_charger_config *const config, switch (data->ibat_stat) { case IBAT_STAT_DISCHARGE: - full_scale_ma = config->dischg_limit_microamp / 1000; + full_scale_ma = config->dischg_limit_microamp / 893; break; case IBAT_STAT_CHARGE_TRICKLE: /* Fallthrough */ @@ -563,16 +564,10 @@ int npm1300_charger_init(const struct device *dev) return ret; } - /* Set discharge limit, allow rounding down to closest value */ - ret = linear_range_get_win_index(&discharge_limit_range, - config->dischg_limit_microamp - discharge_limit_range.step, - config->dischg_limit_microamp, &idx); - if (ret == -EINVAL) { - return ret; - } - - ret = mfd_npm1300_reg_write2(config->mfd, CHGR_BASE, CHGR_OFFSET_ISET_DISCHG, idx / 2U, - idx & 1U); + /* Set discharge limit */ + ret = mfd_npm1300_reg_write2(config->mfd, CHGR_BASE, CHGR_OFFSET_ISET_DISCHG, + discharge_limits[config->dischg_limit_idx] / 2U, + discharge_limits[config->dischg_limit_idx] & 1U); if (ret != 0) { return ret; } @@ -669,6 +664,8 @@ static DEVICE_API(sensor, npm1300_charger_battery_driver_api) = { }; #define NPM1300_CHARGER_INIT(n) \ + BUILD_ASSERT(DT_INST_ENUM_IDX(n, dischg_limit_microamp) < ARRAY_SIZE(discharge_limits)); \ + \ static struct npm1300_charger_data npm1300_charger_data_##n; \ \ static const struct npm1300_charger_config npm1300_charger_config_##n = { \ @@ -678,6 +675,7 @@ static DEVICE_API(sensor, npm1300_charger_battery_driver_api) = { DT_INST_PROP_OR(n, term_warm_microvolt, DT_INST_PROP(n, term_microvolt)), \ .current_microamp = DT_INST_PROP(n, current_microamp), \ .dischg_limit_microamp = DT_INST_PROP(n, dischg_limit_microamp), \ + .dischg_limit_idx = DT_INST_ENUM_IDX(n, dischg_limit_microamp), \ .vbus_limit_microamp = DT_INST_PROP(n, vbus_limit_microamp), \ .thermistor_ohms = DT_INST_PROP(n, thermistor_ohms), \ .thermistor_idx = DT_INST_ENUM_IDX(n, thermistor_ohms), \ diff --git a/dts/bindings/sensor/nordic,npm1300-charger.yaml b/dts/bindings/sensor/nordic,npm1300-charger.yaml index d28323bf133e5..fa5fe30ccd1b2 100644 --- a/dts/bindings/sensor/nordic,npm1300-charger.yaml +++ b/dts/bindings/sensor/nordic,npm1300-charger.yaml @@ -36,10 +36,12 @@ properties: dischg-limit-microamp: type: int required: true + enum: + - 200000 + - 1000000 description: | Discharge current limit in uA. - Available range is 270 mA to 1340 mA in 3.23 mA steps. - The value specified will be rounded down to the closest implemented value. + Available values are 200 mA and 1000 mA. vbus-limit-microamp: type: int From f682fdfe05bf852e57b68fc890c67cb7fda6ae2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Thu, 5 Dec 2024 10:56:28 +0100 Subject: [PATCH 0015/4042] MAINTAINERS: microchip mec platform: filter it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit don't assign all microchip dts bindings to Microchip MEC Platforms. Signed-off-by: Fin Maaß --- MAINTAINERS.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MAINTAINERS.yml b/MAINTAINERS.yml index 5badb24d1eefa..b15fb8c28ee04 100644 --- a/MAINTAINERS.yml +++ b/MAINTAINERS.yml @@ -3806,7 +3806,8 @@ Microchip MEC Platforms: - drivers/*/*mchp*.c - tests/boards/mec15xxevb_assy6853/ - tests/boards/mec172xevb_assy6906/ - - dts/bindings/*/microchip,* + - dts/bindings/*/microchip,mec* + - dts/bindings/*/microchip,xec* labels: - "platform: Microchip MEC" From ef6e30ea1aaf705f2ac79869d57e0a1dcc5afb5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Cab=C3=A9?= Date: Thu, 5 Dec 2024 14:40:19 +0100 Subject: [PATCH 0016/4042] boards: waveshare: adopt new rp2040.dtsi location MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This boards was merged before rp2040.dtsi changed location. Update the include in its dts file accordingly Signed-off-by: Benjamin Cabé --- boards/waveshare/rp2040_zero/rp2040_zero.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boards/waveshare/rp2040_zero/rp2040_zero.dts b/boards/waveshare/rp2040_zero/rp2040_zero.dts index 9d582a970549f..88c41f55d2e87 100644 --- a/boards/waveshare/rp2040_zero/rp2040_zero.dts +++ b/boards/waveshare/rp2040_zero/rp2040_zero.dts @@ -6,7 +6,7 @@ /dts-v1/; -#include +#include #include "rp2040_zero-pinctrl.dtsi" #include #include From 4064d12d56b8c68de08bf5bb1414798062b89f10 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Tue, 19 Nov 2024 22:09:11 +0530 Subject: [PATCH 0017/4042] hostap: Fix build after upmerge Latest hostap (through upmerge) has intdocued a separate data structure for signal info, so, fix the build errors. Also, fix the variable rename for current TX rate. Signed-off-by: Chaitanya Tata --- drivers/wifi/nrf_wifi/src/wpa_supp_if.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c index 292c1b9117a6d..75a6fa6c6b5e0 100644 --- a/drivers/wifi/nrf_wifi/src/wpa_supp_if.c +++ b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c @@ -1191,7 +1191,7 @@ int nrf_wifi_wpa_supp_signal_poll(void *if_priv, struct wpa_signal_info *si, uns goto out; } } else { - si->current_signal = (int)vif_ctx_zep->rssi; + si->data.signal = (int)vif_ctx_zep->rssi; } ret = nrf_wifi_fmac_get_interface(rpu_ctx_zep->rpu_ctx, vif_ctx_zep->vif_idx); @@ -1242,28 +1242,28 @@ void nrf_wifi_wpa_supp_event_proc_get_sta(void *if_priv, } if (info->sta_info.valid_fields & NRF_WIFI_STA_INFO_SIGNAL_VALID) { - signal_info->current_signal = info->sta_info.signal; + signal_info->data.signal = info->sta_info.signal; } else { - signal_info->current_signal = -WPA_INVALID_NOISE; + signal_info->data.signal = 0; } if (info->sta_info.valid_fields & NRF_WIFI_STA_INFO_SIGNAL_AVG_VALID) { - signal_info->avg_signal = info->sta_info.signal_avg; + signal_info->data.avg_signal = info->sta_info.signal_avg; } else { - signal_info->avg_signal = -WPA_INVALID_NOISE; + signal_info->data.avg_signal = 0; } if (info->sta_info.valid_fields & NRF_WIFI_STA_INFO_RX_BEACON_SIGNAL_AVG_VALID) { - signal_info->avg_beacon_signal = info->sta_info.rx_beacon_signal_avg; + signal_info->data.avg_beacon_signal = info->sta_info.rx_beacon_signal_avg; } else { - signal_info->avg_beacon_signal = -WPA_INVALID_NOISE; + signal_info->data.avg_beacon_signal = 0; } - signal_info->current_txrate = 0; + signal_info->data.current_tx_rate = 0; if (info->sta_info.valid_fields & NRF_WIFI_STA_INFO_TX_BITRATE_VALID) { if (info->sta_info.tx_bitrate.valid_fields & NRF_WIFI_RATE_INFO_BITRATE_VALID) { - signal_info->current_txrate = info->sta_info.tx_bitrate.bitrate * 100; + signal_info->data.current_tx_rate = info->sta_info.tx_bitrate.bitrate * 100; } } out: From 069b3937dc9bed5a288c6b8ce3b9dbcb17517cb9 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Tue, 19 Nov 2024 22:10:24 +0530 Subject: [PATCH 0018/4042] modules: hostap: Fix build error with upmerge These files are now unconditiaonlly included, the defines within the file takes care of both enable and disable of the feature. Signed-off-by: Chaitanya Tata --- modules/hostap/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/hostap/CMakeLists.txt b/modules/hostap/CMakeLists.txt index cfb10bb23599c..5448460dd6dbe 100644 --- a/modules/hostap/CMakeLists.txt +++ b/modules/hostap/CMakeLists.txt @@ -133,6 +133,9 @@ zephyr_library_sources( ${WIFI_NM_WPA_SUPPLICANT_BASE}/ctrl_iface_zephyr.c ${WIFI_NM_WPA_SUPPLICANT_BASE}/wpa_cli_zephyr.c + ${HOSTAP_SRC_BASE}/rsn_supp/pmksa_cache.c + ${HOSTAP_SRC_BASE}/common/ptksa_cache.c + # Zephyr specific files (glue code) src/supp_main.c src/supp_api.c @@ -563,7 +566,6 @@ zephyr_library_sources_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_EAPOL ${HOSTAP_SRC_BASE}/eap_peer/eap.c ${HOSTAP_SRC_BASE}/eap_peer/eap_methods.c ${HOSTAP_SRC_BASE}/eap_common/eap_common.c - ${HOSTAP_SRC_BASE}/rsn_supp/pmksa_cache.c ) zephyr_library_compile_definitions_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_EAPOL From 8f537219622b958f9fd21596edf8e2111409ffb4 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Wed, 20 Nov 2024 12:05:19 +0530 Subject: [PATCH 0019/4042] modules: hostap: Fix build error with AP and WPA3 The comeback token functionality is now moved to a separate file. Signed-off-by: Chaitanya Tata --- modules/hostap/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/hostap/CMakeLists.txt b/modules/hostap/CMakeLists.txt index 5448460dd6dbe..a76b34f8a3a08 100644 --- a/modules/hostap/CMakeLists.txt +++ b/modules/hostap/CMakeLists.txt @@ -187,6 +187,7 @@ zephyr_library_sources( ${HOSTAP_SRC_BASE}/ap/hw_features.c ${HOSTAP_SRC_BASE}/ap/ieee802_11_auth.c ${HOSTAP_SRC_BASE}/ap/ieee802_11.c + ${HOSTAP_SRC_BASE}/ap/comeback_token.c ${HOSTAP_SRC_BASE}/ap/ieee802_11_ht.c ${HOSTAP_SRC_BASE}/ap/ieee802_11_shared.c ${HOSTAP_SRC_BASE}/ap/ieee802_11_vht.c From a9378e0547092d2a587b391ef9ec1c0cf29b24cf Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Wed, 20 Nov 2024 12:05:47 +0530 Subject: [PATCH 0020/4042] modules: hostap: Fix DPP3 build failure MbedTLS Crypto ALT implementation clearly states that DPP3 isn't supported, remove DPP3 to fix a build error related to HPKE. Signed-off-by: Chaitanya Tata --- modules/hostap/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/hostap/Kconfig b/modules/hostap/Kconfig index d61cdce704e1b..2e50cea2154c9 100644 --- a/modules/hostap/Kconfig +++ b/modules/hostap/Kconfig @@ -335,7 +335,6 @@ config WIFI_NM_WPA_SUPPLICANT_DPP bool "WFA Easy Connect DPP" select DPP select DPP2 - select DPP3 select GAS select GAS_SERVER select OFFCHANNEL From bf931e455fd4f048b1ccbaa54864a239854ba96e Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Wed, 20 Nov 2024 13:09:37 +0530 Subject: [PATCH 0021/4042] modules: hostap: Fix the callback for EAPoL The signature of callback and the callback function is now changed, so, add a wrapper to convert b/w them. Signed-off-by: Chaitanya Tata --- modules/hostap/src/supp_main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/hostap/src/supp_main.c b/modules/hostap/src/supp_main.c index 5ac548034693e..da6c4f01c81eb 100644 --- a/modules/hostap/src/supp_main.c +++ b/modules/hostap/src/supp_main.c @@ -645,6 +645,12 @@ struct hostapd_iface *hostapd_get_interface(const char *ifname) return ctx->hostapd.iface[0]; } +static void hostapd_event_eapol_rx_cb(void *ctx, const u8 *src_addr, + const u8 *buf, size_t len) +{ + hostapd_event_eapol_rx(ctx, src_addr, buf, len, FRAME_ENCRYPTION_UNKNOWN, -1); +} + static int hostapd_enable_iface_cb(struct hostapd_iface *hapd_iface) { struct hostapd_data *bss; @@ -662,7 +668,7 @@ static int hostapd_enable_iface_cb(struct hostapd_iface *hapd_iface) l2_packet_deinit(bss->l2); bss->l2 = l2_packet_init(bss->conf->iface, bss->conf->bssid, ETH_P_EAPOL, - &hostapd_event_eapol_rx, bss, 0); + &hostapd_event_eapol_rx_cb, bss, 0); if (bss->l2 == NULL) { wpa_printf(MSG_ERROR, "Failed to initialize l2 for hostapd interface"); return -1; From 4347f327b4066f413f9c09dc5f9ba550c8a1bc3f Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Tue, 26 Nov 2024 20:32:08 +0530 Subject: [PATCH 0022/4042] manifest: hal_nxp: Pull Wi-Fi driver build fixes The build fixes for NXP Wi-Fi driver to work with the latest hostap upmerge. Signed-off-by: Chaitanya Tata --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index ef2ddad50208e..477facd49d7f2 100644 --- a/west.yml +++ b/west.yml @@ -199,7 +199,7 @@ manifest: groups: - hal - name: hal_nxp - revision: c42d70dba969de09c0e43d3b26a3ffcb015f6f33 + revision: 0ea9c65e8e14fe01c055e571ad2e6fe5337dc58d path: modules/hal/nxp groups: - hal From 9efb32e27ff85f93c7e3e66db9795ff831d429b9 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Tue, 19 Nov 2024 21:52:44 +0530 Subject: [PATCH 0023/4042] manifest: hostap: Pull in hostap 2.11 upmerge changes Pull hostap 2.11 upmerge changes. Signed-off-by: Chaitanya Tata --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 477facd49d7f2..e8080cc3fcd39 100644 --- a/west.yml +++ b/west.yml @@ -265,7 +265,7 @@ manifest: - hal - name: hostap path: modules/lib/hostap - revision: 14f350c2ad022529720cbf04432a825c28b469ec + revision: 4e4f601dae390263a91744db174fda4640d652cf - name: liblc3 revision: 1a5938ebaca4f13fe79ce074f5dee079783aa29f path: modules/lib/liblc3 From 1820f48ceb0bf2a0c3af308295841778fb3a470b Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Tue, 3 Dec 2024 14:35:51 -0500 Subject: [PATCH 0024/4042] manifest: sof: sync with upstream project Update to sha bc08c9c60 and sync with latest upstream. Signed-off-by: Anas Nashif --- submanifests/optional.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submanifests/optional.yaml b/submanifests/optional.yaml index 8365f5d5b02e2..a2ee931bd4af5 100644 --- a/submanifests/optional.yaml +++ b/submanifests/optional.yaml @@ -35,7 +35,7 @@ manifest: groups: - optional - name: sof - revision: 316f414b64dee8e4aefce503af6c2c2e57d266f4 + revision: bc08c9c606324cfba0c104f4ffaf5dd456cb11d6 path: modules/audio/sof remote: upstream groups: From abe480d876d1cf39b0350d656e85223eafe46a88 Mon Sep 17 00:00:00 2001 From: Dominik Ermel Date: Tue, 3 Dec 2024 18:56:48 +0000 Subject: [PATCH 0025/4042] drivers/flash/flexspi_x25um51345g: Fix broken support for get_size Fix incorrectly implemented flash_get_size callback. Fixes #82364 Signed-off-by: Dominik Ermel --- drivers/flash/flash_mcux_flexspi_mx25um51345g.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/flash/flash_mcux_flexspi_mx25um51345g.c b/drivers/flash/flash_mcux_flexspi_mx25um51345g.c index 0e5aaa97e0d39..56d23d52e9075 100644 --- a/drivers/flash/flash_mcux_flexspi_mx25um51345g.c +++ b/drivers/flash/flash_mcux_flexspi_mx25um51345g.c @@ -67,7 +67,7 @@ struct flash_flexspi_nor_data { const struct device *controller; flexspi_device_config_t config; flexspi_port_t port; - uint64_t *size; + uint64_t size; struct flash_pages_layout layout; struct flash_parameters flash_parameters; }; @@ -500,9 +500,9 @@ static const struct flash_parameters *flash_flexspi_nor_get_parameters( static int flash_flexspi_nor_get_size(const struct device *dev, uint64_t *size) { - const struct flash_flexspi_nor_config *config = dev->config; + const struct flash_flexspi_nor_data *data = dev->data; - *size = config->size; + *size = data->size; return 0; } From 689163c6bc854b37d70cc3cc1e0442f1f9d29c84 Mon Sep 17 00:00:00 2001 From: Pieter De Gendt Date: Tue, 3 Dec 2024 17:59:11 +0100 Subject: [PATCH 0026/4042] drivers: display: display_ili9xxx: Allow multiple instances The ili9xxx driver is used for multiple variants, but did not support different ones at the same time. Use unique variable names for each variant. Signed-off-by: Pieter De Gendt --- drivers/display/display_ili9340.h | 2 +- drivers/display/display_ili9341.h | 2 +- drivers/display/display_ili9342c.h | 2 +- drivers/display/display_ili9488.h | 2 +- drivers/display/display_ili9xxx.c | 10 +++++----- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/display/display_ili9340.h b/drivers/display/display_ili9340.h index 50836b030181c..aaa0d2bfd210b 100644 --- a/drivers/display/display_ili9340.h +++ b/drivers/display/display_ili9340.h @@ -50,7 +50,7 @@ struct ili9340_regs { /* Initializer macro for ILI9340 registers. */ #define ILI9340_REGS_INIT(n) \ - static const struct ili9340_regs ili9xxx_regs_##n = { \ + static const struct ili9340_regs ili9340_regs_##n = { \ .gamset = DT_PROP(DT_INST(n, ilitek_ili9340), gamset), \ .frmctr1 = DT_PROP(DT_INST(n, ilitek_ili9340), frmctr1), \ .disctrl = DT_PROP(DT_INST(n, ilitek_ili9340), disctrl), \ diff --git a/drivers/display/display_ili9341.h b/drivers/display/display_ili9341.h index 5ffd60fc5cb99..b46f6ba9fb01e 100644 --- a/drivers/display/display_ili9341.h +++ b/drivers/display/display_ili9341.h @@ -121,7 +121,7 @@ struct ili9341_regs { "ili9341: Error length frame rate control (IFCTL) register"); \ BUILD_ASSERT(DT_PROP_LEN(DT_INST(n, ilitek_ili9341), etmod) == ILI9341_ETMOD_LEN, \ "ili9341: Error length entry Mode Set (ETMOD) register"); \ - static const struct ili9341_regs ili9xxx_regs_##n = { \ + static const struct ili9341_regs ili9341_regs_##n = { \ .gamset = DT_PROP(DT_INST(n, ilitek_ili9341), gamset), \ .ifmode = DT_PROP(DT_INST(n, ilitek_ili9341), ifmode), \ .frmctr1 = DT_PROP(DT_INST(n, ilitek_ili9341), frmctr1), \ diff --git a/drivers/display/display_ili9342c.h b/drivers/display/display_ili9342c.h index c5cc8fb5b9f13..d028248cff0ca 100644 --- a/drivers/display/display_ili9342c.h +++ b/drivers/display/display_ili9342c.h @@ -67,7 +67,7 @@ struct ili9342c_regs { /* Initializer macro for ILI9342C registers. */ #define ILI9342c_REGS_INIT(n) \ - static const struct ili9342c_regs ili9xxx_regs_##n = { \ + static const struct ili9342c_regs ili9342c_regs_##n = { \ .gamset = DT_PROP(DT_INST(n, ilitek_ili9342c), gamset), \ .ifmode = DT_PROP(DT_INST(n, ilitek_ili9342c), ifmode), \ .frmctr1 = DT_PROP(DT_INST(n, ilitek_ili9342c), frmctr1), \ diff --git a/drivers/display/display_ili9488.h b/drivers/display/display_ili9488.h index 8cb9f37b50739..93d8be2d830a3 100644 --- a/drivers/display/display_ili9488.h +++ b/drivers/display/display_ili9488.h @@ -44,7 +44,7 @@ struct ili9488_regs { /* Initializer macro for ILI9488 registers. */ #define ILI9488_REGS_INIT(n) \ - static const struct ili9488_regs ili9xxx_regs_##n = { \ + static const struct ili9488_regs ili9488_regs_##n = { \ .frmctr1 = DT_PROP(DT_INST(n, ilitek_ili9488), frmctr1), \ .disctrl = DT_PROP(DT_INST(n, ilitek_ili9488), disctrl), \ .pwctrl1 = DT_PROP(DT_INST(n, ilitek_ili9488), pwctrl1), \ diff --git a/drivers/display/display_ili9xxx.c b/drivers/display/display_ili9xxx.c index e28ba65d1849b..8e18d81607520 100644 --- a/drivers/display/display_ili9xxx.c +++ b/drivers/display/display_ili9xxx.c @@ -517,7 +517,7 @@ static const struct ili9xxx_quirks ili9488_quirks = { #define ILI9XXX_INIT(n, t) \ ILI##t##_REGS_INIT(n); \ \ - static const struct ili9xxx_config ili9xxx_config_##n = { \ + static const struct ili9xxx_config ili9##t##_config_##n = { \ .quirks = &ili##t##_quirks, \ .mipi_dev = DEVICE_DT_GET(DT_PARENT(INST_DT_ILI9XXX(n, t))), \ .dbi_config = { \ @@ -535,15 +535,15 @@ static const struct ili9xxx_quirks ili9488_quirks = { .x_resolution = ILI##t##_X_RES, \ .y_resolution = ILI##t##_Y_RES, \ .inversion = DT_PROP(INST_DT_ILI9XXX(n, t), display_inversion),\ - .regs = &ili9xxx_regs_##n, \ + .regs = &ili##t##_regs_##n, \ .regs_init_fn = ili##t##_regs_init, \ }; \ \ - static struct ili9xxx_data ili9xxx_data_##n; \ + static struct ili9xxx_data ili9##t##_data_##n; \ \ DEVICE_DT_DEFINE(INST_DT_ILI9XXX(n, t), ili9xxx_init, \ - NULL, &ili9xxx_data_##n, \ - &ili9xxx_config_##n, POST_KERNEL, \ + NULL, &ili9##t##_data_##n, \ + &ili9##t##_config_##n, POST_KERNEL, \ CONFIG_DISPLAY_INIT_PRIORITY, &ili9xxx_api) #define DT_INST_FOREACH_ILI9XXX_STATUS_OKAY(t) \ From 5a62ca1fc37fe4bae9dca9ad0032c80ac2230288 Mon Sep 17 00:00:00 2001 From: Andy Ross Date: Fri, 29 Nov 2024 07:37:46 -0800 Subject: [PATCH 0027/4042] soc/mt8196: Set SDK toolchain name This is in sdk-ng upstream now (not in the current release yet), so set it up. Signed-off-by: Andy Ross --- soc/mediatek/mt8xxx/Kconfig.defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/soc/mediatek/mt8xxx/Kconfig.defconfig b/soc/mediatek/mt8xxx/Kconfig.defconfig index 8603103104427..303be6c87b848 100644 --- a/soc/mediatek/mt8xxx/Kconfig.defconfig +++ b/soc/mediatek/mt8xxx/Kconfig.defconfig @@ -61,6 +61,7 @@ config XTENSA_HAL config SOC_TOOLCHAIN_NAME default "mtk_mt8195_adsp" if SOC_SERIES_MT8195 default "mtk_mt818x_adsp" if SOC_SERIES_MT818X + default "mtk_mt8196_adsp" if SOC_SERIES_MT8196 config XTENSA_RESET_VECTOR default n From 0e3e324c302892dbffa1ea619f4136292e682998 Mon Sep 17 00:00:00 2001 From: Andy Ross Date: Mon, 18 Nov 2024 16:58:54 -0800 Subject: [PATCH 0028/4042] scripts/west/sign: Auto-detect rimage ELF files This code had a growing "enumerate all the platforms" wart. In point of fact only intel_adsp is special here. Other rimage platforms don't have a bootloader and use zephyr.elf directly. Don't hard code platform names (especially since they aren't the same as board/soc names!). Just autodetect which scheme we have at runtime. Signed-off-by: Andy Ross --- scripts/west_commands/sign.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/west_commands/sign.py b/scripts/west_commands/sign.py index 6f11e673a1782..99ad690a115fc 100644 --- a/scripts/west_commands/sign.py +++ b/scripts/west_commands/sign.py @@ -469,19 +469,19 @@ def sign(self, command, build_dir, build_conf, formats): kernel_name = build_conf.get('CONFIG_KERNEL_BIN_NAME', 'zephyr') - # TODO: make this a new sign.py --bootloader option. - if target in ('imx8', 'imx8m', 'imx8ulp', 'imx95', 'rmb'): - bootloader = None - kernel = str(b / 'zephyr' / f'{kernel_name}.elf') - out_bin = str(b / 'zephyr' / f'{kernel_name}.ri') - out_xman = str(b / 'zephyr' / f'{kernel_name}.ri.xman') - out_tmp = str(b / 'zephyr' / f'{kernel_name}.rix') - else: + bootloader = None + kernel = str(b / 'zephyr' / f'{kernel_name}.elf') + out_bin = str(b / 'zephyr' / f'{kernel_name}.ri') + out_xman = str(b / 'zephyr' / f'{kernel_name}.ri.xman') + out_tmp = str(b / 'zephyr' / f'{kernel_name}.rix') + + # Intel platforms generate a "boot.mod" and "main.mod" as + # separate intermediates to use. Other platforms just use + # zephyr.elf directly. + if os.path.exists(str(b / 'zephyr' / 'boot.mod')): bootloader = str(b / 'zephyr' / 'boot.mod') + if os.path.exists(str(b / 'zephyr' / 'main.mod')): kernel = str(b / 'zephyr' / 'main.mod') - out_bin = str(b / 'zephyr' / f'{kernel_name}.ri') - out_xman = str(b / 'zephyr' / f'{kernel_name}.ri.xman') - out_tmp = str(b / 'zephyr' / f'{kernel_name}.rix') # Clean any stale output. This is especially important when using --if-tool-available # (but not just) From ecf3c1d202df6c711f44c15bf4653b82aae6e023 Mon Sep 17 00:00:00 2001 From: Andy Ross Date: Mon, 18 Nov 2024 17:01:18 -0800 Subject: [PATCH 0029/4042] soc/mediatek/adsp: Build zephyr.ri using rimage when available This is mostly a cut/paste copy of similar code in intel_adsp and imx, which sadly can't be shared given the way the design works. Also includes a bonus, slightly-passive-aggressive description of why that is. Signed-off-by: Andy Ross --- soc/mediatek/mt8xxx/CMakeLists.txt | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/soc/mediatek/mt8xxx/CMakeLists.txt b/soc/mediatek/mt8xxx/CMakeLists.txt index 96d0ae468b14a..82228618dcfe7 100644 --- a/soc/mediatek/mt8xxx/CMakeLists.txt +++ b/soc/mediatek/mt8xxx/CMakeLists.txt @@ -12,3 +12,33 @@ add_custom_target(dsp_img ALL COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/gen_img.py ${ZEPHYR_BINARY_DIR}/${KERNEL_ELF_NAME} ${CMAKE_BINARY_DIR}/zephyr/zephyr.img) + +# Sign zephyr.ri using west (if the underlying rimage tool is +# available; generally it isn't except in SOF builds). Note that the +# "target" string to use for rimage is set at the board level as a +# RIMAGE_TARGET cached (cached so that the python script can read it!) +# cmake variable (not kconfig!). See board_set_rimage_target(). +# Thankfully the SOC name and the rimage target names for these +# platforms are identical. The west sign integration similarly needs +# a RIMAGE_CONFIG_PATH cmake cached (!) variable set to a directory +# containing the .toml files for the platforms, which SOF will set on +# its own at build time. And likewise the signing key isn't provided +# by Zephyr and needs tob e found by a SOF build by passing it in +# RIMAGE_SIGN_KEY. +# +# The short version is that zephyr.ri can only realistically be +# exercised from a SOF build and it doesn't belong here in Zephyr; +# rimage is a SOF tool. Signing audio firmware is only done for SOF +# firmware and not general Zephyr apps for the same hardware. This +# should live in SOF where it doesn't have to be duplicated for every +# device and where it won't be forced to communicate via side channels. +board_set_rimage_target(${CONFIG_SOC}) +set(RIMAGE_SIGN_KEY "otc_private_key_3k.pem" CACHE STRING "default rimage key") +add_custom_target(zephyr.ri ALL DEPENDS ${CMAKE_BINARY_DIR}/zephyr/zephyr.ri) +add_custom_command( + OUTPUT ${CMAKE_BINARY_DIR}/zephyr/zephyr.ri + COMMENT "Sign with rimage..." + COMMAND west $<$:--verbose> sign + --if-tool-available --tool rimage --build-dir ${CMAKE_BINARY_DIR} + DEPENDS ${CMAKE_BINARY_DIR}/zephyr/${KERNEL_ELF_NAME} +) From 80577a24affa91286f5737561727d7aa29e5286e Mon Sep 17 00:00:00 2001 From: Andy Ross Date: Mon, 18 Nov 2024 17:43:06 -0800 Subject: [PATCH 0030/4042] soc/mediatek: Add back SOF-only entry point I thought I was being clever letting the linker place the entry point arbitrarily (since the hardware can set it to any value). But it turns out that the upstream Linux SOF loader code is hard-wired to start the DSP only at the first byte of SRAM, always, no matter what entry point is listed in the rimage file. So until/unless this is fixed, we need to add a trampoline at the start of SRAM (and frustratingly that needs to be 1024 bytes long becuase of the alignment requirements of the vector table that follows it, sigh...) Signed-off-by: Andy Ross --- soc/mediatek/mt8xxx/linker.ld | 5 +++++ soc/mediatek/mt8xxx/soc.c | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/soc/mediatek/mt8xxx/linker.ld b/soc/mediatek/mt8xxx/linker.ld index 47a72aae2a81a..9ed61873abde1 100644 --- a/soc/mediatek/mt8xxx/linker.ld +++ b/soc/mediatek/mt8xxx/linker.ld @@ -25,6 +25,11 @@ ENTRY(mtk_adsp_boot_entry) SECTIONS { + /* kluged-in entry point for Linux loader */ + .sof_entry : { + KEEP(*(.sof_entry.text)) + } > sram + #include > sram diff --git a/soc/mediatek/mt8xxx/soc.c b/soc/mediatek/mt8xxx/soc.c index 744980f084a3e..df98292af6b82 100644 --- a/soc/mediatek/mt8xxx/soc.c +++ b/soc/mediatek/mt8xxx/soc.c @@ -50,6 +50,27 @@ __asm__(".align 4\n\t" " movi a1, " INIT_STACK "\n\t" " call4 c_boot\n\t"); +/* Unfortunately the SOF kernel loader doesn't understand the boot + * vector in the ELF/rimage file yet, so we still need a stub to get + * actual audio firmware to load. Leave a stub in place that jumps to + * our "real" vector. Note that this is frustratingly pessimal: the + * kernel wants the entry point to be at the start of the SRAM region, + * but (1) Xtensa can only load an immediate from addresses LOWER than + * a L32R instruction, which we can't do and so need to jump across a + * region to put one, and (2) the vector table that gets displaced has + * a 1024 byte alignment requirement, forcing us to waste ~1011 bytes + * needlessly. + */ +__asm__(".pushsection .sof_entry.text\n\t" + " j 2f\n" + ".align 4\n\t" + "1:\n\t" + " .word mtk_adsp_boot_entry\n" + "2:\n\t" + " l32r a0, 1b\n\t" + " jx a0\n\t" + ".popsection"); + /* Initial MPU configuration, needed to enable caching */ static void enable_mpu(void) { From 49d162e70a1cccef00992e9536f30a7aeb9e50ed Mon Sep 17 00:00:00 2001 From: Andy Ross Date: Sun, 24 Nov 2024 09:13:37 -0800 Subject: [PATCH 0031/4042] tests/boards/mtk_adsp: Handle protocol skew Recent kernel drivers for some devices have swapped the mailbox device used for replies. It used to be that all commands in either direction were sent on mbox0 and all replies on mbox1. Now mbox0 handles commands and replies for "DSP to Host" communication, and mbox1 is for "Host to DSP". Listen to both devices for our simple test. Signed-off-by: Andy Ross --- tests/boards/mtk_adsp/src/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/boards/mtk_adsp/src/main.c b/tests/boards/mtk_adsp/src/main.c index 95efbffd47ce0..c7e10489aa3c1 100644 --- a/tests/boards/mtk_adsp/src/main.c +++ b/tests/boards/mtk_adsp/src/main.c @@ -63,13 +63,11 @@ static bool mbox1_fired; static void mbox_fn(const struct device *mbox, void *arg) { - zassert_equal(mbox, MBOX1); zassert_equal(arg, NULL); mbox1_fired = true; k_sem_give(&mbox_sem); } - /* Test in/out interrupts from the host. This relies on a SOF driver * on the host, which has the behavior of "replying" with an interrupt * on mbox1 after receiving a "command" on mbox0 (you can also see it @@ -81,6 +79,8 @@ static void mbox_fn(const struct device *mbox, void *arg) */ ZTEST(mtk_adsp, mbox) { + /* Different SOCs transmit the replies on different devices! Just listen to both */ + mtk_adsp_mbox_set_handler(MBOX0, 1, mbox_fn, NULL); mtk_adsp_mbox_set_handler(MBOX1, 1, mbox_fn, NULL); /* First signal the host with a reply on the second channel, From 2652841c69e9441c28a63dff63213044d044ddbc Mon Sep 17 00:00:00 2001 From: Andy Ross Date: Sun, 24 Nov 2024 09:38:00 -0800 Subject: [PATCH 0032/4042] soc/mediatek/mtk_adsp: Set XTENSA_CCOUNT_HZ This got missed. Set it correctly for hygiene, though very few things use it. There is a spot in SOF where it's helpful to have a number for "fasted cpu clock rate" and this is the best candidate. Signed-off-by: Andy Ross --- soc/mediatek/mt8xxx/Kconfig.defconfig | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/soc/mediatek/mt8xxx/Kconfig.defconfig b/soc/mediatek/mt8xxx/Kconfig.defconfig index 303be6c87b848..dd429d36bbf4b 100644 --- a/soc/mediatek/mt8xxx/Kconfig.defconfig +++ b/soc/mediatek/mt8xxx/Kconfig.defconfig @@ -36,6 +36,12 @@ config MTK_ADSP_TIMER config XTENSA_TIMER default n +config XTENSA_CCOUNT_HZ + default 720000000 if SOC_MT8195 + default 400000000 if SOC_MT8186 + default 800000000 if SOC_MT8188 + default 800000000 if SOC_MT8196 + config SYS_CLOCK_HW_CYCLES_PER_SEC default $(dt_node_int_prop_int,$(dt_nodelabel_path,ostimer64),freq-hz) From 4d47f784033a159f9fb8ff18c0544c637fa91086 Mon Sep 17 00:00:00 2001 From: Andy Ross Date: Sat, 23 Nov 2024 21:22:13 -0800 Subject: [PATCH 0033/4042] soc/mediatek/mbox: Enable IRQ This driver forgot to enable its interrupt, but has been working becuase Zephyr apps were always run in a context where the interrupt controller had been initialized by a SOF binary at boot. Signed-off-by: Andy Ross --- soc/mediatek/mt8xxx/mbox.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/soc/mediatek/mt8xxx/mbox.c b/soc/mediatek/mt8xxx/mbox.c index 69fc7b0839346..4e0cbb905a63c 100644 --- a/soc/mediatek/mt8xxx/mbox.c +++ b/soc/mediatek/mt8xxx/mbox.c @@ -102,7 +102,9 @@ static void mbox_isr(const void *arg) } #define DEF_IRQ(N) \ - IRQ_CONNECT(DT_INST_IRQN(N), 0, mbox_isr, DEVICE_DT_INST_GET(N), 0); + { IRQ_CONNECT(DT_INST_IRQN(N), 0, mbox_isr, DEVICE_DT_INST_GET(N), 0); \ + irq_enable(DT_INST_IRQN(N)); } + static int mbox_init(void) { From d33bf2a0c0da3e85acc9e0f68b8d28710ef5dab8 Mon Sep 17 00:00:00 2001 From: Andy Ross Date: Sat, 23 Nov 2024 16:49:48 -0800 Subject: [PATCH 0034/4042] soc/mt8196: Add interrupt routing support The MT8196 device has a newer interrupt controller that acts like the legacy ones once initialized (see intc_mtk_adsp.c). But it has some (only slightly) more complicated routing control that must be initialized on reset, as the default is "don't deliver any interrupts at all". Previous versions of the device integration worked becuase they relied on a SOF binary to be loaded at boot, but obviously that doesn't work for a Zephyr-based SOF firmware image. Signed-off-by: Andy Ross --- soc/mediatek/mt8xxx/soc.c | 111 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) diff --git a/soc/mediatek/mt8xxx/soc.c b/soc/mediatek/mt8xxx/soc.c index df98292af6b82..128e7cad99681 100644 --- a/soc/mediatek/mt8xxx/soc.c +++ b/soc/mediatek/mt8xxx/soc.c @@ -29,6 +29,113 @@ extern char _mtk_adsp_dram_end[]; #define LOG_LEN 0x100000 #endif +/* The MT8196 interrupt controller is very simple at runtime, with + * just an enable and status register needed, like its + * predecessors. But it has routing control which resets to "nothing + * enabled", so needs a driver. + * + * There are 64 interrupt inputs to the controller, controlled by + * pairs of words (the "intc64" type below). Each interrupt is + * associated with one[1] of 16 "groups", each of which directs to a + * different Xtensa architectural interrupt. So each Xtensa interrupt + * can be configured to handle any subset of interrupt inputs. + * + * The mapping of groups to Xtensa interrupts is given below. Note + * particularly that the final two groups are NMIs directed to an + * interrupt level higher than EXCM_LEVEL, so cannot be safely used + * for OS code (they'll interrupt spinlocks), but an app might exploit + * them for e.g. debug or watchdog hooks. + * + * GroupNum XtensaIRQ XtensaLevel + * 0-5 0-5 1 (L1 is shared w/exceptions, poor choice) + * 6-7 7-8 1 + * 8-10 9-11 2 + * 11-13 16-18 3 + * 14,15 20,21 4 (Unmaskable! Do not use w/Zephyr code!) + * + * Naming of the inputs looks like this, though obviously only a small + * fraction have been validated (or are even useful for an audio DSP): + * + * 0: CCU 20: USB1 40: WDT + * 1: SCP 21: SCPVOW 41: CONNSYS1 + * 2: SPM 22: CCIF3_C0 42: CONNSYS3 + * 3: PCIE 23: CCIF3_C1 43: CONNSYS4 + * 4: INFRA_HANG 24: PWR_CTRL 44: CONNSYS2 + * 5: PERI_TIMEOUT 25: DMA_C0 45: IPIC + * 6: MBOX_C0 26: DMA_C1 46: AXI_DMA2 + * 7: MBOX_C1 27: AXI_DMA0 47: AXI_DMA3 + * 8: TIMER0 28: AXI_DMA1 48: APSRC_DDREN + * 9: TIMER1 29: AUDIO_C0 49: LAT_MON_EMI + * 10: IPC_C0 30: AUDIO_C1 50: LAT_MON_INFRA + * 11: IPC_C1 31: HIFI5_WDT_C0 51: DEVAPC_VIO + * 12: IPC1_RSV 32: HIFI5_WDT_C1 52: AO_INFRA_HANG + * 13: C2C_SW_C0 33: APU_MBOX_C0 53: BUS_TRA_EMI + * 14: C2C_SW_C1 34: APU_MBOX_C1 54: BUS_TRA_INFRA + * 15: UART 35: TIMER2 55: L2SRAM_VIO + * 16: UART_BT 36: PWR_ON_C0_IRQ 56: L2SRAM_SETERR + * 17: LATENCY_MON 37: PWR_ON_C1_IRQ 57: PCIERC_GRP2 + * 18: BUS_TRACKER 38: WAKEUP_SRC_C0 58: PCIERC_GRP3 + * 19: USB0 39: WAKEUP_SRC_C1 59: IRQ_MAX_CHANNEL + * + * [1] It is legal and works as expected for an interrupt to be part + * of more than one group (more than one interrupt fires to handle + * it), though I don't understand why an application would want to + * do that. + */ + +struct intc64 { uint32_t lo, hi; }; + +struct intc_8196 { + struct intc64 input; /* Raw (?) input signal, normally high */ + struct intc64 status; /* Latched input, inverted (active == 1) */ + struct intc64 enable; /* Interrupt enable */ + struct intc64 polarity; /* 1 == active low */ + struct intc64 wake_enable; + struct intc64 _unused; + struct intc64 stage1_enable; + struct intc64 sw_trigger; + struct intc64 groups[16]; /* set bit == "member of group" */ + struct intc64 group_status[16]; /* status, but masked by group */ +}; + +#define INTC (*(volatile struct intc_8196 *)0x1a014000) + +static void set_group_bit(volatile struct intc64 *g, uint32_t bit, bool val) +{ + volatile uint32_t *p = bit < 32 ? &g->lo : &g->hi; + volatile uint32_t mask = BIT(bit & 0x1f); + + *p = val ? (*p | mask) : (*p & ~mask); +} + +static void mt8196_intc_set_irq_group(uint32_t irq, uint32_t group) +{ + for (int i = 0; i < 16; i++) { + set_group_bit(&INTC.groups[i], irq, i == group); + } +} + +void mt8196_intc_init(void) +{ + struct intc64 zero = { 0, 0 }; + + INTC.enable = zero; + INTC.polarity.lo = 0xffffffff; + INTC.polarity.hi = 0xffffffff; + INTC.wake_enable = zero; + INTC.stage1_enable = zero; + for (int i = 0; i < ARRAY_SIZE(INTC.groups); i++) { + INTC.groups[i] = zero; + } + + /* Now wire up known interrupts for existing drivers to their + * legacy settings + */ + mt8196_intc_set_irq_group(6, 2); /* mbox0 in group 2 */ + mt8196_intc_set_irq_group(7, 2); /* mbox1 in group 2 */ + mt8196_intc_set_irq_group(8, 1); /* ostimer in group 1 */ +} + /* This is the true boot vector. This device allows for direct * setting of the alternate reset vector, so we let it link wherever * it lands and extract its address in the loader. This represents @@ -209,6 +316,10 @@ void c_boot(void) /* Default console, a driver can override this later */ __stdout_hook_install(arch_printk_char_out); +#ifdef CONFIG_SOC_MT8196 + mt8196_intc_init(); +#endif + void z_prep_c(void); z_prep_c(); } From 7bc252238fb8001267c63d06575c48603c5e83a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20St=C4=99pnicki?= Date: Mon, 25 Nov 2024 18:22:08 +0100 Subject: [PATCH 0035/4042] boards: nordic: nrf54h20dk: VPRs board runner config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added basic support for west debug for nrf54h20 RISC-V cpus: nrf54h20_cpuppr and nrf54h20_cpuppr. Note external jlink probe needs to be used. Signed-off-by: Łukasz Stępnicki --- boards/nordic/nrf54h20dk/board.cmake | 11 +++++++++++ .../nrf54h20dk/support/nrf54h20_cpuflpr.JLinkScript | 9 +++++++++ .../nrf54h20dk/support/nrf54h20_cpuppr.JLinkScript | 9 +++++++++ 3 files changed, 29 insertions(+) create mode 100644 boards/nordic/nrf54h20dk/support/nrf54h20_cpuflpr.JLinkScript create mode 100644 boards/nordic/nrf54h20dk/support/nrf54h20_cpuppr.JLinkScript diff --git a/boards/nordic/nrf54h20dk/board.cmake b/boards/nordic/nrf54h20dk/board.cmake index 0c8376c1714e1..80963356dc989 100644 --- a/boards/nordic/nrf54h20dk/board.cmake +++ b/boards/nordic/nrf54h20dk/board.cmake @@ -12,3 +12,14 @@ if(CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUAPP OR CONFIG_BOARD_NRF54H20DK_NRF54H20_C board_runner_args(jlink "--device=CORTEX-M33" "--speed=4000" "--tool-opt=-jlinkscriptfile ${JLINKSCRIPTFILE}") include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) endif() + +if(CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUPPR OR CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUFLPR) + if(CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUPPR) + set(JLINKSCRIPTFILE ${CMAKE_CURRENT_LIST_DIR}/support/nrf54h20_cpuppr.JLinkScript) + else() + set(JLINKSCRIPTFILE ${CMAKE_CURRENT_LIST_DIR}/support/nrf54h20_cpuflpr.JLinkScript) + endif() + + board_runner_args(jlink "--device=RISC-V" "--speed=4000" "-if SW" "--tool-opt=-jlinkscriptfile ${JLINKSCRIPTFILE}") + include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) +endif() diff --git a/boards/nordic/nrf54h20dk/support/nrf54h20_cpuflpr.JLinkScript b/boards/nordic/nrf54h20dk/support/nrf54h20_cpuflpr.JLinkScript new file mode 100644 index 0000000000000..10b83259fdd50 --- /dev/null +++ b/boards/nordic/nrf54h20dk/support/nrf54h20_cpuflpr.JLinkScript @@ -0,0 +1,9 @@ +int InitTarget(void) { + // Base address where DMI registers can be found in the APB address space + JLINK_ExecCommand("CORESIGHT_SetCoreBaseAddr = 0x5F8D4400"); + + // Use AP[x] to communicate with the RISC-V, flpr = APP + JLINK_ExecCommand("CORESIGHT_SetIndexAHBAPToUse = 0"); + + return 0; +} diff --git a/boards/nordic/nrf54h20dk/support/nrf54h20_cpuppr.JLinkScript b/boards/nordic/nrf54h20dk/support/nrf54h20_cpuppr.JLinkScript new file mode 100644 index 0000000000000..127981a45c368 --- /dev/null +++ b/boards/nordic/nrf54h20dk/support/nrf54h20_cpuppr.JLinkScript @@ -0,0 +1,9 @@ +int InitTarget(void) { + // Base address where DMI registers can be found in the APB address space + JLINK_ExecCommand("CORESIGHT_SetCoreBaseAddr = 0x5F908400"); + + // Use AP[x] to communicate with the RISC-V, ppr = APP + JLINK_ExecCommand("CORESIGHT_SetIndexAHBAPToUse = 0"); + + return 0; +} From d61296e3aa71569c183305cf026a8d9a8acf02cc Mon Sep 17 00:00:00 2001 From: Dmytro Firsov Date: Fri, 22 Nov 2024 19:07:01 +0200 Subject: [PATCH 0036/4042] boards: xenvm: remove incorrect condition for Kconfig heap values xenvm Kconfig contained incorrect name for board parameter. It led to build issues - heap size was set incorrectly. Since whole file is already placed under right Kconfig condition ("if BOARD_XENVM"), remove incorrect parameter at all. This issue was introduced by commit 8dc3f856229c ("hwmv2: Introduce Hardware model version 2 and convert devices") due to the typo. Signed-off-by: Dmytro Firsov --- boards/xen/xenvm/Kconfig.defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boards/xen/xenvm/Kconfig.defconfig b/boards/xen/xenvm/Kconfig.defconfig index 965dc9cda33bd..66ef1066e4c63 100644 --- a/boards/xen/xenvm/Kconfig.defconfig +++ b/boards/xen/xenvm/Kconfig.defconfig @@ -7,6 +7,6 @@ config BUILD_OUTPUT_BIN default y config HEAP_MEM_POOL_SIZE - default 16384 if BOARD_XENVM_XENVM + default 16384 endif # BOARD_XENVM From 3ff65673eb24bab8bfbf48be779dd87f98bb6e81 Mon Sep 17 00:00:00 2001 From: Dmytro Firsov Date: Mon, 25 Nov 2024 18:54:34 +0200 Subject: [PATCH 0037/4042] tests: kernel: exclude xenvm with GICv3 from device tests The issue with mentioned test for GICv3 version of xenvm virtual board is the same as for regular xenvm - device tree overlay for this test overrides #address-cells and #size-cells property for original device tree file (from 0x2 to 0x1), which leads to incorrect DT parsing by actual Xen drivers. This causes build errors, so test should be skipped for GICv3 platform too. Same issue for regular xenvm was fixed by commit 40fe36669c15 ("tests: kernel: exclude xenvm from device tests"). Issue for GICv3 appeared after migrating to HWMv2. Signed-off-by: Dmytro Firsov --- tests/kernel/device/testcase.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/kernel/device/testcase.yaml b/tests/kernel/device/testcase.yaml index 139a7418c0bcc..41efc1823a507 100644 --- a/tests/kernel/device/testcase.yaml +++ b/tests/kernel/device/testcase.yaml @@ -7,7 +7,9 @@ tests: kernel.device: integration_platforms: - native_sim - platform_exclude: xenvm + platform_exclude: + - xenvm + - xenvm/xenvm/gicv3 kernel.device.metadata: platform_allow: - qemu_x86 @@ -21,13 +23,16 @@ tests: - libc extra_configs: - CONFIG_MINIMAL_LIBC=y - platform_exclude: xenvm + platform_exclude: + - xenvm + - xenvm/xenvm/gicv3 kernel.device.pm: integration_platforms: - native_sim platform_exclude: - mec15xxevb_assy6853 - xenvm + - xenvm/xenvm/gicv3 extra_configs: - CONFIG_PM_DEVICE=y kernel.device.linker_generator: From 7bf2decd0398c8d7420c394d0af3a420d7a01b7a Mon Sep 17 00:00:00 2001 From: Neil Chen Date: Thu, 5 Dec 2024 16:37:14 +0800 Subject: [PATCH 0038/4042] boards: frdm_mcxc444: Add i2c support Enable i2c and configure it to read accelerometer sensor on the board. Test it using sample.sensor.accel_polling. Signed-off-by: Neil Chen --- boards/nxp/frdm_mcxc444/doc/index.rst | 2 ++ boards/nxp/frdm_mcxc444/frdm_mcxc444-pinctrl.dtsi | 9 +++++++++ boards/nxp/frdm_mcxc444/frdm_mcxc444.dts | 14 ++++++++++++++ boards/nxp/frdm_mcxc444/frdm_mcxc444.yaml | 1 + 4 files changed, 26 insertions(+) diff --git a/boards/nxp/frdm_mcxc444/doc/index.rst b/boards/nxp/frdm_mcxc444/doc/index.rst index da09d23a25a95..314c8508e63d0 100644 --- a/boards/nxp/frdm_mcxc444/doc/index.rst +++ b/boards/nxp/frdm_mcxc444/doc/index.rst @@ -55,6 +55,8 @@ The ``frdm_mcxc444`` board target supports the following hardware features: +-----------+------------+-------------------------------------+ | FLASH | on-chip | soc flash | +-----------+------------+-------------------------------------+ +| I2C | on-chip | i2c | ++-----------+------------+-------------------------------------+ | LPTMR | on-chip | counter | +-----------+------------+-------------------------------------+ | PIT | on-chip | counter | diff --git a/boards/nxp/frdm_mcxc444/frdm_mcxc444-pinctrl.dtsi b/boards/nxp/frdm_mcxc444/frdm_mcxc444-pinctrl.dtsi index 87552988ff852..651891c424f7a 100644 --- a/boards/nxp/frdm_mcxc444/frdm_mcxc444-pinctrl.dtsi +++ b/boards/nxp/frdm_mcxc444/frdm_mcxc444-pinctrl.dtsi @@ -8,6 +8,15 @@ #include &pinctrl { + pinmux_i2c0: pinmux_i2c0 { + group0 { + pinmux = , + ; + drive-strength = "low"; + drive-open-drain; + slew-rate = "fast"; + }; + }; pinmux_lpuart0: pinmux_lpuart0 { group0 { pinmux = , diff --git a/boards/nxp/frdm_mcxc444/frdm_mcxc444.dts b/boards/nxp/frdm_mcxc444/frdm_mcxc444.dts index c39e6543f135f..c1922d76810fb 100644 --- a/boards/nxp/frdm_mcxc444/frdm_mcxc444.dts +++ b/boards/nxp/frdm_mcxc444/frdm_mcxc444.dts @@ -20,6 +20,7 @@ led2 = &red_led; sw0 = &user_button_2; sw1 = &user_button_3; + accel0 = &fxls8974; }; chosen { @@ -90,6 +91,19 @@ status = "okay"; }; +i2c0: &i2c0 { + status = "okay"; + pinctrl-0 = <&pinmux_i2c0>; + pinctrl-names = "default"; + + fxls8974: fxls8974@18 { + status = "okay"; + compatible = "nxp,fxls8974"; + reg = <0x18>; + int1-gpios = <&gpiod 1 GPIO_ACTIVE_LOW>; + }; +}; + &lpuart0 { status = "okay"; current-speed = <115200>; diff --git a/boards/nxp/frdm_mcxc444/frdm_mcxc444.yaml b/boards/nxp/frdm_mcxc444/frdm_mcxc444.yaml index 2b8e598fca671..24b689035775f 100644 --- a/boards/nxp/frdm_mcxc444/frdm_mcxc444.yaml +++ b/boards/nxp/frdm_mcxc444/frdm_mcxc444.yaml @@ -18,6 +18,7 @@ supported: - counter - flash - gpio + - i2c - uart testing: ignore_tags: From 1fd14ef937f01327f990c5448664341a277c8515 Mon Sep 17 00:00:00 2001 From: Neil Chen Date: Tue, 19 Nov 2024 16:27:01 +0800 Subject: [PATCH 0039/4042] dts: arm/nxp: Add rtc nodes to NXP MCXN23x dtsi file Add rtc nodes to NXP MCXN23x dtsi file Signed-off-by: Neil Chen --- dts/arm/nxp/nxp_mcxn23x_common.dtsi | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dts/arm/nxp/nxp_mcxn23x_common.dtsi b/dts/arm/nxp/nxp_mcxn23x_common.dtsi index a396ca9dfed57..6c8fa853938f2 100644 --- a/dts/arm/nxp/nxp_mcxn23x_common.dtsi +++ b/dts/arm/nxp/nxp_mcxn23x_common.dtsi @@ -838,6 +838,17 @@ status = "disabled"; }; }; + + rtc: rtc@4c000 { + compatible = "nxp,irtc"; + reg = <0x4c000 0x1000>; + status = "disabled"; + interrupts = <52 0>; + prescaler = <1>; + clock-frequency = <16384>; + clock-src = <0>; + alarms-count = <1>; + }; }; &systick { From 37f0d3d0c15769b0942b3b05376561b0ad6df992 Mon Sep 17 00:00:00 2001 From: Neil Chen Date: Tue, 19 Nov 2024 16:27:51 +0800 Subject: [PATCH 0040/4042] boards: nxp: frdm_mcxn236: Enabled IRTC Driver. Enabling the IRTC Driver for the frdm_mcxn236 board. Tested with example samples/drivers/rtc. Signed-off-by: Neil Chen --- boards/nxp/frdm_mcxn236/doc/index.rst | 2 ++ boards/nxp/frdm_mcxn236/frdm_mcxn236.dts | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/boards/nxp/frdm_mcxn236/doc/index.rst b/boards/nxp/frdm_mcxn236/doc/index.rst index 58606df9f0196..2ddc964bb9eaf 100644 --- a/boards/nxp/frdm_mcxn236/doc/index.rst +++ b/boards/nxp/frdm_mcxn236/doc/index.rst @@ -80,6 +80,8 @@ The FRDM-MCXN236 board configuration supports the following hardware features: +-----------+------------+-------------------------------------+ | MRT | on-chip | counter | +-----------+------------+-------------------------------------+ +| RTC | on-chip | rtc | ++-----------+------------+-------------------------------------+ Targets available ================== diff --git a/boards/nxp/frdm_mcxn236/frdm_mcxn236.dts b/boards/nxp/frdm_mcxn236/frdm_mcxn236.dts index 5c1d345cb3d07..1f42d00be9436 100644 --- a/boards/nxp/frdm_mcxn236/frdm_mcxn236.dts +++ b/boards/nxp/frdm_mcxn236/frdm_mcxn236.dts @@ -27,6 +27,7 @@ aliases{ watchdog0 = &wwdt0; pwm-0 = &flexpwm1_pwm0; + rtc = &rtc; }; }; @@ -146,3 +147,7 @@ zephyr_udc0: &usb1 { &mrt0_channel0 { status = "okay"; }; + +&rtc { + status = "okay"; +}; From b17c51f80ee3404cdfdb867b0e8caccd1b8aa3d1 Mon Sep 17 00:00:00 2001 From: Neil Chen Date: Thu, 5 Dec 2024 16:01:24 +0800 Subject: [PATCH 0041/4042] doc: release-notes-4.1: Update note for NXP frdm_mcxn236 Add rtc enable note for NXP frdm_mcxn236 Signed-off-by: Neil Chen --- doc/releases/release-notes-4.1.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/releases/release-notes-4.1.rst b/doc/releases/release-notes-4.1.rst index 70d2a699da650..a3d3bab645459 100644 --- a/doc/releases/release-notes-4.1.rst +++ b/doc/releases/release-notes-4.1.rst @@ -101,7 +101,7 @@ Boards & SoC Support * All HWMv1 board name aliases which were added as deprecated in v3.7 are now removed (:github:`82247`). - * Enabled USB on NXP ``frdm_mcxn236`` + * Enabled USB, RTC on NXP ``frdm_mcxn236`` * Added support for the following shields: From 6f3a01b86b9f1c35212b2f05f93ebadcdddf133b Mon Sep 17 00:00:00 2001 From: Hake Huang Date: Tue, 20 Aug 2024 01:22:52 +0800 Subject: [PATCH 0042/4042] tests: twister: add quit-on-failure option in CI, we may need to quit if there is any failure to save time, so add this --quit-on-failure so that any failure will quit the test. Signed-off-by: Hake Huang --- scripts/pylib/twister/twisterlib/environment.py | 6 ++++++ scripts/pylib/twister/twisterlib/runner.py | 10 ++++++++++ scripts/pylib/twister/twisterlib/twister_main.py | 6 +++++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/scripts/pylib/twister/twisterlib/environment.py b/scripts/pylib/twister/twisterlib/environment.py index b161096d562d0..ad2f619056a1a 100644 --- a/scripts/pylib/twister/twisterlib/environment.py +++ b/scripts/pylib/twister/twisterlib/environment.py @@ -668,6 +668,12 @@ def add_parse_arguments(parser = None) -> argparse.ArgumentParser: help="Use the list of test scenarios under quarantine and run them" "to verify their current status.") + parser.add_argument( + "--quit-on-failure", + action="store_true", + help="""quit twister once there is build / run failure + """) + parser.add_argument( "--report-name", help="""Create a report with a custom name. diff --git a/scripts/pylib/twister/twisterlib/runner.py b/scripts/pylib/twister/twisterlib/runner.py index 287069f47d87e..cf496225aa389 100644 --- a/scripts/pylib/twister/twisterlib/runner.py +++ b/scripts/pylib/twister/twisterlib/runner.py @@ -1927,6 +1927,11 @@ def pipeline_mgr(self, pipeline, done_queue, lock, results): pb = ProjectBuilder(instance, self.env, self.jobserver) pb.duts = self.duts pb.process(pipeline, done_queue, task, lock, results) + if self.env.options.quit_on_failure and \ + pb.instance.status in [TwisterStatus.FAIL, TwisterStatus.ERROR]: + with pipeline.mutex: + pipeline.queue.clear() + break return True else: @@ -1940,6 +1945,11 @@ def pipeline_mgr(self, pipeline, done_queue, lock, results): pb = ProjectBuilder(instance, self.env, self.jobserver) pb.duts = self.duts pb.process(pipeline, done_queue, task, lock, results) + if self.env.options.quit_on_failure and \ + pb.instance.status in [TwisterStatus.FAIL, TwisterStatus.ERROR]: + with pipeline.mutex: + pipeline.queue.clear() + break return True except Exception as e: logger.error(f"General exception: {e}") diff --git a/scripts/pylib/twister/twisterlib/twister_main.py b/scripts/pylib/twister/twisterlib/twister_main.py index 5644b98113196..1fbd2ffac4df7 100644 --- a/scripts/pylib/twister/twisterlib/twister_main.py +++ b/scripts/pylib/twister/twisterlib/twister_main.py @@ -238,13 +238,17 @@ def main(options: argparse.Namespace, default_options: argparse.Namespace): artifacts = Artifacts(env) artifacts.package() - logger.info("Run completed") if ( runner.results.failed or runner.results.error or (tplan.warnings and options.warnings_as_errors) or (options.coverage and not coverage_completed) ): + if env.options.quit_on_failure: + logger.info("twister aborted because of a failure/error") + else: + logger.info("Run completed") return 1 + logger.info("Run completed") return 0 From 62ca03a6c2621dbe750a25575e5d81ca359ed4ff Mon Sep 17 00:00:00 2001 From: Pisit Sawangvonganan Date: Fri, 21 Jun 2024 15:49:40 +0700 Subject: [PATCH 0043/4042] bluetooth: shell: add `bt_shell_private.c` and `bt_shell_private.h` Introduced `bt_shell_private.c` and `bt_shell_private.h` to provide common functions for the Bluetooth `shell_wall_print`. These functions are equivalent to `shell_fprintf`, `shell_info`, `shell_print`, `shell_warn`, `shell_error` and `shell_hexdump` but without requiring the `sh` parameter. The cost of the newly added `bt_shell_fprintf_info` ... `_error` functions will be negligible when there are many individual calls that need to pass both the `sh` and `color` parameters each time. Signed-off-by: Pisit Sawangvonganan --- subsys/bluetooth/host/shell/CMakeLists.txt | 5 +- .../bluetooth/host/shell/bt_shell_private.c | 89 ++++++++++++++++++ .../bluetooth/host/shell/bt_shell_private.h | 90 +++++++++++++++++++ 3 files changed, 183 insertions(+), 1 deletion(-) create mode 100644 subsys/bluetooth/host/shell/bt_shell_private.c create mode 100644 subsys/bluetooth/host/shell/bt_shell_private.h diff --git a/subsys/bluetooth/host/shell/CMakeLists.txt b/subsys/bluetooth/host/shell/CMakeLists.txt index 98f1e6ac2a590..73ff18086f315 100644 --- a/subsys/bluetooth/host/shell/CMakeLists.txt +++ b/subsys/bluetooth/host/shell/CMakeLists.txt @@ -1,7 +1,10 @@ # SPDX-License-Identifier: Apache-2.0 zephyr_library() -zephyr_library_sources(bt.c) +zephyr_library_sources( + bt.c + bt_shell_private.c + ) zephyr_library_sources_ifdef(CONFIG_BT_CONN gatt.c) zephyr_library_sources_ifdef(CONFIG_BT_L2CAP_DYNAMIC_CHANNEL l2cap.c) zephyr_library_sources_ifdef(CONFIG_BT_ISO iso.c) diff --git a/subsys/bluetooth/host/shell/bt_shell_private.c b/subsys/bluetooth/host/shell/bt_shell_private.c new file mode 100644 index 0000000000000..a01b968a27a2d --- /dev/null +++ b/subsys/bluetooth/host/shell/bt_shell_private.c @@ -0,0 +1,89 @@ +/** + * @file bt_shell_private.c + * @brief Bluetooth shell private module + * + * Provide common function which can be shared using privately inside Bluetooth shell. + */ + +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include "bt_shell_private.h" + +static void wall_vfprintf(enum shell_vt100_color color, const char *fmt, va_list args) +{ + int count; + const struct shell *sh; + + count = shell_backend_count_get(); + for (int i = 0; i < count; i++) { + va_list args_copy; + + va_copy(args_copy, args); /* Create a copy of 'args' to safely reuse */ + sh = shell_backend_get(i); + shell_vfprintf(sh, color, fmt, args_copy); + va_end(args_copy); /* Clean up to prevent resource leaks */ + } +} + +void bt_shell_hexdump(const uint8_t *data, size_t len) +{ + int count; + const struct shell *sh; + + count = shell_backend_count_get(); + for (int i = 0; i < count; i++) { + sh = shell_backend_get(i); + shell_hexdump(sh, data, len); + } +} + +void bt_shell_fprintf(enum shell_vt100_color color, + const char *fmt, ...) +{ + va_list args; + + va_start(args, fmt); + wall_vfprintf(color, fmt, args); + va_end(args); +} + +void bt_shell_fprintf_info(const char *fmt, ...) +{ + va_list args; + + va_start(args, fmt); + wall_vfprintf(SHELL_INFO, fmt, args); + va_end(args); +} + +void bt_shell_fprintf_print(const char *fmt, ...) +{ + va_list args; + + va_start(args, fmt); + wall_vfprintf(SHELL_NORMAL, fmt, args); + va_end(args); +} + +void bt_shell_fprintf_warn(const char *fmt, ...) +{ + va_list args; + + va_start(args, fmt); + wall_vfprintf(SHELL_WARNING, fmt, args); + va_end(args); +} + +void bt_shell_fprintf_error(const char *fmt, ...) +{ + va_list args; + + va_start(args, fmt); + wall_vfprintf(SHELL_ERROR, fmt, args); + va_end(args); +} diff --git a/subsys/bluetooth/host/shell/bt_shell_private.h b/subsys/bluetooth/host/shell/bt_shell_private.h new file mode 100644 index 0000000000000..6946079768653 --- /dev/null +++ b/subsys/bluetooth/host/shell/bt_shell_private.h @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __BT_SHELL_PRIVATE_H +#define __BT_SHELL_PRIVATE_H + +#include + +/** + * @brief printf-like function which sends formatted data stream to the shell. + * (Bluetooth context specific) + * + * This function can be used from the command handler or from threads, but not + * from an interrupt context. + * + * @param[in] color Printed text color. + * @param[in] fmt Format string. + * @param[in] ... List of parameters to print. + */ +__printf_like(2, 3) void bt_shell_fprintf(enum shell_vt100_color color, + const char *fmt, ...); + +/** + * @brief printf-like function which sends formatted data stream to the shell. + * (Bluetooth context specific) + * + * This function can be used from the command handler or from threads, but not + * from an interrupt context. + * + * @param[in] fmt Format string. + * @param[in] ... List of parameters to print. + */ +__printf_like(1, 2) void bt_shell_fprintf_info(const char *fmt, ...); +__printf_like(1, 2) void bt_shell_fprintf_print(const char *fmt, ...); +__printf_like(1, 2) void bt_shell_fprintf_warn(const char *fmt, ...); +__printf_like(1, 2) void bt_shell_fprintf_error(const char *fmt, ...); + +/** + * @brief Print data in hexadecimal format. + * (Bluetooth context specific) + * + * @param[in] data Pointer to data. + * @param[in] len Length of data. + */ +void bt_shell_hexdump(const uint8_t *data, size_t len); + +/** + * @brief Print info message to the shell. + * (Bluetooth context specific) + * + * @param[in] _ft Format string. + * @param[in] ... List of parameters to print. + */ +#define bt_shell_info(_ft, ...) \ + bt_shell_fprintf_info(_ft "\n", ##__VA_ARGS__) + +/** + * @brief Print normal message to the shell. + * (Bluetooth context specific) + * + * @param[in] _ft Format string. + * @param[in] ... List of parameters to print. + */ +#define bt_shell_print(_ft, ...) \ + bt_shell_fprintf_print(_ft "\n", ##__VA_ARGS__) + +/** + * @brief Print warning message to the shell. + * (Bluetooth context specific) + * + * @param[in] _ft Format string. + * @param[in] ... List of parameters to print. + */ +#define bt_shell_warn(_ft, ...) \ + bt_shell_fprintf_warn(_ft "\n", ##__VA_ARGS__) + +/** + * @brief Print error message to the shell. + * (Bluetooth context specific) + * + * @param[in] _ft Format string. + * @param[in] ... List of parameters to print. + */ +#define bt_shell_error(_ft, ...) \ + bt_shell_fprintf_error(_ft "\n", ##__VA_ARGS__) + +#endif /* __BT_SHELL_PRIVATE_H */ From 545cdd4dca7ca01af356e19b0ec450b689219afe Mon Sep 17 00:00:00 2001 From: Pisit Sawangvonganan Date: Sun, 10 Nov 2024 22:49:12 +0700 Subject: [PATCH 0044/4042] bluetooth: shell: replace `ctx_shell` with `sh` where applicable Limit the usage of `ctx_shell` to cases where printing requires it and `sh` is not available. Signed-off-by: Pisit Sawangvonganan --- subsys/bluetooth/host/shell/bt.c | 61 +++++++++++++++----------------- 1 file changed, 28 insertions(+), 33 deletions(-) diff --git a/subsys/bluetooth/host/shell/bt.c b/subsys/bluetooth/host/shell/bt.c index 391e3f1d05a09..9d5cda89ebb00 100644 --- a/subsys/bluetooth/host/shell/bt.c +++ b/subsys/bluetooth/host/shell/bt.c @@ -1580,7 +1580,7 @@ static int cmd_id_show(const struct shell *sh, size_t argc, char *argv[]) bt_addr_le_to_str(&addrs[i], addr_str, sizeof(addr_str)); shell_print(sh, "%s%zu: %s", i == selected_id ? "*" : " ", i, - addr_str); + addr_str); } return 0; @@ -1625,7 +1625,7 @@ static int cmd_active_scan_on(const struct shell *sh, uint32_t options, err = bt_le_scan_start(¶m, NULL); if (err) { shell_error(sh, "Bluetooth set active scan failed " - "(err %d)", err); + "(err %d)", err); return err; } else { shell_print(sh, "Bluetooth active scan enabled"); @@ -1753,7 +1753,7 @@ static int cmd_scan_filter_set_name(const struct shell *sh, size_t argc, const char *name_arg = argv[1]; if (strlen(name_arg) >= sizeof(scan_filter.name)) { - shell_error(ctx_shell, "Name is too long (max %zu): %s\n", + shell_error(sh, "Name is too long (max %zu): %s\n", sizeof(scan_filter.name), name_arg); return -ENOEXEC; } @@ -1773,8 +1773,7 @@ static int cmd_scan_filter_set_addr(const struct shell *sh, size_t argc, /* Validate length including null terminator. */ if (len > max_cpy_len) { - shell_error(ctx_shell, "Invalid address string: %s\n", - addr_arg); + shell_error(sh, "Invalid address string: %s\n", addr_arg); return -ENOEXEC; } @@ -1784,9 +1783,7 @@ static int cmd_scan_filter_set_addr(const struct shell *sh, size_t argc, uint8_t tmp; if (c != ':' && char2hex(c, &tmp) < 0) { - shell_error(ctx_shell, - "Invalid address string: %s\n", - addr_arg); + shell_error(sh, "Invalid address string: %s\n", addr_arg); return -ENOEXEC; } } @@ -2307,7 +2304,7 @@ static int cmd_adv_data(const struct shell *sh, size_t argc, char *argv[]) if (*data_len == ARRAY_SIZE(ad)) { /* Maximum entries limit reached. */ shell_print(sh, "Failed to set advertising data: " - "Maximum entries limit reached"); + "Maximum entries limit reached"); return -ENOEXEC; } @@ -2327,7 +2324,7 @@ static int cmd_adv_data(const struct shell *sh, size_t argc, char *argv[]) if (strcmp(arg, "scan-response") && *data_len == ARRAY_SIZE(ad)) { /* Maximum entries limit reached. */ shell_print(sh, "Failed to set advertising data: " - "Maximum entries limit reached"); + "Maximum entries limit reached"); return -ENOEXEC; } @@ -2341,7 +2338,7 @@ static int cmd_adv_data(const struct shell *sh, size_t argc, char *argv[]) } else if (!strcmp(arg, "scan-response")) { if (data == sd) { shell_print(sh, "Failed to set advertising data: " - "duplicate scan-response option"); + "duplicate scan-response option"); return -ENOEXEC; } @@ -2358,7 +2355,7 @@ static int cmd_adv_data(const struct shell *sh, size_t argc, char *argv[]) if (!len || (len - 1) != (hex_data[hex_data_len])) { shell_print(sh, "Failed to set advertising data: " - "malformed hex data"); + "malformed hex data"); return -ENOEXEC; } @@ -2379,7 +2376,7 @@ static int cmd_adv_data(const struct shell *sh, size_t argc, char *argv[]) if (*data_len == ARRAY_SIZE(ad)) { /* Maximum entries limit reached. */ shell_print(sh, "Failed to set advertising data: " - "Maximum entries limit reached"); + "Maximum entries limit reached"); return -ENOEXEC; } @@ -2499,7 +2496,7 @@ static int cmd_adv_delete(const struct shell *sh, size_t argc, char *argv[]) err = bt_le_ext_adv_delete(adv); if (err) { - shell_error(ctx_shell, "Failed to delete advertiser set"); + shell_error(sh, "Failed to delete advertiser set"); return err; } @@ -3109,7 +3106,7 @@ static int cmd_set_power_report_enable(const struct shell *sh, size_t argc, char return -ENOEXEC; } err = bt_conn_le_set_tx_power_report_enable(default_conn, local_enable, - remote_enable); + remote_enable); if (!err) { shell_print(sh, "Tx Power Report: local: %s, remote: %s", enabled2str(local_enable), enabled2str(remote_enable)); @@ -3494,11 +3491,11 @@ static int cmd_info(const struct shell *sh, size_t argc, char *argv[]) err = bt_conn_get_info(conn, &info); if (err) { - shell_print(ctx_shell, "Failed to get info"); + shell_print(sh, "Failed to get info"); goto done; } - shell_print(ctx_shell, "Type: %s, Role: %s, Id: %u", + shell_print(sh, "Type: %s, Role: %s, Id: %u", get_conn_type_str(info.type), get_conn_role_str(info.role), info.id); @@ -3509,20 +3506,20 @@ static int cmd_info(const struct shell *sh, size_t argc, char *argv[]) print_le_addr("Remote on-air", info.le.remote); print_le_addr("Local on-air", info.le.local); - shell_print(ctx_shell, "Interval: 0x%04x (%u us)", + shell_print(sh, "Interval: 0x%04x (%u us)", info.le.interval, BT_CONN_INTERVAL_TO_US(info.le.interval)); - shell_print(ctx_shell, "Latency: 0x%04x", + shell_print(sh, "Latency: 0x%04x", info.le.latency); - shell_print(ctx_shell, "Supervision timeout: 0x%04x (%d ms)", + shell_print(sh, "Supervision timeout: 0x%04x (%d ms)", info.le.timeout, info.le.timeout * 10); #if defined(CONFIG_BT_USER_PHY_UPDATE) - shell_print(ctx_shell, "LE PHY: TX PHY %s, RX PHY %s", + shell_print(sh, "LE PHY: TX PHY %s, RX PHY %s", phy2str(info.le.phy->tx_phy), phy2str(info.le.phy->rx_phy)); #endif #if defined(CONFIG_BT_USER_DATA_LEN_UPDATE) - shell_print(ctx_shell, "LE data len: TX (len: %d time: %d)" + shell_print(sh, "LE data len: TX (len: %d time: %d)" " RX (len: %d time: %d)", info.le.data_len->tx_max_len, info.le.data_len->tx_max_time, @@ -3530,7 +3527,7 @@ static int cmd_info(const struct shell *sh, size_t argc, char *argv[]) info.le.data_len->rx_max_time); #endif #if defined(CONFIG_BT_SUBRATING) - shell_print(ctx_shell, "LE Subrating: Subrate Factor: %d" + shell_print(sh, "LE Subrating: Subrate Factor: %d" " Continuation Number: %d", info.le.subrate->factor, info.le.subrate->continuation_number); @@ -3542,7 +3539,7 @@ static int cmd_info(const struct shell *sh, size_t argc, char *argv[]) char addr_str[BT_ADDR_STR_LEN]; bt_addr_to_str(info.br.dst, addr_str, sizeof(addr_str)); - shell_print(ctx_shell, "Peer address %s", addr_str); + shell_print(sh, "Peer address %s", addr_str); } #endif /* defined(CONFIG_BT_CLASSIC) */ @@ -3559,8 +3556,8 @@ static int cmd_conn_update(const struct shell *sh, size_t argc, char *argv[]) if (default_conn == NULL) { shell_error(sh, - "%s: at least, one connection is required", - sh->ctx->active_cmd.syntax); + "%s: at least, one connection is required", + sh->ctx->active_cmd.syntax); return -ENOEXEC; } @@ -3608,8 +3605,8 @@ static int cmd_conn_data_len_update(const struct shell *sh, size_t argc, if (default_conn == NULL) { shell_error(sh, - "%s: at least, one connection is required", - sh->ctx->active_cmd.syntax); + "%s: at least, one connection is required", + sh->ctx->active_cmd.syntax); return -ENOEXEC; } @@ -3633,8 +3630,6 @@ static int cmd_conn_data_len_update(const struct shell *sh, size_t argc, shell_print(sh, "Calculated tx time: %d", param.tx_max_time); } - - err = bt_conn_le_data_len_update(default_conn, ¶m); if (err) { shell_error(sh, "data len update failed (err %d).", err); @@ -3655,8 +3650,8 @@ static int cmd_conn_phy_update(const struct shell *sh, size_t argc, if (default_conn == NULL) { shell_error(sh, - "%s: at least, one connection is required", - sh->ctx->active_cmd.syntax); + "%s: at least, one connection is required", + sh->ctx->active_cmd.syntax); return -ENOEXEC; } @@ -3772,7 +3767,7 @@ static int cmd_clear(const struct shell *sh, size_t argc, char *argv[]) err = bt_unpair(selected_id, NULL); if (err) { shell_error(sh, "Failed to clear pairings (err %d)", - err); + err); return err; } else { shell_print(sh, "Pairings successfully cleared"); From 9f46f96f473e221ac41e2f58633223c4e2b179eb Mon Sep 17 00:00:00 2001 From: Pisit Sawangvonganan Date: Mon, 11 Nov 2024 00:10:06 +0700 Subject: [PATCH 0045/4042] bluetooth: shell: refactor shell print to eliminate `ctx_shell` usage This change aims to eliminate the dependency on `ctx_shell` in the Bluetooth `host/shell/*`, making the code more maintainable. Replaced `shell_*` functions that depended on `ctx_shell` with the appropriate `bt_shell_*` functions. The shell-less functions `bt_do_scan_filter_clear_name`, `bt_do_scan_off`, and `bt_do_connect_le` were added so they can be called without `sh`. Signed-off-by: Pisit Sawangvonganan --- subsys/bluetooth/host/shell/bt.c | 488 +++++++++++++++------------- subsys/bluetooth/host/shell/cs.c | 15 +- subsys/bluetooth/host/shell/gatt.c | 73 +++-- subsys/bluetooth/host/shell/iso.c | 17 +- subsys/bluetooth/host/shell/l2cap.c | 27 +- 5 files changed, 323 insertions(+), 297 deletions(-) diff --git a/subsys/bluetooth/host/shell/bt.c b/subsys/bluetooth/host/shell/bt.c index 9d5cda89ebb00..46245e4ee32aa 100644 --- a/subsys/bluetooth/host/shell/bt.c +++ b/subsys/bluetooth/host/shell/bt.c @@ -35,6 +35,7 @@ #include #include +#include "bt_shell_private.h" #include "audio/shell/audio.h" #include "controller/ll_sw/shell/ll.h" @@ -125,8 +126,7 @@ static void print_le_addr(const char *desc, const bt_addr_le_t *addr) bt_addr_le_to_str(addr, addr_str, sizeof(addr_str)); - shell_print(ctx_shell, "%s address: %s (%s)", desc, addr_str, - addr_desc); + bt_shell_print("%s address: %s (%s)", desc, addr_str, addr_desc); } #endif /* CONFIG_BT_CONN || (CONFIG_BT_BROADCASTER && CONFIG_BT_EXT_ADV) */ @@ -210,10 +210,9 @@ static const char *plm_report_zone_str(enum bt_conn_le_path_loss_zone zone) #endif /* CONFIG_BT_PATH_LOSS_MONITORING */ #if defined(CONFIG_BT_CENTRAL) -static int cmd_scan_off(const struct shell *sh); -static int cmd_connect_le(const struct shell *sh, size_t argc, char *argv[]); -static int cmd_scan_filter_clear_name(const struct shell *sh, size_t argc, - char *argv[]); +static void bt_do_scan_filter_clear_name(void); +static int bt_do_scan_off(void); +static int bt_do_connect_le(int *ercd, size_t argc, char *argv[]); static struct bt_auto_connect { bt_addr_le_t addr; @@ -227,18 +226,17 @@ static void active_scan_timeout(struct k_work *work) { int err; - shell_print(ctx_shell, "Scan timeout"); + bt_shell_print("Scan timeout"); err = bt_le_scan_stop(); if (err) { - shell_error(ctx_shell, "Failed to stop scan (err %d)", err); + bt_shell_error("Failed to stop scan (err %d)", err); } #if defined(CONFIG_BT_CENTRAL) if (auto_connect.connect_name) { auto_connect.connect_name = false; - /* "name" is what would be in argv[0] normally */ - cmd_scan_filter_clear_name(ctx_shell, 1, (char *[]){ "name" }); + bt_do_scan_filter_clear_name(); } #endif /* CONFIG_BT_CENTRAL */ } @@ -326,12 +324,12 @@ static void print_data_hex(const uint8_t *data, uint8_t len, enum shell_vt100_co return; } - shell_fprintf(ctx_shell, color, "0x"); + bt_shell_fprintf(color, "0x"); /* Reverse the byte order when printing as advertising data is LE * and the MSB should be first in the printed output. */ for (int16_t i = len - 1; i >= 0; i--) { - shell_fprintf(ctx_shell, color, "%02x", data[i]); + bt_shell_fprintf(color, "%02x", data[i]); } } @@ -346,7 +344,7 @@ static void print_data_set(uint8_t set_value_len, do { if (idx > 0) { - shell_fprintf(ctx_shell, SHELL_INFO, ADV_DATA_DELIMITER); + bt_shell_fprintf_info(ADV_DATA_DELIMITER); } print_data_hex(&scan_data[idx], set_value_len, SHELL_INFO); @@ -354,15 +352,14 @@ static void print_data_set(uint8_t set_value_len, } while (idx + set_value_len <= scan_data_len); if (idx < scan_data_len) { - shell_fprintf(ctx_shell, SHELL_WARNING, " Excess data: "); + bt_shell_fprintf_warn(" Excess data: "); print_data_hex(&scan_data[idx], scan_data_len - idx, SHELL_WARNING); } } static bool data_verbose_cb(struct bt_data *data, void *user_data) { - shell_fprintf(ctx_shell, SHELL_INFO, "%*sType 0x%02x: ", - strlen(scan_response_label), "", data->type); + bt_shell_fprintf_info("%*sType 0x%02x: ", strlen(scan_response_label), "", data->type); switch (data->type) { case BT_DATA_UUID16_SOME: @@ -375,14 +372,13 @@ static bool data_verbose_cb(struct bt_data *data, void *user_data) * the rest is unknown and printed as single bytes */ if (data->data_len < BT_UUID_SIZE_16) { - shell_fprintf(ctx_shell, SHELL_WARNING, - "BT_DATA_SVC_DATA16 data length too short (%u)", - data->data_len); + bt_shell_fprintf_warn("BT_DATA_SVC_DATA16 data length too short (%u)", + data->data_len); break; } print_data_set(BT_UUID_SIZE_16, data->data, BT_UUID_SIZE_16); if (data->data_len > BT_UUID_SIZE_16) { - shell_fprintf(ctx_shell, SHELL_INFO, ADV_DATA_DELIMITER); + bt_shell_fprintf_info(ADV_DATA_DELIMITER); print_data_set(1, data->data + BT_UUID_SIZE_16, data->data_len - BT_UUID_SIZE_16); } @@ -396,14 +392,13 @@ static bool data_verbose_cb(struct bt_data *data, void *user_data) * the rest is unknown and printed as single bytes */ if (data->data_len < BT_UUID_SIZE_32) { - shell_fprintf(ctx_shell, SHELL_WARNING, - "BT_DATA_SVC_DATA32 data length too short (%u)", - data->data_len); + bt_shell_fprintf_warn("BT_DATA_SVC_DATA32 data length too short (%u)", + data->data_len); break; } print_data_set(BT_UUID_SIZE_32, data->data, BT_UUID_SIZE_32); if (data->data_len > BT_UUID_SIZE_32) { - shell_fprintf(ctx_shell, SHELL_INFO, ADV_DATA_DELIMITER); + bt_shell_fprintf_info(ADV_DATA_DELIMITER); print_data_set(1, data->data + BT_UUID_SIZE_32, data->data_len - BT_UUID_SIZE_32); } @@ -418,14 +413,13 @@ static bool data_verbose_cb(struct bt_data *data, void *user_data) * the rest is unknown and printed as single bytes */ if (data->data_len < BT_UUID_SIZE_128) { - shell_fprintf(ctx_shell, SHELL_WARNING, - "BT_DATA_SVC_DATA128 data length too short (%u)", - data->data_len); + bt_shell_fprintf_warn("BT_DATA_SVC_DATA128 data length too short (%u)", + data->data_len); break; } print_data_set(BT_UUID_SIZE_128, data->data, BT_UUID_SIZE_128); if (data->data_len > BT_UUID_SIZE_128) { - shell_fprintf(ctx_shell, SHELL_INFO, ADV_DATA_DELIMITER); + bt_shell_fprintf_info(ADV_DATA_DELIMITER); print_data_set(1, data->data + BT_UUID_SIZE_128, data->data_len - BT_UUID_SIZE_128); } @@ -433,7 +427,7 @@ static bool data_verbose_cb(struct bt_data *data, void *user_data) case BT_DATA_NAME_SHORTENED: case BT_DATA_NAME_COMPLETE: case BT_DATA_BROADCAST_NAME: - shell_fprintf(ctx_shell, SHELL_INFO, "%.*s", data->data_len, data->data); + bt_shell_fprintf_info("%.*s", data->data_len, data->data); break; case BT_DATA_PUB_TARGET_ADDR: case BT_DATA_RAND_TARGET_ADDR: @@ -444,13 +438,13 @@ static bool data_verbose_cb(struct bt_data *data, void *user_data) print_data_set(3, data->data, data->data_len); break; case BT_DATA_ENCRYPTED_AD_DATA: - shell_fprintf(ctx_shell, SHELL_INFO, "Encrypted Advertising Data: "); + bt_shell_fprintf_info("Encrypted Advertising Data: "); print_data_set(1, data->data, data->data_len); if (bt_shell_ead_decrypt_scan) { #if defined(CONFIG_BT_EAD) - shell_fprintf(ctx_shell, SHELL_INFO, "\n%*s[START DECRYPTED DATA]\n", - strlen(scan_response_label), ""); + bt_shell_fprintf_info("\n%*s[START DECRYPTED DATA]\n", + strlen(scan_response_label), ""); int ead_err; struct net_buf_simple decrypted_buf; @@ -460,7 +454,7 @@ static bool data_verbose_cb(struct bt_data *data, void *user_data) ead_err = bt_ead_decrypt(bt_shell_ead_session_key, bt_shell_ead_iv, data->data, data->data_len, decrypted_data); if (ead_err) { - shell_error(ctx_shell, "Error during decryption (err %d)", ead_err); + bt_shell_error("Error during decryption (err %d)", ead_err); } net_buf_simple_init_with_data(&decrypted_buf, &decrypted_data[0], @@ -468,8 +462,8 @@ static bool data_verbose_cb(struct bt_data *data, void *user_data) bt_data_parse(&decrypted_buf, &data_verbose_cb, user_data); - shell_fprintf(ctx_shell, SHELL_INFO, "%*s[END DECRYPTED DATA]", - strlen(scan_response_label), ""); + bt_shell_fprintf_info("%*s[END DECRYPTED DATA]", + strlen(scan_response_label), ""); #endif } break; @@ -477,7 +471,7 @@ static bool data_verbose_cb(struct bt_data *data, void *user_data) print_data_set(1, data->data, data->data_len); } - shell_fprintf(ctx_shell, SHELL_INFO, "\n"); + bt_shell_fprintf_info("\n"); return true; } @@ -560,27 +554,26 @@ static void scan_recv(const struct bt_le_scan_recv_info *info, struct net_buf_si bt_data_parse(buf, data_cb, name); bt_addr_le_to_str(info->addr, le_addr, sizeof(le_addr)); - shell_print(ctx_shell, "%s%s, AD evt type %u, RSSI %i %s " - "C:%u S:%u D:%d SR:%u E:%u Prim: %s, Secn: %s, " - "Interval: 0x%04x (%u us), SID: 0x%x", - scan_response_label, - le_addr, info->adv_type, info->rssi, name, - (info->adv_props & BT_GAP_ADV_PROP_CONNECTABLE) != 0, - (info->adv_props & BT_GAP_ADV_PROP_SCANNABLE) != 0, - (info->adv_props & BT_GAP_ADV_PROP_DIRECTED) != 0, - (info->adv_props & BT_GAP_ADV_PROP_SCAN_RESPONSE) != 0, - (info->adv_props & BT_GAP_ADV_PROP_EXT_ADV) != 0, - phy2str(info->primary_phy), phy2str(info->secondary_phy), - info->interval, BT_CONN_INTERVAL_TO_US(info->interval), - info->sid); + bt_shell_print("%s%s, AD evt type %u, RSSI %i %s " + "C:%u S:%u D:%d SR:%u E:%u Prim: %s, Secn: %s, " + "Interval: 0x%04x (%u us), SID: 0x%x", + scan_response_label, + le_addr, info->adv_type, info->rssi, name, + (info->adv_props & BT_GAP_ADV_PROP_CONNECTABLE) != 0, + (info->adv_props & BT_GAP_ADV_PROP_SCANNABLE) != 0, + (info->adv_props & BT_GAP_ADV_PROP_DIRECTED) != 0, + (info->adv_props & BT_GAP_ADV_PROP_SCAN_RESPONSE) != 0, + (info->adv_props & BT_GAP_ADV_PROP_EXT_ADV) != 0, + phy2str(info->primary_phy), phy2str(info->secondary_phy), + info->interval, BT_CONN_INTERVAL_TO_US(info->interval), + info->sid); if (scan_verbose_output) { - shell_info(ctx_shell, - "%*s[SCAN DATA START - %s]", - strlen(scan_response_label), "", - scan_response_type_txt(info->adv_type)); + bt_shell_info("%*s[SCAN DATA START - %s]", + strlen(scan_response_label), "", + scan_response_type_txt(info->adv_type)); bt_data_parse(&buf_copy, data_verbose_cb, NULL); - shell_info(ctx_shell, "%*s[SCAN DATA END]", strlen(scan_response_label), ""); + bt_shell_info("%*s[SCAN DATA END]", strlen(scan_response_label), ""); } #if defined(CONFIG_BT_CENTRAL) @@ -595,15 +588,16 @@ static void scan_recv(const struct bt_le_scan_recv_info *info, struct net_buf_si /* Use the above auto_connect.addr address to automatically connect */ if (auto_connect.connect_name) { + __maybe_unused int ercd; + auto_connect.connect_name = false; - cmd_scan_off(ctx_shell); + bt_do_scan_off(); - /* "name" is what would be in argv[0] normally */ - cmd_scan_filter_clear_name(ctx_shell, 1, (char *[]){"name"}); + bt_do_scan_filter_clear_name(); /* "connect" is what would be in argv[0] normally */ - cmd_connect_le(ctx_shell, 1, (char *[]){"connect"}); + bt_do_connect_le(&ercd, 1, (char *[]){"connect"}); } } else { bt_conn_unref(conn); @@ -614,7 +608,7 @@ static void scan_recv(const struct bt_le_scan_recv_info *info, struct net_buf_si static void scan_timeout(void) { - shell_print(ctx_shell, "Scan timeout"); + bt_shell_print("Scan timeout"); } #endif /* CONFIG_BT_OBSERVER */ @@ -623,8 +617,8 @@ static void scan_timeout(void) static void adv_sent(struct bt_le_ext_adv *adv, struct bt_le_ext_adv_sent_info *info) { - shell_print(ctx_shell, "Advertiser[%d] %p sent %d", - bt_le_ext_adv_get_index(adv), adv, info->num_sent); + bt_shell_print("Advertiser[%d] %p sent %d", bt_le_ext_adv_get_index(adv), adv, + info->num_sent); } static void adv_scanned(struct bt_le_ext_adv *adv, @@ -634,8 +628,7 @@ static void adv_scanned(struct bt_le_ext_adv *adv, bt_addr_le_to_str(info->addr, str, sizeof(str)); - shell_print(ctx_shell, "Advertiser[%d] %p scanned by %s", - bt_le_ext_adv_get_index(adv), adv, str); + bt_shell_print("Advertiser[%d] %p scanned by %s", bt_le_ext_adv_get_index(adv), adv, str); } #endif /* CONFIG_BT_BROADCASTER */ @@ -647,8 +640,7 @@ static void adv_connected(struct bt_le_ext_adv *adv, bt_addr_le_to_str(bt_conn_get_dst(info->conn), str, sizeof(str)); - shell_print(ctx_shell, "Advertiser[%d] %p connected by %s", - bt_le_ext_adv_get_index(adv), adv, str); + bt_shell_print("Advertiser[%d] %p connected by %s", bt_le_ext_adv_get_index(adv), adv, str); } #endif /* CONFIG_BT_PERIPHERAL */ @@ -659,9 +651,8 @@ static bool adv_rpa_expired(struct bt_le_ext_adv *adv) bool keep_rpa = atomic_test_bit(adv_set_opt[adv_index], SHELL_ADV_OPT_KEEP_RPA); - shell_print(ctx_shell, "Advertiser[%d] %p RPA %s", - adv_index, adv, - keep_rpa ? "not expired" : "expired"); + bt_shell_print("Advertiser[%d] %p RPA %s", adv_index, adv, + keep_rpa ? "not expired" : "expired"); #if defined(CONFIG_BT_EAD) /* EAD must be updated each time the RPA is updated */ @@ -758,16 +749,16 @@ static void connected(struct bt_conn *conn, uint8_t err) conn_addr_str(conn, addr, sizeof(addr)); if (err) { - shell_error(ctx_shell, "Failed to connect to %s 0x%02x %s", addr, - err, bt_hci_err_to_str(err)); + bt_shell_error("Failed to connect to %s 0x%02x %s", addr, + err, bt_hci_err_to_str(err)); goto done; } - shell_print(ctx_shell, "Connected: %s", addr); + bt_shell_print("Connected: %s", addr); info_err = bt_conn_get_info(conn, &info); if (info_err != 0) { - shell_error(ctx_shell, "Failed to connection information: %d", info_err); + bt_shell_error("Failed to connection information: %d", info_err); goto done; } @@ -801,7 +792,7 @@ static void disconnected_set_new_default_conn_cb(struct bt_conn *conn, void *use } if (bt_conn_get_info(conn, &info) != 0) { - shell_error(ctx_shell, "Unable to get info: conn %p", conn); + bt_shell_error("Unable to get info: conn %p", conn); return; } @@ -811,7 +802,7 @@ static void disconnected_set_new_default_conn_cb(struct bt_conn *conn, void *use default_conn = bt_conn_ref(conn); bt_addr_le_to_str(info.le.dst, addr_str, sizeof(addr_str)); - shell_print(ctx_shell, "Selected conn is now: %s", addr_str); + bt_shell_print("Selected conn is now: %s", addr_str); } } @@ -820,7 +811,7 @@ static void disconnected(struct bt_conn *conn, uint8_t reason) char addr[BT_ADDR_LE_STR_LEN]; conn_addr_str(conn, addr, sizeof(addr)); - shell_print(ctx_shell, "Disconnected: %s (reason 0x%02x)", addr, reason); + bt_shell_print("Disconnected: %s (reason 0x%02x)", addr, reason); if (default_conn == conn) { bt_conn_unref(default_conn); @@ -833,9 +824,9 @@ static void disconnected(struct bt_conn *conn, uint8_t reason) static bool le_param_req(struct bt_conn *conn, struct bt_le_conn_param *param) { - shell_print(ctx_shell, "LE conn param req: int (0x%04x, 0x%04x) lat %d" - " to %d", param->interval_min, param->interval_max, - param->latency, param->timeout); + bt_shell_print("LE conn param req: int (0x%04x, 0x%04x) lat %d" + " to %d", param->interval_min, param->interval_max, + param->latency, param->timeout); return true; } @@ -843,8 +834,8 @@ static bool le_param_req(struct bt_conn *conn, struct bt_le_conn_param *param) static void le_param_updated(struct bt_conn *conn, uint16_t interval, uint16_t latency, uint16_t timeout) { - shell_print(ctx_shell, "LE conn param updated: int 0x%04x lat %d " - "to %d", interval, latency, timeout); + bt_shell_print("LE conn param updated: int 0x%04x lat %d " + "to %d", interval, latency, timeout); } #if defined(CONFIG_BT_SMP) @@ -857,8 +848,7 @@ static void identity_resolved(struct bt_conn *conn, const bt_addr_le_t *rpa, bt_addr_le_to_str(identity, addr_identity, sizeof(addr_identity)); bt_addr_le_to_str(rpa, addr_rpa, sizeof(addr_rpa)); - shell_print(ctx_shell, "Identity resolved %s -> %s", addr_rpa, - addr_identity); + bt_shell_print("Identity resolved %s -> %s", addr_rpa, addr_identity); } #endif @@ -897,12 +887,11 @@ static void security_changed(struct bt_conn *conn, bt_security_t level, conn_addr_str(conn, addr, sizeof(addr)); if (!err) { - shell_print(ctx_shell, "Security changed: %s level %u", addr, - level); + bt_shell_print("Security changed: %s level %u", addr, level); } else { - shell_print(ctx_shell, "Security failed: %s level %u " - "reason: %s (%d)", - addr, level, security_err_str(err), err); + bt_shell_print("Security failed: %s level %u " + "reason: %s (%d)", + addr, level, security_err_str(err), err); } } #endif @@ -916,11 +905,10 @@ static void remote_info_available(struct bt_conn *conn, bt_conn_get_info(conn, &info); if (IS_ENABLED(CONFIG_BT_REMOTE_VERSION)) { - shell_print(ctx_shell, - "Remote LMP version %s (0x%02x) subversion 0x%04x " - "manufacturer 0x%04x", bt_hci_get_ver_str(remote_info->version), - remote_info->version, remote_info->subversion, - remote_info->manufacturer); + bt_shell_print("Remote LMP version %s (0x%02x) subversion 0x%04x " + "manufacturer 0x%04x", bt_hci_get_ver_str(remote_info->version), + remote_info->version, remote_info->subversion, + remote_info->manufacturer); } if (info.type == BT_CONN_TYPE_LE) { @@ -931,7 +919,7 @@ static void remote_info_available(struct bt_conn *conn, sizeof(features)); bin2hex(features, sizeof(features), features_str, sizeof(features_str)); - shell_print(ctx_shell, "LE Features: 0x%s ", features_str); + bt_shell_print("LE Features: 0x%s ", features_str); } } #endif /* defined(CONFIG_BT_REMOTE_INFO) */ @@ -940,10 +928,9 @@ static void remote_info_available(struct bt_conn *conn, void le_data_len_updated(struct bt_conn *conn, struct bt_conn_le_data_len_info *info) { - shell_print(ctx_shell, - "LE data len updated: TX (len: %d time: %d)" - " RX (len: %d time: %d)", info->tx_max_len, - info->tx_max_time, info->rx_max_len, info->rx_max_time); + bt_shell_print("LE data len updated: TX (len: %d time: %d)" + " RX (len: %d time: %d)", info->tx_max_len, + info->tx_max_time, info->rx_max_len, info->rx_max_time); } #endif @@ -951,8 +938,8 @@ void le_data_len_updated(struct bt_conn *conn, void le_phy_updated(struct bt_conn *conn, struct bt_conn_le_phy_info *info) { - shell_print(ctx_shell, "LE PHY updated: TX PHY %s, RX PHY %s", - phy2str(info->tx_phy), phy2str(info->rx_phy)); + bt_shell_print("LE PHY updated: TX PHY %s, RX PHY %s", + phy2str(info->tx_phy), phy2str(info->rx_phy)); } #endif @@ -960,11 +947,11 @@ void le_phy_updated(struct bt_conn *conn, void tx_power_report(struct bt_conn *conn, const struct bt_conn_le_tx_power_report *report) { - shell_print(ctx_shell, "Tx Power Report: Reason: %s, PHY: %s, Tx Power Level: %d", - tx_power_report_reason2str(report->reason), tx_pwr_ctrl_phy2str(report->phy), - report->tx_power_level); - shell_print(ctx_shell, "Tx Power Level Flag Info: %s, Delta: %d", - tx_power_flag2str(report->tx_power_level_flag), report->delta); + bt_shell_print("Tx Power Report: Reason: %s, PHY: %s, Tx Power Level: %d", + tx_power_report_reason2str(report->reason), tx_pwr_ctrl_phy2str(report->phy), + report->tx_power_level); + bt_shell_print("Tx Power Level Flag Info: %s, Delta: %d", + tx_power_flag2str(report->tx_power_level_flag), report->delta); } #endif @@ -972,8 +959,8 @@ void tx_power_report(struct bt_conn *conn, void path_loss_threshold_report(struct bt_conn *conn, const struct bt_conn_le_path_loss_threshold_report *report) { - shell_print(ctx_shell, "Path Loss Threshold event: Zone: %s, Path loss dbm: %d", - plm_report_zone_str(report->zone), report->path_loss); + bt_shell_print("Path Loss Threshold event: Zone: %s, Path loss dbm: %d", + plm_report_zone_str(report->zone), report->path_loss); } #endif @@ -982,18 +969,18 @@ void subrate_changed(struct bt_conn *conn, const struct bt_conn_le_subrate_changed *params) { if (params->status == BT_HCI_ERR_SUCCESS) { - shell_print(ctx_shell, "Subrate parameters changed: " - "Subrate Factor: %d " - "Continuation Number: %d " - "Peripheral latency: 0x%04x " - "Supervision timeout: 0x%04x (%d ms)", - params->factor, - params->continuation_number, - params->peripheral_latency, - params->supervision_timeout, - params->supervision_timeout * 10); + bt_shell_print("Subrate parameters changed: " + "Subrate Factor: %d " + "Continuation Number: %d " + "Peripheral latency: 0x%04x " + "Supervision timeout: 0x%04x (%d ms)", + params->factor, + params->continuation_number, + params->peripheral_latency, + params->supervision_timeout, + params->supervision_timeout * 10); } else { - shell_print(ctx_shell, "Subrate change failed (HCI status 0x%02x)", params->status); + bt_shell_print("Subrate change failed (HCI status 0x%02x)", params->status); } } #endif @@ -1001,8 +988,7 @@ void subrate_changed(struct bt_conn *conn, #if defined(CONFIG_BT_CHANNEL_SOUNDING) void print_remote_cs_capabilities(struct bt_conn *conn, struct bt_conn_le_cs_capabilities *params) { - shell_print( - ctx_shell, + bt_shell_print( "Received remote channel sounding capabilities:\n" "- Num CS configurations: %d\n" "- Max consecutive CS procedures: %d\n" @@ -1065,8 +1051,8 @@ void print_remote_cs_capabilities(struct bt_conn *conn, struct bt_conn_le_cs_cap void print_remote_cs_fae_table(struct bt_conn *conn, struct bt_conn_le_cs_fae_table *params) { - shell_print(ctx_shell, "Received FAE Table: "); - shell_hexdump(ctx_shell, params->remote_fae_table, 72); + bt_shell_print("Received FAE Table: "); + bt_shell_hexdump(params->remote_fae_table, 72); } static void le_cs_config_created(struct bt_conn *conn, struct bt_conn_le_cs_config *config) @@ -1091,40 +1077,40 @@ static void le_cs_config_created(struct bt_conn *conn, struct bt_conn_le_cs_conf uint8_t chsel_type_idx = MIN(config->channel_selection_type, 2); uint8_t ch3c_shape_idx = MIN(config->ch3c_shape, 2); - shell_print(ctx_shell, - "New CS config created:\n" - "- ID: %d\n" - "- Role: %s\n" - "- Main mode: %s\n" - "- Sub mode: %s\n" - "- RTT type: %s\n" - "- Main mode steps: %d - %d\n" - "- Main mode repetition: %d\n" - "- Mode 0 steps: %d\n" - "- CS sync PHY: %s\n" - "- T_IP1 time: %d\n" - "- T_IP2 time: %d\n" - "- T_FCS time: %d\n" - "- T_PM time: %d\n" - "- Channel map: 0x%08X%08X%04X\n" - "- Channel map repetition: %d\n" - "- Channel selection type: %s\n" - "- Ch3c shape: %s\n" - "- Ch3c jump: %d\n", - config->id, role_str[role_idx], mode_str[main_mode_idx], mode_str[sub_mode_idx], - rtt_type_str[rtt_type_idx], config->min_main_mode_steps, - config->max_main_mode_steps, config->main_mode_repetition, config->mode_0_steps, - phy_str[phy_idx], config->t_ip1_time_us, config->t_ip2_time_us, - config->t_fcs_time_us, config->t_pm_time_us, - sys_get_le32(&config->channel_map[6]), sys_get_le32(&config->channel_map[2]), - sys_get_le16(&config->channel_map[0]), config->channel_map_repetition, - chsel_type_str[chsel_type_idx], ch3c_shape_str[ch3c_shape_idx], - config->ch3c_jump); + bt_shell_print( + "New CS config created:\n" + "- ID: %d\n" + "- Role: %s\n" + "- Main mode: %s\n" + "- Sub mode: %s\n" + "- RTT type: %s\n" + "- Main mode steps: %d - %d\n" + "- Main mode repetition: %d\n" + "- Mode 0 steps: %d\n" + "- CS sync PHY: %s\n" + "- T_IP1 time: %d\n" + "- T_IP2 time: %d\n" + "- T_FCS time: %d\n" + "- T_PM time: %d\n" + "- Channel map: 0x%08X%08X%04X\n" + "- Channel map repetition: %d\n" + "- Channel selection type: %s\n" + "- Ch3c shape: %s\n" + "- Ch3c jump: %d\n", + config->id, role_str[role_idx], mode_str[main_mode_idx], mode_str[sub_mode_idx], + rtt_type_str[rtt_type_idx], config->min_main_mode_steps, + config->max_main_mode_steps, config->main_mode_repetition, config->mode_0_steps, + phy_str[phy_idx], config->t_ip1_time_us, config->t_ip2_time_us, + config->t_fcs_time_us, config->t_pm_time_us, + sys_get_le32(&config->channel_map[6]), sys_get_le32(&config->channel_map[2]), + sys_get_le16(&config->channel_map[0]), config->channel_map_repetition, + chsel_type_str[chsel_type_idx], ch3c_shape_str[ch3c_shape_idx], + config->ch3c_jump); } static void le_cs_config_removed(struct bt_conn *conn, uint8_t config_id) { - shell_print(ctx_shell, "CS config %d is removed", config_id); + bt_shell_print("CS config %d is removed", config_id); } #endif @@ -1207,12 +1193,12 @@ static void per_adv_sync_sync_cb(struct bt_le_per_adv_sync *sync, conn_addr_str(info->conn, past_peer, sizeof(past_peer)); } - shell_print(ctx_shell, "PER_ADV_SYNC[%u]: [DEVICE]: %s synced, " - "Interval 0x%04x (%u us), PHY %s, SD 0x%04X, PAST peer %s", - bt_le_per_adv_sync_get_index(sync), le_addr, - info->interval, BT_CONN_INTERVAL_TO_US(info->interval), - phy2str(info->phy), info->service_data, - is_past_peer ? past_peer : "not present"); + bt_shell_print("PER_ADV_SYNC[%u]: [DEVICE]: %s synced, " + "Interval 0x%04x (%u us), PHY %s, SD 0x%04X, PAST peer %s", + bt_le_per_adv_sync_get_index(sync), le_addr, + info->interval, BT_CONN_INTERVAL_TO_US(info->interval), + phy2str(info->phy), info->service_data, + is_past_peer ? past_peer : "not present"); if (info->conn) { /* if from PAST */ for (int i = 0; i < ARRAY_SIZE(per_adv_syncs); i++) { @@ -1238,8 +1224,8 @@ static void per_adv_sync_terminated_cb( } bt_addr_le_to_str(info->addr, le_addr, sizeof(le_addr)); - shell_print(ctx_shell, "PER_ADV_SYNC[%u]: [DEVICE]: %s sync terminated", - bt_le_per_adv_sync_get_index(sync), le_addr); + bt_shell_print("PER_ADV_SYNC[%u]: [DEVICE]: %s sync terminated", + bt_le_per_adv_sync_get_index(sync), le_addr); } static void per_adv_sync_recv_cb( @@ -1250,10 +1236,10 @@ static void per_adv_sync_recv_cb( char le_addr[BT_ADDR_LE_STR_LEN]; bt_addr_le_to_str(info->addr, le_addr, sizeof(le_addr)); - shell_print(ctx_shell, "PER_ADV_SYNC[%u]: [DEVICE]: %s, tx_power %i, " - "RSSI %i, CTE %u, data length %u", - bt_le_per_adv_sync_get_index(sync), le_addr, info->tx_power, - info->rssi, info->cte_type, buf->len); + bt_shell_print("PER_ADV_SYNC[%u]: [DEVICE]: %s, tx_power %i, " + "RSSI %i, CTE %u, data length %u", + bt_le_per_adv_sync_get_index(sync), le_addr, info->tx_power, + info->rssi, info->cte_type, buf->len); } static void per_adv_sync_biginfo_cb(struct bt_le_per_adv_sync *sync, @@ -1262,16 +1248,16 @@ static void per_adv_sync_biginfo_cb(struct bt_le_per_adv_sync *sync, char le_addr[BT_ADDR_LE_STR_LEN]; bt_addr_le_to_str(biginfo->addr, le_addr, sizeof(le_addr)); - shell_print(ctx_shell, "BIG_INFO PER_ADV_SYNC[%u]: [DEVICE]: %s, sid 0x%02x, num_bis %u, " - "nse 0x%02x, interval 0x%04x (%u us), bn 0x%02x, pto 0x%02x, irc 0x%02x, " - "max_pdu 0x%04x, sdu_interval 0x%04x, max_sdu 0x%04x, phy %s, framing 0x%02x, " - "%sencrypted", - bt_le_per_adv_sync_get_index(sync), le_addr, biginfo->sid, biginfo->num_bis, - biginfo->sub_evt_count, biginfo->iso_interval, - BT_CONN_INTERVAL_TO_US(biginfo->iso_interval), biginfo->burst_number, - biginfo->offset, biginfo->rep_count, biginfo->max_pdu, biginfo->sdu_interval, - biginfo->max_sdu, phy2str(biginfo->phy), biginfo->framing, - biginfo->encryption ? "" : "not "); + bt_shell_print("BIG_INFO PER_ADV_SYNC[%u]: [DEVICE]: %s, sid 0x%02x, num_bis %u, " + "nse 0x%02x, interval 0x%04x (%u us), bn 0x%02x, pto 0x%02x, irc 0x%02x, " + "max_pdu 0x%04x, sdu_interval 0x%04x, max_sdu 0x%04x, phy %s, framing 0x%02x, " + "%sencrypted", + bt_le_per_adv_sync_get_index(sync), le_addr, biginfo->sid, biginfo->num_bis, + biginfo->sub_evt_count, biginfo->iso_interval, + BT_CONN_INTERVAL_TO_US(biginfo->iso_interval), biginfo->burst_number, + biginfo->offset, biginfo->rep_count, biginfo->max_pdu, biginfo->sdu_interval, + biginfo->max_sdu, phy2str(biginfo->phy), biginfo->framing, + biginfo->encryption ? "" : "not "); } static struct bt_le_per_adv_sync_cb per_adv_sync_cb = { @@ -1285,15 +1271,15 @@ static struct bt_le_per_adv_sync_cb per_adv_sync_cb = { static void bt_ready(int err) { if (err) { - shell_error(ctx_shell, "Bluetooth init failed (err %d)", err); + bt_shell_error("Bluetooth init failed (err %d)", err); return; } - shell_print(ctx_shell, "Bluetooth initialized"); + bt_shell_print("Bluetooth initialized"); if (IS_ENABLED(CONFIG_SETTINGS) && !no_settings_load) { settings_load(); - shell_print(ctx_shell, "Settings Loaded"); + bt_shell_print("Settings Loaded"); } if (IS_ENABLED(CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY)) { @@ -1664,7 +1650,7 @@ static int cmd_passive_scan_on(const struct shell *sh, uint32_t options, return 0; } -static int cmd_scan_off(const struct shell *sh) +static int bt_do_scan_off(void) { int err; @@ -1672,6 +1658,15 @@ static int cmd_scan_off(const struct shell *sh) (void)k_work_cancel_delayable(&active_scan_timeout_work); err = bt_le_scan_stop(); + + return err; +} + +static int cmd_scan_off(const struct shell *sh) +{ + int err; + + err = bt_do_scan_off(); if (err) { shell_error(sh, "Stopping scanning failed (err %d)", err); return err; @@ -1862,11 +1857,20 @@ static int cmd_scan_filter_clear_all(const struct shell *sh, size_t argc, return 0; } -static int cmd_scan_filter_clear_name(const struct shell *sh, size_t argc, - char *argv[]) +static void bt_do_scan_filter_clear_name(void) { (void)memset(scan_filter.name, 0, sizeof(scan_filter.name)); scan_filter.name_set = false; +} + +static int cmd_scan_filter_clear_name(const struct shell *sh, size_t argc, + char *argv[]) +{ + ARG_UNUSED(sh); + ARG_UNUSED(argc); + ARG_UNUSED(argv); + + bt_do_scan_filter_clear_name(); return 0; } @@ -1874,6 +1878,10 @@ static int cmd_scan_filter_clear_name(const struct shell *sh, size_t argc, static int cmd_scan_filter_clear_addr(const struct shell *sh, size_t argc, char *argv[]) { + ARG_UNUSED(sh); + ARG_UNUSED(argc); + ARG_UNUSED(argv); + (void)memset(scan_filter.addr, 0, sizeof(scan_filter.addr)); scan_filter.addr_set = false; @@ -1934,7 +1942,7 @@ static ssize_t ad_init(struct bt_data *data_array, const size_t data_array_size, csis_ad_len = csis_ad_data_add(&data_array[ad_len], data_array_size - ad_len, discoverable); if (csis_ad_len < 0) { - shell_error(ctx_shell, "Failed to add CSIS data (err %d)", csis_ad_len); + bt_shell_error("Failed to add CSIS data (err %d)", csis_ad_len); return ad_len; } @@ -3257,28 +3265,27 @@ static int cmd_subrate_request(const struct shell *sh, size_t argc, char *argv[] #if defined(CONFIG_BT_CONN) #if defined(CONFIG_BT_CENTRAL) -static int cmd_connect_le(const struct shell *sh, size_t argc, char *argv[]) +static int bt_do_connect_le(int *ercd, size_t argc, char *argv[]) { int err; bt_addr_le_t addr; struct bt_conn *conn = NULL; uint32_t options = 0; + *ercd = 0; + /* When no arguments are specified, connect to the last scanned device. */ if (argc == 1) { if (auto_connect.addr_set) { bt_addr_le_copy(&addr, &auto_connect.addr); } else { - shell_error(sh, "No connectable adv stored, please trigger a scan first."); - shell_help(sh); - - return SHELL_CMD_HELP_PRINTED; + return -ENOENT; } } else { err = bt_addr_le_from_str(argv[1], argv[2], &addr); if (err) { - shell_error(sh, "Invalid peer address (err %d)", err); - return err; + *ercd = err; + return -EINVAL; } } @@ -3291,7 +3298,6 @@ static int cmd_connect_le(const struct shell *sh, size_t argc, char *argv[]) } else if (!strcmp(arg, "no-1m")) { options |= BT_CONN_LE_OPT_NO_1M; } else { - shell_help(sh); return SHELL_CMD_HELP_PRINTED; } } @@ -3305,12 +3311,9 @@ static int cmd_connect_le(const struct shell *sh, size_t argc, char *argv[]) err = bt_conn_le_create(&addr, create_params, BT_LE_CONN_PARAM_DEFAULT, &conn); if (err) { - shell_error(sh, "Connection failed (%d)", err); + *ercd = err; return -ENOEXEC; } else { - - shell_print(sh, "Connection pending"); - /* unref connection obj in advance as app user */ bt_conn_unref(conn); } @@ -3318,6 +3321,32 @@ static int cmd_connect_le(const struct shell *sh, size_t argc, char *argv[]) return 0; } +static int cmd_connect_le(const struct shell *sh, size_t argc, char *argv[]) +{ + int err; + int ercd; + + err = bt_do_connect_le(&ercd, argc, argv); + switch (err) { + case -ENOENT: + shell_error(sh, "No connectable adv stored. Please trigger a scan first."); + shell_help(sh); + return SHELL_CMD_HELP_PRINTED; + case -EINVAL: + shell_error(sh, "Invalid peer address (err %d)", ercd); + return ercd; + case SHELL_CMD_HELP_PRINTED: + shell_help(sh); + return SHELL_CMD_HELP_PRINTED; + case -ENOEXEC: + shell_error(sh, "Connection failed (%d)", ercd); + return -ENOEXEC; + default: + shell_print(sh, "Connection pending"); + return 0; + } +} + static int cmd_connect_le_name(const struct shell *sh, size_t argc, char *argv[]) { const struct bt_le_scan_param param = { @@ -3904,7 +3933,7 @@ static void bond_info(const struct bt_bond_info *info, void *user_data) int *bond_count = user_data; bt_addr_le_to_str(&info->addr, addr, sizeof(addr)); - shell_print(ctx_shell, "Remote Identity: %s", addr); + bt_shell_print("Remote Identity: %s", addr); (*bond_count)++; } @@ -3938,7 +3967,7 @@ static void connection_info(struct bt_conn *conn, void *user_data) struct bt_conn_info info; if (bt_conn_get_info(conn, &info) < 0) { - shell_error(ctx_shell, "Unable to get info: conn %p", conn); + bt_shell_error("Unable to get info: conn %p", conn); return; } @@ -3946,19 +3975,19 @@ static void connection_info(struct bt_conn *conn, void *user_data) #if defined(CONFIG_BT_CLASSIC) case BT_CONN_TYPE_BR: bt_addr_to_str(info.br.dst, addr, sizeof(addr)); - shell_print(ctx_shell, " #%u [BR][%s] %s", info.id, role_str(info.role), addr); + bt_shell_print(" #%u [BR][%s] %s", info.id, role_str(info.role), addr); break; #endif case BT_CONN_TYPE_LE: bt_addr_le_to_str(info.le.dst, addr, sizeof(addr)); - shell_print(ctx_shell, "%s#%u [LE][%s] %s: Interval %u latency %u timeout %u", - conn == default_conn ? "*" : " ", info.id, role_str(info.role), addr, - info.le.interval, info.le.latency, info.le.timeout); + bt_shell_print("%s#%u [LE][%s] %s: Interval %u latency %u timeout %u", + conn == default_conn ? "*" : " ", info.id, role_str(info.role), addr, + info.le.interval, info.le.latency, info.le.timeout); break; #if defined(CONFIG_BT_ISO) case BT_CONN_TYPE_ISO: bt_addr_le_to_str(info.le.dst, addr, sizeof(addr)); - shell_print(ctx_shell, " #%u [ISO][%s] %s", info.id, role_str(info.role), addr); + bt_shell_print(" #%u [ISO][%s] %s", info.id, role_str(info.role), addr); break; #endif default: @@ -3988,7 +4017,7 @@ static void auth_passkey_display(struct bt_conn *conn, unsigned int passkey) snprintk(passkey_str, 7, "%06u", passkey); - shell_print(ctx_shell, "Passkey for %s: %s", addr, passkey_str); + bt_shell_print("Passkey for %s: %s", addr, passkey_str); } #if defined(CONFIG_BT_PASSKEY_KEYPRESS) @@ -3999,8 +4028,8 @@ static void auth_passkey_display_keypress(struct bt_conn *conn, bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); - shell_print(ctx_shell, "Passkey keypress notification from %s: type %d", - addr, type); + bt_shell_print("Passkey keypress notification from %s: type %d", + addr, type); } #endif @@ -4013,7 +4042,7 @@ static void auth_passkey_confirm(struct bt_conn *conn, unsigned int passkey) snprintk(passkey_str, 7, "%06u", passkey); - shell_print(ctx_shell, "Confirm passkey for %s: %s", addr, passkey_str); + bt_shell_print("Confirm passkey for %s: %s", addr, passkey_str); } static void auth_passkey_entry(struct bt_conn *conn) @@ -4022,7 +4051,7 @@ static void auth_passkey_entry(struct bt_conn *conn) bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); - shell_print(ctx_shell, "Enter passkey for %s", addr); + bt_shell_print("Enter passkey for %s", addr); } static void auth_cancel(struct bt_conn *conn) @@ -4031,7 +4060,7 @@ static void auth_cancel(struct bt_conn *conn) conn_addr_str(conn, addr, sizeof(addr)); - shell_print(ctx_shell, "Pairing cancelled: %s", addr); + bt_shell_print("Pairing cancelled: %s", addr); /* clear connection reference for sec mode 3 pairing */ if (pairing_conn) { @@ -4046,7 +4075,7 @@ static void auth_pairing_confirm(struct bt_conn *conn) bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); - shell_print(ctx_shell, "Confirm pairing for %s", addr); + bt_shell_print("Confirm pairing for %s", addr); } #if !defined(CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY) @@ -4092,9 +4121,7 @@ static void auth_pairing_oob_data_request(struct bt_conn *conn, if (oobd_remote && !bt_addr_le_eq(info.le.remote, &oob_remote.addr)) { bt_addr_le_to_str(info.le.remote, addr, sizeof(addr)); - shell_print(ctx_shell, - "No OOB data available for remote %s", - addr); + bt_shell_print("No OOB data available for remote %s", addr); bt_conn_auth_cancel(conn); return; } @@ -4102,9 +4129,7 @@ static void auth_pairing_oob_data_request(struct bt_conn *conn, if (oobd_local && !bt_addr_le_eq(info.le.local, &oob_local.addr)) { bt_addr_le_to_str(info.le.local, addr, sizeof(addr)); - shell_print(ctx_shell, - "No OOB data available for local %s", - addr); + bt_shell_print("No OOB data available for local %s", addr); bt_conn_auth_cancel(conn); return; } @@ -4112,14 +4137,14 @@ static void auth_pairing_oob_data_request(struct bt_conn *conn, bt_le_oob_set_sc_data(conn, oobd_local, oobd_remote); bt_addr_le_to_str(info.le.dst, addr, sizeof(addr)); - shell_print(ctx_shell, "Set %s OOB SC data for %s, ", - oob_config_str(oob_info->lesc.oob_config), addr); + bt_shell_print("Set %s OOB SC data for %s, ", + oob_config_str(oob_info->lesc.oob_config), addr); return; } #endif /* CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY */ bt_addr_le_to_str(info.le.dst, addr, sizeof(addr)); - shell_print(ctx_shell, "Legacy OOB TK requested from remote %s", addr); + bt_shell_print("Legacy OOB TK requested from remote %s", addr); } static void auth_pairing_complete(struct bt_conn *conn, bool bonded) @@ -4128,8 +4153,7 @@ static void auth_pairing_complete(struct bt_conn *conn, bool bonded) bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); - shell_print(ctx_shell, "%s with %s", bonded ? "Bonded" : "Paired", - addr); + bt_shell_print("%s with %s", bonded ? "Bonded" : "Paired", addr); } static void auth_pairing_failed(struct bt_conn *conn, enum bt_security_err err) @@ -4138,8 +4162,7 @@ static void auth_pairing_failed(struct bt_conn *conn, enum bt_security_err err) bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); - shell_print(ctx_shell, "Pairing failed with %s reason: %s (%d)", addr, - security_err_str(err), err); + bt_shell_print("Pairing failed with %s reason: %s (%d)", addr, security_err_str(err), err); } #if defined(CONFIG_BT_CLASSIC) @@ -4159,10 +4182,9 @@ static void auth_pincode_entry(struct bt_conn *conn, bool highsec) bt_addr_to_str(info.br.dst, addr, sizeof(addr)); if (highsec) { - shell_print(ctx_shell, "Enter 16 digits wide PIN code for %s", - addr); + bt_shell_print("Enter 16 digits wide PIN code for %s", addr); } else { - shell_print(ctx_shell, "Enter PIN code for %s", addr); + bt_shell_print("Enter PIN code for %s", addr); } /* @@ -4179,12 +4201,12 @@ static void auth_pincode_entry(struct bt_conn *conn, bool highsec) enum bt_security_err pairing_accept( struct bt_conn *conn, const struct bt_conn_pairing_feat *const feat) { - shell_print(ctx_shell, "Remote pairing features: " - "IO: 0x%02x, OOB: %d, AUTH: 0x%02x, Key: %d, " - "Init Kdist: 0x%02x, Resp Kdist: 0x%02x", - feat->io_capability, feat->oob_data_flag, - feat->auth_req, feat->max_enc_key_size, - feat->init_key_dist, feat->resp_key_dist); + bt_shell_print("Remote pairing features: " + "IO: 0x%02x, OOB: %d, AUTH: 0x%02x, Key: %d, " + "Init Kdist: 0x%02x, Resp Kdist: 0x%02x", + feat->io_capability, feat->oob_data_flag, + feat->auth_req, feat->max_enc_key_size, + feat->init_key_dist, feat->resp_key_dist); return BT_SECURITY_ERR_SUCCESS; } @@ -4195,7 +4217,7 @@ void bond_deleted(uint8_t id, const bt_addr_le_t *peer) char addr[BT_ADDR_LE_STR_LEN]; bt_addr_le_to_str(peer, addr, sizeof(addr)); - shell_print(ctx_shell, "Bond deleted for %s, id %u", addr, id); + bt_shell_print("Bond deleted for %s, id %u", addr, id); } static struct bt_conn_auth_cb auth_cb_display = { @@ -4763,7 +4785,7 @@ int ead_encrypt_ad(const uint8_t *payload, uint8_t payload_size, uint8_t *encryp err = bt_ead_encrypt(bt_shell_ead_session_key, bt_shell_ead_iv, payload, payload_size, encrypted_payload); if (err != 0) { - shell_error(ctx_shell, "Failed to encrypt AD."); + bt_shell_error("Failed to encrypt AD."); return -1; } @@ -4791,7 +4813,7 @@ int ead_update_ad(void) if (ad->data_len < 0) { /* if the len is less than 0 that mean there is not even a type field */ - shell_error(ctx_shell, "Failed to update AD due to malformed AD."); + bt_shell_error("Failed to update AD due to malformed AD."); return -ENOEXEC; } @@ -4819,11 +4841,11 @@ int ead_update_ad(void) err = bt_le_ext_adv_set_data(adv, ad_structs, bt_shell_ead_ad_len, NULL, 0); if (err != 0) { - shell_error(ctx_shell, "Failed to set advertising data (err %d)", err); + bt_shell_error("Failed to set advertising data (err %d)", err); return -ENOEXEC; } - shell_info(ctx_shell, "Advertising data for Advertiser[%d] %p updated.", selected_adv, adv); + bt_shell_info("Advertising data for Advertiser[%d] %p updated.", selected_adv, adv); return 0; } diff --git a/subsys/bluetooth/host/shell/cs.c b/subsys/bluetooth/host/shell/cs.c index 86f3a311932f1..2597063cbed47 100644 --- a/subsys/bluetooth/host/shell/cs.c +++ b/subsys/bluetooth/host/shell/cs.c @@ -24,7 +24,8 @@ #include #include -#include "bt.h" +#include "host/shell/bt.h" +#include "host/shell/bt_shell_private.h" static int check_cs_sync_antenna_selection_input(uint16_t input) { @@ -138,21 +139,21 @@ static int cmd_read_remote_fae_table(const struct shell *sh, size_t argc, char * static bool process_step_data(struct bt_le_cs_subevent_step *step, void *user_data) { - shell_print(ctx_shell, "Subevent results contained step data: "); - shell_print(ctx_shell, "- Step mode %d\n" + bt_shell_print("Subevent results contained step data: "); + bt_shell_print("- Step mode %d\n" "- Step channel %d\n" "- Step data hexdump:", step->mode, step->channel); - shell_hexdump(ctx_shell, step->data, step->data_len); + bt_shell_hexdump(step->data, step->data_len); return true; } static void cs_test_subevent_data_cb(struct bt_conn_le_cs_subevent_result *result) { - shell_print(ctx_shell, "Received subevent results."); - shell_print(ctx_shell, "Subevent Header:\n" + bt_shell_print("Received subevent results."); + bt_shell_print("Subevent Header:\n" "- Procedure Counter: %d\n" "- Frequency Compensation: 0x%04x\n" "- Reference Power Level: %d\n" @@ -179,7 +180,7 @@ static void cs_test_subevent_data_cb(struct bt_conn_le_cs_subevent_result *resul static void cs_test_end_complete_cb(void) { - shell_print(ctx_shell, "CS Test End Complete."); + bt_shell_print("CS Test End Complete."); } static int cmd_cs_test_simple(const struct shell *sh, size_t argc, char *argv[]) diff --git a/subsys/bluetooth/host/shell/gatt.c b/subsys/bluetooth/host/shell/gatt.c index 8581a494818c4..b3ce7fcb22483 100644 --- a/subsys/bluetooth/host/shell/gatt.c +++ b/subsys/bluetooth/host/shell/gatt.c @@ -27,6 +27,7 @@ #include #include "host/shell/bt.h" +#include "host/shell/bt_shell_private.h" #if defined(CONFIG_BT_GATT_CLIENT) || defined(CONFIG_BT_GATT_DYNAMIC_DB) extern uint8_t selected_id; @@ -75,8 +76,8 @@ static void update_write_stats(uint16_t len) static void print_write_stats(void) { - shell_print(ctx_shell, "Write #%u: %u bytes (%u bps)", - write_stats.count, write_stats.total, write_stats.rate); + bt_shell_print("Write #%u: %u bytes (%u bps)", + write_stats.count, write_stats.total, write_stats.rate); } #endif /* CONFIG_BT_GATT_CLIENT || CONFIG_BT_GATT_DYNAMIC_DB */ @@ -94,8 +95,8 @@ static struct bt_gatt_exchange_params exchange_params; static void exchange_func(struct bt_conn *conn, uint8_t err, struct bt_gatt_exchange_params *params) { - shell_print(ctx_shell, "Exchange %s", err == 0U ? "successful" : - "failed"); + bt_shell_print("Exchange %s", err == 0U ? "successful" : + "failed"); /* Release global `exchange_params`. */ __ASSERT_NO_MSG(params == &exchange_params); @@ -139,43 +140,43 @@ static int cmd_exchange_mtu(const struct shell *sh, static struct bt_gatt_discover_params discover_params; static struct bt_uuid_16 uuid = BT_UUID_INIT_16(0); -static void print_chrc_props(const struct shell *sh, uint8_t properties) +static void print_chrc_props(uint8_t properties) { - shell_print(sh, "Properties: "); + bt_shell_print("Properties: "); if (properties & BT_GATT_CHRC_BROADCAST) { - shell_print(sh, "[bcast]"); + bt_shell_print("[bcast]"); } if (properties & BT_GATT_CHRC_READ) { - shell_print(sh, "[read]"); + bt_shell_print("[read]"); } if (properties & BT_GATT_CHRC_WRITE) { - shell_print(sh, "[write]"); + bt_shell_print("[write]"); } if (properties & BT_GATT_CHRC_WRITE_WITHOUT_RESP) { - shell_print(sh, "[write w/w rsp]"); + bt_shell_print("[write w/w rsp]"); } if (properties & BT_GATT_CHRC_NOTIFY) { - shell_print(sh, "[notify]"); + bt_shell_print("[notify]"); } if (properties & BT_GATT_CHRC_INDICATE) { - shell_print(sh, "[indicate]"); + bt_shell_print("[indicate]"); } if (properties & BT_GATT_CHRC_AUTH) { - shell_print(sh, "[auth]"); + bt_shell_print("[auth]"); } if (properties & BT_GATT_CHRC_EXT_PROP) { - shell_print(sh, "[ext prop]"); + bt_shell_print("[ext prop]"); } - shell_print(sh, ""); + bt_shell_print(""); } static uint8_t discover_func(struct bt_conn *conn, @@ -188,7 +189,7 @@ static uint8_t discover_func(struct bt_conn *conn, char str[BT_UUID_STR_LEN]; if (!attr) { - shell_print(ctx_shell, "Discover complete"); + bt_shell_print("Discover complete"); (void)memset(params, 0, sizeof(*params)); return BT_GATT_ITER_STOP; } @@ -198,29 +199,29 @@ static uint8_t discover_func(struct bt_conn *conn, case BT_GATT_DISCOVER_PRIMARY: gatt_service = attr->user_data; bt_uuid_to_str(gatt_service->uuid, str, sizeof(str)); - shell_print(ctx_shell, "Service %s found: start handle %x, " - "end_handle %x", str, attr->handle, - gatt_service->end_handle); + bt_shell_print("Service %s found: start handle %x, " + "end_handle %x", str, attr->handle, + gatt_service->end_handle); break; case BT_GATT_DISCOVER_CHARACTERISTIC: gatt_chrc = attr->user_data; bt_uuid_to_str(gatt_chrc->uuid, str, sizeof(str)); - shell_print(ctx_shell, "Characteristic %s found: handle %x", - str, attr->handle); - print_chrc_props(ctx_shell, gatt_chrc->properties); + bt_shell_print("Characteristic %s found: handle %x", + str, attr->handle); + print_chrc_props(gatt_chrc->properties); break; case BT_GATT_DISCOVER_INCLUDE: gatt_include = attr->user_data; bt_uuid_to_str(gatt_include->uuid, str, sizeof(str)); - shell_print(ctx_shell, "Include %s found: handle %x, start %x, " - "end %x", str, attr->handle, - gatt_include->start_handle, - gatt_include->end_handle); + bt_shell_print("Include %s found: handle %x, start %x, " + "end %x", str, attr->handle, + gatt_include->start_handle, + gatt_include->end_handle); break; default: bt_uuid_to_str(attr->uuid, str, sizeof(str)); - shell_print(ctx_shell, "Descriptor %s found: handle %x", str, - attr->handle); + bt_shell_print("Descriptor %s found: handle %x", str, + attr->handle); break; } @@ -291,13 +292,13 @@ static uint8_t read_func(struct bt_conn *conn, uint8_t err, struct bt_gatt_read_params *params, const void *data, uint16_t length) { - shell_print(ctx_shell, "Read complete: err 0x%02x length %u", err, length); + bt_shell_print("Read complete: err 0x%02x length %u", err, length); if (!data) { (void)memset(params, 0, sizeof(*params)); return BT_GATT_ITER_STOP; } else { - shell_hexdump(ctx_shell, data, length); + bt_shell_hexdump(data, length); } return BT_GATT_ITER_CONTINUE; @@ -429,7 +430,7 @@ static uint8_t gatt_write_buf[BT_ATT_MAX_ATTRIBUTE_LEN]; static void write_func(struct bt_conn *conn, uint8_t err, struct bt_gatt_write_params *params) { - shell_print(ctx_shell, "Write complete: err 0x%02x", err); + bt_shell_print("Write complete: err 0x%02x", err); (void)memset(&write_params, 0, sizeof(write_params)); } @@ -557,14 +558,14 @@ static uint8_t notify_func(struct bt_conn *conn, const void *data, uint16_t length) { if (!data) { - shell_print(ctx_shell, "Unsubscribed"); + bt_shell_print("Unsubscribed"); params->value_handle = 0U; return BT_GATT_ITER_STOP; } - shell_print(ctx_shell, "Notification: value_handle %u, length %u", - params->value_handle, length); - shell_hexdump(ctx_shell, data, length); + bt_shell_print("Notification: value_handle %u, length %u", + params->value_handle, length); + bt_shell_hexdump(data, length); return BT_GATT_ITER_CONTINUE; } @@ -793,7 +794,7 @@ static ssize_t write_vnd1(struct bt_conn *conn, const struct bt_gatt_attr *attr, uint8_t flags) { if (echo_enabled) { - shell_print(ctx_shell, "Echo attr len %u", len); + bt_shell_print("Echo attr len %u", len); bt_gatt_notify(conn, attr, buf, len); } diff --git a/subsys/bluetooth/host/shell/iso.c b/subsys/bluetooth/host/shell/iso.c index 7c30b09bce91e..77b79fbb8cc9f 100644 --- a/subsys/bluetooth/host/shell/iso.c +++ b/subsys/bluetooth/host/shell/iso.c @@ -23,6 +23,7 @@ #include #include "host/shell/bt.h" +#include "host/shell/bt_shell_private.h" #if defined(CONFIG_BT_ISO_TX) #define DEFAULT_IO_QOS \ @@ -75,8 +76,8 @@ static void iso_recv(struct bt_iso_chan *chan, const struct bt_iso_recv_info *in struct net_buf *buf) { if (info->flags & BT_ISO_FLAGS_VALID) { - shell_print(ctx_shell, "Incoming data channel %p len %u, seq: %d, ts: %d", - chan, buf->len, info->seq_num, info->ts); + bt_shell_print("Incoming data channel %p len %u, seq: %d, ts: %d", + chan, buf->len, info->seq_num, info->ts); } } #endif /* CONFIG_BT_ISO_RX */ @@ -86,7 +87,7 @@ static void iso_connected(struct bt_iso_chan *chan) struct bt_iso_info iso_info; int err; - shell_print(ctx_shell, "ISO Channel %p connected", chan); + bt_shell_print("ISO Channel %p connected", chan); err = bt_iso_chan_get_info(chan, &iso_info); @@ -108,8 +109,8 @@ static void iso_connected(struct bt_iso_chan *chan) static void iso_disconnected(struct bt_iso_chan *chan, uint8_t reason) { - shell_print(ctx_shell, "ISO Channel %p disconnected with reason 0x%02x", - chan, reason); + bt_shell_print("ISO Channel %p disconnected with reason 0x%02x", + chan, reason); } static struct bt_iso_chan_ops iso_ops = { @@ -474,11 +475,11 @@ static int cmd_connect(const struct shell *sh, size_t argc, char *argv[]) static int iso_accept(const struct bt_iso_accept_info *info, struct bt_iso_chan **chan) { - shell_print(ctx_shell, "Incoming request from %p with CIG ID 0x%02X and CIS ID 0x%02X", - info->acl, info->cig_id, info->cis_id); + bt_shell_print("Incoming request from %p with CIG ID 0x%02X and CIS ID 0x%02X", + info->acl, info->cig_id, info->cis_id); if (iso_chan.iso) { - shell_print(ctx_shell, "No channels available"); + bt_shell_print("No channels available"); return -ENOMEM; } diff --git a/subsys/bluetooth/host/shell/l2cap.c b/subsys/bluetooth/host/shell/l2cap.c index 10b8a4517ea26..05c0af9fe24c2 100644 --- a/subsys/bluetooth/host/shell/l2cap.c +++ b/subsys/bluetooth/host/shell/l2cap.c @@ -30,6 +30,7 @@ #include #include "host/shell/bt.h" +#include "host/shell/bt_shell_private.h" #define CREDITS 10 #define DATA_MTU (23 * CREDITS) @@ -89,7 +90,7 @@ static void l2cap_recv_cb(struct k_work *work) struct net_buf *buf; while ((buf = k_fifo_get(&l2cap_recv_fifo, K_NO_WAIT))) { - shell_print(ctx_shell, "Confirming reception"); + bt_shell_print("Confirming reception"); bt_l2cap_chan_recv_complete(&c->ch.chan, buf); } } @@ -102,18 +103,18 @@ static int l2cap_recv(struct bt_l2cap_chan *chan, struct net_buf *buf) return l2cap_recv_metrics(chan, buf); } - shell_print(ctx_shell, "Incoming data channel %p len %u", chan, - buf->len); + bt_shell_print("Incoming data channel %p len %u", chan, + buf->len); if (buf->len) { - shell_hexdump(ctx_shell, buf->data, buf->len); + bt_shell_hexdump(buf->data, buf->len); } if (l2cap_recv_delay_ms > 0) { /* Submit work only if queue is empty */ if (k_fifo_is_empty(&l2cap_recv_fifo)) { - shell_print(ctx_shell, "Delaying response in %u ms...", - l2cap_recv_delay_ms); + bt_shell_print("Delaying response in %u ms...", + l2cap_recv_delay_ms); } k_fifo_put(&l2cap_recv_fifo, buf); @@ -127,12 +128,12 @@ static int l2cap_recv(struct bt_l2cap_chan *chan, struct net_buf *buf) static void l2cap_sent(struct bt_l2cap_chan *chan) { - shell_print(ctx_shell, "Outgoing data channel %p transmitted", chan); + bt_shell_print("Outgoing data channel %p transmitted", chan); } static void l2cap_status(struct bt_l2cap_chan *chan, atomic_t *status) { - shell_print(ctx_shell, "Channel %p status %u", chan, (uint32_t)*status); + bt_shell_print("Channel %p status %u", chan, (uint32_t)*status); } static void l2cap_connected(struct bt_l2cap_chan *chan) @@ -141,19 +142,19 @@ static void l2cap_connected(struct bt_l2cap_chan *chan) k_work_init_delayable(&c->recv_work, l2cap_recv_cb); - shell_print(ctx_shell, "Channel %p connected", chan); + bt_shell_print("Channel %p connected", chan); } static void l2cap_disconnected(struct bt_l2cap_chan *chan) { - shell_print(ctx_shell, "Channel %p disconnected", chan); + bt_shell_print("Channel %p disconnected", chan); } static struct net_buf *l2cap_alloc_buf(struct bt_l2cap_chan *chan) { /* print if metrics is disabled */ if (!metrics) { - shell_print(ctx_shell, "Channel %p requires buffer", chan); + bt_shell_print("Channel %p requires buffer", chan); } return net_buf_alloc(&data_rx_pool, K_FOREVER); @@ -217,7 +218,7 @@ static int l2cap_accept(struct bt_conn *conn, struct bt_l2cap_server *server, { int err; - shell_print(ctx_shell, "Incoming conn %p", conn); + bt_shell_print("Incoming conn %p", conn); err = l2cap_accept_policy(conn); if (err < 0) { @@ -225,7 +226,7 @@ static int l2cap_accept(struct bt_conn *conn, struct bt_l2cap_server *server, } if (l2ch_chan.ch.chan.conn) { - shell_print(ctx_shell, "No channels available"); + bt_shell_print("No channels available"); return -ENOMEM; } From 579200d3f73e5e192d6dd90d6e83564fbd13f791 Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Tue, 26 Nov 2024 15:51:54 +0100 Subject: [PATCH 0046/4042] tests: Bluetooth: Update PTS ICS with new spec versions Added support for BAP 1.0.2, CSIS 1.01, PACS 1.0.2, PBP 1.0.1 Enabled support for extended adv in the LL (mandatory requirement) Enabled support for multiple BIGs support in the LL. Due to a bug in the BT qualification tool, the following features are values in the .bqw file are manually added BAP 4/1 BAP 26/1 BAP 49/1 BAP 62/1 BAP 77/1 BAP 83/1 CSIP 3/1 CSIP 8/1 PBP 10/1 Signed-off-by: Emil Gydesen --- .../ICS_Zephyr_Bluetooth_Host.bqw | 4964 +++++++++-------- .../ICS_Zephyr_Bluetooth_Host.pts | 72 +- 2 files changed, 2530 insertions(+), 2506 deletions(-) diff --git a/tests/bluetooth/qualification/ICS_Zephyr_Bluetooth_Host.bqw b/tests/bluetooth/qualification/ICS_Zephyr_Bluetooth_Host.bqw index 958ad9fd319b5..907363f610ff0 100644 --- a/tests/bluetooth/qualification/ICS_Zephyr_Bluetooth_Host.bqw +++ b/tests/bluetooth/qualification/ICS_Zephyr_Bluetooth_Host.bqw @@ -1,589 +1,590 @@ - + - + - GAP 10/5 - GAP 16/3 - GAP 31/8 - GAP 8a/11 - GAP 8a/15 - GAP 8a/16 - GAP 10/4 - GAP 16/4 - GAP 36/3 - GAP 8a/7 - GAP 17/3 - GAP 35/4 - GAP 8a/1 - GAP 8a/4 - GAP 21/2 - GAP 21/10 - GAP 22/1 - GAP 31/10 - GAP 32/1 - GAP 32/2 - GAP 22/3 - GAP 24/4 - GAP 10/2 + GAP 11c/1 + GAP 27b/7 + GAP 20/8 + GAP 37b/1 + GAP 27a/6 + GAP 14a/1 + GAP 14a/13 + GAP 8a/19 + GAP 27c/1 + GAP 35/11 + GAP 25/13b + GAP 30a/3 + GAP 14a/18 + GAP 25/13c + GAP 37b/6 + GAP 27b/9 + GAP 35/13c + GAP 8/5 + GAP 35/13 + GAP 30a/1 + GAP 35/12 GAP 11/2 - GAP 36/5 - GAP 8a/2 - GAP 8a/9 GAP 12/2 + GAP 14/2 + GAP 17/4 + GAP 20/1 + GAP 20A/15 + GAP 20A/3 GAP 21/9 GAP 22/2 GAP 24/2 GAP 25/4 - GAP 31/4 - GAP 35/3 - GAP 35/5 - GAP 36/2 - GAP 8a/3 - GAP 8a/8 - GAP 8a/10 - GAP 12/1 - GAP 21/7 - GAP 28/1 - GAP 31/1 - GAP 31/6 - GAP 31/9 - GAP 8a/13 - GAP 8a/17 - GAP 6/1 - GAP 9/1 - GAP 16/1 - GAP 35/6 - GAP 14a/18 - GAP 30a/1 - GAP 30a/3 - GAP 34/3 - GAP 37b/6 - GAP 8a/5 - GAP 10/1 - GAP 21/1 - GAP 21/4 - GAP 22/4 - GAP 24/1 - GAP 32/3 - GAP 34/2 - GAP 8a/19 - GAP 14a/1 - GAP 14a/13 - GAP 27b/7 - GAP 37b/1 - GAP 6/2 - GAP 15/1 - GAP 17/1 - GAP 18/1 - GAP 18/2 - GAP 21/5 - GAP 28/2 - GAP 34/1 - GAP 36/1 - GAP 8a/12 - GAP 8a/14 - GAP 11/3 - GAP 14a/2 - GAP 14a/8 - GAP 14a/12 - GAP 14a/16 - GAP 14a/19 - GAP 24/3 - GAP 30a/11 - GAP 14a/4 - GAP 14a/14 - GAP 30a/7 - GAP 30a/12 - GAP 37b/7 - GAP 10/3 - GAP 20/3 - GAP 25/14 - GAP 27c/2 - GAP 27c/3 - GAP 14a/3 - GAP 14a/5 - GAP 14a/6 - GAP 14a/7 - GAP 30a/6 - GAP 30a/8 - GAP 30a/17 - GAP 35/14 - GAP 37b/8 - GAP 14a/9 - GAP 14a/11 - GAP 30a/9 - GAP 30a/14 - GAP 30a/18 - GAP 30a/19 + GAP 25/9 + GAP 11b/3 + GAP 37c/2 + GAP 37/7 + GAP 17b/2 + GAP 30a/5 + GAP 17/5 + GAP 30a/10 + GAP 36/6 GAP 8a/18 GAP 27b/1 - GAP 30a/2 GAP 30a/4 - GAP 30a/5 - GAP 30a/10 + GAP 37a/4 GAP 30a/13 - GAP 11/1 - GAP 21/6 - GAP 25/3 - GAP 31/2 - GAP 31/5 - GAP 21/8 - GAP 5/2 - GAP 8/3 - GAP 11b/1 - GAP 14/1 - GAP 5/1 - GAP 14a/10 - GAP 14a/15 - GAP 14a/17 - GAP 27b/6 - GAP 27b/8 - GAP 30a/15 - GAP 30a/16 - GAP 8/2 - GAP 20/2 - GAP 31/11 - GAP 35/15 - GAP 37b/9 - GAP 37c/1 - GAP 37c/3 - GAP 7/1 + GAP 11/5 + GAP 26/6 + GAP 30a/2 + GAP 0/2 + GAP 11a/1 + GAP 12/1 + GAP 13/1 + GAP 17/2 + GAP 37/3a + GAP 25/12 + GAP 30a/19 + GAP 30a/18 + GAP 30a/14 + GAP 37a/6 + GAP 14a/11 + GAP 25/13a + GAP 14a/9 + GAP 30a/9 + GAP 33/8a + GAP 14a/14a + GAP 11/3 GAP 13/2 + GAP 15/1 + GAP 17/1 GAP 17a/2 - GAP 17b/1 + GAP 18/1 + GAP 18/2 + GAP 20/4 GAP 20/6 GAP 20A/5 GAP 20A/8 + GAP 21/5 GAP 23/2 - GAP 23/6 GAP 25/1 GAP 25/6 - GAP 25/12 - GAP 25/13a GAP 27/7 + GAP 28/2 GAP 33/4 - GAP 33/8a + GAP 34/1 GAP 35/10 + GAP 36/1 GAP 37/3 - GAP 37/3a - GAP 37a/6 - GAP 20/1 - GAP 27b/9 - GAP 27c/1 - GAP 5/3 - GAP 8/5 - GAP 14/2 - GAP 7/3 + GAP 6/2 + GAP 7/1 + GAP 8a/12 + GAP 8a/14 + GAP 17b/1 + GAP 23/6 + GAP 35/14 + GAP 17a/4 + GAP 14a/7 + GAP 23/7a + GAP 30a/17 + GAP 27a/5 + GAP 27b/5 + GAP 30a/8 + GAP 14a/5 + GAP 27a/4 + GAP 20A/18 + GAP 30a/6 + GAP 27c/2 + GAP 14a/6 + GAP 37b/8 + GAP 25/14 + GAP 14a/3 + GAP 27c/3 GAP 11a/2 + GAP 16/1 GAP 17a/1 - GAP 17a/4 GAP 19/1 + GAP 20/3 GAP 20/5 GAP 20A/7 - GAP 20A/18 GAP 23/3 - GAP 23/7 - GAP 23/7a GAP 25/2 GAP 25/5 GAP 26/3 GAP 27/5 GAP 27a/1 GAP 27a/3 - GAP 27a/4 - GAP 27a/5 - GAP 27b/5 GAP 31/3 + GAP 35/6 GAP 37a/2 - GAP 17/4 - GAP 20A/3 - GAP 20A/15 - GAP 25/9 - GAP 25/13b - GAP 25/13c - GAP 27/6 + GAP 6/1 + GAP 8a/11 + GAP 8a/15 + GAP 8a/16 + GAP 9/1 + GAP 10/3 + GAP 23/7 + GAP 7/3 + GAP 37c/3 + GAP 37/6 + GAP 35/15 + GAP 14a/17 + GAP 11/4 + GAP 37b/9 + GAP 37c/1 + GAP 17b/4 + GAP 11b/4 + GAP 37b/3 + GAP 30a/15 + GAP 11b/2 + GAP 14a/15 + GAP 20A/19 + GAP 30a/16 + GAP 14a/10 + GAP 27b/8 + GAP 27b/3 + GAP 27b/6 + GAP 25/11 + GAP 11/1 + GAP 20/2 + GAP 20A/4 + GAP 21/6 + GAP 21/8 + GAP 23/4 + GAP 25/3 + GAP 25/8 + GAP 31/11 + GAP 31/2 + GAP 31/5 + GAP 33/6 + GAP 35/7 + GAP 37/2 + GAP 37a/3 + GAP 7/2 + GAP 8/2 + GAP 27/6 GAP 27a/2 GAP 29/4 GAP 30/1 + GAP 31/4 GAP 33/1 GAP 33/5 - GAP 33/8 + GAP 34/3 + GAP 35/3 + GAP 35/5 GAP 35/8 - GAP 35/11 - GAP 35/12 - GAP 35/13 - GAP 35/13c - GAP 11/5 - GAP 11a/1 - GAP 13/1 - GAP 17/2 - GAP 17/5 - GAP 17b/2 - GAP 20/7 - GAP 20A/2 - GAP 20A/9 - GAP 20A/11 - GAP 20A/13 - GAP 20A/16 - GAP 23/1 - GAP 23/5 - GAP 26/6 - GAP 27/1 - GAP 27/9 - GAP 30/2 - GAP 33/7 - GAP 36/6 - GAP 37a/4 - GAP 0/2 - GAP 17b/3 - GAP 20A/6 - GAP 25/10 - GAP 25/13 - GAP 26/1 - GAP 26/2 - GAP 26/4 - GAP 27/9a - GAP 27b/2 - GAP 29/3 - GAP 33/2 - GAP 35/13a - GAP 35/13b - GAP 37b/5 - GAP 8a/14a - GAP 21/11 - GAP 30a/14a - GAP 8/4 - GAP 8a/6 - GAP 11b/3 + GAP 36/2 + GAP 36/5 + GAP 5/3 + GAP 8a/2 + GAP 8a/9 + GAP 10/2 + GAP 33/8 + GAP 37a/5 + GAP 20A/14a + GAP 37b/2 + GAP 30a/12 GAP 17a/5 + GAP 14a/4 + GAP 14a/14 + GAP 26/5 + GAP 30a/7 + GAP 37b/7 + GAP 17/3 GAP 19/2 GAP 19/3 GAP 20A/10 GAP 20A/12 - GAP 20A/14a GAP 20A/17 GAP 21/3 GAP 25/7 - GAP 26/5 GAP 29/1 GAP 29/2 GAP 35/1 + GAP 35/4 GAP 35/9 - GAP 37/7 + GAP 36/3 GAP 37a/1 - GAP 37a/5 - GAP 37b/2 + GAP 5/1 GAP 8/1 + GAP 8/4 + GAP 8a/6 + GAP 8a/7 + GAP 10/4 GAP 16/2 - GAP 37c/2 - GAP 14a/14a - GAP 20/4 - GAP 5/4 - GAP 11/4 - GAP 7/2 - GAP 11b/2 - GAP 11b/4 - GAP 17b/4 - GAP 20A/4 - GAP 20A/19 - GAP 23/4 - GAP 25/8 - GAP 25/11 - GAP 27b/3 - GAP 33/6 - GAP 35/7 - GAP 37/2 - GAP 37/6 - GAP 37a/3 - GAP 37b/3 - GAP 11c/1 + GAP 16/4 + GAP 8a/14a + GAP 14a/16 + GAP 27b/2 + GAP 14a/19 + GAP 35/13b + GAP 17b/3 + GAP 25/13 + GAP 14a/2 + GAP 27/9a + GAP 35/13a + GAP 30a/11 + GAP 30a/14a + GAP 37b/5 + GAP 14a/8 + GAP 14a/12 + GAP 10/1 + GAP 14/1 + GAP 20A/6 + GAP 21/1 + GAP 21/11 + GAP 21/4 + GAP 22/4 + GAP 24/1 + GAP 24/3 + GAP 25/10 + GAP 26/1 + GAP 26/2 + GAP 26/4 + GAP 29/3 + GAP 31/8 + GAP 32/3 + GAP 33/2 + GAP 34/2 + GAP 5/2 + GAP 8/3 + GAP 8a/5 + GAP 10/5 + GAP 11b/1 + GAP 16/3 + GAP 20/7 + GAP 20A/11 + GAP 20A/13 + GAP 20A/16 + GAP 20A/2 + GAP 20A/9 + GAP 21/7 + GAP 23/1 + GAP 23/5 + GAP 27/1 + GAP 27/9 + GAP 28/1 + GAP 30/2 + GAP 31/1 + GAP 31/6 + GAP 31/9 + GAP 8a/10 + GAP 8a/13 + GAP 8a/17 + GAP 8a/3 + GAP 8a/8 + GAP 33/7 GAP 20A/1 GAP 20A/14 + GAP 21/10 + GAP 21/2 + GAP 22/1 + GAP 22/3 + GAP 24/4 GAP 27/2 - GAP 27a/6 + GAP 31/10 + GAP 32/1 + GAP 32/2 GAP 35/2 GAP 37/1 + GAP 5/4 + GAP 8a/1 + GAP 8a/4 + L2CAP 2/49 + L2CAP 2/45a + L2CAP 1/6 + L2CAP 3/16 + L2CAP 0/2 + L2CAP 4/3 + L2CAP 1/5 + L2CAP 2/48b + L2CAP 4/2 + L2CAP 2/41 L2CAP 2/46 L2CAP 3/1 - L2CAP 1/5 - L2CAP 2/40 - L2CAP 2/42 - L2CAP 2/47 - L2CAP 3/16 + L2CAP 4/1 L2CAP 2/43 L2CAP 3/12 - L2CAP 4/3 L2CAP 1/4 - L2CAP 1/6 - L2CAP 2/45a - L2CAP 0/2 L2CAP 2/48 - L2CAP 4/1 - L2CAP 2/41 - L2CAP 2/48b - L2CAP 4/2 - L2CAP 2/49 + L2CAP 2/40 + L2CAP 2/42 + L2CAP 2/47 L2CAP 1/3 - IOP 2/2 IOP 1/1 + IOP 2/2 - GATT 3/10 - GATT 3/11 - GATT 3/16 - GATT 4/16 - GATT 3/7 - GATT 4/8 - GATT 4/17 - GATT 4/2 - GATT 4/22 - GATT 3/13 - GATT 3/21 - GATT 3/22 - GATT 3/23 - GATT 4/7 - GATT 3/18 - GATT 3/6 - GATT 4/4 - GATT 3/2 - GATT 3/3 - GATT 3/8 + GATT 9/15 + GATT 2/5 + GATT 9/11 + GATT 1/2 GATT 3/12 GATT 3/14 GATT 3/19 + GATT 3/2 GATT 3/20 + GATT 3/26 + GATT 3/3 + GATT 3/8 + GATT 4/27 + GATT 4/5 GATT 4/6 - GATT 4/9 - GATT 4/11 - GATT 4/14 - GATT 7/7 - GATT 9/5 - GATT 9/6 - GATT 10/5 - GATT 4/25 - GATT 8/8 - GATT 3a/1 - GATT 4/12 - GATT 7/2 - GATT 9/10 - GATT 4/19 - GATT 4a/2 - GATT 9/4 - GATT 10/1 - GATT 10/3 - GATT 10/4 - GATT 10/6 - GATT 3/17 - GATT 4/21 - GATT 7/4 - GATT 7/6 - GATT 9/7 - GATT 9/8 - GATT 9/14 - GATT 10/7 - GATT 10/8 - GATT 10/12 - GATT 3/1 - GATT 4/23 - GATT 4/26 - GATT 7/8 - GATT 8/2 - GATT 4/20 + GATT 7/5 GATT 9/3 - GATT 9/9 - GATT 9/13 + GATT 8/2 GATT 10/2 + GATT 9/13 + GATT 7/8 GATT 10/9 - GATT 2/5 - GATT 4/5 - GATT 7/5 - GATT 9/11 - GATT 9/15 - GATT 3/5 - GATT 4/10 - GATT 4/15 - GATT 4a/1 + GATT 9/9 + GATT 3/10 + GATT 3/11 + GATT 3/16 + GATT 3/18 + GATT 4/20 + GATT 4/23 + GATT 4/26 + GATT 10/11 + GATT 2/3a + GATT 9/2 + GATT 3a/2 + GATT 2/4 + GATT 9/1 + GATT 4/30 + GATT 4/31 + GATT 2/2 + GATT 3/15 + GATT 3/4 + GATT 3/9 GATT 4/1 GATT 4/13 GATT 4/18 - GATT 3/4 - GATT 3/9 - GATT 3/15 GATT 4/3 + GATT 7/3 + GATT 10/6 + GATT 10/1 + GATT 9/4 + GATT 10/3 + GATT 4a/2 + GATT 10/4 + GATT 3/25 + GATT 3/6 + GATT 4/17 + GATT 4/19 + GATT 4/4 + GATT 10/7 + GATT 10/12 + GATT 9/8 + GATT 9/14 + GATT 9/7 + GATT 10/8 + GATT 3/30 + GATT 3/13 + GATT 3/17 + GATT 4/16 + GATT 4/2 + GATT 4/21 + GATT 4/22 + GATT 7/4 + GATT 7/6 + GATT 9/10 + GATT 3a/1 GATT 9/12 GATT 1a/1 GATT 1a/3 - GATT 2/2 - GATT 2/4 - GATT 3a/2 - GATT 7/3 - GATT 9/1 - GATT 9/2 - GATT 10/11 - GATT 2/3a - GATT 4/30 - GATT 4/31 - GATT 1/2 - GATT 3/25 + GATT 4/11 + GATT 4/12 + GATT 4/9 + GATT 7/2 + GATT 4a/1 GATT 1/1 GATT 3/29 - GATT 3/30 - GATT 3/26 - GATT 4/27 + GATT 3/21 + GATT 3/22 + GATT 3/23 + GATT 3/5 + GATT 4/10 + GATT 4/15 + GATT 4/7 + GATT 8/8 + GATT 10/5 + GATT 9/6 + GATT 9/5 + GATT 3/1 + GATT 3/7 + GATT 4/14 + GATT 4/25 + GATT 4/8 + GATT 7/7 - SM 4/1 - SM 6/1 - SM 6/2 - SM 2/2 - SM 5/3 - SM 7a/3 - SM 7b/3 + SM 7b/2 SM 3/1 - SM 2/3 - SM 7a/2 - SM 5/1 - SM 5/4 SM 5/2 - SM 7a/1 - SM 1/2 - SM 7b/2 + SM 7b/3 + SM 7a/3 SM 7b/1 - SM 2/1 - SM 1/1 SM 4/3 + SM 1/2 + SM 4/1 + SM 5/3 + SM 6/1 + SM 7a/1 + SM 2/3 SM 2/5 SM 4/2 + SM 1/1 + SM 2/1 + SM 7a/2 + SM 2/2 + SM 5/1 + SM 5/4 + SM 6/2 - ATT 3/12 - ATT 3/15 - ATT 3/18 - ATT 4/10 - ATT 4/7 - ATT 4/8 - ATT 4/12 - ATT 4/22 - ATT 4/24 - ATT 4/27 - ATT 3/3 - ATT 3/4 - ATT 3/6 - ATT 3/9 - ATT 3/19 - ATT 3/21 - ATT 3/22 - ATT 3/25 - ATT 3/28 - ATT 4/2 - ATT 4/16 - ATT 4/26 - ATT 4/20 - ATT 3/10 - ATT 3/16 - ATT 1/1 - ATT 3/26 - ATT 4/1 - ATT 4/13 - ATT 3/7 + ATT 7/3 + ATT 4/32 + ATT 2/2 ATT 3/11 ATT 3/14 ATT 3/17 + ATT 3/7 + ATT 4/19 ATT 4/3 ATT 4/6 ATT 4/9 - ATT 4/19 - ATT 3/8 - ATT 3/23 - ATT 4/4 - ATT 4/5 - ATT 4/14 - ATT 4/17 - ATT 4/23 - ATT 7/2 - ATT 2/3a - ATT 3/31 - ATT 4/33 + ATT 6/1 + ATT 3/12 + ATT 3/15 + ATT 3/18 + ATT 4/10 + ATT 4/20 ATT 1/2 ATT 3/1 - ATT 3/2 - ATT 3/5 ATT 3/13 + ATT 3/2 ATT 3/20 ATT 3/24 ATT 3/27 + ATT 3/5 ATT 4/11 ATT 4/15 ATT 4/18 ATT 4/21 ATT 4/25 ATT 4/28 - ATT 4/32 - ATT 7/3 - ATT 6/1 + ATT 1/1 ATT 4/31 - ATT 2/2 + ATT 3/26 + ATT 4/1 + ATT 4/13 + ATT 7/1 ATT 3/30 ATT 3/32 - ATT 7/1 + ATT 4/12 + ATT 4/22 + ATT 4/24 + ATT 4/27 + ATT 4/7 + ATT 4/8 + ATT 7/2 + ATT 3/23 + ATT 3/8 + ATT 4/14 + ATT 4/17 + ATT 4/23 + ATT 4/4 + ATT 4/5 + ATT 3/10 + ATT 3/16 + ATT 2/3a + ATT 3/31 + ATT 4/33 + ATT 3/19 + ATT 3/21 + ATT 3/22 + ATT 3/25 + ATT 3/28 + ATT 3/3 + ATT 3/4 + ATT 3/6 + ATT 3/9 + ATT 4/16 + ATT 4/2 + ATT 4/26 - DIS 1/2 - DIS 2/5 - DIS 2/3 - DIS 2/11 - DIS 2/2 + DIS 3/3 + DIS 2/7 DIS 2/4 DIS 2/6 - DIS 2/7 - DIS 3/3 - DIS 2/1 - DIS 0/2 + DIS 2/11 + DIS 2/3 + DIS 2/5 DIS 5/1 + DIS 0/2 + DIS 2/1 + DIS 1/2 + DIS 2/2 - IAS 2/2 - IAS 2/3 - IAS 1/2 - IAS 3/2 IAS 0/1 IAS 2/1 IAS 2/4 IAS 3/1 + IAS 3/2 + IAS 1/2 + IAS 2/2 + IAS 2/3 - HRS 1/2 - HRS 2/1 - HRS 3/6 + HRS 2/2 HRS 0/1 HRS 3/2 HRS 3/5 - HRS 2/2 + HRS 3/6 + HRS 2/1 + HRS 1/2 HRS 3/4 @@ -591,175 +592,142 @@ BAS 0/2 BAS 2/3 - BAS 2/1 - BAS 3/5 - BAS 3/3 BAS 4/1 - BAS 1/2 BAS 4/2 + BAS 1/2 + BAS 3/5 + BAS 3/3 + BAS 2/1 - OTS 4/13 - OTS 4/15 - OTS 6/1 + OTS 8/8 + OTS 5/9 + OTS 6/3 + OTS 7/1 + OTS 4/16 + OTS 4/2 + OTS 4/20 + OTS 4/3 + OTS 5/1 + OTS 0/1 + OTS 8/7 + OTS 8/4 OTS 3/3 OTS 4/7 OTS 5/3 OTS 5/6 - OTS 8/4 - OTS 8/7 + OTS 8/2 OTS 2/1 OTS 4/6 OTS 6/2 OTS 6/4 OTS 6/5 - OTS 3/2 - OTS 4/12 - OTS 5/2 - OTS 8/3 - OTS 4/2 - OTS 4/3 - OTS 4/16 - OTS 4/20 - OTS 5/1 - OTS 0/1 - OTS 5/9 - OTS 6/3 - OTS 7/1 - OTS 8/8 + OTS 8/6 + OTS 4/13 + OTS 4/15 + OTS 6/1 + OTS 8/1 OTS 4/1 OTS 5/5 - OTS 8/1 - OTS 8/6 - OTS 8/2 + OTS 8/3 + OTS 3/2 + OTS 4/12 OTS 4/4 OTS 4/5 + OTS 5/2 - OTP 6/10 - OTP 6/12 - OTP 7/1 - OTP 7/20 + OTP 9/13 + OTP 9/6 + OTP 6/7 + OTP 6/9 + OTP 8/19 + OTP 9/18 + OTP 3/2 + OTP 6/1 + OTP 6/13 + OTP 7/16 + OTP 8/18 OTP 9/12 - OTP 2/2 - OTP 5/1 - OTP 7/6 - OTP 9/4 - OTP 9/9 + OTP 9/10 OTP 2/1 OTP 6/11 OTP 7/15 OTP 7/17 - OTP 9/10 - OTP 0/1 - OTP 6/3 - OTP 7/3 - OTP 7/19 - OTP 8/30 - OTP 9/3 - OTP 9/11 - OTP 9/15 - OTP 3/2 - OTP 6/1 - OTP 6/13 - OTP 7/16 - OTP 9/18 - OTP 7/18 - OTP 8/1 OTP 9/5 OTP 9/8 - OTP 6/9 - OTP 9/6 - OTP 9/13 + OTP 7/18 + OTP 8/1 + OTP 9/4 + OTP 9/9 + OTP 2/2 + OTP 5/1 + OTP 7/12 + OTP 7/6 + OTP 6/10 + OTP 6/12 + OTP 7/1 + OTP 7/20 + OTP 7/7 + OTP 10/1 + OTP 9/14 + OTP 9/16 + OTP 9/1 OTP 4/1 - OTP 6/2 OTP 6/14 + OTP 6/2 OTP 7/2 - OTP 9/1 - OTP 9/14 - OTP 9/16 - OTP 10/1 - OTP 7/7 - OTP 6/7 - OTP 8/19 - OTP 8/18 - OTP 7/12 + OTP 8/17 + OTP 9/11 + OTP 9/15 + OTP 9/3 + OTP 0/1 + OTP 6/3 OTP 6/4 + OTP 7/19 + OTP 7/3 OTP 8/2 - OTP 8/17 + OTP 8/30 - MESH 0/2 - MESH 4/2 - MESH 4/6 - MESH 4/15 - MESH 6/1 - MESH 7/5 - MESH 10/3 - MESH 11/2 - MESH 11/12 - MESH 11/17 - MESH 11/18 - MESH 11/21 + MESH 11/15 MESH 2/2 + MESH 12/3 + MESH 12/6 MESH 4/3 MESH 4/8 MESH 5/4 - MESH 11/15 - MESH 12/3 - MESH 12/6 MESH 18/11 MESH 21/2 - MESH 3/1 - MESH 4/17 - MESH 7/1 - MESH 10/1 - MESH 13/1 - MESH 14/4 - MESH 16/4 - MESH 18/1 - MESH 18/9 - MESH 20/2 - MESH 21/1 - MESH 21/4 - MESH 1a/2 - MESH 4/11 - MESH 4/13 - MESH 7/4 - MESH 11/6 - MESH 11/14 - MESH 11/23 - MESH 12/12 - MESH 14/1 - MESH 18/2 - MESH 18/6 - MESH 18/12 - MESH 11/1 - MESH 11/4 - MESH 11/22 - MESH 12/1 - MESH 15/1 - MESH 20/3 - MESH 2/3 - MESH 3/2 - MESH 4/1 - MESH 4/4 - MESH 4/9 - MESH 4/12 - MESH 4/16 - MESH 5/3 - MESH 6/3 - MESH 7/2 - MESH 8/1 - MESH 9/1 - MESH 11/8 + MESH 11/24 + MESH 11/16 + MESH 11/7 + MESH 11/19 + MESH 11/5 + MESH 10/2 + MESH 11/3 + MESH 13/2 + MESH 14/5 + MESH 4/10 + MESH 4/5 + MESH 5/1 + MESH 5/2 + MESH 6/2 + MESH 18/5 + MESH 18/8 + MESH 20/1 MESH 11/20 + MESH 10/5 + MESH 2/3 + MESH 11/13 + MESH 11/8 + MESH 4/16 MESH 12/2 MESH 12/4 MESH 14/2 @@ -770,1464 +738,1506 @@ MESH 16/2 MESH 16/3 MESH 16/6 + MESH 3/2 + MESH 4/1 + MESH 4/12 + MESH 4/4 + MESH 4/9 + MESH 5/3 + MESH 6/3 + MESH 7/2 + MESH 8/1 + MESH 9/1 MESH 18/4 MESH 18/7 MESH 20/4 MESH 21/3 - MESH 12/5 + MESH 11/23 + MESH 12/12 + MESH 18/12 + MESH 1a/2 + MESH 11/14 + MESH 4/13 + MESH 11/6 + MESH 14/1 + MESH 4/11 + MESH 7/4 + MESH 18/2 + MESH 18/6 + MESH 4/17 + MESH 10/1 + MESH 13/1 + MESH 14/4 + MESH 16/4 + MESH 3/1 + MESH 7/1 + MESH 18/1 + MESH 18/9 + MESH 20/2 + MESH 21/1 + MESH 21/4 + MESH 11/22 + MESH 11/1 + MESH 11/4 + MESH 12/1 + MESH 15/1 + MESH 20/3 + MESH 11/12 + MESH 4/15 + MESH 11/18 + MESH 0/2 + MESH 12/7 + MESH 11/17 + MESH 11/21 MESH 12/11 - MESH 18/3 + MESH 10/3 + MESH 11/2 + MESH 12/5 + MESH 4/2 + MESH 4/6 + MESH 6/1 + MESH 7/5 MESH 18/10 + MESH 18/3 MESH 20/5 - MESH 10/5 - MESH 11/13 - MESH 12/7 - MESH 2/1 - MESH 4/7 - MESH 4/14 - MESH 7/3 - MESH 10/4 MESH 11/11 + MESH 4/14 MESH 12/8 + MESH 18/13 + MESH 2/1 + MESH 10/4 MESH 15/4 MESH 15/5 MESH 16/5 - MESH 18/13 + MESH 4/7 + MESH 7/3 MESH 19/1 - MESH 4/5 - MESH 4/10 - MESH 5/1 - MESH 5/2 - MESH 6/2 - MESH 10/2 - MESH 11/3 - MESH 11/5 - MESH 11/7 - MESH 11/19 - MESH 11/24 - MESH 13/2 - MESH 14/5 - MESH 18/5 - MESH 18/8 - MESH 20/1 - MESH 11/16 - LC3 1/1 - LC3 5/2 - LC3 5/4 - LC3 5/6 + LC3 4/2 + LC3 2/2 LC3 3/6 LC3 5/5 LC3 2/3 LC3 4/1 - LC3 5/1 - LC3 6/1 + LC3 5/4 + LC3 1/1 LC3 2/1 LC3 3/3 - LC3 3/5 LC3 5/3 - LC3 0/1 + LC3 3/5 + LC3 6/1 + LC3 5/1 + LC3 6/2 LC3 3/1 - LC3 3/2 LC3 3/4 - LC3 6/2 - LC3 2/2 - LC3 4/2 + LC3 0/1 + LC3 3/2 + LC3 5/6 + LC3 5/2 - AICS 2/1 + AICS 4/1 + AICS 4/2 + AICS 4/3 + AICS 2/4 + AICS 3/3 + AICS 3/1 + AICS 0/1 + AICS 3/4 AICS 2/3 AICS 2/5 - AICS 3/4 - AICS 3/2 - AICS 3/5 - AICS 2/4 AICS 2/2 AICS 2/6 AICS 2/7 - AICS 4/1 - AICS 4/2 - AICS 3/1 - AICS 3/3 - AICS 1/2 + AICS 3/5 + AICS 3/2 + AICS 2/8 AICS 4/4 + AICS 2/1 AICS 4/6 - AICS 2/8 - AICS 4/3 - AICS 0/1 + AICS 1/2 - VOCS 2/2 - VOCS 2/5 + VOCS 3/2 + VOCS 3/6 VOCS 2/4 VOCS 2/7 VOCS 3/1 - VOCS 3/6 - VOCS 2/1 - VOCS 2/3 + VOCS 2/2 + VOCS 3/4 + VOCS 2/5 VOCS 3/3 VOCS 1/2 + VOCS 2/3 + VOCS 2/1 VOCS 2/6 VOCS 2/8 - VOCS 3/4 - VOCS 3/2 VOCS 0/1 - VCS 3/1 - VCS 3/2 - VCS 3/4 - VCS 3/7 - VCS 2/2 + VCS 4/4 + VCS 3/6 VCS 2/1 VCS 2/4 - VCS 3/6 - VCS 3/5 + VCS 2/2 VCS 4/3 - VCS 2/3 - VCS 3/3 - VCS 1/2 - VCS 4/4 - VCS 4/6 + VCS 3/2 + VCS 3/1 VCS 0/1 + VCS 3/5 + VCS 4/6 + VCS 3/7 + VCS 3/4 VCS 4/1 + VCS 3/3 + VCS 1/2 + VCS 2/3 VCS 4/2 - VCP 14/8 - VCP 16/5 - VCP 16/11 - VCP 13/4 - VCP 15/6 - VCP 14/6 - VCP 15/3 - VCP 17/7 - VCP 17/10 - VCP 17/11 - VCP 16/9 - VCP 14/4 - VCP 14/5 - VCP 16/7 - VCP 15/2 - VCP 16/8 - VCP 16/13 + VCP 14/2 VCP 8/1 + VCP 10/3 + VCP 12/9 + VCP 16/13 + VCP 5/4 + VCP 12/10 + VCP 17/4 + VCP 6/11 + VCP 2/2 + VCP 16/8 + VCP 10/2 + VCP 13/2 + VCP 16/3 + VCP 10/1 + VCP 6/3 + VCP 17/9 + VCP 12/12 + VCP 12/1 + VCP 12/6 + VCP 13/3 + VCP 16/6 + VCP 15/1 + VCP 18/14 + VCP 5/1 + VCP 16/12 VCP 11/1 VCP 11/3 - VCP 5/1 VCP 5/2 VCP 5/3 - VCP 17/6 - VCP 14/7 - VCP 16/12 VCP 16/14 - VCP 12/11 - VCP 13/1 - VCP 15/1 + VCP 16/1 + VCP 18/4 + VCP 14/7 + VCP 6/8 + VCP 17/6 + VCP 18/15 + VCP 15/3 VCP 12/3 - VCP 12/4 - VCP 17/9 - VCP 13/2 - VCP 13/3 - VCP 16/3 - VCP 16/6 - VCP 3/1 - VCP 17/3 - VCP 17/8 - VCP 16/2 - VCP 17/1 - VCP 17/5 - VCP 18/7 - VCP 1/1 + VCP 6/10 VCP 1/2 VCP 14/1 VCP 18/2 + VCP 13/4 + VCP 15/6 + VCP 12/4 + VCP 14/6 VCP 18/6 - VCP 12/1 - VCP 12/6 - VCP 12/12 - VCP 6/3 - VCP 2/2 - VCP 12/9 - VCP 12/10 - VCP 14/2 - VCP 17/4 + VCP 1/1 + VCP 17/11 + VCP 16/9 + VCP 13/1 VCP 6/1 - VCP 17/2 VCP 18/1 + VCP 17/7 + VCP 17/10 + VCP 12/11 + VCP 14/4 VCP 18/12 - VCP 6/10 - VCP 18/15 - VCP 6/8 - VCP 16/1 - VCP 18/4 + VCP 17/2 + VCP 6/13 + VCP 17/5 + VCP 16/11 + VCP 18/7 + VCP 16/2 + VCP 14/8 + VCP 16/5 + VCP 17/3 + VCP 17/8 + VCP 17/1 + VCP 3/1 + VCP 12/8 + VCP 16/10 VCP 11/2 + VCP 18/3 VCP 14/3 - VCP 14/9 - VCP 16/4 - VCP 16/10 VCP 15/4 + VCP 12/7 + VCP 6/2 + VCP 12/5 VCP 15/5 + VCP 16/4 VCP 12/2 - VCP 12/5 - VCP 5/4 - VCP 6/11 - VCP 10/2 - VCP 10/3 - VCP 6/2 - VCP 12/7 - VCP 12/8 - VCP 18/3 - VCP 18/14 - VCP 6/13 - VCP 10/1 + VCP 14/9 + VCP 15/2 + VCP 16/7 + VCP 14/5 - MICS 2/1 - MICS 3/3 - MICS 1/2 - MICS 3/6 MICS 3/2 - MICS 3/1 MICS 0/1 MICS 3/4 + MICS 3/6 + MICS 1/2 + MICS 3/1 + MICS 2/1 + MICS 3/3 - MICP 13/3 - MICP 12/2 - MICP 12/3 - MICP 14/4 - MICP 15/6 - MICP 15/11 - MICP 14/5 - MICP 14/9 - MICP 15/10 - MICP 13/5 - MICP 14/3 - MICP 14/13 - MICP 5/2 - MICP 15/7 - MICP 16/4 - MICP 14/7 - MICP 14/11 - MICP 14/12 - MICP 15/8 - MICP 16/5 - MICP 13/4 - MICP 13/6 - MICP 14/6 - MICP 6/1 - MICP 11/1 - MICP 14/8 + MICP 6/14 + MICP 1/1 MICP 14/10 + MICP 14/8 + MICP 11/1 MICP 5/1 MICP 15/9 - MICP 6/4 - MICP 6/6 - MICP 15/5 - MICP 14/1 - MICP 15/4 - MICP 1/1 MICP 1/2 - MICP 13/1 MICP 16/1 - MICP 15/1 - MICP 16/3 - MICP 6/2 - MICP 6/8 - MICP 14/2 - MICP 15/2 - MICP 2/2 - MICP 8/1 - MICP 16/13 - MICP 12/1 - MICP 14/14 - MICP 16/6 - MICP 16/7 - MICP 6/14 + MICP 13/1 MICP 10/2 MICP 6/5 + MICP 12/1 MICP 13/2 - MICP 15/3 - MICP 10/1 + MICP 16/3 + MICP 15/8 + MICP 16/5 + MICP 14/11 + MICP 15/1 + MICP 14/7 MICP 3/1 MICP 16/14 + MICP 14/12 + MICP 15/5 + MICP 6/6 MICP 6/13 + MICP 13/3 + MICP 6/4 + MICP 8/1 + MICP 16/13 + MICP 14/9 + MICP 14/5 + MICP 16/7 + MICP 6/1 + MICP 15/10 + MICP 13/6 + MICP 14/6 + MICP 13/4 + MICP 2/2 + MICP 15/6 + MICP 15/11 + MICP 10/1 + MICP 12/3 + MICP 15/4 + MICP 12/2 + MICP 14/1 + MICP 14/4 + MICP 16/6 + MICP 15/3 + MICP 14/14 + MICP 14/2 + MICP 14/13 + MICP 15/2 + MICP 15/7 + MICP 6/8 + MICP 6/2 + MICP 14/3 + MICP 16/4 + MICP 13/5 + MICP 5/2 - MCS 22/12 - MCS 22/21 - MCS 23/9 - MCS 24/3 - MCS 22/5 - MCS 22/13 - MCS 22/19 - MCS 22/20 - MCS 22/25 - MCS 23/7 - MCS 23/10 - MCS 24/1 - MCS 24/2 - MCS 25/2 - MCS 25/4 MCS 22/7 MCS 22/24 - MCS 23/14 MCS 23/20 MCS 25/3 - MCS 20/1 - MCS 21/2 + MCS 23/14 + MCS 23/19 + MCS 23/4 + MCS 23/3 MCS 22/3 - MCS 22/17 + MCS 20/1 MCS 22/23 + MCS 22/17 MCS 23/13 - MCS 22/8 - MCS 22/9 - MCS 22/11 - MCS 22/14 - MCS 22/26 - MCS 23/6 - MCS 23/8 - MCS 23/12 - MCS 23/21 - MCS 24/4 - MCS 22/4 + MCS 21/2 + MCS 22/12 + MCS 23/9 + MCS 22/21 + MCS 24/3 + MCS 23/11 + MCS 23/17 MCS 22/6 MCS 22/10 - MCS 22/18 MCS 23/1 + MCS 22/18 MCS 23/2 - MCS 23/11 - MCS 23/17 - MCS 0b/2 - MCS 22/1 - MCS 22/2 - MCS 22/15 - MCS 22/16 - MCS 22/22 - MCS 23/5 - MCS 23/15 - MCS 23/16 - MCS 23/18 - MCS 25/1 - MCS 25/6 - MCS 23/3 - MCS 23/4 - MCS 23/19 + MCS 22/4 + MCS 23/7 + MCS 24/1 + MCS 22/19 + MCS 22/5 + MCS 24/2 + MCS 23/10 + MCS 25/4 + MCS 22/20 + MCS 22/13 + MCS 25/2 + MCS 22/25 + MCS 23/21 + MCS 22/26 + MCS 22/11 + MCS 23/8 + MCS 23/12 + MCS 23/6 + MCS 24/4 + MCS 22/9 + MCS 22/8 + MCS 22/14 + MCS 25/6 + MCS 22/15 + MCS 23/15 + MCS 22/22 + MCS 22/1 + MCS 23/5 + MCS 23/16 + MCS 22/16 + MCS 22/2 + MCS 25/1 + MCS 0b/2 + MCS 23/18 - MCP 16/9 - MCP 17/3 - MCP 17/4 - MCP 17/7 - MCP 16/13 - MCP 16/14 - MCP 16/22 - MCP 17/8 - MCP 16/6 - MCP 16/19 - MCP 17/17 - MCP 17/18 - MCP 16/5 - MCP 16/11 - MCP 16/17 - MCP 17/5 - MCP 17/6 - MCP 17/12 - MCP 18/7 - MCP 6/2 - MCP 18/2 - MCP 16/7 - MCP 16/8 - MCP 16/16 - MCP 2/2 - MCP 16/20 - MCP 17/1 - MCP 17/9 - MCP 17/11 - MCP 17/13 - MCP 17/14 - MCP 17/19 - MCP 6/3 - MCP 16/21 - MCP 16/2 MCP 16/4 + MCP 6/5 + MCP 18/4 + MCP 18/3 + MCP 6/13 MCP 16/10 - MCP 16/15 - MCP 17/15 MCP 17/20 - MCP 6/5 + MCP 17/15 + MCP 16/2 MCP 10/1 - MCP 18/3 - MCP 18/4 - MCP 1/2 - MCP 6/4 - MCP 10/2 - MCP 1/1 - MCP 6/6 - MCP 6/1 - MCP 9/2 - MCP 9/3 - MCP 18/8 - MCP 16/1 - MCP 16/3 + MCP 16/15 + MCP 18/5 + MCP 5/4 MCP 16/12 - MCP 16/18 MCP 17/2 - MCP 17/10 - MCP 17/16 - MCP 18/5 + MCP 9/1 + MCP 6/7 MCP 18/6 - MCP 6/13 + MCP 16/3 + MCP 16/1 + MCP 17/10 MCP 5/3 - MCP 6/7 - MCP 9/1 - MCP 8/1 + MCP 17/16 + MCP 16/18 + MCP 16/19 MCP 21/3 - MCP 13/3 - MCP 20/1 - MCP 21/2 + MCP 8/1 + MCP 17/17 + MCP 17/18 + MCP 16/6 + MCP 10/2 + MCP 6/4 + MCP 1/2 + MCP 21/1 + MCP 2/2 + MCP 17/7 MCP 3/1 + MCP 17/4 + MCP 17/3 + MCP 16/9 MCP 6/14 MCP 13/2 - MCP 21/1 - MCP 5/2 + MCP 9/2 + MCP 21/2 + MCP 20/1 + MCP 6/1 + MCP 17/6 + MCP 16/17 + MCP 16/11 + MCP 17/5 + MCP 9/3 + MCP 16/5 + MCP 13/3 + MCP 18/8 + MCP 18/2 + MCP 16/22 + MCP 6/2 + MCP 18/7 + MCP 17/12 + MCP 16/14 + MCP 16/13 + MCP 17/8 + MCP 6/3 + MCP 16/8 MCP 11/1 - MCP 18/14 MCP 18/15 - MCP 5/4 + MCP 16/21 + MCP 16/7 + MCP 18/14 + MCP 16/16 + MCP 5/2 + MCP 17/13 + MCP 17/19 + MCP 17/1 + MCP 6/6 + MCP 17/11 + MCP 17/9 + MCP 17/14 + MCP 16/20 + MCP 1/1 - TBS 2/3 - TBS 3/1 - TBS 3/2 - TBS 3/6 - TBS 2/15 - TBS 3/5 - TBS 2/18 - TBS 3/4 - TBS 2/9 - TBS 2/12 - TBS 2/23 - TBS 3/3 - TBS 2/24 - TBS 2/16 - TBS 2/17 - TBS 2/20 - TBS 4/4 - TBS 22/13 - TBS 22/15 - TBS 22/16 - TBS 22/17 - TBS 1/2 - TBS 2/4 - TBS 2/5 - TBS 2/21 - TBS 2/22 - TBS 22/4 - TBS 22/10 - TBS 22/11 - TBS 23/5 - TBS 24/2 - TBS 24/7 - TBS 2/8 - TBS 2/10 + TBS 22/3 TBS 2/13 - TBS 2/25 TBS 4/5 - TBS 22/3 + TBS 24/3 TBS 22/12 TBS 22/14 + TBS 2/25 + TBS 2/10 TBS 22/22 - TBS 24/3 - TBS 2/11 - TBS 4/1 + TBS 2/8 + TBS 2/15 + TBS 23/1 TBS 20/1 - TBS 22/8 TBS 22/19 - TBS 22/20 - TBS 23/1 - TBS 23/4 + TBS 22/8 + TBS 4/1 TBS 24/1 + TBS 2/11 + TBS 23/4 + TBS 3/5 + TBS 22/20 TBS 24/5 - TBS 0/1 - TBS 2/14 - TBS 4/2 - TBS 22/2 - TBS 22/5 - TBS 0b/2 - TBS 2/1 + TBS 22/7 + TBS 22/24 TBS 2/2 - TBS 2/6 + TBS 23/3 + TBS 3/4 + TBS 2/18 + TBS 0b/2 + TBS 22/1 TBS 4/7 + TBS 2/6 TBS 21/2 - TBS 22/1 TBS 22/6 - TBS 22/7 - TBS 22/24 - TBS 23/3 - TBS 2/7 - TBS 2/19 - TBS 22/9 - TBS 22/18 - TBS 22/21 - TBS 22/23 - TBS 22/25 - TBS 23/6 - TBS 24/4 - TBS 0b/1 - TBS 4/3 - TBS 23/2 + TBS 2/1 + TBS 22/2 + TBS 4/2 + TBS 2/14 + TBS 0/1 + TBS 22/5 + TBS 3/3 + TBS 23/5 + TBS 2/12 + TBS 24/2 + TBS 2/22 + TBS 2/23 + TBS 2/21 + TBS 22/4 + TBS 2/5 + TBS 22/10 + TBS 2/4 + TBS 2/9 + TBS 1/2 + TBS 24/7 + TBS 22/11 + TBS 3/1 + TBS 22/17 + TBS 22/15 + TBS 2/16 + TBS 3/2 + TBS 3/6 + TBS 22/13 + TBS 2/3 + TBS 22/16 + TBS 2/17 + TBS 4/4 + TBS 2/20 + TBS 4/3 + TBS 23/2 + TBS 0b/1 + TBS 2/7 + TBS 23/6 + TBS 2/19 + TBS 22/18 + TBS 22/25 + TBS 22/21 + TBS 2/24 + TBS 22/23 + TBS 24/4 + TBS 22/9 - CCP 11/5 - CCP 11/10 - CCP 12/2 - CCP 12/6 - CCP 12/16 - CCP 13/5 - CCP 13/9 - CCP 13/10 - CCP 14/4 - CCP 14/5 - CCP 12/3 - CCP 12/19 - CCP 12/20 - CCP 13/11 - CCP 14/3 - CCP 14/8 - CCP 11/3 - CCP 11/9 - CCP 11/12 - CCP 12/14 - CCP 12/21 - CCP 13/1 - CCP 13/3 - CCP 13/13 - CCP 13/14 - CCP 11/7 - CCP 12/4 - CCP 12/7 - CCP 12/8 - CCP 12/11 - CCP 12/15 - CCP 12/22 - CCP 13/4 - CCP 14/16 - CCP 14/17 - CCP 11/2 + CCP 14/10 + CCP 13/15 + CCP 14/2 + CCP 5/2 + CCP 15/6 + CCP 11/8 + CCP 14/9 + CCP 11/15 + CCP 13/12 + CCP 11/1 + CCP 1/1 + CCP 6/1 + CCP 13/7 + CCP 6/5 + CCP 12/1 CCP 12/13 CCP 12/17 - CCP 13/2 - CCP 14/12 + CCP 11/2 + CCP 6/6 CCP 14/13 + CCP 5/3 + CCP 13/6 + CCP 13/2 CCP 14/15 - CCP 14/14 - CCP 11/4 - CCP 11/14 - CCP 11/16 + CCP 14/12 + CCP 14/7 + CCP 14/20 CCP 12/5 CCP 12/9 - CCP 12/12 - CCP 12/18 + CCP 11/4 CCP 13/16 - CCP 14/7 + CCP 12/18 + CCP 6/7 + CCP 11/14 CCP 14/11 + CCP 12/12 + CCP 10/1 CCP 14/19 - CCP 14/20 - CCP 6/6 - CCP 13/6 - CCP 11/1 - CCP 11/8 - CCP 11/15 - CCP 12/1 - CCP 13/7 - CCP 13/12 - CCP 13/15 - CCP 14/2 - CCP 14/9 - CCP 14/10 - CCP 1/1 - CCP 6/1 - CCP 6/5 - CCP 6/2 + CCP 15/4 CCP 2/2 - CCP 6/7 - CCP 15/6 - CCP 1/2 - CCP 15/2 - CCP 11/11 - CCP 11/13 + CCP 11/16 + CCP 6/4 + CCP 14/18 + CCP 15/5 + CCP 14/22 + CCP 14/6 CCP 12/10 + CCP 11/11 + CCP 6/13 + CCP 5/1 + CCP 14/21 CCP 13/8 + CCP 15/8 CCP 14/1 - CCP 14/6 - CCP 14/18 - CCP 14/21 - CCP 14/22 - CCP 15/7 - CCP 15/3 - CCP 5/2 + CCP 11/13 + CCP 14/8 + CCP 6/2 + CCP 14/3 + CCP 12/3 + CCP 12/19 + CCP 14/14 + CCP 13/11 + CCP 12/20 CCP 11/6 - CCP 6/4 + CCP 12/7 + CCP 12/11 + CCP 15/3 + CCP 10/2 + CCP 12/8 + CCP 12/22 + CCP 14/16 + CCP 12/4 + CCP 12/15 + CCP 14/17 + CCP 11/7 + CCP 13/4 + CCP 8/1 + CCP 13/14 + CCP 11/9 + CCP 12/21 + CCP 12/14 + CCP 15/2 + CCP 1/2 + CCP 13/13 CCP 15/14 + CCP 13/3 + CCP 11/12 + CCP 11/3 + CCP 13/1 + CCP 12/6 + CCP 13/5 + CCP 13/10 + CCP 15/15 + CCP 12/2 + CCP 14/4 + CCP 11/5 CCP 3/1 + CCP 12/16 CCP 6/14 - CCP 15/15 - CCP 8/1 - CCP 10/2 - CCP 5/3 - CCP 15/4 - CCP 15/5 - CCP 15/8 - CCP 5/1 - CCP 6/13 - CCP 10/1 + CCP 15/7 + CCP 11/10 + CCP 13/9 + CCP 14/5 - CSIS 2/3 - CSIS 2/4 - CSIS 3/2 + CSIS 2/1 + CSIS 3/6 CSIS 2/2 + CSIS 2/6 + CSIS 0a/2 CSIS 3/1 - CSIS 2/1 - CSIS 3/4 - CSIS 3/3 + CSIS 2/4 CSIS 1/2 + CSIS 3/3 + CSIS 3/4 + CSIS 3/2 CSIS 2/5 - CSIS 0a/2 - CSIS 2/6 - CSIS 3/6 + CSIS 2/3 - CSIP 11/2 - CSIP 12/4 - CSIP 6/2 - CSIP 13/3 - CSIP 13/8 - CSIP 5/2 - CSIP 13/6 - CSIP 13/9 - CSIP 14/2 - CSIP 14/5 - CSIP 14/7 - CSIP 12/2 - CSIP 6/1 - CSIP 6/9 - CSIP 5/5 - CSIP 6/8 - CSIP 12/3 - CSIP 14/3 - CSIP 14/6 - CSIP 1/1 - CSIP 1/2 - CSIP 6/7 - CSIP 11/1 + CSIP 3/1 + CSIP 8/1 + CSIP 13/1 + CSIP 6/6 + CSIP 12/5 + CSIP 14/16 + CSIP 12/1 CSIP 11/3 + CSIP 6/4 + CSIP 11/1 CSIP 11/4 - CSIP 12/1 - CSIP 12/5 - CSIP 14/9 - CSIP 5/4 - CSIP 13/11 - CSIP 2/2 - CSIP 6/6 - CSIP 13/1 - CSIP 5/1 + CSIP 6/3 + CSIP 13/5 + CSIP 14/8 + CSIP 13/2 + CSIP 13/7 CSIP 13/10 - CSIP 14/4 + CSIP 5/1 CSIP 4/2 CSIP 9/2 - CSIP 13/4 - CSIP 14/15 - CSIP 13/7 - CSIP 14/8 + CSIP 14/4 + CSIP 12/2 CSIP 6/15 + CSIP 6/9 + CSIP 6/1 + CSIP 5/5 CSIP 6/16 - CSIP 13/2 - CSIP 13/5 - CSIP 6/3 + CSIP 6/8 + CSIP 14/2 + CSIP 13/6 + CSIP 5/2 + CSIP 14/15 + CSIP 14/7 + CSIP 14/5 + CSIP 13/9 + CSIP 13/4 + CSIP 13/11 + CSIP 2/2 + CSIP 14/9 + CSIP 5/4 + CSIP 6/2 + CSIP 13/8 CSIP 10/1 - CSIP 6/4 - CSIP 14/16 + CSIP 12/3 + CSIP 13/3 + CSIP 14/6 + CSIP 12/4 + CSIP 1/1 + CSIP 6/7 + CSIP 1/2 + CSIP 11/2 + CSIP 14/3 - PACS 4/9 - PACS 4/10 - PACS 4/5 - PACS 4/11 - PACS 4/14 - PACS 4/6 - PACS 5/1 + PACS 4/4 + PACS 3/2 PACS 4/12 - PACS 4/16 + PACS 6/2 PACS 3/5 - PACS 4/7 + PACS 4/16 + PACS 6/5 PACS 4/15 + PACS 4/1 PACS 4/13 + PACS 4/7 + PACS 2/2 + PACS 4/5 + PACS 4/11 PACS 3/4 + PACS 1/2 PACS 4/3 PACS 3/1 - PACS 4/1 - PACS 4/4 + PACS 4/14 + PACS 4/9 + PACS 4/10 + PACS 6/4 + PACS 4/8 + PACS 6/7 + PACS 3/6 + PACS 6/3 + PACS 4/6 PACS 4/2 - PACS 2/2 - PACS 3/2 PACS 3/3 PACS 6/1 - PACS 6/3 - PACS 4/8 - PACS 3/6 - PACS 6/7 - PACS 6/2 - PACS 6/5 - PACS 6/4 - PACS 1/1 + PACS 5/1 - ASCS 6/4 + ASCS 9/3 + ASCS 7/1 + ASCS 0/1 + ASCS 9/2 + ASCS 9/9 + ASCS 3/1 + ASCS 5/1 + ASCS 9/4 + ASCS 5/3 + ASCS 6/6 + ASCS 5/2 ASCS 6/7 ASCS 7/4 - ASCS 6/5 - ASCS 7/3 - ASCS 7/5 - ASCS 4/1 - ASCS 6/1 + ASCS 9/7 + ASCS 9/1 + ASCS 8/2 ASCS 6/2 + ASCS 8/1 + ASCS 6/1 ASCS 6/9 + ASCS 4/1 ASCS 6/3 - ASCS 6/8 ASCS 7/2 - ASCS 2/2 - ASCS 8/2 - ASCS 7/1 - ASCS 5/1 - ASCS 8/1 - ASCS 9/3 - ASCS 6/6 - ASCS 5/3 + ASCS 6/8 + ASCS 7/3 ASCS 9/5 - ASCS 0/1 - ASCS 3/1 - ASCS 5/2 - ASCS 9/1 - ASCS 9/7 - ASCS 9/2 - ASCS 9/4 - ASCS 9/9 + ASCS 7/5 + ASCS 6/5 + ASCS 2/2 ASCS 9/6 + ASCS 6/4 - BASS 3/2 - BASS 3/5 - BASS 4/1 + BASS 5/1 + BASS 4/5 BASS 5/2 BASS 5/6 - BASS 4/5 - BASS 5/1 - BASS 3/1 - BASS 4/2 - BASS 4/6 - BASS 4/3 - BASS 5/8 - BASS 5/3 - BASS 0/1 - BASS 2/2 + BASS 3/5 + BASS 4/1 + BASS 3/2 BASS 3/4 + BASS 2/2 BASS 4/4 - BASS 5/4 BASS 5/5 + BASS 5/4 + BASS 5/3 + BASS 5/8 + BASS 4/6 + BASS 4/2 + BASS 0/1 + BASS 3/1 + BASS 4/3 - BAP 45/7 - BAP 46/1 - BAP 74/2 - BAP 80/3 - BAP 89/9 - BAP 89/12 - BAP 90/1 - BAP 11/2 - BAP 7/2 - BAP 7/3 - BAP 20/5 - BAP 20/10 - BAP 31/2 - BAP 31/6 - BAP 32/3 - BAP 32/4 - BAP 16/12 - BAP 16/15 - BAP 17/6 - BAP 80/6 - BAP 89/6 - BAP 10/5 - BAP 20/7 - BAP 33/7 - BAP 16/11 - BAP 16/14 - BAP 17/12 - BAP 17/14 - BAP 38/2 - BAP 39/1 - BAP 39/8 - BAP 39/10 - BAP 39/15 - BAP 55/5 - BAP 56/1 - BAP 56/6 - BAP 56/8 - BAP 56/12 - BAP 56/16 - BAP 69/1 - BAP 69/16 - BAP 70/1 - BAP 70/7 - BAP 45/11 - BAP 46/2 - BAP 74/1 - BAP 90/5 - BAP 90/7 - BAP 90/8 - BAP 10/2 - BAP 11/3 - BAP 12/17 - BAP 9/8 - BAP 20/6 - BAP 20/8 - BAP 16/9 - BAP 17/2 - BAP 17/9 - BAP 38/3 - BAP 39/11 - BAP 55/3 - BAP 55/6 - BAP 55/12 - BAP 56/5 - BAP 69/10 - BAP 69/15 - BAP 70/12 - BAP 23/1 - BAP 80/1 - BAP 22/2 - BAP 32/5 - BAP 32/6 - BAP 35/2 - BAP 59/4 - BAP 66/2 - BAP 67/3 - BAP 73/5 - BAP 11/1 - BAP 13/17 - BAP 7/1 - BAP 20/2 - BAP 20/3 - BAP 20/11 - BAP 32/2 - BAP 17/5 - BAP 17/13 - BAP 17/16 - BAP 37/17 - BAP 38/4 - BAP 38/9 + BAP 4/1 + BAP 26/1 + BAP 49/1 + BAP 62/1 + BAP 77/1 + BAP 83/1 + BAP 44/13 + BAP 10/1 + BAP 89/13 + BAP 68/11 + BAP 9a/6 + BAP 21/9 + BAP 88/3 + BAP 1/4 + BAP 51/4 + BAP 7/7 + BAP 21/12 + BAP 40/2 + BAP 73/9 + BAP 21/8 + BAP 29/1 + BAP 21/11 + BAP 36/6 + BAP 60/1 + BAP 39/7 + BAP 76/3 + BAP 21/4 + BAP 92/7 + BAP 16/6 + BAP 36/11 + BAP 45/9 + BAP 55/1 + BAP 16/16 + BAP 44/10 + BAP 55/15 + BAP 65/3 + BAP 76/4 + BAP 39/13 + BAP 16/7 + BAP 37/4 + BAP 22/3 + BAP 59/1 + BAP 92/3 + BAP 59/10 + BAP 80/10 + BAP 34/5 + BAP 60/2 + BAP 37/11 + BAP 59/8 + BAP 12/14 + BAP 23/4 + BAP 38/14 + BAP 68/17 + BAP 40/12 + BAP 74/11 + BAP 14/7 + BAP 73/4 + BAP 45/10 + BAP 17/15 + BAP 38/16 + BAP 36/4 + BAP 76/1 + BAP 71/1 + BAP 95/5 + BAP 70/11 + BAP 14/11 + BAP 54/4 + BAP 44/9 + BAP 20/4 + BAP 39/12 + BAP 92/6 + BAP 90/4 + BAP 16/8 + BAP 15/15 + BAP 54/17 + BAP 82/1 + BAP 13/8 + BAP 40/9 BAP 45/6 + BAP 96/2 + BAP 90/2 + BAP 73/2 + BAP 93/5 + BAP 1/3 + BAP 93/6 + BAP 21/2 + BAP 13/16 + BAP 36/5 + BAP 61/1 + BAP 7/9 + BAP 40/6 + BAP 32/10 + BAP 59/12 + BAP 40/15 + BAP 13/5 + BAP 95/3 + BAP 95/2 + BAP 34/4 + BAP 73/12 + BAP 33/4 + BAP 70/5 BAP 45/8 + BAP 54/14 + BAP 12/12 + BAP 37/15 + BAP 40/14 + BAP 22/7 + BAP 41/14 + BAP 39/5 + BAP 12/4 BAP 45/13 - BAP 89/7 + BAP 17/10 + BAP 12/10 BAP 89/10 - BAP 10/4 - BAP 20/4 - BAP 33/4 + BAP 87/3 + BAP 9/2 + BAP 33a/1 BAP 16/13 - BAP 17/3 - BAP 17/10 - BAP 38/10 - BAP 39/5 - BAP 39/12 - BAP 54/4 - BAP 55/9 + BAP 89/7 BAP 69/2 - BAP 46/3 - BAP 74/3 - BAP 21/3 - BAP 21/5 - BAP 33/1 - BAP 51/3 - BAP 53/1 - BAP 73/8 - BAP 73/10 - BAP 87/1 - BAP 87/2 - BAP 88/6 - BAP 44/3 - BAP 44/7 - BAP 9/7 - BAP 20/9 - BAP 31/1 + BAP 13/11 + BAP 23/5 + BAP 65/1 + BAP 38/5 + BAP 38/11 + BAP 22/8 + BAP 90/6 + BAP 20/1 + BAP 40/5 + BAP 59/6 + BAP 12/13 + BAP 39/3 + BAP 52/3 + BAP 39/16 + BAP 23/7 + BAP 69/12 + BAP 72/3 + BAP 74/22 + BAP 88/7 + BAP 44/1 + BAP 55/8 + BAP 33a/4 + BAP 38/8 + BAP 82/2 + BAP 74/8 + BAP 74/15 + BAP 22/1 + BAP 39/6 + BAP 73/3 + BAP 44/5 + BAP 45/3 + BAP 33a/5 + BAP 89/11 + BAP 46/4 + BAP 12/1 + BAP 86/3 + BAP 15/11 + BAP 37/10 + BAP 89/3 + BAP 54/16 + BAP 9a/2 + BAP 33/8 + BAP 51/2 + BAP 66/1 + BAP 37/12 + BAP 59/9 + BAP 37/5 + BAP 31/3 + BAP 70/9 + BAP 54/2 + BAP 22/11 + BAP 73/7 + BAP 94/1 + BAP 17/1 + BAP 7/4 + BAP 23/19 + BAP 14/6 + BAP 12/15 + BAP 7/8 + BAP 93/4 + BAP 14/13 + BAP 23/10 + BAP 10/5 + BAP 69/16 + BAP 14/10 + BAP 39/10 + BAP 37/1 + BAP 17/12 + BAP 55/5 + BAP 46/6 + BAP 30/3 + BAP 36/12 + BAP 36/17 + BAP 16/14 + BAP 51/1 + BAP 56/1 + BAP 44/8 + BAP 22/4 + BAP 32/7 + BAP 31/5 + BAP 58/3 + BAP 41/4 + BAP 9/1 + BAP 9/3 + BAP 33/6 + BAP 15/2 + BAP 52/1 + BAP 56/6 + BAP 12/5 + BAP 12/11 + BAP 56/16 + BAP 14/2 + BAP 13/2 + BAP 15/14 + BAP 54/13 + BAP 37/9 + BAP 36/2 + BAP 92/5 + BAP 32/9 + BAP 54/7 + BAP 40/8 + BAP 86/1 + BAP 41/6 + BAP 9a/4 + BAP 53/2 + BAP 80/13 + BAP 56/8 + BAP 93/3 + BAP 80/6 + BAP 41/1 + BAP 20/7 + BAP 33a/3 + BAP 14/4 + BAP 27/5 + BAP 34/3 + BAP 51/5 + BAP 7/5 + BAP 66/2 + BAP 89/2 + BAP 38/9 + BAP 38/4 + BAP 69/11 + BAP 39/4 + BAP 32/5 + BAP 14/8 + BAP 56/14 + BAP 54/11 + BAP 11/1 + BAP 69/9 + BAP 41/8 + BAP 56/10 + BAP 63/3 + BAP 74/4 + BAP 46/9 + BAP 22/2 + BAP 25/3 + BAP 80/1 + BAP 38/13 + BAP 12/9 + BAP 16/4 + BAP 13/7 + BAP 68/8 + BAP 40/4 + BAP 9/6 + BAP 37/17 + BAP 56/2 + BAP 17/5 + BAP 80/5 + BAP 70/6 + BAP 17/13 + BAP 67/3 + BAP 5/3 + BAP 20/11 + BAP 32/6 + BAP 90/20 + BAP 23/1 + BAP 84/3 + BAP 73/5 + BAP 28/4 + BAP 20/2 + BAP 55/2 + BAP 76/2 + BAP 20/3 + BAP 7/1 + BAP 13/1 + BAP 9a/3 + BAP 33a/2 + BAP 32/2 + BAP 13/13 + BAP 37/13 + BAP 35/2 + BAP 13/14 + BAP 13/12 + BAP 59/4 + BAP 94/2 + BAP 33a/7 + BAP 68/6 BAP 32/1 - BAP 16/10 - BAP 17/11 + BAP 43/1 + BAP 65/5 + BAP 20/9 + BAP 39/9 + BAP 15/13 + BAP 41/13 + BAP 37/7 + BAP 41/16 + BAP 69/13 + BAP 21/7 BAP 38/6 + BAP 90/17 + BAP 15/12 + BAP 61/3 + BAP 33a/8 + BAP 45/4 + BAP 55/4 + BAP 22/9 + BAP 88/5 + BAP 16/5 + BAP 27/4 BAP 38/7 - BAP 39/9 BAP 39/14 - BAP 43/1 - BAP 55/4 - BAP 56/4 - BAP 57/1 - BAP 68/6 + BAP 40/1 + BAP 86/4 + BAP 74/3 BAP 69/4 - BAP 69/7 - BAP 69/13 BAP 69/14 - BAP 70/3 - BAP 70/14 - BAP 21/6 - BAP 21/7 - BAP 22/9 + BAP 61/5 + BAP 74/23 + BAP 9a/1 BAP 22/12 - BAP 33/2 + BAP 41/11 + BAP 72/1 + BAP 12/3 BAP 34/2 - BAP 35/1 - BAP 65/2 BAP 65/4 - BAP 65/5 - BAP 72/1 - BAP 86/4 - BAP 88/5 - BAP 44/6 - BAP 22/4 - BAP 30/3 - BAP 31/5 - BAP 32/7 - BAP 32/9 - BAP 33/6 - BAP 34/3 - BAP 36/17 - BAP 51/1 - BAP 51/5 - BAP 52/1 - BAP 53/2 - BAP 58/3 - BAP 86/1 - BAP 86/2 - BAP 44/2 - BAP 44/8 - BAP 9/1 - BAP 9/3 - BAP 14/2 - BAP 14/3 - BAP 14/4 - BAP 14/10 - BAP 21/2 - BAP 22/7 - BAP 32/10 - BAP 34/4 - BAP 54/17 - BAP 59/2 - BAP 59/12 - BAP 65/1 - BAP 67/2 - BAP 73/2 - BAP 73/12 - BAP 87/3 - BAP 44/9 - BAP 45/9 - BAP 45/10 - BAP 45/12 - BAP 45/14 - BAP 60/1 - BAP 60/2 - BAP 89/8 - BAP 89/13 - BAP 90/3 - BAP 21/4 - BAP 21/8 - BAP 21/9 + BAP 31/1 + BAP 1/2 + BAP 65/2 + BAP 21/6 + BAP 16/10 + BAP 46/3 + BAP 14/5 + BAP 85/4 + BAP 36/14 + BAP 8/1 + BAP 33/2 + BAP 69/7 + BAP 57/1 + BAP 68/3 + BAP 70/3 + BAP 61/6 + BAP 36/7 + BAP 53/1 + BAP 54/12 + BAP 89/5 + BAP 46/2 + BAP 55/6 + BAP 90/21 + BAP 51/7 + BAP 14/15 + BAP 1/5 + BAP 36/1 + BAP 25/2 + BAP 50/2 + BAP 7/10 + BAP 45/2 + BAP 12/16 + BAP 41/3 + BAP 17/2 + BAP 6/4 + BAP 87/2 + BAP 90/16 + BAP 69/10 + BAP 56/5 + BAP 16/3 + BAP 17/9 + BAP 8/2 + BAP 15/8 + BAP 11/3 + BAP 87/1 + BAP 70/12 + BAP 36/8 + BAP 14/9 + BAP 45/11 + BAP 74/6 + BAP 33/1 + BAP 69/15 + BAP 36/13 + BAP 89/1 + BAP 48/1 + BAP 55/12 + BAP 9/8 + BAP 12/17 + BAP 28/2 + BAP 13/10 + BAP 16/9 + BAP 37/16 + BAP 39/11 + BAP 80/15 + BAP 48/2 + BAP 44/7 + BAP 15/16 + BAP 54/9 + BAP 58/2 + BAP 6/2 + BAP 46/14 + BAP 95/1 + BAP 88/6 + BAP 68/13 + BAP 90/5 + BAP 92/1 + BAP 70/16 + BAP 73/8 + BAP 80/16 + BAP 68/2 BAP 21/10 - BAP 21/11 - BAP 21/12 - BAP 22/3 - BAP 22/6 - BAP 34/5 - BAP 51/4 - BAP 51/6 + BAP 90/3 + BAP 89/8 + BAP 45/12 BAP 52/2 - BAP 58/1 - BAP 59/1 + BAP 70/15 + BAP 19/1 BAP 59/5 - BAP 59/8 - BAP 59/10 - BAP 65/3 - BAP 67/1 - BAP 73/1 - BAP 73/4 - BAP 73/9 - BAP 73/11 - BAP 88/1 - BAP 88/3 - BAP 44/10 - BAP 44/13 - BAP 44/15 - BAP 21/1 - BAP 22/5 - BAP 30/1 - BAP 30/2 - BAP 32/8 - BAP 33/3 - BAP 34/1 - BAP 52/4 - BAP 52/5 - BAP 59/3 - BAP 73/6 - BAP 87/4 - BAP 88/2 - BAP 88/4 - BAP 44/4 - BAP 44/11 - BAP 44/12 - BAP 44/14 - BAP 44/16 - BAP 17/8 - BAP 39/2 - BAP 55/10 - BAP 55/11 - BAP 55/14 - BAP 55/16 - BAP 56/7 - BAP 56/9 - BAP 56/11 - BAP 69/5 - BAP 69/8 - BAP 70/8 - BAP 70/10 - BAP 60/4 - BAP 38/13 - BAP 39/4 - BAP 55/2 - BAP 56/2 - BAP 56/3 - BAP 56/10 - BAP 56/14 - BAP 56/15 - BAP 69/9 - BAP 69/11 - BAP 70/6 - BAP 37/8 - BAP 37/13 - BAP 54/5 - BAP 54/11 - BAP 60/3 - BAP 1/1 - BAP 45/5 - BAP 10/1 + BAP 70/2 + BAP 44/15 + BAP 72/2 + BAP 14/12 + BAP 73/11 + BAP 54/6 BAP 10/3 + BAP 45/14 + BAP 80/22 + BAP 54/8 BAP 31/7 - BAP 16/16 - BAP 17/4 + BAP 88/1 + BAP 36/9 BAP 17/7 - BAP 17/15 - BAP 18/1 - BAP 19/1 - BAP 36/4 - BAP 37/4 - BAP 38/12 - BAP 38/14 - BAP 38/16 - BAP 39/7 - BAP 39/13 - BAP 55/1 - BAP 55/7 - BAP 55/15 + BAP 22/6 BAP 68/4 - BAP 68/17 - BAP 70/2 + BAP 67/1 + BAP 38/12 BAP 70/4 - BAP 70/15 - BAP 71/1 - BAP 14/5 - BAP 15/12 - BAP 15/13 - BAP 16/5 - BAP 9/4 - BAP 12/6 - BAP 14/16 - BAP 15/3 - BAP 15/4 - BAP 15/5 - BAP 9/2 - BAP 12/4 - BAP 14/11 - BAP 15/1 - BAP 15/15 - BAP 16/8 - BAP 69/3 - BAP 70/5 - BAP 70/11 - BAP 70/13 - BAP 70/16 - BAP 36/12 - BAP 37/1 - BAP 37/9 - BAP 54/7 - BAP 54/13 + BAP 58/1 + BAP 73/1 + BAP 82/3 + BAP 55/7 + BAP 51/6 + BAP 17/4 + BAP 18/1 + BAP 46/5 + BAP 13/6 + BAP 25/1 + BAP 93/1 + BAP 96/1 + BAP 48/3 + BAP 40/16 + BAP 33/7 + BAP 56/12 + BAP 92/2 + BAP 60/3 + BAP 70/1 + BAP 38/2 + BAP 16/11 + BAP 80/7 + BAP 86/2 + BAP 82/4 + BAP 14/3 + BAP 70/7 BAP 68/10 + BAP 69/1 + BAP 45/5 BAP 68/15 - BAP 14/13 - BAP 15/2 - BAP 15/14 - BAP 14/7 - BAP 14/12 - BAP 16/6 - BAP 16/7 - BAP 1/4 - BAP 29/1 - BAP 72/2 - BAP 9a/1 - BAP 33a/7 - BAP 33a/8 - BAP 40/1 - BAP 41/11 - BAP 41/13 - BAP 41/16 - BAP 61/3 - BAP 1/2 - BAP 8/1 - BAP 29/2 - BAP 45/4 - BAP 45/3 - BAP 46/4 - BAP 89/3 - BAP 89/11 - BAP 22/1 - BAP 22/8 - BAP 22/10 - BAP 22/11 - BAP 31/3 - BAP 31/4 - BAP 33/5 - BAP 33/8 - BAP 51/2 - BAP 52/3 - BAP 59/6 + BAP 1/1 + BAP 39/8 + BAP 41/15 + BAP 44/2 + BAP 40/7 + BAP 36/3 + BAP 89/6 + BAP 39/15 + BAP 39/1 + BAP 46/15 + BAP 17/14 + BAP 41/7 + BAP 54/5 + BAP 13/17 + BAP 61/4 + BAP 41/10 + BAP 56/3 + BAP 15/6 + BAP 17/16 + BAP 3/1 + BAP 15/7 + BAP 56/15 + BAP 9a/5 + BAP 14/14 + BAP 37/8 + BAP 41/5 + BAP 68/9 + BAP 16/2 + BAP 89/4 BAP 59/7 - BAP 59/9 - BAP 59/11 - BAP 66/1 - BAP 73/3 - BAP 73/7 - BAP 86/3 - BAP 88/7 - BAP 44/1 - BAP 44/5 - BAP 72/3 - BAP 20/1 - BAP 17/1 - BAP 38/1 - BAP 38/5 - BAP 38/8 - BAP 38/11 - BAP 38/15 - BAP 39/3 - BAP 39/6 - BAP 39/16 - BAP 42/1 - BAP 55/8 - BAP 55/13 + BAP 36/15 + BAP 22/10 BAP 56/13 - BAP 69/6 - BAP 69/12 - BAP 70/9 - BAP 9/5 - BAP 13/4 - BAP 14/6 + BAP 12/8 + BAP 33/5 BAP 15/10 - BAP 15/11 - BAP 1/6 - BAP 1/5 - BAP 8/2 - BAP 45/2 - BAP 58/2 - BAP 89/1 - BAP 89/5 - BAP 7/10 - BAP 14/1 - BAP 14/9 - BAP 14/15 - BAP 15/8 - BAP 15/9 - BAP 15/16 - BAP 16/1 - BAP 16/3 - BAP 6/2 - BAP 6/4 - BAP 7/6 - BAP 25/2 - BAP 28/2 - BAP 40/10 - BAP 40/13 - BAP 41/3 - BAP 36/15 - BAP 37/5 - BAP 37/10 - BAP 37/12 - BAP 54/2 - BAP 54/10 - BAP 54/16 BAP 68/1 + BAP 59/11 + BAP 74/7 + BAP 40/11 + BAP 45/1 BAP 68/12 - BAP 7/7 - BAP 9a/6 - BAP 23/4 - BAP 40/2 - BAP 40/12 - BAP 74/11 - BAP 76/1 - BAP 76/3 - BAP 76/4 - BAP 80/10 - BAP 80/16 - BAP 80/22 - BAP 82/3 - BAP 92/3 - BAP 92/7 - BAP 95/5 - BAP 12/14 - BAP 36/6 - BAP 36/9 - BAP 37/15 - BAP 54/14 - BAP 84/1 - BAP 1/3 - BAP 7/9 - BAP 7/4 - BAP 9a/2 - BAP 9a/7 + BAP 69/6 + BAP 54/10 BAP 23/2 - BAP 23/7 - BAP 23/19 - BAP 33a/4 - BAP 33a/5 - BAP 40/5 - BAP 40/11 + BAP 9a/7 + BAP 38/1 + BAP 5/4 + BAP 55/13 + BAP 13/3 + BAP 42/1 + BAP 9/5 + BAP 31/4 + BAP 38/15 + BAP 13/4 BAP 41/2 - BAP 74/7 - BAP 7/5 - BAP 7/8 - BAP 9a/4 - BAP 23/10 - BAP 25/1 - BAP 33a/3 - BAP 40/7 - BAP 40/8 - BAP 40/16 - BAP 41/1 - BAP 41/4 - BAP 41/6 - BAP 41/7 - BAP 41/15 - BAP 46/5 - BAP 46/6 - BAP 46/15 - BAP 48/3 - BAP 9a/8 - BAP 23/5 - BAP 33a/1 BAP 40/3 - BAP 40/6 - BAP 40/9 - BAP 40/14 - BAP 40/15 - BAP 41/14 - BAP 61/1 + BAP 69/3 BAP 61/2 - BAP 82/1 - BAP 90/2 - BAP 90/4 - BAP 92/6 - BAP 93/5 - BAP 93/6 - BAP 95/2 - BAP 95/3 - BAP 96/2 - BAP 12/10 - BAP 12/12 - BAP 13/5 - BAP 13/8 + BAP 17/3 BAP 13/9 - BAP 13/11 - BAP 13/16 - BAP 36/5 - BAP 61/5 - BAP 61/6 - BAP 74/23 - BAP 85/4 - BAP 90/17 - BAP 12/3 - BAP 27/4 - BAP 36/14 - BAP 37/7 - BAP 68/3 + BAP 15/1 + BAP 38/10 + BAP 10/4 + BAP 9a/8 + BAP 70/13 + BAP 67/2 + BAP 59/2 + BAP 55/9 + BAP 74/1 + BAP 20/8 + BAP 16/1 + BAP 7/6 + BAP 20/6 + BAP 95/6 + BAP 21/5 + BAP 90/11 + BAP 37/3 + BAP 73/10 + BAP 74/10 + BAP 21/3 + BAP 38/3 + BAP 51/3 + BAP 40/13 + BAP 68/16 + BAP 15/9 + BAP 14/1 + BAP 10/2 + BAP 36/16 + BAP 40/10 + BAP 44/3 + BAP 90/8 + BAP 55/3 + BAP 90/7 + BAP 17/11 + BAP 35/1 + BAP 56/4 + BAP 70/14 + BAP 44/6 + BAP 9/7 + BAP 29/2 BAP 23/6 + BAP 17/8 + BAP 13/15 + BAP 60/4 BAP 23/18 - BAP 33a/6 - BAP 41/9 - BAP 41/12 - BAP 64/2 - BAP 74/9 - BAP 79/2 - BAP 80/2 - BAP 80/14 + BAP 69/5 BAP 80/21 - BAP 85/2 - BAP 92/4 - BAP 93/2 - BAP 95/4 - BAP 5/1 - BAP 12/2 + BAP 55/11 + BAP 90/1 + BAP 69/8 BAP 12/7 - BAP 13/15 + BAP 78/3 + BAP 54/1 + BAP 22/5 + BAP 55/10 + BAP 16/15 + BAP 17/6 + BAP 89/9 + BAP 30/1 + BAP 74/2 + BAP 9/4 + BAP 73/6 + BAP 32/3 + BAP 56/9 BAP 36/10 + BAP 52/5 + BAP 68/7 + BAP 44/4 + BAP 56/11 + BAP 74/9 + BAP 70/8 + BAP 68/5 + BAP 33/3 BAP 37/2 - BAP 37/6 - BAP 37/14 - BAP 54/1 BAP 54/3 - BAP 54/15 - BAP 63/1 - BAP 68/5 - BAP 68/7 - BAP 68/14 - BAP 46/14 - BAP 48/1 - BAP 48/2 - BAP 74/6 - BAP 74/10 - BAP 80/15 - BAP 90/11 - BAP 90/16 - BAP 90/21 - BAP 92/1 - BAP 95/1 - BAP 95/6 - BAP 12/16 - BAP 13/10 - BAP 36/1 - BAP 36/7 - BAP 36/8 - BAP 36/13 - BAP 36/16 - BAP 37/3 - BAP 37/16 - BAP 50/1 - BAP 54/9 - BAP 54/12 - BAP 68/13 - BAP 68/16 - BAP 80/7 - BAP 80/13 - BAP 82/4 - BAP 92/2 - BAP 92/5 - BAP 93/1 - BAP 93/3 - BAP 93/4 - BAP 96/1 - BAP 12/5 - BAP 12/11 - BAP 13/2 - BAP 13/6 - BAP 36/2 - BAP 36/3 - BAP 36/11 - BAP 37/11 - BAP 54/6 - BAP 54/8 - BAP 68/2 - BAP 68/11 - BAP 3/1 - BAP 89/2 - BAP 89/4 - BAP 9/6 - BAP 14/8 - BAP 14/14 - BAP 15/6 - BAP 15/7 - BAP 16/2 - BAP 16/4 - BAP 9a/3 - BAP 9a/5 - BAP 25/3 - BAP 45/1 - BAP 74/8 - BAP 74/15 - BAP 74/22 - BAP 82/2 - BAP 90/6 - BAP 94/1 - BAP 12/1 - BAP 12/8 - BAP 12/13 - BAP 12/15 - BAP 13/3 - BAP 27/2 - BAP 28/4 - BAP 33a/2 - BAP 40/4 - BAP 41/5 - BAP 41/8 - BAP 41/10 - BAP 46/9 - BAP 61/4 - BAP 74/4 - BAP 76/2 - BAP 80/5 - BAP 90/20 - BAP 94/2 - BAP 5/3 - BAP 12/9 - BAP 13/1 - BAP 13/7 - BAP 13/12 - BAP 13/13 - BAP 13/14 - BAP 68/8 - BAP 68/9 - BAP 78/1 + BAP 93/2 + BAP 1/6 + BAP 7/3 + BAP 88/4 + BAP 55/16 + BAP 21/1 + BAP 20/5 + BAP 14/16 + BAP 41/9 + BAP 37/6 + BAP 80/14 + BAP 80/2 + BAP 59/3 + BAP 44/14 + BAP 31/6 + BAP 68/14 + BAP 33a/6 + BAP 34/1 + BAP 54/15 + BAP 16/12 + BAP 92/4 + BAP 89/12 + BAP 39/2 + BAP 64/2 + BAP 31/2 + BAP 15/5 + BAP 95/4 + BAP 15/3 + BAP 85/2 + BAP 41/12 + BAP 45/7 + BAP 44/11 + BAP 87/4 + BAP 44/16 + BAP 11/2 + BAP 12/2 + BAP 80/3 + BAP 12/6 + BAP 15/4 + BAP 7/2 + BAP 88/2 + BAP 32/4 + BAP 37/14 + BAP 44/12 + BAP 55/14 + BAP 20/10 + BAP 52/4 + BAP 32/8 + BAP 46/1 + BAP 30/2 + BAP 70/10 + BAP 79/2 + BAP 56/7 @@ -2240,916 +2250,918 @@ - CAP 7/2 - CAP 7/4 - CAP 7/9 - CAP 8/1 - CAP 8/2 - CAP 8/3 - CAP 8/4 - CAP 11/7 - CAP 14/1 - CAP 17/2 - CAP 20/5 - CAP 23/2 + CAP 26/5 + CAP 20/3 + CAP 11/5 + CAP 26/7 + CAP 22/4 + CAP 16/4 + CAP 6/8 + CAP 20/9 + CAP 20/6 + CAP 7/5 + CAP 17/1 + CAP 18/2 CAP 6/1 CAP 6/7 CAP 7/6 - CAP 11/2 - CAP 11/12 - CAP 13/1 - CAP 21/1 CAP 22/8 + CAP 13/1 + CAP 32/1 + CAP 31/3 + CAP 31/1 CAP 22/9 - CAP 22/10 + CAP 11/2 CAP 28/6 - CAP 7/8 - CAP 11/3 - CAP 11/11 - CAP 12/1 - CAP 20/1 - CAP 22/5 - CAP 28/7 - CAP 28/9 - CAP 9/1 + CAP 6/3 + CAP 22/10 + CAP 21/1 + CAP 27/4 + CAP 11/12 + CAP 16/3 + CAP 16/5 + CAP 1/3 + CAP 26/4 CAP 10/1 + CAP 22/7 + CAP 9/1 CAP 11/10 CAP 16/1 - CAP 16/5 CAP 22/3 - CAP 22/7 - CAP 6/5 - CAP 6/6 - CAP 11/1 - CAP 13/2 - CAP 20/2 - CAP 20/4 + CAP 19/4 + CAP 28/11 + CAP 7/1 + CAP 19/1 + CAP 33/2 + CAP 21/3 + CAP 24/1 + CAP 18/1 + CAP 1/2 + CAP 22/11 + CAP 33/1 + CAP 11/8 + CAP 26/1 + CAP 10/2 + CAP 21/2 + CAP 23/1 + CAP 31/2 + CAP 11/6 + CAP 7/7 + CAP 11/9 + CAP 6/2 CAP 22/1 - CAP 22/6 CAP 26/6 CAP 28/8 + CAP 20/2 + CAP 13/2 + CAP 6/6 + CAP 6/5 + CAP 6a/1 + CAP 20/4 + CAP 22/6 + CAP 11/1 + CAP 11/11 + CAP 1/1 + CAP 12/1 + CAP 4/1 + CAP 28/9 + CAP 7/8 + CAP 6/4 + CAP 3/1 + CAP 20/1 + CAP 28/7 + CAP 11/3 + CAP 22/5 + CAP 27/5 CAP 2/2 - CAP 7/3 - CAP 11/4 - CAP 16/6 - CAP 17/5 + CAP 16/2 + CAP 19/2 CAP 22/2 CAP 22/12 - CAP 28/10 + CAP 7/3 CAP 29/1 - CAP 6a/2 + CAP 17/5 + CAP 16/6 + CAP 28/10 + CAP 11/4 + CAP 8/3 CAP 31/4 + CAP 17/2 + CAP 6a/2 + CAP 20/5 + CAP 23/2 + CAP 7/9 + CAP 11/7 + CAP 7/4 CAP 32/2 - CAP 16/3 - CAP 18/2 - CAP 27/4 - CAP 31/1 - CAP 31/3 - CAP 32/1 - CAP 6/8 - CAP 7/5 - CAP 11/5 - CAP 16/4 - CAP 17/1 - CAP 20/3 - CAP 20/6 - CAP 20/9 - CAP 22/4 - CAP 26/7 - CAP 16/2 - CAP 19/2 - CAP 27/5 - CAP 19/4 - CAP 26/4 - CAP 26/5 - CAP 6/2 - CAP 7/1 - CAP 7/7 - CAP 10/2 - CAP 11/6 - CAP 11/8 - CAP 11/9 - CAP 21/2 - CAP 21/3 - CAP 22/11 - CAP 23/1 - CAP 24/1 - CAP 26/1 - CAP 28/11 - CAP 33/1 - CAP 33/2 - CAP 1/1 - CAP 3/1 - CAP 4/1 - CAP 6/4 - CAP 6a/1 - CAP 18/1 - CAP 19/1 - CAP 31/2 - CAP 6/3 - CAP 1/3 - CAP 1/2 + CAP 14/1 + CAP 8/2 + CAP 7/2 + CAP 8/1 + CAP 8/4 - HAS 3/1 - HAS 3/5 - HAS 3/12 - HAS 4/5 - HAS 4/6 - HAS 5/2 - HAS 5/3 - HAS 3/14 - HAS 3/10 - HAS 4/1 - HAS 5/1 - HAS 5/4 - HAS 5/6 - HAS 3/1a - HAS 4/4 + HAS 4/7 HAS 2/2 - HAS 3/3 HAS 3/4 - HAS 3/8 HAS 3/9 HAS 3/13 - HAS 4/7 - HAS 3/2 - HAS 3/7 - HAS 3/11 - HAS 4/3 - HAS 0/1 - HAS 3/6 + HAS 3/8 + HAS 3/3 HAS 4/2 HAS 5/5 + HAS 3/6 + HAS 0/1 + HAS 4/4 HAS 4/9 + HAS 3/1a + HAS 5/4 + HAS 5/1 + HAS 4/1 + HAS 5/6 + HAS 3/10 HAS 4/8 + HAS 4/3 + HAS 3/7 + HAS 3/11 + HAS 3/2 + HAS 3/14 + HAS 5/2 + HAS 5/3 + HAS 4/6 HAS 4/10 + HAS 3/12 + HAS 3/5 + HAS 4/5 + HAS 3/1 - HAP 13/7 - HAP 1/1 HAP 13/6 HAP 18/1 + HAP 1/1 HAP 19/2 + HAP 12/7 + HAP 13/7 + HAP 12/6 + HAP 46/1 HAP 10/1 - HAP 17/1 + HAP 92/1 + HAP 51/1 + HAP 43/2 HAP 40/1 + HAP 17/1 HAP 43/1 - HAP 43/2 - HAP 51/1 - HAP 92/1 - HAP 12/4 + HAP 50/1 + HAP 24/5 + HAP 13/4 + HAP 1/2 + HAP 90/1 + HAP 50/2 + HAP 43/3 + HAP 46/2 + HAP 14/2 + HAP 12/2 + HAP 12/1 + HAP 1/4 + HAP 26/1 + HAP 16/1 + HAP 24/1 + HAP 2/2 HAP 12/5 - HAP 13/2 - HAP 13/3 HAP 14/3 + HAP 13/2 HAP 16/2 - HAP 2/2 - HAP 16/1 - HAP 24/1 - HAP 26/1 - HAP 13/1 - HAP 13/5 + HAP 13/3 + HAP 12/4 HAP 24/2 - HAP 24/6 + HAP 13/1 HAP 43/4 - HAP 1/2 - HAP 1/4 - HAP 12/1 - HAP 12/2 - HAP 13/4 - HAP 14/2 - HAP 24/5 - HAP 43/3 - HAP 46/2 - HAP 50/1 - HAP 50/2 - HAP 90/1 - HAP 12/6 - HAP 12/7 - HAP 46/1 + HAP 24/6 + HAP 13/5 HAP 12/3 - HAP 14/1 - HAP 19/1 HAP 24/3 + HAP 19/1 HAP 24/4 + HAP 14/1 - TMAP 1/4 - TMAP 1/1 - TMAP 1/8 - TMAP 13/1 - TMAP 17/1 - TMAP 18/2 - TMAP 53/1 - TMAP 55/6 - TMAP 56/14 - TMAP 70/1 - TMAP 75/4 - TMAP 75/5 - TMAP 77/1 - TMAP 92/1 - TMAP 93/1 - TMAP 96/10 - TMAP 14/2 - TMAP 14/4 - TMAP 14/5 - TMAP 15/1 - TMAP 15/3 - TMAP 15/6 - TMAP 17/5 - TMAP 50/1 - TMAP 56/8 - TMAP 56/13 - TMAP 75/2 - TMAP 76/5 - TMAP 90/1 - TMAP 95/4 - TMAP 96/1 - TMAP 96/7 - TMAP 96/15 - TMAP 98/2 - TMAP 99/2 - TMAP 117/2 + TMAP 95/5 + TMAP 114/4 + TMAP 57/3 + TMAP 79/2 + TMAP 116/4 + TMAP 78/1 + TMAP 55/3 + TMAP 113/1 + TMAP 98/3 + TMAP 17/6 + TMAP 115/5 + TMAP 55/5 + TMAP 116/7 + TMAP 76/6 + TMAP 110/1 + TMAP 14/1 + TMAP 16/1 + TMAP 56/7 + TMAP 54/3 + TMAP 117/1 + TMAP 78/2 + TMAP 56/10 + TMAP 96/14 + TMAP 3/1 + TMAP 100/1 + TMAP 76/1 + TMAP 95/7 + TMAP 76/3 TMAP 1/2 - TMAP 1/6 - TMAP 14/3 - TMAP 15/5 + TMAP 17/2 + TMAP 151/3 + TMAP 74/2 + TMAP 56/9 TMAP 16/3 + TMAP 55/4 + TMAP 14/3 + TMAP 76/4 + TMAP 119/1 + TMAP 1/6 TMAP 16/6 - TMAP 17/2 - TMAP 17/3 TMAP 52/1 - TMAP 55/4 - TMAP 56/9 TMAP 72/1 - TMAP 74/2 - TMAP 76/3 - TMAP 76/4 + TMAP 15/5 + TMAP 121/2 TMAP 77/2 - TMAP 95/7 - TMAP 96/5 + TMAP 115/8 TMAP 96/9 TMAP 115/7 - TMAP 115/8 - TMAP 119/1 - TMAP 121/2 - TMAP 151/3 - TMAP 10/1 - TMAP 12/2 - TMAP 14/7 - TMAP 15/2 - TMAP 17/7 - TMAP 19/1 - TMAP 55/7 - TMAP 56/16 - TMAP 57/2 - TMAP 72/2 - TMAP 75/3 - TMAP 95/1 - TMAP 96/2 - TMAP 96/8 - TMAP 96/11 - TMAP 96/16 - TMAP 115/4 - TMAP 116/3 - TMAP 116/9 - TMAP 116/10 - TMAP 118/1 - TMAP 131/1 - TMAP 1/5 - TMAP 1/7 - TMAP 16/5 - TMAP 19/2 - TMAP 19/3 - TMAP 52/2 - TMAP 55/1 - TMAP 55/8 - TMAP 56/1 - TMAP 56/5 - TMAP 56/12 - TMAP 57/1 - TMAP 96/6 - TMAP 97/2 - TMAP 112/2 - TMAP 114/2 - TMAP 96/13 - TMAP 98/1 - TMAP 114/1 - TMAP 115/3 - TMAP 116/8 - TMAP 116/11 - TMAP 3/1 - TMAP 14/1 - TMAP 16/1 - TMAP 16/4 - TMAP 17/6 - TMAP 54/3 + TMAP 96/5 + TMAP 17/3 TMAP 55/2 - TMAP 55/3 - TMAP 55/5 - TMAP 56/7 - TMAP 56/10 - TMAP 57/3 - TMAP 74/6 - TMAP 76/1 - TMAP 76/6 - TMAP 78/1 - TMAP 78/2 - TMAP 79/2 - TMAP 95/5 + TMAP 16/4 TMAP 95/6 - TMAP 96/14 - TMAP 98/3 - TMAP 100/1 - TMAP 110/1 - TMAP 113/1 - TMAP 114/4 - TMAP 115/5 - TMAP 116/4 - TMAP 116/7 - TMAP 117/1 + TMAP 74/6 + TMAP 96/15 + TMAP 76/5 + TMAP 99/2 + TMAP 96/7 + TMAP 15/6 + TMAP 14/5 + TMAP 153/4 + TMAP 98/2 + TMAP 95/4 TMAP 118/3 + TMAP 17/5 + TMAP 96/1 + TMAP 75/2 + TMAP 14/2 + TMAP 15/3 + TMAP 117/2 + TMAP 15/1 + TMAP 56/13 TMAP 119/2 - TMAP 153/4 - TMAP 14/6 + TMAP 90/1 + TMAP 56/8 + TMAP 50/1 + TMAP 14/4 + TMAP 18/2 + TMAP 56/14 + TMAP 1/1 + TMAP 115/3 + TMAP 1/8 + TMAP 116/11 + TMAP 70/1 + TMAP 93/1 + TMAP 96/13 + TMAP 114/1 + TMAP 75/4 + TMAP 17/1 + TMAP 77/1 + TMAP 53/1 + TMAP 120/1 + TMAP 13/1 + TMAP 55/6 + TMAP 75/5 + TMAP 96/10 + TMAP 116/8 + TMAP 98/1 + TMAP 153/2 + TMAP 92/1 + TMAP 57/2 + TMAP 19/1 + TMAP 96/16 + TMAP 116/9 + TMAP 96/2 + TMAP 75/3 + TMAP 10/1 + TMAP 153/1 + TMAP 17/7 + TMAP 151/1 + TMAP 115/4 + TMAP 131/1 + TMAP 154/1 + TMAP 118/1 + TMAP 14/7 + TMAP 56/16 + TMAP 72/2 + TMAP 116/3 + TMAP 116/10 + TMAP 15/2 + TMAP 96/8 + TMAP 95/1 + TMAP 96/11 + TMAP 12/2 + TMAP 55/7 + TMAP 79/1 + TMAP 116/5 + TMAP 96/12 + TMAP 94/1 + TMAP 116/1 + TMAP 1/4 + TMAP 97/1 TMAP 15/4 - TMAP 16/2 - TMAP 17/4 - TMAP 54/1 - TMAP 56/2 - TMAP 56/4 + TMAP 115/1 TMAP 56/6 - TMAP 56/15 - TMAP 74/1 + TMAP 78/3 + TMAP 56/4 + TMAP 116/15 TMAP 74/3 + TMAP 14/6 + TMAP 54/1 TMAP 76/2 - TMAP 78/3 - TMAP 79/1 - TMAP 92/2 - TMAP 94/1 - TMAP 94/5 + TMAP 156/1 TMAP 96/3 - TMAP 96/12 - TMAP 97/1 - TMAP 99/1 TMAP 114/3 - TMAP 115/1 - TMAP 116/1 - TMAP 116/5 + TMAP 16/2 TMAP 116/14 - TMAP 116/15 - TMAP 151/4 + TMAP 56/15 + TMAP 92/2 + TMAP 99/1 + TMAP 17/4 + TMAP 56/2 + TMAP 74/1 TMAP 151/5 - TMAP 156/1 - TMAP 151/1 - TMAP 153/1 - TMAP 154/1 + TMAP 151/4 + TMAP 94/5 + TMAP 94/2 + TMAP 116/12 + TMAP 95/3 + TMAP 95/8 TMAP 2/2 - TMAP 12/1 - TMAP 12/3 - TMAP 18/1 + TMAP 112/1 TMAP 54/2 - TMAP 56/3 - TMAP 56/11 - TMAP 73/1 - TMAP 74/4 - TMAP 74/5 + TMAP 100/2 TMAP 75/1 - TMAP 75/6 - TMAP 94/2 - TMAP 94/3 + TMAP 56/3 TMAP 94/4 + TMAP 12/1 + TMAP 116/16 TMAP 95/2 - TMAP 95/3 - TMAP 95/8 + TMAP 12/3 + TMAP 73/1 + TMAP 152/1 + TMAP 74/5 + TMAP 18/1 TMAP 96/4 - TMAP 100/2 - TMAP 112/1 - TMAP 116/12 - TMAP 116/16 - TMAP 120/1 - TMAP 153/2 - TMAP 115/2 - TMAP 115/6 - TMAP 116/2 - TMAP 116/6 - TMAP 116/13 + TMAP 56/11 + TMAP 94/3 + TMAP 75/6 + TMAP 74/4 + TMAP 151/2 + TMAP 52/2 + TMAP 1/7 + TMAP 56/12 + TMAP 153/6 + TMAP 56/1 + TMAP 56/5 TMAP 118/2 - TMAP 121/1 + TMAP 16/5 TMAP 150/1 - TMAP 151/6 + TMAP 116/13 + TMAP 116/6 TMAP 153/5 - TMAP 153/6 - TMAP 151/2 - TMAP 152/1 + TMAP 19/3 + TMAP 57/1 + TMAP 19/2 + TMAP 151/6 + TMAP 116/2 + TMAP 55/8 + TMAP 97/2 + TMAP 96/6 + TMAP 1/5 + TMAP 115/2 + TMAP 115/6 + TMAP 114/2 + TMAP 121/1 + TMAP 112/2 + TMAP 55/1 - PBP 3/1 - PBP 5/1 - PBP 2/2 - PBP 6/1 - PBP 8/3 - PBP 8/8 - PBP 8/10 - PBP 1/1 - PBP 12/1 - PBP 14/5 - PBP 14/10 - PBP 7/3 - PBP 7/4 - PBP 8/6 - PBP 8/7 - PBP 14/6 - PBP 5/2 - PBP 6/2 - PBP 9/1 - PBP 13/1 - PBP 13/4 - PBP 14/4 - PBP 14/9 - PBP 11/2 - PBP 13/2 - PBP 6/6 + PBP 10/1 PBP 8/9 PBP 12/2 PBP 14/11 + PBP 6/6 + PBP 8/10 + PBP 11/2 + PBP 13/2 + PBP 2/2 + PBP 8/8 + PBP 6/1 + PBP 8/3 + PBP 6/8 PBP 6/4 + PBP 7/2 PBP 6/7 - PBP 6/8 PBP 7/1 - PBP 7/2 PBP 14/7 + PBP 13/4 + PBP 14/4 + PBP 5/2 + PBP 14/9 + PBP 13/1 + PBP 6/2 + PBP 9/1 + PBP 3/1 + PBP 14/10 + PBP 12/1 + PBP 1/1 PBP 14/12 + PBP 14/5 + PBP 7/4 + PBP 8/7 + PBP 8/6 + PBP 14/6 + PBP 7/3 PBP 8/4 - PBP 8/12 PBP 13/3 - PBP 1/2 - PBP 6/3 - PBP 6/5 - PBP 8/1 - PBP 8/2 + PBP 5/1 + PBP 8/12 + PBP 4/1 PBP 8/5 - PBP 8/11 PBP 11/1 + PBP 8/2 PBP 14/1 + PBP 8/11 + PBP 8/1 PBP 14/2 + PBP 6/5 PBP 14/3 + PBP 6/3 PBP 14/8 + PBP 1/2 - - MBT 20/2 - MBT 3/2 - MBT 20/1 + MBT 0/1 MBT 10/1 MBT 10/2 + MBT 20/1 + MBT 3/2 + MBT 20/2 MBT 3/1 - DFU 3/1 - DFU 10/1 + DFU 3/2 DFU 22/3 DFU 30/1 - DFU 3/2 - DFU 0/1 + DFU 10/1 + DFU 3/1 + DFU 21/1 DFU 3/3 - DFU 20/1 DFU 11/1 - DFU 21/1 - DFU 22/1 + DFU 0/1 + DFU 20/1 DFU 11/2 DFU 21/2 + DFU 22/1 - GMAP 15/1 - GMAP 16/1 - GMAP 17/5 - GMAP 20/8 - GMAP 20/13 - GMAP 20/19 - GMAP 20/25 - GMAP 20/60 - GMAP 20/67 - GMAP 20/68 - GMAP 20/76 - GMAP 20/83 - GMAP 20/86 - GMAP 20/87 - GMAP 20/92 - GMAP 20/95 - GMAP 20/97 - GMAP 20/105 - GMAP 20/109 - GMAP 21/1 - GMAP 1/2 - GMAP 12/3 - GMAP 14/1 - GMAP 14/4 - GMAP 14/6 - GMAP 18/2 - GMAP 18/6 - GMAP 20/11 - GMAP 20/15 - GMAP 20/16 - GMAP 20/22 - GMAP 20/24 - GMAP 20/31 - GMAP 20/40 - GMAP 20/41 - GMAP 20/42 - GMAP 20/54 - GMAP 20/57 - GMAP 20/64 - GMAP 20/71 - GMAP 20/73 - GMAP 1/4 - GMAP 1/5 - GMAP 14/3 - GMAP 14/9 - GMAP 16/5 - GMAP 19/2 - GMAP 20/4 - GMAP 20/14 - GMAP 20/17 - GMAP 20/27 - GMAP 20/29 - GMAP 20/30 + GMAP 102/1 + GMAP 77/1 + GMAP 20/59 + GMAP 40/43 + GMAP 20/12 + GMAP 104/2 + GMAP 36/5 + GMAP 14/11 + GMAP 40/70 + GMAP 104/1 + GMAP 20/44 + GMAP 34/2 + GMAP 38/4 + GMAP 40/9 + GMAP 40/10 GMAP 20/33 - GMAP 20/36 - GMAP 20/38 - GMAP 20/45 - GMAP 20/46 - GMAP 20/48 - GMAP 20/72 - GMAP 20/75 - GMAP 20/89 - GMAP 20/114 - GMAP 30/1 - GMAP 10/1 - GMAP 14/2 - GMAP 14/5 - GMAP 14/8 - GMAP 14/10 - GMAP 15/2 - GMAP 16/3 - GMAP 20/7 - GMAP 20/9 - GMAP 20/21 - GMAP 20/47 - GMAP 20/52 - GMAP 20/53 - GMAP 20/55 - GMAP 20/66 - GMAP 20/69 - GMAP 20/91 - GMAP 20/96 - GMAP 20/104 - GMAP 35/6 - GMAP 37/2 - GMAP 37/3 - GMAP 37/5 - GMAP 38/5 - GMAP 40/13 - GMAP 40/18 - GMAP 40/26 - GMAP 40/28 - GMAP 40/37 - GMAP 40/46 - GMAP 40/48 - GMAP 54/2 - GMAP 54/3 - GMAP 56/1 - GMAP 1/1 - GMAP 1/6 - GMAP 2/2 - GMAP 14/12 - GMAP 16/2 - GMAP 17/4 - GMAP 18/4 - GMAP 18/5 - GMAP 32/4 - GMAP 35/4 - GMAP 35/5 - GMAP 35/8 + GMAP 20/29 + GMAP 79/6 + GMAP 40/58 GMAP 36/1 - GMAP 37/4 - GMAP 37/6 - GMAP 40/4 - GMAP 40/8 - GMAP 40/14 - GMAP 40/21 - GMAP 40/27 - GMAP 40/33 - GMAP 40/36 - GMAP 20/78 - GMAP 20/79 - GMAP 20/82 - GMAP 20/84 - GMAP 20/88 - GMAP 20/90 - GMAP 20/103 - GMAP 20/111 - GMAP 32/2 - GMAP 34/3 - GMAP 34/4 - GMAP 35/1 - GMAP 35/2 - GMAP 36/2 - GMAP 38/6 - GMAP 40/6 - GMAP 40/7 - GMAP 40/12 - GMAP 40/15 - GMAP 40/17 - GMAP 40/19 - GMAP 40/23 - GMAP 40/32 - GMAP 40/38 - GMAP 40/39 - GMAP 40/44 - GMAP 59/5 - GMAP 59/6 - GMAP 59/8 - GMAP 59/9 - GMAP 59/11 - GMAP 75/1 - GMAP 76/2 - GMAP 76/4 - GMAP 79/8 - GMAP 79/16 - GMAP 92/5 - GMAP 93/2 - GMAP 93/4 - GMAP 102/4 - GMAP 103/4 - GMAP 105/7 - GMAP 12/2 - GMAP 13/1 - GMAP 14/7 - GMAP 16/6 - GMAP 18/3 - GMAP 19/1 - GMAP 20/10 - GMAP 20/26 - GMAP 20/39 - GMAP 20/43 - GMAP 20/50 - GMAP 20/56 - GMAP 20/61 - GMAP 20/85 - GMAP 20/98 - GMAP 20/110 - GMAP 32/3 - GMAP 33/1 - GMAP 35/7 - GMAP 35/10 - GMAP 38/2 - GMAP 38/3 - GMAP 40/1 - GMAP 40/3 - GMAP 40/25 - GMAP 40/34 - GMAP 40/50 - GMAP 40/52 - GMAP 40/63 - GMAP 40/65 - GMAP 40/67 - GMAP 40/72 - GMAP 41/1 - GMAP 56/2 - GMAP 57/3 - GMAP 59/1 - GMAP 77/4 - GMAP 79/14 - GMAP 92/1 - GMAP 93/1 - GMAP 93/5 - GMAP 105/5 - GMAP 107/2 - GMAP 14/11 - GMAP 16/4 - GMAP 17/2 - GMAP 17/3 - GMAP 18/1 - GMAP 20/2 - GMAP 20/3 - GMAP 20/6 - GMAP 20/12 - GMAP 20/18 - GMAP 20/23 + GMAP 16/5 + GMAP 14/9 + GMAP 20/32 + GMAP 34/5 + GMAP 90/1 + GMAP 32/1 + GMAP 105/3 + GMAP 103/3 + GMAP 100/1 + GMAP 20/5 + GMAP 93/6 + GMAP 40/22 + GMAP 1/3 + GMAP 77/3 + GMAP 70/1 + GMAP 20/62 + GMAP 20/28 + GMAP 56/3 + GMAP 54/4 + GMAP 78/3 + GMAP 79/2 + GMAP 38/5 + GMAP 58/2 + GMAP 40/46 + GMAP 10/1 + GMAP 20/55 + GMAP 105/6 + GMAP 20/47 + GMAP 40/18 + GMAP 37/5 + GMAP 20/7 + GMAP 14/2 + GMAP 40/26 + GMAP 14/10 + GMAP 20/52 + GMAP 40/13 + GMAP 79/3 + GMAP 37/2 + GMAP 16/3 + GMAP 54/2 + GMAP 14/5 + GMAP 79/12 + GMAP 15/2 + GMAP 60/1 + GMAP 14/8 + GMAP 20/9 + GMAP 35/6 + GMAP 56/1 + GMAP 20/91 + GMAP 20/96 + GMAP 58/1 + GMAP 20/66 + GMAP 105/4 + GMAP 54/3 + GMAP 57/4 + GMAP 59/10 + GMAP 20/21 + GMAP 107/1 + GMAP 20/53 + GMAP 20/104 + GMAP 37/3 + GMAP 40/37 + GMAP 20/69 + GMAP 40/48 + GMAP 40/28 GMAP 20/34 - GMAP 20/37 - GMAP 20/44 - GMAP 20/59 - GMAP 20/65 - GMAP 20/77 - GMAP 20/100 + GMAP 20/2 GMAP 20/106 - GMAP 20/107 + GMAP 35/3 GMAP 20/112 GMAP 20/113 + GMAP 79/5 + GMAP 52/1 + GMAP 102/3 + GMAP 20/6 GMAP 22/1 - GMAP 34/2 - GMAP 35/3 + GMAP 16/4 + GMAP 20/100 + GMAP 50/1 + GMAP 40/41 + GMAP 20/3 + GMAP 20/23 + GMAP 17/3 + GMAP 20/18 + GMAP 79/7 GMAP 35/11 - GMAP 36/5 + GMAP 20/65 + GMAP 75/2 GMAP 38/1 - GMAP 38/4 - GMAP 40/9 - GMAP 40/10 - GMAP 40/41 - GMAP 40/43 + GMAP 94/1 + GMAP 92/4 GMAP 40/60 - GMAP 40/70 - GMAP 50/1 - GMAP 52/1 + GMAP 105/2 + GMAP 103/2 + GMAP 17/2 + GMAP 20/107 + GMAP 20/77 GMAP 74/2 - GMAP 75/2 - GMAP 77/1 - GMAP 79/5 - GMAP 79/7 + GMAP 20/37 + GMAP 18/1 GMAP 79/10 - GMAP 92/4 - GMAP 94/1 - GMAP 102/1 - GMAP 102/3 - GMAP 103/2 - GMAP 104/1 - GMAP 57/4 - GMAP 58/1 - GMAP 58/2 - GMAP 59/10 - GMAP 60/1 - GMAP 79/2 - GMAP 79/3 - GMAP 79/12 - GMAP 105/4 - GMAP 105/6 - GMAP 107/1 + GMAP 20/92 + GMAP 20/19 + GMAP 20/95 + GMAP 40/71 + GMAP 40/55 + GMAP 20/67 GMAP 32/5 + GMAP 20/13 + GMAP 42/1 + GMAP 62/1 GMAP 32/7 + GMAP 74/1 + GMAP 20/25 + GMAP 77/2 + GMAP 20/109 + GMAP 20/97 GMAP 35/9 - GMAP 36/3 - GMAP 39/1 - GMAP 40/11 GMAP 40/20 - GMAP 40/30 + GMAP 40/35 + GMAP 40/49 + GMAP 40/69 + GMAP 39/1 + GMAP 20/105 + GMAP 40/61 + GMAP 54/1 + GMAP 82/1 + GMAP 20/60 + GMAP 40/66 + GMAP 20/108 + GMAP 57/1 + GMAP 20/20 + GMAP 81/1 + GMAP 12/1 + GMAP 17/6 + GMAP 20/51 + GMAP 40/54 + GMAP 79/15 + GMAP 73/1 + GMAP 36/6 + GMAP 92/2 + GMAP 20/74 + GMAP 34/1 + GMAP 79/11 + GMAP 17/1 + GMAP 20/70 + GMAP 40/2 + GMAP 20/81 + GMAP 55/1 + GMAP 19/3 + GMAP 40/29 + GMAP 40/56 + GMAP 79/1 + GMAP 32/3 + GMAP 20/85 + GMAP 107/2 + GMAP 57/3 + GMAP 40/3 + GMAP 20/43 + GMAP 92/1 + GMAP 20/56 + GMAP 56/2 + GMAP 41/1 + GMAP 38/2 + GMAP 79/14 + GMAP 20/110 + GMAP 40/1 + GMAP 14/7 + GMAP 40/65 + GMAP 59/1 + GMAP 40/50 + GMAP 40/67 + GMAP 20/50 + GMAP 40/34 + GMAP 40/63 + GMAP 38/3 + GMAP 33/1 + GMAP 20/39 + GMAP 14/4 + GMAP 20/82 + GMAP 20/24 + GMAP 32/2 + GMAP 34/3 + GMAP 20/90 + GMAP 20/71 + GMAP 20/41 + GMAP 92/5 + GMAP 40/23 + GMAP 76/2 + GMAP 20/11 + GMAP 102/4 + GMAP 18/2 + GMAP 40/44 + GMAP 40/12 + GMAP 1/2 + GMAP 20/54 + GMAP 40/17 + GMAP 20/42 + GMAP 40/15 + GMAP 79/16 + GMAP 40/38 + GMAP 20/40 + GMAP 36/2 + GMAP 75/1 + GMAP 59/8 + GMAP 40/7 + GMAP 20/73 + GMAP 40/32 + GMAP 18/6 + GMAP 93/4 + GMAP 103/4 + GMAP 40/19 + GMAP 40/39 + GMAP 20/84 + GMAP 93/2 + GMAP 40/6 + GMAP 20/15 + GMAP 59/6 + GMAP 20/88 + GMAP 20/22 + GMAP 76/4 + GMAP 40/21 + GMAP 14/3 + GMAP 93/7 + GMAP 105/1 + GMAP 106/1 + GMAP 20/4 + GMAP 20/17 + GMAP 20/75 + GMAP 20/48 + GMAP 20/38 + GMAP 40/27 + GMAP 40/36 + GMAP 1/4 + GMAP 53/1 + GMAP 59/12 + GMAP 40/14 + GMAP 20/89 + GMAP 76/1 + GMAP 40/47 + GMAP 37/4 + GMAP 30/1 + GMAP 32/4 + GMAP 79/13 + GMAP 20/27 + GMAP 35/4 + GMAP 40/4 + GMAP 1/5 + GMAP 20/114 + GMAP 40/33 + GMAP 37/6 + GMAP 20/14 + GMAP 79/4 + GMAP 93/3 + GMAP 72/1 + GMAP 35/5 + GMAP 103/1 + GMAP 20/46 + GMAP 79/9 + GMAP 20/36 + GMAP 20/45 + GMAP 40/57 + GMAP 20/30 + GMAP 19/2 + GMAP 40/8 + GMAP 35/8 + GMAP 74/4 + GMAP 92/3 + GMAP 20/72 + GMAP 40/52 + GMAP 20/98 + GMAP 16/6 + GMAP 19/1 + GMAP 105/5 + GMAP 18/3 + GMAP 20/61 + GMAP 12/2 + GMAP 40/25 + GMAP 93/5 + GMAP 77/4 + GMAP 35/10 + GMAP 40/72 + GMAP 20/10 + GMAP 13/1 + GMAP 20/26 + GMAP 93/1 + GMAP 35/7 + GMAP 59/11 + GMAP 20/16 + GMAP 20/78 + GMAP 35/2 + GMAP 34/4 + GMAP 20/64 + GMAP 20/57 + GMAP 20/111 + GMAP 59/5 + GMAP 38/6 + GMAP 105/7 + GMAP 20/31 + GMAP 20/103 + GMAP 14/1 + GMAP 59/9 + GMAP 14/6 + GMAP 12/3 + GMAP 35/1 + GMAP 79/8 + GMAP 20/79 GMAP 40/31 - GMAP 40/35 - GMAP 40/49 - GMAP 40/55 - GMAP 40/61 - GMAP 40/66 - GMAP 40/69 - GMAP 40/71 - GMAP 42/1 - GMAP 54/1 - GMAP 62/1 - GMAP 74/1 - GMAP 74/3 + GMAP 20/87 + GMAP 16/1 + GMAP 20/76 + GMAP 110/1 + GMAP 15/1 GMAP 76/3 - GMAP 77/2 - GMAP 82/1 + GMAP 40/30 + GMAP 20/68 + GMAP 20/86 + GMAP 21/1 + GMAP 20/8 + GMAP 74/3 + GMAP 40/11 + GMAP 36/3 GMAP 104/3 - GMAP 110/1 - GMAP 20/1 - GMAP 20/35 - GMAP 20/49 - GMAP 20/58 + GMAP 20/83 + GMAP 17/5 GMAP 20/63 GMAP 20/80 - GMAP 20/93 - GMAP 20/94 - GMAP 20/99 - GMAP 20/101 - GMAP 20/102 - GMAP 32/6 + GMAP 16/2 + GMAP 40/62 + GMAP 40/42 + GMAP 20/1 GMAP 35/12 - GMAP 36/4 + GMAP 14/12 GMAP 37/1 - GMAP 40/5 - GMAP 40/16 - GMAP 40/24 - GMAP 40/40 - GMAP 40/42 - GMAP 40/45 - GMAP 40/51 - GMAP 40/53 - GMAP 40/59 - GMAP 40/62 - GMAP 40/64 GMAP 40/68 - GMAP 57/2 + GMAP 40/51 + GMAP 102/2 GMAP 59/2 - GMAP 59/3 - GMAP 59/4 + GMAP 1/6 + GMAP 18/4 + GMAP 1/1 + GMAP 40/24 + GMAP 18/5 + GMAP 40/59 GMAP 59/7 + GMAP 20/58 + GMAP 17/4 GMAP 72/2 - GMAP 102/2 GMAP 102/5 + GMAP 40/16 + GMAP 57/2 + GMAP 40/53 + GMAP 40/40 + GMAP 20/35 + GMAP 20/49 + GMAP 32/6 + GMAP 20/101 + GMAP 40/64 + GMAP 40/45 + GMAP 20/99 GMAP 108/1 - GMAP 40/47 - GMAP 40/57 - GMAP 40/58 - GMAP 53/1 - GMAP 59/12 - GMAP 72/1 - GMAP 74/4 - GMAP 76/1 - GMAP 79/4 - GMAP 79/6 - GMAP 79/9 - GMAP 79/13 - GMAP 92/3 - GMAP 93/3 - GMAP 93/7 - GMAP 103/1 - GMAP 105/1 - GMAP 106/1 - GMAP 104/2 - GMAP 105/2 - GMAP 1/3 - GMAP 12/1 - GMAP 17/1 - GMAP 17/6 - GMAP 19/3 - GMAP 20/5 - GMAP 20/20 - GMAP 20/28 - GMAP 20/32 - GMAP 20/51 - GMAP 20/62 - GMAP 20/70 - GMAP 20/74 - GMAP 20/81 - GMAP 20/108 - GMAP 32/1 - GMAP 34/1 - GMAP 34/5 - GMAP 36/6 - GMAP 40/2 - GMAP 40/22 - GMAP 40/29 - GMAP 40/54 - GMAP 40/56 - GMAP 54/4 - GMAP 55/1 - GMAP 56/3 - GMAP 57/1 - GMAP 70/1 - GMAP 73/1 - GMAP 77/3 - GMAP 78/3 - GMAP 79/1 - GMAP 79/11 - GMAP 79/15 - GMAP 81/1 - GMAP 90/1 - GMAP 92/2 - GMAP 93/6 - GMAP 100/1 - GMAP 103/3 - GMAP 105/3 + GMAP 36/4 + GMAP 2/2 + GMAP 40/5 + GMAP 20/102 + GMAP 59/4 + GMAP 20/94 + GMAP 20/93 + GMAP 59/3 - CORE 11/3 - CORE 40/2 - CORE 2a/60 - CORE 11/1 CORE 11/2 + CORE 11/1 + CORE 2a/60 CORE 12/1 - CORE 12/3 CORE 2a/53 CORE 31/2 - CORE 2a/51 - CORE 2a/52 - CORE 2a/54 - CORE 11/5 - CORE 41/2 - CORE 2/1 - CORE 2/60 - CORE 2a/50 - CORE 2b/60 CORE 11/6 - CORE 20/4 CORE 20a/1 + CORE 2b/60 + CORE 20/4 + CORE 2a/50 + CORE 2/60 + CORE 2/1 + CORE 12/3 + CORE 2a/54 + CORE 2a/51 + CORE 41/2 + CORE 11/5 + CORE 2a/52 + CORE 40/2 + CORE 11/3 @@ -3158,4 +3170,4 @@ - \ No newline at end of file + diff --git a/tests/bluetooth/qualification/ICS_Zephyr_Bluetooth_Host.pts b/tests/bluetooth/qualification/ICS_Zephyr_Bluetooth_Host.pts index f6cac3f08c401..fc1a5cfa981e4 100644 --- a/tests/bluetooth/qualification/ICS_Zephyr_Bluetooth_Host.pts +++ b/tests/bluetooth/qualification/ICS_Zephyr_Bluetooth_Host.pts @@ -1,6 +1,6 @@  - 302478 + 332723 Zephyr Host @@ -129,6 +129,10 @@ 14a
17 + + 20
+ 8 +
14a
5 @@ -5587,10 +5591,6 @@ 4
4
- - 1
- 1 -
4
12 @@ -5663,6 +5663,10 @@ 4
10
+ + 1
+ 2 +
6
4 @@ -6040,10 +6044,6 @@ 9a
6
- - 84
- 1 -
38
11 @@ -6112,6 +6112,10 @@ 23
10
+ + 51
+ 7 +
56
14 @@ -6216,6 +6220,10 @@ 65
5
+ + 63
+ 3 +
17
12 @@ -6276,6 +6284,14 @@ 40
9
+ + 78
+ 3 +
+ + 50
+ 2 +
7
10 @@ -7024,10 +7040,6 @@ 73
3
- - 50
- 1 -
70
6 @@ -7188,10 +7200,6 @@ 21
1
- - 78
- 1 -
12
14 @@ -7432,10 +7440,18 @@ 14
4
+ + 84
+ 3 +
73
5
+ + 27
+ 5 +
28
4 @@ -7980,10 +7996,6 @@ 45
7
- - 27
- 2 -
69
3 @@ -8100,10 +8112,6 @@ 16
11
- - 5
- 1 -
80
7 @@ -8136,10 +8144,6 @@ 41
10
- - 63
- 1 -
14
3 @@ -8368,6 +8372,10 @@ 70
13
+ + 5
+ 4 +
39
8 @@ -10366,6 +10374,10 @@ 8
3
+ + 4
+ 1 +
9
1 @@ -12119,4 +12131,4 @@
-
\ No newline at end of file + From 603cd4870ac4100ededeb91f76e640d89830bafd Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 5 Dec 2024 07:11:04 +0000 Subject: [PATCH 0047/4042] west.yml: MCUboot synchronization from upstream Update Zephyr fork of MCUboot to revision: 5d6471bac184c8accaeeb0efcfad8dd35225a28d Brings following Zephyr relevant fixes: - 5d6471ba zephyr: convert platform_allow to a list - 7cc60059 boot: zephyr: boards: nrf54l10 and nrf54l05 configs - 742978e7 boot: zephyr: Fix sample.bootloader.mcuboot.usb_cdc_acm_recovery - 39aab3d8 zephyr: Add CONFIG_MCUBOOT_CLEANUP_RAM Signed-off-by: Jamie McCrae --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index e8080cc3fcd39..68714fa5e0f6e 100644 --- a/west.yml +++ b/west.yml @@ -291,7 +291,7 @@ manifest: groups: - crypto - name: mcuboot - revision: eb942067989569f9cf319b087d0bb16b16effd86 + revision: 5d6471bac184c8accaeeb0efcfad8dd35225a28d path: bootloader/mcuboot groups: - bootloader From aba874933cf30f86500d253675777a2951a377f2 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 5 Dec 2024 07:13:04 +0000 Subject: [PATCH 0048/4042] Revert "ci: twister: add workaround until module test data is fixed [REVERTME]" This reverts commit b8957692fc612846683db37a31951507c8860d3c. Signed-off-by: Jamie McCrae --- .github/workflows/twister.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/twister.yaml b/.github/workflows/twister.yaml index e660979b92d69..0fa810b3dd765 100644 --- a/.github/workflows/twister.yaml +++ b/.github/workflows/twister.yaml @@ -137,8 +137,7 @@ jobs: if [ "${{matrix.subset}}" = "1" ]; then ./scripts/zephyr_module.py --twister-out module_tests.args if [ -s module_tests.args ]; then - # FIXME: workaround for modules with invalid test data - ./scripts/twister +module_tests.args --outdir module_tests ${TWISTER_COMMON} ${PUSH_OPTIONS} --integration + ./scripts/twister +module_tests.args --outdir module_tests ${TWISTER_COMMON} ${PUSH_OPTIONS} fi fi From c9309fc92d495dcc77835d352a5530108f49f7b8 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Thu, 5 Dec 2024 05:37:46 +0100 Subject: [PATCH 0049/4042] MAINTAINERS: Add cvinayak to Bluetooth HCI, Host and ISO Contributed some of the following to HCI (UART) samples: Vinayak Kariappa Chettimada (20): Bluetooth: hci_uart: reduce configured stack sizes samples: Bluetooth: Add configuration file for all controller features samples: Bluetooth: hci_rpmsg: Fix RAM overflow building for DF feature Bluetooth: Controller: Preliminary Central multiple CIS support samples: Bluetooth: hci_rpmsg/uart: Fix BT_CTLR_ISO_TX_BUFFER_SIZE Bluetooth: Controller: Fix connected ISO dynamic tx power Bluetooth: Controller: BT_CTLR_ISO_TX_BUFFER_SIZE from BT_ISO_TX_MTU samples: Bluetooth: hci_uart: Add preliminary support for nrf54l15pdk samples: Bluetooth: hci_uart: Use lower IRQ priority SoC peripherals samples: Bluetooth: hci_uart: Add preliminary DF support for nrf54l15pdk samples: Bluetooth: hci_uart/hci_ipc: CI coverage for nRF53+nRF21 FEM samples: Bluetooth: hci_uart: CI coverage for nRF5340dk cpuapp samples: Bluetooth: hci_uart: CI coverage for nRF52+nRF21 FEM samples: Bluetooth: hci_uart: CI coverage for nRF52840 samples: Bluetooth: hci_uart: CI coverage for nRF52dk samples: Bluetooth: hci_uart: CI coverage for nRF52833 DF samples: Bluetooth: hci_uart(_3wire)/hci_ipc: Enable PAST feature samples: Bluetooth: hci_uart hci_ipc configuration update samples: Bluetooth: hci_uart hci_ipc configuration update Revert "Bluetooth: controller: remove refs to LLCP_LEGACY after rebase" Contributed some of the following to Host: Vinayak Kariappa Chettimada (2409): Bluetooth: SMP: Fix unaligned access usage fault. soc: Use nrf.h instead of nrf52.h and nrf52_bitfields.h Bluetooth: Fix race condition between ecc_send and ecc_task ... Contributed some of the following to Host ISO: Vinayak Kariappa Chettimada (2): Bluetooth: host: iso: Fix typo in hci_le_big_terminate Bluetooth: HCI: Rename to bt_hci_iso_sdu_hdr and bt_hci_iso_sdu_ts_hdr and attends the weekly Bluetooth Zephyr meetings. Signed-off-by: Vinayak Kariappa Chettimada --- MAINTAINERS.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/MAINTAINERS.yml b/MAINTAINERS.yml index b15fb8c28ee04..7df0197ff9781 100644 --- a/MAINTAINERS.yml +++ b/MAINTAINERS.yml @@ -313,6 +313,7 @@ Bluetooth HCI: - sjanc - theob-pro - HoZHel + - cvinayak files: - include/zephyr/drivers/bluetooth/ - include/zephyr/drivers/bluetooth.h @@ -326,7 +327,7 @@ Bluetooth HCI: tests: - bluetooth -Bluetooth controller: +Bluetooth Controller: status: maintained maintainers: - cvinayak @@ -365,6 +366,7 @@ Bluetooth Host: - sjanc - Thalley - theob-pro + - cvinayak files: - doc/connectivity/bluetooth/ - include/zephyr/bluetooth/ @@ -515,6 +517,7 @@ Bluetooth ISO: - jhedberg - kruithofa - rugeGerritsen + - cvinayak files: - include/zephyr/bluetooth/iso.h - doc/connectivity/bluetooth/shell/host/iso.rst From 59a389351cf91b5cf6a1a31eba726c48f24c919e Mon Sep 17 00:00:00 2001 From: Trung Hieu Le Date: Wed, 27 Nov 2024 17:21:17 +0100 Subject: [PATCH 0050/4042] include: zephyr: sys: util: Add type check for macro DIV_ROUND_CLOSEST Add type check to avoid comparing unsigned values with 0 which is always true or false and can cause coverity issue. Signed-off-by: Trung Hieu Le --- include/zephyr/sys/util.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/zephyr/sys/util.h b/include/zephyr/sys/util.h index 8c648c777e402..6773490cc75b5 100644 --- a/include/zephyr/sys/util.h +++ b/include/zephyr/sys/util.h @@ -366,9 +366,10 @@ extern "C" { * * @return The result of @p n / @p d, rounded to the nearest integer. */ -#define DIV_ROUND_CLOSEST(n, d) \ - ((((n) < 0) ^ ((d) < 0)) ? ((n) - ((d) / 2)) / (d) : \ - ((n) + ((d) / 2)) / (d)) +#define DIV_ROUND_CLOSEST(n, d) \ + (((((__typeof__(n))-1) < 0) && (((__typeof__(d))-1) < 0) && ((n) < 0) ^ ((d) < 0)) \ + ? ((n) - ((d) / 2)) / (d) \ + : ((n) + ((d) / 2)) / (d)) #ifndef MAX /** From ccb65ab62c60f16f6975f1d5d8ce56d0da9db011 Mon Sep 17 00:00:00 2001 From: Francois Ramu Date: Mon, 18 Nov 2024 15:03:30 +0100 Subject: [PATCH 0051/4042] include: bindings: high speed clock for the stm32F1/F4 series The stm32F4 serie has HSI and HSE clock possible clock sources The stm32F1 also has an external HSE possible clock source Signed-off-by: Francois Ramu --- include/zephyr/dt-bindings/clock/stm32f10x_clock.h | 1 - include/zephyr/dt-bindings/clock/stm32f1_clock.h | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/zephyr/dt-bindings/clock/stm32f10x_clock.h b/include/zephyr/dt-bindings/clock/stm32f10x_clock.h index 3570327cb9f08..05f2b598a0552 100644 --- a/include/zephyr/dt-bindings/clock/stm32f10x_clock.h +++ b/include/zephyr/dt-bindings/clock/stm32f10x_clock.h @@ -16,7 +16,6 @@ /* Common clocks with stm32f1x defined in stm32f1_clock.h */ #define STM32_SRC_PLL2CLK (STM32_SRC_PLLCLK + 1) #define STM32_SRC_PLL3CLK (STM32_SRC_PLL2CLK + 1) -#define STM32_SRC_EXT_HSE (STM32_SRC_PLL3CLK + 1) /** CFGR1 devices */ #undef MCO1_SEL /* Need to redefine generic F1 MCO_SEL for connectivity line devices. */ diff --git a/include/zephyr/dt-bindings/clock/stm32f1_clock.h b/include/zephyr/dt-bindings/clock/stm32f1_clock.h index a7e16ba2f7970..f6777932c77b1 100644 --- a/include/zephyr/dt-bindings/clock/stm32f1_clock.h +++ b/include/zephyr/dt-bindings/clock/stm32f1_clock.h @@ -25,7 +25,8 @@ /* Low speed clocks defined in stm32_common_clocks.h */ #define STM32_SRC_HSI (STM32_SRC_LSI + 1) #define STM32_SRC_HSE (STM32_SRC_HSI + 1) -#define STM32_SRC_PLLCLK (STM32_SRC_HSE + 1) +#define STM32_SRC_EXT_HSE (STM32_SRC_HSE + 1) +#define STM32_SRC_PLLCLK (STM32_SRC_EXT_HSE + 1) #define STM32_CLOCK_REG_MASK 0xFFU #define STM32_CLOCK_REG_SHIFT 0U From 911f138e7b809ec4d235c65bb438a70cfff6f53f Mon Sep 17 00:00:00 2001 From: Francois Ramu Date: Fri, 15 Nov 2024 15:46:42 +0100 Subject: [PATCH 0052/4042] dts: arm: stm32f411 compatible for PLL I2S The stm32f411 and stm32f412 and stm32f446 have a PLLI2S with a div M in front of the PLLI2S input. Signed-off-by: Francois Ramu --- dts/arm/st/f4/stm32f411.dtsi | 8 ++++++++ dts/arm/st/f4/stm32f412.dtsi | 2 +- dts/arm/st/f4/stm32f446.dtsi | 2 +- ...2-plli2s-clock.yaml => st,stm32f411-plli2s-clock.yaml} | 4 ++-- 4 files changed, 12 insertions(+), 4 deletions(-) rename dts/bindings/clock/{st,stm32f412-plli2s-clock.yaml => st,stm32f411-plli2s-clock.yaml} (87%) diff --git a/dts/arm/st/f4/stm32f411.dtsi b/dts/arm/st/f4/stm32f411.dtsi index 846b5d6b74eb2..8b1cec9089374 100644 --- a/dts/arm/st/f4/stm32f411.dtsi +++ b/dts/arm/st/f4/stm32f411.dtsi @@ -7,6 +7,14 @@ #include / { + clocks { + plli2s: plli2s { + #clock-cells = <0>; + compatible = "st,stm32f411-plli2s-clock"; + status = "disabled"; + }; + }; + soc { compatible = "st,stm32f411", "st,stm32f4", "simple-bus"; diff --git a/dts/arm/st/f4/stm32f412.dtsi b/dts/arm/st/f4/stm32f412.dtsi index d250d167259d8..201d4005bb409 100644 --- a/dts/arm/st/f4/stm32f412.dtsi +++ b/dts/arm/st/f4/stm32f412.dtsi @@ -13,7 +13,7 @@ clocks { plli2s: plli2s { #clock-cells = <0>; - compatible = "st,stm32f412-plli2s-clock"; + compatible = "st,stm32f411-plli2s-clock"; status = "disabled"; }; }; diff --git a/dts/arm/st/f4/stm32f446.dtsi b/dts/arm/st/f4/stm32f446.dtsi index 4aea609df1fcb..0c8612e780729 100644 --- a/dts/arm/st/f4/stm32f446.dtsi +++ b/dts/arm/st/f4/stm32f446.dtsi @@ -11,7 +11,7 @@ / { clocks { plli2s: plli2s { - compatible = "st,stm32f412-plli2s-clock"; + compatible = "st,stm32f411-plli2s-clock"; }; }; diff --git a/dts/bindings/clock/st,stm32f412-plli2s-clock.yaml b/dts/bindings/clock/st,stm32f411-plli2s-clock.yaml similarity index 87% rename from dts/bindings/clock/st,stm32f412-plli2s-clock.yaml rename to dts/bindings/clock/st,stm32f411-plli2s-clock.yaml index fbe6c78682c27..d2650031b10ff 100644 --- a/dts/bindings/clock/st,stm32f412-plli2s-clock.yaml +++ b/dts/bindings/clock/st,stm32f411-plli2s-clock.yaml @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 description: | - STM32F412 PLL I2S node binding: + STM32F411 PLL I2S node binding: Fully configurable I2S dedicated PLL. @@ -13,7 +13,7 @@ description: | with f(VCO clock) = f(PLL I2S clock input) × (PLLI2S N / PLLI2S M) -compatible: "st,stm32f412-plli2s-clock" +compatible: "st,stm32f411-plli2s-clock" include: st,stm32f4-plli2s-clock.yaml From 757e5b3d9a0cebbf505034239c96e38407fc9115 Mon Sep 17 00:00:00 2001 From: Francois Ramu Date: Mon, 25 Nov 2024 11:38:28 +0100 Subject: [PATCH 0053/4042] drivers: clock control: stm32 pll clock config for I2S The stm32F41x have a PLLI2S M divider for their PLL I2S but others like the stm32F401 or stm32F74x have the PLL M divider from the main PLL : might affect the sysclock. LL Function is the same for configuring the PLL I2S but parameter could depends on the stm32 serie. Signed-off-by: Francois Ramu --- drivers/clock_control/clock_stm32_ll_common.h | 6 ++++++ drivers/clock_control/clock_stm32f2_f4_f7.c | 7 ------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/clock_control/clock_stm32_ll_common.h b/drivers/clock_control/clock_stm32_ll_common.h index e13fb34c2d3e1..d02e1a65055fa 100644 --- a/drivers/clock_control/clock_stm32_ll_common.h +++ b/drivers/clock_control/clock_stm32_ll_common.h @@ -27,7 +27,13 @@ #define z_pllr(v) LL_RCC_PLLR_DIV_ ## v #define pllr(v) z_pllr(v) +#if defined(RCC_PLLI2SCFGR_PLLI2SM) +/* Some stm32F4 devices have a dedicated PLL I2S with M divider */ #define z_plli2s_m(v) LL_RCC_PLLI2SM_DIV_ ## v +#else +/* Some stm32F4 devices (typ. stm32F401) have a dedicated PLL I2S with PLL M divider */ +#define z_plli2s_m(v) LL_RCC_PLLM_DIV_ ## v +#endif /* RCC_PLLI2SCFGR_PLLI2SM */ #define plli2sm(v) z_plli2s_m(v) #define z_plli2s_r(v) LL_RCC_PLLI2SR_DIV_ ## v diff --git a/drivers/clock_control/clock_stm32f2_f4_f7.c b/drivers/clock_control/clock_stm32f2_f4_f7.c index a10fede688704..a8031914f5b0d 100644 --- a/drivers/clock_control/clock_stm32f2_f4_f7.c +++ b/drivers/clock_control/clock_stm32f2_f4_f7.c @@ -104,17 +104,10 @@ void config_pll_sysclock(void) __unused void config_plli2s(void) { -#if DT_HAS_COMPAT_STATUS_OKAY(st_stm32f4_plli2s_clock) LL_RCC_PLLI2S_ConfigDomain_I2S(get_pll_source(), - pllm(STM32_PLLI2S_M_DIVISOR), - STM32_PLLI2S_N_MULTIPLIER, - plli2sr(STM32_PLLI2S_R_DIVISOR)); -#elif DT_HAS_COMPAT_STATUS_OKAY(st_stm32f412_plli2s_clock) - LL_RCC_PLL_ConfigDomain_I2S(get_pll_source(), plli2sm(STM32_PLLI2S_M_DIVISOR), STM32_PLLI2S_N_MULTIPLIER, plli2sr(STM32_PLLI2S_R_DIVISOR)); -#endif } #endif /* STM32_PLLI2S_ENABLED */ From 62996ee14d592dff03bfd5213c4cb389435a1095 Mon Sep 17 00:00:00 2001 From: Francois Ramu Date: Fri, 15 Nov 2024 15:48:07 +0100 Subject: [PATCH 0054/4042] drivers: clock_control: stm32 mco driver get define from DTS Rely on the DTS to get the MCO input source clock and prescaler. DTS configuration has been introduced and Kconfig method deprecated two releases before and can be then safely removed. Signed-off-by: Francois Ramu --- drivers/clock_control/Kconfig.stm32 | 306 +----------------- drivers/clock_control/clock_stm32_ll_common.c | 4 - drivers/clock_control/clock_stm32_ll_h5.c | 4 - drivers/clock_control/clock_stm32_ll_h7.c | 4 - drivers/clock_control/clock_stm32_ll_mco.h | 112 ------- drivers/clock_control/clock_stm32_ll_u5.c | 5 +- 6 files changed, 3 insertions(+), 432 deletions(-) delete mode 100644 drivers/clock_control/clock_stm32_ll_mco.h diff --git a/drivers/clock_control/Kconfig.stm32 b/drivers/clock_control/Kconfig.stm32 index e5c652b04092e..47a1b790a7b0d 100644 --- a/drivers/clock_control/Kconfig.stm32 +++ b/drivers/clock_control/Kconfig.stm32 @@ -97,310 +97,8 @@ config CLOCK_STM32_MCO bool default y depends on DT_HAS_ST_STM32_CLOCK_MCO_ENABLED || DT_HAS_ST_STM32F1_CLOCK_MCO_ENABLED - # Although deprecated, MCO configuration via Kconfig takes priority over Device Tree. - # Prevent DT-based MCO driver from compiling when Kconfig is used. - depends on CLOCK_STM32_MCO1_SRC_NOCLOCK && CLOCK_STM32_MCO2_SRC_NOCLOCK - -choice - prompt "STM32 MCO1 Clock Source" - default CLOCK_STM32_MCO1_SRC_NOCLOCK - -config CLOCK_STM32_MCO1_SRC_NOCLOCK - bool "NOCLOCK" - help - MCO1 output disabled, no clock on MCO1 - -config CLOCK_STM32_MCO1_SRC_EXT_HSE - bool "EXT_HSE" - depends on SOC_STM32F10X_CONNECTIVITY_LINE_DEVICE - select DEPRECATED - help - Use EXT_HSE as source of MCO1 - This option is deprecated, please use devicetree instead. - -config CLOCK_STM32_MCO1_SRC_LSE - bool "LSE" - depends on SOC_SERIES_STM32F4X || \ - SOC_SERIES_STM32F7X || \ - SOC_SERIES_STM32L4X || \ - SOC_SERIES_STM32H7X || \ - SOC_SERIES_STM32H7RSX || \ - SOC_SERIES_STM32H5X || \ - SOC_SERIES_STM32U5X - select DEPRECATED - help - Use LSE as source of MCO1 - This option is deprecated, please use devicetree instead. - -config CLOCK_STM32_MCO1_SRC_HSE - bool "HSE" - depends on SOC_SERIES_STM32F1X || \ - SOC_SERIES_STM32F4X || \ - SOC_SERIES_STM32F7X || \ - SOC_SERIES_STM32L4X || \ - SOC_SERIES_STM32H7X || \ - SOC_SERIES_STM32H7RSX || \ - SOC_SERIES_STM32H5X || \ - SOC_SERIES_STM32U5X - select DEPRECATED - help - Use HSE as source of MCO1 - This option is deprecated, please use devicetree instead. - -config CLOCK_STM32_MCO1_SRC_LSI - bool "LSI" - depends on SOC_SERIES_STM32L4X || \ - SOC_SERIES_STM32U5X - select DEPRECATED - help - Use LSI as source of MCO1 - This option is deprecated, please use devicetree instead. - -config CLOCK_STM32_MCO1_SRC_MSI - bool "MSI" - depends on SOC_SERIES_STM32L4X - select DEPRECATED - help - Use MSI as source of MCO1 - This option is deprecated, please use devicetree instead. - -config CLOCK_STM32_MCO1_SRC_MSIK - bool "MSIK" - depends on SOC_SERIES_STM32U5X - select DEPRECATED - help - Use MSIK as source of MCO1 - This option is deprecated, please use devicetree instead. - -config CLOCK_STM32_MCO1_SRC_MSIS - bool "MSIS" - depends on SOC_SERIES_STM32U5X - select DEPRECATED - help - Use MSIS as source of MCO1 - This option is deprecated, please use devicetree instead. - -config CLOCK_STM32_MCO1_SRC_HSI - bool "HSI" - depends on SOC_SERIES_STM32F1X || \ - SOC_SERIES_STM32F4X || \ - SOC_SERIES_STM32F7X || \ - SOC_SERIES_STM32H7X || \ - SOC_SERIES_STM32H7RSX || \ - SOC_SERIES_STM32H5X - select DEPRECATED - help - Use HSI as source of MCO1 - This option is deprecated, please use devicetree instead. - -config CLOCK_STM32_MCO1_SRC_HSI16 - bool "HSI16" - depends on SOC_SERIES_STM32L4X || \ - SOC_SERIES_STM32U5X - select DEPRECATED - help - Use HSI16 as source of MCO1 - This option is deprecated, please use devicetree instead. - -config CLOCK_STM32_MCO1_SRC_HSI48 - bool "HSI48" - depends on SOC_SERIES_STM32L4X || \ - SOC_SERIES_STM32H7X || \ - SOC_SERIES_STM32H7RSX || \ - SOC_SERIES_STM32H5X || \ - SOC_SERIES_STM32U5X - select DEPRECATED - help - Use HSI48 as source of MCO1 - This option is deprecated, please use devicetree instead. - -config CLOCK_STM32_MCO1_SRC_PLLCLK - bool "PLLCLK" - depends on SOC_SERIES_STM32F4X || \ - SOC_SERIES_STM32F7X || \ - SOC_SERIES_STM32L4X || \ - SOC_SERIES_STM32U5X - select DEPRECATED - help - Use PLLCLK as source of MCO1 - This option is deprecated, please use devicetree instead. - -config CLOCK_STM32_MCO1_SRC_PLLQCLK - bool "PLLQ" - depends on SOC_SERIES_STM32H7X || \ - SOC_SERIES_STM32H7RSX || \ - SOC_SERIES_STM32H5X - select DEPRECATED - help - Use PLLQ as source of MCO1 - This option is deprecated, please use devicetree instead. - -config CLOCK_STM32_MCO1_SRC_PLLCLK_DIV2 - bool "PLLCLK_DIV2" - depends on SOC_SERIES_STM32F1X - select DEPRECATED - help - Use PLLCLK/2 as source of MCO1 - This option is deprecated, please use devicetree instead. - -config CLOCK_STM32_MCO1_SRC_PLL2CLK - bool "PLL2CLK" - depends on SOC_STM32F10X_CONNECTIVITY_LINE_DEVICE - select DEPRECATED - help - Use PLL2CLK as source of MCO1 - This option is deprecated, please use devicetree instead. - -config CLOCK_STM32_MCO1_SRC_PLLI2SCLK - bool "PLLI2SCLK" - depends on SOC_STM32F10X_CONNECTIVITY_LINE_DEVICE - select DEPRECATED - help - Use PLLI2SCLK as source of MCO1 - This option is deprecated, please use devicetree instead. - -config CLOCK_STM32_MCO1_SRC_PLLI2SCLK_DIV2 - bool "PLLI2SCLK_DIV2" - depends on SOC_STM32F10X_CONNECTIVITY_LINE_DEVICE - select DEPRECATED - help - Use PLLI2SCLK/2 as source of MCO1 - This option is deprecated, please use devicetree instead. - -config CLOCK_STM32_MCO1_SRC_SYSCLK - bool "SYSCLK" - depends on SOC_SERIES_STM32F1X || \ - SOC_SERIES_STM32L4X || \ - SOC_SERIES_STM32U5X - select DEPRECATED - help - Use SYSCLK as source of MCO1 - This option is deprecated, please use devicetree instead. - -endchoice - -config CLOCK_STM32_MCO1_DIV - int "MCO1 prescaler" - depends on !CLOCK_STM32_MCO1_SRC_NOCLOCK && (\ - SOC_SERIES_STM32F4X || \ - SOC_SERIES_STM32F7X || \ - SOC_SERIES_STM32L4X || \ - SOC_SERIES_STM32H7X || \ - SOC_SERIES_STM32H7RSX || \ - SOC_SERIES_STM32H5X || \ - SOC_SERIES_STM32U5X \ - ) - default 1 - range 1 5 if SOC_SERIES_STM32F4X || SOC_SERIES_STM32F7X - range 1 15 if SOC_SERIES_STM32H7X || SOC_SERIES_STM32H7RSX || SOC_SERIES_STM32H5X - range 1 16 if SOC_SERIES_STM32L4X || SOC_SERIES_STM32U5X - help - Prescaler for MCO1 output clock - This option is deprecated, please use devicetree instead. - -choice - prompt "STM32 MCO2 Clock Source" - default CLOCK_STM32_MCO2_SRC_NOCLOCK - -config CLOCK_STM32_MCO2_SRC_NOCLOCK - bool "NOCLOCK" - help - MCO2 output disabled, no clock on MCO2 - -config CLOCK_STM32_MCO2_SRC_SYSCLK - bool "SYSCLK" - depends on SOC_SERIES_STM32F4X || \ - SOC_SERIES_STM32F7X || \ - SOC_SERIES_STM32H7X || \ - SOC_SERIES_STM32H7RSX || \ - SOC_SERIES_STM32H5X - select DEPRECATED - help - Use SYSCLK as source of MCO2 - This option is deprecated, please use devicetree instead. - -config CLOCK_STM32_MCO2_SRC_PLLI2S - bool "PLLI2S" - depends on SOC_SERIES_STM32F4X || SOC_SERIES_STM32F7X - select DEPRECATED - help - Use PLLI2S as source of MCO2 - This option is deprecated, please use devicetree instead. - -config CLOCK_STM32_MCO2_SRC_HSE - bool "HSE" - depends on SOC_SERIES_STM32F4X || \ - SOC_SERIES_STM32F7X || \ - SOC_SERIES_STM32H7X || \ - SOC_SERIES_STM32H7RSX || \ - SOC_SERIES_STM32H5X - select DEPRECATED - help - Use HSE as source of MCO2 - This option is deprecated, please use devicetree instead. - -config CLOCK_STM32_MCO2_SRC_LSI - bool "LSI" - depends on SOC_SERIES_STM32H7X || \ - SOC_SERIES_STM32H7RSX || \ - SOC_SERIES_STM32H5X - help - Use LSI as source of MCO2 - This option is deprecated, please use devicetree instead. - -config CLOCK_STM32_MCO2_SRC_CSI - bool "CSI" - depends on SOC_SERIES_STM32H7X || \ - SOC_SERIES_STM32H7RSX || \ - SOC_SERIES_STM32H5X - select DEPRECATED - help - Use CSI as source of MCO2 - This option is deprecated, please use devicetree instead. - -config CLOCK_STM32_MCO2_SRC_PLLCLK - bool "PLLCLK" - depends on SOC_SERIES_STM32F4X || SOC_SERIES_STM32F7X - select DEPRECATED - help - Use PLLCLK as source of MCO2 - This option is deprecated, please use devicetree instead. - -config CLOCK_STM32_MCO2_SRC_PLLPCLK - bool "PLLPCLK" - depends on SOC_SERIES_STM32H7X || \ - SOC_SERIES_STM32H7RSX || \ - SOC_SERIES_STM32H5X - select DEPRECATED - help - Use PLLPCLK as source of MC02 - This option is deprecated, please use devicetree instead. - -config CLOCK_STM32_MCO2_SRC_PLL2PCLK - bool "PLL2PCLK" - depends on SOC_SERIES_STM32H7X || \ - SOC_SERIES_STM32H7RSX || \ - SOC_SERIES_STM32H5X - select DEPRECATED - help - Use PLL2PCLK as source of MC02 - This option is deprecated, please use devicetree instead. - -endchoice - -config CLOCK_STM32_MCO2_DIV - int "MCO2 prescaler" - depends on !CLOCK_STM32_MCO2_SRC_NOCLOCK && (\ - SOC_SERIES_STM32F4X || \ - SOC_SERIES_STM32F7X || \ - SOC_SERIES_STM32H5X || \ - SOC_SERIES_STM32H7X || \ - SOC_SERIES_STM32H7RSX \ - ) - default 1 - range 1 5 if SOC_SERIES_STM32F4X || SOC_SERIES_STM32F7X - range 1 15 if SOC_SERIES_STM32H7X || SOC_SERIES_STM32H7RSX || SOC_SERIES_STM32H5X help - Prescaler for MCO2 output clock + Allows to output various different clock sources onto the MCO pin + using a configurable prescaler. endif # CLOCK_CONTROL_STM32_CUBE diff --git a/drivers/clock_control/clock_stm32_ll_common.c b/drivers/clock_control/clock_stm32_ll_common.c index adc451d7e8c51..223250128ea74 100644 --- a/drivers/clock_control/clock_stm32_ll_common.c +++ b/drivers/clock_control/clock_stm32_ll_common.c @@ -17,7 +17,6 @@ #include #include #include "clock_stm32_ll_common.h" -#include "clock_stm32_ll_mco.h" #include "stm32_hsem.h" /* Macros to fill up prescaler values */ @@ -870,9 +869,6 @@ int stm32_clock_control_init(const struct device *dev) LL_RCC_SetADCClockSource(adc34_prescaler(STM32_ADC34_PRESCALER)); #endif - /* configure MCO1/MCO2 based on Kconfig */ - stm32_clock_control_mco_init(); - return 0; } diff --git a/drivers/clock_control/clock_stm32_ll_h5.c b/drivers/clock_control/clock_stm32_ll_h5.c index 221147a0b589e..ed70430084efd 100644 --- a/drivers/clock_control/clock_stm32_ll_h5.c +++ b/drivers/clock_control/clock_stm32_ll_h5.c @@ -18,7 +18,6 @@ #include #include #include -#include "clock_stm32_ll_mco.h" /* Macros to fill up prescaler values */ #define z_hsi_divider(v) LL_RCC_HSI_DIV_ ## v @@ -769,9 +768,6 @@ int stm32_clock_control_init(const struct device *dev) /* Update CMSIS variable */ SystemCoreClock = CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC; - /* configure MCO1/MCO2 based on Kconfig */ - stm32_clock_control_mco_init(); - return 0; } diff --git a/drivers/clock_control/clock_stm32_ll_h7.c b/drivers/clock_control/clock_stm32_ll_h7.c index d24863ee55834..119564d522046 100644 --- a/drivers/clock_control/clock_stm32_ll_h7.c +++ b/drivers/clock_control/clock_stm32_ll_h7.c @@ -16,7 +16,6 @@ #include #include #include -#include "clock_stm32_ll_mco.h" #include "stm32_hsem.h" @@ -1083,9 +1082,6 @@ int stm32_clock_control_init(const struct device *dev) #endif z_stm32_hsem_lock(CFG_HW_RCC_SEMID, HSEM_LOCK_DEFAULT_RETRY); - /* Configure MCO1/MCO2 based on Kconfig */ - stm32_clock_control_mco_init(); - /* Set up individual enabled clocks */ set_up_fixed_clock_sources(); diff --git a/drivers/clock_control/clock_stm32_ll_mco.h b/drivers/clock_control/clock_stm32_ll_mco.h deleted file mode 100644 index 22e2043329bcc..0000000000000 --- a/drivers/clock_control/clock_stm32_ll_mco.h +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (c) 2017-2022 Linaro Limited. - * Copyright (c) 2017 RnDity Sp. z o.o. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef ZEPHYR_DRIVERS_CLOCK_CONTROL_CLOCK_STM32_LL_MCO_H_ -#define ZEPHYR_DRIVERS_CLOCK_CONTROL_CLOCK_STM32_LL_MCO_H_ - -#include - -#if CONFIG_CLOCK_STM32_MCO1_SRC_NOCLOCK - #define MCO1_SOURCE LL_RCC_MCO1SOURCE_NOCLOCK -#elif CONFIG_CLOCK_STM32_MCO1_SRC_EXT_HSE - #define MCO1_SOURCE LL_RCC_MCO1SOURCE_EXT_HSE -#elif CONFIG_CLOCK_STM32_MCO1_SRC_LSE - #define MCO1_SOURCE LL_RCC_MCO1SOURCE_LSE -#elif CONFIG_CLOCK_STM32_MCO1_SRC_HSE - #define MCO1_SOURCE LL_RCC_MCO1SOURCE_HSE -#elif CONFIG_CLOCK_STM32_MCO1_SRC_LSI - #define MCO1_SOURCE LL_RCC_MCO1SOURCE_LSI -#elif CONFIG_CLOCK_STM32_MCO1_SRC_MSI - #define MCO1_SOURCE LL_RCC_MCO1SOURCE_MSI -#elif CONFIG_CLOCK_STM32_MCO1_SRC_MSIK - #define MCO1_SOURCE LL_RCC_MCO1SOURCE_MSIK -#elif CONFIG_CLOCK_STM32_MCO1_SRC_MSIS - #define MCO1_SOURCE LL_RCC_MCO1SOURCE_MSIS -#elif CONFIG_CLOCK_STM32_MCO1_SRC_HSI - #define MCO1_SOURCE LL_RCC_MCO1SOURCE_HSI -#elif CONFIG_CLOCK_STM32_MCO1_SRC_HSI16 - #define MCO1_SOURCE LL_RCC_MCO1SOURCE_HSI -#elif CONFIG_CLOCK_STM32_MCO1_SRC_HSI48 - #define MCO1_SOURCE LL_RCC_MCO1SOURCE_HSI48 -#elif CONFIG_CLOCK_STM32_MCO1_SRC_PLLCLK - #define MCO1_SOURCE LL_RCC_MCO1SOURCE_PLLCLK -#elif CONFIG_CLOCK_STM32_MCO1_SRC_PLLQCLK - #if (CONFIG_SOC_SERIES_STM32G0X || CONFIG_SOC_SERIES_STM32WLX) - #define MCO1_SOURCE LL_RCC_MCO1SOURCE_PLLQCLK - #elif (CONFIG_SOC_SERIES_STM32H5X || \ - CONFIG_SOC_SERIES_STM32H7X || CONFIG_SOC_SERIES_STM32H7RSX) - #define MCO1_SOURCE LL_RCC_MCO1SOURCE_PLL1QCLK - #else - #error "PLLQCLK is not a valid clock source on your SOC" - #endif -#elif CONFIG_CLOCK_STM32_MCO1_SRC_PLLCLK_DIV2 - #define MCO1_SOURCE LL_RCC_MCO1SOURCE_PLLCLK_DIV_2 -#elif CONFIG_CLOCK_STM32_MCO1_SRC_PLL2CLK - #define MCO1_SOURCE LL_RCC_MCO1SOURCE_PLL2CLK -#elif CONFIG_CLOCK_STM32_MCO1_SRC_PLLI2SCLK - #define MCO1_SOURCE LL_RCC_MCO1SOURCE_PLLI2SCLK -#elif CONFIG_CLOCK_STM32_MCO1_SRC_PLLI2SCLK_DIV2 - #define MCO1_SOURCE LL_RCC_MCO1SOURCE_PLLI2SCLK_DIV2 -#elif CONFIG_CLOCK_STM32_MCO1_SRC_SYSCLK - #define MCO1_SOURCE LL_RCC_MCO1SOURCE_SYSCLK -#endif - -#if CONFIG_CLOCK_STM32_MCO2_SRC_SYSCLK - #define MCO2_SOURCE LL_RCC_MCO2SOURCE_SYSCLK -#elif CONFIG_CLOCK_STM32_MCO2_SRC_PLLI2S - #define MCO2_SOURCE LL_RCC_MCO2SOURCE_PLLI2S -#elif CONFIG_CLOCK_STM32_MCO2_SRC_HSE - #define MCO2_SOURCE LL_RCC_MCO2SOURCE_HSE -#elif CONFIG_CLOCK_STM32_MCO2_SRC_LSI - #define MCO2_SOURCE LL_RCC_MCO2SOURCE_LSI -#elif CONFIG_CLOCK_STM32_MCO2_SRC_CSI - #define MCO2_SOURCE LL_RCC_MCO2SOURCE_CSI -#elif CONFIG_CLOCK_STM32_MCO2_SRC_PLLCLK - #define MCO2_SOURCE LL_RCC_MCO2SOURCE_PLLCLK -#elif CONFIG_CLOCK_STM32_MCO2_SRC_PLLPCLK - #define MCO2_SOURCE LL_RCC_MCO2SOURCE_PLL1PCLK -#elif CONFIG_CLOCK_STM32_MCO2_SRC_PLL2PCLK - #define MCO2_SOURCE LL_RCC_MCO2SOURCE_PLL2PCLK -#endif - -#define fn_mco1_prescaler(v) LL_RCC_MCO1_DIV_ ## v -#define mco1_prescaler(v) fn_mco1_prescaler(v) - -#define fn_mco2_prescaler(v) LL_RCC_MCO2_DIV_ ## v -#define mco2_prescaler(v) fn_mco2_prescaler(v) - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * MCO configure doesn't active requested clock source, - * so please make sure the clock source was enabled. - */ -__unused -static inline void stm32_clock_control_mco_init(void) -{ -#ifndef CONFIG_CLOCK_STM32_MCO1_SRC_NOCLOCK -#ifdef CONFIG_SOC_SERIES_STM32F1X - LL_RCC_ConfigMCO(MCO1_SOURCE); -#else - LL_RCC_ConfigMCO(MCO1_SOURCE, - mco1_prescaler(CONFIG_CLOCK_STM32_MCO1_DIV)); -#endif -#endif /* CONFIG_CLOCK_STM32_MCO1_SRC_NOCLOCK */ - -#ifndef CONFIG_CLOCK_STM32_MCO2_SRC_NOCLOCK - LL_RCC_ConfigMCO(MCO2_SOURCE, - mco2_prescaler(CONFIG_CLOCK_STM32_MCO2_DIV)); -#endif /* CONFIG_CLOCK_STM32_MCO2_SRC_NOCLOCK */ -} - -#ifdef __cplusplus -} -#endif - -#endif /* ZEPHYR_DRIVERS_CLOCK_CONTROL_CLOCK_STM32_LL_MCO_H_ */ diff --git a/drivers/clock_control/clock_stm32_ll_u5.c b/drivers/clock_control/clock_stm32_ll_u5.c index 380f88f2da694..2db630c99c917 100644 --- a/drivers/clock_control/clock_stm32_ll_u5.c +++ b/drivers/clock_control/clock_stm32_ll_u5.c @@ -17,7 +17,7 @@ #include #include #include -#include "clock_stm32_ll_mco.h" + /* Macros to fill up prescaler values */ #define z_ahb_prescaler(v) LL_RCC_SYSCLK_DIV_ ## v @@ -904,9 +904,6 @@ int stm32_clock_control_init(const struct device *dev) /* Update CMSIS variable */ SystemCoreClock = CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC; - /* configure MCO1/MCO2 based on Kconfig */ - stm32_clock_control_mco_init(); - return 0; } From fc3a09d2537ab9194f9cb217fa6af74fab91b1ec Mon Sep 17 00:00:00 2001 From: Francois Ramu Date: Fri, 22 Nov 2024 17:55:48 +0100 Subject: [PATCH 0055/4042] include: binding defines division factor for stm32 MCO prescaler Depending on the stm32 serie the MCO1/2 prescaler is a value set in the CFGR register to divide the MCO output clock. Use the same model based on the RefMan for other stm32 series than stm32C0/F4/F7/H5/H7, once the MCO is in the DTS. Signed-off-by: Francois Ramu --- dts/bindings/clock/st,stm32-clock-mco.yaml | 2 +- .../zephyr/dt-bindings/clock/stm32c0_clock.h | 10 ++++++++++ .../zephyr/dt-bindings/clock/stm32f4_clock.h | 7 +++++++ .../zephyr/dt-bindings/clock/stm32f7_clock.h | 8 ++++++++ .../zephyr/dt-bindings/clock/stm32h5_clock.h | 17 +++++++++++++++++ .../zephyr/dt-bindings/clock/stm32h7_clock.h | 17 +++++++++++++++++ .../zephyr/dt-bindings/clock/stm32h7rs_clock.h | 17 +++++++++++++++++ 7 files changed, 77 insertions(+), 1 deletion(-) diff --git a/dts/bindings/clock/st,stm32-clock-mco.yaml b/dts/bindings/clock/st,stm32-clock-mco.yaml index 6e27ebccf7519..a8c16085ca741 100644 --- a/dts/bindings/clock/st,stm32-clock-mco.yaml +++ b/dts/bindings/clock/st,stm32-clock-mco.yaml @@ -15,7 +15,7 @@ description: | Example: &mco1 { clocks = <&rcc STM32_SRC_LSE MCO1_SEL(7)>; - prescaler = ; + prescaler = ; pinctrl-0 = <&rcc_mco_pa8>; pinctrl-names = "default"; status = "okay"; diff --git a/include/zephyr/dt-bindings/clock/stm32c0_clock.h b/include/zephyr/dt-bindings/clock/stm32c0_clock.h index 70438d62b6d5e..9564f4113f231 100644 --- a/include/zephyr/dt-bindings/clock/stm32c0_clock.h +++ b/include/zephyr/dt-bindings/clock/stm32c0_clock.h @@ -81,4 +81,14 @@ #define MCO2_SEL(val) STM32_MCO_CFGR(val, 0x7, 16, CFGR1_REG) #define MCO2_PRE(val) STM32_MCO_CFGR(val, 0x7, 20, CFGR1_REG) +/* MCO prescaler : division factor */ +#define MCO_PRE_DIV_1 0 +#define MCO_PRE_DIV_2 1 +#define MCO_PRE_DIV_4 2 +#define MCO_PRE_DIV_8 3 +#define MCO_PRE_DIV_16 4 +#define MCO_PRE_DIV_32 5 +#define MCO_PRE_DIV_64 6 +#define MCO_PRE_DIV_128 7 + #endif /* ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_STM32C0_CLOCK_H_ */ diff --git a/include/zephyr/dt-bindings/clock/stm32f4_clock.h b/include/zephyr/dt-bindings/clock/stm32f4_clock.h index 18356856ef242..d9ac0ca7e4274 100644 --- a/include/zephyr/dt-bindings/clock/stm32f4_clock.h +++ b/include/zephyr/dt-bindings/clock/stm32f4_clock.h @@ -82,4 +82,11 @@ /** BDCR devices */ #define RTC_SEL(val) STM32_DOMAIN_CLOCK(val, 3, 8, BDCR_REG) +/* MCO prescaler : division factor */ +#define MCO_PRE_DIV_1 0 +#define MCO_PRE_DIV_2 4 +#define MCO_PRE_DIV_3 5 +#define MCO_PRE_DIV_4 6 +#define MCO_PRE_DIV_5 7 + #endif /* ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_STM32F4_CLOCK_H_ */ diff --git a/include/zephyr/dt-bindings/clock/stm32f7_clock.h b/include/zephyr/dt-bindings/clock/stm32f7_clock.h index 11fbd10308a9e..a729aea88f11a 100644 --- a/include/zephyr/dt-bindings/clock/stm32f7_clock.h +++ b/include/zephyr/dt-bindings/clock/stm32f7_clock.h @@ -82,6 +82,14 @@ #define MCO1_PRE(val) STM32_MCO_CFGR(val, 0x7, 24, CFGR_REG) #define MCO2_SEL(val) STM32_MCO_CFGR(val, 0x3, 30, CFGR_REG) #define MCO2_PRE(val) STM32_MCO_CFGR(val, 0x7, 27, CFGR_REG) + +/* MCO prescaler : division factor */ +#define MCO_PRE_DIV_1 0 +#define MCO_PRE_DIV_2 4 +#define MCO_PRE_DIV_3 5 +#define MCO_PRE_DIV_4 6 +#define MCO_PRE_DIV_5 7 + /** BDCR devices */ #define RTC_SEL(val) STM32_DOMAIN_CLOCK(val, 3, 8, BDCR_REG) diff --git a/include/zephyr/dt-bindings/clock/stm32h5_clock.h b/include/zephyr/dt-bindings/clock/stm32h5_clock.h index 0fb5d9166aa39..cbac2d667436a 100644 --- a/include/zephyr/dt-bindings/clock/stm32h5_clock.h +++ b/include/zephyr/dt-bindings/clock/stm32h5_clock.h @@ -156,4 +156,21 @@ #define MCO2_SEL(val) STM32_MCO_CFGR(val, 0x7, 25, CFGR1_REG) #define MCO2_PRE(val) STM32_MCO_CFGR(val, 0xF, 29, CFGR1_REG) +/* MCO prescaler : division factor */ +#define MCO_PRE_DIV_1 1 +#define MCO_PRE_DIV_2 2 +#define MCO_PRE_DIV_3 3 +#define MCO_PRE_DIV_4 4 +#define MCO_PRE_DIV_5 5 +#define MCO_PRE_DIV_6 6 +#define MCO_PRE_DIV_7 7 +#define MCO_PRE_DIV_8 8 +#define MCO_PRE_DIV_9 9 +#define MCO_PRE_DIV_10 10 +#define MCO_PRE_DIV_11 11 +#define MCO_PRE_DIV_12 12 +#define MCO_PRE_DIV_13 13 +#define MCO_PRE_DIV_14 14 +#define MCO_PRE_DIV_15 15 + #endif /* ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_STM32H5_CLOCK_H_ */ diff --git a/include/zephyr/dt-bindings/clock/stm32h7_clock.h b/include/zephyr/dt-bindings/clock/stm32h7_clock.h index b844612edd4cc..92c954cdc86b6 100644 --- a/include/zephyr/dt-bindings/clock/stm32h7_clock.h +++ b/include/zephyr/dt-bindings/clock/stm32h7_clock.h @@ -141,4 +141,21 @@ #define MCO2_SEL(val) STM32_MCO_CFGR(val, 0xF, 29, CFGR_REG) #define MCO2_PRE(val) STM32_MCO_CFGR(val, 0x7, 25, CFGR_REG) +/* MCO prescaler : division factor */ +#define MCO_PRE_DIV_1 1 +#define MCO_PRE_DIV_2 2 +#define MCO_PRE_DIV_3 3 +#define MCO_PRE_DIV_4 4 +#define MCO_PRE_DIV_5 5 +#define MCO_PRE_DIV_6 6 +#define MCO_PRE_DIV_7 7 +#define MCO_PRE_DIV_8 8 +#define MCO_PRE_DIV_9 9 +#define MCO_PRE_DIV_10 10 +#define MCO_PRE_DIV_11 11 +#define MCO_PRE_DIV_12 12 +#define MCO_PRE_DIV_13 13 +#define MCO_PRE_DIV_14 14 +#define MCO_PRE_DIV_15 15 + #endif /* ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_STM32H7_CLOCK_H_ */ diff --git a/include/zephyr/dt-bindings/clock/stm32h7rs_clock.h b/include/zephyr/dt-bindings/clock/stm32h7rs_clock.h index 38f7d1734d31b..e2c1ed81289e5 100644 --- a/include/zephyr/dt-bindings/clock/stm32h7rs_clock.h +++ b/include/zephyr/dt-bindings/clock/stm32h7rs_clock.h @@ -137,4 +137,21 @@ #define MCO2_SEL(val) STM32_MCO_CFGR(val, 0x7, 29, CFGR_REG) #define MCO2_PRE(val) STM32_MCO_CFGR(val, 0xF, 25, CFGR_REG) +/* MCO prescaler : division factor */ +#define MCO_PRE_DIV_1 1 +#define MCO_PRE_DIV_2 2 +#define MCO_PRE_DIV_3 3 +#define MCO_PRE_DIV_4 4 +#define MCO_PRE_DIV_5 5 +#define MCO_PRE_DIV_6 6 +#define MCO_PRE_DIV_7 7 +#define MCO_PRE_DIV_8 8 +#define MCO_PRE_DIV_9 9 +#define MCO_PRE_DIV_10 10 +#define MCO_PRE_DIV_11 11 +#define MCO_PRE_DIV_12 12 +#define MCO_PRE_DIV_13 13 +#define MCO_PRE_DIV_14 14 +#define MCO_PRE_DIV_15 15 + #endif /* ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_STM32H7RS_CLOCK_H_ */ From 5f70e07469624c64451392f125e49c2672040f8a Mon Sep 17 00:00:00 2001 From: Francois Ramu Date: Fri, 15 Nov 2024 15:48:39 +0100 Subject: [PATCH 0056/4042] samples: boards: stm32 mco output control This sample enables and configures the MCO1/2 output for stm32 target boards. MCO_PRE_DIV_n is defined by the stm32XX_clock.h Signed-off-by: Francois Ramu --- samples/boards/st/mco/README.rst | 7 +++++ .../st/mco/boards/nucleo_f411re.overlay | 30 +++++++++++++++++++ .../st/mco/boards/nucleo_f446ze.overlay | 30 +++++++++++++++++++ .../st/mco/boards/nucleo_u5a5zj_q.overlay | 7 +---- .../st/mco/boards/stm32f746g_disco.overlay | 14 ++------- samples/boards/st/mco/sample.yaml | 4 +++ samples/boards/st/mco/src/main.c | 18 +++++++---- 7 files changed, 86 insertions(+), 24 deletions(-) create mode 100644 samples/boards/st/mco/boards/nucleo_f411re.overlay create mode 100644 samples/boards/st/mco/boards/nucleo_f446ze.overlay diff --git a/samples/boards/st/mco/README.rst b/samples/boards/st/mco/README.rst index cb3c1d9e92719..57b1b25d6c0df 100644 --- a/samples/boards/st/mco/README.rst +++ b/samples/boards/st/mco/README.rst @@ -16,6 +16,13 @@ Requirements The SoC should support MCO functionality and use a pin that has the MCO alternate function. To support another board, add a dts overlay file in boards folder. Make sure that the output clock is enabled in dts overlay file. +Depending on the stm32 serie, several clock source and prescaler are possible for each MCOx. +The clock source is set by the DTS among the possible values for each stm32 serie. +The prescaler is set by the DTS, through the property ``prescaler = ;`` + +See :zephyr_file:`dts/bindings/clock/st,stm32-clock-mco.yaml` + +It is required to check the Reference Manual to configure the DTS correctly. Building and Running diff --git a/samples/boards/st/mco/boards/nucleo_f411re.overlay b/samples/boards/st/mco/boards/nucleo_f411re.overlay new file mode 100644 index 0000000000000..3e71e127fd0dc --- /dev/null +++ b/samples/boards/st/mco/boards/nucleo_f411re.overlay @@ -0,0 +1,30 @@ +/* Enable the PLLI2s and set it as clock source for the MCO2 (with prescaler 5) */ + +&plli2s { + div-m = <8>; + mul-n = <100>; + div-r = <2>; + clocks = <&clk_hse>; + status = "okay"; +}; + +/* see RefMan RM0383 */ +&mco1 { + /* Select One of the line below for clock source */ + clocks = <&rcc STM32_SRC_HSI MCO1_SEL(0)>; +/* clocks = <&rcc STM32_SRC_LSE MCO1_SEL(1)>; */ +/* clocks = <&rcc STM32_SRC_HSE MCO1_SEL(2)>; */ +/* clocks = <&rcc STM32_SRC_PLL_P MCO1_SEL(3)>; */ + prescaler = ; + pinctrl-0 = <&rcc_mco_1_pa8>; + pinctrl-names = "default"; + status = "okay"; +}; + +&mco2 { + clocks = <&rcc STM32_SRC_PLLI2S_R MCO2_SEL(1)>; + prescaler = ; + pinctrl-0 = <&rcc_mco_2_pc9>; + pinctrl-names = "default"; + status = "okay"; +}; diff --git a/samples/boards/st/mco/boards/nucleo_f446ze.overlay b/samples/boards/st/mco/boards/nucleo_f446ze.overlay new file mode 100644 index 0000000000000..4a1713ba49daa --- /dev/null +++ b/samples/boards/st/mco/boards/nucleo_f446ze.overlay @@ -0,0 +1,30 @@ +/* Enable the PLLI2s and set it as clock source for the MCO2 (with prescaler 2) : 25MHz */ + +&plli2s { + div-m = <8>; + mul-n = <100>; + div-r = <2>; + clocks = <&clk_hse>; + status = "okay"; +}; + +/* see RefMan RM0390 */ +&mco1 { + /* Select One of the line below for clock source */ +/* clocks = <&rcc STM32_SRC_HSI MCO1_SEL(0)>; */ +/* clocks = <&rcc STM32_SRC_LSE MCO1_SEL(1)>; */ + clocks = <&rcc STM32_SRC_HSE MCO1_SEL(2)>; +/* clocks = <&rcc STM32_SRC_PLL_P MCO1_SEL(3)>;*/ + prescaler = ; + pinctrl-0 = <&rcc_mco_1_pa8>; + pinctrl-names = "default"; + status = "okay"; +}; + +&mco2 { + clocks = <&rcc STM32_SRC_PLLI2S_R MCO2_SEL(1)>; + prescaler = ; + pinctrl-0 = <&rcc_mco_2_pc9>; + pinctrl-names = "default"; + status = "okay"; +}; diff --git a/samples/boards/st/mco/boards/nucleo_u5a5zj_q.overlay b/samples/boards/st/mco/boards/nucleo_u5a5zj_q.overlay index acff74efdc3b9..05510d7b06e7d 100644 --- a/samples/boards/st/mco/boards/nucleo_u5a5zj_q.overlay +++ b/samples/boards/st/mco/boards/nucleo_u5a5zj_q.overlay @@ -8,15 +8,10 @@ */ #define MCO1_SEL_LSE 7 -/* See reference manual (RM0456): - * 0b001: MCO divided by 2 - */ -#define MCO1_PRE_DIV_2 1 - &mco1 { status = "okay"; clocks = <&rcc STM32_SRC_LSE MCO1_SEL(MCO1_SEL_LSE)>; - prescaler = ; + prescaler = ; pinctrl-0 = <&rcc_mco_pa8>; pinctrl-names = "default"; }; diff --git a/samples/boards/st/mco/boards/stm32f746g_disco.overlay b/samples/boards/st/mco/boards/stm32f746g_disco.overlay index a69e0d147b5e4..c480dc9b0f449 100644 --- a/samples/boards/st/mco/boards/stm32f746g_disco.overlay +++ b/samples/boards/st/mco/boards/stm32f746g_disco.overlay @@ -12,15 +12,10 @@ */ #define MCO1_SEL_LSE 1 -/* See reference manual (RM0385): - * 0b100: division by 2 - */ -#define MCO1_PRE_DIV_2 4 - &mco1 { status = "okay"; clocks = <&rcc STM32_SRC_LSE MCO1_SEL(MCO1_SEL_LSE)>; - prescaler = ; + prescaler = ; pinctrl-0 = <&rcc_mco_1_pa8>; /* D10 (CN7) */ pinctrl-names = "default"; }; @@ -30,15 +25,10 @@ */ #define MCO2_SEL_HSE 2 -/* See reference manual (RM0385): - * 0b111: division by 5 - */ -#define MCO2_PRE_DIV_5 7 - &mco2 { status = "okay"; clocks = <&rcc STM32_SRC_HSE MCO2_SEL(MCO2_SEL_HSE)>; - prescaler = ; + prescaler = ; pinctrl-0 = <&rcc_mco_2_pc9>; /* uSD_D1 (CN3 pin 8) */ pinctrl-names = "default"; }; diff --git a/samples/boards/st/mco/sample.yaml b/samples/boards/st/mco/sample.yaml index 1cecb6772eabf..6d052cae771ab 100644 --- a/samples/boards/st/mco/sample.yaml +++ b/samples/boards/st/mco/sample.yaml @@ -3,6 +3,10 @@ sample: tests: sample.board.stm32.mco: platform_allow: + - nucleo_f411re + - nucleo_f446ze + - stm32f746g_disco - nucleo_u5a5zj_q + integration_platforms: - stm32f746g_disco tags: board diff --git a/samples/boards/st/mco/src/main.c b/samples/boards/st/mco/src/main.c index 7e79d1e8cd8dc..92df7ad883662 100644 --- a/samples/boards/st/mco/src/main.c +++ b/samples/boards/st/mco/src/main.c @@ -9,7 +9,6 @@ int main(void) { - const struct device *dev; /* This sample demonstrates MCO usage via Device Tree. * MCO configuration is performed in the Device Tree overlay files. @@ -17,23 +16,30 @@ int main(void) * initialization. This sample checks that all MCOs are ready - if so, * the selected clock should be visible on the chosen GPIO pin. */ - dev = DEVICE_DT_GET(DT_NODELABEL(mco1)); - if (device_is_ready(dev)) { + +#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(mco1)) + const struct device *dev1; + + dev1 = DEVICE_DT_GET(DT_NODELABEL(mco1)); + if (device_is_ready(dev1)) { printk("MCO1 device successfully configured\n"); } else { printk("MCO1 device not ready\n"); return -1; } +#endif /* mco1 */ #if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(mco2)) - dev = DEVICE_DT_GET(DT_NODELABEL(mco2)); - if (device_is_ready(dev)) { + const struct device *dev2; + + dev2 = DEVICE_DT_GET(DT_NODELABEL(mco2)); + if (device_is_ready(dev2)) { printk("MCO2 device successfully configured\n"); } else { printk("MCO2 device not ready\n"); return -1; } -#endif +#endif /* mco2 */ printk("\nDisplayed the status of all MCO devices - end of example.\n"); return 0; From 44a033d866d9af6a2c193408b78718aa31d472ee Mon Sep 17 00:00:00 2001 From: Francois Ramu Date: Tue, 19 Nov 2024 09:27:16 +0100 Subject: [PATCH 0057/4042] doc: Migration guide v4.1: STM32 addition for the MCO STM32 configuration for the MCO clock source and prescaler is done by the DTS and no more by Kconfig (removed). Signed-off-by: Francois Ramu --- doc/releases/migration-guide-4.1.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/releases/migration-guide-4.1.rst b/doc/releases/migration-guide-4.1.rst index a1949f82a1075..7ef6964bc9b28 100644 --- a/doc/releases/migration-guide-4.1.rst +++ b/doc/releases/migration-guide-4.1.rst @@ -24,6 +24,17 @@ Kernel Boards ****** +Devicetree +********** + +STM32 +===== + +* MCO clock source and prescaler are now exclusively configured by the DTS + as it was introduced earlier. + The Kconfig method for configuration is now removed. + + Modules ******* From 06f2b1b9b8045a00b18858bee8e894551290fe29 Mon Sep 17 00:00:00 2001 From: Josuah Demangeon Date: Mon, 21 Oct 2024 14:06:49 +0000 Subject: [PATCH 0058/4042] drivers: video: common: Add utilities to seek frmival/caps structures Introduce a video_get_format_index() utility to help finding a caps entry out of a given format. Introduce several utilities to seek and apply frame intervals. Signed-off-by: Josuah Demangeon --- drivers/video/video_common.c | 81 +++++++++++ include/zephyr/drivers/video.h | 59 +++++++- tests/drivers/video/api/CMakeLists.txt | 7 + tests/drivers/video/api/prj.conf | 5 + tests/drivers/video/api/src/video_common.c | 154 +++++++++++++++++++++ tests/drivers/video/api/testcase.yaml | 9 ++ 6 files changed, 314 insertions(+), 1 deletion(-) create mode 100644 tests/drivers/video/api/CMakeLists.txt create mode 100644 tests/drivers/video/api/prj.conf create mode 100644 tests/drivers/video/api/src/video_common.c create mode 100644 tests/drivers/video/api/testcase.yaml diff --git a/drivers/video/video_common.c b/drivers/video/video_common.c index 6ff4c7b933858..2cd9a6f032d5b 100644 --- a/drivers/video/video_common.c +++ b/drivers/video/video_common.c @@ -1,9 +1,12 @@ /* * Copyright (c) 2019, Linaro Limited + * Copyright (c) 2024, tinyVision.ai Inc. * * SPDX-License-Identifier: Apache-2.0 */ +#include + #include #include @@ -83,3 +86,81 @@ void video_buffer_release(struct video_buffer *vbuf) VIDEO_COMMON_FREE(block->data); } } + +int video_format_caps_index(const struct video_format_cap *fmts, const struct video_format *fmt, + size_t *idx) +{ + for (int i = 0; fmts[i].pixelformat != 0; i++) { + if (fmts[i].pixelformat == fmt->pixelformat && + IN_RANGE(fmt->width, fmts[i].width_min, fmts[i].width_max) && + IN_RANGE(fmt->height, fmts[i].height_min, fmts[i].height_max)) { + *idx = i; + return 0; + } + } + return -ENOENT; +} + +void video_closest_frmival_stepwise(const struct video_frmival_stepwise *stepwise, + const struct video_frmival *desired, + struct video_frmival *match) +{ + uint64_t min = stepwise->min.numerator; + uint64_t max = stepwise->max.numerator; + uint64_t step = stepwise->step.numerator; + uint64_t goal = desired->numerator; + + /* Set a common denominator to all values */ + min *= stepwise->max.denominator * stepwise->step.denominator * desired->denominator; + max *= stepwise->min.denominator * stepwise->step.denominator * desired->denominator; + step *= stepwise->min.denominator * stepwise->max.denominator * desired->denominator; + goal *= stepwise->min.denominator * stepwise->max.denominator * stepwise->step.denominator; + + /* Saturate the desired value to the min/max supported */ + goal = CLAMP(goal, min, max); + + /* Compute a numerator and denominator */ + match->numerator = min + DIV_ROUND_CLOSEST(goal - min, step) * step; + match->denominator = stepwise->min.denominator * stepwise->max.denominator * + stepwise->step.denominator * desired->denominator; +} + +void video_closest_frmival(const struct device *dev, enum video_endpoint_id ep, + struct video_frmival_enum *match) +{ + uint64_t best_diff_nsec = INT32_MAX; + struct video_frmival desired = match->discrete; + struct video_frmival_enum fie = {.format = match->format}; + + __ASSERT(match->type != VIDEO_FRMIVAL_TYPE_STEPWISE, + "cannot find range matching the range, only a value matching the range"); + + while (video_enum_frmival(dev, ep, &fie) == 0) { + struct video_frmival tmp = {0}; + uint64_t diff_nsec = 0, a, b; + + switch (fie.type) { + case VIDEO_FRMIVAL_TYPE_DISCRETE: + tmp = fie.discrete; + break; + case VIDEO_FRMIVAL_TYPE_STEPWISE: + video_closest_frmival_stepwise(&fie.stepwise, &desired, &tmp); + break; + default: + __ASSERT(false, "invalid answer from the queried video device"); + } + + a = video_frmival_nsec(&desired); + b = video_frmival_nsec(&tmp); + diff_nsec = a > b ? a - b : b - a; + if (diff_nsec < best_diff_nsec) { + best_diff_nsec = diff_nsec; + memcpy(&match->discrete, &tmp, sizeof(tmp)); + + /* The video_enum_frmival() function will increment fie.index every time. + * Compensate for it to get the current index, not the next index. + */ + match->index = fie.index - 1; + } + } +} diff --git a/include/zephyr/drivers/video.h b/include/zephyr/drivers/video.h index fb647cac70fb1..19d85f0db0c5a 100644 --- a/include/zephyr/drivers/video.h +++ b/include/zephyr/drivers/video.h @@ -16,7 +16,7 @@ * @brief Video Interface * @defgroup video_interface Video Interface * @since 2.1 - * @version 1.0.0 + * @version 1.1.0 * @ingroup io_interfaces * @{ */ @@ -753,6 +753,63 @@ struct video_buffer *video_buffer_alloc(size_t size); */ void video_buffer_release(struct video_buffer *buf); +/** + * @brief Search for a format that matches in a list of capabilities + * + * @param fmts The format capability list to search. + * @param fmt The format to find in the list. + * @param idx The pointer to a number of the first format that matches. + * + * @return 0 when a format is found. + * @return -ENOENT when no matching format is found. + */ +int video_format_caps_index(const struct video_format_cap *fmts, const struct video_format *fmt, + size_t *idx); + +/** + * @brief Compute the difference between two frame intervals + * + * @param frmival Frame interval to turn into microseconds. + * + * @return The frame interval value in microseconds. + */ +static inline uint64_t video_frmival_nsec(const struct video_frmival *frmival) +{ + return (uint64_t)NSEC_PER_SEC * frmival->numerator / frmival->denominator; +} + +/** + * @brief Find the closest match to a frame interval value within a stepwise frame interval. + * + * @param stepwise The stepwise frame interval range to search + * @param desired The frame interval for which find the closest match + * @param match The resulting frame interval closest to @p desired + */ +void video_closest_frmival_stepwise(const struct video_frmival_stepwise *stepwise, + const struct video_frmival *desired, + struct video_frmival *match); + +/** + * @brief Find the closest match to a frame interval value within a video device. + * + * To compute the closest match, fill @p match with the following fields: + * + * - @c match->format to the @ref video_format of interest. + * - @c match->type to @ref VIDEO_FRMIVAL_TYPE_DISCRETE. + * - @c match->discrete to the desired frame interval. + * + * The result will be loaded into @p match, with the following fields set: + * + * - @c match->discrete to the value of the closest frame interval. + * - @c match->index to the index of the closest frame interval. + * + * @param dev Video device to query. + * @param ep Video endpoint ID to query. + * @param match Frame interval enumerator with the query, and loaded with the result. + */ +void video_closest_frmival(const struct device *dev, enum video_endpoint_id ep, + struct video_frmival_enum *match); + /* fourcc - four-character-code */ #define video_fourcc(a, b, c, d) \ ((uint32_t)(a) | ((uint32_t)(b) << 8) | ((uint32_t)(c) << 16) | ((uint32_t)(d) << 24)) diff --git a/tests/drivers/video/api/CMakeLists.txt b/tests/drivers/video/api/CMakeLists.txt new file mode 100644 index 0000000000000..ff4533fefd2d4 --- /dev/null +++ b/tests/drivers/video/api/CMakeLists.txt @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: Apache-2.0 + +cmake_minimum_required(VERSION 3.20.0) +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(integration) + +target_sources(app PRIVATE src/video_common.c) diff --git a/tests/drivers/video/api/prj.conf b/tests/drivers/video/api/prj.conf new file mode 100644 index 0000000000000..5e2cc7c828bf2 --- /dev/null +++ b/tests/drivers/video/api/prj.conf @@ -0,0 +1,5 @@ +CONFIG_ZTEST=y +CONFIG_VIDEO=y +CONFIG_VIDEO_BUFFER_POOL_SZ_MAX=16384 +CONFIG_VIDEO_BUFFER_POOL_NUM_MAX=1 +CONFIG_VIDEO_LOG_LEVEL_DBG=y diff --git a/tests/drivers/video/api/src/video_common.c b/tests/drivers/video/api/src/video_common.c new file mode 100644 index 0000000000000..4f01ef2d5b599 --- /dev/null +++ b/tests/drivers/video/api/src/video_common.c @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2024 tinyVision.ai Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include + +enum { + RGB565, + YUYV_A, + YUYV_B, +}; + +static const struct video_format_cap fmts[] = { + [RGB565] = {.pixelformat = VIDEO_PIX_FMT_RGB565, + .width_min = 1280, .width_max = 1280, .width_step = 50, + .height_min = 720, .height_max = 720, .height_step = 50}, + [YUYV_A] = {.pixelformat = VIDEO_PIX_FMT_YUYV, + .width_min = 100, .width_max = 1000, .width_step = 50, + .height_min = 100, .height_max = 1000, .height_step = 50}, + [YUYV_B] = {.pixelformat = VIDEO_PIX_FMT_YUYV, + .width_min = 1920, .width_max = 1920, .width_step = 0, + .height_min = 1080, .height_max = 1080, .height_step = 0}, + {0}, +}; + +ZTEST(video_common, test_video_format_caps_index) +{ + struct video_format fmt = {0}; + size_t idx; + int ret; + + fmt.pixelformat = VIDEO_PIX_FMT_YUYV; + + fmt.width = 100; + fmt.height = 100; + fmt.pitch = 100 * 2; + ret = video_format_caps_index(fmts, &fmt, &idx); + zassert_ok(ret, "expecting minimum value to match"); + zassert_equal(idx, YUYV_A); + + fmt.width = 1000; + fmt.height = 1000; + fmt.pitch = 1000 * 2; + ret = video_format_caps_index(fmts, &fmt, &idx); + zassert_ok(ret, "expecting maximum value to match"); + zassert_equal(idx, YUYV_A); + + fmt.width = 1920; + fmt.height = 1080; + fmt.pitch = 1920 * 2; + ret = video_format_caps_index(fmts, &fmt, &idx); + zassert_ok(ret, "expecting exact match to work"); + zassert_equal(idx, YUYV_B); + + fmt.width = 1001; + fmt.height = 1000; + fmt.pitch = 1001 * 2; + ret = video_format_caps_index(fmts, &fmt, &idx); + zassert_not_ok(ret, "expecting 1 above maximum width to mismatch"); + + fmt.width = 1000; + fmt.height = 1001; + fmt.pitch = 1000 * 2; + ret = video_format_caps_index(fmts, &fmt, &idx); + zassert_not_ok(ret, "expecting 1 above maximum height to mismatch"); + + fmt.width = 1280; + fmt.height = 720; + fmt.pitch = 1280 * 2; + ret = video_format_caps_index(fmts, &fmt, &idx); + zassert_not_ok(ret); + zassert_not_ok(ret, "expecting wrong format to mismatch"); + + fmt.pixelformat = VIDEO_PIX_FMT_RGB565; + + fmt.width = 1000; + fmt.height = 1000; + fmt.pitch = 1000 * 2; + ret = video_format_caps_index(fmts, &fmt, &idx); + zassert_not_ok(ret, "expecting wrong format to mismatch"); + + fmt.width = 1280; + fmt.height = 720; + fmt.pitch = 1280 * 2; + ret = video_format_caps_index(fmts, &fmt, &idx); + zassert_ok(ret, "expecting exact match to work"); + zassert_equal(idx, RGB565); +} + +ZTEST(video_common, test_video_frmival_nsec) +{ + zassert_equal( + video_frmival_nsec(&(struct video_frmival){.numerator = 1, .denominator = 15}), + 66666666); + + zassert_equal( + video_frmival_nsec(&(struct video_frmival){.numerator = 1, .denominator = 30}), + 33333333); + + zassert_equal( + video_frmival_nsec(&(struct video_frmival){.numerator = 5, .denominator = 1}), + 5000000000); + + zassert_equal( + video_frmival_nsec(&(struct video_frmival){.numerator = 1, .denominator = 1750000}), + 571); +} + +ZTEST(video_common, test_video_closest_frmival_stepwise) +{ + struct video_frmival_stepwise stepwise; + struct video_frmival desired; + struct video_frmival expected; + struct video_frmival match; + + stepwise.min.numerator = 1; + stepwise.min.denominator = 30; + stepwise.max.numerator = 30; + stepwise.max.denominator = 30; + stepwise.step.numerator = 1; + stepwise.step.denominator = 30; + + desired.numerator = 1; + desired.denominator = 1; + video_closest_frmival_stepwise(&stepwise, &desired, &match); + zassert_equal(video_frmival_nsec(&match), video_frmival_nsec(&desired), "1 / 1"); + + desired.numerator = 3; + desired.denominator = 30; + video_closest_frmival_stepwise(&stepwise, &desired, &match); + zassert_equal(video_frmival_nsec(&match), video_frmival_nsec(&desired), "3 / 30"); + + desired.numerator = 7; + desired.denominator = 80; + expected.numerator = 3; + expected.denominator = 30; + video_closest_frmival_stepwise(&stepwise, &desired, &match); + zassert_equal(video_frmival_nsec(&match), video_frmival_nsec(&expected), "7 / 80"); + + desired.numerator = 1; + desired.denominator = 120; + video_closest_frmival_stepwise(&stepwise, &desired, &match); + zassert_equal(video_frmival_nsec(&match), video_frmival_nsec(&stepwise.min), "1 / 120"); + + desired.numerator = 100; + desired.denominator = 1; + video_closest_frmival_stepwise(&stepwise, &desired, &match); + zassert_equal(video_frmival_nsec(&match), video_frmival_nsec(&stepwise.max), "100 / 1"); +} + +ZTEST_SUITE(video_common, NULL, NULL, NULL, NULL, NULL); diff --git a/tests/drivers/video/api/testcase.yaml b/tests/drivers/video/api/testcase.yaml new file mode 100644 index 0000000000000..c6005d99760c9 --- /dev/null +++ b/tests/drivers/video/api/testcase.yaml @@ -0,0 +1,9 @@ +# Copyright (c) 2024 tinyVision.ai Inc. +# SPDX-License-Identifier: Apache-2.0 + +tests: + drivers.video.api: + tags: + - drivers + - video + platform_allow: native_sim From 6836ef972ffbbd564f7ae364a4554cf61fa05b41 Mon Sep 17 00:00:00 2001 From: Josuah Demangeon Date: Mon, 21 Oct 2024 13:57:48 +0000 Subject: [PATCH 0059/4042] drivers: video: add emulated Imager driver and RX driver Add a new implementation of a test pattern generator, with the same architecture as real drivers: split receiver core and I2C-controlled sub-device, with changes of video format in "zephyr,emul-imager" leads to different data produced by "zephyr,emul-rx". Signed-off-by: Josuah Demangeon --- drivers/video/CMakeLists.txt | 2 + drivers/video/Kconfig | 4 + drivers/video/Kconfig.emul_imager | 18 + drivers/video/Kconfig.emul_rx | 10 + drivers/video/video_emul_imager.c | 497 ++++++++++++++++++ drivers/video/video_emul_rx.c | 333 ++++++++++++ .../video/zephyr,video-emul-imager.yaml | 12 + dts/bindings/video/zephyr,video-emul-rx.yaml | 18 + tests/drivers/build_all/video/app.overlay | 40 +- tests/drivers/video/api/CMakeLists.txt | 1 + tests/drivers/video/api/app.overlay | 53 ++ tests/drivers/video/api/src/video_emul.c | 189 +++++++ 12 files changed, 1173 insertions(+), 4 deletions(-) create mode 100644 drivers/video/Kconfig.emul_imager create mode 100644 drivers/video/Kconfig.emul_rx create mode 100644 drivers/video/video_emul_imager.c create mode 100644 drivers/video/video_emul_rx.c create mode 100644 dts/bindings/video/zephyr,video-emul-imager.yaml create mode 100644 dts/bindings/video/zephyr,video-emul-rx.yaml create mode 100644 tests/drivers/video/api/app.overlay create mode 100644 tests/drivers/video/api/src/video_emul.c diff --git a/drivers/video/CMakeLists.txt b/drivers/video/CMakeLists.txt index e678071bdeca8..6210f8d881d07 100644 --- a/drivers/video/CMakeLists.txt +++ b/drivers/video/CMakeLists.txt @@ -16,3 +16,5 @@ zephyr_library_sources_ifdef(CONFIG_VIDEO_OV5640 ov5640.c) zephyr_library_sources_ifdef(CONFIG_VIDEO_OV7670 ov7670.c) zephyr_library_sources_ifdef(CONFIG_VIDEO_ESP32 video_esp32_dvp.c) zephyr_library_sources_ifdef(CONFIG_VIDEO_MCUX_SDMA video_mcux_smartdma.c) +zephyr_library_sources_ifdef(CONFIG_VIDEO_EMUL_IMAGER video_emul_imager.c) +zephyr_library_sources_ifdef(CONFIG_VIDEO_EMUL_RX video_emul_rx.c) diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 6ff70bbcfca8d..a3b1634436282 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -74,4 +74,8 @@ source "drivers/video/Kconfig.gc2145" source "drivers/video/Kconfig.mcux_sdma" +source "drivers/video/Kconfig.emul_imager" + +source "drivers/video/Kconfig.emul_rx" + endif # VIDEO diff --git a/drivers/video/Kconfig.emul_imager b/drivers/video/Kconfig.emul_imager new file mode 100644 index 0000000000000..d2752fdd53b47 --- /dev/null +++ b/drivers/video/Kconfig.emul_imager @@ -0,0 +1,18 @@ +# Copyright (c) 2024 tinyVision.ai Inc. +# SPDX-License-Identifier: Apache-2.0 + +config VIDEO_EMUL_IMAGER + bool "Software implementation of an imager" + depends on DT_HAS_ZEPHYR_VIDEO_EMUL_IMAGER_ENABLED + default y + help + Enable driver for the emulated Imager. + +config VIDEO_EMUL_IMAGER_FRAMEBUFFER_SIZE + int "Internal framebuffer size used for link emulation purpose" + default 4096 + help + Configure the size of the internal framebuffer the emulated Imager + driver uses to simulate MIPI transfers. This is the first field of + dev->data, and the emulated video MIPI driver will `memcpy()` it + into the video buffer. diff --git a/drivers/video/Kconfig.emul_rx b/drivers/video/Kconfig.emul_rx new file mode 100644 index 0000000000000..39425d9b136bc --- /dev/null +++ b/drivers/video/Kconfig.emul_rx @@ -0,0 +1,10 @@ +# Copyright (c) 2024 tinyVision.ai Inc. +# SPDX-License-Identifier: Apache-2.0 + +config VIDEO_EMUL_RX + bool "Software implementation of video frame RX core" + depends on DT_HAS_ZEPHYR_VIDEO_EMUL_RX_ENABLED + depends on VIDEO_EMUL_IMAGER + default y + help + Enable driver for the MIPI RX emulated DMA engine. diff --git a/drivers/video/video_emul_imager.c b/drivers/video/video_emul_imager.c new file mode 100644 index 0000000000000..63ce00be8d7cf --- /dev/null +++ b/drivers/video/video_emul_imager.c @@ -0,0 +1,497 @@ +/* + * Copyright (c) 2024 tinyVision.ai Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#define DT_DRV_COMPAT zephyr_video_emul_imager + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +LOG_MODULE_REGISTER(video_emul_imager, CONFIG_VIDEO_LOG_LEVEL); + +#define EMUL_IMAGER_REG_SENSOR_ID 0x0000 +#define EMUL_IMAGER_SENSOR_ID 0x99 +#define EMUL_IMAGER_REG_CTRL 0x0001 +#define EMUL_IMAGER_REG_INIT1 0x0002 +#define EMUL_IMAGER_REG_INIT2 0x0003 +#define EMUL_IMAGER_REG_TIMING1 0x0004 +#define EMUL_IMAGER_REG_TIMING2 0x0005 +#define EMUL_IMAGER_REG_TIMING3 0x0006 +#define EMUL_IMAGER_REG_EXPOSURE 0x0007 +#define EMUL_IMAGER_REG_GAIN 0x0008 +#define EMUL_IMAGER_REG_PATTERN 0x0009 +#define EMUL_IMAGER_PATTERN_OFF 0x00 +#define EMUL_IMAGER_PATTERN_BARS1 0x01 +#define EMUL_IMAGER_PATTERN_BARS2 0x02 + +/* Emulated register bank */ +uint8_t emul_imager_fake_regs[10]; + +enum emul_imager_fmt_id { + RGB565_64x20, + YUYV_64x20, +}; + +struct emul_imager_reg { + uint16_t addr; + uint8_t value; +}; + +struct emul_imager_mode { + uint8_t fps; + /* List of registers lists to configure the various properties of the sensor. + * This permits to deduplicate the list of registers in case some lare sections + * are repeated across modes, such as the resolution for different FPS. + */ + const struct emul_imager_reg *regs[2]; + /* More fields can be added according to the needs of the sensor driver */ +}; + +struct emul_imager_config { + struct i2c_dt_spec i2c; +}; + +struct emul_imager_data { + /* First field is a framebuffer for I/O emulation purpose */ + uint8_t framebuffer[CONFIG_VIDEO_EMUL_IMAGER_FRAMEBUFFER_SIZE]; + /* Other fields are shared with real hardware drivers */ + const struct emul_imager_mode *mode; + enum emul_imager_fmt_id fmt_id; + struct video_format fmt; +}; + +/* Initial parameters of the sensors common to all modes. */ +static const struct emul_imager_reg emul_imager_init_regs[] = { + {EMUL_IMAGER_REG_CTRL, 0x00}, + /* Example comment about REG_INIT1 */ + {EMUL_IMAGER_REG_INIT1, 0x10}, + {EMUL_IMAGER_REG_INIT2, 0x00}, + {0}, +}; + +/* List of registers aggregated together in "modes" that can be applied + * to set the timing parameters and other mode-dependent configuration. + */ + +static const struct emul_imager_reg emul_imager_rgb565_64x20[] = { + {EMUL_IMAGER_REG_TIMING1, 0x64}, + {EMUL_IMAGER_REG_TIMING2, 0x20}, + {0}, +}; +static const struct emul_imager_reg emul_imager_rgb565_64x20_15fps[] = { + {EMUL_IMAGER_REG_TIMING3, 15}, + {0}, +}; +static const struct emul_imager_reg emul_imager_rgb565_64x20_30fps[] = { + {EMUL_IMAGER_REG_TIMING3, 30}, + {0}, +}; +static const struct emul_imager_reg emul_imager_rgb565_64x20_60fps[] = { + {EMUL_IMAGER_REG_TIMING3, 60}, + {0}, +}; +struct emul_imager_mode emul_imager_rgb565_64x20_modes[] = { + {.fps = 15, .regs = {emul_imager_rgb565_64x20, emul_imager_rgb565_64x20_15fps}}, + {.fps = 30, .regs = {emul_imager_rgb565_64x20, emul_imager_rgb565_64x20_30fps}}, + {.fps = 60, .regs = {emul_imager_rgb565_64x20, emul_imager_rgb565_64x20_60fps}}, + {0}, +}; + +static const struct emul_imager_reg emul_imager_yuyv_64x20[] = { + {EMUL_IMAGER_REG_TIMING1, 0x64}, + {EMUL_IMAGER_REG_TIMING2, 0x20}, + {0}, +}; +static const struct emul_imager_reg emul_imager_yuyv_64x20_15fps[] = { + {EMUL_IMAGER_REG_TIMING3, 15}, + {0}, +}; +static const struct emul_imager_reg emul_imager_yuyv_64x20_30fps[] = { + {EMUL_IMAGER_REG_TIMING3, 30}, + {0}, +}; +struct emul_imager_mode emul_imager_yuyv_64x20_modes[] = { + {.fps = 15, .regs = {emul_imager_yuyv_64x20, emul_imager_yuyv_64x20_15fps}}, + {.fps = 30, .regs = {emul_imager_yuyv_64x20, emul_imager_yuyv_64x20_30fps}}, + {0}, +}; + +/* Summary of all the modes of all the frame formats, with the format ID as + * index, matching fmts[]. + */ +static const struct emul_imager_mode *emul_imager_modes[] = { + [RGB565_64x20] = emul_imager_rgb565_64x20_modes, + [YUYV_64x20] = emul_imager_yuyv_64x20_modes, +}; + +/* Video device capabilities where the supported resolutions and pixel formats are listed. + * The format ID is used as index to fetch the matching mode from the list above. + */ +#define EMUL_IMAGER_VIDEO_FORMAT_CAP(width, height, format) \ + { \ + .pixelformat = (format), \ + .width_min = (width), \ + .width_max = (width), \ + .height_min = (height), \ + .height_max = (height), \ + .width_step = 0, \ + .height_step = 0, \ + } +static const struct video_format_cap fmts[] = { + [RGB565_64x20] = EMUL_IMAGER_VIDEO_FORMAT_CAP(64, 20, VIDEO_PIX_FMT_RGB565), + [YUYV_64x20] = EMUL_IMAGER_VIDEO_FORMAT_CAP(64, 20, VIDEO_PIX_FMT_YUYV), + {0}, +}; + +/* Emulated I2C register interface, to replace with actual I2C calls for real hardware */ +static int emul_imager_read_reg(const struct device *const dev, uint8_t reg_addr, uint8_t *value) +{ + LOG_DBG("%s placeholder for I2C read from 0x%02x", dev->name, reg_addr); + switch (reg_addr) { + case EMUL_IMAGER_REG_SENSOR_ID: + *value = EMUL_IMAGER_SENSOR_ID; + break; + default: + *value = emul_imager_fake_regs[reg_addr]; + } + return 0; +} + +/* Helper to read a full integer directly from a register */ +static int emul_imager_read_int(const struct device *const dev, uint8_t reg_addr, int *value) +{ + uint8_t val8; + int ret; + + ret = emul_imager_read_reg(dev, reg_addr, &val8); + *value = val8; + return ret; +} + +/* Some sensors will need reg8 or reg16 variants. */ +static int emul_imager_write_reg(const struct device *const dev, uint8_t reg_addr, uint8_t value) +{ + LOG_DBG("%s placeholder for I2C write 0x%08x to 0x%02x", dev->name, value, reg_addr); + emul_imager_fake_regs[reg_addr] = value; + return 0; +} + +static int emul_imager_write_multi(const struct device *const dev, + const struct emul_imager_reg *regs) +{ + int ret; + + for (int i = 0; regs[i].addr != 0; i++) { + ret = emul_imager_write_reg(dev, regs[i].addr, regs[i].value); + if (ret < 0) { + return ret; + } + } + return 0; +} + +static int emul_imager_set_ctrl(const struct device *dev, unsigned int cid, void *value) +{ + switch (cid) { + case VIDEO_CID_EXPOSURE: + return emul_imager_write_reg(dev, EMUL_IMAGER_REG_EXPOSURE, (int)value); + case VIDEO_CID_GAIN: + return emul_imager_write_reg(dev, EMUL_IMAGER_REG_GAIN, (int)value); + case VIDEO_CID_TEST_PATTERN: + return emul_imager_write_reg(dev, EMUL_IMAGER_REG_PATTERN, (int)value); + default: + return -ENOTSUP; + } +} + +static int emul_imager_get_ctrl(const struct device *dev, unsigned int cid, void *value) +{ + struct emul_imager_data *data = dev->data; + + switch (cid) { + case VIDEO_CID_EXPOSURE: + return emul_imager_read_int(dev, EMUL_IMAGER_REG_EXPOSURE, value); + case VIDEO_CID_GAIN: + return emul_imager_read_int(dev, EMUL_IMAGER_REG_GAIN, value); + case VIDEO_CID_TEST_PATTERN: + return emul_imager_read_int(dev, EMUL_IMAGER_REG_PATTERN, value); + case VIDEO_CID_PIXEL_RATE: + *(int64_t *)value = (int64_t)data->fmt.width * data->fmt.pitch * data->mode->fps; + return 0; + default: + return -ENOTSUP; + } +} + +/* Customize this function according to your "struct emul_imager_mode". */ +static int emul_imager_set_mode(const struct device *dev, const struct emul_imager_mode *mode) +{ + struct emul_imager_data *data = dev->data; + int ret; + + if (data->mode == mode) { + return 0; + } + + LOG_DBG("Applying mode %p at %d FPS", mode, mode->fps); + + /* Apply all the configuration registers for that mode */ + for (int i = 0; i < 2; i++) { + ret = emul_imager_write_multi(dev, mode->regs[i]); + if (ret < 0) { + goto err; + } + } + + data->mode = mode; + return 0; +err: + LOG_ERR("Could not apply %s mode %p (%u FPS)", dev->name, mode, mode->fps); + return ret; +} + +static int emul_imager_set_frmival(const struct device *dev, enum video_endpoint_id ep, + struct video_frmival *frmival) +{ + struct emul_imager_data *data = dev->data; + struct video_frmival_enum fie = {.format = &data->fmt, .discrete = *frmival}; + + if (ep != VIDEO_EP_OUT && ep != VIDEO_EP_ALL) { + return -EINVAL; + } + + video_closest_frmival(dev, ep, &fie); + LOG_DBG("Applying frame interval number %u", fie.index); + return emul_imager_set_mode(dev, &emul_imager_modes[data->fmt_id][fie.index]); +} + +static int emul_imager_get_frmival(const struct device *dev, enum video_endpoint_id ep, + struct video_frmival *frmival) +{ + struct emul_imager_data *data = dev->data; + + if (ep != VIDEO_EP_OUT && ep != VIDEO_EP_ALL) { + return -EINVAL; + } + + frmival->numerator = 1; + frmival->denominator = data->mode->fps; + return 0; +} + +static int emul_imager_enum_frmival(const struct device *dev, enum video_endpoint_id ep, + struct video_frmival_enum *fie) +{ + const struct emul_imager_mode *mode; + size_t fmt_id; + int ret; + + if (ep != VIDEO_EP_OUT && ep != VIDEO_EP_ALL) { + return -EINVAL; + } + + ret = video_format_caps_index(fmts, fie->format, &fmt_id); + if (ret < 0) { + return ret; + } + + mode = &emul_imager_modes[fmt_id][fie->index]; + + fie->type = VIDEO_FRMIVAL_TYPE_DISCRETE; + fie->discrete.numerator = 1; + fie->discrete.denominator = mode->fps; + fie->index++; + + return mode->fps == 0; +} + +/* White, Yellow, Cyan, Green, Magenta, Red, Blue, Black */ +static const uint16_t pattern_8bars_yuv[8][3] = { + {0xFF, 0x7F, 0x7F}, {0xFF, 0x00, 0xFF}, {0xFF, 0xFF, 0x00}, {0x7F, 0x00, 0x00}, + {0x00, 0xFF, 0xFF}, {0x00, 0x00, 0xFF}, {0x00, 0xFF, 0x00}, {0x00, 0x7F, 0x7F}}; +static const uint16_t pattern_8bars_rgb[8][3] = { + {0xFF, 0xFF, 0xFF}, {0xFF, 0xFF, 0x00}, {0x00, 0xFF, 0xFF}, {0x00, 0xFF, 0x00}, + {0xFF, 0x00, 0xFF}, {0xFF, 0x00, 0x00}, {0x00, 0x00, 0xFF}, {0x00, 0x00, 0x00}}; +static void emul_imager_fill_framebuffer(const struct device *const dev, struct video_format *fmt) +{ + struct emul_imager_data *data = dev->data; + uint16_t *fb16 = (uint16_t *)data->framebuffer; + uint16_t r, g, b, y, uv; + + /* Fill the first row of the emulated framebuffer */ + switch (fmt->pixelformat) { + case VIDEO_PIX_FMT_YUYV: + for (size_t i = 0; i < fmt->width; i++) { + y = pattern_8bars_yuv[i * 8 / fmt->width][0]; + uv = pattern_8bars_yuv[i * 8 / fmt->width][1 + i % 2]; + fb16[i] = sys_cpu_to_be16(y << 8 | uv << 0); + } + break; + case VIDEO_PIX_FMT_RGB565: + for (size_t i = 0; i < fmt->width; i++) { + r = pattern_8bars_rgb[i * 8 / fmt->width][0] >> (8 - 5); + g = pattern_8bars_rgb[i * 8 / fmt->width][1] >> (8 - 6); + b = pattern_8bars_rgb[i * 8 / fmt->width][2] >> (8 - 5); + fb16[i] = sys_cpu_to_le16((r << 11) | (g << 6) | (b << 0)); + } + break; + default: + LOG_WRN("Unsupported pixel format %x, supported: %x, %x", fmt->pixelformat, + VIDEO_PIX_FMT_YUYV, VIDEO_PIX_FMT_RGB565); + memset(fb16, 0, fmt->pitch); + } + + /* Duplicate the first row over the whole frame */ + for (size_t i = 1; i < fmt->height; i++) { + memcpy(data->framebuffer + fmt->pitch * i, data->framebuffer, fmt->pitch); + } +} + +static int emul_imager_set_fmt(const struct device *const dev, enum video_endpoint_id ep, + struct video_format *fmt) +{ + struct emul_imager_data *data = dev->data; + size_t fmt_id; + int ret; + + if (ep != VIDEO_EP_OUT && ep != VIDEO_EP_ALL) { + return -EINVAL; + } + + if (fmt->pitch * fmt->height > CONFIG_VIDEO_EMUL_IMAGER_FRAMEBUFFER_SIZE) { + LOG_ERR("%s has %u bytes of memory, unable to support %x %ux%u (%u bytes)", + dev->name, CONFIG_VIDEO_EMUL_IMAGER_FRAMEBUFFER_SIZE, fmt->pixelformat, + fmt->width, fmt->height, fmt->pitch * fmt->height); + return -ENOMEM; + } + + if (memcmp(&data->fmt, fmt, sizeof(data->fmt)) == 0) { + return 0; + } + + ret = video_format_caps_index(fmts, fmt, &fmt_id); + if (ret < 0) { + LOG_ERR("Format %x %ux%u not found for %s", fmt->pixelformat, fmt->width, + fmt->height, dev->name); + return ret; + } + + ret = emul_imager_set_mode(dev, &emul_imager_modes[fmt_id][0]); + if (ret < 0) { + return ret; + } + + /* Change the image pattern on the framebuffer */ + emul_imager_fill_framebuffer(dev, fmt); + + data->fmt_id = fmt_id; + data->fmt = *fmt; + return 0; +} + +static int emul_imager_get_fmt(const struct device *dev, enum video_endpoint_id ep, + struct video_format *fmt) +{ + struct emul_imager_data *data = dev->data; + + if (ep != VIDEO_EP_OUT && ep != VIDEO_EP_ALL) { + return -EINVAL; + } + + *fmt = data->fmt; + return 0; +} + +static int emul_imager_get_caps(const struct device *dev, enum video_endpoint_id ep, + struct video_caps *caps) +{ + if (ep != VIDEO_EP_OUT && ep != VIDEO_EP_ALL) { + return -EINVAL; + } + + caps->format_caps = fmts; + return 0; +} + +static int emul_imager_stream_start(const struct device *dev) +{ + return emul_imager_write_reg(dev, EMUL_IMAGER_REG_CTRL, 1); +} + +static int emul_imager_stream_stop(const struct device *dev) +{ + return emul_imager_write_reg(dev, EMUL_IMAGER_REG_CTRL, 0); +} + +static DEVICE_API(video, emul_imager_driver_api) = { + .set_ctrl = emul_imager_set_ctrl, + .get_ctrl = emul_imager_get_ctrl, + .set_frmival = emul_imager_set_frmival, + .get_frmival = emul_imager_get_frmival, + .enum_frmival = emul_imager_enum_frmival, + .set_format = emul_imager_set_fmt, + .get_format = emul_imager_get_fmt, + .get_caps = emul_imager_get_caps, + .stream_start = emul_imager_stream_start, + .stream_stop = emul_imager_stream_stop, +}; + +int emul_imager_init(const struct device *dev) +{ + struct video_format fmt; + uint8_t sensor_id; + int ret; + + if (/* !i2c_is_ready_dt(&cfg->i2c) */ false) { + /* LOG_ERR("Bus %s is not ready", cfg->i2c.bus->name); */ + return -ENODEV; + } + + ret = emul_imager_read_reg(dev, EMUL_IMAGER_REG_SENSOR_ID, &sensor_id); + if (ret < 0 || sensor_id != EMUL_IMAGER_SENSOR_ID) { + LOG_ERR("Failed to get %s correct sensor ID (0x%x", dev->name, sensor_id); + return ret; + } + + ret = emul_imager_write_multi(dev, emul_imager_init_regs); + if (ret < 0) { + LOG_ERR("Could not set %s initial registers", dev->name); + return ret; + } + + fmt.pixelformat = fmts[0].pixelformat; + fmt.width = fmts[0].width_min; + fmt.height = fmts[0].height_min; + fmt.pitch = fmt.width * 2; + + ret = emul_imager_set_fmt(dev, VIDEO_EP_OUT, &fmt); + if (ret < 0) { + LOG_ERR("Failed to set %s to default format %x %ux%u", dev->name, fmt.pixelformat, + fmt.width, fmt.height); + } + + return 0; +} + +#define EMUL_IMAGER_DEFINE(inst) \ + static struct emul_imager_data emul_imager_data_##inst; \ + \ + static const struct emul_imager_config emul_imager_cfg_##inst = { \ + .i2c = /* I2C_DT_SPEC_INST_GET(inst) */ {0}, \ + }; \ + \ + DEVICE_DT_INST_DEFINE(inst, &emul_imager_init, NULL, &emul_imager_data_##inst, \ + &emul_imager_cfg_##inst, POST_KERNEL, CONFIG_VIDEO_INIT_PRIORITY, \ + &emul_imager_driver_api); + +DT_INST_FOREACH_STATUS_OKAY(EMUL_IMAGER_DEFINE) diff --git a/drivers/video/video_emul_rx.c b/drivers/video/video_emul_rx.c new file mode 100644 index 0000000000000..73ee8a7ff1711 --- /dev/null +++ b/drivers/video/video_emul_rx.c @@ -0,0 +1,333 @@ +/* + * Copyright (c) 2024 tinyVision.ai Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#define DT_DRV_COMPAT zephyr_video_emul_rx + +#include + +#include +#include +#include +#include +#include +#include + +LOG_MODULE_REGISTER(video_emul_rx, CONFIG_VIDEO_LOG_LEVEL); + +struct emul_rx_config { + const struct device *source_dev; +}; + +struct emul_rx_data { + const struct device *dev; + struct video_format fmt; + struct k_work work; + struct k_fifo fifo_in; + struct k_fifo fifo_out; +}; + +static int emul_rx_set_ctrl(const struct device *dev, unsigned int cid, void *value) +{ + const struct emul_rx_config *cfg = dev->config; + + /* Forward all controls to the source */ + return video_set_ctrl(cfg->source_dev, cid, value); +} + +static int emul_rx_get_ctrl(const struct device *dev, unsigned int cid, void *value) +{ + const struct emul_rx_config *cfg = dev->config; + + /* Forward all controls to the source */ + return video_get_ctrl(cfg->source_dev, cid, value); +} + +static int emul_rx_set_frmival(const struct device *dev, enum video_endpoint_id ep, + struct video_frmival *frmival) +{ + const struct emul_rx_config *cfg = dev->config; + + /* Input/output timing is driven by the source */ + if (ep != VIDEO_EP_IN && ep != VIDEO_EP_OUT && ep != VIDEO_EP_ALL) { + return -EINVAL; + } + return video_set_frmival(cfg->source_dev, VIDEO_EP_OUT, frmival); +} + +static int emul_rx_get_frmival(const struct device *dev, enum video_endpoint_id ep, + struct video_frmival *frmival) +{ + const struct emul_rx_config *cfg = dev->config; + + /* Input/output timing is driven by the source */ + if (ep != VIDEO_EP_IN && ep != VIDEO_EP_OUT && ep != VIDEO_EP_ALL) { + return -EINVAL; + } + return video_get_frmival(cfg->source_dev, VIDEO_EP_OUT, frmival); +} + +static int emul_rx_enum_frmival(const struct device *dev, enum video_endpoint_id ep, + struct video_frmival_enum *fie) +{ + const struct emul_rx_config *cfg = dev->config; + + /* Input/output timing is driven by the source */ + if (ep != VIDEO_EP_IN && ep != VIDEO_EP_OUT && ep != VIDEO_EP_ALL) { + return -EINVAL; + } + return video_enum_frmival(cfg->source_dev, VIDEO_EP_OUT, fie); +} + +static int emul_rx_set_fmt(const struct device *const dev, enum video_endpoint_id ep, + struct video_format *fmt) +{ + const struct emul_rx_config *cfg = dev->config; + struct emul_rx_data *data = dev->data; + int ret; + + /* The same format is shared between input and output: data is just passed through */ + if (ep != VIDEO_EP_IN && ep != VIDEO_EP_OUT && ep != VIDEO_EP_ALL) { + return -EINVAL; + } + + /* Propagate the format selection to the source */ + ret = video_set_format(cfg->source_dev, VIDEO_EP_OUT, fmt); + if (ret < 0) { + LOG_DBG("Failed to set %s format to %x %ux%u", cfg->source_dev->name, + fmt->pixelformat, fmt->width, fmt->height); + return -EINVAL; + } + + /* Cache the format selected locally to use it for getting the size of the buffer */ + data->fmt = *fmt; + return 0; +} + +static int emul_rx_get_fmt(const struct device *dev, enum video_endpoint_id ep, + struct video_format *fmt) +{ + struct emul_rx_data *data = dev->data; + + /* Input/output caps are the same as the source: data is just passed through */ + if (ep != VIDEO_EP_IN && ep != VIDEO_EP_OUT && ep != VIDEO_EP_ALL) { + return -EINVAL; + } + *fmt = data->fmt; + return 0; +} + +static int emul_rx_get_caps(const struct device *dev, enum video_endpoint_id ep, + struct video_caps *caps) +{ + const struct emul_rx_config *cfg = dev->config; + + /* Input/output caps are the same as the source: data is just passed through */ + if (ep != VIDEO_EP_IN && ep != VIDEO_EP_OUT && ep != VIDEO_EP_ALL) { + return -EINVAL; + } + return video_get_caps(cfg->source_dev, VIDEO_EP_OUT, caps); +} + +static int emul_rx_stream_start(const struct device *dev) +{ + const struct emul_rx_config *cfg = dev->config; + + /* A real hardware driver would first start its own peripheral */ + return video_stream_start(cfg->source_dev); +} + +static int emul_rx_stream_stop(const struct device *dev) +{ + const struct emul_rx_config *cfg = dev->config; + + return video_stream_stop(cfg->source_dev); + /* A real hardware driver would then stop its own peripheral */ +} + +static void emul_rx_worker(struct k_work *work) +{ + struct emul_rx_data *data = CONTAINER_OF(work, struct emul_rx_data, work); + const struct device *dev = data->dev; + const struct emul_rx_config *cfg = dev->config; + struct video_format *fmt = &data->fmt; + struct video_buffer *vbuf = vbuf; + + LOG_DBG("Queueing a frame of %u bytes in format %x %ux%u", fmt->pitch * fmt->height, + fmt->pixelformat, fmt->width, fmt->height); + + while ((vbuf = k_fifo_get(&data->fifo_in, K_NO_WAIT)) != NULL) { + vbuf->bytesused = fmt->pitch * fmt->height; + vbuf->line_offset = 0; + + LOG_DBG("Inserting %u bytes into buffer %p", vbuf->bytesused, vbuf->buffer); + + /* Simulate the MIPI/DVP hardware transferring image data from the imager to the + * video buffer memory using DMA. The vbuf->size is checked in emul_rx_enqueue(). + */ + memcpy(vbuf->buffer, cfg->source_dev->data, vbuf->bytesused); + + /* Once the buffer is completed, submit it to the video buffer */ + k_fifo_put(&data->fifo_out, vbuf); + } +} + +static int emul_rx_enqueue(const struct device *dev, enum video_endpoint_id ep, + struct video_buffer *vbuf) +{ + struct emul_rx_data *data = dev->data; + struct video_format *fmt = &data->fmt; + + /* Can only enqueue a buffer to get data out, data input is from hardware */ + if (ep != VIDEO_EP_OUT && ep != VIDEO_EP_ALL) { + return -EINVAL; + } + + if (vbuf->size < fmt->pitch * fmt->height) { + LOG_ERR("Buffer too small for a full frame"); + return -ENOMEM; + } + + /* The buffer has not been filled yet: flag as emtpy */ + vbuf->bytesused = 0; + + /* Submit the buffer for processing in the worker, where everything happens */ + k_fifo_put(&data->fifo_in, vbuf); + k_work_submit(&data->work); + + return 0; +} + +static int emul_rx_dequeue(const struct device *dev, enum video_endpoint_id ep, + struct video_buffer **vbufp, k_timeout_t timeout) +{ + struct emul_rx_data *data = dev->data; + + /* Can only dequeue a buffer to get data out, data input is from hardware */ + if (ep != VIDEO_EP_OUT && ep != VIDEO_EP_ALL) { + return -EINVAL; + } + + /* All the processing is expected to happen in the worker */ + *vbufp = k_fifo_get(&data->fifo_out, timeout); + if (*vbufp == NULL) { + return -EAGAIN; + } + + return 0; +} + +static int emul_rx_flush(const struct device *dev, enum video_endpoint_id ep, bool cancel) +{ + struct emul_rx_data *data = dev->data; + struct k_work_sync sync; + + /* Can only flush the buffer going out, data input is from hardware */ + if (ep != VIDEO_EP_OUT && ep != VIDEO_EP_ALL) { + return -EINVAL; + } + + if (cancel) { + struct video_buffer *vbuf; + + /* First, stop the hardware processing */ + emul_rx_stream_stop(dev); + + /* Cancel the jobs that were not running */ + k_work_cancel(&data->work); + + /* Flush the jobs that were still running */ + k_work_flush(&data->work, &sync); + + /* Empty all the cancelled items */ + while ((vbuf = k_fifo_get(&data->fifo_in, K_NO_WAIT))) { + k_fifo_put(&data->fifo_out, vbuf); + } + } else { + /* Process all the remaining items from the queue */ + k_work_flush(&data->work, &sync); + } + + return 0; +} + +static DEVICE_API(video, emul_rx_driver_api) = { + .set_ctrl = emul_rx_set_ctrl, + .get_ctrl = emul_rx_get_ctrl, + .set_frmival = emul_rx_set_frmival, + .get_frmival = emul_rx_get_frmival, + .enum_frmival = emul_rx_enum_frmival, + .set_format = emul_rx_set_fmt, + .get_format = emul_rx_get_fmt, + .get_caps = emul_rx_get_caps, + .stream_start = emul_rx_stream_start, + .stream_stop = emul_rx_stream_stop, + .enqueue = emul_rx_enqueue, + .dequeue = emul_rx_dequeue, + .flush = emul_rx_flush, +}; + +int emul_rx_init(const struct device *dev) +{ + struct emul_rx_data *data = dev->data; + const struct emul_rx_config *cfg = dev->config; + int ret; + + data->dev = dev; + + if (!device_is_ready(cfg->source_dev)) { + LOG_ERR("Source device %s is not ready", cfg->source_dev->name); + return -ENODEV; + } + + ret = video_get_format(cfg->source_dev, VIDEO_EP_OUT, &data->fmt); + if (ret < 0) { + return ret; + } + + k_fifo_init(&data->fifo_in); + k_fifo_init(&data->fifo_out); + k_work_init(&data->work, &emul_rx_worker); + + return 0; +} + +/* See #80649 */ + +/* Handle the variability of "ports{port@0{}};" vs "port{};" while going down */ +#define DT_INST_PORT_BY_ID(inst, pid) \ + COND_CODE_1(DT_NODE_EXISTS(DT_INST_CHILD(inst, ports)), \ + (DT_CHILD(DT_INST_CHILD(inst, ports), port_##pid)), \ + (DT_INST_CHILD(inst, port))) + +/* Handle the variability of "endpoint@0{};" vs "endpoint{};" while going down */ +#define DT_INST_ENDPOINT_BY_ID(inst, pid, eid) \ + COND_CODE_1(DT_NODE_EXISTS(DT_CHILD(DT_INST_PORT_BY_ID(inst, pid), endpoint)), \ + (DT_CHILD(DT_INST_PORT_BY_ID(inst, pid), endpoint)), \ + (DT_CHILD(DT_INST_PORT_BY_ID(inst, pid), endpoint_##eid))) + +/* Handle the variability of "ports{port@0{}};" vs "port{};" while going up */ +#define DT_ENDPOINT_PARENT_DEVICE(node) \ + COND_CODE_1(DT_NODE_EXISTS(DT_CHILD(DT_GPARENT(node), port)), \ + (DT_GPARENT(node)), (DT_PARENT(DT_GPARENT(node)))) + +/* Handle the "remote-endpoint-label" */ +#define DEVICE_DT_GET_REMOTE_DEVICE(node) \ + DEVICE_DT_GET(DT_ENDPOINT_PARENT_DEVICE( \ + DT_NODELABEL(DT_STRING_TOKEN(node, remote_endpoint_label)))) + +#define EMUL_RX_DEFINE(n) \ + static const struct emul_rx_config emul_rx_cfg_##n = { \ + .source_dev = DEVICE_DT_GET_REMOTE_DEVICE(DT_INST_ENDPOINT_BY_ID(n, 0, 0)), \ + }; \ + \ + static struct emul_rx_data emul_rx_data_##n = { \ + .dev = DEVICE_DT_INST_GET(n), \ + }; \ + \ + DEVICE_DT_INST_DEFINE(n, &emul_rx_init, NULL, &emul_rx_data_##n, &emul_rx_cfg_##n, \ + POST_KERNEL, CONFIG_VIDEO_INIT_PRIORITY, &emul_rx_driver_api); + +DT_INST_FOREACH_STATUS_OKAY(EMUL_RX_DEFINE) diff --git a/dts/bindings/video/zephyr,video-emul-imager.yaml b/dts/bindings/video/zephyr,video-emul-imager.yaml new file mode 100644 index 0000000000000..b3d1760eba45e --- /dev/null +++ b/dts/bindings/video/zephyr,video-emul-imager.yaml @@ -0,0 +1,12 @@ +# Copyright 2024 tinyVision.ai Inc. +# SPDX-License-Identifier: Apache-2.0 + +description: Emulated Imager for testing purpose + +compatible: "zephyr,video-emul-imager" + +include: i2c-device.yaml + +child-binding: + child-binding: + include: video-interfaces.yaml diff --git a/dts/bindings/video/zephyr,video-emul-rx.yaml b/dts/bindings/video/zephyr,video-emul-rx.yaml new file mode 100644 index 0000000000000..6db547604a1af --- /dev/null +++ b/dts/bindings/video/zephyr,video-emul-rx.yaml @@ -0,0 +1,18 @@ +# Copyright 2024 tinyVision.ai Inc. +# SPDX-License-Identifier: Apache-2.0 + +description: Emulated Video DMA engine for testing purpose + +compatible: "zephyr,video-emul-rx" + +include: base.yaml + +child-binding: + child-binding: + include: video-interfaces.yaml + properties: + reg: + type: int + enum: + - 0 # for input endpoint + - 1 # for output endpoint diff --git a/tests/drivers/build_all/video/app.overlay b/tests/drivers/build_all/video/app.overlay index e394026c32b01..84678f7ee0699 100644 --- a/tests/drivers/build_all/video/app.overlay +++ b/tests/drivers/build_all/video/app.overlay @@ -15,19 +15,19 @@ #address-cells = <1>; #size-cells = <1>; - test_gpio: gpio@deadbeef { + test_gpio: gpio@10001000 { compatible = "vnd,gpio"; gpio-controller; - reg = <0xdeadbeef 0x1000>; + reg = <0x10001000 0x1000>; #gpio-cells = <0x2>; status = "okay"; }; - test_i2c: i2c@11112222 { + test_i2c: i2c@10002000 { #address-cells = <1>; #size-cells = <0>; compatible = "vnd,i2c"; - reg = <0x11112222 0x1000>; + reg = <0x10002000 0x1000>; status = "okay"; clock-frequency = <100000>; @@ -65,6 +65,38 @@ reg = <0x5>; reset-gpios = <&test_gpio 0 0>; }; + + test_i2c_video_emul_imager: video_emul_imager@6 { + compatible = "zephyr,video-emul-imager"; + reg = <0x6>; + + port { + test_video_emul_imager_ep_out: endpoint { + remote-endpoint-label = "test_video_emul_rx_ep_in"; + }; + }; + }; + + }; + + test_video_emul_rx: video_emul_rx@10003000 { + compatible = "zephyr,video-emul-rx"; + reg = <0x10003000 0x1000>; + + port { + #address-cells = <1>; + #size-cells = <0>; + + test_video_emul_rx_ep_in: endpoint@0 { + reg = <0x0>; + remote-endpoint-label = "test_video_emul_imager_ep_out"; + }; + + test_video_emul_rx_ep_out: endpoint@1 { + reg = <0x1>; + remote-endpoint-label = "application"; + }; + }; }; }; }; diff --git a/tests/drivers/video/api/CMakeLists.txt b/tests/drivers/video/api/CMakeLists.txt index ff4533fefd2d4..b6c94a58d9d9d 100644 --- a/tests/drivers/video/api/CMakeLists.txt +++ b/tests/drivers/video/api/CMakeLists.txt @@ -5,3 +5,4 @@ find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) project(integration) target_sources(app PRIVATE src/video_common.c) +target_sources(app PRIVATE src/video_emul.c) diff --git a/tests/drivers/video/api/app.overlay b/tests/drivers/video/api/app.overlay new file mode 100644 index 0000000000000..3e1e02e6a95a0 --- /dev/null +++ b/tests/drivers/video/api/app.overlay @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2024 tinyVision.ai Inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + test { + #address-cells = <1>; + #size-cells = <1>; + + test_i2c: i2c@10002000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "vnd,i2c"; + reg = <0x10002000 0x1000>; + clock-frequency = <100000>; + status = "okay"; + + test_video_emul_imager: video_emul_imager@6 { + compatible = "zephyr,video-emul-imager"; + status = "okay"; + reg = <0x6>; + + port { + test_video_emul_imager_ep_out: endpoint { + remote-endpoint-label = "test_video_emul_rx_ep_in"; + }; + }; + }; + }; + + test_video_emul_rx: video_emul_rx@10003000 { + compatible = "zephyr,video-emul-rx"; + reg = <0x10003000 0x1000>; + status = "okay"; + + port { + #address-cells = <1>; + #size-cells = <0>; + + test_video_emul_rx_ep_in: endpoint@0 { + reg = <0x0>; + remote-endpoint-label = "test_video_emul_imager_ep_out"; + }; + + test_video_emul_rx_ep_out: endpoint@1 { + reg = <0x1>; + remote-endpoint-label = "application"; + }; + }; + }; + }; +}; diff --git a/tests/drivers/video/api/src/video_emul.c b/tests/drivers/video/api/src/video_emul.c new file mode 100644 index 0000000000000..d7b750dda3251 --- /dev/null +++ b/tests/drivers/video/api/src/video_emul.c @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2024 tinyVision.ai Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include + +const struct device *rx_dev = DEVICE_DT_GET(DT_NODELABEL(test_video_emul_rx)); +const struct device *imager_dev = DEVICE_DT_GET(DT_NODELABEL(test_video_emul_imager)); + +ZTEST(video_common, test_video_device) +{ + zexpect_true(device_is_ready(rx_dev)); + zexpect_true(device_is_ready(imager_dev)); + + zexpect_ok(video_stream_start(imager_dev)); + zexpect_ok(video_stream_stop(imager_dev)); + + zexpect_ok(video_stream_start(rx_dev)); + zexpect_ok(video_stream_stop(rx_dev)); +} + +ZTEST(video_common, test_video_format) +{ + struct video_caps caps = {0}; + struct video_format fmt = {0}; + + zexpect_ok(video_get_caps(imager_dev, VIDEO_EP_OUT, &caps)); + + /* Test all the formats listed in the caps, the min and max values */ + for (size_t i = 0; caps.format_caps[i].pixelformat != 0; i++) { + fmt.pixelformat = caps.format_caps[i].pixelformat; + + fmt.height = caps.format_caps[i].height_min; + fmt.width = caps.format_caps[i].width_min; + zexpect_ok(video_set_format(imager_dev, VIDEO_EP_OUT, &fmt)); + zexpect_ok(video_get_format(imager_dev, VIDEO_EP_OUT, &fmt)); + zexpect_equal(fmt.pixelformat, caps.format_caps[i].pixelformat); + zexpect_equal(fmt.width, caps.format_caps[i].width_min); + zexpect_equal(fmt.height, caps.format_caps[i].height_min); + + fmt.height = caps.format_caps[i].height_max; + fmt.width = caps.format_caps[i].width_min; + zexpect_ok(video_set_format(imager_dev, VIDEO_EP_OUT, &fmt)); + zexpect_ok(video_get_format(imager_dev, VIDEO_EP_OUT, &fmt)); + zexpect_equal(fmt.pixelformat, caps.format_caps[i].pixelformat); + zexpect_equal(fmt.width, caps.format_caps[i].width_max); + zexpect_equal(fmt.height, caps.format_caps[i].height_min); + + fmt.height = caps.format_caps[i].height_min; + fmt.width = caps.format_caps[i].width_max; + zexpect_ok(video_set_format(imager_dev, VIDEO_EP_OUT, &fmt)); + zexpect_ok(video_get_format(imager_dev, VIDEO_EP_OUT, &fmt)); + zexpect_equal(fmt.pixelformat, caps.format_caps[i].pixelformat); + zexpect_equal(fmt.width, caps.format_caps[i].width_min); + zexpect_equal(fmt.height, caps.format_caps[i].height_max); + + fmt.height = caps.format_caps[i].height_max; + fmt.width = caps.format_caps[i].width_max; + zexpect_ok(video_set_format(imager_dev, VIDEO_EP_OUT, &fmt)); + zexpect_ok(video_get_format(imager_dev, VIDEO_EP_OUT, &fmt)); + zexpect_equal(fmt.pixelformat, caps.format_caps[i].pixelformat); + zexpect_equal(fmt.width, caps.format_caps[i].width_max); + zexpect_equal(fmt.height, caps.format_caps[i].height_max); + } + + fmt.pixelformat = 0x00000000; + zexpect_not_ok(video_set_format(imager_dev, VIDEO_EP_OUT, &fmt)); + zexpect_ok(video_get_format(imager_dev, VIDEO_EP_OUT, &fmt)); + zexpect_not_equal(fmt.pixelformat, 0x00000000, "should not store wrong formats"); +} + +ZTEST(video_common, test_video_frmival) +{ + struct video_format fmt; + struct video_frmival_enum fie = {.format = &fmt}; + + /* Pick the current format for testing the frame interval enumeration */ + zexpect_ok(video_get_format(imager_dev, VIDEO_EP_OUT, &fmt)); + + /* Do a first enumeration of frame intervals, expected to work */ + zexpect_ok(video_enum_frmival(imager_dev, VIDEO_EP_OUT, &fie)); + zexpect_equal(fie.index, 1, "fie's index should increment by one at every iteration"); + + /* Test that every value of the frame interval enumerator can be applied */ + do { + struct video_frmival q, a; + uint32_t min, max, step; + + zexpect_equal_ptr(fie.format, &fmt, "the format should not be changed"); + zexpect_true(fie.type == VIDEO_FRMIVAL_TYPE_STEPWISE || + fie.type == VIDEO_FRMIVAL_TYPE_DISCRETE); + + switch (fie.type) { + case VIDEO_FRMIVAL_TYPE_STEPWISE: + /* Get everthing under the same denominator */ + q.denominator = fie.stepwise.min.denominator * + fie.stepwise.max.denominator * + fie.stepwise.step.denominator; + min = fie.stepwise.max.denominator * fie.stepwise.step.denominator * + fie.stepwise.min.numerator; + max = fie.stepwise.min.denominator * fie.stepwise.step.denominator * + fie.stepwise.max.numerator; + step = fie.stepwise.min.denominator * fie.stepwise.max.denominator * + fie.stepwise.step.numerator; + + /* Test every supported frame interval */ + for (q.numerator = min; q.numerator <= max; q.numerator += step) { + zexpect_ok(video_set_frmival(imager_dev, VIDEO_EP_OUT, &q)); + zexpect_ok(video_get_frmival(imager_dev, VIDEO_EP_OUT, &a)); + zexpect_equal(video_frmival_nsec(&q), video_frmival_nsec(&a)); + } + break; + case VIDEO_FRMIVAL_TYPE_DISCRETE: + /* There is just one frame interval to test */ + zexpect_ok(video_set_frmival(imager_dev, VIDEO_EP_OUT, &fie.discrete)); + zexpect_ok(video_get_frmival(imager_dev, VIDEO_EP_OUT, &a)); + + zexpect_equal(video_frmival_nsec(&fie.discrete), video_frmival_nsec(&a)); + break; + } + } while (video_enum_frmival(imager_dev, VIDEO_EP_OUT, &fie) == 0); +} + +ZTEST(video_common, test_video_ctrl) +{ + int value; + + /* Exposure control, expected to be supported by all imagers */ + zexpect_ok(video_set_ctrl(imager_dev, VIDEO_CID_EXPOSURE, (void *)30)); + zexpect_ok(video_get_ctrl(imager_dev, VIDEO_CID_EXPOSURE, &value)); + zexpect_equal(value, 30); + + /* Gain control, expected to be supported by all imagers */ + zexpect_ok(video_set_ctrl(imager_dev, VIDEO_CID_GAIN, (void *)30)); + zexpect_ok(video_get_ctrl(imager_dev, VIDEO_CID_GAIN, &value)); + zexpect_equal(value, 30); +} + +ZTEST(video_common, test_video_vbuf) +{ + struct video_caps caps; + struct video_format fmt; + struct video_buffer *vbuf = NULL; + + /* Get a list of supported format */ + zexpect_ok(video_get_caps(rx_dev, VIDEO_EP_OUT, &caps)); + + /* Pick set first format, just to use something supported */ + fmt.pixelformat = caps.format_caps[0].pixelformat; + fmt.width = caps.format_caps[0].width_max; + fmt.height = caps.format_caps[0].height_max; + fmt.pitch = fmt.width * 2; + zexpect_ok(video_set_format(rx_dev, VIDEO_EP_OUT, &fmt)); + + /* Allocate a buffer, assuming prj.conf gives enough memory for it */ + vbuf = video_buffer_alloc(fmt.pitch * fmt.height); + zexpect_not_null(vbuf); + + /* Start the virtual hardware */ + zexpect_ok(video_stream_start(rx_dev)); + + /* Enqueue a first buffer */ + zexpect_ok(video_enqueue(rx_dev, VIDEO_EP_OUT, vbuf)); + + /* Receive the completed buffer */ + zexpect_ok(video_dequeue(rx_dev, VIDEO_EP_OUT, &vbuf, K_FOREVER)); + zexpect_not_null(vbuf); + zexpect_equal(vbuf->bytesused, vbuf->size); + + /* Enqueue back the same buffer */ + zexpect_ok(video_enqueue(rx_dev, VIDEO_EP_OUT, vbuf)); + + /* Process the remaining buffers */ + zexpect_ok(video_flush(rx_dev, VIDEO_EP_OUT, false)); + + /* Expect the buffer to immediately be available */ + zexpect_ok(video_dequeue(rx_dev, VIDEO_EP_OUT, &vbuf, K_FOREVER)); + zexpect_not_null(vbuf); + zexpect_equal(vbuf->bytesused, vbuf->size); + + /* Nothing left in the queue, possible to stop */ + zexpect_ok(video_stream_stop(rx_dev)); +} + +ZTEST_SUITE(video_emul, NULL, NULL, NULL, NULL, NULL); From 8c730d2edff37dcfd01bbb77c8a645cc5fd5e6c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=BCnther?= Date: Wed, 10 Jul 2024 17:41:33 +0200 Subject: [PATCH 0060/4042] doc: add get_filtered_output method documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add documentation for the get_filtered_output method in both the Python implementation and the Integration with pytest chapter. The method is used to filter command outputs by removing prompts and log messages, making it easier to process shell command results. Signed-off-by: Thomas Günther removed traling whitespace --- doc/develop/test/pytest.rst | 2 + .../src/twister_harness/helpers/shell.py | 49 ++++++++++++++----- 2 files changed, 40 insertions(+), 11 deletions(-) diff --git a/doc/develop/test/pytest.rst b/doc/develop/test/pytest.rst index 9bf95c030989a..88137a6917472 100644 --- a/doc/develop/test/pytest.rst +++ b/doc/develop/test/pytest.rst @@ -219,6 +219,8 @@ Shell .. automethod:: wait_for_prompt + .. automethod:: get_filtered_output + Examples of pytest tests in the Zephyr project ********************************************** diff --git a/scripts/pylib/pytest-twister-harness/src/twister_harness/helpers/shell.py b/scripts/pylib/pytest-twister-harness/src/twister_harness/helpers/shell.py index 7782617538c7c..0960db7743ae8 100644 --- a/scripts/pylib/pytest-twister-harness/src/twister_harness/helpers/shell.py +++ b/scripts/pylib/pytest-twister-harness/src/twister_harness/helpers/shell.py @@ -22,7 +22,9 @@ class Shell: Helper class that provides methods used to interact with shell application. """ - def __init__(self, device: DeviceAdapter, prompt: str = 'uart:~$', timeout: float | None = None) -> None: + def __init__( + self, device: DeviceAdapter, prompt: str = 'uart:~$', timeout: float | None = None + ) -> None: self._device: DeviceAdapter = device self.prompt: str = prompt self.base_timeout: float = timeout or device.base_timeout @@ -48,7 +50,9 @@ def wait_for_prompt(self, timeout: float | None = None) -> bool: return True return False - def exec_command(self, command: str, timeout: float | None = None, print_output: bool = True) -> list[str]: + def exec_command( + self, command: str, timeout: float | None = None, print_output: bool = True + ) -> list[str]: """ Send shell command to a device and return response. Passed command is extended by double enter sings - first one to execute this command @@ -63,20 +67,42 @@ def exec_command(self, command: str, timeout: float | None = None, print_output: self._device.write(command_ext.encode()) lines: list[str] = [] # wait for device command print - it should be done immediately after sending command to device - lines.extend(self._device.readlines_until(regex=regex_command, timeout=1.0, print_output=print_output)) + lines.extend( + self._device.readlines_until( + regex=regex_command, timeout=1.0, print_output=print_output + ) + ) # wait for device command execution - lines.extend(self._device.readlines_until(regex=regex_prompt, timeout=timeout, print_output=print_output)) + lines.extend( + self._device.readlines_until( + regex=regex_prompt, timeout=timeout, print_output=print_output + ) + ) return lines def get_filtered_output(self, command_lines: list[str]) -> list[str]: + """ + Filter out prompts and log messages + + Take the output of exec_command, which can contain log messages and command prompts, + and filter them to obtain only the command output. + + Example: + >>> # equivalent to `lines = shell.exec_command("kernel version")` + >>> lines = [ + >>> 'uart:~$', # filter prompts + >>> 'Zephyr version 3.6.0', # keep this line + >>> 'uart:~$ debug message' # filter log messages + >>> ] + >>> filtered_output = shell.get_filtered_output(output) + >>> filtered_output + ['Zephyr version 3.6.0'] + + :param command_lines: List of strings i.e. the output of `exec_command`. + :return: A list of strings containing, excluding prompts and log messages. + """ regex_filter = re.compile( - '|'.join([ - re.escape(self.prompt), - '', - '', - '', - '' - ]) + '|'.join([re.escape(self.prompt), '', '', '', '']) ) return list(filter(lambda l: not regex_filter.search(l), command_lines)) @@ -106,6 +132,7 @@ class ShellMCUbootCommandParsed: """ Helper class to keep data from `mcuboot` shell command. """ + areas: list[ShellMCUbootArea] = field(default_factory=list) @classmethod From 71a014480737f792b8821c65f8abc7d1672b09c2 Mon Sep 17 00:00:00 2001 From: Gang Li Date: Wed, 4 Dec 2024 05:29:18 +0100 Subject: [PATCH 0061/4042] net: wifi: change the acquisition of wifi interface For WiFi interface, uniformly use net_if_get_wifi_sta() and net_if_get_wifi_sap() APIs to replace net_if_get_first_wifi(). Signed-off-by: Gang Li --- subsys/net/l2/wifi/wifi_shell.c | 70 +++++++++++++++------------------ 1 file changed, 31 insertions(+), 39 deletions(-) diff --git a/subsys/net/l2/wifi/wifi_shell.c b/subsys/net/l2/wifi/wifi_shell.c index 3b4b21da93748..6bd009f96e934 100644 --- a/subsys/net/l2/wifi/wifi_shell.c +++ b/subsys/net/l2/wifi/wifi_shell.c @@ -1056,7 +1056,7 @@ static int wifi_scan_args_to_params(const struct shell *sh, static int cmd_wifi_scan(const struct shell *sh, size_t argc, char *argv[]) { - struct net_if *iface = net_if_get_first_wifi(); + struct net_if *iface = net_if_get_wifi_sta(); struct wifi_scan_params params = { 0 }; bool do_scan = true; int opt_num; @@ -1092,7 +1092,7 @@ static int cmd_wifi_scan(const struct shell *sh, size_t argc, char *argv[]) static int cmd_wifi_status(const struct shell *sh, size_t argc, char *argv[]) { - struct net_if *iface = net_if_get_first_wifi(); + struct net_if *iface = net_if_get_wifi_sta(); struct wifi_iface_status status = { 0 }; context.sh = sh; @@ -1226,7 +1226,7 @@ static int cmd_wifi_stats(const struct shell *sh, size_t argc, char *argv[]) { #if defined(CONFIG_NET_STATISTICS_WIFI) && \ defined(CONFIG_NET_STATISTICS_USER_API) - struct net_if *iface = net_if_get_first_wifi(); + struct net_if *iface = net_if_get_wifi_sta(); struct net_stats_wifi stats = { 0 }; int ret; @@ -1269,7 +1269,7 @@ static int cmd_wifi_stats(const struct shell *sh, size_t argc, char *argv[]) static int cmd_wifi_11k(const struct shell *sh, size_t argc, char *argv[]) { - struct net_if *iface = net_if_get_first_wifi(); + struct net_if *iface = net_if_get_wifi_sta(); struct wifi_11k_params params = { 0 }; context.sh = sh; @@ -1310,7 +1310,7 @@ static int cmd_wifi_11k(const struct shell *sh, size_t argc, char *argv[]) static int cmd_wifi_11k_neighbor_request(const struct shell *sh, size_t argc, char *argv[]) { - struct net_if *iface = net_if_get_first_wifi(); + struct net_if *iface = net_if_get_wifi_sta(); struct wifi_11k_params params = { 0 }; context.sh = sh; @@ -1347,7 +1347,7 @@ static int cmd_wifi_11k_neighbor_request(const struct shell *sh, size_t argc, ch static int cmd_wifi_ps(const struct shell *sh, size_t argc, char *argv[]) { - struct net_if *iface = net_if_get_first_wifi(); + struct net_if *iface = net_if_get_wifi_sta(); struct wifi_ps_params params = { 0 }; context.sh = sh; @@ -1435,7 +1435,7 @@ static int cmd_wifi_ps(const struct shell *sh, size_t argc, char *argv[]) static int cmd_wifi_ps_mode(const struct shell *sh, size_t argc, char *argv[]) { - struct net_if *iface = net_if_get_first_wifi(); + struct net_if *iface = net_if_get_wifi_sta(); struct wifi_ps_params params = { 0 }; context.sh = sh; @@ -1465,7 +1465,7 @@ static int cmd_wifi_ps_mode(const struct shell *sh, size_t argc, char *argv[]) static int cmd_wifi_ps_timeout(const struct shell *sh, size_t argc, char *argv[]) { - struct net_if *iface = net_if_get_first_wifi(); + struct net_if *iface = net_if_get_wifi_sta(); struct wifi_ps_params params = { 0 }; long timeout_ms = 0; int err = 0; @@ -1500,7 +1500,7 @@ static int cmd_wifi_ps_timeout(const struct shell *sh, size_t argc, char *argv[] static int cmd_wifi_twt_setup_quick(const struct shell *sh, size_t argc, char *argv[]) { - struct net_if *iface = net_if_get_first_wifi(); + struct net_if *iface = net_if_get_wifi_sta(); struct wifi_twt_params params = { 0 }; int idx = 1; long value; @@ -1547,7 +1547,7 @@ static int cmd_wifi_twt_setup_quick(const struct shell *sh, size_t argc, static int cmd_wifi_twt_setup(const struct shell *sh, size_t argc, char *argv[]) { - struct net_if *iface = net_if_get_first_wifi(); + struct net_if *iface = net_if_get_wifi_sta(); struct wifi_twt_params params = { 0 }; int idx = 1; long value; @@ -1632,7 +1632,7 @@ static int cmd_wifi_twt_setup(const struct shell *sh, size_t argc, static int cmd_wifi_twt_teardown(const struct shell *sh, size_t argc, char *argv[]) { - struct net_if *iface = net_if_get_first_wifi(); + struct net_if *iface = net_if_get_wifi_sta(); struct wifi_twt_params params = { 0 }; long value; @@ -1682,7 +1682,7 @@ static int cmd_wifi_twt_teardown(const struct shell *sh, size_t argc, static int cmd_wifi_twt_teardown_all(const struct shell *sh, size_t argc, char *argv[]) { - struct net_if *iface = net_if_get_first_wifi(); + struct net_if *iface = net_if_get_wifi_sta(); struct wifi_twt_params params = { 0 }; context.sh = sh; @@ -1806,11 +1806,7 @@ static int cmd_wifi_ap_stations(const struct shell *sh, size_t argc, static int cmd_wifi_ap_sta_disconnect(const struct shell *sh, size_t argc, char *argv[]) { -#ifdef CONFIG_WIFI_NM_HOSTAPD_AP struct net_if *iface = net_if_get_wifi_sap(); -#else - struct net_if *iface = net_if_get_first_wifi(); -#endif uint8_t mac[6]; int ret; @@ -1879,11 +1875,7 @@ static int wifi_ap_config_args_to_params(const struct shell *sh, size_t argc, ch static int cmd_wifi_ap_config_params(const struct shell *sh, size_t argc, char *argv[]) { -#ifdef CONFIG_WIFI_NM_HOSTAPD_AP struct net_if *iface = net_if_get_wifi_sap(); -#else - struct net_if *iface = net_if_get_first_wifi(); -#endif struct wifi_ap_config_params ap_config_params = { 0 }; int ret = -1; @@ -1907,7 +1899,7 @@ static int cmd_wifi_ap_config_params(const struct shell *sh, size_t argc, static int cmd_wifi_reg_domain(const struct shell *sh, size_t argc, char *argv[]) { - struct net_if *iface = net_if_get_first_wifi(); + struct net_if *iface = net_if_get_wifi_sta(); struct wifi_reg_domain regd = {0}; int ret, chan_idx = 0; @@ -1976,7 +1968,7 @@ static int cmd_wifi_reg_domain(const struct shell *sh, size_t argc, static int cmd_wifi_listen_interval(const struct shell *sh, size_t argc, char *argv[]) { - struct net_if *iface = net_if_get_first_wifi(); + struct net_if *iface = net_if_get_wifi_sta(); struct wifi_ps_params params = { 0 }; long interval; @@ -2011,7 +2003,7 @@ static int cmd_wifi_listen_interval(const struct shell *sh, size_t argc, char *a #ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_WNM static int cmd_wifi_btm_query(const struct shell *sh, size_t argc, char *argv[]) { - struct net_if *iface = net_if_get_first_wifi(); + struct net_if *iface = net_if_get_wifi_sta(); uint8_t query_reason = 0; long tmp = 0; @@ -2139,7 +2131,7 @@ static int cmd_wifi_ap_wps_pin(const struct shell *sh, size_t argc, char *argv[] static int cmd_wifi_ps_wakeup_mode(const struct shell *sh, size_t argc, char *argv[]) { - struct net_if *iface = net_if_get_first_wifi(); + struct net_if *iface = net_if_get_wifi_sta(); struct wifi_ps_params params = { 0 }; context.sh = sh; @@ -2170,7 +2162,7 @@ static int cmd_wifi_ps_wakeup_mode(const struct shell *sh, size_t argc, char *ar static int cmd_wifi_set_rts_threshold(const struct shell *sh, size_t argc, char *argv[]) { - struct net_if *iface = net_if_get_first_wifi(); + struct net_if *iface = net_if_get_wifi_sta(); unsigned int rts_threshold = -1; /* Default value if user supplies "off" argument */ int err = 0; @@ -2227,7 +2219,7 @@ static int cmd_wifi_set_rts_threshold(const struct shell *sh, size_t argc, char static int cmd_wifi_ps_exit_strategy(const struct shell *sh, size_t argc, char *argv[]) { - struct net_if *iface = net_if_get_first_wifi(); + struct net_if *iface = net_if_get_wifi_sta(); struct wifi_ps_params params = { 0 }; context.sh = sh; @@ -2328,7 +2320,7 @@ static int cmd_wifi_mode(const struct shell *sh, size_t argc, char *argv[]) * lower layer */ if (mode_info.if_index == 0) { - iface = net_if_get_first_wifi(); + iface = net_if_get_wifi_sta(); if (iface == NULL) { PR_ERROR("Cannot find the default wifi interface\n"); return -ENOEXEC; @@ -2417,7 +2409,7 @@ static int cmd_wifi_channel(const struct shell *sh, size_t argc, char *argv[]) */ if (channel_info.if_index == 0) { - iface = net_if_get_first_wifi(); + iface = net_if_get_wifi_sta(); if (iface == NULL) { PR_ERROR("Cannot find the default wifi interface\n"); return -ENOEXEC; @@ -2531,7 +2523,7 @@ static int cmd_wifi_packet_filter(const struct shell *sh, size_t argc, char *arg * value to be verified by the lower layer. */ if (packet_filter.if_index == 0) { - iface = net_if_get_first_wifi(); + iface = net_if_get_wifi_sta(); if (iface == NULL) { PR_ERROR("Cannot find the default wifi interface\n"); return -ENOEXEC; @@ -2568,7 +2560,7 @@ static int cmd_wifi_packet_filter(const struct shell *sh, size_t argc, char *arg static int cmd_wifi_version(const struct shell *sh, size_t argc, char *argv[]) { - struct net_if *iface = net_if_get_first_wifi(); + struct net_if *iface = net_if_get_wifi_sta(); struct wifi_version version = {0}; if (argc > 1) { @@ -2813,7 +2805,7 @@ static int parse_dpp_args_set_config_param(const struct shell *sh, size_t argc, static int cmd_wifi_dpp_configurator_add(const struct shell *sh, size_t argc, char *argv[]) { - struct net_if *iface = net_if_get_first_wifi(); + struct net_if *iface = net_if_get_wifi_sta(); struct wifi_dpp_params params = {0}; params.action = WIFI_DPP_CONFIGURATOR_ADD; @@ -2828,7 +2820,7 @@ static int cmd_wifi_dpp_configurator_add(const struct shell *sh, size_t argc, ch static int cmd_wifi_dpp_auth_init(const struct shell *sh, size_t argc, char *argv[]) { int ret; - struct net_if *iface = net_if_get_first_wifi(); + struct net_if *iface = net_if_get_wifi_sta(); struct wifi_dpp_params params = {0}; params.action = WIFI_DPP_AUTH_INIT; @@ -2848,7 +2840,7 @@ static int cmd_wifi_dpp_auth_init(const struct shell *sh, size_t argc, char *arg static int cmd_wifi_dpp_qr_code(const struct shell *sh, size_t argc, char *argv[]) { - struct net_if *iface = net_if_get_first_wifi(); + struct net_if *iface = net_if_get_wifi_sta(); struct wifi_dpp_params params = {0}; params.action = WIFI_DPP_QR_CODE; @@ -2867,7 +2859,7 @@ static int cmd_wifi_dpp_qr_code(const struct shell *sh, size_t argc, char *argv[ static int cmd_wifi_dpp_chirp(const struct shell *sh, size_t argc, char *argv[]) { int ret; - struct net_if *iface = net_if_get_first_wifi(); + struct net_if *iface = net_if_get_wifi_sta(); struct wifi_dpp_params params = {0}; params.action = WIFI_DPP_CHIRP; @@ -2888,7 +2880,7 @@ static int cmd_wifi_dpp_chirp(const struct shell *sh, size_t argc, char *argv[]) static int cmd_wifi_dpp_listen(const struct shell *sh, size_t argc, char *argv[]) { int ret; - struct net_if *iface = net_if_get_first_wifi(); + struct net_if *iface = net_if_get_wifi_sta(); struct wifi_dpp_params params = {0}; params.action = WIFI_DPP_LISTEN; @@ -2909,7 +2901,7 @@ static int cmd_wifi_dpp_listen(const struct shell *sh, size_t argc, char *argv[] static int cmd_wifi_dpp_btstrap_gen(const struct shell *sh, size_t argc, char *argv[]) { int ret; - struct net_if *iface = net_if_get_first_wifi(); + struct net_if *iface = net_if_get_wifi_sta(); struct wifi_dpp_params params = {0}; params.action = WIFI_DPP_BOOTSTRAP_GEN; @@ -2930,7 +2922,7 @@ static int cmd_wifi_dpp_btstrap_gen(const struct shell *sh, size_t argc, char *a static int cmd_wifi_dpp_btstrap_get_uri(const struct shell *sh, size_t argc, char *argv[]) { int ret = 0; - struct net_if *iface = net_if_get_first_wifi(); + struct net_if *iface = net_if_get_wifi_sta(); struct wifi_dpp_params params = {0}; params.action = WIFI_DPP_BOOTSTRAP_GET_URI; @@ -2954,7 +2946,7 @@ static int cmd_wifi_dpp_btstrap_get_uri(const struct shell *sh, size_t argc, cha static int cmd_wifi_dpp_configurator_set(const struct shell *sh, size_t argc, char *argv[]) { int ret; - struct net_if *iface = net_if_get_first_wifi(); + struct net_if *iface = net_if_get_wifi_sta(); struct wifi_dpp_params params = {0}; params.action = WIFI_DPP_SET_CONF_PARAM; @@ -2975,7 +2967,7 @@ static int cmd_wifi_dpp_configurator_set(const struct shell *sh, size_t argc, ch static int cmd_wifi_dpp_resp_timeout_set(const struct shell *sh, size_t argc, char *argv[]) { int ret = 0; - struct net_if *iface = net_if_get_first_wifi(); + struct net_if *iface = net_if_get_wifi_sta(); struct wifi_dpp_params params = {0}; params.action = WIFI_DPP_SET_WAIT_RESP_TIME; From 8aba897c89f82719b30de497360ce276d7b46db0 Mon Sep 17 00:00:00 2001 From: TOKITA Hiroshi Date: Mon, 4 Nov 2024 23:47:23 +0900 Subject: [PATCH 0062/4042] boards: m5stack: cores3: Add RTC configuration Adding PFC8563 configuration for enabling RTC feature. Signed-off-by: TOKITA Hiroshi --- .../m5stack_cores3/m5stack_cores3_procpu_common.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/boards/m5stack/m5stack_cores3/m5stack_cores3_procpu_common.dtsi b/boards/m5stack/m5stack_cores3/m5stack_cores3_procpu_common.dtsi index 474da0931435a..559dca8c420ea 100644 --- a/boards/m5stack/m5stack_cores3/m5stack_cores3_procpu_common.dtsi +++ b/boards/m5stack/m5stack_cores3/m5stack_cores3_procpu_common.dtsi @@ -17,6 +17,7 @@ zephyr,shell-uart = &usb_serial; zephyr,flash = &flash0; zephyr,code-partition = &slot0_partition; + zephyr,rtc = &bm8563_rtc; zephyr,bt-hci = &esp32_bt_hci; }; @@ -27,6 +28,7 @@ i2c-0 = &i2c0; i2c-1 = &i2c1; watchdog0 = &wdt0; + rtc = &bm8563_rtc; }; }; @@ -68,6 +70,12 @@ clock-frequency = ; pinctrl-0 = <&i2c0_default>; pinctrl-names = "default"; + + bm8563_rtc: bm8563@51 { + compatible = "nxp,pcf8563"; + reg = <0x51>; + status = "okay"; + }; }; &i2c1 { From 6ab57b325655ba666be35a8a565102541459e219 Mon Sep 17 00:00:00 2001 From: Nicolas Pitre Date: Tue, 3 Dec 2024 21:42:56 -0500 Subject: [PATCH 0063/4042] arch: riscv: restore previous arch_current_thread_set() code generation Commit 132fa83ed448 ("arch: riscv: make arch_current_thread_set() safer") created some unintended code generation changes. Reorder the assignments to preserve original results. Signed-off-by: Nicolas Pitre --- include/zephyr/arch/riscv/arch_inlines.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/zephyr/arch/riscv/arch_inlines.h b/include/zephyr/arch/riscv/arch_inlines.h index 2752b43d97706..c97413a5f8f5b 100644 --- a/include/zephyr/arch/riscv/arch_inlines.h +++ b/include/zephyr/arch/riscv/arch_inlines.h @@ -33,7 +33,7 @@ register struct k_thread *__arch_current_thread __asm__("gp"); #define arch_current_thread() __arch_current_thread #define arch_current_thread_set(thread) \ do { \ - _current_cpu->current = __arch_current_thread = (thread); \ + __arch_current_thread = _current_cpu->current = (thread); \ } while (0) #endif /* CONFIG_RISCV_CURRENT_VIA_GP */ From e212539ffa605b8f26b73a06e925d043805a709e Mon Sep 17 00:00:00 2001 From: Maxmillion McLaughlin Date: Tue, 3 Dec 2024 17:19:50 -0800 Subject: [PATCH 0064/4042] drivers: sensor: max31865: fix compilation warning -Wdouble-promotion Fixes type mix-match for rtd temperature calculation. Also changes coefficient array name for clarity. Signed-off-by: Maxmillion McLaughlin --- drivers/sensor/maxim/max31865/max31865.c | 6 +++--- drivers/sensor/maxim/max31865/max31865.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/sensor/maxim/max31865/max31865.c b/drivers/sensor/maxim/max31865/max31865.c index f9cf6f0e7dfce..e42992acf746d 100644 --- a/drivers/sensor/maxim/max31865/max31865.c +++ b/drivers/sensor/maxim/max31865/max31865.c @@ -99,9 +99,9 @@ static double calculate_temperature(double resistance, double resistance_0) } resistance /= resistance_0; resistance *= 100.0; - temperature = A[0] + A[1] * resistance + A[2] * pow(resistance, 2) - - A[3] * pow(resistance, 3) - A[4] * pow(resistance, 4) + - A[5] * pow(resistance, 5); + temperature = RTD_C[0] + RTD_C[1] * resistance + RTD_C[2] * pow(resistance, 2) - + RTD_C[3] * pow(resistance, 3) - RTD_C[4] * pow(resistance, 4) + + RTD_C[5] * pow(resistance, 5); return temperature; } diff --git a/drivers/sensor/maxim/max31865/max31865.h b/drivers/sensor/maxim/max31865/max31865.h index 1b8681bf9f8fa..d5279533cb16c 100644 --- a/drivers/sensor/maxim/max31865/max31865.h +++ b/drivers/sensor/maxim/max31865/max31865.h @@ -71,7 +71,7 @@ LOG_MODULE_REGISTER(MAX31865, CONFIG_SENSOR_LOG_LEVEL); * For under zero, taken from * https://www.analog.com/media/en/technical-documentation/application-notes/AN709_0.pdf */ -static const float A[6] = {-242.02, 2.2228, 2.5859e-3, 4.8260e-6, 2.8183e-8, 1.5243e-10}; +static const double RTD_C[6] = {-242.02, 2.2228, 2.5859e-3, 4.8260e-6, 2.8183e-8, 1.5243e-10}; struct max31865_data { double temperature; From 0247ee823c990dfe665fedeb94347dfcf2208ca1 Mon Sep 17 00:00:00 2001 From: Chris Friedt Date: Tue, 3 Dec 2024 14:10:13 -0500 Subject: [PATCH 0065/4042] tests: benchmarks: move pthread_pressure to benchmarks/posix The pthread_pressure test was not a typical test per se. It was a benchmark in search of the proper home. Let's move it to the correct place in the Zephyr tree, add a doc, and provide some reporting. Currently, k_threads out-perform pthreads by almost a factor of 2. The theoretical maximum performance of pthreads would be at parity of k_threads, since pthreads are a wrapper around kernel threads. It would be great to reduce the gap. Signed-off-by: Chris Friedt --- .../posix/threads}/CMakeLists.txt | 0 .../posix/threads}/Kconfig | 17 +- tests/benchmarks/posix/threads/README.rst | 45 ++++ .../benchmarks/posix/threads/prj-assert.conf | 6 + tests/benchmarks/posix/threads/prj.conf | 6 + tests/benchmarks/posix/threads/src/main.c | 243 ++++++++++++++++++ tests/benchmarks/posix/threads/testcase.yaml | 21 ++ tests/posix/pthread_pressure/prj.conf | 11 - tests/posix/pthread_pressure/src/main.c | 230 ----------------- tests/posix/pthread_pressure/testcase.yaml | 16 -- 10 files changed, 327 insertions(+), 268 deletions(-) rename tests/{posix/pthread_pressure => benchmarks/posix/threads}/CMakeLists.txt (100%) rename tests/{posix/pthread_pressure => benchmarks/posix/threads}/Kconfig (71%) create mode 100644 tests/benchmarks/posix/threads/README.rst create mode 100644 tests/benchmarks/posix/threads/prj-assert.conf create mode 100644 tests/benchmarks/posix/threads/prj.conf create mode 100644 tests/benchmarks/posix/threads/src/main.c create mode 100644 tests/benchmarks/posix/threads/testcase.yaml delete mode 100644 tests/posix/pthread_pressure/prj.conf delete mode 100644 tests/posix/pthread_pressure/src/main.c delete mode 100644 tests/posix/pthread_pressure/testcase.yaml diff --git a/tests/posix/pthread_pressure/CMakeLists.txt b/tests/benchmarks/posix/threads/CMakeLists.txt similarity index 100% rename from tests/posix/pthread_pressure/CMakeLists.txt rename to tests/benchmarks/posix/threads/CMakeLists.txt diff --git a/tests/posix/pthread_pressure/Kconfig b/tests/benchmarks/posix/threads/Kconfig similarity index 71% rename from tests/posix/pthread_pressure/Kconfig rename to tests/benchmarks/posix/threads/Kconfig index 2bbdfcc21101a..5972de5ae83e9 100644 --- a/tests/posix/pthread_pressure/Kconfig +++ b/tests/benchmarks/posix/threads/Kconfig @@ -1,15 +1,11 @@ # Copyright (c) 2023, Meta +# Copyright (c) 2024, Tenstorrent AI ULC # # SPDX-License-Identifier: Apache-2.0 -source "Kconfig.zephyr" +mainmenu "POSIX Threads Benchmark" -config TEST_NUM_CPUS - int "Number of CPUs to use in parallel" - range 1 MP_MAX_NUM_CPUS - default MP_MAX_NUM_CPUS - help - The number of parallel threads to run during the test. +source "Kconfig.zephyr" config TEST_DURATION_S int "Number of seconds to run the test" @@ -44,8 +40,7 @@ config TEST_PTHREADS help Run tests for pthreads -config TEST_EXTRA_ASSERTIONS - bool "Add extra assertions into the hot path" - default y +config TEST_PERIODIC_STATS + bool "Print statistics periodically" help - This can be disabled for benchmarking. + Print statistics periodically throughout the benchmark. diff --git a/tests/benchmarks/posix/threads/README.rst b/tests/benchmarks/posix/threads/README.rst new file mode 100644 index 0000000000000..8c084d1d240c8 --- /dev/null +++ b/tests/benchmarks/posix/threads/README.rst @@ -0,0 +1,45 @@ +POSIX Thread Benchmark +###################### + +Overview +******** + +This benchmark creates and joins as many threads as possible within a configurable time window. +It provides a rough comparison Zephyr's POSIX threads (pthreads) with Zephyr's kernel threads +(k_threads) API, highlighting the overhead of the POSIX. Ideally, this overhead would shrink over +time. + +Sample output of the benchmark:: + + *** Booting Zephyr OS build v4.0.0-1410-gfca33facee37 *** + ASSERT: y + BOARD: qemu_riscv64 + NUM_CPUS: 1 + TEST_DELAY_US: 0 + TEST_DURATION_S: 5 + SMP: n + API, Thread ID, time(s), threads, cores, rate (threads/s/core) + k_thread, ALL, 5, 47663, 1, 9532 + pthread, ALL, 5, 28180, 1, 5636 + PROJECT EXECUTION SUCCESSFUL + +To observe periodic statistics on a per-thread basis in addition to the summary of statistics +printed at the end of execution, use CONFIG_TEST_PERIODIC_STATS. + +Several other options can be tuned on an as-needed basis: + +- CONFIG_MP_MAX_NUM_CPUS - Number of CPUs to use in parallel. +- CONFIG_TEST_DURATION_S - Number of seconds to run the test. +- CONFIG_TEST_DELAY_US - Microseconds to delay between pthread join and create. +- CONFIG_TEST_KTHREADS - Exercise k_threads in the test app. +- CONFIG_TEST_PTHREADS - Exercise pthreads in the test app. +- CONFIG_TEST_STACK_SIZE - Size of each thread stack in this test. + +The following table summarizes the purposes of the different extra +configuration files that are available to be used with this benchmark. +A tester may mix and match them allowing them different scenarios to +be easily compared the default. + ++-----------------------------+----------------------------------------+ +| prj-assert.conf | Enable assertions for API verification | ++-----------------------------+----------------------------------------+ diff --git a/tests/benchmarks/posix/threads/prj-assert.conf b/tests/benchmarks/posix/threads/prj-assert.conf new file mode 100644 index 0000000000000..824e4f79979ca --- /dev/null +++ b/tests/benchmarks/posix/threads/prj-assert.conf @@ -0,0 +1,6 @@ +CONFIG_FORCE_NO_ASSERT=n +CONFIG_ASSERT=y + +# May be enabled for GitHub CI to reduce host scheduling noise while running +# several concurrent Qemu processes each under stressful SMP load. +# CONFIG_PTHREAD_CREATE_BARRIER=y diff --git a/tests/benchmarks/posix/threads/prj.conf b/tests/benchmarks/posix/threads/prj.conf new file mode 100644 index 0000000000000..c24fe59a4ed99 --- /dev/null +++ b/tests/benchmarks/posix/threads/prj.conf @@ -0,0 +1,6 @@ +CONFIG_TEST=y +CONFIG_FORCE_NO_ASSERT=y + +CONFIG_POSIX_API=y +CONFIG_POSIX_AEP_CHOICE_BASE=y +CONFIG_POSIX_PRIORITY_SCHEDULING=y diff --git a/tests/benchmarks/posix/threads/src/main.c b/tests/benchmarks/posix/threads/src/main.c new file mode 100644 index 0000000000000..86ae9eaf09b8a --- /dev/null +++ b/tests/benchmarks/posix/threads/src/main.c @@ -0,0 +1,243 @@ +/* + * Copyright (c) 2023, Meta + * Copyright (c) 2024, Tenstorrent AI ULC + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include + +#include +#include + +#define STACK_SIZE K_THREAD_STACK_LEN(CONFIG_TEST_STACK_SIZE) + +/* update interval for printing stats */ +#if CONFIG_TEST_DURATION_S >= 60 +#define UPDATE_INTERVAL_S 10 +#elif CONFIG_TEST_DURATION_S >= 30 +#define UPDATE_INTERVAL_S 5 +#else +#define UPDATE_INTERVAL_S 1 +#endif + +/* 32 threads is mainly a limitation of find_lsb_set() */ +#define NUM_CPUS MIN(32, MIN(CONFIG_MP_MAX_NUM_CPUS, CONFIG_POSIX_THREAD_THREADS_MAX)) + +typedef int (*create_fn)(int i); +typedef int (*join_fn)(int i); + +static void before(void); + +/* bitmask of available threads */ +static bool alive[NUM_CPUS]; + +/* array of thread stacks */ +static K_THREAD_STACK_ARRAY_DEFINE(thread_stacks, NUM_CPUS, STACK_SIZE); + +static struct k_thread k_threads[NUM_CPUS]; +static uint64_t counters[NUM_CPUS]; +static uint64_t prev_counters[NUM_CPUS]; + +static void print_stats(const char *tag, uint64_t now, uint64_t end) +{ + for (int i = 0; i < NUM_CPUS; ++i) { + printf("%s, %d, %u, %llu, 1, %llu\n", tag, i, UPDATE_INTERVAL_S, counters[i], + (counters[i] - prev_counters[i]) / UPDATE_INTERVAL_S); + prev_counters[i] = counters[i]; + } +} + +static void print_group_stats(const char *tag) +{ + uint64_t count = 0; + + for (int i = 0; i < NUM_CPUS; ++i) { + count += counters[i]; + } + + printf("%s, ALL, %u, %llu, %u, %llu\n", tag, CONFIG_TEST_DURATION_S, count, NUM_CPUS, + count / CONFIG_TEST_DURATION_S / NUM_CPUS); +} + +static void create_join_common(const char *tag, create_fn create, join_fn join) +{ + int i; + int __maybe_unused ret; + uint64_t now_ms = k_uptime_get(); + const uint64_t end_ms = now_ms + MSEC_PER_SEC * CONFIG_TEST_DURATION_S; + uint64_t update_ms = now_ms + MSEC_PER_SEC * UPDATE_INTERVAL_S; + + for (i = 0; i < NUM_CPUS; ++i) { + /* spawn thread i */ + prev_counters[i] = 0; + ret = create(i); + __ASSERT(ret == 0, "%s_create(%d)[%zu] failed: %d", tag, i, counters[i], ret); + } + + do { + if (!IS_ENABLED(CONFIG_SMP)) { + /* allow the test thread to be swapped-out */ + k_yield(); + } + + for (i = 0; i < NUM_CPUS; ++i) { + if (alive[i]) { + ret = join(i); + __ASSERT(ret, "%s_join(%d)[%zu] failed: %d", tag, i, counters[i], + ret); + alive[i] = false; + + /* update counter i after each (create,join) pair */ + ++counters[i]; + + if (IS_ENABLED(CONFIG_TEST_DELAY_US)) { + /* success with 0 delay means we are ~raceless */ + k_busy_wait(CONFIG_TEST_DELAY_US); + } + + /* re-spawn thread i */ + ret = create(i); + __ASSERT(ret == 0, "%s_create(%d)[%zu] failed: %d", tag, i, + counters[i], ret); + } + } + + /* are we there yet? */ + now_ms = k_uptime_get(); + + /* dump some stats periodically */ + if (now_ms > update_ms) { + update_ms += MSEC_PER_SEC * UPDATE_INTERVAL_S; + + /* at this point, we should have seen many context switches */ + for (i = 0; IS_ENABLED(CONFIG_ASSERT) && i < NUM_CPUS; ++i) { + __ASSERT(counters[i] > 0, "%s %d was never scheduled", tag, i); + } + + if (IS_ENABLED(CONFIG_TEST_PERIODIC_STATS)) { + print_stats(tag, now_ms, end_ms); + } + } + Z_SPIN_DELAY(100); + } while (end_ms > now_ms); + + print_group_stats(tag); +} + +/* + * Wrappers for k_threads + */ + +static void k_thread_fun(void *arg1, void *arg2, void *arg3) +{ + int i = POINTER_TO_INT(arg1); + + alive[i] = true; +} + +static int k_thread_create_wrapper(int i) +{ + k_thread_create(&k_threads[i], thread_stacks[i], STACK_SIZE, k_thread_fun, + INT_TO_POINTER(i), NULL, NULL, K_HIGHEST_APPLICATION_THREAD_PRIO, 0, + K_NO_WAIT); + + return 0; +} + +static int k_thread_join_wrapper(int i) +{ + return k_thread_join(&k_threads[i], K_FOREVER); +} + +static void create_join_kthread(void) +{ + if (IS_ENABLED(CONFIG_TEST_KTHREADS)) { + before(); + create_join_common("k_thread", k_thread_create_wrapper, k_thread_join_wrapper); + } +} + +/* + * Wrappers for pthreads + */ + +static pthread_t pthreads[NUM_CPUS]; +static pthread_attr_t pthread_attrs[NUM_CPUS]; + +static void *pthread_fun(void *arg) +{ + k_thread_fun(arg, NULL, NULL); + return NULL; +} + +static int pthread_create_wrapper(int i) +{ + return pthread_create(&pthreads[i], &pthread_attrs[i], pthread_fun, INT_TO_POINTER(i)); +} + +static int pthread_join_wrapper(int i) +{ + return pthread_join(pthreads[i], NULL); +} + +static void create_join_pthread(void) +{ + if (IS_ENABLED(CONFIG_TEST_PTHREADS)) { + before(); + create_join_common("pthread", pthread_create_wrapper, pthread_join_wrapper); + } +} + +static void setup(void) +{ + printf("ASSERT: %c\n", IS_ENABLED(CONFIG_ASSERT) ? 'y' : 'n'); + printf("BOARD: %s\n", CONFIG_BOARD); + printf("NUM_CPUS: %u\n", NUM_CPUS); + printf("TEST_DELAY_US: %u\n", CONFIG_TEST_DELAY_US); + printf("TEST_DURATION_S: %u\n", CONFIG_TEST_DURATION_S); + printf("SMP: %c\n", IS_ENABLED(CONFIG_SMP) ? 'y' : 'n'); + + printf("API, Thread ID, time(s), threads, cores, rate (threads/s/core)\n"); + + if (IS_ENABLED(CONFIG_TEST_PTHREADS)) { + int __maybe_unused ret; + const struct sched_param param = { + .sched_priority = sched_get_priority_max(SCHED_FIFO), + }; + + /* setup pthread stacks */ + for (int i = 0; i < NUM_CPUS; ++i) { + ret = pthread_attr_init(&pthread_attrs[i]); + __ASSERT(ret == 0, "pthread_attr_init[%d] failed: %d", i, ret); + + ret = pthread_attr_setstack(&pthread_attrs[i], thread_stacks[i], + STACK_SIZE); + __ASSERT(ret == 0, "pthread_attr_setstack[%d] failed: %d", i, ret); + + ret = pthread_attr_setschedpolicy(&pthread_attrs[i], SCHED_FIFO); + __ASSERT(ret == 0, "pthread_attr_setschedpolicy[%d] failed: %d", i, ret); + + ret = pthread_attr_setschedparam(&pthread_attrs[i], ¶m); + __ASSERT(ret == 0, "pthread_attr_setschedparam[%d] failed: %d", i, ret); + } + } +} + +static void before(void) +{ + for (int i = 0; i < NUM_CPUS; ++i) { + counters[i] = 0; + } +} + +int main(void) +{ + setup(); + + create_join_kthread(); + create_join_pthread(); + + printf("PROJECT EXECUTION SUCCESSFUL\n"); +} diff --git a/tests/benchmarks/posix/threads/testcase.yaml b/tests/benchmarks/posix/threads/testcase.yaml new file mode 100644 index 0000000000000..9a7f2084f47ee --- /dev/null +++ b/tests/benchmarks/posix/threads/testcase.yaml @@ -0,0 +1,21 @@ +common: + tags: + - posix + - benchmark + min_ram: 64 + arch_exclude: + - posix + integration_platforms: + - qemu_cortex_a53/qemu_cortex_a53/smp + - qemu_riscv64/qemu_virt_riscv64/smp + - qemu_riscv32/qemu_virt_riscv32/smp + - qemu_x86_64 + harness: console + harness_config: + type: one_line + record: + regex: "(?P.*), ALL, (?P