Skip to content

Commit c1678ff

Browse files
Joao Pintobjorn-helgaas
authored andcommitted
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>
1 parent ed00c83 commit c1678ff

8 files changed

Lines changed: 93 additions & 0 deletions

File tree

‎arch/arc/Kconfig‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ config ARC
1919
select GENERIC_FIND_FIRST_BIT
2020
# for now, we don't need GENERIC_IRQ_PROBE, CONFIG_GENERIC_IRQ_CHIP
2121
select GENERIC_IRQ_SHOW
22+
select GENERIC_PCI_IOMAP
2223
select GENERIC_PENDING_IRQ if SMP
2324
select GENERIC_SMP_IDLE_THREAD
2425
select HAVE_ARCH_KGDB
@@ -39,6 +40,9 @@ config ARC
3940
select PERF_USE_VMALLOC
4041
select HAVE_DEBUG_STACKOVERFLOW
4142

43+
config MIGHT_HAVE_PCI
44+
bool
45+
4246
config TRACE_IRQFLAGS_SUPPORT
4347
def_bool y
4448

@@ -568,6 +572,28 @@ endmenu # "ARC Architecture Configuration"
568572
source "mm/Kconfig"
569573
source "net/Kconfig"
570574
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+
571597
source "fs/Kconfig"
572598
source "arch/arc/Kconfig.debug"
573599
source "security/Kconfig"

‎arch/arc/include/asm/dma.h‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,10 @@
1010
#define ASM_ARC_DMA_H
1111

1212
#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
1318

1419
#endif

‎arch/arc/include/asm/io.h‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@
1616
extern void __iomem *ioremap(unsigned long physaddr, unsigned long size);
1717
extern void __iomem *ioremap_prot(phys_addr_t offset, unsigned long size,
1818
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+
1928
extern void iounmap(const void __iomem *addr);
2029

2130
#define ioremap_nocache(phy, sz) ioremap(phy, sz)

‎arch/arc/include/asm/pci.h‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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 */

‎arch/arc/kernel/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ obj-y := arcksyms.o setup.o irq.o time.o reset.o ptrace.o process.o devtree.o
1212
obj-y += signal.o traps.o sys.o troubleshoot.o stacktrace.o disasm.o clk.o
1313
obj-$(CONFIG_ISA_ARCOMPACT) += entry-compact.o intc-compact.o
1414
obj-$(CONFIG_ISA_ARCV2) += entry-arcv2.o intc-arcv2.o
15+
obj-$(CONFIG_PCI) += pcibios.o
1516

1617
obj-$(CONFIG_MODULES) += arcksyms.o module.o
1718
obj-$(CONFIG_SMP) += smp.o

‎arch/arc/kernel/pcibios.c‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
}

‎arch/arc/plat-axs10x/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ menuconfig ARC_PLAT_AXS10X
1111
select DW_APB_ICTL
1212
select GPIO_DWAPB
1313
select OF_GPIO
14+
select MIGHT_HAVE_PCI
1415
select GENERIC_IRQ_CHIP
1516
select ARCH_REQUIRE_GPIOLIB
1617
help

‎drivers/pci/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ obj-$(CONFIG_PCI_IOV) += iov.o
3232
# Some architectures use the generic PCI setup functions
3333
#
3434
obj-$(CONFIG_ALPHA) += setup-irq.o
35+
obj-$(CONFIG_ARC) += setup-irq.o
3536
obj-$(CONFIG_ARM) += setup-irq.o
3637
obj-$(CONFIG_ARM64) += setup-irq.o
3738
obj-$(CONFIG_UNICORE32) += setup-irq.o

0 commit comments

Comments
 (0)