Skip to content

Commit d7069b3

Browse files
committed
Revert "Add support for some special qualcomm SoCs. (#67)"
Hard-coding special Hardware strings should be used only as a last resort, as it bloats the library size and doesn't scale to newer chipsets.
1 parent 60480b7 commit d7069b3

File tree

2 files changed

+7
-85
lines changed

2 files changed

+7
-85
lines changed

src/arm/cache.c

-1
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,6 @@ void cpuinfo_arm_decode_cache(
535535
l2_size = 1024 * 1024;
536536
break;
537537
case 660:
538-
case 662:
539538
/* Snapdragon 660: 1 MB L2 (little cores only) */
540539
l2_size = 1024 * 1024;
541540
break;

src/arm/linux/chipset.c

+7-84
Original file line numberDiff line numberDiff line change
@@ -282,82 +282,6 @@ static bool match_sm(
282282
return true;
283283
}
284284

285-
286-
struct special_map_entry {
287-
const char* platform;
288-
uint16_t model;
289-
uint8_t series;
290-
char suffix;
291-
};
292-
293-
static const struct special_map_entry qualcomm_hardware_map_entries[] = {
294-
{
295-
/* "Kona" -> Qualcomm Kona */
296-
.platform = "Kona",
297-
.series = cpuinfo_arm_chipset_series_qualcomm_snapdragon,
298-
.model = 865,
299-
},
300-
{
301-
/* "Bengal" -> Qualcomm Bengal */
302-
.platform = "Bengal",
303-
.series = cpuinfo_arm_chipset_series_qualcomm_snapdragon,
304-
.model = 662,
305-
},
306-
{
307-
/* "Bengalp" -> Qualcomm Bengalp */
308-
.platform = "Bengalp",
309-
.series = cpuinfo_arm_chipset_series_qualcomm_snapdragon,
310-
.model = 662,
311-
},
312-
{
313-
/* "Lito" -> Qualcomm Lito */
314-
.platform = "Lito",
315-
.series = cpuinfo_arm_chipset_series_qualcomm_snapdragon,
316-
.model = 765,
317-
.suffix = 'G'
318-
},
319-
{
320-
/* "Lagoon" -> Qualcomm Lagoon */
321-
.platform = "Lagoon",
322-
.series = cpuinfo_arm_chipset_series_qualcomm_snapdragon,
323-
.model = 0,
324-
},
325-
};
326-
327-
328-
int strcicmp(char const *a, char const *b)
329-
{
330-
for (;; a++, b++) {
331-
int d = tolower((unsigned char)*a) - tolower((unsigned char)*b);
332-
if (d != 0 || !*a)
333-
return d;
334-
}
335-
}
336-
337-
static bool match_qualcomm_special(
338-
const char* start, const char* end,
339-
struct cpuinfo_arm_chipset chipset[restrict static 1])
340-
{
341-
for (size_t i = 0; i < CPUINFO_COUNT_OF(qualcomm_hardware_map_entries); i++) {
342-
int length = end - start;
343-
if (strcicmp(qualcomm_hardware_map_entries[i].platform, start) == 0 &&
344-
qualcomm_hardware_map_entries[i].platform[length] == 0)
345-
{
346-
*chipset = (struct cpuinfo_arm_chipset) {
347-
.vendor = chipset_series_vendor[qualcomm_hardware_map_entries[i].series],
348-
.series = (enum cpuinfo_arm_chipset_series) qualcomm_hardware_map_entries[i].series,
349-
.model = qualcomm_hardware_map_entries[i].model,
350-
.suffix = {
351-
[0] = qualcomm_hardware_map_entries[i].suffix,
352-
},
353-
};
354-
return true;
355-
}
356-
}
357-
return false;
358-
359-
}
360-
361285
/**
362286
* Tries to match /Samsung Exynos\d{4}$/ signature (case-insensitive) for Samsung Exynos chipsets.
363287
* If match successful, extracts model information into \p chipset argument.
@@ -1829,6 +1753,13 @@ static bool is_tegra(const char* start, const char* end) {
18291753
return (length == 5 || start[5] == '3');
18301754
}
18311755

1756+
struct special_map_entry {
1757+
const char* platform;
1758+
uint16_t model;
1759+
uint8_t series;
1760+
char suffix;
1761+
};
1762+
18321763
static const struct special_map_entry special_hardware_map_entries[] = {
18331764
#if CPUINFO_ARCH_ARM
18341765
{
@@ -2387,14 +2318,6 @@ struct cpuinfo_arm_chipset cpuinfo_arm_linux_decode_chipset_from_proc_cpuinfo_ha
23872318
(int) hardware_length, hardware);
23882319
return chipset;
23892320
}
2390-
2391-
if (match_qualcomm_special(pos, hardware_end, &chipset)) {
2392-
cpuinfo_log_debug(
2393-
"matched Qualcomm signature in /proc/cpuinfo Hardware string \"%.*s\"",
2394-
(int) hardware_length, hardware);
2395-
return chipset;
2396-
}
2397-
23982321
}
23992322
word_start = false;
24002323
break;

0 commit comments

Comments
 (0)