Unverified Commit 1a572bce authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!8834 Add support for Hygon model 10h processors

Merge Pull Request from: @liao-xuan1 
 
Update the CPU topology and NB, EDAC, k10temp,audio drivers for Hygon
family 18h model 10h processors.

Reference:
https://gitee.com/openeuler/kernel/pulls/8822
https://gitee.com/deepin-kernelsig/kernel/pulls/1
https://gitee.com/OpenCloudOS/OpenCloudOS-Kernel/pulls/54 
 
Link:https://gitee.com/openeuler/kernel/pulls/8834

 

Reviewed-by: default avatarXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parents b0ac92b5 73cc9cbc
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -32,9 +32,11 @@
#define PCI_DEVICE_ID_AMD_19H_M50H_DF_F4 0x166e

#define PCI_DEVICE_ID_HYGON_18H_M05H_ROOT  0x14a0
#define PCI_DEVICE_ID_HYGON_18H_M10H_ROOT  0x14c0
#define PCI_DEVICE_ID_HYGON_18H_M04H_DF_F1 0x1491
#define PCI_DEVICE_ID_HYGON_18H_M05H_DF_F1 0x14b1
#define PCI_DEVICE_ID_HYGON_18H_M05H_DF_F4 0x14b4
#define PCI_DEVICE_ID_HYGON_18H_M10H_DF_F4 0x14d4
#define PCI_DEVICE_ID_HYGON_18H_M06H_DF_F5 0x14b5

/* Protect the PCI config register pairs used for SMN and DF indirect access. */
@@ -100,6 +102,7 @@ static const struct pci_device_id hygon_root_ids[] = {
	{ PCI_DEVICE(PCI_VENDOR_ID_HYGON, PCI_DEVICE_ID_AMD_17H_ROOT) },
	{ PCI_DEVICE(PCI_VENDOR_ID_HYGON, PCI_DEVICE_ID_AMD_17H_M30H_ROOT) },
	{ PCI_DEVICE(PCI_VENDOR_ID_HYGON, PCI_DEVICE_ID_HYGON_18H_M05H_ROOT) },
	{ PCI_DEVICE(PCI_VENDOR_ID_HYGON, PCI_DEVICE_ID_HYGON_18H_M10H_ROOT) },
	{}
};

@@ -107,6 +110,7 @@ static const struct pci_device_id hygon_nb_misc_ids[] = {
	{ PCI_DEVICE(PCI_VENDOR_ID_HYGON, PCI_DEVICE_ID_AMD_17H_DF_F3) },
	{ PCI_DEVICE(PCI_VENDOR_ID_HYGON, PCI_DEVICE_ID_AMD_17H_M30H_DF_F3) },
	{ PCI_DEVICE(PCI_VENDOR_ID_HYGON, PCI_DEVICE_ID_HYGON_18H_M05H_DF_F3) },
	{ PCI_DEVICE(PCI_VENDOR_ID_HYGON, PCI_DEVICE_ID_HYGON_18H_M10H_DF_F3) },
	{}
};

@@ -114,6 +118,7 @@ static const struct pci_device_id hygon_nb_link_ids[] = {
	{ PCI_DEVICE(PCI_VENDOR_ID_HYGON, PCI_DEVICE_ID_AMD_17H_DF_F4) },
	{ PCI_DEVICE(PCI_VENDOR_ID_HYGON, PCI_DEVICE_ID_AMD_17H_M30H_DF_F4) },
	{ PCI_DEVICE(PCI_VENDOR_ID_HYGON, PCI_DEVICE_ID_HYGON_18H_M05H_DF_F4) },
	{ PCI_DEVICE(PCI_VENDOR_ID_HYGON, PCI_DEVICE_ID_HYGON_18H_M10H_DF_F4) },
	{}
};

@@ -328,7 +333,8 @@ int get_df_id(struct pci_dev *misc, u8 *id)
	u32 value;
	int ret;

	if (boot_cpu_data.x86_model == 0x6) {
	if (boot_cpu_data.x86_model >= 0x6 &&
	    boot_cpu_data.x86_model <= 0x7) {
		/* F5x180[19:16]: DF ID */
		ret = get_df_register(misc, 5, 0x180, &value);
		*id = (value >> 16) & 0xf;
+2 −1
Original line number Diff line number Diff line
@@ -693,7 +693,8 @@ void cacheinfo_hygon_init_llc_id(struct cpuinfo_x86 *c, int cpu)
	if (!cpuid_edx(0x80000006))
		return;

	if (c->x86_model < 0x5) {
	if (c->x86_model < 0x5 ||
	   (c->x86_model >= 0x10 && c->x86_model <= 0x1f)) {
		/*
		 * LLC is at the core complex level.
		 * Core complex ID is ApicId[3] for these processors.
+14 −0
Original line number Diff line number Diff line
@@ -2677,6 +2677,16 @@ static struct amd64_family_type family_types[] = {
			.dbam_to_cs		= f17_addr_mask_to_cs_size,
		}
	},
	[F18_M10H_CPUS] = {
		.ctl_name = "F18h_M10h",
		.f0_id = PCI_DEVICE_ID_HYGON_18H_M10H_DF_F0,
		.f6_id = PCI_DEVICE_ID_HYGON_18H_M10H_DF_F6,
		.max_mcs = 2,
		.ops = {
			.early_channel_count	= f17_early_channel_count,
			.dbam_to_cs		= f17_addr_mask_to_cs_size,
		}
	},
	[F19_CPUS] = {
		.ctl_name = "F19h",
		.f0_id = PCI_DEVICE_ID_AMD_19H_DF_F0,
@@ -3791,6 +3801,10 @@ static struct amd64_family_type *per_family_init(struct amd64_pvt *pvt)
			pvt->ops = &family_types[F18_M06H_CPUS].ops;
			family_types[F18_M06H_CPUS].ctl_name = "F18h_M07h";
			break;
		} else if (pvt->model == 0x10) {
			fam_type = &family_types[F18_M10H_CPUS];
			pvt->ops = &family_types[F18_M10H_CPUS].ops;
			break;
		}
		fam_type	= &family_types[F17_CPUS];
		pvt->ops	= &family_types[F17_CPUS].ops;
+3 −0
Original line number Diff line number Diff line
@@ -131,6 +131,8 @@

#define PCI_DEVICE_ID_HYGON_18H_M06H_DF_F0 0x14b0
#define PCI_DEVICE_ID_HYGON_18H_M06H_DF_F6 0x14b6
#define PCI_DEVICE_ID_HYGON_18H_M10H_DF_F0 0x14d0
#define PCI_DEVICE_ID_HYGON_18H_M10H_DF_F6 0x14d6

/*
 * Function 1 - Address Map
@@ -306,6 +308,7 @@ enum amd_families {
	F17_M60H_CPUS,
	F17_M70H_CPUS,
	F18_M06H_CPUS,
	F18_M10H_CPUS,
	F19_CPUS,
	F19_M10H_CPUS,
	NUM_FAMILIES,
+1 −0
Original line number Diff line number Diff line
@@ -577,6 +577,7 @@ static const struct pci_device_id k10temp_id_table[] = {
	{ PCI_VDEVICE(HYGON, PCI_DEVICE_ID_AMD_17H_DF_F3) },
	{ PCI_VDEVICE(HYGON, PCI_DEVICE_ID_AMD_17H_M30H_DF_F3) },
	{ PCI_VDEVICE(HYGON, PCI_DEVICE_ID_HYGON_18H_M05H_DF_F3) },
	{ PCI_VDEVICE(HYGON, PCI_DEVICE_ID_HYGON_18H_M10H_DF_F3) },
	{}
};
MODULE_DEVICE_TABLE(pci, k10temp_id_table);
Loading