From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754604AbcHZPlo (ORCPT ); Fri, 26 Aug 2016 11:41:44 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:22138 "EHLO mailapp01.imgtec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753131AbcHZPlj (ORCPT ); Fri, 26 Aug 2016 11:41:39 -0400 From: Paul Burton To: , Ralf Baechle CC: Paul Burton , Bjorn Helgaas , , James Hogan , Anna-Maria Gleixner Subject: [PATCH 14/26] MIPS: CDMM: Allow CDMM base address to be specified via DT Date: Fri, 26 Aug 2016 16:37:13 +0100 Message-ID: <20160826153725.11629-15-paul.burton@imgtec.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20160826153725.11629-1-paul.burton@imgtec.com> References: <20160826153725.11629-1-paul.burton@imgtec.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.100.200.141] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 #include #include +#include +#include #include #include #include @@ -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