sparc32: fix sparse warning in io-unit.c
Fix following warning: io-unit.c:56:13: warning: incorrect type in assignment (different address spaces) The page table for the io unit resides in __iomem. Fix up all users of the io unit page table. Introduce sbus helers for all read/write operations. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
f977ea49ae
commit
1918660b90
|
@ -43,7 +43,7 @@
|
||||||
struct iounit_struct {
|
struct iounit_struct {
|
||||||
unsigned long bmap[(IOUNIT_DMA_SIZE >> (PAGE_SHIFT + 3)) / sizeof(unsigned long)];
|
unsigned long bmap[(IOUNIT_DMA_SIZE >> (PAGE_SHIFT + 3)) / sizeof(unsigned long)];
|
||||||
spinlock_t lock;
|
spinlock_t lock;
|
||||||
iopte_t *page_table;
|
iopte_t __iomem *page_table;
|
||||||
unsigned long rotor[3];
|
unsigned long rotor[3];
|
||||||
unsigned long limit[4];
|
unsigned long limit[4];
|
||||||
};
|
};
|
||||||
|
|
|
@ -25,6 +25,8 @@
|
||||||
#include <asm/dma.h>
|
#include <asm/dma.h>
|
||||||
#include <asm/oplib.h>
|
#include <asm/oplib.h>
|
||||||
|
|
||||||
|
#include "mm_32.h"
|
||||||
|
|
||||||
/* #define IOUNIT_DEBUG */
|
/* #define IOUNIT_DEBUG */
|
||||||
#ifdef IOUNIT_DEBUG
|
#ifdef IOUNIT_DEBUG
|
||||||
#define IOD(x) printk(x)
|
#define IOD(x) printk(x)
|
||||||
|
@ -38,7 +40,8 @@
|
||||||
static void __init iounit_iommu_init(struct platform_device *op)
|
static void __init iounit_iommu_init(struct platform_device *op)
|
||||||
{
|
{
|
||||||
struct iounit_struct *iounit;
|
struct iounit_struct *iounit;
|
||||||
iopte_t *xpt, *xptend;
|
iopte_t __iomem *xpt;
|
||||||
|
iopte_t __iomem *xptend;
|
||||||
|
|
||||||
iounit = kzalloc(sizeof(struct iounit_struct), GFP_ATOMIC);
|
iounit = kzalloc(sizeof(struct iounit_struct), GFP_ATOMIC);
|
||||||
if (!iounit) {
|
if (!iounit) {
|
||||||
|
@ -62,10 +65,10 @@ static void __init iounit_iommu_init(struct platform_device *op)
|
||||||
op->dev.archdata.iommu = iounit;
|
op->dev.archdata.iommu = iounit;
|
||||||
iounit->page_table = xpt;
|
iounit->page_table = xpt;
|
||||||
spin_lock_init(&iounit->lock);
|
spin_lock_init(&iounit->lock);
|
||||||
|
|
||||||
for (xptend = iounit->page_table + (16 * PAGE_SIZE) / sizeof(iopte_t);
|
xptend = iounit->page_table + (16 * PAGE_SIZE) / sizeof(iopte_t);
|
||||||
xpt < xptend;)
|
for (; xpt < xptend; xpt++)
|
||||||
iopte_val(*xpt++) = 0;
|
sbus_writel(0, xpt);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int __init iounit_init(void)
|
static int __init iounit_init(void)
|
||||||
|
@ -130,7 +133,7 @@ nexti: scan = find_next_zero_bit(iounit->bmap, limit, scan);
|
||||||
vaddr = IOUNIT_DMA_BASE + (scan << PAGE_SHIFT) + (vaddr & ~PAGE_MASK);
|
vaddr = IOUNIT_DMA_BASE + (scan << PAGE_SHIFT) + (vaddr & ~PAGE_MASK);
|
||||||
for (k = 0; k < npages; k++, iopte = __iopte(iopte_val(iopte) + 0x100), scan++) {
|
for (k = 0; k < npages; k++, iopte = __iopte(iopte_val(iopte) + 0x100), scan++) {
|
||||||
set_bit(scan, iounit->bmap);
|
set_bit(scan, iounit->bmap);
|
||||||
iounit->page_table[scan] = iopte;
|
sbus_writel(iopte, &iounit->page_table[scan]);
|
||||||
}
|
}
|
||||||
IOD(("%08lx\n", vaddr));
|
IOD(("%08lx\n", vaddr));
|
||||||
return vaddr;
|
return vaddr;
|
||||||
|
@ -202,7 +205,7 @@ static int iounit_map_dma_area(struct device *dev, dma_addr_t *pba, unsigned lon
|
||||||
struct iounit_struct *iounit = dev->archdata.iommu;
|
struct iounit_struct *iounit = dev->archdata.iommu;
|
||||||
unsigned long page, end;
|
unsigned long page, end;
|
||||||
pgprot_t dvma_prot;
|
pgprot_t dvma_prot;
|
||||||
iopte_t *iopte;
|
iopte_t __iomem *iopte;
|
||||||
|
|
||||||
*pba = addr;
|
*pba = addr;
|
||||||
|
|
||||||
|
@ -224,8 +227,8 @@ static int iounit_map_dma_area(struct device *dev, dma_addr_t *pba, unsigned lon
|
||||||
|
|
||||||
i = ((addr - IOUNIT_DMA_BASE) >> PAGE_SHIFT);
|
i = ((addr - IOUNIT_DMA_BASE) >> PAGE_SHIFT);
|
||||||
|
|
||||||
iopte = (iopte_t *)(iounit->page_table + i);
|
iopte = iounit->page_table + i;
|
||||||
*iopte = MKIOPTE(__pa(page));
|
sbus_writel(MKIOPTE(__pa(page)), iopte);
|
||||||
}
|
}
|
||||||
addr += PAGE_SIZE;
|
addr += PAGE_SIZE;
|
||||||
va += PAGE_SIZE;
|
va += PAGE_SIZE;
|
||||||
|
|
Loading…
Reference in New Issue