powerpc/64s: Support new device tree binding for discovering CPU features
The ibm,powerpc-cpu-features device tree binding describes CPU features with ASCII names and extensible compatibility, privilege, and enablement metadata that allows improved flexibility and compatibility with new hardware. The interface is described in detail in ibm,powerpc-cpu-features.txt in this patch. Currently this code is not enabled by default, and there are no released firmwares that provide the binding. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Bu işleme şunda yer alıyor:

işlemeyi yapan:
Michael Ellerman

ebeveyn
75bda95048
işleme
5a61ef74f2
@@ -1,5 +1,5 @@
|
||||
#ifndef __ASM_POWERPC_CPUFEATURES_H
|
||||
#define __ASM_POWERPC_CPUFEATURES_H
|
||||
#ifndef __ASM_POWERPC_CPU_HAS_FEATURE_H
|
||||
#define __ASM_POWERPC_CPU_HAS_FEATURE_H
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
@@ -52,4 +52,4 @@ static inline bool cpu_has_feature(unsigned long feature)
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __ASM_POWERPC_CPUFEATURE_H */
|
||||
#endif /* __ASM_POWERPC_CPU_HAS_FEATURE_H */
|
||||
|
@@ -118,7 +118,9 @@ extern struct cpu_spec *cur_cpu_spec;
|
||||
|
||||
extern unsigned int __start___ftr_fixup, __stop___ftr_fixup;
|
||||
|
||||
extern void set_cur_cpu_spec(struct cpu_spec *s);
|
||||
extern struct cpu_spec *identify_cpu(unsigned long offset, unsigned int pvr);
|
||||
extern void identify_cpu_name(unsigned int pvr);
|
||||
extern void do_feature_fixups(unsigned long value, void *fixup_start,
|
||||
void *fixup_end);
|
||||
|
||||
|
26
arch/powerpc/include/asm/dt_cpu_ftrs.h
Normal dosya
26
arch/powerpc/include/asm/dt_cpu_ftrs.h
Normal dosya
@@ -0,0 +1,26 @@
|
||||
#ifndef __ASM_POWERPC_DT_CPU_FTRS_H
|
||||
#define __ASM_POWERPC_DT_CPU_FTRS_H
|
||||
|
||||
/*
|
||||
* Copyright 2017, IBM Corporation
|
||||
* cpufeatures is the new way to discover CPU features with /cpus/features
|
||||
* devicetree. This supersedes PVR based discovery ("cputable"), and older
|
||||
* device tree feature advertisement.
|
||||
*/
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <asm/asm-compat.h>
|
||||
#include <asm/feature-fixups.h>
|
||||
#include <uapi/asm/cputable.h>
|
||||
|
||||
#ifdef CONFIG_PPC_DT_CPU_FTRS
|
||||
bool dt_cpu_ftrs_init(void *fdt);
|
||||
void dt_cpu_ftrs_scan(void);
|
||||
bool dt_cpu_ftrs_in_use(void);
|
||||
#else
|
||||
static inline bool dt_cpu_ftrs_init(void *fdt) { return false; }
|
||||
static inline void dt_cpu_ftrs_scan(void) { }
|
||||
static inline bool dt_cpu_ftrs_in_use(void) { return false; }
|
||||
#endif
|
||||
|
||||
#endif /* __ASM_POWERPC_DT_CPU_FTRS_H */
|
@@ -1229,6 +1229,7 @@
|
||||
#define PVR_POWER8E 0x004B
|
||||
#define PVR_POWER8NVL 0x004C
|
||||
#define PVR_POWER8 0x004D
|
||||
#define PVR_POWER9 0x004E
|
||||
#define PVR_BE 0x0070
|
||||
#define PVR_PA6T 0x0090
|
||||
|
||||
|
@@ -47,4 +47,11 @@
|
||||
#define PPC_FEATURE2_ARCH_3_00 0x00800000 /* ISA 3.00 */
|
||||
#define PPC_FEATURE2_HAS_IEEE128 0x00400000 /* VSX IEEE Binary Float 128-bit */
|
||||
|
||||
/*
|
||||
* IMPORTANT!
|
||||
* All future PPC_FEATURE definitions should be allocated in cooperation with
|
||||
* OPAL / skiboot firmware, in accordance with the ibm,powerpc-cpu-features
|
||||
* device tree binding.
|
||||
*/
|
||||
|
||||
#endif /* _UAPI__ASM_POWERPC_CPUTABLE_H */
|
||||
|
Yeni konuda referans
Bir kullanıcı engelle