Arthur Heymans | 2e2f166 | 2023-07-14 22:58:49 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #include <amdblocks/cpu.h> |
Arthur Heymans | 447e279 | 2023-07-14 23:05:46 +0200 | [diff] [blame] | 4 | #include <amdblocks/mca.h> |
Arthur Heymans | 5ee1d23 | 2023-07-14 23:16:22 +0200 | [diff] [blame^] | 5 | #include <cpu/amd/microcode.h> |
Arthur Heymans | 2e2f166 | 2023-07-14 22:58:49 +0200 | [diff] [blame] | 6 | #include <cpu/cpu.h> |
| 7 | #include <device/device.h> |
| 8 | #include <soc/cpu.h> |
| 9 | |
| 10 | static void model_19_init(struct device *dev) |
| 11 | { |
Arthur Heymans | 447e279 | 2023-07-14 23:05:46 +0200 | [diff] [blame] | 12 | check_mca(); |
Arthur Heymans | 2e2f166 | 2023-07-14 22:58:49 +0200 | [diff] [blame] | 13 | set_cstate_io_addr(); |
Arthur Heymans | 5ee1d23 | 2023-07-14 23:16:22 +0200 | [diff] [blame^] | 14 | |
| 15 | amd_apply_microcode_patch(); |
Arthur Heymans | 2e2f166 | 2023-07-14 22:58:49 +0200 | [diff] [blame] | 16 | } |
| 17 | |
| 18 | static struct device_operations cpu_dev_ops = { |
| 19 | .init = model_19_init, |
| 20 | }; |
| 21 | |
| 22 | static struct cpu_device_id cpu_table[] = { |
| 23 | { X86_VENDOR_AMD, GENOA_A0_CPUID, CPUID_ALL_STEPPINGS_MASK }, |
| 24 | { X86_VENDOR_AMD, GENOA_B0_CPUID, CPUID_ALL_STEPPINGS_MASK }, |
| 25 | CPU_TABLE_END |
| 26 | }; |
| 27 | |
| 28 | static const struct cpu_driver model_19 __cpu_driver = { |
| 29 | .ops = &cpu_dev_ops, |
| 30 | .id_table = cpu_table, |
| 31 | }; |