@@ -34,6 +34,10 @@ PMU_INFO_TABLE *g_pmu_info_table;
3434void
3535val_pmu_create_info_table (uint64_t * pmu_info_table )
3636{
37+ uint32_t node_index ;
38+ addr_t base ;
39+ uint32_t reg_value ;
40+
3741 if (pmu_info_table == NULL ) {
3842 val_print (ACS_PRINT_ERR , "\nInput for Create PMU Info table cannot be NULL" , 0 );
3943 return ;
@@ -46,9 +50,43 @@ val_pmu_create_info_table(uint64_t *pmu_info_table)
4650 val_print (ACS_PRINT_TEST , " PMU_INFO: Number of PMU units : %4d\n" ,
4751 g_pmu_info_table -> pmu_count );
4852
53+ for (node_index = 0 ; node_index < g_pmu_info_table -> pmu_count ; node_index ++ ) {
54+ base = val_pmu_get_info (PMU_NODE_BASE0 , node_index );
55+ reg_value = BITFIELD_READ (PMDEVARCH_ARCHITECT , val_mmio_read (base + REG_PMDEVARCH ));
56+ /* 0x23B is value for Arm Limited */
57+ if (reg_value == 0x23B )
58+ val_pmu_set_node_coresight_complaint (0x1 , node_index );
59+ else {
60+ val_pmu_set_node_coresight_complaint (0x0 , node_index );
61+ val_print (ACS_PRINT_ERR , "\n PMU node index %d is not CS complaint" , node_index );
62+ }
63+ }
64+
4965 return ;
5066}
5167
68+ /**
69+ @brief Set if PMU node coresight architecture complaint or not
70+ **/
71+ void
72+ val_pmu_set_node_coresight_complaint (uint32_t flag , uint32_t node_index )
73+ {
74+ PMU_INFO_BLOCK * entry ;
75+
76+ if (g_pmu_info_table == NULL ) {
77+ val_print (ACS_PRINT_WARN , "\n APMT info table not found" , 0 );
78+ return ;
79+ }
80+
81+ if (node_index > g_pmu_info_table -> pmu_count ) {
82+ val_print (ACS_PRINT_WARN , "\n Invalid Node index " , 0 );
83+ return ;
84+ }
85+
86+ entry = & g_pmu_info_table -> info [node_index ];
87+ entry -> coresight_compliant = flag ;
88+ }
89+
5290/**
5391 @brief Free the memory allocated for the PMU information table
5492**/
@@ -100,6 +138,8 @@ val_pmu_get_info(PMU_INFO_e type, uint32_t node_index)
100138 return g_pmu_info_table -> pmu_count ;
101139 case PMU_NODE_DP_EXTN :
102140 return entry -> dual_page_extension ;
141+ case PMU_NODE_CS_COM :
142+ return entry -> coresight_compliant ;
103143 default :
104144 val_print (ACS_PRINT_ERR , "\n This PMU info option is not supported : %d " , type );
105145 return 0 ;
0 commit comments