@@ -1259,17 +1259,32 @@ static int armv8_pmu_init_nogroups(struct arm_pmu *cpu_pmu, char *name,
12591259 return armv8_pmu_init (cpu_pmu , name , map_event , NULL , NULL , NULL );
12601260}
12611261
1262- static int armv8_pmuv3_init (struct arm_pmu * cpu_pmu )
1263- {
1264- return armv8_pmu_init_nogroups (cpu_pmu , "armv8_pmuv3" ,
1265- armv8_pmuv3_map_event );
1266- }
1267-
1268- static int armv8_a34_pmu_init (struct arm_pmu * cpu_pmu )
1269- {
1270- return armv8_pmu_init_nogroups (cpu_pmu , "armv8_cortex_a34" ,
1271- armv8_pmuv3_map_event );
1272- }
1262+ #define PMUV3_INIT_SIMPLE (name ) \
1263+ static int name##_pmu_init(struct arm_pmu *cpu_pmu) \
1264+ { \
1265+ return armv8_pmu_init_nogroups(cpu_pmu, #name, armv8_pmuv3_map_event);\
1266+ }
1267+
1268+ PMUV3_INIT_SIMPLE (armv8_pmuv3 )
1269+
1270+ PMUV3_INIT_SIMPLE (armv8_cortex_a34 )
1271+ PMUV3_INIT_SIMPLE (armv8_cortex_a55 )
1272+ PMUV3_INIT_SIMPLE (armv8_cortex_a65 )
1273+ PMUV3_INIT_SIMPLE (armv8_cortex_a75 )
1274+ PMUV3_INIT_SIMPLE (armv8_cortex_a76 )
1275+ PMUV3_INIT_SIMPLE (armv8_cortex_a77 )
1276+ PMUV3_INIT_SIMPLE (armv8_cortex_a78 )
1277+ PMUV3_INIT_SIMPLE (armv9_cortex_a510 )
1278+ PMUV3_INIT_SIMPLE (armv9_cortex_a710 )
1279+ PMUV3_INIT_SIMPLE (armv8_cortex_x1 )
1280+ PMUV3_INIT_SIMPLE (armv9_cortex_x2 )
1281+ PMUV3_INIT_SIMPLE (armv8_neoverse_e1 )
1282+ PMUV3_INIT_SIMPLE (armv8_neoverse_n1 )
1283+ PMUV3_INIT_SIMPLE (armv9_neoverse_n2 )
1284+ PMUV3_INIT_SIMPLE (armv8_neoverse_v1 )
1285+
1286+ PMUV3_INIT_SIMPLE (armv8_nvidia_carmel )
1287+ PMUV3_INIT_SIMPLE (armv8_nvidia_denver )
12731288
12741289static int armv8_a35_pmu_init (struct arm_pmu * cpu_pmu )
12751290{
@@ -1283,24 +1298,12 @@ static int armv8_a53_pmu_init(struct arm_pmu *cpu_pmu)
12831298 armv8_a53_map_event );
12841299}
12851300
1286- static int armv8_a55_pmu_init (struct arm_pmu * cpu_pmu )
1287- {
1288- return armv8_pmu_init_nogroups (cpu_pmu , "armv8_cortex_a55" ,
1289- armv8_pmuv3_map_event );
1290- }
1291-
12921301static int armv8_a57_pmu_init (struct arm_pmu * cpu_pmu )
12931302{
12941303 return armv8_pmu_init_nogroups (cpu_pmu , "armv8_cortex_a57" ,
12951304 armv8_a57_map_event );
12961305}
12971306
1298- static int armv8_a65_pmu_init (struct arm_pmu * cpu_pmu )
1299- {
1300- return armv8_pmu_init_nogroups (cpu_pmu , "armv8_cortex_a65" ,
1301- armv8_pmuv3_map_event );
1302- }
1303-
13041307static int armv8_a72_pmu_init (struct arm_pmu * cpu_pmu )
13051308{
13061309 return armv8_pmu_init_nogroups (cpu_pmu , "armv8_cortex_a72" ,
@@ -1313,42 +1316,6 @@ static int armv8_a73_pmu_init(struct arm_pmu *cpu_pmu)
13131316 armv8_a73_map_event );
13141317}
13151318
1316- static int armv8_a75_pmu_init (struct arm_pmu * cpu_pmu )
1317- {
1318- return armv8_pmu_init_nogroups (cpu_pmu , "armv8_cortex_a75" ,
1319- armv8_pmuv3_map_event );
1320- }
1321-
1322- static int armv8_a76_pmu_init (struct arm_pmu * cpu_pmu )
1323- {
1324- return armv8_pmu_init_nogroups (cpu_pmu , "armv8_cortex_a76" ,
1325- armv8_pmuv3_map_event );
1326- }
1327-
1328- static int armv8_a77_pmu_init (struct arm_pmu * cpu_pmu )
1329- {
1330- return armv8_pmu_init_nogroups (cpu_pmu , "armv8_cortex_a77" ,
1331- armv8_pmuv3_map_event );
1332- }
1333-
1334- static int armv8_a78_pmu_init (struct arm_pmu * cpu_pmu )
1335- {
1336- return armv8_pmu_init_nogroups (cpu_pmu , "armv8_cortex_a78" ,
1337- armv8_pmuv3_map_event );
1338- }
1339-
1340- static int armv8_e1_pmu_init (struct arm_pmu * cpu_pmu )
1341- {
1342- return armv8_pmu_init_nogroups (cpu_pmu , "armv8_neoverse_e1" ,
1343- armv8_pmuv3_map_event );
1344- }
1345-
1346- static int armv8_n1_pmu_init (struct arm_pmu * cpu_pmu )
1347- {
1348- return armv8_pmu_init_nogroups (cpu_pmu , "armv8_neoverse_n1" ,
1349- armv8_pmuv3_map_event );
1350- }
1351-
13521319static int armv8_thunder_pmu_init (struct arm_pmu * cpu_pmu )
13531320{
13541321 return armv8_pmu_init_nogroups (cpu_pmu , "armv8_cavium_thunder" ,
@@ -1362,23 +1329,31 @@ static int armv8_vulcan_pmu_init(struct arm_pmu *cpu_pmu)
13621329}
13631330
13641331static const struct of_device_id armv8_pmu_of_device_ids [] = {
1365- {.compatible = "arm,armv8-pmuv3" , .data = armv8_pmuv3_init },
1366- {.compatible = "arm,cortex-a34-pmu" , .data = armv8_a34_pmu_init },
1332+ {.compatible = "arm,armv8-pmuv3" , .data = armv8_pmuv3_pmu_init },
1333+ {.compatible = "arm,cortex-a34-pmu" , .data = armv8_cortex_a34_pmu_init },
13671334 {.compatible = "arm,cortex-a35-pmu" , .data = armv8_a35_pmu_init },
13681335 {.compatible = "arm,cortex-a53-pmu" , .data = armv8_a53_pmu_init },
1369- {.compatible = "arm,cortex-a55-pmu" , .data = armv8_a55_pmu_init },
1336+ {.compatible = "arm,cortex-a55-pmu" , .data = armv8_cortex_a55_pmu_init },
13701337 {.compatible = "arm,cortex-a57-pmu" , .data = armv8_a57_pmu_init },
1371- {.compatible = "arm,cortex-a65-pmu" , .data = armv8_a65_pmu_init },
1338+ {.compatible = "arm,cortex-a65-pmu" , .data = armv8_cortex_a65_pmu_init },
13721339 {.compatible = "arm,cortex-a72-pmu" , .data = armv8_a72_pmu_init },
13731340 {.compatible = "arm,cortex-a73-pmu" , .data = armv8_a73_pmu_init },
1374- {.compatible = "arm,cortex-a75-pmu" , .data = armv8_a75_pmu_init },
1375- {.compatible = "arm,cortex-a76-pmu" , .data = armv8_a76_pmu_init },
1376- {.compatible = "arm,cortex-a77-pmu" , .data = armv8_a77_pmu_init },
1377- {.compatible = "arm,cortex-a78-pmu" , .data = armv8_a78_pmu_init },
1378- {.compatible = "arm,neoverse-e1-pmu" , .data = armv8_e1_pmu_init },
1379- {.compatible = "arm,neoverse-n1-pmu" , .data = armv8_n1_pmu_init },
1341+ {.compatible = "arm,cortex-a75-pmu" , .data = armv8_cortex_a75_pmu_init },
1342+ {.compatible = "arm,cortex-a76-pmu" , .data = armv8_cortex_a76_pmu_init },
1343+ {.compatible = "arm,cortex-a77-pmu" , .data = armv8_cortex_a77_pmu_init },
1344+ {.compatible = "arm,cortex-a78-pmu" , .data = armv8_cortex_a78_pmu_init },
1345+ {.compatible = "arm,cortex-a510-pmu" , .data = armv9_cortex_a510_pmu_init },
1346+ {.compatible = "arm,cortex-a710-pmu" , .data = armv9_cortex_a710_pmu_init },
1347+ {.compatible = "arm,cortex-x1-pmu" , .data = armv8_cortex_x1_pmu_init },
1348+ {.compatible = "arm,cortex-x2-pmu" , .data = armv9_cortex_x2_pmu_init },
1349+ {.compatible = "arm,neoverse-e1-pmu" , .data = armv8_neoverse_e1_pmu_init },
1350+ {.compatible = "arm,neoverse-n1-pmu" , .data = armv8_neoverse_n1_pmu_init },
1351+ {.compatible = "arm,neoverse-n2-pmu" , .data = armv9_neoverse_n2_pmu_init },
1352+ {.compatible = "arm,neoverse-v1-pmu" , .data = armv8_neoverse_v1_pmu_init },
13801353 {.compatible = "cavium,thunder-pmu" , .data = armv8_thunder_pmu_init },
13811354 {.compatible = "brcm,vulcan-pmu" , .data = armv8_vulcan_pmu_init },
1355+ {.compatible = "nvidia,carmel-pmu" , .data = armv8_nvidia_carmel_pmu_init },
1356+ {.compatible = "nvidia,denver-pmu" , .data = armv8_nvidia_denver_pmu_init },
13821357 {},
13831358};
13841359
@@ -1401,7 +1376,7 @@ static int __init armv8_pmu_driver_init(void)
14011376 if (acpi_disabled )
14021377 return platform_driver_register (& armv8_pmu_driver );
14031378 else
1404- return arm_pmu_acpi_probe (armv8_pmuv3_init );
1379+ return arm_pmu_acpi_probe (armv8_pmuv3_pmu_init );
14051380}
14061381device_initcall (armv8_pmu_driver_init )
14071382
0 commit comments