[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201125144847.3920-4-punitagrawal@gmail.com>
Date: Wed, 25 Nov 2020 23:48:46 +0900
From: Punit Agrawal <punitagrawal@...il.com>
To: rjw@...ysocki.net
Cc: Punit Agrawal <punitagrawal@...il.com>, wei.huang2@....com,
linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
bp@...en8.de, x86@...nel.org, Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>
Subject: [RFC PATCH 3/4] x86/cpu: amd: Define processor families
So far, the AMD processor identifier (family, models, stepping) are
referred to by raw values making it easy to make mistakes. It is also
harder to read and maintain. Additionally, these values are also being
used in subsystems outside the arch code where not everybody maybe be
as familiar with the processor identifiers.
As a first step towards improving the status quo, add macros for the
AMD processor families and propagate them through the existing
cpu_device_id.h header used for this purpose.
Signed-off-by: Punit Agrawal <punitagrawal@...il.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Ingo Molnar <mingo@...hat.com>
Cc: Borislav Petkov <bp@...en8.de>
Cc: x86@...nel.org
---
arch/x86/include/asm/amd-family.h | 18 ++++++++++++++++++
arch/x86/include/asm/cpu_device_id.h | 2 ++
2 files changed, 20 insertions(+)
create mode 100644 arch/x86/include/asm/amd-family.h
diff --git a/arch/x86/include/asm/amd-family.h b/arch/x86/include/asm/amd-family.h
new file mode 100644
index 000000000000..dff4d13b8e74
--- /dev/null
+++ b/arch/x86/include/asm/amd-family.h
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _ASM_X86_AMD_FAMILY_H
+#define _ASM_X86_AMD_FAMILY_H
+
+#define AMD_FAM_K5 0x04
+#define AMD_FAM_K6 0x05
+#define AMD_FAM_K7 0x06
+#define AMD_FAM_K8 0x0F
+#define AMD_FAM_K10 0x10
+#define AMD_FAM_K8_K10_HYBRID 0x11
+#define AMD_FAM_LLANO 0x12
+#define AMD_FAM_BOBCAT 0x14
+#define AMD_FAM_BULLDOZER 0x15
+#define AMD_FAM_JAGUAR 0x16
+#define AMD_FAM_ZEN 0x17
+#define AMD_FAM_ZEN3 0x19
+
+#endif /* _ASM_X86_AMD_FAMILY_H */
diff --git a/arch/x86/include/asm/cpu_device_id.h b/arch/x86/include/asm/cpu_device_id.h
index eb8fcede9e3b..bbb48ba4c7ff 100644
--- a/arch/x86/include/asm/cpu_device_id.h
+++ b/arch/x86/include/asm/cpu_device_id.h
@@ -12,6 +12,8 @@
#include <linux/mod_devicetable.h>
/* Get the INTEL_FAM* model defines */
#include <asm/intel-family.h>
+/* Get the AMD model defines */
+#include <asm/amd-family.h>
/* And the X86_VENDOR_* ones */
#include <asm/processor.h>
--
2.29.2
Powered by blists - more mailing lists