Skip to content

Commit 00ba935

Browse files
author
Linus Walleij
committed
ARM: ixp4xx: Drop custom DMA coherency and bouncing
The new PCI driver does not need any of this stuff, so just drop it. Cc: iommu@lists.linux-foundation.org Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20220211223238.648934-12-linus.walleij@linaro.org Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent 3059dfa commit 00ba935

File tree

3 files changed

+0
-64
lines changed

3 files changed

+0
-64
lines changed

arch/arm/Kconfig

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,6 @@ config ARCH_MAY_HAVE_PC_FDC
217217
config ARCH_SUPPORTS_UPROBES
218218
def_bool y
219219

220-
config ARCH_HAS_DMA_SET_COHERENT_MASK
221-
bool
222-
223220
config GENERIC_ISA_DMA
224221
bool
225222

@@ -381,10 +378,8 @@ config ARCH_IOP32X
381378
config ARCH_IXP4XX
382379
bool "IXP4xx-based"
383380
depends on MMU
384-
select ARCH_HAS_DMA_SET_COHERENT_MASK
385381
select ARCH_SUPPORTS_BIG_ENDIAN
386382
select CPU_XSCALE
387-
select DMABOUNCE if PCI
388383
select GENERIC_IRQ_MULTI_HANDLER
389384
select GPIO_IXP4XX
390385
select GPIOLIB

arch/arm/mach-ixp4xx/common.c

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
#include <linux/soc/ixp4xx/cpu.h>
3131
#include <linux/irqchip/irq-ixp4xx.h>
3232
#include <linux/platform_data/timer-ixp4xx.h>
33-
#include <linux/dma-map-ops.h>
3433
#include <mach/hardware.h>
3534
#include <linux/uaccess.h>
3635
#include <asm/page.h>
@@ -330,59 +329,3 @@ void ixp4xx_restart(enum reboot_mode mode, const char *cmd)
330329
*IXP4XX_OSWE = IXP4XX_WDT_RESET_ENABLE | IXP4XX_WDT_COUNT_ENABLE;
331330
}
332331
}
333-
334-
#ifdef CONFIG_PCI
335-
static int ixp4xx_needs_bounce(struct device *dev, dma_addr_t dma_addr, size_t size)
336-
{
337-
return (dma_addr + size) > SZ_64M;
338-
}
339-
340-
static int ixp4xx_platform_notify_remove(struct device *dev)
341-
{
342-
if (dev_is_pci(dev))
343-
dmabounce_unregister_dev(dev);
344-
345-
return 0;
346-
}
347-
#endif
348-
349-
/*
350-
* Setup DMA mask to 64MB on PCI devices and 4 GB on all other things.
351-
*/
352-
static int ixp4xx_platform_notify(struct device *dev)
353-
{
354-
dev->dma_mask = &dev->coherent_dma_mask;
355-
356-
#ifdef CONFIG_PCI
357-
if (dev_is_pci(dev)) {
358-
dev->coherent_dma_mask = DMA_BIT_MASK(28); /* 64 MB */
359-
dmabounce_register_dev(dev, 2048, 4096, ixp4xx_needs_bounce);
360-
return 0;
361-
}
362-
#endif
363-
364-
dev->coherent_dma_mask = DMA_BIT_MASK(32);
365-
return 0;
366-
}
367-
368-
int dma_set_coherent_mask(struct device *dev, u64 mask)
369-
{
370-
if (dev_is_pci(dev))
371-
mask &= DMA_BIT_MASK(28); /* 64 MB */
372-
373-
if ((mask & DMA_BIT_MASK(28)) == DMA_BIT_MASK(28)) {
374-
dev->coherent_dma_mask = mask;
375-
return 0;
376-
}
377-
378-
return -EIO; /* device wanted sub-64MB mask */
379-
}
380-
EXPORT_SYMBOL(dma_set_coherent_mask);
381-
382-
void __init ixp4xx_init_early(void)
383-
{
384-
platform_notify = ixp4xx_platform_notify;
385-
#ifdef CONFIG_PCI
386-
platform_notify_remove = ixp4xx_platform_notify_remove;
387-
#endif
388-
}

kernel/dma/mapping.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,6 @@ int dma_set_mask(struct device *dev, u64 mask)
745745
}
746746
EXPORT_SYMBOL(dma_set_mask);
747747

748-
#ifndef CONFIG_ARCH_HAS_DMA_SET_COHERENT_MASK
749748
int dma_set_coherent_mask(struct device *dev, u64 mask)
750749
{
751750
/*
@@ -761,7 +760,6 @@ int dma_set_coherent_mask(struct device *dev, u64 mask)
761760
return 0;
762761
}
763762
EXPORT_SYMBOL(dma_set_coherent_mask);
764-
#endif
765763

766764
size_t dma_max_mapping_size(struct device *dev)
767765
{

0 commit comments

Comments
 (0)