1 From ff2217b2d7f964250dbb9feae94caec8adf3d124 Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.com>
3 Date: Thu, 11 May 2023 16:23:13 +0100
4 Subject: [PATCH] bcm2835-sdhost: Use DT to configure logging
6 Retrieve the system timer base address directly from DT.
8 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
10 drivers/mmc/host/bcm2835-sdhost.c | 10 +++++++---
11 1 file changed, 7 insertions(+), 3 deletions(-)
13 --- a/drivers/mmc/host/bcm2835-sdhost.c
14 +++ b/drivers/mmc/host/bcm2835-sdhost.c
15 @@ -242,15 +242,19 @@ static void __iomem *timer_base;
16 #define LOG_ENTRIES (256*1)
17 #define LOG_SIZE (sizeof(LOG_ENTRY_T)*LOG_ENTRIES)
19 -static void log_init(struct device *dev, u32 bus_to_phys)
20 +static void log_init(struct device *dev)
22 + struct device_node *np;
24 spin_lock_init(&log_lock);
25 sdhost_log_buf = dma_alloc_coherent(dev, LOG_SIZE, &sdhost_log_addr,
28 + np = of_find_compatible_node(NULL, NULL,
29 + "brcm,bcm2835-system-timer");
30 pr_info("sdhost: log_buf @ %p (%llx)\n",
31 sdhost_log_buf, (u64)sdhost_log_addr);
32 - timer_base = ioremap(bus_to_phys + 0x7e003000, SZ_4K);
33 + timer_base = of_iomap(np, 0);
35 pr_err("sdhost: failed to remap timer\n");
37 @@ -2123,7 +2127,7 @@ static int bcm2835_sdhost_probe(struct p
38 (unsigned long)host->max_clk,
41 - log_init(dev, iomem->start - host->bus_addr);