|
112 | 112 |
|
113 | 113 | #define CMN_DTM_PMEVCNTSR 0x240
|
114 | 114 |
|
115 |
| -#define CMN_DTM_UNIT_INFO 0x0910 |
| 115 | +#define CMN650_DTM_UNIT_INFO 0x0910 |
| 116 | +#define CMN_DTM_UNIT_INFO 0x0960 |
| 117 | +#define CMN_DTM_UNIT_INFO_DTC_DOMAIN GENMASK_ULL(1, 0) |
116 | 118 |
|
117 | 119 | #define CMN_DTM_NUM_COUNTERS 4
|
118 | 120 | /* Want more local counters? Why not replicate the whole DTM! Ugh... */
|
@@ -2117,6 +2119,16 @@ static int arm_cmn_init_dtcs(struct arm_cmn *cmn)
|
2117 | 2119 | return 0;
|
2118 | 2120 | }
|
2119 | 2121 |
|
| 2122 | +static unsigned int arm_cmn_dtc_domain(struct arm_cmn *cmn, void __iomem *xp_region) |
| 2123 | +{ |
| 2124 | + int offset = CMN_DTM_UNIT_INFO; |
| 2125 | + |
| 2126 | + if (cmn->part == PART_CMN650 || cmn->part == PART_CI700) |
| 2127 | + offset = CMN650_DTM_UNIT_INFO; |
| 2128 | + |
| 2129 | + return FIELD_GET(CMN_DTM_UNIT_INFO_DTC_DOMAIN, readl_relaxed(xp_region + offset)); |
| 2130 | +} |
| 2131 | + |
2120 | 2132 | static void arm_cmn_init_node_info(struct arm_cmn *cmn, u32 offset, struct arm_cmn_node *node)
|
2121 | 2133 | {
|
2122 | 2134 | int level;
|
@@ -2248,7 +2260,7 @@ static int arm_cmn_discover(struct arm_cmn *cmn, unsigned int rgn_offset)
|
2248 | 2260 | if (cmn->part == PART_CMN600)
|
2249 | 2261 | xp->dtc = 0xf;
|
2250 | 2262 | else
|
2251 |
| - xp->dtc = 1 << readl_relaxed(xp_region + CMN_DTM_UNIT_INFO); |
| 2263 | + xp->dtc = 1 << arm_cmn_dtc_domain(cmn, xp_region); |
2252 | 2264 |
|
2253 | 2265 | xp->dtm = dtm - cmn->dtms;
|
2254 | 2266 | arm_cmn_init_dtm(dtm++, xp, 0);
|
|
0 commit comments