From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161243AbbKEG5q (ORCPT ); Thu, 5 Nov 2015 01:57:46 -0500 Received: from smtpfb1-g21.free.fr ([212.27.42.9]:43805 "EHLO smtpfb1-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1034501AbbKEGrn convert rfc822-to-8bit (ORCPT ); Thu, 5 Nov 2015 01:47:43 -0500 Date: Thu, 5 Nov 2015 07:47:30 +0100 From: Jean-Francois Moine To: Maxime Ripard Cc: Arnd Bergmann , 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 , Jens Kuske , Philipp Zabel , Linus Walleij , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v4 4/6] reset: sunxi: Add Allwinner H3 bus resets Message-Id: <20151105074730.fd6a9d57a1f2c7933478c680@free.fr> In-Reply-To: <20151104163014.GB6114@lukather> References: <1445964626-6484-1-git-send-email-jenskuske@gmail.com> <1445964626-6484-5-git-send-email-jenskuske@gmail.com> <13919923.o3Dj9msmoa@wuerfel> <20151104163014.GB6114@lukather> X-Mailer: Sylpheed 3.4.3 (GTK+ 2.24.28; armv7l-unknown-linux-gnueabihf) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 4 Nov 2015 08:30:14 -0800 Maxime Ripard wrote: > Hi Arnd, > > On Fri, Oct 30, 2015 at 09:27:03AM +0100, Arnd Bergmann wrote: > > On Tuesday 27 October 2015 17:50:24 Jens Kuske wrote: > > > > > > +static int sun8i_h3_bus_reset_xlate(struct reset_controller_dev *rcdev, > > > + const struct of_phandle_args *reset_spec) > > > +{ > > > + unsigned int index = reset_spec->args[0]; > > > + > > > + if (index < 96) > > > + return index; > > > + else if (index < 128) > > > + return index + 32; > > > + else if (index < 160) > > > + return index + 64; > > > + else > > > + return -EINVAL; > > > +} > > > + > > > > > > > This looks like you are doing something wrong and should either > > put the actual number into DT, > > This is the actual number, except that there's some useless registers > in between. Allwinner documents it like that: > > 0x0 Reset 0 > 0x4 Reset 1 > 0xc Reset 2 > > So we have to adjust the offset to account with the blank register in > between (0x8). > > > or use a two-cell representation, with the first cell indicating the > > block (0, 1 or 2), and the second cell the index. > > And the missing register is not a block either. > > That would also imply either changing the bindings of that driver (and > all the current DTS that are using it), or introducing a whole new > driver just to deal with some extraordinary offset calculation. In the H3, the holes are not used, but what would occur if these holes would be used for some other purpose in future SoCs? Double mapping? -- Ken ar c'hentań | ** Breizh ha Linux atav! ** Jef | http://moinejf.free.fr/