summaryrefslogtreecommitdiffstats
path: root/target/linux/bcm27xx/patches-6.1/950-0716-bcm2835-sdhost-Use-DT-to-configure-logging.patch
blob: 6227a9031a6a0e10e63244efbc9f8f2b28ab018a (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
From ff2217b2d7f964250dbb9feae94caec8adf3d124 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.com>
Date: Thu, 11 May 2023 16:23:13 +0100
Subject: [PATCH] bcm2835-sdhost: Use DT to configure logging

Retrieve the system timer base address directly from DT.

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

--- a/drivers/mmc/host/bcm2835-sdhost.c
+++ b/drivers/mmc/host/bcm2835-sdhost.c
@@ -242,15 +242,19 @@ static void __iomem *timer_base;
 #define LOG_ENTRIES (256*1)
 #define LOG_SIZE (sizeof(LOG_ENTRY_T)*LOG_ENTRIES)
 
-static void log_init(struct device *dev, u32 bus_to_phys)
+static void log_init(struct device *dev)
 {
+	struct device_node *np;
+
 	spin_lock_init(&log_lock);
 	sdhost_log_buf = dma_alloc_coherent(dev, LOG_SIZE, &sdhost_log_addr,
 					     GFP_KERNEL);
 	if (sdhost_log_buf) {
+		np = of_find_compatible_node(NULL, NULL,
+					     "brcm,bcm2835-system-timer");
 		pr_info("sdhost: log_buf @ %p (%llx)\n",
 			sdhost_log_buf, (u64)sdhost_log_addr);
-		timer_base = ioremap(bus_to_phys + 0x7e003000, SZ_4K);
+		timer_base = of_iomap(np, 0);
 		if (!timer_base)
 			pr_err("sdhost: failed to remap timer\n");
 	}
@@ -2123,7 +2127,7 @@ static int bcm2835_sdhost_probe(struct p
 		 (unsigned long)host->max_clk,
 		 (int)host->irq);
 
-	log_init(dev, iomem->start - host->bus_addr);
+	log_init(dev);
 
 	if (node)
 		mmc_of_parse(mmc);