diff options
author | David S. Miller <davem@davemloft.net> | 2012-05-13 20:49:31 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-05-13 20:49:31 -0700 |
commit | 5d83d66635bb1642f3c6a3690c28ff4afdf1ae5f (patch) | |
tree | fb3f20377d8567af11be07c383ff21bf5fc6850a /arch/sparc/mm/iommu.c | |
parent | b25e74b1be321613bf33492cd9d2e5dd0924562d (diff) |
sparc32: Move cache and TLB flushes over to method ops.
This eliminated most of the remaining users of btfixup.
There are some complications because of the special cases we
have for sun4d, leon, and some flavors of viking.
It was found that there are no cases where a flush_page_for_dma
method was not hooked up to something, so the "noflush" iommu
methods were removed.
Add some documentation to the viking_sun4d_smp_ops to describe exactly
the hardware bug which causes us to need special TLB flushing on
sun4d.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/mm/iommu.c')
-rw-r--r-- | arch/sparc/mm/iommu.c | 38 |
1 files changed, 1 insertions, 37 deletions
diff --git a/arch/sparc/mm/iommu.c b/arch/sparc/mm/iommu.c index c64f81e370aa..720bea2c7fdd 100644 --- a/arch/sparc/mm/iommu.c +++ b/arch/sparc/mm/iommu.c @@ -39,8 +39,6 @@ /* srmmu.c */ extern int viking_mxcc_present; -BTFIXUPDEF_CALL(void, flush_page_for_dma, unsigned long) -#define flush_page_for_dma(page) BTFIXUP_CALL(flush_page_for_dma)(page) extern int flush_page_for_dma_global; static int viking_flush; /* viking.S */ @@ -216,11 +214,6 @@ static u32 iommu_get_scsi_one(struct device *dev, char *vaddr, unsigned int len) return busa + off; } -static __u32 iommu_get_scsi_one_noflush(struct device *dev, char *vaddr, unsigned long len) -{ - return iommu_get_scsi_one(dev, vaddr, len); -} - static __u32 iommu_get_scsi_one_gflush(struct device *dev, char *vaddr, unsigned long len) { flush_page_for_dma(0); @@ -238,19 +231,6 @@ static __u32 iommu_get_scsi_one_pflush(struct device *dev, char *vaddr, unsigned return iommu_get_scsi_one(dev, vaddr, len); } -static void iommu_get_scsi_sgl_noflush(struct device *dev, struct scatterlist *sg, int sz) -{ - int n; - - while (sz != 0) { - --sz; - n = (sg->length + sg->offset + PAGE_SIZE-1) >> PAGE_SHIFT; - sg->dma_address = iommu_get_one(dev, sg_page(sg), n) + sg->offset; - sg->dma_length = sg->length; - sg = sg_next(sg); - } -} - static void iommu_get_scsi_sgl_gflush(struct device *dev, struct scatterlist *sg, int sz) { int n; @@ -426,17 +406,6 @@ static void iommu_unmap_dma_area(struct device *dev, unsigned long busa, int len } #endif -static const struct sparc32_dma_ops iommu_dma_noflush_ops = { - .get_scsi_one = iommu_get_scsi_one_noflush, - .get_scsi_sgl = iommu_get_scsi_sgl_noflush, - .release_scsi_one = iommu_release_scsi_one, - .release_scsi_sgl = iommu_release_scsi_sgl, -#ifdef CONFIG_SBUS - .map_dma_area = iommu_map_dma_area, - .unmap_dma_area = iommu_unmap_dma_area, -#endif -}; - static const struct sparc32_dma_ops iommu_dma_gflush_ops = { .get_scsi_one = iommu_get_scsi_one_gflush, .get_scsi_sgl = iommu_get_scsi_sgl_gflush, @@ -461,12 +430,7 @@ static const struct sparc32_dma_ops iommu_dma_pflush_ops = { void __init ld_mmu_iommu(void) { - viking_flush = (BTFIXUPVAL_CALL(flush_page_for_dma) == (unsigned long)viking_flush_page); - - if (!BTFIXUPVAL_CALL(flush_page_for_dma)) { - /* IO coherent chip */ - sparc32_dma_ops = &iommu_dma_noflush_ops; - } else if (flush_page_for_dma_global) { + if (flush_page_for_dma_global) { /* flush_page_for_dma flushes everything, no matter of what page is it */ sparc32_dma_ops = &iommu_dma_gflush_ops; } else { |