blob: 4f39aefc75a88447f35a74078c3e58da0e517f30 [file] [log] [blame]
Felix Held060b8ad2021-02-05 22:51:33 +01001/* SPDX-License-Identifier: GPL-2.0-only */
2
Felix Heldaa77d132021-02-10 16:13:56 +01003#include <amdblocks/cpu.h>
Felix Heldf1093af2021-07-13 23:00:26 +02004#include <amdblocks/mca.h>
Raul E Rangel35dc4b02021-02-12 16:04:27 -07005#include <cpu/amd/microcode.h>
Felix Held060b8ad2021-02-05 22:51:33 +01006#include <cpu/cpu.h>
7#include <device/device.h>
8#include <soc/cpu.h>
Felix Held7aacdd12021-02-10 23:27:47 +01009
Felix Held79f705f2021-04-22 17:08:50 +020010_Static_assert(CONFIG_MAX_CPUS == 16, "Do not override MAX_CPUS. To reduce the number of "
11 "available cores, use the downcore_mode and disable_smt devicetree settings instead.");
12
Felix Held060b8ad2021-02-05 22:51:33 +010013static void zen_2_3_init(struct device *dev)
14{
Felix Helda24472a2021-07-13 18:21:27 +020015 check_mca();
Felix Heldaa77d132021-02-10 16:13:56 +010016 set_cstate_io_addr();
Raul E Rangel35dc4b02021-02-12 16:04:27 -070017
Grzegorz Bernackid34dbe52023-04-25 15:30:14 +000018 amd_apply_microcode_patch();
Felix Held060b8ad2021-02-05 22:51:33 +010019}
20
21static struct device_operations cpu_dev_ops = {
22 .init = zen_2_3_init,
23};
24
25static struct cpu_device_id cpu_table[] = {
Felix Held4e812bd2023-02-06 17:21:50 +010026 { X86_VENDOR_AMD, CEZANNE_A0_CPUID, CPUID_ALL_STEPPINGS_MASK },
Anand Vaikar6e8d0122024-06-17 10:46:17 +053027 { X86_VENDOR_AMD, RENOIR_A1_CPUID, CPUID_ALL_STEPPINGS_MASK},
Felix Held1e781652023-02-08 11:39:16 +010028 CPU_TABLE_END
Felix Held060b8ad2021-02-05 22:51:33 +010029};
30
31static const struct cpu_driver zen_2_3 __cpu_driver = {
32 .ops = &cpu_dev_ops,
33 .id_table = cpu_table,
34};