bcm27xx: 6.1: add kernel patches
[openwrt/openwrt.git] / target / linux / bcm27xx / patches-6.1 / 950-0716-bcm2835-sdhost-Use-DT-to-configure-logging.patch
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
5
6 Retrieve the system timer base address directly from DT.
7
8 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
9 ---
10 drivers/mmc/host/bcm2835-sdhost.c | 10 +++++++---
11 1 file changed, 7 insertions(+), 3 deletions(-)
12
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)
18
19 -static void log_init(struct device *dev, u32 bus_to_phys)
20 +static void log_init(struct device *dev)
21 {
22 + struct device_node *np;
23 +
24 spin_lock_init(&log_lock);
25 sdhost_log_buf = dma_alloc_coherent(dev, LOG_SIZE, &sdhost_log_addr,
26 GFP_KERNEL);
27 if (sdhost_log_buf) {
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);
34 if (!timer_base)
35 pr_err("sdhost: failed to remap timer\n");
36 }
37 @@ -2123,7 +2127,7 @@ static int bcm2835_sdhost_probe(struct p
38 (unsigned long)host->max_clk,
39 (int)host->irq);
40
41 - log_init(dev, iomem->start - host->bus_addr);
42 + log_init(dev);
43
44 if (node)
45 mmc_of_parse(mmc);