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

!9360 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/8834
https://gitee.com/openeuler/kernel/pulls/1638 
 
Link:https://gitee.com/openeuler/kernel/pulls/9360

 

Reviewed-by: default avatarXie XiuQi <xiexiuqi@huawei.com>
Reviewed-by: default avatarYuan Can <yuancan@huawei.com>
Signed-off-by: default avatarYuan Can <yuancan@huawei.com>
parents 31711b2c 57c54edf
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -24,9 +24,11 @@
#define PCI_DEVICE_ID_AMD_19H_DF_F4	0x1654

#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. */
@@ -83,6 +85,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) },
	{}
};

@@ -90,6 +93,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) },
	{}
};

@@ -97,6 +101,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) },
	{}
};

+2 −1
Original line number Diff line number Diff line
@@ -691,7 +691,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
@@ -2443,6 +2443,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,
@@ -3558,6 +3568,10 @@ static struct amd64_family_type *per_family_init(struct amd64_pvt *pvt)
			fam_type = &family_types[F18_M06H_CPUS];
			pvt->ops = &family_types[F18_M06H_CPUS].ops;
			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
@@ -129,6 +129,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
@@ -303,6 +305,7 @@ enum amd_families {
	F17_M30H_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
@@ -559,6 +559,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