diff --git a/drivers/wireless/Kconfig b/drivers/wireless/Kconfig index 08e93a28e40..1eb791f7f77 100644 --- a/drivers/wireless/Kconfig +++ b/drivers/wireless/Kconfig @@ -28,6 +28,19 @@ config CC1101_SPIDEV endif +config WL_CC1101_IGNORE_VERSION + bool "Ignore CC1101 Version Check (Allow Clone Chips)" + default n + depends on WL_CC1101 + ---help--- + Some third-party CC1101 clone silicon hardcodes the VERSION + register to 0x00. Enabling this option bypasses the strict + version verification, allowing these compatible chips to + initialize. + + Warning: Enabling this may cause false-positives if the SPI + MISO line is shorted to GND. + config WL_GS2200M bool "Telit GS2200M Wi-Fi support" default n diff --git a/drivers/wireless/cc1101.c b/drivers/wireless/cc1101.c index dcc366f7356..31a5a71c7c0 100644 --- a/drivers/wireless/cc1101.c +++ b/drivers/wireless/cc1101.c @@ -817,10 +817,27 @@ int cc1101_checkpart(struct cc1101_dev_s *dev) wlinfo("CC1101 cc1101_checkpart 0x%X 0x%X\n", partnum, version); +#ifndef CONFIG_WL_CC1101_IGNORE_VERSION + /* Strict official silicon validation */ + if (partnum == CC1101_PARTNUM_VALUE && version == CC1101_VERSION_VALUE) { return OK; } +#else + /* Bypass for third-party clone silicon (e.g., VERSION == 0x00) */ + + if (partnum == CC1101_PARTNUM_VALUE) + { + if (version != CC1101_VERSION_VALUE) + { + wlwarn("WARNING: Unofficial CC1101 version 0x%02x detected.\\n", + version); + } + + return OK; + } +#endif return -ENOTSUP; }