From: Konrad Rzeszutek Wilk <konrad@kernel.org>
To: andrew.cooper3@citrix.com, aravind.gopalakrishnan@amd.com,
xen-devel@lists.xenproject.org, jbeulich@suse.com, keir@xen.org
Subject: [PATCH v3 5/6] pci: Use #defines for PCI vendors.
Date: Wed, 12 Mar 2014 11:27:51 -0400 [thread overview]
Message-ID: <1394638072-11331-6-git-send-email-konrad.wilk@oracle.com> (raw)
In-Reply-To: <1394638072-11331-1-git-send-email-konrad.wilk@oracle.com>
Instead of having hard-coded values. We only do PCI vendors
as Jan requested and put all PCI device vendors in one
new file.
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
[v1: Sorted them based on their numerical values per Jan's review]
Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
xen/arch/x86/oprofile/op_model_athlon.c | 4 ++--
xen/arch/x86/x86_64/mmconf-fam10h.c | 1 +
xen/arch/x86/x86_64/mmconfig-shared.c | 1 +
xen/arch/x86/x86_64/mmconfig.h | 4 ----
xen/drivers/char/ns16550.c | 5 +++--
xen/include/xen/pci_ids.h | 9 +++++++++
6 files changed, 16 insertions(+), 8 deletions(-)
create mode 100644 xen/include/xen/pci_ids.h
diff --git a/xen/arch/x86/oprofile/op_model_athlon.c b/xen/arch/x86/oprofile/op_model_athlon.c
index ad84768..204343d 100644
--- a/xen/arch/x86/oprofile/op_model_athlon.c
+++ b/xen/arch/x86/oprofile/op_model_athlon.c
@@ -20,7 +20,8 @@
#include <asm/current.h>
#include <asm/hvm/support.h>
#include <xen/pci_regs.h>
-
+#include <xen/pci_ids.h>
+
#include "op_x86_model.h"
#include "op_counter.h"
@@ -445,7 +446,6 @@ static inline void __init init_ibs_nmi_per_cpu(void *arg)
apic_write(reg, APIC_EILVT_MSG_NMI << 8);
}
-#define PCI_VENDOR_ID_AMD 0x1022
#define PCI_DEVICE_ID_AMD_10H_NB_MISC 0x1203
#define IBSCTL 0x1cc
static int __init init_ibs_nmi(void)
diff --git a/xen/arch/x86/x86_64/mmconf-fam10h.c b/xen/arch/x86/x86_64/mmconf-fam10h.c
index 1373acb..65260f6 100644
--- a/xen/arch/x86/x86_64/mmconf-fam10h.c
+++ b/xen/arch/x86/x86_64/mmconf-fam10h.c
@@ -6,6 +6,7 @@
#include <xen/acpi.h>
#include <xen/pci.h>
#include <xen/pci_regs.h>
+#include <xen/pci_ids.h>
#include <xen/init.h>
#include <xen/dmi.h>
#include <asm/amd.h>
diff --git a/xen/arch/x86/x86_64/mmconfig-shared.c b/xen/arch/x86/x86_64/mmconfig-shared.c
index 7589b64..742bc18 100644
--- a/xen/arch/x86/x86_64/mmconfig-shared.c
+++ b/xen/arch/x86/x86_64/mmconfig-shared.c
@@ -19,6 +19,7 @@
#include <xen/xmalloc.h>
#include <xen/pci.h>
#include <xen/pci_regs.h>
+#include <xen/pci_ids.h>
#include <asm/e820.h>
#include <asm/msr.h>
#include <asm/msr-index.h>
diff --git a/xen/arch/x86/x86_64/mmconfig.h b/xen/arch/x86/x86_64/mmconfig.h
index 36e0448..c447e5a 100644
--- a/xen/arch/x86/x86_64/mmconfig.h
+++ b/xen/arch/x86/x86_64/mmconfig.h
@@ -17,7 +17,6 @@
* Author: Allen Kay <allen.m.kay@intel.com> - adapted from linux
*/
-#define PCI_VENDOR_ID_INTEL 0x8086
#define PCI_DEVICE_ID_INTEL_E7520_MCH 0x3590
#define PCI_DEVICE_ID_INTEL_82945G_HB 0x2770
@@ -29,11 +28,8 @@
#define PCI_PROBE_MASK 0x000f
#define PCI_PROBE_NOEARLY 0x0010
-#define PCI_VENDOR_ID_AMD 0x1022
#define PCI_CHECK_ENABLE_AMD_MMCONF 0x20000
-#define PCI_VENDOR_ID_NVIDIA 0x10de
-
extern unsigned int pci_probe;
/*
diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index 66d10f7..fd66238 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -19,6 +19,7 @@
#ifdef HAS_PCI
#include <xen/pci.h>
#include <xen/pci_regs.h>
+#include <xen/pci_ids.h>
#endif
#include <xen/8250-uart.h>
#include <xen/vmap.h>
@@ -135,13 +136,13 @@ static const struct ns16550_config_mmio __initconst uart_config[] =
{
/* Broadcom TruManage device */
{
- .vendor_id = 0x14e4,
+ .vendor_id = PCI_VENDOR_ID_BROADCOM,
.dev_id = 0x160a,
.param = param_trumanage,
},
/* OXPCIe952 1 Native UART */
{
- .vendor_id = 0x1415,
+ .vendor_id = PCI_VENDOR_ID_OXSEMI,
.dev_id = 0xc138,
.param = param_oxford,
}
diff --git a/xen/include/xen/pci_ids.h b/xen/include/xen/pci_ids.h
new file mode 100644
index 0000000..f5b1d94
--- /dev/null
+++ b/xen/include/xen/pci_ids.h
@@ -0,0 +1,9 @@
+#define PCI_VENDOR_ID_AMD 0x1022
+
+#define PCI_VENDOR_ID_NVIDIA 0x10de
+
+#define PCI_VENDOR_ID_OXSEMI 0x1415
+
+#define PCI_VENDOR_ID_BROADCOM 0x14e4
+
+#define PCI_VENDOR_ID_INTEL 0x8086
--
1.7.7.6
next prev parent reply other threads:[~2014-03-12 15:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-12 15:27 [PATCH v3]/[GIT PULL] Enable serial output for Oxford Semiconductor PCIe cards and fix bugs Konrad Rzeszutek Wilk
2014-03-12 15:27 ` [PATCH v3 1/6] serial: Skip over PCIe device which have no quirks (fix AMT regression) Konrad Rzeszutek Wilk
2014-03-12 15:27 ` [PATCH v3 2/6] serial: Fix COM1 assumption if pci_uart_config did not find the AMT card Konrad Rzeszutek Wilk
2014-03-12 15:27 ` [PATCH v3 3/6] serial: Support OXPCIe952 aka Oxford Semiconductor Ltd Device c138 (1415:c138) Konrad Rzeszutek Wilk
2014-03-12 15:27 ` [PATCH v3 4/6] serial: Seperate the PCI device ids and parameters (v1) Konrad Rzeszutek Wilk
2014-03-12 15:27 ` Konrad Rzeszutek Wilk [this message]
2014-03-12 15:27 ` [PATCH v3 6/6] serial: Expand the PCI serial quirks for OXPCIe200 and OXPCIe952 1 Native UART Konrad Rzeszutek Wilk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1394638072-11331-6-git-send-email-konrad.wilk@oracle.com \
--to=konrad@kernel.org \
--cc=andrew.cooper3@citrix.com \
--cc=aravind.gopalakrishnan@amd.com \
--cc=jbeulich@suse.com \
--cc=keir@xen.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).