From patchwork Fri Oct 3 11:19:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Rutland X-Patchwork-Id: 38313 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0F8C92057C for ; Fri, 3 Oct 2014 11:22:12 +0000 (UTC) Received: by mail-wg0-f69.google.com with SMTP id b13sf557211wgh.4 for ; Fri, 03 Oct 2014 04:22:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:date:from:to:cc:subject:message-id :references:mime-version:in-reply-to:user-agent:sender:precedence :list-id:x-original-sender:x-original-authentication-results :mailing-list:list-post:list-help:list-archive:list-unsubscribe :content-type:content-disposition; bh=1eywF5rJS1X7I1PF1tAa5DFMME/Hxy43EvnX2UVTeHU=; b=HcBxMSorMdZG3hSUl3IQteLbw67cbALwyypgYcc80cuUYvvC7s//tixwUCTTl8leJs jmZci962oMSGO83giwMzB1fMKo9J+r/BjMss2MmUCkiduHAotZ27E6J0wNfZxqLjyMn7 qr0Bnm6UuyR/DSl27xx0Z76GfHm7wh0/3f+HFdnc4TEZVoXanZTE+eIF31cb2vp/48E4 K0OIFgsHyjkI+aJ+9JEoXGnKpmCy+EF03Bb9XdDxf2GkRRh5PrCm4iGiXDriv6mMOctV ksLf9K9SHbflL77bHgVR0XX9uF8E0f1Fv2F9faTw3bet4TZw+6v0fy2UMkZi8eBABpRt HAUg== X-Gm-Message-State: ALoCoQkpMYvFhdR4e0OU5vxAEqGJNnJZik6jPuifMRo0tktGLlal0YtO15if9tTR01CGKeCrXyj7 X-Received: by 10.181.25.234 with SMTP id it10mr691627wid.1.1412335332162; Fri, 03 Oct 2014 04:22:12 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.29.135 with SMTP id k7ls334193lah.78.gmail; Fri, 03 Oct 2014 04:22:11 -0700 (PDT) X-Received: by 10.112.128.135 with SMTP id no7mr4954025lbb.74.1412335331851; Fri, 03 Oct 2014 04:22:11 -0700 (PDT) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com [209.85.217.179]) by mx.google.com with ESMTPS id y10si10681986laj.52.2014.10.03.04.22.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 03 Oct 2014 04:22:11 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by mail-lb0-f179.google.com with SMTP id l4so796190lbv.24 for ; Fri, 03 Oct 2014 04:22:11 -0700 (PDT) X-Received: by 10.112.130.226 with SMTP id oh2mr2478150lbb.100.1412335331534; Fri, 03 Oct 2014 04:22:11 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.130.169 with SMTP id of9csp208662lbb; Fri, 3 Oct 2014 04:22:10 -0700 (PDT) X-Received: by 10.66.236.138 with SMTP id uu10mr6348809pac.51.1412335330053; Fri, 03 Oct 2014 04:22:10 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id pi5si4315551pdb.125.2014.10.03.04.22.09 for ; Fri, 03 Oct 2014 04:22:10 -0700 (PDT) Received-SPF: none (google.com: devicetree-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751334AbaJCLWI (ORCPT + 5 others); Fri, 3 Oct 2014 07:22:08 -0400 Received: from cam-admin0.cambridge.arm.com ([217.140.96.50]:63140 "EHLO cam-admin0.cambridge.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751314AbaJCLWH (ORCPT ); Fri, 3 Oct 2014 07:22:07 -0400 Received: from leverpostej (leverpostej.cambridge.arm.com [10.1.205.151]) by cam-admin0.cambridge.arm.com (8.12.6/8.12.6) with ESMTP id s93BJIwo001076; Fri, 3 Oct 2014 12:19:18 +0100 (BST) Date: Fri, 3 Oct 2014 12:19:16 +0100 From: Mark Rutland To: Ganapatrao Kulkarni Cc: Catalin Marinas , Will Deacon , "grant.likely@linaro.org" , "robh+dt@kernel.org" , "devicetree@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "gpkulkarni@gmail.com" Subject: Re: [RFC PATCH 3/4] arm64:thunder: Add initial dts for Cavium Thunder SoC in 2 Node topology. Message-ID: <20141003111916.GF26643@leverpostej> References: <1411635840-24038-1-git-send-email-ganapatrao.kulkarni@caviumnetworks.com> <1411635840-24038-4-git-send-email-ganapatrao.kulkarni@caviumnetworks.com> MIME-Version: 1.0 In-Reply-To: <1411635840-24038-4-git-send-email-ganapatrao.kulkarni@caviumnetworks.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: devicetree-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: devicetree@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: mark.rutland@arm.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Content-Disposition: inline On Thu, Sep 25, 2014 at 10:03:58AM +0100, Ganapatrao Kulkarni wrote: > adding devicetree definition for thunder's 2 node topology. > Defined cpu-map for all 96 cores of 2 node system. [...] > + CPU0: cpu@000 { > + device_type = "cpu"; > + compatible = "cavium,thunder", "arm,armv8"; > + reg = <0x0 0x000>; > + enable-method = "psci"; > + }; > + CPU1: cpu@001 { > + device_type = "cpu"; > + compatible = "cavium,thunder", "arm,armv8"; > + reg = <0x0 0x001>; > + enable-method = "psci"; > + }; This is going to take up an awful lot of space. Perhaps we should follwo ePAPR and allow for common properties to go in /cpus (as I believe we do for arm). We might not be able to do that for device_type given how we detect CPU nodes at present, but we could certainly do it for the enable-method: ---->8---- ---->8---- I don't believe we check the compatible string at the moment, so that should be safe to make common too. Mark. --- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm64/kernel/cpu_ops.c b/arch/arm64/kernel/cpu_ops.c index cce9524..733b3ed 100644 --- a/arch/arm64/kernel/cpu_ops.c +++ b/arch/arm64/kernel/cpu_ops.c @@ -54,7 +54,18 @@ static const struct cpu_operations * __init cpu_get_ops(const char *name) */ int __init cpu_read_ops(struct device_node *dn, int cpu) { - const char *enable_method = of_get_property(dn, "enable-method", NULL); + const char *enable_method = NULL; + of_property_read_string(dn, "enable-method", &enable_method); + + if (!enable_method) { + /* + * Perhaps we have a common /cpus/enable-method + */ + struct device_node *cpus = of_get_parent(dn); + of_property_read_string(cpus, "enable-method", &enable_method); + of_node_put(cpus); + } + if (!enable_method) { /* * The boot CPU may not have an enable method (e.g. when