Commit 63a9332b authored by Andrew Lunn's avatar Andrew Lunn Committed by Nicolas Pitre

ARM: Orion: Get address map from plat-orion instead of via platform_data

Use an getter function in plat-orion/addr-map.c to get the address map
structure, rather than pass it to drivers in the platform_data
structures. When the drivers are built for none orion platforms, a
dummy function is provided instead which returns NULL.
Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
Tested-by: default avatarMichael Walle <michael@walle.cc>
Acked-by: default avatarNicolas Pitre <nico@linaro.org>
Signed-off-by: default avatarNicolas Pitre <nico@fluxnic.net>
parent 45173d5e
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/mbus.h>
#include <video/vga.h> #include <video/vga.h>
#include <asm/mach/pci.h> #include <asm/mach/pci.h>
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
...@@ -51,7 +50,7 @@ static int __init dove_pcie_setup(int nr, struct pci_sys_data *sys) ...@@ -51,7 +50,7 @@ static int __init dove_pcie_setup(int nr, struct pci_sys_data *sys)
*/ */
orion_pcie_set_local_bus_nr(pp->base, sys->busnr); orion_pcie_set_local_bus_nr(pp->base, sys->busnr);
orion_pcie_setup(pp->base, &orion_mbus_dram_info); orion_pcie_setup(pp->base);
/* /*
* IORESOURCE_IO * IORESOURCE_IO
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include <linux/gpio.h> #include <linux/gpio.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/mbus.h>
#include <linux/io.h> #include <linux/io.h>
#include <mach/hardware.h> #include <mach/hardware.h>
#include <plat/mpp.h> #include <plat/mpp.h>
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/mbus.h>
#include <video/vga.h> #include <video/vga.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/mach/pci.h> #include <asm/mach/pci.h>
...@@ -209,7 +208,7 @@ static int __init kirkwood_pcie_setup(int nr, struct pci_sys_data *sys) ...@@ -209,7 +208,7 @@ static int __init kirkwood_pcie_setup(int nr, struct pci_sys_data *sys)
*/ */
orion_pcie_set_local_bus_nr(pp->base, sys->busnr); orion_pcie_set_local_bus_nr(pp->base, sys->busnr);
orion_pcie_setup(pp->base, &orion_mbus_dram_info); orion_pcie_setup(pp->base);
return 1; return 1;
} }
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include <linux/gpio.h> #include <linux/gpio.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/mbus.h>
#include <linux/io.h> #include <linux/io.h>
#include <plat/mpp.h> #include <plat/mpp.h>
#include <mach/hardware.h> #include <mach/hardware.h>
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/mbus.h>
#include <video/vga.h> #include <video/vga.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/mach/pci.h> #include <asm/mach/pci.h>
...@@ -154,7 +153,7 @@ static int __init mv78xx0_pcie_setup(int nr, struct pci_sys_data *sys) ...@@ -154,7 +153,7 @@ static int __init mv78xx0_pcie_setup(int nr, struct pci_sys_data *sys)
* Generic PCIe unit setup. * Generic PCIe unit setup.
*/ */
orion_pcie_set_local_bus_nr(pp->base, sys->busnr); orion_pcie_set_local_bus_nr(pp->base, sys->busnr);
orion_pcie_setup(pp->base, &orion_mbus_dram_info); orion_pcie_setup(pp->base);
sys->resource[0] = &pp->res[0]; sys->resource[0] = &pp->res[0];
sys->resource[1] = &pp->res[1]; sys->resource[1] = &pp->res[1];
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/mbus.h>
#include <linux/io.h> #include <linux/io.h>
#include <mach/hardware.h> #include <mach/hardware.h>
#include <plat/mpp.h> #include <plat/mpp.h>
......
...@@ -146,7 +146,7 @@ static int __init pcie_setup(struct pci_sys_data *sys) ...@@ -146,7 +146,7 @@ static int __init pcie_setup(struct pci_sys_data *sys)
/* /*
* Generic PCIe unit setup. * Generic PCIe unit setup.
*/ */
orion_pcie_setup(PCIE_BASE, &orion_mbus_dram_info); orion_pcie_setup(PCIE_BASE);
/* /*
* Check whether to apply Orion-1/Orion-NAS PCIe config * Check whether to apply Orion-1/Orion-NAS PCIe config
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/mbus.h> #include <linux/mbus.h>
#include <linux/io.h> #include <linux/io.h>
...@@ -16,6 +17,12 @@ ...@@ -16,6 +17,12 @@
struct mbus_dram_target_info orion_mbus_dram_info; struct mbus_dram_target_info orion_mbus_dram_info;
const struct mbus_dram_target_info *mv_mbus_dram_info(void)
{
return &orion_mbus_dram_info;
}
EXPORT_SYMBOL_GPL(mv_mbus_dram_info);
/* /*
* DDR target is the same on all Orion platforms. * DDR target is the same on all Orion platforms.
*/ */
......
...@@ -20,8 +20,7 @@ int orion_pcie_x4_mode(void __iomem *base); ...@@ -20,8 +20,7 @@ int orion_pcie_x4_mode(void __iomem *base);
int orion_pcie_get_local_bus_nr(void __iomem *base); int orion_pcie_get_local_bus_nr(void __iomem *base);
void orion_pcie_set_local_bus_nr(void __iomem *base, int nr); void orion_pcie_set_local_bus_nr(void __iomem *base, int nr);
void orion_pcie_reset(void __iomem *base); void orion_pcie_reset(void __iomem *base);
void orion_pcie_setup(void __iomem *base, void orion_pcie_setup(void __iomem *base);
struct mbus_dram_target_info *dram);
int orion_pcie_rd_conf(void __iomem *base, struct pci_bus *bus, int orion_pcie_rd_conf(void __iomem *base, struct pci_bus *bus,
u32 devfn, int where, int size, u32 *val); u32 devfn, int where, int size, u32 *val);
int orion_pcie_rd_conf_tlp(void __iomem *base, struct pci_bus *bus, int orion_pcie_rd_conf_tlp(void __iomem *base, struct pci_bus *bus,
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <linux/mbus.h> #include <linux/mbus.h>
#include <asm/mach/pci.h> #include <asm/mach/pci.h>
#include <plat/pcie.h> #include <plat/pcie.h>
#include <plat/addr-map.h>
#include <linux/delay.h> #include <linux/delay.h>
/* /*
...@@ -175,8 +176,7 @@ static void __init orion_pcie_setup_wins(void __iomem *base, ...@@ -175,8 +176,7 @@ static void __init orion_pcie_setup_wins(void __iomem *base,
writel(((size - 1) & 0xffff0000) | 1, base + PCIE_BAR_CTRL_OFF(1)); writel(((size - 1) & 0xffff0000) | 1, base + PCIE_BAR_CTRL_OFF(1));
} }
void __init orion_pcie_setup(void __iomem *base, void __init orion_pcie_setup(void __iomem *base)
struct mbus_dram_target_info *dram)
{ {
u16 cmd; u16 cmd;
u32 mask; u32 mask;
...@@ -184,7 +184,7 @@ void __init orion_pcie_setup(void __iomem *base, ...@@ -184,7 +184,7 @@ void __init orion_pcie_setup(void __iomem *base,
/* /*
* Point PCIe unit MBUS decode windows to DRAM space. * Point PCIe unit MBUS decode windows to DRAM space.
*/ */
orion_pcie_setup_wins(base, dram); orion_pcie_setup_wins(base, &orion_mbus_dram_info);
/* /*
* Master + slave enable. * Master + slave enable.
......
...@@ -3988,7 +3988,7 @@ static int mv_create_dma_pools(struct mv_host_priv *hpriv, struct device *dev) ...@@ -3988,7 +3988,7 @@ static int mv_create_dma_pools(struct mv_host_priv *hpriv, struct device *dev)
} }
static void mv_conf_mbus_windows(struct mv_host_priv *hpriv, static void mv_conf_mbus_windows(struct mv_host_priv *hpriv,
struct mbus_dram_target_info *dram) const struct mbus_dram_target_info *dram)
{ {
int i; int i;
...@@ -3998,7 +3998,7 @@ static void mv_conf_mbus_windows(struct mv_host_priv *hpriv, ...@@ -3998,7 +3998,7 @@ static void mv_conf_mbus_windows(struct mv_host_priv *hpriv,
} }
for (i = 0; i < dram->num_cs; i++) { for (i = 0; i < dram->num_cs; i++) {
struct mbus_dram_window *cs = dram->cs + i; const struct mbus_dram_window *cs = dram->cs + i;
writel(((cs->size - 1) & 0xffff0000) | writel(((cs->size - 1) & 0xffff0000) |
(cs->mbus_attr << 8) | (cs->mbus_attr << 8) |
...@@ -4019,6 +4019,7 @@ static void mv_conf_mbus_windows(struct mv_host_priv *hpriv, ...@@ -4019,6 +4019,7 @@ static void mv_conf_mbus_windows(struct mv_host_priv *hpriv,
static int mv_platform_probe(struct platform_device *pdev) static int mv_platform_probe(struct platform_device *pdev)
{ {
const struct mv_sata_platform_data *mv_platform_data; const struct mv_sata_platform_data *mv_platform_data;
const struct mbus_dram_target_info *dram;
const struct ata_port_info *ppi[] = const struct ata_port_info *ppi[] =
{ &mv_port_info[chip_soc], NULL }; { &mv_port_info[chip_soc], NULL };
struct ata_host *host; struct ata_host *host;
...@@ -4072,8 +4073,9 @@ static int mv_platform_probe(struct platform_device *pdev) ...@@ -4072,8 +4073,9 @@ static int mv_platform_probe(struct platform_device *pdev)
/* /*
* (Re-)program MBUS remapping windows if we are asked to. * (Re-)program MBUS remapping windows if we are asked to.
*/ */
if (mv_platform_data->dram != NULL) dram = mv_mbus_dram_info();
mv_conf_mbus_windows(hpriv, mv_platform_data->dram); if (dram)
mv_conf_mbus_windows(hpriv, dram);
rc = mv_create_dma_pools(hpriv, &pdev->dev); rc = mv_create_dma_pools(hpriv, &pdev->dev);
if (rc) if (rc)
...@@ -4141,17 +4143,18 @@ static int mv_platform_suspend(struct platform_device *pdev, pm_message_t state) ...@@ -4141,17 +4143,18 @@ static int mv_platform_suspend(struct platform_device *pdev, pm_message_t state)
static int mv_platform_resume(struct platform_device *pdev) static int mv_platform_resume(struct platform_device *pdev)
{ {
struct ata_host *host = platform_get_drvdata(pdev); struct ata_host *host = platform_get_drvdata(pdev);
const struct mbus_dram_target_info *dram;
int ret; int ret;
if (host) { if (host) {
struct mv_host_priv *hpriv = host->private_data; struct mv_host_priv *hpriv = host->private_data;
const struct mv_sata_platform_data *mv_platform_data = \
pdev->dev.platform_data;
/* /*
* (Re-)program MBUS remapping windows if we are asked to. * (Re-)program MBUS remapping windows if we are asked to.
*/ */
if (mv_platform_data->dram != NULL) dram = mv_mbus_dram_info();
mv_conf_mbus_windows(hpriv, mv_platform_data->dram); if (dram)
mv_conf_mbus_windows(hpriv, dram);
/* initialize adapter */ /* initialize adapter */
ret = mv_init_host(host); ret = mv_init_host(host);
......
...@@ -1250,7 +1250,7 @@ static int __devinit mv_xor_probe(struct platform_device *pdev) ...@@ -1250,7 +1250,7 @@ static int __devinit mv_xor_probe(struct platform_device *pdev)
static void static void
mv_xor_conf_mbus_windows(struct mv_xor_shared_private *msp, mv_xor_conf_mbus_windows(struct mv_xor_shared_private *msp,
struct mbus_dram_target_info *dram) const struct mbus_dram_target_info *dram)
{ {
void __iomem *base = msp->xor_base; void __iomem *base = msp->xor_base;
u32 win_enable = 0; u32 win_enable = 0;
...@@ -1264,7 +1264,7 @@ mv_xor_conf_mbus_windows(struct mv_xor_shared_private *msp, ...@@ -1264,7 +1264,7 @@ mv_xor_conf_mbus_windows(struct mv_xor_shared_private *msp,
} }
for (i = 0; i < dram->num_cs; i++) { for (i = 0; i < dram->num_cs; i++) {
struct mbus_dram_window *cs = dram->cs + i; const struct mbus_dram_window *cs = dram->cs + i;
writel((cs->base & 0xffff0000) | writel((cs->base & 0xffff0000) |
(cs->mbus_attr << 8) | (cs->mbus_attr << 8) |
...@@ -1290,7 +1290,7 @@ static struct platform_driver mv_xor_driver = { ...@@ -1290,7 +1290,7 @@ static struct platform_driver mv_xor_driver = {
static int mv_xor_shared_probe(struct platform_device *pdev) static int mv_xor_shared_probe(struct platform_device *pdev)
{ {
struct mv_xor_platform_shared_data *msd = pdev->dev.platform_data; const struct mbus_dram_target_info *dram;
struct mv_xor_shared_private *msp; struct mv_xor_shared_private *msp;
struct resource *res; struct resource *res;
...@@ -1323,8 +1323,9 @@ static int mv_xor_shared_probe(struct platform_device *pdev) ...@@ -1323,8 +1323,9 @@ static int mv_xor_shared_probe(struct platform_device *pdev)
/* /*
* (Re-)program MBUS remapping windows if we are asked to. * (Re-)program MBUS remapping windows if we are asked to.
*/ */
if (msd != NULL && msd->dram != NULL) dram = mv_mbus_dram_info();
mv_xor_conf_mbus_windows(msp, msd->dram); if (dram)
mv_xor_conf_mbus_windows(msp, dram);
return 0; return 0;
} }
......
...@@ -679,8 +679,9 @@ static const struct mmc_host_ops mvsd_ops = { ...@@ -679,8 +679,9 @@ static const struct mmc_host_ops mvsd_ops = {
.enable_sdio_irq = mvsd_enable_sdio_irq, .enable_sdio_irq = mvsd_enable_sdio_irq,
}; };
static void __init mv_conf_mbus_windows(struct mvsd_host *host, static void __init
struct mbus_dram_target_info *dram) mv_conf_mbus_windows(struct mvsd_host *host,
const struct mbus_dram_target_info *dram)
{ {
void __iomem *iobase = host->base; void __iomem *iobase = host->base;
int i; int i;
...@@ -691,7 +692,7 @@ static void __init mv_conf_mbus_windows(struct mvsd_host *host, ...@@ -691,7 +692,7 @@ static void __init mv_conf_mbus_windows(struct mvsd_host *host,
} }
for (i = 0; i < dram->num_cs; i++) { for (i = 0; i < dram->num_cs; i++) {
struct mbus_dram_window *cs = dram->cs + i; const struct mbus_dram_window *cs = dram->cs + i;
writel(((cs->size - 1) & 0xffff0000) | writel(((cs->size - 1) & 0xffff0000) |
(cs->mbus_attr << 8) | (cs->mbus_attr << 8) |
(dram->mbus_dram_target_id << 4) | 1, (dram->mbus_dram_target_id << 4) | 1,
...@@ -705,6 +706,7 @@ static int __init mvsd_probe(struct platform_device *pdev) ...@@ -705,6 +706,7 @@ static int __init mvsd_probe(struct platform_device *pdev)
struct mmc_host *mmc = NULL; struct mmc_host *mmc = NULL;
struct mvsd_host *host = NULL; struct mvsd_host *host = NULL;
const struct mvsdio_platform_data *mvsd_data; const struct mvsdio_platform_data *mvsd_data;
const struct mbus_dram_target_info *dram;
struct resource *r; struct resource *r;
int ret, irq; int ret, irq;
...@@ -755,8 +757,9 @@ static int __init mvsd_probe(struct platform_device *pdev) ...@@ -755,8 +757,9 @@ static int __init mvsd_probe(struct platform_device *pdev)
} }
/* (Re-)program MBUS remapping windows if we are asked to. */ /* (Re-)program MBUS remapping windows if we are asked to. */
if (mvsd_data->dram != NULL) dram = mv_mbus_dram_info();
mv_conf_mbus_windows(host, mvsd_data->dram); if (dram)
mv_conf_mbus_windows(host, dram);
mvsd_power_down(host); mvsd_power_down(host);
......
...@@ -2509,7 +2509,7 @@ static void mv643xx_eth_netpoll(struct net_device *dev) ...@@ -2509,7 +2509,7 @@ static void mv643xx_eth_netpoll(struct net_device *dev)
/* platform glue ************************************************************/ /* platform glue ************************************************************/
static void static void
mv643xx_eth_conf_mbus_windows(struct mv643xx_eth_shared_private *msp, mv643xx_eth_conf_mbus_windows(struct mv643xx_eth_shared_private *msp,
struct mbus_dram_target_info *dram) const struct mbus_dram_target_info *dram)
{ {
void __iomem *base = msp->base; void __iomem *base = msp->base;
u32 win_enable; u32 win_enable;
...@@ -2527,7 +2527,7 @@ mv643xx_eth_conf_mbus_windows(struct mv643xx_eth_shared_private *msp, ...@@ -2527,7 +2527,7 @@ mv643xx_eth_conf_mbus_windows(struct mv643xx_eth_shared_private *msp,
win_protect = 0; win_protect = 0;
for (i = 0; i < dram->num_cs; i++) { for (i = 0; i < dram->num_cs; i++) {
struct mbus_dram_window *cs = dram->cs + i; const struct mbus_dram_window *cs = dram->cs + i;
writel((cs->base & 0xffff0000) | writel((cs->base & 0xffff0000) |
(cs->mbus_attr << 8) | (cs->mbus_attr << 8) |
...@@ -2577,6 +2577,7 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev) ...@@ -2577,6 +2577,7 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev)
static int mv643xx_eth_version_printed; static int mv643xx_eth_version_printed;
struct mv643xx_eth_shared_platform_data *pd = pdev->dev.platform_data; struct mv643xx_eth_shared_platform_data *pd = pdev->dev.platform_data;
struct mv643xx_eth_shared_private *msp; struct mv643xx_eth_shared_private *msp;
const struct mbus_dram_target_info *dram;
struct resource *res; struct resource *res;
int ret; int ret;
...@@ -2641,8 +2642,9 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev) ...@@ -2641,8 +2642,9 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev)
/* /*
* (Re-)program MBUS remapping windows if we are asked to. * (Re-)program MBUS remapping windows if we are asked to.
*/ */
if (pd != NULL && pd->dram != NULL) dram = mv_mbus_dram_info();
mv643xx_eth_conf_mbus_windows(msp, pd->dram); if (dram)
mv643xx_eth_conf_mbus_windows(msp, dram);
/* /*
* Detect hardware parameters. * Detect hardware parameters.
......
...@@ -172,7 +172,7 @@ static const struct hc_driver ehci_orion_hc_driver = { ...@@ -172,7 +172,7 @@ static const struct hc_driver ehci_orion_hc_driver = {
static void __init static void __init
ehci_orion_conf_mbus_windows(struct usb_hcd *hcd, ehci_orion_conf_mbus_windows(struct usb_hcd *hcd,
struct mbus_dram_target_info *dram) const struct mbus_dram_target_info *dram)
{ {
int i; int i;
...@@ -182,7 +182,7 @@ ehci_orion_conf_mbus_windows(struct usb_hcd *hcd, ...@@ -182,7 +182,7 @@ ehci_orion_conf_mbus_windows(struct usb_hcd *hcd,
} }
for (i = 0; i < dram->num_cs; i++) { for (i = 0; i < dram->num_cs; i++) {
struct mbus_dram_window *cs = dram->cs + i; const struct mbus_dram_window *cs = dram->cs + i;
wrl(USB_WINDOW_CTRL(i), ((cs->size - 1) & 0xffff0000) | wrl(USB_WINDOW_CTRL(i), ((cs->size - 1) & 0xffff0000) |
(cs->mbus_attr << 8) | (cs->mbus_attr << 8) |
...@@ -194,6 +194,7 @@ ehci_orion_conf_mbus_windows(struct usb_hcd *hcd, ...@@ -194,6 +194,7 @@ ehci_orion_conf_mbus_windows(struct usb_hcd *hcd,
static int __devinit ehci_orion_drv_probe(struct platform_device *pdev) static int __devinit ehci_orion_drv_probe(struct platform_device *pdev)
{ {
struct orion_ehci_data *pd = pdev->dev.platform_data; struct orion_ehci_data *pd = pdev->dev.platform_data;
const struct mbus_dram_target_info *dram;
struct resource *res; struct resource *res;
struct usb_hcd *hcd; struct usb_hcd *hcd;
struct ehci_hcd *ehci; struct ehci_hcd *ehci;
...@@ -259,8 +260,9 @@ static int __devinit ehci_orion_drv_probe(struct platform_device *pdev) ...@@ -259,8 +260,9 @@ static int __devinit ehci_orion_drv_probe(struct platform_device *pdev)
/* /*
* (Re-)program MBUS remapping windows if we are asked to. * (Re-)program MBUS remapping windows if we are asked to.
*/ */
if (pd != NULL && pd->dram != NULL) dram = mv_mbus_dram_info();
ehci_orion_conf_mbus_windows(hcd, pd->dram); if (dram)
ehci_orion_conf_mbus_windows(hcd, dram);
/* /*
* setup Orion USB controller. * setup Orion USB controller.
......
...@@ -32,5 +32,16 @@ struct mbus_dram_target_info ...@@ -32,5 +32,16 @@ struct mbus_dram_target_info
} cs[4]; } cs[4];
}; };
/*
* The Marvell mbus is to be found only on SOCs from the Orion family
* at the moment. Provide a dummy stub for other architectures.
*/
#ifdef CONFIG_PLAT_ORION
extern const struct mbus_dram_target_info *mv_mbus_dram_info(void);
#else
static inline const struct mbus_dram_target_info *mv_mbus_dram_info(void)
{
return NULL;
}
#endif
#endif #endif
...@@ -94,9 +94,10 @@ static irqreturn_t kirkwood_dma_irq(int irq, void *dev_id) ...@@ -94,9 +94,10 @@ static irqreturn_t kirkwood_dma_irq(int irq, void *dev_id)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
static void kirkwood_dma_conf_mbus_windows(void __iomem *base, int win, static void
unsigned long dma, kirkwood_dma_conf_mbus_windows(void __iomem *base, int win,
struct mbus_dram_target_info *dram) unsigned long dma,
const struct mbus_dram_target_info *dram)
{ {
int i; int i;
...@@ -106,7 +107,7 @@ static void kirkwood_dma_conf_mbus_windows(void __iomem *base, int win, ...@@ -106,7 +107,7 @@ static void kirkwood_dma_conf_mbus_windows(void __iomem *base, int win,
/* try to find matching cs for current dma address */ /* try to find matching cs for current dma address */
for (i = 0; i < dram->num_cs; i++) { for (i = 0; i < dram->num_cs; i++) {
struct mbus_dram_window *cs = dram->cs + i; const struct mbus_dram_window *cs = dram->cs + i;
if ((cs->base & 0xffff0000) < (dma & 0xffff0000)) { if ((cs->base & 0xffff0000) < (dma & 0xffff0000)) {
writel(cs->base & 0xffff0000, writel(cs->base & 0xffff0000,
base + KIRKWOOD_AUDIO_WIN_BASE_REG(win)); base + KIRKWOOD_AUDIO_WIN_BASE_REG(win));
...@@ -127,6 +128,7 @@ static int kirkwood_dma_open(struct snd_pcm_substream *substream) ...@@ -127,6 +128,7 @@ static int kirkwood_dma_open(struct snd_pcm_substream *substream)
struct snd_soc_dai *cpu_dai = soc_runtime->cpu_dai; struct snd_soc_dai *cpu_dai = soc_runtime->cpu_dai;
struct kirkwood_dma_data *priv; struct kirkwood_dma_data *priv;
struct kirkwood_dma_priv *prdata = snd_soc_platform_get_drvdata(platform); struct kirkwood_dma_priv *prdata = snd_soc_platform_get_drvdata(platform);
const struct mbus_dram_target_info *dram;
unsigned long addr; unsigned long addr;
priv = snd_soc_dai_get_dma_data(cpu_dai, substream); priv = snd_soc_dai_get_dma_data(cpu_dai, substream);
...@@ -175,15 +177,16 @@ static int kirkwood_dma_open(struct snd_pcm_substream *substream) ...@@ -175,15 +177,16 @@ static int kirkwood_dma_open(struct snd_pcm_substream *substream)
writel((unsigned long)-1, priv->io + KIRKWOOD_ERR_MASK); writel((unsigned long)-1, priv->io + KIRKWOOD_ERR_MASK);
} }
dram = mv_mbus_dram_info();
addr = virt_to_phys(substream->dma_buffer.area); addr = virt_to_phys(substream->dma_buffer.area);
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
prdata->play_stream = substream; prdata->play_stream = substream;
kirkwood_dma_conf_mbus_windows(priv->io, kirkwood_dma_conf_mbus_windows(priv->io,
KIRKWOOD_PLAYBACK_WIN, addr, priv->dram); KIRKWOOD_PLAYBACK_WIN, addr, dram);
} else { } else {
prdata->rec_stream = substream; prdata->rec_stream = substream;
kirkwood_dma_conf_mbus_windows(priv->io, kirkwood_dma_conf_mbus_windows(priv->io,
KIRKWOOD_RECORD_WIN, addr, priv->dram); KIRKWOOD_RECORD_WIN, addr, dram);
} }
return 0; return 0;
......
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