From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from service87.mimecast.com (service87.mimecast.com [91.220.42.44]) by ozlabs.org (Postfix) with ESMTP id 7458F2C0095 for ; Fri, 23 Aug 2013 02:51:25 +1000 (EST) Message-ID: <521641A6.2070503@arm.com> Date: Thu, 22 Aug 2013 17:51:50 +0100 From: Sudeep KarkadaNagesha MIME-Version: 1.0 To: Mark Rutland Subject: Re: [RFC PATCH v2 3/4] powerpc: refactor of_get_cpu_node to support other architectures References: <1376586580-5409-1-git-send-email-Sudeep.KarkadaNagesha@arm.com> <1376674791-28244-1-git-send-email-Sudeep.KarkadaNagesha@arm.com> <1376674791-28244-2-git-send-email-Sudeep.KarkadaNagesha@arm.com> <2032060.4bgTKOdEX2@flatron> <1376777376.25016.11.camel@pasglop> <20130819101922.GI3719@e106331-lin.cambridge.arm.com> <5212177C.8000709@gmail.com> <521223FA.5050903@arm.com> <20130822135930.GC23152@e106331-lin.cambridge.arm.com> In-Reply-To: <20130822135930.GC23152@e106331-lin.cambridge.arm.com> Content-Type: text/plain; charset=WINDOWS-1252 Cc: Jonas Bonn , "devicetree@vger.kernel.org" , Michal Simek , Lorenzo Pieralisi , "linux-pm@vger.kernel.org" , Sudeep KarkadaNagesha , Tomasz Figa , "rob.herring@calxeda.com" , "linux-kernel@vger.kernel.org" , "Rafael J. Wysocki" , Rob Herring , "grant.likely@linaro.org" , "linuxppc-dev@lists.ozlabs.org" , "linux-arm-kernel@lists.infradead.org" List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On 22/08/13 14:59, Mark Rutland wrote: > On Mon, Aug 19, 2013 at 02:56:10PM +0100, Sudeep KarkadaNagesha wrote: >> On 19/08/13 14:02, Rob Herring wrote: >>> On 08/19/2013 05:19 AM, Mark Rutland wrote: >>>> On Sat, Aug 17, 2013 at 11:09:36PM +0100, Benjamin Herrenschmidt wrote= : >>>>> On Sat, 2013-08-17 at 12:50 +0200, Tomasz Figa wrote: >>>>>> I wonder how would this handle uniprocessor ARM (pre-v7) cores, for >>>>>> which=20 >>>>>> the updated bindings[1] define #address-cells =3D <0> and so no reg= =20 >>>>>> property. >>>>>> >>>>>> [1] - http://thread.gmane.org/gmane.linux.ports.arm.kernel/260795 >>>>> >>>>> Why did you do that in the binding ? That sounds like looking to crea= te >>>>> problems ...=20 >>>>> >>>>> Traditionally, UP setups just used "0" as the "reg" property on other >>>>> architectures, why do differently ? >>>> >>>> The decision was taken because we defined our reg property to refer to >>>> the MPIDR register's Aff{2,1,0} bitfields, and on UP cores before v7 >>>> there's no MPIDR register at all. Given there can only be a single CPU >>>> in that case, describing a register that wasn't present didn't seem >>>> necessary or helpful. >>> >>> What exactly reg represents is up to the binding definition, but it >>> still should be present IMO. I don't see any issue with it being >>> different for pre-v7. >>> >> Yes it's better to have 'reg' with value 0 than not having it. >> Otherwise this generic of_get_cpu_node implementation would need some >> _hack_ to handle that case. >=20 > I'm not sure that having some code to handle a difference in standard > between two architectures is a hack. If anything, I'd argue encoding a > reg of 0 that corresponds to a nonexistent MPIDR value (given that's > what the reg property is defined to map to on ARM) is more of a hack ;) >=20 Agreed. But I am more confused. 1. This raises another question as how much do we follow from ePAPR standard. ePAPR marks the reg property in /cpu as required. Does that mean we must have all the properties marked as required to be present in DT ? On the contrary timebase/clock-frequency is some thing that can be found dynamically and need not be present but they are marked as required too. > I'm not averse to having a reg value of 0 for this case, but given that > there are existing devicetrees without it, requiring a reg property will > break compatibility with them. >=20 2. What exactly does backward compatibility has to cover ? This can't be considered as breaking of the binding definition. In continuation to the above argument that reg property is required, do we need to cover this as it's clearly a case of missing required property(this holds only if reg is required always). Regards, Sudeep