Received: by 10.213.65.68 with SMTP id h4csp464270imn; Tue, 13 Mar 2018 09:53:28 -0700 (PDT) X-Google-Smtp-Source: AG47ELubmtM+lShVWGKOsse5Db545MeN24qtKbgg6xQFJfAjXpWe950vUjp8Bh72ARjRVueJLsBX X-Received: by 10.98.248.7 with SMTP id d7mr1243668pfh.117.1520960008717; Tue, 13 Mar 2018 09:53:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520960008; cv=none; d=google.com; s=arc-20160816; b=M8V94Qy0b/LNflvuyGDfK4snkGC0XAVgTJl3oJ9nZRMQhNhbPoPre86BpTozgjTgfY qDKWOkC8C56saHynC6Tno7+idz+6YQyn7px3A6WKZc8Wg8RipK2Ov6ENwiSS3g429/u4 jpJFsjYMavf+JRvSA6/CDbERfIShcx9GbbpERtbfvw1AI0RP4jjzan7GqxQV0NmB7Mk0 Y/J+BbyoTpsf+0duNeodeU9ZWN0c644XnJzQa6nLsRAiGVuff7QXlHJmlNXYtgHln8My ilTXsEJ+NlLCYTdNYMlEuSLWRzTHzcWZXk+9iWJCql6IZeNoFCzm0jxUoGpoNxAPJsly Ficw== 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=MeGrr8xl8Qa6IshfPweKohsWxy9mwxVK2IpEKuF05Mo=; b=q4y1D/HV82pTUITSDpW2DXqxK5FHNvCh5d7JZe9CUjKgefpcbQByHKZke68mnlCpzy ruY+qJVFf0qyyuaK9FE7VOcXAOCeV69vQDMGi6QoesK22IuGmSM5LPEzhbxryHRqYCQn j//r17pEmH350C+3GwCy+OgF2hHb70epZCVGFk6kQjlSAfNr9nqJHBdQYb4AbO51+NVJ Zptnm9EnxuYj0s3dDoAdhZXzU9srIFC/GwfR7jfh5BXI2Autqno3uzcRJDNcd/t2dDUe DhJ8IDKS1jf+exQJTorgQBHz+PpAztlv+DR9AUt1ClOuSBPhA1pcD2ydx4OM6uFGemkY Kc8Q== 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 h16-v6si310415pli.408.2018.03.13.09.53.13; Tue, 13 Mar 2018 09:53:28 -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 S933373AbeCMQud (ORCPT + 99 others); Tue, 13 Mar 2018 12:50:33 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:59124 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751435AbeCMPbL (ORCPT ); Tue, 13 Mar 2018 11:31:11 -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 F2DB611DA; Tue, 13 Mar 2018 15:31:10 +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.15 079/146] MIPS: CPC: Map registers using DT in mips_cpc_default_phys_base() Date: Tue, 13 Mar 2018 16:24:06 +0100 Message-Id: <20180313152326.901035436@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180313152320.439085687@linuxfoundation.org> References: <20180313152320.439085687@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.15-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; }