From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Rutland Subject: Re: [RFC PATCH 3/4] arm64:thunder: Add initial dts for Cavium Thunder SoC in 2 Node topology. Date: Fri, 3 Oct 2014 12:19:16 +0100 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 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1411635840-24038-4-git-send-email-ganapatrao.kulkarni-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Ganapatrao Kulkarni Cc: Catalin Marinas , Will Deacon , "grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org" , "robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org" , "devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org" , "gpkulkarni-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" List-Id: devicetree@vger.kernel.org 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---- 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 ---->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-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html