diff options
author | Anshuman Khandual <anshuman.khandual@arm.com> | 2023-07-10 11:54:57 +0530 |
---|---|---|
committer | Suzuki K Poulose <suzuki.poulose@arm.com> | 2023-07-26 16:46:25 +0100 |
commit | 5a1c7097472fcde5745654e3a59f55140903d9cc (patch) | |
tree | 0a95a4c2d479f27c8a05e37c3e641f6f22561cac /include/linux/coresight.h | |
parent | 4e3b9a6eae987c80330e5253754dab35acc2a63b (diff) | |
download | linux-5a1c7097472fcde5745654e3a59f55140903d9cc.tar.gz linux-5a1c7097472fcde5745654e3a59f55140903d9cc.tar.bz2 linux-5a1c7097472fcde5745654e3a59f55140903d9cc.zip |
coresight: etm4x: Drop pid argument from etm4_probe()
Coresight device pid can be retrieved from its iomem base address, which is
stored in 'struct etm4x_drvdata'. This drops pid argument from etm4_probe()
and 'struct etm4_init_arg'. Instead etm4_check_arch_features() derives the
coresight device pid with a new helper coresight_get_pid(), right before it
is consumed in etm4_hisi_match_pid().
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: coresight@lists.linaro.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20230710062500.45147-4-anshuman.khandual@arm.com
Diffstat (limited to 'include/linux/coresight.h')
-rw-r--r-- | include/linux/coresight.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/coresight.h b/include/linux/coresight.h index bf70987240e4..255cfd283883 100644 --- a/include/linux/coresight.h +++ b/include/linux/coresight.h @@ -386,6 +386,18 @@ static inline u32 csdev_access_relaxed_read32(struct csdev_access *csa, return csa->read(offset, true, false); } +#define CORESIGHT_PIDRn(i) (0xFE0 + ((i) * 4)) + +static inline u32 coresight_get_pid(struct csdev_access *csa) +{ + u32 i, pid = 0; + + for (i = 0; i < 4; i++) + pid |= csdev_access_relaxed_read32(csa, CORESIGHT_PIDRn(i)) << (i * 8); + + return pid; +} + static inline u64 csdev_access_relaxed_read_pair(struct csdev_access *csa, u32 lo_offset, u32 hi_offset) { |