4fee7efa22608798b564d65b324a6b66f888755e
[openwrt/staging/xback.git] /
1 From 975bb6f620418ffcfa101561583d6cadc8025a1d Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.com>
3 Date: Thu, 11 May 2023 16:24:26 +0100
4 Subject: [PATCH] bcm2835-sdhost: Use phys addresses for slave DMA
5 config
6
7 Contrary to what struct snd_dmaengine_dai_dma_data suggests, the
8 configuration of addresses of DMA slave interfaces should be done in
9 CPU physical addresses.
10
11 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
12 ---
13 drivers/mmc/host/bcm2835-sdhost.c | 17 ++---------------
14 1 file changed, 2 insertions(+), 15 deletions(-)
15
16 --- a/drivers/mmc/host/bcm2835-sdhost.c
17 +++ b/drivers/mmc/host/bcm2835-sdhost.c
18 @@ -2015,9 +2015,7 @@ static int bcm2835_sdhost_probe(struct p
19 struct resource *iomem;
20 struct bcm2835_host *host;
21 struct mmc_host *mmc;
22 - const __be32 *addr;
23 u32 msg[3];
24 - int na;
25 int ret;
26
27 pr_debug("bcm2835_sdhost_probe\n");
28 @@ -2034,24 +2032,13 @@ static int bcm2835_sdhost_probe(struct p
29 host->allow_dma = 1;
30 spin_lock_init(&host->lock);
31
32 - iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
33 - host->ioaddr = devm_ioremap_resource(dev, iomem);
34 + host->ioaddr = devm_platform_get_and_ioremap_resource(pdev, 0, &iomem);
35 if (IS_ERR(host->ioaddr)) {
36 ret = PTR_ERR(host->ioaddr);
37 goto err;
38 }
39
40 - na = of_n_addr_cells(node);
41 - addr = of_get_address(node, 0, NULL, NULL);
42 - if (!addr) {
43 - dev_err(dev, "could not get DMA-register address\n");
44 - return -ENODEV;
45 - }
46 - host->bus_addr = (phys_addr_t)of_read_number(addr, na);
47 - pr_debug(" - ioaddr %lx, iomem->start %lx, bus_addr %lx\n",
48 - (unsigned long)host->ioaddr,
49 - (unsigned long)iomem->start,
50 - (unsigned long)host->bus_addr);
51 + host->bus_addr = iomem->start;
52
53 if (node) {
54 /* Read any custom properties */