Patrick Georgi has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/32130 )
Change subject: arch/x86/cpu: Add functions to determine CPU vendor ......................................................................
arch/x86/cpu: Add functions to determine CPU vendor
Add two functions to determine if CPU is made by a specific vendor. Use Kconfig symbols to allow link time optimizations.
Change-Id: I1bd6c3b59cfd992f7ba507bc9f9269669920b24f Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/32130 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: HAOUAS Elyes ehaouas@noos.fr Reviewed-by: Julien Viard de Galbert coreboot-review-ju@vdg.name Reviewed-by: Patrick Georgi pgeorgi@google.com --- M src/arch/x86/include/arch/cpu.h 1 file changed, 10 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Patrick Georgi: Looks good to me, approved HAOUAS Elyes: Looks good to me, but someone else must approve Julien Viard de Galbert: Looks good to me, but someone else must approve
diff --git a/src/arch/x86/include/arch/cpu.h b/src/arch/x86/include/arch/cpu.h index b40dd1b..3e464e4 100644 --- a/src/arch/x86/include/arch/cpu.h +++ b/src/arch/x86/include/arch/cpu.h @@ -166,6 +166,16 @@ void smm_lock(void); void smm_setup_structures(void *gnvs, void *tcg, void *smi1);
+static inline bool cpu_is_amd(void) +{ + return CONFIG(CPU_AMD_AGESA) || CONFIG(CPU_AMD_PI); +} + +static inline bool cpu_is_intel(void) +{ + return CONFIG(CPU_INTEL_COMMON) || CONFIG(SOC_INTEL_COMMON); +} + #ifndef __SIMPLE_DEVICE__
struct device;