From patchwork Fri Jun 27 03:49:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 4433321 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BD4C29F319 for ; Fri, 27 Jun 2014 03:55:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E1A27201EF for ; Fri, 27 Jun 2014 03:55:41 +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 CC4BE201C0 for ; Fri, 27 Jun 2014 03:55:40 +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 1X0NEQ-0006CN-Bl; Fri, 27 Jun 2014 03:53:46 +0000 Received: from mail-pb0-f50.google.com ([209.85.160.50]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1X0NDW-0004vF-Oc for linux-arm-kernel@lists.infradead.org; Fri, 27 Jun 2014 03:52:51 +0000 Received: by mail-pb0-f50.google.com with SMTP id rp16so4015548pbb.37 for ; Thu, 26 Jun 2014 20:52:29 -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=zV2wuKdMLhcjL7GdhpfGjm9CHhUCNDg0zLQ+oCRodWU=; b=JuOTOp7bQyWM+FkL7T33/RLmG8rDlqc8FlH4QFXf/BjB/rD8GBLzRoA+qUFijOjjKS W4vh6UnDg/0TioqUUweOFJ5/ek3e4EmNAbLPow8iUK0MZlpDu5PgvbpZtfunra+3Gtu5 6ERJJS4gVHw/ai1S62Yk1UuBXneHwKUZGE6hXuKe3H1/uoNJZBkC3twfzEBcBnfhymoE /kv4tLG80OOBYZqDLQVKo9AcR5fqkoKWcw8iOYBs+1zLbnT0RNWN0iYuSNFBo7iaZ/JT +29971sTr44r0dItXsyolQBtA1MbGRRKA0rKYWdDzVcU+m4wAzeJeuY4ZxN7LMa1iXZ2 aZFA== X-Gm-Message-State: ALoCoQkyl3uenIhPU2Lk6PrQvQXFPyjCT10fPh6ibkecVwgEUBHelguQe95bsogGrIpl2kjeSF45 X-Received: by 10.66.164.5 with SMTP id ym5mr27759247pab.50.1403841149096; Thu, 26 Jun 2014 20:52:29 -0700 (PDT) Received: from localhost ([183.247.163.231]) by mx.google.com with ESMTPSA id av2sm12348875pbc.16.2014.06.26.20.52.24 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 26 Jun 2014 20:52:28 -0700 (PDT) From: Hanjun Guo To: "Rafael J. Wysocki" , Catalin Marinas , linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org Subject: [PATCH v4 09/13] ARM64 / ACPI: Introduce PCI functions for ACPI on ARM64 Date: Fri, 27 Jun 2014 11:49:32 +0800 Message-Id: <1403840976-7456-10-git-send-email-hanjun.guo@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1403840976-7456-1-git-send-email-hanjun.guo@linaro.org> References: <1403840976-7456-1-git-send-email-hanjun.guo@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140626_205250_850816_0FC7E8E2 X-CRM114-Status: GOOD ( 11.77 ) X-Spam-Score: -0.7 (/) Cc: Mark Rutland , lorenzo.pieralisi@arm.com, rric@kernel.org, Arnd Bergmann , linaro-acpi@lists.linaro.org, linux-kernel@vger.kernel.org, Grant Likely , Hanjun Guo , Sudeep Holla , Bjorn Helgaas , Charles.Garcia-Tobin@arm.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 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.9 required=5.0 tests=BAYES_00, T_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. Reviewed-by: Grant Likely Originally-by: Graeme Gregory Signed-off-by: Hanjun Guo --- arch/arm64/include/asm/pci.h | 6 ++++++ arch/arm64/kernel/pci.c | 28 ++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/arch/arm64/include/asm/pci.h b/arch/arm64/include/asm/pci.h index d93576f..46501d4 100644 --- a/arch/arm64/include/asm/pci.h +++ b/arch/arm64/include/asm/pci.h @@ -21,6 +21,12 @@ 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 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..1f7aedd 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,30 @@ 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; +} +#endif