bcm27xx: update 6.1 patches from RPi foundation
[openwrt/staging/xback.git] / target / linux / bcm27xx / patches-6.1 / 950-0718-mmc-bcm2835-Use-phys-addresses-for-slave-DMA-config.patch
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
5
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.
9
10 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
11 ---
12 drivers/mmc/host/bcm2835.c | 17 +++--------------
13 1 file changed, 3 insertions(+), 14 deletions(-)
14
15 --- a/drivers/mmc/host/bcm2835.c
16 +++ b/drivers/mmc/host/bcm2835.c
17 @@ -38,7 +38,6 @@
18 #include <linux/io.h>
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;
27 struct clk *clk;
28 struct bcm2835_host *host;
29 + struct resource *iomem;
30 struct mmc_host *mmc;
31 - const __be32 *regaddr_p;
32 int ret;
33
34 dev_dbg(dev, "%s\n", __func__);
35 @@ -1369,23 +1368,13 @@ static int bcm2835_probe(struct platform
36 host->pdev = pdev;
37 spin_lock_init(&host->lock);
38
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);
43 goto err;
44 }
45
46 - /* Parse OF address directly to get the physical address for
47 - * DMA to our registers.
48 - */
49 - regaddr_p = of_get_address(pdev->dev.of_node, 0, NULL, NULL);
50 - if (!regaddr_p) {
51 - dev_err(dev, "Can't get phys address\n");
52 - ret = -EINVAL;
53 - goto err;
54 - }
55 -
56 - host->phys_addr = be32_to_cpup(regaddr_p);
57 + host->phys_addr = iomem->start;
58
59 host->dma_chan = NULL;
60 host->dma_desc = NULL;