openwrt/target/linux/bcm27xx/patches-6.1/950-0717-bcm2835-sdhost-Use-phys-addresses-for-slave-DMA-conf.patch
Álvaro Fernández Rojas 793f8ab62c bcm27xx: 6.1: add kernel patches
Add kernel patches for version 6.1.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-06-09 19:12:30 +02:00

55 lines
1.7 KiB
Diff

From 975bb6f620418ffcfa101561583d6cadc8025a1d Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.com>
Date: Thu, 11 May 2023 16:24:26 +0100
Subject: [PATCH] bcm2835-sdhost: 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-sdhost.c | 17 ++---------------
1 file changed, 2 insertions(+), 15 deletions(-)
--- a/drivers/mmc/host/bcm2835-sdhost.c
+++ b/drivers/mmc/host/bcm2835-sdhost.c
@@ -2015,9 +2015,7 @@ static int bcm2835_sdhost_probe(struct p
struct resource *iomem;
struct bcm2835_host *host;
struct mmc_host *mmc;
- const __be32 *addr;
u32 msg[3];
- int na;
int ret;
pr_debug("bcm2835_sdhost_probe\n");
@@ -2034,24 +2032,13 @@ static int bcm2835_sdhost_probe(struct p
host->allow_dma = 1;
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;
}
- na = of_n_addr_cells(node);
- addr = of_get_address(node, 0, NULL, NULL);
- if (!addr) {
- dev_err(dev, "could not get DMA-register address\n");
- return -ENODEV;
- }
- host->bus_addr = (phys_addr_t)of_read_number(addr, na);
- pr_debug(" - ioaddr %lx, iomem->start %lx, bus_addr %lx\n",
- (unsigned long)host->ioaddr,
- (unsigned long)iomem->start,
- (unsigned long)host->bus_addr);
+ host->bus_addr = iomem->start;
if (node) {
/* Read any custom properties */