aboutsummaryrefslogtreecommitdiff
path: root/drivers/serial/cpm_uart/cpm_uart_cpm1.c
diff options
context:
space:
mode:
authorVitaly Bordug <vbordug@ru.mvista.com>2006-04-25 20:26:46 +0400
committerPaul Mackerras <paulus@samba.org>2006-04-28 21:11:33 +1000
commit09b03b6c29638eb5c79b02e585cb1b20d91a8ea0 (patch)
treec6348427c9b785a90db7f87d55903c6b75804170 /drivers/serial/cpm_uart/cpm_uart_cpm1.c
parent4427d6bf966379304f77b7cc8c92421e6bb95483 (diff)
[PATCH] ppc32 CPM_UART: Fixed odd address translations
Current address translation methods can produce wrong results, because virt_to_bus and vice versa may not produce correct offsets on dma-allocated memory. The right way is, while tracking both phys and virt address of the window that has been allocated for boffer descriptors, and use those numbers to compute the offset and make translation properly. Signed-off-by: Vitaly Bordug <vbordug@ru.mvista.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'drivers/serial/cpm_uart/cpm_uart_cpm1.c')
-rw-r--r--drivers/serial/cpm_uart/cpm_uart_cpm1.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm1.c b/drivers/serial/cpm_uart/cpm_uart_cpm1.c
index 31223aa862f5..a5a30622637a 100644
--- a/drivers/serial/cpm_uart/cpm_uart_cpm1.c
+++ b/drivers/serial/cpm_uart/cpm_uart_cpm1.c
@@ -144,7 +144,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con)
/* was hostalloc but changed cause it blows away the */
/* large tlb mapping when pinning the kernel area */
mem_addr = (u8 *) cpm_dpram_addr(cpm_dpalloc(memsz, 8));
- dma_addr = 0;
+ dma_addr = (u32)mem_addr;
} else
mem_addr = dma_alloc_coherent(NULL, memsz, &dma_addr,
GFP_KERNEL);
@@ -157,8 +157,9 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con)
}
pinfo->dp_addr = dp_offset;
- pinfo->mem_addr = mem_addr;
- pinfo->dma_addr = dma_addr;
+ pinfo->mem_addr = mem_addr; /* virtual address*/
+ pinfo->dma_addr = dma_addr; /* physical address*/
+ pinfo->mem_size = memsz;
pinfo->rx_buf = mem_addr;
pinfo->tx_buf = pinfo->rx_buf + L1_CACHE_ALIGN(pinfo->rx_nrfifos