Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 173439
b: refs/heads/master
c: 01be5d6
h: refs/heads/master
i:
  173437: 603df23
  173435: 038e49e
  173431: 92adade
  173423: 384e742
  173407: b038091
  173375: c7e6df7
  173311: faa1a28
v: v3
  • Loading branch information
Paul Mundt committed Oct 27, 2009
1 parent d8af9f9 commit 2f7c7f3
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 26 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: 3f375f12ecb9c691dda70bb64b313e55fe6ee4ee
refs/heads/master: 01be5d63fd4645eab1d05a7caa04462c11c8b7a1
7 changes: 7 additions & 0 deletions trunk/arch/sh/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,12 @@ config ARCH_HAS_CPU_IDLE_WAIT
config IO_TRAPPED
bool

config DMA_COHERENT
bool

config DMA_NONCOHERENT
def_bool !DMA_COHERENT

source "init/Kconfig"

source "kernel/Kconfig.freezer"
Expand Down Expand Up @@ -217,6 +223,7 @@ config CPU_SHX2

config CPU_SHX3
bool
select DMA_COHERENT

config ARCH_SHMOBILE
bool
Expand Down
12 changes: 0 additions & 12 deletions trunk/arch/sh/drivers/pci/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,3 @@ config PCI
Find out whether you have a PCI motherboard. PCI is the name of a
bus system, i.e. the way the CPU talks to the other stuff inside
your box. If you have PCI, say Y, otherwise N.

config SH_PCIDMA_NONCOHERENT
bool "Cache and PCI noncoherent"
depends on PCI
default y
help
Enable this option if your platform does not have a CPU cache which
remains coherent with PCI DMA. It is safest to say 'Y', although you
will see better performance if you can say 'N', because the PCI DMA
code will not have to flush the CPU's caches. If you have a PCI host
bridge integrated with your SH CPU, refer carefully to the chip specs
to see if you can say 'N' here. Otherwise, leave it as 'Y'.
20 changes: 7 additions & 13 deletions trunk/arch/sh/include/asm/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,13 @@ static inline void pcibios_penalize_isa_irq(int irq, int active)
/* pci_unmap_{single,page} being a nop depends upon the
* configuration.
*/
#ifdef CONFIG_SH_PCIDMA_NONCOHERENT
#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \
dma_addr_t ADDR_NAME;
#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \
__u32 LEN_NAME;
#define pci_unmap_addr(PTR, ADDR_NAME) \
((PTR)->ADDR_NAME)
#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \
(((PTR)->ADDR_NAME) = (VAL))
#define pci_unmap_len(PTR, LEN_NAME) \
((PTR)->LEN_NAME)
#define pci_unmap_len_set(PTR, LEN_NAME, VAL) \
(((PTR)->LEN_NAME) = (VAL))
#ifdef CONFIG_DMA_NONCOHERENT
#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) dma_addr_t ADDR_NAME;
#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) __u32 LEN_NAME;
#define pci_unmap_addr(PTR, ADDR_NAME) ((PTR)->ADDR_NAME)
#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) (((PTR)->ADDR_NAME) = (VAL))
#define pci_unmap_len(PTR, LEN_NAME) ((PTR)->LEN_NAME)
#define pci_unmap_len_set(PTR, LEN_NAME, VAL) (((PTR)->LEN_NAME) = (VAL))
#else
#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
Expand Down
4 changes: 4 additions & 0 deletions trunk/arch/sh/kernel/dma-nommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ static int nommu_map_sg(struct device *dev, struct scatterlist *sg,
return nents;
}

#ifdef CONFIG_DMA_NONCOHERENT
static void nommu_sync_single(struct device *dev, dma_addr_t addr,
size_t size, enum dma_data_direction dir)
{
Expand All @@ -59,14 +60,17 @@ static void nommu_sync_sg(struct device *dev, struct scatterlist *sg,
for_each_sg(sg, s, nelems, i)
dma_cache_sync(dev, sg_virt(s), s->length, dir);
}
#endif

struct dma_map_ops nommu_dma_ops = {
.alloc_coherent = dma_generic_alloc_coherent,
.free_coherent = dma_generic_free_coherent,
.map_page = nommu_map_page,
.map_sg = nommu_map_sg,
#ifdef CONFIG_DMA_NONCOHERENT
.sync_single_for_device = nommu_sync_single,
.sync_sg_for_device = nommu_sync_sg,
#endif
.is_phys = 1,
};

Expand Down

0 comments on commit 2f7c7f3

Please sign in to comment.