[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1416413091-13452-7-git-send-email-tomasz.nowicki@linaro.org>
Date: Wed, 19 Nov 2014 17:04:51 +0100
From: Tomasz Nowicki <tomasz.nowicki@...aro.org>
To: catalin.marinas@....com, will.deacon@....com, bhelgaas@...gle.com,
lorenzo.pieralisi@....com, wangyijing@...wei.com, arnd@...db.de,
hanjun.guo@...aro.org, Liviu.Dudau@....com, tglx@...utronix.de,
mingo@...hat.com, hpa@...or.com, rjw@...ysocki.net
Cc: linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
x86@...nel.org, linux-pci@...r.kernel.org,
linux-acpi@...r.kernel.org, linaro-acpi@...ts.linaro.org,
Tomasz Nowicki <tomasz.nowicki@...aro.org>
Subject: [PATCH 6/6] pci, acpi: Share ACPI PCI config space accessors.
MMCFG can be used perfectly for all architectures which support ACPI.
ACPI mandates MMCFG to describe PCI config space ranges which means
we should use MMCONFIG accessors by default.
Signed-off-by: Tomasz Nowicki <tomasz.nowicki@...aro.org>
Tested-by: Hanjun Guo <hanjun.guo@...aro.org>
---
drivers/acpi/mmconfig.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/drivers/acpi/mmconfig.c b/drivers/acpi/mmconfig.c
index c0ad05f..c9c6e05 100644
--- a/drivers/acpi/mmconfig.c
+++ b/drivers/acpi/mmconfig.c
@@ -23,6 +23,26 @@ static DEFINE_MUTEX(pci_mmcfg_lock);
LIST_HEAD(pci_mmcfg_list);
+/*
+ * raw_pci_read/write - ACPI PCI config space accessors.
+ *
+ * ACPI spec defines MMCFG as the way we can access PCI config space,
+ * so let MMCFG be default (__weak).
+ *
+ * If platform needs more fancy stuff, should provides its own implementation.
+ */
+int __weak raw_pci_read(unsigned int domain, unsigned int bus,
+ unsigned int devfn, int reg, int len, u32 *val)
+{
+ return pci_mmcfg_read(domain, bus, devfn, reg, len, val);
+}
+
+int __weak raw_pci_write(unsigned int domain, unsigned int bus,
+ unsigned int devfn, int reg, int len, u32 val)
+{
+ return pci_mmcfg_write(domain, bus, devfn, reg, len, val);
+}
+
static char __iomem *pci_dev_base(unsigned int seg, unsigned int bus,
unsigned int devfn)
{
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists