Skip to content

Commit 2b14e44

Browse files
authored
Support Huawei Kunpeng920 series CPU info detection, Kunpeng920 Series CPU base on TaiShan v110 microarchitecture. (#39)
TaiShan v110 base on armv8.2a designed by Huawei hisilicon.
1 parent a1e0b95 commit 2b14e44

File tree

3 files changed

+46
-0
lines changed

3 files changed

+46
-0
lines changed

include/cpuinfo.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,9 @@ enum cpuinfo_uarch {
499499
/** Applied Micro X-Gene. */
500500
cpuinfo_uarch_xgene = 0x00B00100,
501501

502+
/** Huawei hisilicon Kunpeng Series CPU. */
503+
cpuinfo_uarch_taishanv110 = 0x00C00100,
504+
502505
/* Hygon Dhyana (a modification of AMD Zen for Chinese market). */
503506
cpuinfo_uarch_dhyana = 0x01000100,
504507
};

src/arm/cache.c

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1448,6 +1448,46 @@ void cpuinfo_arm_decode_cache(
14481448
.line_size = 64 /* assumption */
14491449
};
14501450
break;
1451+
case cpuinfo_uarch_taishanv110:
1452+
/*
1453+
* Kunpeng920 series CPU designed by Huawei hisilicon for server,
1454+
* L1 and L2 cache is private to each core, L3 is shared with all cores.
1455+
* +--------------------+-------+-----------+-----------+-----------+----------+------------+
1456+
* | Processor model | Cores | L1D cache | L1I cache | L2 cache | L3 cache | Reference |
1457+
* +--------------------+-------+-----------+-----------+-----------+----------+------------+
1458+
* | Kunpeng920-3226 | 32 | 64K | 64K | 512K | 32M | [1] |
1459+
* +--------------------+-------+-----------+-----------+-----------+----------+------------+
1460+
* | Kunpeng920-4826 | 48 | 64K | 64K | 512K | 48M | [2] |
1461+
* +--------------------+-------+-----------+-----------+-----------+----------+------------+
1462+
* | Kunpeng920-6426 | 64 | 64K | 64K | 512K | 64M | [3] |
1463+
* +--------------------+-------+-----------+-----------+-----------+----------+------------+
1464+
*
1465+
* [1] https://en.wikichip.org/wiki/hisilicon/kunpeng/920-3226
1466+
* [2] https://en.wikichip.org/wiki/hisilicon/kunpeng/920-4826
1467+
* [3] https://en.wikichip.org/wiki/hisilicon/kunpeng/920-6426
1468+
*/
1469+
*l1i = (struct cpuinfo_cache) {
1470+
.size = 64 * 1024,
1471+
.associativity = 4 /* assumption */,
1472+
.line_size = 128 /* assumption */,
1473+
};
1474+
*l1d = (struct cpuinfo_cache) {
1475+
.size = 64 * 1024,
1476+
.associativity = 4 /* assumption */,
1477+
.line_size = 128 /* assumption */,
1478+
};
1479+
*l2 = (struct cpuinfo_cache) {
1480+
.size = 512 * 1024,
1481+
.associativity = 8 /* assumption */,
1482+
.line_size = 128 /* assumption */,
1483+
.flags = CPUINFO_CACHE_INCLUSIVE /* assumption */,
1484+
};
1485+
*l3 = (struct cpuinfo_cache) {
1486+
.size = cluster_cores * 1024 * 1024,
1487+
.associativity = 16 /* assumption */,
1488+
.line_size = 128 /* assumption */,
1489+
};
1490+
break;
14511491
#endif
14521492
case cpuinfo_uarch_cortex_a12:
14531493
case cpuinfo_uarch_cortex_a32:

src/arm/uarch.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@ void cpuinfo_arm_decode_vendor_uarch(
155155
case 'H':
156156
*vendor = cpuinfo_vendor_huawei;
157157
switch (midr_get_part(midr)) {
158+
case 0xD01: /* Kunpeng920 ARM-base CPU*/
159+
*uarch = cpuinfo_uarch_taishanv110;
160+
break;
158161
case 0xD40: /* Kirin 980 Big/Medium cores -> Cortex-A76 */
159162
*vendor = cpuinfo_vendor_arm;
160163
*uarch = cpuinfo_uarch_cortex_a76;

0 commit comments

Comments
 (0)