diff options
author | Arnd Bergmann <arnd@arndb.de> | 2016-07-07 09:54:54 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2016-07-07 09:54:54 -0400 |
commit | fc7c0be08448be0445c310b9a2ece48d85c08c7b (patch) | |
tree | 3474ad8c380ffd11a1f9d54fe075789d79edbab2 | |
parent | 623149b00e6b34c43a229faf0dc0ad51f37a6da9 (diff) | |
parent | c4c0e2607abfc86c32a43c9a22b2a256de27dea3 (diff) |
Merge tag 'arm-soc/for-4.8/soc-arm64-part2' of http://github.com/Broadcom/stblinux into next/arm64
Merge "Broadcom ARM64-based SoC changes for 4.8 second part" from Florian Fainelli:
- Eric updates the bcm2836 interrupt controller driver not to rely on ARM/Linux specific functions
in preparation for using it on ARM64
- Eric also adds a Kconfig entry for the BCM2835 Raspberry Pi family in the ARM64 Kconfig.platforms
file
- Eric cherry picked a patch from Alexander Graf with Acks from ARM64 maintainers to support different
DMA and bus offsets, required for the Raspberry Pi 3 SoC
* tag 'arm-soc/for-4.8/soc-arm64-part2' of http://github.com/Broadcom/stblinux:
arm64: Add platform selection for BCM2835.
arm64: Allow for different DMA and CPU bus offsets
irqchip: bcm2835: Avoid arch/arm-specific handle_IRQ
-rw-r--r-- | arch/arm64/Kconfig.platforms | 13 | ||||
-rw-r--r-- | arch/arm64/include/asm/dma-mapping.h | 17 | ||||
-rw-r--r-- | drivers/irqchip/irq-bcm2835.c | 3 | ||||
-rw-r--r-- | drivers/irqchip/irq-bcm2836.c | 2 |
4 files changed, 30 insertions, 5 deletions
diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms index 59fc6d92a52a..143761dd09d1 100644 --- a/arch/arm64/Kconfig.platforms +++ b/arch/arm64/Kconfig.platforms | |||
@@ -13,6 +13,19 @@ config ARCH_ALPINE | |||
13 | This enables support for the Annapurna Labs Alpine | 13 | This enables support for the Annapurna Labs Alpine |
14 | Soc family. | 14 | Soc family. |
15 | 15 | ||
16 | config ARCH_BCM2835 | ||
17 | bool "Broadcom BCM2835 family" | ||
18 | select ARCH_REQUIRE_GPIOLIB | ||
19 | select CLKSRC_OF | ||
20 | select PINCTRL | ||
21 | select PINCTRL_BCM2835 | ||
22 | select ARM_AMBA | ||
23 | select ARM_TIMER_SP804 | ||
24 | select HAVE_ARM_ARCH_TIMER | ||
25 | help | ||
26 | This enables support for the Broadcom BCM2837 SoC. | ||
27 | This SoC is used in the Raspberry Pi 3 device. | ||
28 | |||
16 | config ARCH_BCM_IPROC | 29 | config ARCH_BCM_IPROC |
17 | bool "Broadcom iProc SoC Family" | 30 | bool "Broadcom iProc SoC Family" |
18 | select COMMON_CLK_IPROC | 31 | select COMMON_CLK_IPROC |
diff --git a/arch/arm64/include/asm/dma-mapping.h b/arch/arm64/include/asm/dma-mapping.h index 7dbea6c070ec..ccea82c2b089 100644 --- a/arch/arm64/include/asm/dma-mapping.h +++ b/arch/arm64/include/asm/dma-mapping.h | |||
@@ -66,12 +66,16 @@ static inline bool is_device_dma_coherent(struct device *dev) | |||
66 | 66 | ||
67 | static inline dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr) | 67 | static inline dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr) |
68 | { | 68 | { |
69 | return (dma_addr_t)paddr; | 69 | dma_addr_t dev_addr = (dma_addr_t)paddr; |
70 | |||
71 | return dev_addr - ((dma_addr_t)dev->dma_pfn_offset << PAGE_SHIFT); | ||
70 | } | 72 | } |
71 | 73 | ||
72 | static inline phys_addr_t dma_to_phys(struct device *dev, dma_addr_t dev_addr) | 74 | static inline phys_addr_t dma_to_phys(struct device *dev, dma_addr_t dev_addr) |
73 | { | 75 | { |
74 | return (phys_addr_t)dev_addr; | 76 | phys_addr_t paddr = (phys_addr_t)dev_addr; |
77 | |||
78 | return paddr + ((phys_addr_t)dev->dma_pfn_offset << PAGE_SHIFT); | ||
75 | } | 79 | } |
76 | 80 | ||
77 | static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size) | 81 | static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size) |
@@ -86,5 +90,14 @@ static inline void dma_mark_clean(void *addr, size_t size) | |||
86 | { | 90 | { |
87 | } | 91 | } |
88 | 92 | ||
93 | /* Override for dma_max_pfn() */ | ||
94 | static inline unsigned long dma_max_pfn(struct device *dev) | ||
95 | { | ||
96 | dma_addr_t dma_max = (dma_addr_t)*dev->dma_mask; | ||
97 | |||
98 | return (ulong)dma_to_phys(dev, dma_max) >> PAGE_SHIFT; | ||
99 | } | ||
100 | #define dma_max_pfn(dev) dma_max_pfn(dev) | ||
101 | |||
89 | #endif /* __KERNEL__ */ | 102 | #endif /* __KERNEL__ */ |
90 | #endif /* __ASM_DMA_MAPPING_H */ | 103 | #endif /* __ASM_DMA_MAPPING_H */ |
diff --git a/drivers/irqchip/irq-bcm2835.c b/drivers/irqchip/irq-bcm2835.c index bf9cc5f2e839..44d7c38dde47 100644 --- a/drivers/irqchip/irq-bcm2835.c +++ b/drivers/irqchip/irq-bcm2835.c | |||
@@ -52,7 +52,6 @@ | |||
52 | #include <linux/irqdomain.h> | 52 | #include <linux/irqdomain.h> |
53 | 53 | ||
54 | #include <asm/exception.h> | 54 | #include <asm/exception.h> |
55 | #include <asm/mach/irq.h> | ||
56 | 55 | ||
57 | /* Put the bank and irq (32 bits) into the hwirq */ | 56 | /* Put the bank and irq (32 bits) into the hwirq */ |
58 | #define MAKE_HWIRQ(b, n) ((b << 5) | (n)) | 57 | #define MAKE_HWIRQ(b, n) ((b << 5) | (n)) |
@@ -242,7 +241,7 @@ static void __exception_irq_entry bcm2835_handle_irq( | |||
242 | u32 hwirq; | 241 | u32 hwirq; |
243 | 242 | ||
244 | while ((hwirq = get_next_armctrl_hwirq()) != ~0) | 243 | while ((hwirq = get_next_armctrl_hwirq()) != ~0) |
245 | handle_IRQ(irq_linear_revmap(intc.domain, hwirq), regs); | 244 | handle_domain_irq(intc.domain, hwirq, regs); |
246 | } | 245 | } |
247 | 246 | ||
248 | static void bcm2836_chained_handle_irq(struct irq_desc *desc) | 247 | static void bcm2836_chained_handle_irq(struct irq_desc *desc) |
diff --git a/drivers/irqchip/irq-bcm2836.c b/drivers/irqchip/irq-bcm2836.c index 72ff1d5c5de6..27875982657e 100644 --- a/drivers/irqchip/irq-bcm2836.c +++ b/drivers/irqchip/irq-bcm2836.c | |||
@@ -180,7 +180,7 @@ __exception_irq_entry bcm2836_arm_irqchip_handle_irq(struct pt_regs *regs) | |||
180 | } else if (stat) { | 180 | } else if (stat) { |
181 | u32 hwirq = ffs(stat) - 1; | 181 | u32 hwirq = ffs(stat) - 1; |
182 | 182 | ||
183 | handle_IRQ(irq_linear_revmap(intc.domain, hwirq), regs); | 183 | handle_domain_irq(intc.domain, hwirq, regs); |
184 | } | 184 | } |
185 | } | 185 | } |
186 | 186 | ||