wireless/cc1101: Add Kconfig option to bypass strict version check

Many third-party CC1101 modules (such as those populated on the Evil Crow
RF V2) feature clone silicon that hardcodes the VERSION register to 0x00
instead of the official 0x14.

Previously, the cc1101_checkpart() function strictly enforced
VERSION == 0x14, which caused cc1101_register() to return -ENODEV (-19)
and abort initialization on these compatible modules.

This commit introduces the CONFIG_WL_CC1101_IGNORE_VERSION Kconfig option.
- When disabled (default), the driver maintains strict official silicon
  validation. This preserves the diagnostic ability to catch hardware
  faults, such as a MISO line shorted to GND (which also reads as 0x00).
- When enabled, the driver explicitly permits VERSION == 0x00, allowing
  successful initialization and interoperability with clone chips while
  printing a warning to the syslog.

Signed-off-by: Chip L. <chplee@gmail.com>
This commit is contained in:
Chip L.
2026-02-27 02:56:59 +08:00
committed by Alan C. Assis
parent 0acf6f02f3
commit 3582497909
2 changed files with 30 additions and 0 deletions

View File

@@ -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

View File

@@ -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;
}