diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2016-07-06 05:49:24 +0200 |
---|---|---|
committer | Florian Fainelli <f.fainelli@gmail.com> | 2016-07-06 05:49:24 +0200 |
commit | c4c0e2607abfc86c32a43c9a22b2a256de27dea3 (patch) | |
tree | 7446e420e76849db9034f934b0e396b8091b12cb /arch/arm64 | |
parent | arm64: vulcan: enable GPIOLIB in Kconfig (diff) | |
parent | arm64: Add platform selection for BCM2835. (diff) | |
download | linux-c4c0e2607abfc86c32a43c9a22b2a256de27dea3.tar.xz linux-c4c0e2607abfc86c32a43c9a22b2a256de27dea3.zip |
Merge tag 'bcm2835-arm64-next-2016-07-03' into soc-arm64/next
This pull request brings in the build support for the Raspberry Pi arm64
port. This has an external dependency on Jason Cooper's irqchip/bcm
branch, it is a stable branch based on v4.7-rc1, and it has been in
-next for a couple of weeks.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Diffstat (limited to 'arch/arm64')
-rw-r--r-- | arch/arm64/Kconfig.platforms | 13 | ||||
-rw-r--r-- | arch/arm64/include/asm/dma-mapping.h | 17 |
2 files changed, 28 insertions, 2 deletions
diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms index 33892f2320cc..d945ca32647b 100644 --- a/arch/arm64/Kconfig.platforms +++ b/arch/arm64/Kconfig.platforms @@ -13,6 +13,19 @@ config ARCH_ALPINE This enables support for the Annapurna Labs Alpine Soc family. +config ARCH_BCM2835 + bool "Broadcom BCM2835 family" + select ARCH_REQUIRE_GPIOLIB + select CLKSRC_OF + select PINCTRL + select PINCTRL_BCM2835 + select ARM_AMBA + select ARM_TIMER_SP804 + select HAVE_ARM_ARCH_TIMER + help + This enables support for the Broadcom BCM2837 SoC. + This SoC is used in the Raspberry Pi 3 device. + config ARCH_BCM_IPROC bool "Broadcom iProc SoC Family" 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) static inline dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr) { - return (dma_addr_t)paddr; + dma_addr_t dev_addr = (dma_addr_t)paddr; + + return dev_addr - ((dma_addr_t)dev->dma_pfn_offset << PAGE_SHIFT); } static inline phys_addr_t dma_to_phys(struct device *dev, dma_addr_t dev_addr) { - return (phys_addr_t)dev_addr; + phys_addr_t paddr = (phys_addr_t)dev_addr; + + return paddr + ((phys_addr_t)dev->dma_pfn_offset << PAGE_SHIFT); } 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) { } +/* Override for dma_max_pfn() */ +static inline unsigned long dma_max_pfn(struct device *dev) +{ + dma_addr_t dma_max = (dma_addr_t)*dev->dma_mask; + + return (ulong)dma_to_phys(dev, dma_max) >> PAGE_SHIFT; +} +#define dma_max_pfn(dev) dma_max_pfn(dev) + #endif /* __KERNEL__ */ #endif /* __ASM_DMA_MAPPING_H */ |