From patchwork Fri Sep 12 14:00:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 37331 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 166B3203EE for ; Fri, 12 Sep 2014 14:02:19 +0000 (UTC) Received: by mail-wi0-f198.google.com with SMTP id cc10sf364457wib.5 for ; Fri, 12 Sep 2014 07:02:14 -0700 (PDT) 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:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=dF5XlabkNxAasN74PUHxEgko3fWTol7Ozhr9cmvsRH8=; b=OPJUWK1oXj+WBVUFp42+47ATSo4MNWrHLeOPuWlZ9yMqg+e8FPFOlPWUujoMYfomR3 kRV4ATUkPV1/rxUTEmlz0la+dbBXTUhGEnt98UVS0m1znpgw1CSNq1wFyP5Qo+ZbUbhy QQlMwvFR6jWdRSWgP4CIEIuU/ylka5nM7Fucuxl+iw7eqRUskA701Njim2PsmTnYjem3 mgdJJWcB4vGwWN6zv6O0pukAKox6VfZ+gT4eEaO9waR/20EAsBby7wUJka6YBBIVyguE lOjIUbul87zFGdARf8H1oiKsO78UBMva41h8nTDe4JWnSDwc0xOa3vM1cMicqMPxwVcJ UDqg== X-Gm-Message-State: ALoCoQkC7WoeSTMst6F38OqLDmiwB7OCa8E6+/FF3cgbm8A80klTqlq2Bl7e3xQQx6LaOVou/ZwY X-Received: by 10.152.6.195 with SMTP id d3mr833584laa.10.1410530534440; Fri, 12 Sep 2014 07:02:14 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.9 with SMTP id o9ls152535lao.97.gmail; Fri, 12 Sep 2014 07:02:14 -0700 (PDT) X-Received: by 10.112.170.138 with SMTP id am10mr8823184lbc.74.1410530534265; Fri, 12 Sep 2014 07:02:14 -0700 (PDT) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com [209.85.217.179]) by mx.google.com with ESMTPS id qj5si6659754lbb.89.2014.09.12.07.02.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 12 Sep 2014 07:02:14 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by mail-lb0-f179.google.com with SMTP id p9so910478lbv.24 for ; Fri, 12 Sep 2014 07:02:14 -0700 (PDT) X-Received: by 10.152.22.137 with SMTP id d9mr9227818laf.29.1410530534105; Fri, 12 Sep 2014 07:02:14 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.141.42 with SMTP id rl10csp737728lbb; Fri, 12 Sep 2014 07:02:13 -0700 (PDT) X-Received: by 10.70.95.138 with SMTP id dk10mr14126716pdb.66.1410530532204; Fri, 12 Sep 2014 07:02:12 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v3si8191344pdh.66.2014.09.12.07.02.11 for ; Fri, 12 Sep 2014 07:02:12 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755146AbaILOBd (ORCPT + 27 others); Fri, 12 Sep 2014 10:01:33 -0400 Received: from mail-pd0-f177.google.com ([209.85.192.177]:64470 "EHLO mail-pd0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755105AbaILOB2 (ORCPT ); Fri, 12 Sep 2014 10:01:28 -0400 Received: by mail-pd0-f177.google.com with SMTP id y10so1301724pdj.22 for ; Fri, 12 Sep 2014 07:01:28 -0700 (PDT) X-Received: by 10.70.45.41 with SMTP id j9mr13712847pdm.85.1410530486550; Fri, 12 Sep 2014 07:01:26 -0700 (PDT) Received: from localhost ([111.140.73.43]) by mx.google.com with ESMTPSA id rw8sm4089444pbc.11.2014.09.12.07.01.25 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 12 Sep 2014 07:01:25 -0700 (PDT) From: Hanjun Guo To: Catalin Marinas , "Rafael J. Wysocki" , Mark Rutland , Olof Johansson , Grant Likely , Will Deacon Cc: Graeme Gregory , Arnd Bergmann , Sudeep Holla , Jon Masters , Jason Cooper , Marc Zyngier , Bjorn Helgaas , Daniel Lezcano , Mark Brown , Rob Herring , Robert Richter , Lv Zheng , Robert Moore , Lorenzo Pieralisi , Liviu Dudau , Randy Dunlap , Charles.Garcia-Tobin@arm.com, linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linaro-acpi@lists.linaro.org, Hanjun Guo Subject: [PATCH v4 08/18] ARM64 / ACPI: Make PCI optional for ACPI on ARM64 Date: Fri, 12 Sep 2014 22:00:06 +0800 Message-Id: <1410530416-30200-9-git-send-email-hanjun.guo@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1410530416-30200-1-git-send-email-hanjun.guo@linaro.org> References: <1410530416-30200-1-git-send-email-hanjun.guo@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: hanjun.guo@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , As PCI for ARM64 is not ready, so introduce some stub functions to make PCI optional for ACPI, and make ACPI core run without CONFIG_PCI on ARM64. Since ACPI on X86 and IA64 depends on PCI and this patch only makes PCI optional for ARM64, it will not break anything on X86 and IA64. Signed-off-by: Hanjun Guo --- arch/arm64/include/asm/pci.h | 11 +++++++++++ drivers/acpi/Makefile | 2 +- drivers/acpi/internal.h | 5 +++++ include/linux/pci.h | 37 +++++++++++++++++++++++++++---------- 4 files changed, 44 insertions(+), 11 deletions(-) create mode 100644 arch/arm64/include/asm/pci.h diff --git a/arch/arm64/include/asm/pci.h b/arch/arm64/include/asm/pci.h new file mode 100644 index 0000000..250cd24 --- /dev/null +++ b/arch/arm64/include/asm/pci.h @@ -0,0 +1,11 @@ +#ifndef __ASM_PCI_H +#define __ASM_PCI_H +#ifdef __KERNEL__ + +/* + * PCI address space differs from physical memory address space + */ +#define PCI_DMA_BUS_IS_PHYS (0) + +#endif /* __KERNEL__ */ +#endif /* __ASM_PCI_H */ diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile index 89837f8..6f3a74d 100644 --- a/drivers/acpi/Makefile +++ b/drivers/acpi/Makefile @@ -43,7 +43,7 @@ acpi-y += processor_core.o acpi-$(CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC) += processor_pdc.o acpi-y += ec.o acpi-$(CONFIG_ACPI_DOCK) += dock.o -acpi-y += pci_root.o pci_link.o pci_irq.o +acpi-$(CONFIG_PCI) += pci_root.o pci_link.o pci_irq.o acpi-y += acpi_lpss.o acpi-y += acpi_platform.o acpi-y += acpi_pnp.o diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h index 4c5cf77..e1e6487 100644 --- a/drivers/acpi/internal.h +++ b/drivers/acpi/internal.h @@ -26,8 +26,13 @@ acpi_status acpi_os_initialize1(void); int init_acpi_device_notify(void); int acpi_scan_init(void); +#ifdef CONFIG_PCI void acpi_pci_root_init(void); void acpi_pci_link_init(void); +#else +static inline void acpi_pci_root_init(void) {} +static inline void acpi_pci_link_init(void) {} +#endif void acpi_processor_init(void); void acpi_platform_init(void); void acpi_pnp_init(void); diff --git a/include/linux/pci.h b/include/linux/pci.h index 61978a4..50fa750 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -558,15 +558,6 @@ struct pci_ops { int (*write)(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 val); }; -/* - * ACPI needs to be able to access PCI config space before we've done a - * PCI bus scan and created pci_bus structures. - */ -int raw_pci_read(unsigned int domain, unsigned int bus, unsigned int devfn, - int reg, int len, u32 *val); -int raw_pci_write(unsigned int domain, unsigned int bus, unsigned int devfn, - int reg, int len, u32 val); - struct pci_bus_region { dma_addr_t start; dma_addr_t end; @@ -1293,6 +1284,16 @@ typedef int (*arch_set_vga_state_t)(struct pci_dev *pdev, bool decode, unsigned int command_bits, u32 flags); void pci_register_set_vga_state(arch_set_vga_state_t func); +/* + * ACPI needs to be able to access PCI config space before we've done a + * PCI bus scan and created pci_bus structures. + */ +int raw_pci_read(unsigned int domain, unsigned int bus, unsigned int devfn, + int reg, int len, u32 *val); +int raw_pci_write(unsigned int domain, unsigned int bus, unsigned int devfn, + int reg, int len, u32 val); +void pcibios_penalize_isa_irq(int irq, int active); + #else /* CONFIG_PCI is not enabled */ /* @@ -1394,6 +1395,23 @@ static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus, unsigned int devfn) { return NULL; } +static inline struct pci_bus *pci_find_bus(int domain, int busnr) +{ return NULL; } + +static inline int pci_bus_write_config_byte(struct pci_bus *bus, + unsigned int devfn, int where, u8 val) +{ return -ENOSYS; } + +static inline int raw_pci_read(unsigned int domain, unsigned int bus, + unsigned int devfn, int reg, int len, u32 *val) +{ return -ENOSYS; } + +static inline int raw_pci_write(unsigned int domain, unsigned int bus, + unsigned int devfn, int reg, int len, u32 val) +{ return -ENOSYS; } + +static inline void pcibios_penalize_isa_irq(int irq, int active) { } + static inline int pci_domain_nr(struct pci_bus *bus) { return 0; } static inline struct pci_dev *pci_dev_get(struct pci_dev *dev) { return NULL; } @@ -1607,7 +1625,6 @@ int pcibios_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state); int pcibios_add_device(struct pci_dev *dev); void pcibios_release_device(struct pci_dev *dev); -void pcibios_penalize_isa_irq(int irq, int active); #ifdef CONFIG_HIBERNATE_CALLBACKS extern struct dev_pm_ops pcibios_pm_ops;