From patchwork Fri Apr 25 13:20:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 4062531 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 59B22BFF02 for ; Fri, 25 Apr 2014 13:26:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 839942034A for ; Fri, 25 Apr 2014 13:26:36 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (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 A010320170 for ; Fri, 25 Apr 2014 13:26:35 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wdg70-0008UT-3X; Fri, 25 Apr 2014 13:24:18 +0000 Received: from mail-pa0-f51.google.com ([209.85.220.51]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wdg6m-0007ye-Eh for linux-arm-kernel@lists.infradead.org; Fri, 25 Apr 2014 13:24:04 +0000 Received: by mail-pa0-f51.google.com with SMTP id fb1so2533313pad.10 for ; Fri, 25 Apr 2014 06:23:43 -0700 (PDT) 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=qJ0tVS2TbhZAGfQ5PHmCrnm86Uay2O4INq9VpCTVCUw=; b=echjqINVpbn9NmA7LaKPzYJvziJkHlcrSgJOuMaZBVlNw1kRUZo1g6Pc2n6+P6hHBv BnrbkbJ7N1fyNrnwO9RG0tzDkbeCofoL568uQbwqi2+gTlY/HB28xJNrypW8g2Y5OMAR Hui1cvlp+iuAsahr+MFltBGohW7Sau5hbvUNB5bBaFycp+hPTB6P3cYGT2R5P5vnMChI s+XEyxv2RADUDymHr1LbBaULYhpwkg5J3vVr6Nt3V2yPqjlaviyKeIFG2dW1dAl/IX9B kBeDN4ZhQxPdLUMnVPJZ5H2TpxNixq7AvQUc9eYTYxrGte18Cgv/kJZm5kwjRNtH3N8o EWwg== X-Gm-Message-State: ALoCoQmrb4zw4EmDUDtsMVYwK1FtrGZxdALZV95kClWl0QUQAHrfqHxH90ylX+Ieoeb9srQJHpNP X-Received: by 10.66.240.70 with SMTP id vy6mr7837868pac.80.1398432223075; Fri, 25 Apr 2014 06:23:43 -0700 (PDT) Received: from localhost ([218.17.215.175]) by mx.google.com with ESMTPSA id pr4sm15959360pbb.53.2014.04.25.06.23.33 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 25 Apr 2014 06:23:42 -0700 (PDT) From: Hanjun Guo To: linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org Subject: [PATCH v3 part1 08/11] ARM64 / ACPI: Introduce PCI functions for ACPI on ARM64 Date: Fri, 25 Apr 2014 21:20:14 +0800 Message-Id: <1398432017-8506-9-git-send-email-hanjun.guo@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1398432017-8506-1-git-send-email-hanjun.guo@linaro.org> References: <1398432017-8506-1-git-send-email-hanjun.guo@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140425_062404_525518_4ABAAE06 X-CRM114-Status: GOOD ( 12.85 ) X-Spam-Score: -0.1 (/) Cc: Mark Rutland , Rob Herring , Graeme Gregory , Arnd Bergmann , Mark Brown , Catalin Marinas , linaro-acpi@lists.linaro.org, "Rafael J. Wysocki" , Will Deacon , Al Stone , Olof Johansson , Hanjun Guo , Sudeep Holla , Grant Likely , 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=-1.8 required=5.0 tests=BAYES_00, 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 CONFIG_ACPI depends CONFIG_PCI now, and ACPI provides ACPI based PCI hotplug and PCI host bridge hotplug, introduce some PCI functions to make ACPI core can be compiled, some of the functions should be revisited when implemented on ARM64. Signed-off-by: Hanjun Guo Signed-off-by: Graeme Gregory Signed-off-by: Al Stone --- arch/arm64/include/asm/pci.h | 11 +++++++++++ arch/arm64/kernel/pci.c | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/arch/arm64/include/asm/pci.h b/arch/arm64/include/asm/pci.h index d93576f..0aa3607 100644 --- a/arch/arm64/include/asm/pci.h +++ b/arch/arm64/include/asm/pci.h @@ -21,6 +21,17 @@ struct pci_host_bridge *find_pci_host_bridge(struct pci_bus *bus); #define pcibios_assign_all_busses() \ (pci_has_flag(PCI_REASSIGN_ALL_BUS)) +static inline void pcibios_penalize_isa_irq(int irq, int active) +{ + /* we don't do dynamic pci irq allocation */ +} + +static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) +{ + /* no legacy IRQ on arm64 */ + return -ENODEV; +} + /* * PCI address space differs from physical memory address space */ diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c index 9f29c9a..df90bad 100644 --- a/arch/arm64/kernel/pci.c +++ b/arch/arm64/kernel/pci.c @@ -17,6 +17,7 @@ #include #include #include +#include #include @@ -171,3 +172,36 @@ unsigned long pci_ioremap_io(const struct resource *res, phys_addr_t phys_addr) /* return io_offset */ return start * PAGE_SIZE - res->start; } + +/* + * raw_pci_read - Platform-specific PCI config space access. + * + * Default empty implementation. Replace with an architecture-specific setup + * routine, if necessary. + */ +int raw_pci_read(unsigned int domain, unsigned int bus, + unsigned int devfn, int reg, int len, u32 *val) +{ + return -EINVAL; +} + +int raw_pci_write(unsigned int domain, unsigned int bus, + unsigned int devfn, int reg, int len, u32 val) +{ + return -EINVAL; +} + +#ifdef CONFIG_ACPI +/* Root bridge scanning */ +struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root) +{ + /* TODO: Should be revisited when implementing PCI on ACPI */ + return NULL; +} + +void __init pci_acpi_crs_quirks(void) +{ + /* Do nothing on ARM64 */ + return; +} +#endif