From e36d5009ba83ff126a989b04618367c8139ae00b Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Fri, 31 Jan 2025 11:24:07 +0100 Subject: [PATCH] btstack_chipset_bcm: add btstack_chipset_bcm_identify_controller --- chipset/bcm/btstack_chipset_bcm.c | 24 ++++++++++++++++++++++++ chipset/bcm/btstack_chipset_bcm.h | 11 +++++++++++ 2 files changed, 35 insertions(+) diff --git a/chipset/bcm/btstack_chipset_bcm.c b/chipset/bcm/btstack_chipset_bcm.c index 09e34610d..f59fac85e 100644 --- a/chipset/bcm/btstack_chipset_bcm.c +++ b/chipset/bcm/btstack_chipset_bcm.c @@ -285,3 +285,27 @@ void btstack_chipset_bcm_enable_init_script(int enabled){ btstack_chipset_bcm.next_command = NULL; } } + +// Other lmp_subversion values: +// 0x220c - CYW20819 +// 0x420e - CYW20719 +const char * btstack_chipset_bcm_identify_controller(uint16_t lmp_subversion) { + const char * device_name = NULL; + switch (lmp_subversion){ + case 0x220b: + // CYW20706 + device_name = "BCM20703A2"; + break; + case 0x2220: + // CYW5551x + device_name = "CYW55500A1"; + break; + case 0x2257: + // CYW5557x + device_name = "CYW55560A1"; + break; + default: + break; + } + return device_name; +} diff --git a/chipset/bcm/btstack_chipset_bcm.h b/chipset/bcm/btstack_chipset_bcm.h index d0f15d60b..9326c5bc2 100644 --- a/chipset/bcm/btstack_chipset_bcm.h +++ b/chipset/bcm/btstack_chipset_bcm.h @@ -79,6 +79,17 @@ void btstack_chipset_bcm_set_device_name(const char * path); */ void btstack_chipset_bcm_enable_init_script(int enabled); +/** + * @Brief Identify Broadcom/Cypress/Infineon chipset by lmp_subversion + * If identified, device name is returned and can be used for HCI_OPCODE_HCI_READ_LOCAL_VERSION_INFORMATION + * + * @note Required for newer Controllers that require AIROC Download Mode for PatchRAM Upload + * + * @param lmp_subversion + * @returns device name if identified, otherwise NULL + */ +const char * btstack_chipset_bcm_identify_controller(uint16_t lmp_subversion); + #if defined __cplusplus } #endif