Linux PCI subsystem development
 help / color / mirror / Atom feed
* [PATCH v1 1/2] x86/PCI: Get rid of custom x86 model comparison
@ 2020-07-13 19:44 Andy Shevchenko
  2020-07-13 19:44 ` [PATCH v1 2/2] x86/PCI: Describe @reg for type1_access_ok() Andy Shevchenko
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Andy Shevchenko @ 2020-07-13 19:44 UTC (permalink / raw)
  To: Bjorn Helgaas, x86, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	H. Peter Anvin, linux-pci
  Cc: Andy Shevchenko

Switch the platform code to use x86_id_table and accompanying API
instead of custom comparison against x86 CPU model.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 arch/x86/pci/intel_mid_pci.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/arch/x86/pci/intel_mid_pci.c b/arch/x86/pci/intel_mid_pci.c
index 00c62115f39c..d8af4787e616 100644
--- a/arch/x86/pci/intel_mid_pci.c
+++ b/arch/x86/pci/intel_mid_pci.c
@@ -28,10 +28,12 @@
 #include <linux/io.h>
 #include <linux/smp.h>
 
+#include <asm/cpu_device_id.h>
 #include <asm/segment.h>
 #include <asm/pci_x86.h>
 #include <asm/hw_irq.h>
 #include <asm/io_apic.h>
+#include <asm/intel-family.h>
 #include <asm/intel-mid.h>
 
 #define PCIE_CAP_OFFSET	0x100
@@ -211,9 +213,16 @@ static int pci_write(struct pci_bus *bus, unsigned int devfn, int where,
 			       where, size, value);
 }
 
+static const struct x86_cpu_id intel_mid_cpu_ids[] = {
+	X86_MATCH_INTEL_FAM6_MODEL(ATOM_SILVERMONT_MID, NULL),
+	{}
+};
+
 static int intel_mid_pci_irq_enable(struct pci_dev *dev)
 {
+	const struct x86_cpu_id *id;
 	struct irq_alloc_info info;
+	u16 model = 0;
 	int polarity;
 	int ret;
 	u8 gsi;
@@ -227,8 +236,12 @@ static int intel_mid_pci_irq_enable(struct pci_dev *dev)
 		return ret;
 	}
 
-	switch (intel_mid_identify_cpu()) {
-	case INTEL_MID_CPU_CHIP_TANGIER:
+	id = x86_match_cpu(intel_mid_cpu_ids);
+	if (id)
+		model = id->model;
+
+	switch (model) {
+	case INTEL_FAM6_ATOM_SILVERMONT_MID:
 		polarity = IOAPIC_POL_HIGH;
 
 		/* Special treatment for IRQ0 */
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-07-14 19:29 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-13 19:44 [PATCH v1 1/2] x86/PCI: Get rid of custom x86 model comparison Andy Shevchenko
2020-07-13 19:44 ` [PATCH v1 2/2] x86/PCI: Describe @reg for type1_access_ok() Andy Shevchenko
2020-07-13 19:59   ` Bjorn Helgaas
2020-07-13 20:03     ` Andy Shevchenko
2020-07-13 21:02       ` Bjorn Helgaas
2020-07-14  9:09         ` Andy Shevchenko
2020-07-13 20:59 ` [NEEDS-REVIEW] [PATCH v1 1/2] x86/PCI: Get rid of custom x86 model comparison Dave Hansen
2020-07-14  9:35   ` Andy Shevchenko
2020-07-13 21:02 ` Bjorn Helgaas
2020-07-14  9:38   ` Andy Shevchenko
2020-07-14 19:02     ` Bjorn Helgaas
2020-07-14 19:29       ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox