Skip to content

Commit

Permalink
ARC: Add PCI support
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Joao Pinto authored and Bjorn Helgaas committed Mar 10, 2016
1 parent ed00c83 commit c1678ff
Show file tree
Hide file tree
Showing 8 changed files with 93 additions and 0 deletions.
26 changes: 26 additions & 0 deletions arch/arc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ config ARC
select GENERIC_FIND_FIRST_BIT
# for now, we don't need GENERIC_IRQ_PROBE, CONFIG_GENERIC_IRQ_CHIP
select GENERIC_IRQ_SHOW
select GENERIC_PCI_IOMAP
select GENERIC_PENDING_IRQ if SMP
select GENERIC_SMP_IDLE_THREAD
select HAVE_ARCH_KGDB
Expand All @@ -39,6 +40,9 @@ config ARC
select PERF_USE_VMALLOC
select HAVE_DEBUG_STACKOVERFLOW

config MIGHT_HAVE_PCI
bool

config TRACE_IRQFLAGS_SUPPORT
def_bool y

Expand Down Expand Up @@ -568,6 +572,28 @@ endmenu # "ARC Architecture Configuration"
source "mm/Kconfig"
source "net/Kconfig"
source "drivers/Kconfig"

menu "Bus Support"

config PCI
bool "PCI support" if MIGHT_HAVE_PCI
help
PCI is the name of a bus system, i.e., the way the CPU talks to
the other stuff inside your box. Find out if your board/platform
has PCI.

Note: PCIe support for Synopsys Device will be available only
when HAPS DX is configured with PCIe RC bitmap. If you have PCI,
say Y, otherwise N.

config PCI_SYSCALL
def_bool PCI

source "drivers/pci/Kconfig"
source "drivers/pci/pcie/Kconfig"

endmenu

source "fs/Kconfig"
source "arch/arc/Kconfig.debug"
source "security/Kconfig"
Expand Down
5 changes: 5 additions & 0 deletions arch/arc/include/asm/dma.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,10 @@
#define ASM_ARC_DMA_H

#define MAX_DMA_ADDRESS 0xC0000000
#ifdef CONFIG_PCI
extern int isa_dma_bridge_buggy;
#else
#define isa_dma_bridge_buggy 0
#endif

#endif
9 changes: 9 additions & 0 deletions arch/arc/include/asm/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@
extern void __iomem *ioremap(unsigned long physaddr, unsigned long size);
extern void __iomem *ioremap_prot(phys_addr_t offset, unsigned long size,
unsigned long flags);
static inline void __iomem *ioport_map(unsigned long port, unsigned int nr)
{
return (void __iomem *)port;
}

static inline void ioport_unmap(void __iomem *addr)
{
}

extern void iounmap(const void __iomem *addr);

#define ioremap_nocache(phy, sz) ioremap(phy, sz)
Expand Down
28 changes: 28 additions & 0 deletions arch/arc/include/asm/pci.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright (C) 2015-2016 Synopsys, Inc. (www.synopsys.com)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/

#ifndef _ASM_ARC_PCI_H
#define _ASM_ARC_PCI_H

#ifdef __KERNEL__
#include <linux/ioport.h>

#define PCIBIOS_MIN_IO 0x100
#define PCIBIOS_MIN_MEM 0x100000

#define pcibios_assign_all_busses() 1
/*
* The PCI address space does equal the physical memory address space.
* The networking and block device layers use this boolean for bounce
* buffer decisions.
*/
#define PCI_DMA_BUS_IS_PHYS 1

#endif /* __KERNEL__ */

#endif /* _ASM_ARC_PCI_H */
1 change: 1 addition & 0 deletions arch/arc/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ obj-y := arcksyms.o setup.o irq.o time.o reset.o ptrace.o process.o devtree.o
obj-y += signal.o traps.o sys.o troubleshoot.o stacktrace.o disasm.o clk.o
obj-$(CONFIG_ISA_ARCOMPACT) += entry-compact.o intc-compact.o
obj-$(CONFIG_ISA_ARCV2) += entry-arcv2.o intc-arcv2.o
obj-$(CONFIG_PCI) += pcibios.o

obj-$(CONFIG_MODULES) += arcksyms.o module.o
obj-$(CONFIG_SMP) += smp.o
Expand Down
22 changes: 22 additions & 0 deletions arch/arc/kernel/pcibios.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright (C) 2014-2015 Synopsys, Inc. (www.synopsys.com)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/

#include <linux/pci.h>

/*
* We don't have to worry about legacy ISA devices, so nothing to do here
*/
resource_size_t pcibios_align_resource(void *data, const struct resource *res,
resource_size_t size, resource_size_t align)
{
return res->start;
}

void pcibios_fixup_bus(struct pci_bus *bus)
{
}
1 change: 1 addition & 0 deletions arch/arc/plat-axs10x/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ menuconfig ARC_PLAT_AXS10X
select DW_APB_ICTL
select GPIO_DWAPB
select OF_GPIO
select MIGHT_HAVE_PCI
select GENERIC_IRQ_CHIP
select ARCH_REQUIRE_GPIOLIB
help
Expand Down
1 change: 1 addition & 0 deletions drivers/pci/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ obj-$(CONFIG_PCI_IOV) += iov.o
# Some architectures use the generic PCI setup functions
#
obj-$(CONFIG_ALPHA) += setup-irq.o
obj-$(CONFIG_ARC) += setup-irq.o
obj-$(CONFIG_ARM) += setup-irq.o
obj-$(CONFIG_ARM64) += setup-irq.o
obj-$(CONFIG_UNICORE32) += setup-irq.o
Expand Down

0 comments on commit c1678ff

Please sign in to comment.