Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Joao Pinto and committed by
Bjorn Helgaas
c1678ffc ed00c83c

+93
+26
arch/arc/Kconfig
··· 19 19 select GENERIC_FIND_FIRST_BIT 20 20 # for now, we don't need GENERIC_IRQ_PROBE, CONFIG_GENERIC_IRQ_CHIP 21 21 select GENERIC_IRQ_SHOW 22 + select GENERIC_PCI_IOMAP 22 23 select GENERIC_PENDING_IRQ if SMP 23 24 select GENERIC_SMP_IDLE_THREAD 24 25 select HAVE_ARCH_KGDB ··· 39 38 select OF_EARLY_FLATTREE 40 39 select PERF_USE_VMALLOC 41 40 select HAVE_DEBUG_STACKOVERFLOW 41 + 42 + config MIGHT_HAVE_PCI 43 + bool 42 44 43 45 config TRACE_IRQFLAGS_SUPPORT 44 46 def_bool y ··· 572 568 source "mm/Kconfig" 573 569 source "net/Kconfig" 574 570 source "drivers/Kconfig" 571 + 572 + menu "Bus Support" 573 + 574 + config PCI 575 + bool "PCI support" if MIGHT_HAVE_PCI 576 + help 577 + PCI is the name of a bus system, i.e., the way the CPU talks to 578 + the other stuff inside your box. Find out if your board/platform 579 + has PCI. 580 + 581 + Note: PCIe support for Synopsys Device will be available only 582 + when HAPS DX is configured with PCIe RC bitmap. If you have PCI, 583 + say Y, otherwise N. 584 + 585 + config PCI_SYSCALL 586 + def_bool PCI 587 + 588 + source "drivers/pci/Kconfig" 589 + source "drivers/pci/pcie/Kconfig" 590 + 591 + endmenu 592 + 575 593 source "fs/Kconfig" 576 594 source "arch/arc/Kconfig.debug" 577 595 source "security/Kconfig"
+5
arch/arc/include/asm/dma.h
··· 10 10 #define ASM_ARC_DMA_H 11 11 12 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 19 #endif
+9
arch/arc/include/asm/io.h
··· 16 16 extern void __iomem *ioremap(unsigned long physaddr, unsigned long size); 17 17 extern void __iomem *ioremap_prot(phys_addr_t offset, unsigned long size, 18 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 28 extern void iounmap(const void __iomem *addr); 20 29 21 30 #define ioremap_nocache(phy, sz) ioremap(phy, sz)
+28
arch/arc/include/asm/pci.h
··· 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 */
+1
arch/arc/kernel/Makefile
··· 12 12 obj-y += signal.o traps.o sys.o troubleshoot.o stacktrace.o disasm.o clk.o 13 13 obj-$(CONFIG_ISA_ARCOMPACT) += entry-compact.o intc-compact.o 14 14 obj-$(CONFIG_ISA_ARCV2) += entry-arcv2.o intc-arcv2.o 15 + obj-$(CONFIG_PCI) += pcibios.o 15 16 16 17 obj-$(CONFIG_MODULES) += arcksyms.o module.o 17 18 obj-$(CONFIG_SMP) += smp.o
+22
arch/arc/kernel/pcibios.c
··· 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 + }
+1
arch/arc/plat-axs10x/Kconfig
··· 11 11 select DW_APB_ICTL 12 12 select GPIO_DWAPB 13 13 select OF_GPIO 14 + select MIGHT_HAVE_PCI 14 15 select GENERIC_IRQ_CHIP 15 16 select ARCH_REQUIRE_GPIOLIB 16 17 help
+1
drivers/pci/Makefile
··· 32 32 # Some architectures use the generic PCI setup functions 33 33 # 34 34 obj-$(CONFIG_ALPHA) += setup-irq.o 35 + obj-$(CONFIG_ARC) += setup-irq.o 35 36 obj-$(CONFIG_ARM) += setup-irq.o 36 37 obj-$(CONFIG_ARM64) += setup-irq.o 37 38 obj-$(CONFIG_UNICORE32) += setup-irq.o