1 From 69939eb84658f25f2300a34c3f7719ac05c86dec Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.com>
3 Date: Thu, 11 May 2023 16:25:46 +0100
4 Subject: [PATCH] mmc: bcm2835: Use phys addresses for slave DMA config
6 Contrary to what struct snd_dmaengine_dai_dma_data suggests, the
7 configuration of addresses of DMA slave interfaces should be done in
8 CPU physical addresses.
10 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
12 drivers/mmc/host/bcm2835.c | 17 +++--------------
13 1 file changed, 3 insertions(+), 14 deletions(-)
15 --- a/drivers/mmc/host/bcm2835.c
16 +++ b/drivers/mmc/host/bcm2835.c
19 #include <linux/iopoll.h>
20 #include <linux/module.h>
21 -#include <linux/of_address.h>
22 #include <linux/of_irq.h>
23 #include <linux/platform_device.h>
24 #include <linux/scatterlist.h>
25 @@ -1355,8 +1354,8 @@ static int bcm2835_probe(struct platform
26 struct device *dev = &pdev->dev;
28 struct bcm2835_host *host;
29 + struct resource *iomem;
31 - const __be32 *regaddr_p;
34 dev_dbg(dev, "%s\n", __func__);
35 @@ -1369,23 +1368,13 @@ static int bcm2835_probe(struct platform
37 spin_lock_init(&host->lock);
39 - host->ioaddr = devm_platform_ioremap_resource(pdev, 0);
40 + host->ioaddr = devm_platform_get_and_ioremap_resource(pdev, 0, &iomem);
41 if (IS_ERR(host->ioaddr)) {
42 ret = PTR_ERR(host->ioaddr);
46 - /* Parse OF address directly to get the physical address for
47 - * DMA to our registers.
49 - regaddr_p = of_get_address(pdev->dev.of_node, 0, NULL, NULL);
51 - dev_err(dev, "Can't get phys address\n");
56 - host->phys_addr = be32_to_cpup(regaddr_p);
57 + host->phys_addr = iomem->start;
59 host->dma_chan = NULL;
60 host->dma_desc = NULL;