1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 /* TODO: Update for Glinda */
4
5 #include <amdblocks/cpu.h>
6 #include <amdblocks/mca.h>
7 #include <cpu/amd/microcode.h>
8 #include <cpu/cpu.h>
9 #include <device/device.h>
10 #include <soc/cpu.h>
11
12 _Static_assert(CONFIG_MAX_CPUS == 24, "Do not override MAX_CPUS. To reduce the number of "
13 "available cores, use the downcore_mode and disable_smt devicetree settings instead.");
14
zen_2_3_init(struct device * dev)15 static void zen_2_3_init(struct device *dev)
16 {
17 check_mca();
18 set_cstate_io_addr();
19
20 amd_apply_microcode_patch();
21 }
22
23 static struct device_operations cpu_dev_ops = {
24 .init = zen_2_3_init,
25 };
26
27 static struct cpu_device_id cpu_table[] = {
28 { X86_VENDOR_AMD, GLINDA_A0_CPUID, CPUID_ALL_STEPPINGS_MASK },
29 { X86_VENDOR_AMD, GLINDA_B0_CPUID, CPUID_ALL_STEPPINGS_MASK },
30 CPU_TABLE_END
31 };
32
33 static const struct cpu_driver zen_2_3 __cpu_driver = {
34 .ops = &cpu_dev_ops,
35 .id_table = cpu_table,
36 };
37