lkml.org 
[lkml]   [2016]   [Aug]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 14/26] MIPS: CDMM: Allow CDMM base address to be specified via DT
Date
Allow systems to specify the base address for the CDMM using device
tree. This removes the need for it to be specified by platform specific
code, preparing for generic kernels which can run without any.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
---

drivers/bus/mips_cdmm.c | 13 +++++++++++++
1 file changed, 13 insertions(+)

diff --git a/drivers/bus/mips_cdmm.c b/drivers/bus/mips_cdmm.c
index cad49bc..311ce54 100644
--- a/drivers/bus/mips_cdmm.c
+++ b/drivers/bus/mips_cdmm.c
@@ -13,6 +13,8 @@
#include <linux/cpu.h>
#include <linux/cpumask.h>
#include <linux/io.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/smp.h>
@@ -340,6 +342,17 @@ static phys_addr_t mips_cdmm_cur_base(void)
*/
phys_addr_t __weak mips_cdmm_phys_base(void)
{
+ struct device_node *cdmm_node;
+ struct resource res;
+ int err;
+
+ cdmm_node = of_find_compatible_node(of_root, NULL, "mti,mips-cdmm");
+ if (cdmm_node) {
+ err = of_address_to_resource(cdmm_node, 0, &res);
+ if (!err)
+ return res.start;
+ }
+
return 0;
}

--
2.9.3
\
 
 \ /
  Last update: 2016-09-17 09:57    [W:0.187 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site