From mboxrd@z Thu Jan 1 00:00:00 1970 From: Naresh Bhat Subject: Re: [PATCH 05/19] ARM64 / ACPI: Make PCI optional for ACPI on ARM64 Date: Fri, 25 Jul 2014 03:27:21 +0530 Message-ID: References: <1406206825-15590-1-git-send-email-hanjun.guo@linaro.org> <1406206825-15590-6-git-send-email-hanjun.guo@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1406206825-15590-6-git-send-email-hanjun.guo@linaro.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Hanjun Guo Cc: Mark Rutland , Mark Brown , Catalin Marinas , Will Deacon , Lv Zheng , Lorenzo Pieralisi , Daniel Lezcano , Robert Moore , linux-acpi@vger.kernel.org, Grant Likely , Charles Garcia-Tobin , Robert Richter , Jason Cooper , Arnd Bergmann , Marc Zyngier , Liviu Dudau , linaro-acpi-private@linaro.org, Bjorn Helgaas , linux-arm-kernel@lists.infradead.org, Graeme Gregory , Randy Dunlap , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, Sudeep Holla List-Id: linux-acpi@vger.kernel.org On 24 July 2014 18:30, Hanjun Guo wrote: > > 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 optinal for ARM64, it will not break anything on X86 and IA64. optional > > > 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 505d4d7..8e9bbe6 100644 > --- a/drivers/acpi/Makefile > +++ b/drivers/acpi/Makefile > @@ -39,7 +39,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 466bcd1..27d7354 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 -ENODEV; } > + > +static inline int raw_pci_read(unsigned int domain, unsigned int bus, > + unsigned int devfn, int reg, int len, u32 *val) > +{ return -EINVAL; } > + > +static inline int raw_pci_write(unsigned int domain, unsigned int bus, > + unsigned int devfn, int reg, int len, u32 val) > +{ return -EINVAL; } > + > +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; } > > @@ -1597,7 +1615,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; > -- > 1.7.9.5 > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752063AbaGXWFi (ORCPT ); Thu, 24 Jul 2014 18:05:38 -0400 Received: from mail-oi0-f54.google.com ([209.85.218.54]:39299 "EHLO mail-oi0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751164AbaGXWFh (ORCPT ); Thu, 24 Jul 2014 18:05:37 -0400 X-Greylist: delayed 494 seconds by postgrey-1.27 at vger.kernel.org; Thu, 24 Jul 2014 18:05:37 EDT MIME-Version: 1.0 In-Reply-To: <1406206825-15590-6-git-send-email-hanjun.guo@linaro.org> References: <1406206825-15590-1-git-send-email-hanjun.guo@linaro.org> <1406206825-15590-6-git-send-email-hanjun.guo@linaro.org> Date: Fri, 25 Jul 2014 03:27:21 +0530 Message-ID: Subject: Re: [PATCH 05/19] ARM64 / ACPI: Make PCI optional for ACPI on ARM64 From: Naresh Bhat To: Hanjun Guo Cc: Catalin Marinas , "Rafael J. Wysocki" , Mark Rutland , Graeme Gregory , Arnd Bergmann , Grant Likely , Sudeep Holla , Will Deacon , Jason Cooper , Marc Zyngier , Bjorn Helgaas , Daniel Lezcano , Mark Brown , Robert Richter , Lv Zheng , Robert Moore , Lorenzo Pieralisi , Liviu Dudau , Randy Dunlap , Charles Garcia-Tobin , linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linaro-acpi-private@linaro.org Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24 July 2014 18:30, Hanjun Guo wrote: > > 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 optinal for ARM64, it will not break anything on X86 and IA64. optional > > > 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 505d4d7..8e9bbe6 100644 > --- a/drivers/acpi/Makefile > +++ b/drivers/acpi/Makefile > @@ -39,7 +39,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 466bcd1..27d7354 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 -ENODEV; } > + > +static inline int raw_pci_read(unsigned int domain, unsigned int bus, > + unsigned int devfn, int reg, int len, u32 *val) > +{ return -EINVAL; } > + > +static inline int raw_pci_write(unsigned int domain, unsigned int bus, > + unsigned int devfn, int reg, int len, u32 val) > +{ return -EINVAL; } > + > +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; } > > @@ -1597,7 +1615,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; > -- > 1.7.9.5 > From mboxrd@z Thu Jan 1 00:00:00 1970 From: naresh.bhat@linaro.org (Naresh Bhat) Date: Fri, 25 Jul 2014 03:27:21 +0530 Subject: [PATCH 05/19] ARM64 / ACPI: Make PCI optional for ACPI on ARM64 In-Reply-To: <1406206825-15590-6-git-send-email-hanjun.guo@linaro.org> References: <1406206825-15590-1-git-send-email-hanjun.guo@linaro.org> <1406206825-15590-6-git-send-email-hanjun.guo@linaro.org> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 24 July 2014 18:30, Hanjun Guo wrote: > > 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 optinal for ARM64, it will not break anything on X86 and IA64. optional > > > 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 505d4d7..8e9bbe6 100644 > --- a/drivers/acpi/Makefile > +++ b/drivers/acpi/Makefile > @@ -39,7 +39,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 466bcd1..27d7354 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 -ENODEV; } > + > +static inline int raw_pci_read(unsigned int domain, unsigned int bus, > + unsigned int devfn, int reg, int len, u32 *val) > +{ return -EINVAL; } > + > +static inline int raw_pci_write(unsigned int domain, unsigned int bus, > + unsigned int devfn, int reg, int len, u32 val) > +{ return -EINVAL; } > + > +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; } > > @@ -1597,7 +1615,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; > -- > 1.7.9.5 >