From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752609AbbJZVG2 (ORCPT ); Mon, 26 Oct 2015 17:06:28 -0400 Received: from down.free-electrons.com ([37.187.137.238]:52802 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751458AbbJZVG0 (ORCPT ); Mon, 26 Oct 2015 17:06:26 -0400 Date: Mon, 26 Oct 2015 22:06:23 +0100 From: Maxime Ripard To: Jean-Francois Moine Cc: Jens Kuske , devicetree@vger.kernel.org, Vishnu Patekar , Emilio =?iso-8859-1?Q?L=F3pez?= , 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: <20151026210623.GB10947@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> <20151024104749.179dab64@OPI2> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="i+pmTOJ7usc0SF/I" Content-Disposition: inline In-Reply-To: <20151024104749.179dab64@OPI2> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --i+pmTOJ7usc0SF/I Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Oct 24, 2015 at 10:47:49AM +0200, Jean-Francois Moine wrote: > On Sat, 24 Oct 2015 09:13:28 +0200 > Maxime Ripard wrote: >=20 > > Or simply > >=20 > > bus_gates { > > clocks =3D <&ahb1>, <&ahb2>; > > clock-indices =3D <5>, <6>, <8>, ... > > clock-output-names =3D "bus_ce", "bus_dma", "bus_mmc0" > > }; >=20 > I don't understand: the apb1, apb2, ahb1 and ahb2 clocks may be > programmed independently to different frequencies I don't understand why you're talking about frequencies here. > and you have to know which of them is the parent of each leaf clock. Indeed, but that's also doable here. Just not in the DT. > 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. >=20 > There could be an other solution using the output clock name to define > the parent clock: >=20 > bus_gates { > clocks =3D <&ahb1>, <&ahb2>, <&apb1>, <&apb2>; > clock-indices =3D <5>, <6>, <8>, ... > clock-output-names =3D "ahb1_ce", "ahb1_dma", "ahb1_mmc0" > }; >=20 > with the documentation: >=20 > "the clocks MUST be defined in order: ahb1, ahb2, apb1, apb2." >=20 > and the code >=20 > if (strncmp(clock_name, "ahb1", 4) =3D=3D 0) > clk_parent =3D of_clk_get_parent_name(node, 0); > else if (..) >=20 > but it seems a bit hacky. It's exactly what I suggested, without the string comparison, but relying on the ID instead. Maxime --=20 Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com --i+pmTOJ7usc0SF/I Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWLpXPAAoJEBx+YmzsjxAggBwQAKa9xZCWG2TiEL5WFQ5/MstV z7HJ//VqGWf0ERwQ8mOzFdHnbAeyitGV02fy9K4xor15UCezxkhn3BA9MB5cmnvX snoyy3AxJArbKY+mP/13jLAmbbP0TVzJ16AvaKLLTcWJYIqKEqat/BQajprcGcjP JvJ3D+mQ5eYK7EMvnJ0BFtGOCYhwkKvC3X5guX9ED0lmRFSPlfCq28ijaaV2CNYG 9UM/N6CboONSPeZmwXO7vcmS1K/glqQ9KIqTIgEDOexcIV95OehP5s+7Gw+0n4iH HXLaq3kzqGDX5JRY+Gc+yVVfDV3B/4MqHQhBXRCFOnurKI0mBRxgj0MzDqA7nZDQ YeS9mPUEkFG7sLOkh7HACAovEFYXRNbTJLORM2y5E76VLzSPM7UUOTCIEFLGFJL/ BQW6ajiYNCdgoBsav+YBgfCgBFLuk6EBo3faNYw/PKnFIntyJdeuHlHG6i5ENw9K QBNldgUpFUMMGT88q3t5dOowNjSwwZWHK11VbUJM9faLHXhooGfk/wltPNbR3eZm +VwHCWDtVaji1FxoXA3ab8QH219wZY3RgE3Vyy9ByDTiW7J1uRpVRB9sA/GiJ6zn V/KDS+N8D2C81S1RKlyzdJ9jBZIhHtXWnMHAZFOanS3KbLjfUFAV8TozeieMjSa9 5Ad/W13jPoZkojR1Fnr7 =EWuz -----END PGP SIGNATURE----- --i+pmTOJ7usc0SF/I--