aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/bcm27xx/patches-4.19/950-0462-mmc-bcm2835-sdhost-Support-64-bit-physical-addresses.patch
blob: a2aeeea2dd5c269e390d6b3bcc417f1e0384a99a (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
52
53
54
55
56
From 8a58288d710a817b5dc7747f0bec1fb167368e7e Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Wed, 29 Aug 2018 09:05:15 +0100
Subject: [PATCH] mmc: bcm2835-sdhost: Support 64-bit physical
 addresses

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
---
 drivers/mmc/host/bcm2835-sdhost.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

--- a/drivers/mmc/host/bcm2835-sdhost.c
+++ b/drivers/mmc/host/bcm2835-sdhost.c
@@ -148,7 +148,7 @@ struct bcm2835_host {
 	spinlock_t		lock;
 
 	void __iomem		*ioaddr;
-	u32			bus_addr;
+	phys_addr_t		bus_addr;
 
 	struct mmc_host		*mmc;
 
@@ -246,8 +246,8 @@ static void log_init(struct device *dev,
 	sdhost_log_buf = dma_zalloc_coherent(dev, LOG_SIZE, &sdhost_log_addr,
 					     GFP_KERNEL);
 	if (sdhost_log_buf) {
-		pr_info("sdhost: log_buf @ %p (%x)\n",
-			sdhost_log_buf, (u32)sdhost_log_addr);
+		pr_info("sdhost: log_buf @ %p (%llx)\n",
+			sdhost_log_buf, (u64)sdhost_log_addr);
 		timer_base = ioremap_nocache(bus_to_phys + 0x7e003000, SZ_4K);
 		if (!timer_base)
 			pr_err("sdhost: failed to remap timer\n");
@@ -2024,6 +2024,7 @@ static int bcm2835_sdhost_probe(struct p
 	struct mmc_host *mmc;
 	const __be32 *addr;
 	u32 msg[3];
+	int na;
 	int ret;
 
 	pr_debug("bcm2835_sdhost_probe\n");
@@ -2047,12 +2048,13 @@ static int bcm2835_sdhost_probe(struct p
 		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 = be32_to_cpup(addr);
+	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,