Commit fc7dff39 authored by Russell King's avatar Russell King Committed by Tony Lindgren

omap: fix virtual vs physical address space confusions

Modified version of Russell's patch 6ef82d2c8bf322129e45274873e62f4419aa256b
for linux-omap tree.

mcbsp is confused as to what takes a physical or virtual address.
Fix the two instances where it gets it wrong.
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent a5d7c5a4
...@@ -134,6 +134,7 @@ static struct omap_mcbsp_ops omap1_mcbsp_ops = { ...@@ -134,6 +134,7 @@ static struct omap_mcbsp_ops omap1_mcbsp_ops = {
#ifdef CONFIG_ARCH_OMAP730 #ifdef CONFIG_ARCH_OMAP730
static struct omap_mcbsp_platform_data omap730_mcbsp_pdata[] = { static struct omap_mcbsp_platform_data omap730_mcbsp_pdata[] = {
{ {
.phys_base = OMAP730_MCBSP1_BASE,
.virt_base = io_p2v(OMAP730_MCBSP1_BASE), .virt_base = io_p2v(OMAP730_MCBSP1_BASE),
.dma_rx_sync = OMAP_DMA_MCBSP1_RX, .dma_rx_sync = OMAP_DMA_MCBSP1_RX,
.dma_tx_sync = OMAP_DMA_MCBSP1_TX, .dma_tx_sync = OMAP_DMA_MCBSP1_TX,
...@@ -142,6 +143,7 @@ static struct omap_mcbsp_platform_data omap730_mcbsp_pdata[] = { ...@@ -142,6 +143,7 @@ static struct omap_mcbsp_platform_data omap730_mcbsp_pdata[] = {
.ops = &omap1_mcbsp_ops, .ops = &omap1_mcbsp_ops,
}, },
{ {
.phys_base = OMAP730_MCBSP2_BASE,
.virt_base = io_p2v(OMAP730_MCBSP2_BASE), .virt_base = io_p2v(OMAP730_MCBSP2_BASE),
.dma_rx_sync = OMAP_DMA_MCBSP3_RX, .dma_rx_sync = OMAP_DMA_MCBSP3_RX,
.dma_tx_sync = OMAP_DMA_MCBSP3_TX, .dma_tx_sync = OMAP_DMA_MCBSP3_TX,
...@@ -159,6 +161,7 @@ static struct omap_mcbsp_platform_data omap730_mcbsp_pdata[] = { ...@@ -159,6 +161,7 @@ static struct omap_mcbsp_platform_data omap730_mcbsp_pdata[] = {
#ifdef CONFIG_ARCH_OMAP15XX #ifdef CONFIG_ARCH_OMAP15XX
static struct omap_mcbsp_platform_data omap15xx_mcbsp_pdata[] = { static struct omap_mcbsp_platform_data omap15xx_mcbsp_pdata[] = {
{ {
.phys_base = OMAP1510_MCBSP1_BASE,
.virt_base = OMAP1510_MCBSP1_BASE, .virt_base = OMAP1510_MCBSP1_BASE,
.dma_rx_sync = OMAP_DMA_MCBSP1_RX, .dma_rx_sync = OMAP_DMA_MCBSP1_RX,
.dma_tx_sync = OMAP_DMA_MCBSP1_TX, .dma_tx_sync = OMAP_DMA_MCBSP1_TX,
...@@ -168,6 +171,7 @@ static struct omap_mcbsp_platform_data omap15xx_mcbsp_pdata[] = { ...@@ -168,6 +171,7 @@ static struct omap_mcbsp_platform_data omap15xx_mcbsp_pdata[] = {
.clk_name = "mcbsp_clk", .clk_name = "mcbsp_clk",
}, },
{ {
.phys_base = OMAP1510_MCBSP2_BASE,
.virt_base = io_p2v(OMAP1510_MCBSP2_BASE), .virt_base = io_p2v(OMAP1510_MCBSP2_BASE),
.dma_rx_sync = OMAP_DMA_MCBSP2_RX, .dma_rx_sync = OMAP_DMA_MCBSP2_RX,
.dma_tx_sync = OMAP_DMA_MCBSP2_TX, .dma_tx_sync = OMAP_DMA_MCBSP2_TX,
...@@ -176,6 +180,7 @@ static struct omap_mcbsp_platform_data omap15xx_mcbsp_pdata[] = { ...@@ -176,6 +180,7 @@ static struct omap_mcbsp_platform_data omap15xx_mcbsp_pdata[] = {
.ops = &omap1_mcbsp_ops, .ops = &omap1_mcbsp_ops,
}, },
{ {
.phys_base = OMAP1510_MCBSP3_BASE,
.virt_base = OMAP1510_MCBSP3_BASE, .virt_base = OMAP1510_MCBSP3_BASE,
.dma_rx_sync = OMAP_DMA_MCBSP3_RX, .dma_rx_sync = OMAP_DMA_MCBSP3_RX,
.dma_tx_sync = OMAP_DMA_MCBSP3_TX, .dma_tx_sync = OMAP_DMA_MCBSP3_TX,
...@@ -194,6 +199,7 @@ static struct omap_mcbsp_platform_data omap15xx_mcbsp_pdata[] = { ...@@ -194,6 +199,7 @@ static struct omap_mcbsp_platform_data omap15xx_mcbsp_pdata[] = {
#ifdef CONFIG_ARCH_OMAP16XX #ifdef CONFIG_ARCH_OMAP16XX
static struct omap_mcbsp_platform_data omap16xx_mcbsp_pdata[] = { static struct omap_mcbsp_platform_data omap16xx_mcbsp_pdata[] = {
{ {
.phys_base = OMAP1610_MCBSP1_BASE,
.virt_base = OMAP1610_MCBSP1_BASE, .virt_base = OMAP1610_MCBSP1_BASE,
.dma_rx_sync = OMAP_DMA_MCBSP1_RX, .dma_rx_sync = OMAP_DMA_MCBSP1_RX,
.dma_tx_sync = OMAP_DMA_MCBSP1_TX, .dma_tx_sync = OMAP_DMA_MCBSP1_TX,
...@@ -203,6 +209,7 @@ static struct omap_mcbsp_platform_data omap16xx_mcbsp_pdata[] = { ...@@ -203,6 +209,7 @@ static struct omap_mcbsp_platform_data omap16xx_mcbsp_pdata[] = {
.clk_name = "mcbsp_clk", .clk_name = "mcbsp_clk",
}, },
{ {
.phys_base = OMAP1610_MCBSP2_BASE,
.virt_base = io_p2v(OMAP1610_MCBSP2_BASE), .virt_base = io_p2v(OMAP1610_MCBSP2_BASE),
.dma_rx_sync = OMAP_DMA_MCBSP2_RX, .dma_rx_sync = OMAP_DMA_MCBSP2_RX,
.dma_tx_sync = OMAP_DMA_MCBSP2_TX, .dma_tx_sync = OMAP_DMA_MCBSP2_TX,
...@@ -211,6 +218,7 @@ static struct omap_mcbsp_platform_data omap16xx_mcbsp_pdata[] = { ...@@ -211,6 +218,7 @@ static struct omap_mcbsp_platform_data omap16xx_mcbsp_pdata[] = {
.ops = &omap1_mcbsp_ops, .ops = &omap1_mcbsp_ops,
}, },
{ {
.phys_base = OMAP1610_MCBSP3_BASE,
.virt_base = OMAP1610_MCBSP3_BASE, .virt_base = OMAP1610_MCBSP3_BASE,
.dma_rx_sync = OMAP_DMA_MCBSP3_RX, .dma_rx_sync = OMAP_DMA_MCBSP3_RX,
.dma_tx_sync = OMAP_DMA_MCBSP3_TX, .dma_tx_sync = OMAP_DMA_MCBSP3_TX,
......
...@@ -148,6 +148,7 @@ static struct omap_mcbsp_ops omap2_mcbsp_ops = { ...@@ -148,6 +148,7 @@ static struct omap_mcbsp_ops omap2_mcbsp_ops = {
#ifdef CONFIG_ARCH_OMAP24XX #ifdef CONFIG_ARCH_OMAP24XX
static struct omap_mcbsp_platform_data omap24xx_mcbsp_pdata[] = { static struct omap_mcbsp_platform_data omap24xx_mcbsp_pdata[] = {
{ {
.phys_base = OMAP24XX_MCBSP1_BASE,
.virt_base = OMAP2_IO_ADDRESS(OMAP24XX_MCBSP1_BASE), .virt_base = OMAP2_IO_ADDRESS(OMAP24XX_MCBSP1_BASE),
.dma_rx_sync = OMAP24XX_DMA_MCBSP1_RX, .dma_rx_sync = OMAP24XX_DMA_MCBSP1_RX,
.dma_tx_sync = OMAP24XX_DMA_MCBSP1_TX, .dma_tx_sync = OMAP24XX_DMA_MCBSP1_TX,
...@@ -157,6 +158,7 @@ static struct omap_mcbsp_platform_data omap24xx_mcbsp_pdata[] = { ...@@ -157,6 +158,7 @@ static struct omap_mcbsp_platform_data omap24xx_mcbsp_pdata[] = {
.clk_name = "mcbsp_clk", .clk_name = "mcbsp_clk",
}, },
{ {
.phys_base = OMAP24XX_MCBSP2_BASE,
.virt_base = OMAP2_IO_ADDRESS(OMAP24XX_MCBSP2_BASE), .virt_base = OMAP2_IO_ADDRESS(OMAP24XX_MCBSP2_BASE),
.dma_rx_sync = OMAP24XX_DMA_MCBSP2_RX, .dma_rx_sync = OMAP24XX_DMA_MCBSP2_RX,
.dma_tx_sync = OMAP24XX_DMA_MCBSP2_TX, .dma_tx_sync = OMAP24XX_DMA_MCBSP2_TX,
...@@ -175,6 +177,7 @@ static struct omap_mcbsp_platform_data omap24xx_mcbsp_pdata[] = { ...@@ -175,6 +177,7 @@ static struct omap_mcbsp_platform_data omap24xx_mcbsp_pdata[] = {
#ifdef CONFIG_ARCH_OMAP34XX #ifdef CONFIG_ARCH_OMAP34XX
static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = { static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = {
{ {
.phys_base = OMAP34XX_MCBSP1_BASE,
.virt_base = OMAP2_IO_ADDRESS(OMAP34XX_MCBSP1_BASE), .virt_base = OMAP2_IO_ADDRESS(OMAP34XX_MCBSP1_BASE),
.dma_rx_sync = OMAP24XX_DMA_MCBSP1_RX, .dma_rx_sync = OMAP24XX_DMA_MCBSP1_RX,
.dma_tx_sync = OMAP24XX_DMA_MCBSP1_TX, .dma_tx_sync = OMAP24XX_DMA_MCBSP1_TX,
...@@ -184,6 +187,7 @@ static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = { ...@@ -184,6 +187,7 @@ static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = {
.clk_name = "mcbsp_clk", .clk_name = "mcbsp_clk",
}, },
{ {
.phys_base = OMAP34XX_MCBSP2_BASE,
.virt_base = OMAP2_IO_ADDRESS(OMAP34XX_MCBSP2_BASE), .virt_base = OMAP2_IO_ADDRESS(OMAP34XX_MCBSP2_BASE),
.dma_rx_sync = OMAP24XX_DMA_MCBSP2_RX, .dma_rx_sync = OMAP24XX_DMA_MCBSP2_RX,
.dma_tx_sync = OMAP24XX_DMA_MCBSP2_TX, .dma_tx_sync = OMAP24XX_DMA_MCBSP2_TX,
...@@ -193,6 +197,7 @@ static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = { ...@@ -193,6 +197,7 @@ static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = {
.clk_name = "mcbsp_clk", .clk_name = "mcbsp_clk",
}, },
{ {
.phys_base = OMAP34XX_MCBSP3_BASE,
.virt_base = OMAP2_IO_ADDRESS(OMAP34XX_MCBSP3_BASE), .virt_base = OMAP2_IO_ADDRESS(OMAP34XX_MCBSP3_BASE),
.dma_rx_sync = OMAP24XX_DMA_MCBSP3_RX, .dma_rx_sync = OMAP24XX_DMA_MCBSP3_RX,
.dma_tx_sync = OMAP24XX_DMA_MCBSP3_TX, .dma_tx_sync = OMAP24XX_DMA_MCBSP3_TX,
...@@ -200,6 +205,7 @@ static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = { ...@@ -200,6 +205,7 @@ static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = {
.clk_name = "mcbsp_clk", .clk_name = "mcbsp_clk",
}, },
{ {
.phys_base = OMAP34XX_MCBSP4_BASE,
.virt_base = OMAP2_IO_ADDRESS(OMAP34XX_MCBSP4_BASE), .virt_base = OMAP2_IO_ADDRESS(OMAP34XX_MCBSP4_BASE),
.dma_rx_sync = OMAP24XX_DMA_MCBSP4_RX, .dma_rx_sync = OMAP24XX_DMA_MCBSP4_RX,
.dma_tx_sync = OMAP24XX_DMA_MCBSP4_TX, .dma_tx_sync = OMAP24XX_DMA_MCBSP4_TX,
...@@ -207,6 +213,7 @@ static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = { ...@@ -207,6 +213,7 @@ static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = {
.clk_name = "mcbsp_clk", .clk_name = "mcbsp_clk",
}, },
{ {
.phys_base = OMAP34XX_MCBSP5_BASE,
.virt_base = OMAP2_IO_ADDRESS(OMAP34XX_MCBSP5_BASE), .virt_base = OMAP2_IO_ADDRESS(OMAP34XX_MCBSP5_BASE),
.dma_rx_sync = OMAP24XX_DMA_MCBSP5_RX, .dma_rx_sync = OMAP24XX_DMA_MCBSP5_RX,
.dma_tx_sync = OMAP24XX_DMA_MCBSP5_TX, .dma_tx_sync = OMAP24XX_DMA_MCBSP5_TX,
......
...@@ -326,6 +326,7 @@ struct omap_mcbsp_ops { ...@@ -326,6 +326,7 @@ struct omap_mcbsp_ops {
}; };
struct omap_mcbsp_platform_data { struct omap_mcbsp_platform_data {
unsigned long phys_base;
u32 virt_base; u32 virt_base;
u8 dma_rx_sync, dma_tx_sync; u8 dma_rx_sync, dma_tx_sync;
u16 rx_irq, tx_irq; u16 rx_irq, tx_irq;
...@@ -335,6 +336,7 @@ struct omap_mcbsp_platform_data { ...@@ -335,6 +336,7 @@ struct omap_mcbsp_platform_data {
struct omap_mcbsp { struct omap_mcbsp {
struct device *dev; struct device *dev;
unsigned long phys_base;
u32 io_base; u32 io_base;
u8 id; u8 id;
u8 free; u8 free;
......
...@@ -701,7 +701,7 @@ int omap_mcbsp_xmit_buffer(unsigned int id, dma_addr_t buffer, ...@@ -701,7 +701,7 @@ int omap_mcbsp_xmit_buffer(unsigned int id, dma_addr_t buffer,
omap_set_dma_dest_params(mcbsp->dma_tx_lch, omap_set_dma_dest_params(mcbsp->dma_tx_lch,
src_port, src_port,
OMAP_DMA_AMODE_CONSTANT, OMAP_DMA_AMODE_CONSTANT,
mcbsp->io_base + OMAP_MCBSP_REG_DXR1, mcbsp->phys_base + OMAP_MCBSP_REG_DXR1,
0, 0); 0, 0);
omap_set_dma_src_params(mcbsp->dma_tx_lch, omap_set_dma_src_params(mcbsp->dma_tx_lch,
...@@ -764,7 +764,7 @@ int omap_mcbsp_recv_buffer(unsigned int id, dma_addr_t buffer, ...@@ -764,7 +764,7 @@ int omap_mcbsp_recv_buffer(unsigned int id, dma_addr_t buffer,
omap_set_dma_src_params(mcbsp->dma_rx_lch, omap_set_dma_src_params(mcbsp->dma_rx_lch,
src_port, src_port,
OMAP_DMA_AMODE_CONSTANT, OMAP_DMA_AMODE_CONSTANT,
mcbsp->io_base + OMAP_MCBSP_REG_DRR1, mcbsp->phys_base + OMAP_MCBSP_REG_DRR1,
0, 0); 0, 0);
omap_set_dma_dest_params(mcbsp->dma_rx_lch, omap_set_dma_dest_params(mcbsp->dma_rx_lch,
...@@ -892,6 +892,7 @@ static int __init omap_mcbsp_probe(struct platform_device *pdev) ...@@ -892,6 +892,7 @@ static int __init omap_mcbsp_probe(struct platform_device *pdev)
mcbsp->dma_tx_lch = -1; mcbsp->dma_tx_lch = -1;
mcbsp->dma_rx_lch = -1; mcbsp->dma_rx_lch = -1;
mcbsp->phys_base = pdata->phys_base;
mcbsp->io_base = pdata->virt_base; mcbsp->io_base = pdata->virt_base;
/* Default I/O is IRQ based */ /* Default I/O is IRQ based */
mcbsp->io_type = OMAP_MCBSP_IRQ_IO; mcbsp->io_type = OMAP_MCBSP_IRQ_IO;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment