From patchwork Fri Jan 17 12:25:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 3503951 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 400F1C02DC for ; Fri, 17 Jan 2014 12:37:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6CFFC2010F for ; Fri, 17 Jan 2014 12:37:17 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 62DEF200ED for ; Fri, 17 Jan 2014 12:37:16 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W48fg-0007ff-RK; Fri, 17 Jan 2014 12:37:12 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1W48fe-0007VI-Da; Fri, 17 Jan 2014 12:37:10 +0000 Received: from mail-pa0-f50.google.com ([209.85.220.50]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W48fb-0007UQ-DN for linux-arm-kernel@lists.infradead.org; Fri, 17 Jan 2014 12:37:08 +0000 Received: by mail-pa0-f50.google.com with SMTP id kp14so4094074pab.9 for ; Fri, 17 Jan 2014 04:36:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=5QP59l2c3VvO6ejRn51ApEBt0IbfcbSMs23GLho2JYQ=; b=kmakSUvuwCwUwgIy6OnVPjExT8QHZvOIbnGpt6gvLhVG2Bn1QO0eB2S3KQnFqsrMu9 d/GH8rrUOROwCI+ekQYocgUUllZ1BUNMvZOlpApUztpuUmWNH6WcjXd7saqrpPlzCctb nbD1rpNh2c9Yb4Mf4PUdSvIQm1UWIXl8C0OtmdoYkBvqRph+uz4moyQUd6DZi1PWUSCm fAn8Ds5BwRjWpq1O4uRc8V12pjBeUz1CwwjERQ3Bpp3A4ZpvUO8Vh/bxR7HSZsNyyeKT H46vGT0awbveyYpi8hI7iMdJb8eTCqgG1sT0qUZ1VgvZ2lbfZjkPAZSFfqdAtJ3Cl2JW xRew== X-Gm-Message-State: ALoCoQmoNe0Umgcm0fITcX4luQOeLc81OMovmV+IC+THRBAP0AnD2cu4575sr9oROremqhMDpbgi X-Received: by 10.66.136.131 with SMTP id qa3mr1746081pab.77.1389962204945; Fri, 17 Jan 2014 04:36:44 -0800 (PST) Received: from localhost ([218.17.215.175]) by mx.google.com with ESMTPSA id sy10sm30252975pac.15.2014.01.17.04.34.50 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 17 Jan 2014 04:36:44 -0800 (PST) From: Hanjun Guo To: "Rafael J. Wysocki" , Catalin Marinas , Will Deacon , Russell King - ARM Linux Subject: [PATCH 06/20] ARM64 / ACPI: Introduce some PCI functions when PCI is enabled Date: Fri, 17 Jan 2014 20:25:00 +0800 Message-Id: <1389961514-13562-7-git-send-email-hanjun.guo@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1389961514-13562-1-git-send-email-hanjun.guo@linaro.org> References: <1389961514-13562-1-git-send-email-hanjun.guo@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140117_073707_521206_92CE299C X-CRM114-Status: GOOD ( 13.74 ) X-Spam-Score: -1.8 (-) Cc: Mark Rutland , Matthew Garrett , linaro-kernel@lists.linaro.org, Arnd Bergmann , Rob Herring , Linus Walleij , Olof Johansson , linux-kernel@vger.kernel.org, linaro-acpi@lists.linaro.org, linux-acpi@vger.kernel.org, Hanjun Guo , patches@linaro.org, Grant Likely , Bjorn Helgaas , linux-arm-kernel@lists.infradead.org, Charles.Garcia-Tobin@arm.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_WEB, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Introduce some PCI functions to make ACPI can be compiled when CONFIG_PCI is enabled, these functions should be revisited when implemented on ARM64. Signed-off-by: Hanjun Guo --- arch/arm64/Makefile | 1 + arch/arm64/pci/Makefile | 1 + arch/arm64/pci/pci.c | 33 +++++++++++++++++++++++++++++++++ drivers/acpi/plat/arm-core.c | 19 +++++++++++++++++++ 4 files changed, 54 insertions(+) create mode 100644 arch/arm64/pci/Makefile create mode 100644 arch/arm64/pci/pci.c diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index 2fceb71..fcaa58e 100644 --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile @@ -45,6 +45,7 @@ export TEXT_OFFSET GZFLAGS core-y += arch/arm64/kernel/ arch/arm64/mm/ core-$(CONFIG_KVM) += arch/arm64/kvm/ core-$(CONFIG_XEN) += arch/arm64/xen/ +drivers-$(CONFIG_PCI) += arch/arm64/pci/ libs-y := arch/arm64/lib/ $(libs-y) libs-y += $(LIBGCC) diff --git a/arch/arm64/pci/Makefile b/arch/arm64/pci/Makefile new file mode 100644 index 0000000..b8d5dbd --- /dev/null +++ b/arch/arm64/pci/Makefile @@ -0,0 +1 @@ +obj-y += pci.o diff --git a/arch/arm64/pci/pci.c b/arch/arm64/pci/pci.c new file mode 100644 index 0000000..4e46790 --- /dev/null +++ b/arch/arm64/pci/pci.c @@ -0,0 +1,33 @@ +#include +#include +#include +#include + +/** + * raw_pci_read - Platform-specific PCI config space access. + * + * Default empty implementation. Replace with an architecture-specific setup + * routine, if necessary. + */ +int __weak raw_pci_read(unsigned int domain, unsigned int bus, + unsigned int devfn, int reg, int len, u32 *val) +{ + return -EINVAL; +} + +int __weak raw_pci_write(unsigned int domain, unsigned int bus, + unsigned int devfn, int reg, int len, u32 val) +{ + return -EINVAL; +} + +/* Root bridge scanning */ +struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root) +{ + return NULL; +} + +void __init pci_acpi_crs_quirks(void) +{ + return; +} diff --git a/drivers/acpi/plat/arm-core.c b/drivers/acpi/plat/arm-core.c index 3c8521d..1835b21 100644 --- a/drivers/acpi/plat/arm-core.c +++ b/drivers/acpi/plat/arm-core.c @@ -100,6 +100,25 @@ int acpi_gsi_to_irq(u32 gsi, unsigned int *irq) } EXPORT_SYMBOL_GPL(acpi_gsi_to_irq); +int acpi_isa_irq_to_gsi(unsigned isa_irq, u32 *gsi) +{ + return -1; +} + +int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base) +{ + /* TBD */ + return -EINVAL; +} +EXPORT_SYMBOL(acpi_register_ioapic); + +int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base) +{ + /* TBD */ + return -EINVAL; +} +EXPORT_SYMBOL(acpi_unregister_ioapic); + /* * success: return IRQ number (>0) * failure: return =< 0