Received: by 10.213.65.68 with SMTP id h4csp430633imn; Tue, 13 Mar 2018 08:50:05 -0700 (PDT) X-Google-Smtp-Source: AG47ELu56T1wBiMZycXU/0WzByaxJ1oDx64LTuXHFyfjB3aOFwwSJd8NHdE/l8/j2adAQTxG1Im/ X-Received: by 10.99.164.81 with SMTP id c17mr895347pgp.114.1520956205305; Tue, 13 Mar 2018 08:50:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520956205; cv=none; d=google.com; s=arc-20160816; b=jmePkza+663TYaQT8yy+bOpv2Rbz3ybhh0dhYitoG4W8OEWr/l3W4W4YcG0RoavGrR pTCPhHvWoomPD+D4CDejE9H8p/bmxfIFzGgSgWqegUhIo/TOYaQcN48xwiBOmRxtYJfZ g8cQdUIOQmcXUZeXkA2jkjA6xIr3kvwSC33G3wV8TnZmfMEIqHXcTFWFcYTgGDyXKKHQ F3qN7WmcKxtDo4Oi3vIy7RVv1V8GYxLWpyqyde6UOVftYqCo0QOzK5YkevRtRbtaVdHs UdTdgt8dreuwUZszjd6AEWsqEiKpHjwSNawShN11thz60J4V2m+R+YK97qw0NJRgsmhx 2exg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=PwX6Y2d6l7by8uaIxtgOjzvLTLQcN6TSMTTGGu8po8A=; b=rjINwhxHh/o4TL9tvG/7f7N7BowSqAjLr3XZmDz+shKK2rXoexEADwQWr5JVpOQmdE gc8FpoksXZEDt7zTSsdsQzbl6itYfFi1YLFjRUpRa+p6oz12C5Xos6BYivQjpsHfz3sQ Nm4pTvjEwTttiKuPwUbIwiKrvQ1rFhDiiN9gM1+rg5IrZlpgmIdptxkEK2R1h3U3Dqj5 4jbSwguPw4LUy7o6RRgtKhtQSAZ2Aq2HOkCK0aoSbpxXRm9Fdj8wH6RihQhRQtu/joKQ gBhcmqa3dRwbRJnEaE6gul+NsrtmmHcpiHyiM8/a9wkx3++e0ZJtVtMweR6OBz5yquD8 pk/Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q4-v6si277855plr.365.2018.03.13.08.49.50; Tue, 13 Mar 2018 08:50:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934895AbeCMPk2 (ORCPT + 99 others); Tue, 13 Mar 2018 11:40:28 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:35682 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934884AbeCMPkZ (ORCPT ); Tue, 13 Mar 2018 11:40:25 -0400 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id C9C0A10EC; Tue, 13 Mar 2018 15:40:24 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Paul Burton , Miodrag Dinic , Aleksandar Markovic , linux-mips@linux-mips.org, Ralf Baechle , James Hogan Subject: [PATCH 4.14 114/140] MIPS: CPC: Map registers using DT in mips_cpc_default_phys_base() Date: Tue, 13 Mar 2018 16:25:17 +0100 Message-Id: <20180313152505.846604094@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180313152458.201155692@linuxfoundation.org> References: <20180313152458.201155692@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Paul Burton commit 791412dafbbfd860e78983d45cf71db603a82f67 upstream. Reading mips_cpc_base value from the DT allows each platform to define it according to its needs. This is especially convenient for MIPS_GENERIC kernel where this kind of information should be determined in runtime. Use mti,mips-cpc compatible string with just a reg property to specify the register location for your platform. Signed-off-by: Paul Burton Signed-off-by: Miodrag Dinic Signed-off-by: Aleksandar Markovic Cc: linux-mips@linux-mips.org Cc: Ralf Baechle Patchwork: https://patchwork.linux-mips.org/patch/18513/ Signed-off-by: James Hogan Signed-off-by: Greg Kroah-Hartman --- arch/mips/kernel/mips-cpc.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) --- a/arch/mips/kernel/mips-cpc.c +++ b/arch/mips/kernel/mips-cpc.c @@ -10,6 +10,8 @@ #include #include +#include +#include #include #include @@ -22,6 +24,17 @@ static DEFINE_PER_CPU_ALIGNED(unsigned l phys_addr_t __weak mips_cpc_default_phys_base(void) { + struct device_node *cpc_node; + struct resource res; + int err; + + cpc_node = of_find_compatible_node(of_root, NULL, "mti,mips-cpc"); + if (cpc_node) { + err = of_address_to_resource(cpc_node, 0, &res); + if (!err) + return res.start; + } + return 0; }