Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 210908
b: refs/heads/master
c: 710224f
h: refs/heads/master
v: v3
  • Loading branch information
FUJITA Tomonori authored and Linus Torvalds committed Sep 23, 2010
1 parent 9e5bf98 commit 7f2f10f
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c227e69028473c7c7994a9b0a2cc0034f3f7e0fe
refs/heads/master: 710224fa2750cf449c02dd115548acebfdd2c86a
8 changes: 8 additions & 0 deletions trunk/arch/arm/common/it8152.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,14 @@ int dma_needs_bounce(struct device *dev, dma_addr_t dma_addr, size_t size)
((dma_addr + size - PHYS_OFFSET) >= SZ_64M);
}

int dma_set_coherent_mask(struct device *dev, u64 mask)
{
if (mask >= PHYS_OFFSET + SZ_64M - 1)
return 0;

return -EIO;
}

int __init it8152_pci_setup(int nr, struct pci_sys_data *sys)
{
it8152_io.start = IT8152_IO_BASE + 0x12000;
Expand Down
8 changes: 8 additions & 0 deletions trunk/arch/arm/mach-ixp4xx/common-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,14 @@ struct pci_bus * __devinit ixp4xx_scan_bus(int nr, struct pci_sys_data *sys)
return pci_scan_bus(sys->busnr, &ixp4xx_ops, sys);
}

int dma_set_coherent_mask(struct device *dev, u64 mask)
{
if (mask >= SZ_64M - 1)
return 0;

return -EIO;
}

EXPORT_SYMBOL(ixp4xx_pci_read);
EXPORT_SYMBOL(ixp4xx_pci_write);

2 changes: 2 additions & 0 deletions trunk/arch/arm/mach-ixp4xx/include/mach/hardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#define PCIBIOS_MAX_MEM 0x4BFFFFFF
#endif

#define ARCH_HAS_DMA_SET_COHERENT_MASK

#define pcibios_assign_all_busses() 1

/* Register locations and bits */
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/arm/mach-pxa/include/mach/hardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ extern unsigned long get_clock_tick_rate(void);
#define PCIBIOS_MIN_IO 0
#define PCIBIOS_MIN_MEM 0
#define pcibios_assign_all_busses() 1
#define ARCH_HAS_DMA_SET_COHERENT_MASK
#endif


#endif /* _ASM_ARCH_HARDWARE_H */
2 changes: 2 additions & 0 deletions trunk/arch/arm/mach-pxa/include/mach/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#ifndef __ASM_ARM_ARCH_IO_H
#define __ASM_ARM_ARCH_IO_H

#include <mach/hardware.h>

#define IO_SPACE_LIMIT 0xffffffff

/*
Expand Down
4 changes: 4 additions & 0 deletions trunk/include/linux/dma-mapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,17 @@ static inline u64 dma_get_mask(struct device *dev)
return DMA_BIT_MASK(32);
}

#ifdef ARCH_HAS_DMA_SET_COHERENT_MASK
int dma_set_coherent_mask(struct device *dev, u64 mask);
#else
static inline int dma_set_coherent_mask(struct device *dev, u64 mask)
{
if (!dma_supported(dev, mask))
return -EIO;
dev->coherent_dma_mask = mask;
return 0;
}
#endif

extern u64 dma_get_required_mask(struct device *dev);

Expand Down

0 comments on commit 7f2f10f

Please sign in to comment.