1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Helpers for Intel SoC model detection
5 * Copyright (c) 2019, Intel Corporation.
8 #ifndef __PLATFORM_DATA_X86_SOC_H
9 #define __PLATFORM_DATA_X86_SOC_H
11 #if IS_ENABLED(CONFIG_X86)
13 #include <asm/cpu_device_id.h>
14 #include <asm/intel-family.h>
16 #define SOC_INTEL_IS_CPU(soc, type) \
17 static inline bool soc_intel_is_##soc(void) \
19 static const struct x86_cpu_id soc##_cpu_ids[] = { \
20 X86_MATCH_INTEL_FAM6_MODEL(type, NULL), \
23 const struct x86_cpu_id *id; \
25 id = x86_match_cpu(soc##_cpu_ids); \
31 SOC_INTEL_IS_CPU(byt, ATOM_SILVERMONT);
32 SOC_INTEL_IS_CPU(cht, ATOM_AIRMONT);
33 SOC_INTEL_IS_CPU(apl, ATOM_GOLDMONT);
34 SOC_INTEL_IS_CPU(glk, ATOM_GOLDMONT_PLUS);
35 SOC_INTEL_IS_CPU(cml, KABYLAKE_L);
37 #else /* IS_ENABLED(CONFIG_X86) */
39 static inline bool soc_intel_is_byt(void)
44 static inline bool soc_intel_is_cht(void)
49 static inline bool soc_intel_is_apl(void)
54 static inline bool soc_intel_is_glk(void)
59 static inline bool soc_intel_is_cml(void)
63 #endif /* IS_ENABLED(CONFIG_X86) */
65 #endif /* __PLATFORM_DATA_X86_SOC_H */