提交 b3f15378 编写于 作者: S Suzuki K. Poulose 提交者: Catalin Marinas

arm64: Read system wide CPUID value

Add an API for reading the safe CPUID value across the
system from the new infrastructure.
Signed-off-by: NSuzuki K. Poulose <suzuki.poulose@arm.com>
Tested-by: NDave Martin <Dave.Martin@arm.com>
Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
上级 3086d391
...@@ -144,6 +144,8 @@ void check_local_cpu_features(void); ...@@ -144,6 +144,8 @@ void check_local_cpu_features(void);
bool cpu_supports_mixed_endian_el0(void); bool cpu_supports_mixed_endian_el0(void);
bool system_supports_mixed_endian_el0(void); bool system_supports_mixed_endian_el0(void);
u64 read_system_reg(u32 id);
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
#endif #endif
...@@ -590,6 +590,15 @@ void update_cpu_features(int cpu, ...@@ -590,6 +590,15 @@ void update_cpu_features(int cpu,
update_mixed_endian_el0_support(info); update_mixed_endian_el0_support(info);
} }
u64 read_system_reg(u32 id)
{
struct arm64_ftr_reg *regp = get_arm64_ftr_reg(id);
/* We shouldn't get a request for an unsupported register */
BUG_ON(!regp);
return regp->sys_val;
}
static bool static bool
feature_matches(u64 reg, const struct arm64_cpu_capabilities *entry) feature_matches(u64 reg, const struct arm64_cpu_capabilities *entry)
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册