diff options
author | Joao Pinto <Joao.Pinto@synopsys.com> | 2016-03-10 15:44:13 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2016-03-10 15:44:13 -0500 |
commit | c1678ffcdea25afe4fbbebfab13d65a7db5458fb (patch) | |
tree | 41be9cd7cef62752ad396046315ba633258842cd | |
parent | ed00c83cd4909dc268cc0639bf16804444ed8c79 (diff) |
ARC: Add PCI support
Add PCI support to ARC and update drivers/pci Makefile enabling the ARC
arch to use the generic PCI setup functions.
[bhelgaas: fold in Joao's pci-dma-compat.h & pci-bridge.h build fix (I
should have caught this myself, sorry]
Signed-off-by: Joao Pinto <jpinto@synopsys.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Vineet Gupta <vgupta@synopsys.com>
-rw-r--r-- | arch/arc/Kconfig | 26 | ||||
-rw-r--r-- | arch/arc/include/asm/dma.h | 5 | ||||
-rw-r--r-- | arch/arc/include/asm/io.h | 9 | ||||
-rw-r--r-- | arch/arc/include/asm/pci.h | 28 | ||||
-rw-r--r-- | arch/arc/kernel/Makefile | 1 | ||||
-rw-r--r-- | arch/arc/kernel/pcibios.c | 22 | ||||
-rw-r--r-- | arch/arc/plat-axs10x/Kconfig | 1 | ||||
-rw-r--r-- | drivers/pci/Makefile | 1 |
8 files changed, 93 insertions, 0 deletions
diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig index 76dde9db7934..f9e3b357af79 100644 --- a/arch/arc/Kconfig +++ b/arch/arc/Kconfig | |||
@@ -19,6 +19,7 @@ config ARC | |||
19 | select GENERIC_FIND_FIRST_BIT | 19 | select GENERIC_FIND_FIRST_BIT |
20 | # for now, we don't need GENERIC_IRQ_PROBE, CONFIG_GENERIC_IRQ_CHIP | 20 | # for now, we don't need GENERIC_IRQ_PROBE, CONFIG_GENERIC_IRQ_CHIP |
21 | select GENERIC_IRQ_SHOW | 21 | select GENERIC_IRQ_SHOW |
22 | select GENERIC_PCI_IOMAP | ||
22 | select GENERIC_PENDING_IRQ if SMP | 23 | select GENERIC_PENDING_IRQ if SMP |
23 | select GENERIC_SMP_IDLE_THREAD | 24 | select GENERIC_SMP_IDLE_THREAD |
24 | select HAVE_ARCH_KGDB | 25 | select HAVE_ARCH_KGDB |
@@ -39,6 +40,9 @@ config ARC | |||
39 | select PERF_USE_VMALLOC | 40 | select PERF_USE_VMALLOC |
40 | select HAVE_DEBUG_STACKOVERFLOW | 41 | select HAVE_DEBUG_STACKOVERFLOW |
41 | 42 | ||
43 | config MIGHT_HAVE_PCI | ||
44 | bool | ||
45 | |||
42 | config TRACE_IRQFLAGS_SUPPORT | 46 | config TRACE_IRQFLAGS_SUPPORT |
43 | def_bool y | 47 | def_bool y |
44 | 48 | ||
@@ -568,6 +572,28 @@ endmenu # "ARC Architecture Configuration" | |||
568 | source "mm/Kconfig" | 572 | source "mm/Kconfig" |
569 | source "net/Kconfig" | 573 | source "net/Kconfig" |
570 | source "drivers/Kconfig" | 574 | source "drivers/Kconfig" |
575 | |||
576 | menu "Bus Support" | ||
577 | |||
578 | config PCI | ||
579 | bool "PCI support" if MIGHT_HAVE_PCI | ||
580 | help | ||
581 | PCI is the name of a bus system, i.e., the way the CPU talks to | ||
582 | the other stuff inside your box. Find out if your board/platform | ||
583 | has PCI. | ||
584 | |||
585 | Note: PCIe support for Synopsys Device will be available only | ||
586 | when HAPS DX is configured with PCIe RC bitmap. If you have PCI, | ||
587 | say Y, otherwise N. | ||
588 | |||
589 | config PCI_SYSCALL | ||
590 | def_bool PCI | ||
591 | |||
592 | source "drivers/pci/Kconfig" | ||
593 | source "drivers/pci/pcie/Kconfig" | ||
594 | |||
595 | endmenu | ||
596 | |||
571 | source "fs/Kconfig" | 597 | source "fs/Kconfig" |
572 | source "arch/arc/Kconfig.debug" | 598 | source "arch/arc/Kconfig.debug" |
573 | source "security/Kconfig" | 599 | source "security/Kconfig" |
diff --git a/arch/arc/include/asm/dma.h b/arch/arc/include/asm/dma.h index ca7c45181de9..01e47a69b034 100644 --- a/arch/arc/include/asm/dma.h +++ b/arch/arc/include/asm/dma.h | |||
@@ -10,5 +10,10 @@ | |||
10 | #define ASM_ARC_DMA_H | 10 | #define ASM_ARC_DMA_H |
11 | 11 | ||
12 | #define MAX_DMA_ADDRESS 0xC0000000 | 12 | #define MAX_DMA_ADDRESS 0xC0000000 |
13 | #ifdef CONFIG_PCI | ||
14 | extern int isa_dma_bridge_buggy; | ||
15 | #else | ||
16 | #define isa_dma_bridge_buggy 0 | ||
17 | #endif | ||
13 | 18 | ||
14 | #endif | 19 | #endif |
diff --git a/arch/arc/include/asm/io.h b/arch/arc/include/asm/io.h index 694ece8a0243..947bf0cfdec0 100644 --- a/arch/arc/include/asm/io.h +++ b/arch/arc/include/asm/io.h | |||
@@ -16,6 +16,15 @@ | |||
16 | extern void __iomem *ioremap(unsigned long physaddr, unsigned long size); | 16 | extern void __iomem *ioremap(unsigned long physaddr, unsigned long size); |
17 | extern void __iomem *ioremap_prot(phys_addr_t offset, unsigned long size, | 17 | extern void __iomem *ioremap_prot(phys_addr_t offset, unsigned long size, |
18 | unsigned long flags); | 18 | unsigned long flags); |
19 | static inline void __iomem *ioport_map(unsigned long port, unsigned int nr) | ||
20 | { | ||
21 | return (void __iomem *)port; | ||
22 | } | ||
23 | |||
24 | static inline void ioport_unmap(void __iomem *addr) | ||
25 | { | ||
26 | } | ||
27 | |||
19 | extern void iounmap(const void __iomem *addr); | 28 | extern void iounmap(const void __iomem *addr); |
20 | 29 | ||
21 | #define ioremap_nocache(phy, sz) ioremap(phy, sz) | 30 | #define ioremap_nocache(phy, sz) ioremap(phy, sz) |
diff --git a/arch/arc/include/asm/pci.h b/arch/arc/include/asm/pci.h new file mode 100644 index 000000000000..ba56c23c1b20 --- /dev/null +++ b/arch/arc/include/asm/pci.h | |||
@@ -0,0 +1,28 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2015-2016 Synopsys, Inc. (www.synopsys.com) | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | |||
9 | #ifndef _ASM_ARC_PCI_H | ||
10 | #define _ASM_ARC_PCI_H | ||
11 | |||
12 | #ifdef __KERNEL__ | ||
13 | #include <linux/ioport.h> | ||
14 | |||
15 | #define PCIBIOS_MIN_IO 0x100 | ||
16 | #define PCIBIOS_MIN_MEM 0x100000 | ||
17 | |||
18 | #define pcibios_assign_all_busses() 1 | ||
19 | /* | ||
20 | * The PCI address space does equal the physical memory address space. | ||
21 | * The networking and block device layers use this boolean for bounce | ||
22 | * buffer decisions. | ||
23 | */ | ||
24 | #define PCI_DMA_BUS_IS_PHYS 1 | ||
25 | |||
26 | #endif /* __KERNEL__ */ | ||
27 | |||
28 | #endif /* _ASM_ARC_PCI_H */ | ||
diff --git a/arch/arc/kernel/Makefile b/arch/arc/kernel/Makefile index e7f3625a19b5..1bc2036b19d7 100644 --- a/arch/arc/kernel/Makefile +++ b/arch/arc/kernel/Makefile | |||
@@ -12,6 +12,7 @@ obj-y := arcksyms.o setup.o irq.o time.o reset.o ptrace.o process.o devtree.o | |||
12 | obj-y += signal.o traps.o sys.o troubleshoot.o stacktrace.o disasm.o clk.o | 12 | obj-y += signal.o traps.o sys.o troubleshoot.o stacktrace.o disasm.o clk.o |
13 | obj-$(CONFIG_ISA_ARCOMPACT) += entry-compact.o intc-compact.o | 13 | obj-$(CONFIG_ISA_ARCOMPACT) += entry-compact.o intc-compact.o |
14 | obj-$(CONFIG_ISA_ARCV2) += entry-arcv2.o intc-arcv2.o | 14 | obj-$(CONFIG_ISA_ARCV2) += entry-arcv2.o intc-arcv2.o |
15 | obj-$(CONFIG_PCI) += pcibios.o | ||
15 | 16 | ||
16 | obj-$(CONFIG_MODULES) += arcksyms.o module.o | 17 | obj-$(CONFIG_MODULES) += arcksyms.o module.o |
17 | obj-$(CONFIG_SMP) += smp.o | 18 | obj-$(CONFIG_SMP) += smp.o |
diff --git a/arch/arc/kernel/pcibios.c b/arch/arc/kernel/pcibios.c new file mode 100644 index 000000000000..72e1d73d0bd6 --- /dev/null +++ b/arch/arc/kernel/pcibios.c | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2014-2015 Synopsys, Inc. (www.synopsys.com) | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | |||
9 | #include <linux/pci.h> | ||
10 | |||
11 | /* | ||
12 | * We don't have to worry about legacy ISA devices, so nothing to do here | ||
13 | */ | ||
14 | resource_size_t pcibios_align_resource(void *data, const struct resource *res, | ||
15 | resource_size_t size, resource_size_t align) | ||
16 | { | ||
17 | return res->start; | ||
18 | } | ||
19 | |||
20 | void pcibios_fixup_bus(struct pci_bus *bus) | ||
21 | { | ||
22 | } | ||
diff --git a/arch/arc/plat-axs10x/Kconfig b/arch/arc/plat-axs10x/Kconfig index d475f9d4847c..426ac4b8bb39 100644 --- a/arch/arc/plat-axs10x/Kconfig +++ b/arch/arc/plat-axs10x/Kconfig | |||
@@ -11,6 +11,7 @@ menuconfig ARC_PLAT_AXS10X | |||
11 | select DW_APB_ICTL | 11 | select DW_APB_ICTL |
12 | select GPIO_DWAPB | 12 | select GPIO_DWAPB |
13 | select OF_GPIO | 13 | select OF_GPIO |
14 | select MIGHT_HAVE_PCI | ||
14 | select GENERIC_IRQ_CHIP | 15 | select GENERIC_IRQ_CHIP |
15 | select ARCH_REQUIRE_GPIOLIB | 16 | select ARCH_REQUIRE_GPIOLIB |
16 | help | 17 | help |
diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile index be3f631c3f75..2154092ddee8 100644 --- a/drivers/pci/Makefile +++ b/drivers/pci/Makefile | |||
@@ -32,6 +32,7 @@ obj-$(CONFIG_PCI_IOV) += iov.o | |||
32 | # Some architectures use the generic PCI setup functions | 32 | # Some architectures use the generic PCI setup functions |
33 | # | 33 | # |
34 | obj-$(CONFIG_ALPHA) += setup-irq.o | 34 | obj-$(CONFIG_ALPHA) += setup-irq.o |
35 | obj-$(CONFIG_ARC) += setup-irq.o | ||
35 | obj-$(CONFIG_ARM) += setup-irq.o | 36 | obj-$(CONFIG_ARM) += setup-irq.o |
36 | obj-$(CONFIG_ARM64) += setup-irq.o | 37 | obj-$(CONFIG_ARM64) += setup-irq.o |
37 | obj-$(CONFIG_UNICORE32) += setup-irq.o | 38 | obj-$(CONFIG_UNICORE32) += setup-irq.o |