1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter.git synced 2025-02-15 04:42:02 +00:00
openmptcprouter/6.1/target/linux/bcm27xx/patches-6.1/950-0718-bcm2835-sdhost-Use-DT-to-configure-logging.patch
Ycarus (Yannick Chabanois) 3743692973 Fix RPI5 support
2023-11-17 17:31:36 +01:00

45 lines
1.4 KiB
Diff

From d75dc424481fe13f702e6419a19a8e40a45fc244 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);