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: 23323 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f69.google.com (mail-vb0-f69.google.com [209.85.212.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C668620540 for ; Fri, 17 Jan 2014 12:36:47 +0000 (UTC) Received: by mail-vb0-f69.google.com with SMTP id m10sf6157477vbh.8 for ; Fri, 17 Jan 2014 04:36:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=5QP59l2c3VvO6ejRn51ApEBt0IbfcbSMs23GLho2JYQ=; b=W5hPJAHODQ6wxdD6PxKm69HAWmfsYndSea1hv83P3OjtBLt/ZX86YFFUyqDPslS343 MvzSrrcuy7vxLyYpn26XXb70LC/BhbLtuc0ULuGq1OXwHX6lLCf7kpP8QH+XDe1/ohTR tk2lw4sXv8wLJzbVb92hpG4vrYh6hgOeuhcbwQvmJ0MrS6999CkSb8Ahtv+jn0Gp4IIE B4A6hqDb1hdcau8TLZZOf2BOVIAYVrvBV1ZEbroRJGRJa0N6yaKZVv80PE2NeApunloe tveKwBZyrYhaOoXYBQjd97cq9Cq+n5tvT/t0R9rvSN9WaAeC8CC8dXfK26cAbJtZ5/gR XjIA== X-Gm-Message-State: ALoCoQnkA7Rqe30CxO/1fLnjfa8pvR8ZXF1+aczPtBa7iH5uU8X+n7c/1rR8P3Yy3X2cu1Q8JNLQ X-Received: by 10.224.55.81 with SMTP id t17mr607759qag.3.1389962206972; Fri, 17 Jan 2014 04:36:46 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.42.138 with SMTP id c10ls443810qga.62.gmail; Fri, 17 Jan 2014 04:36:46 -0800 (PST) X-Received: by 10.220.110.210 with SMTP id o18mr77423vcp.49.1389962206842; Fri, 17 Jan 2014 04:36:46 -0800 (PST) Received: from mail-vb0-f52.google.com (mail-vb0-f52.google.com [209.85.212.52]) by mx.google.com with ESMTPS id gq3si4833574vdc.106.2014.01.17.04.36.46 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 17 Jan 2014 04:36:46 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.52 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.52; Received: by mail-vb0-f52.google.com with SMTP id p14so1544230vbm.11 for ; Fri, 17 Jan 2014 04:36:46 -0800 (PST) X-Received: by 10.52.108.40 with SMTP id hh8mr67570vdb.51.1389962206742; Fri, 17 Jan 2014 04:36:46 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.59.13.131 with SMTP id ey3csp16434ved; Fri, 17 Jan 2014 04:36:45 -0800 (PST) X-Received: by 10.68.197.234 with SMTP id ix10mr1874283pbc.80.1389962205354; Fri, 17 Jan 2014 04:36:45 -0800 (PST) Received: from mail-pd0-f169.google.com (mail-pd0-f169.google.com [209.85.192.169]) by mx.google.com with ESMTPS id ye6si10038005pbc.110.2014.01.17.04.36.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 17 Jan 2014 04:36:45 -0800 (PST) Received-SPF: neutral (google.com: 209.85.192.169 is neither permitted nor denied by best guess record for domain of hanjun.guo@linaro.org) client-ip=209.85.192.169; Received: by mail-pd0-f169.google.com with SMTP id v10so3947456pde.14 for ; Fri, 17 Jan 2014 04:36:45 -0800 (PST) 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 Cc: linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Grant Likely , Matthew Garrett , Olof Johansson , Linus Walleij , Bjorn Helgaas , Rob Herring , Mark Rutland , Arnd Bergmann , patches@linaro.org, linux-kernel@vger.kernel.org, linaro-kernel@lists.linaro.org, linaro-acpi@lists.linaro.org, Charles.Garcia-Tobin@arm.com, Hanjun Guo 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-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: hanjun.guo@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.52 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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