From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751440AbbJXIsU (ORCPT ); Sat, 24 Oct 2015 04:48:20 -0400 Received: from smtp3-g21.free.fr ([212.27.42.3]:32381 "EHLO smtp3-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750846AbbJXIsQ convert rfc822-to-8bit (ORCPT ); Sat, 24 Oct 2015 04:48:16 -0400 Date: Sat, 24 Oct 2015 10:47:49 +0200 From: Jean-Francois Moine To: Maxime Ripard Cc: Jens Kuske , devicetree@vger.kernel.org, Vishnu Patekar , Emilio =?UTF-8?B?TMOzcGV6?= , Michael Turquette , linux-sunxi@googlegroups.com, linux-kernel@vger.kernel.org, Hans de Goede , Chen-Yu Tsai , Rob Herring , Philipp Zabel , Linus Walleij , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 5/6] ARM: dts: sunxi: Add Allwinner H3 DTSI Message-ID: <20151024104749.179dab64@OPI2> In-Reply-To: <20151024071328.GQ10947@lukather> References: <1445444428-4652-1-git-send-email-jenskuske@gmail.com> <1445444428-4652-2-git-send-email-jenskuske@gmail.com> <20151023181406.GK10947@lukather> <20151023212013.50bcbe4a@OPI2> <20151024071328.GQ10947@lukather> X-Mailer: Claws Mail 3.13.0 (GTK+ 2.24.28; arm-unknown-linux-gnueabihf) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 24 Oct 2015 09:13:28 +0200 Maxime Ripard wrote: > Or simply > > bus_gates { > clocks = <&ahb1>, <&ahb2>; > clock-indices = <5>, <6>, <8>, ... > clock-output-names = "bus_ce", "bus_dma", "bus_mmc0" > }; I don't understand: the apb1, apb2, ahb1 and ahb2 clocks may be programmed independently to different frequencies and you have to know which of them is the parent of each leaf clock. So, either you hard-code the parents as Jens did in a first proposal, or you define the full list of parents in the DT as in the last proposal, or you use a container per parent in the DT as I proposed. There could be an other solution using the output clock name to define the parent clock: bus_gates { clocks = <&ahb1>, <&ahb2>, <&apb1>, <&apb2>; clock-indices = <5>, <6>, <8>, ... clock-output-names = "ahb1_ce", "ahb1_dma", "ahb1_mmc0" }; with the documentation: "the clocks MUST be defined in order: ahb1, ahb2, apb1, apb2." and the code if (strncmp(clock_name, "ahb1", 4) == 0) clk_parent = of_clk_get_parent_name(node, 0); else if (..) but it seems a bit hacky. -- Ken ar c'hentaƱ | ** Breizh ha Linux atav! ** Jef | http://moinejf.free.fr/