Recognize new HiSilicon Kirin signature in ro.board.platform
diff --git a/src/arm/linux/chipset.c b/src/arm/linux/chipset.c
index 6481058..a8f2c56 100644
--- a/src/arm/linux/chipset.c
+++ b/src/arm/linux/chipset.c
@@ -601,7 +601,7 @@
}
/**
- * Tries to match /Kirin\s?\d{3}$/ signature for HiSilicon Kirin chipsets.
+ * Tries to match /[Kk]irin\s?\d{3}$/ signature for HiSilicon Kirin chipsets.
* If match successful, extracts model information into \p chipset argument.
*
* @param start - start of the /proc/cpuinfo Hardware string to match.
@@ -624,10 +624,11 @@
return false;
}
- /* Check that the string starts with "Kirin". Symbols 1-5 are loaded and compared as little-endian 32-bit word. */
- if (start[0] != 'K') {
+ /* Check that the string starts with "Kirin" or "kirin". */
+ if (((uint8_t) start[0] | UINT8_C(0x20)) != (uint8_t) 'k') {
return false;
}
+ /* Symbols 1-5 are loaded and compared as little-endian 32-bit word. */
const uint32_t irin = load_u32le(start + 1);
if (irin != UINT32_C(0x6E697269) /* "niri" = reverse("irin") */) {
return false;
@@ -2637,6 +2638,13 @@
return chipset;
}
+ /* Check HiSilicon Kirin signature */
+ if (match_kirin(platform, platform_end, &chipset)) {
+ cpuinfo_log_debug(
+ "matched HiSilicon Kirin signature in ro.board.platform string \"%.*s\"", (int) platform_length, platform);
+ return chipset;
+ }
+
/* Check Spreadtrum SC signature */
if (match_sc(platform, platform_end, &chipset)) {
cpuinfo_log_debug(