aboutsummaryrefslogtreecommitdiff
path: root/target/linux/bcm27xx/patches-6.1/950-0714-bcm2835-mmc-Use-phys-addresses-for-slave-DMA-config.patch
blob: f52e9438f07658054e8151771279deab82c279e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
From b4c2f9c2f928b8481d85569ebd4efa419d29cfdb Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.com>
Date: Thu, 11 May 2023 16:19:57 +0100
Subject: [PATCH] bcm2835-mmc: Use phys addresses for slave DMA config

Contrary to what struct snd_dmaengine_dai_dma_data suggests, the
configuration of addresses of DMA slave interfaces should be done in
CPU physical addresses.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
---
 drivers/mmc/host/bcm2835-mmc.c | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

--- a/drivers/mmc/host/bcm2835-mmc.c
+++ b/drivers/mmc/host/bcm2835-mmc.c
@@ -1404,7 +1404,6 @@ static int bcm2835_mmc_probe(struct plat
 	struct resource *iomem;
 	struct bcm2835_host *host;
 	struct mmc_host *mmc;
-	const __be32 *addr;
 	int ret;
 
 	mmc = mmc_alloc_host(sizeof(*host), dev);
@@ -1417,25 +1416,12 @@ static int bcm2835_mmc_probe(struct plat
 	host->timeout = msecs_to_jiffies(1000);
 	spin_lock_init(&host->lock);
 
-	iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	host->ioaddr = devm_ioremap_resource(dev, iomem);
+	host->ioaddr = devm_platform_get_and_ioremap_resource(pdev, 0, &iomem);
 	if (IS_ERR(host->ioaddr)) {
 		ret = PTR_ERR(host->ioaddr);
 		goto err;
 	}
 
-	addr = of_get_address(node, 0, NULL, NULL);
-	if (!addr) {
-		dev_err(dev, "could not get DMA-register address\n");
-		ret = -ENODEV;
-		goto err;
-	}
-	host->bus_addr = be32_to_cpup(addr);
-	pr_debug(" - ioaddr %lx, iomem->start %lx, bus_addr %lx\n",
-		 (unsigned long)host->ioaddr,
-		 (unsigned long)iomem->start,
-		 (unsigned long)host->bus_addr);
-
 #ifndef FORCE_PIO
 	if (node) {
 		host->dma_chan_rxtx = dma_request_slave_channel(dev, "rx-tx");