From mboxrd@z Thu Jan 1 00:00:00 1970 From: arnd@arndb.de (Arnd Bergmann) Date: Fri, 2 Mar 2012 14:56:47 +0000 Subject: [PATCH 4/4] ARM: kirkwood: convert orion-wdt to fdt. In-Reply-To: <20120302141541.GE11986@titan.lakedaemon.net> References: <20120302091510.GC29461@kw.sim.vm.gnt> <20120302141541.GE11986@titan.lakedaemon.net> Message-ID: <201203021456.47896.arnd@arndb.de> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Friday 02 March 2012, Jason wrote: > Grr... good catch. I originally had this in kirkwood-dreamplug.dts, > which is always 200000000. That's not the case in kirkwood.dtsi. What > I would like to do, and I haven't had time to look into it (I thought I > would tackle it later as a refinement :-( ), is a reference of some > sort, eg: > > in kirkwood.dtsi: > > / { > compatible = "marvell,kirkwood"; > tclk:clock-frequency = <200000000>; > > wdt at fed20300 { > compatible = "marvell,orion-wdt"; > reg = <0xfed20300 0x28>; > clock-frequency = &tclk; > }; > }; > > then, in kirkwood-foobar.dts > > include "kirkwood.dtsi" > > / { > model = "foobar"; > compatible = "..."; > tclk:clock-frequency = <166000000>; > }; > > but I'm not sure if that would work. That would make wdt at fed20300/clock-frequency a phandle pointing to the root property, which is not what we want here. > In any case, the simplest answer is to set clock-frequency in > kirkwood-dreamplug.dts as a root node property, and then each driver > that needs tclk, requests the clock-frequency from the root node. > Hopefully, Grant can chime in on this one. I think you can just pick a reasonable default value for wdt at fed20300/clock-frequency, and let the board override that by setting it to something else if necessary. I suppose this will also change a bit when kirkwood gets moved over to generic clk support in the future and starts using the clk binding instead of what you do now. Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [PATCH 4/4] ARM: kirkwood: convert orion-wdt to fdt. Date: Fri, 2 Mar 2012 14:56:47 +0000 Message-ID: <201203021456.47896.arnd@arndb.de> References: <20120302091510.GC29461@kw.sim.vm.gnt> <20120302141541.GE11986@titan.lakedaemon.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20120302141541.GE11986-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Sender: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org To: Jason Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org, Simon Guinot , linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org List-Id: devicetree@vger.kernel.org On Friday 02 March 2012, Jason wrote: > Grr... good catch. I originally had this in kirkwood-dreamplug.dts, > which is always 200000000. That's not the case in kirkwood.dtsi. What > I would like to do, and I haven't had time to look into it (I thought I > would tackle it later as a refinement :-( ), is a reference of some > sort, eg: > > in kirkwood.dtsi: > > / { > compatible = "marvell,kirkwood"; > tclk:clock-frequency = <200000000>; > > wdt@fed20300 { > compatible = "marvell,orion-wdt"; > reg = <0xfed20300 0x28>; > clock-frequency = &tclk; > }; > }; > > then, in kirkwood-foobar.dts > > include "kirkwood.dtsi" > > / { > model = "foobar"; > compatible = "..."; > tclk:clock-frequency = <166000000>; > }; > > but I'm not sure if that would work. That would make wdt@fed20300/clock-frequency a phandle pointing to the root property, which is not what we want here. > In any case, the simplest answer is to set clock-frequency in > kirkwood-dreamplug.dts as a root node property, and then each driver > that needs tclk, requests the clock-frequency from the root node. > Hopefully, Grant can chime in on this one. I think you can just pick a reasonable default value for wdt@fed20300/clock-frequency, and let the board override that by setting it to something else if necessary. I suppose this will also change a bit when kirkwood gets moved over to generic clk support in the future and starts using the clk binding instead of what you do now. Arnd