Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp422279imm; Thu, 31 May 2018 03:02:09 -0700 (PDT) X-Google-Smtp-Source: ADUXVKI56pWkurHCSmviLEBLa15byergQHHyIiuaBb9pBAUXLQi7a4btEuaiX4jfNqGzzUhHCyBo X-Received: by 2002:a17:902:1029:: with SMTP id b38-v6mr6299073pla.277.1527760929123; Thu, 31 May 2018 03:02:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527760929; cv=none; d=google.com; s=arc-20160816; b=eTg46M4uu2UVOcozr5gP6mNTNqc80un3s6RAxo54r1k++IyGCpwKcbhdjggWh4LSOW qMYkTwvQiW99yWkZrdn2WkwueDpBtksH3e0vBiuxjQtrHbKiG/iPSJqmCPuma/rnE1cB a97r4qsN4IAMF3G6GG+zxxzh3yKce4xZ0xtbAMQRc2vVeMhmeyLVx7qDKdmTX8CMBjZL TNOhACUy/eVYjE5vG96gupudZfHULLoh84IFfUaPCnvbmUD9F6JHZN7RGXuCejkgPi5z 7ilN9HYxIJ19vl35ACtQamUhdjgpzMgKsqYovQfOMg6Iu2NUl7kQLJLj0X8AUJLpu4y4 Unmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature:arc-authentication-results; bh=d3lTwdrg6WWY7gPAJwqTjI/79qviSOxgZa5h5e0Euhw=; b=R4GWeA5qYy1WqGXyj1+eXmlpo6JvmJ4dWWUwFJFZYtgbJJROnKv1Cn1u6pLBk4G4+K jPsXZw9bF4dmbfhpa7pbcuNxN23oIFBNx/+7ZL5T682N4b9Bl4K00B46bfnX1U2l/9J2 tt5ojIcZ6xRBSZzjbOecT6CjNznORNIeJaMbti0Jx29zxtH1BObRNnx3YnF6kSy0SBzM 4HYstlyYtCAOjEIVm4esWMI8TuEPGtbSelDe38YWWKMMDz3g0z86HP+eEaVeuyCNSzb8 03cJYhx+Sm2g/baNSLtzFn7d6OTC8dMZuCoIUJiwf9bzPVdxrHa+T3NE7uVbx1T17ols 3j/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SelqeO3f; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j123-v6si37090009pfg.156.2018.05.31.03.01.55; Thu, 31 May 2018 03:02:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SelqeO3f; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754410AbeEaKB1 (ORCPT + 99 others); Thu, 31 May 2018 06:01:27 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:36061 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754284AbeEaKBV (ORCPT ); Thu, 31 May 2018 06:01:21 -0400 Received: by mail-pf0-f194.google.com with SMTP id w129-v6so10546017pfd.3; Thu, 31 May 2018 03:01:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=d3lTwdrg6WWY7gPAJwqTjI/79qviSOxgZa5h5e0Euhw=; b=SelqeO3fwiAbsqiad3mJteY3cp/K9nniLEz5cgd5dj+lLUpZZ5pH1ECHyKOD+wBO/l Lb2K3hFWY1kxauuoQv3qtzgJddEHMH5qZ5U0Y7AWtDo5ledRcJ5kLP6ewYisYOu/pzkv BbfZ5hS4hDZusKxkx7q3V4o2fqlaOdcV4jfsBE9CX85B+tYQClgOp5jZoskQf3jlkC+b r4cpMimCg3m/r1y+WsUPgtz584golIgmU0VmwCbybiIjdpr5Mphsd9gIgELRUAH6zCpA GnmE1i+c4Dyp2LxeEDfZ3EiF/ZS0Ipirz20OeV98CzRZPbYP8oc0K8vCzGUqJ7lAt9C+ bcAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=d3lTwdrg6WWY7gPAJwqTjI/79qviSOxgZa5h5e0Euhw=; b=GEnZ4S4/7XfRsTbaS+gBb5X9lSAKQzlrdProIdPeQ7OjONrGfaLqvsSUjP7w7tJTnA SYlu67FCzz/E40V1oEgsUmoV09hEI2EjXVQzfDEZmaa0SIXyhPwQObINaEsFOJqcj8nv 98iqtGV/8hM4qsEb2ThSgq+qqXLb0Z0RbfKR4CYyQUyrEiXyMzo/Tdc3E6j4X/mHbNZk XFVbRVd2gbdNIB8OyvitmJ+lGpR+lbhY/uRlC5dZvJeGGG/lwtMEMFRvEtg50D6nAIsp /YBuONGviTFWOTOhiIC8TgGXuw+vcaenhpy6RBhZqeDabwSWOSGAEtUnEC7lnUVXcDAO a9bw== X-Gm-Message-State: ALKqPwe9yG6Or9qPyxdec/Bi6oVSv4QR+GuFJ5HtBMVQAl2SMFQWJsx7 KZrlnOxlFt4DY7dUOy1PCsqLi7DeQiELQOXPl78= X-Received: by 2002:a63:7b51:: with SMTP id k17-v6mr4982284pgn.55.1527760880494; Thu, 31 May 2018 03:01:20 -0700 (PDT) MIME-Version: 1.0 References: <1527154169-32380-1-git-send-email-michel.pollet@bp.renesas.com> <1527154169-32380-2-git-send-email-michel.pollet@bp.renesas.com> In-Reply-To: From: M P Date: Thu, 31 May 2018 11:01:09 +0100 Message-ID: Subject: Re: [PATCH v7 1/5] dt-bindings: Add the r9a06g032-sysctrl.h file To: Geert Uytterhoeven Cc: michel.pollet@bp.renesas.com, linux-renesas-soc@vger.kernel.org, Simon Horman , Phil Edworthy , buserror+upstream@gmail.com, Michael Turquette , sboyd@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, geert+renesas@glider.be, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Geert, On Thu, 31 May 2018 at 10:32, Geert Uytterhoeven wro= te: > > Hi Michel, > > On Thu, May 31, 2018 at 11:11 AM, M P wrote: > > On Fri, 25 May 2018 at 11:31, Geert Uytterhoeven > > wrote: > >> On Thu, May 24, 2018 at 11:28 AM, Michel Pollet > >> wrote: > >> > This adds the constants necessary to use the renesas,r9a06g032-sysct= rl > > node. > > >> > @@ -0,0 +1,187 @@ > >> > +/* SPDX-License-Identifier: GPL-2.0 */ > >> > +/* > >> > + * R9A06G032 sysctrl IDs > >> > + * > >> > + * Copyright (C) 2018 Renesas Electronics Europe Limited > >> > + * > >> > + * Michel Pollet , > >> > + * Derived from zx-reboot.c > >> > + */ > >> > + > >> > +#ifndef __DT_BINDINGS_R9A06G032_SYSCTRL_H__ > >> > +#define __DT_BINDINGS_R9A06G032_SYSCTRL_H__ > >> > + > >> > +#define R9A06G032_CLKOUT 0 > >> > +#define R9A06G032_CLK_PLL_USB 1 > >> > +#define R9A06G032_CLK_48 1 /* AKA CLK_PLL_USB= */ > >> > +#define R9A06G032_CLKOUT_D10 2 > >> > +#define R9A06G032_CLKOUT_D16 3 > >> > +#define R9A06G032_MSEBIS_CLK 3 /* AKA CLKOUT_D16 = */ > >> > +#define R9A06G032_MSEBIM_CLK 3 /* AKA CLKOUT_D16 = */ > >> > +#define R9A06G032_CLKOUT_D160 4 > >> > +#define R9A06G032_CLKOUT_D1OR2 5 > >> > +#define R9A06G032_CLK_DDRPHY_PLLCLK 5 /* AKA CLKOUT_D1OR= 2 */ > > > >> [...] > > > >> I have 3 comments: > > > >> 1. I had expected this list to match (both name- and order-wise) > > Appendix > >> C ("Clock Tree Structure") in the RZ/N1[DSL] User=E2=80=99s Manu= al: System > >> Introduction, Multiplexing, Electrical and Mechanical Informatio= n. > >> That would make it easier to review. > > > > Well, that document was made a *long* time after the internal documenta= tion > > we used to generate the clock lists. There are a few things we had to d= o: > > > > * Renumber peripherals. We decided a long time ago that u-boot and linu= x > > would stick to zero based peripherals, and not one based numbers. It's = next > > to impossible to keep mixing number based across software base, so we u= se > > UART0 while the hardware manual mentions UART1 -- It *is* documented > > extensively with out SDK, and makes life using linux a lot easier. It's > > across all our SDK, u-boot, webapps readmes, howtos etc. > > > > * Rename some peripherals. Plenty of peripherals names made little sens= e > > and had zero consistency, in fact, many names were different depending = on > > the place they were used! -- "flashnand"+"nand_flash"+"FNAND" etc, > > "QUADSPI"+"QSPI" etc etc so we also re-normalized the names to match li= nux > > conventions. > > > > * Other internal reasons I can't document here > > > > Also, the value here are made up anyway -- so I've decided to sort them= to > > make sure any clock that has a parent is numbered *after* the parent... > > Well, all of that combines makes it very hard for us to review the list. I understand -- the previous format was a lot more readable, here I had to work to make the table as small as I could, and quite a few bits of readabi= lity were lost in the process. It's already a huge file. I'm not sure if that would help, but here is the link to the old table format I used https://github.com/renesas-rz/rzn1_linux/blob/rzn1-stable/drivers/clk/rzn1/= rzn1-clkctrl-tables.h I had to throw that away to make up the new composite table that now contai= ns what was in the device tree file before. However the names are the same. Perhaps I could change how I encode the register/bit pairs to use 8+8 bits = to make the hex constants more readable? > > >> 2. These definitions seems to be a mix of: > >> 1. Internal core clocks, > >> 2. Other core clocks, > >> 3. Module clocks. > > > >> The internal clocks do not need to be referenced from DT, so I w= ould > >> not make them part of the DT bindings. > > > > Why? I'm told that "Bindings aren't for linux" -- why can't I imagine > > 'something' needing them? Why would I decide NOT to include them, > > as they are there? I 'factored' a few of them to the same number when > > Just general safety w.r.t. unchangeable DT definitions: anything that is > not listed here cannot be declared wrong later. Well, I need these #define *somewhere* as I use them in my driver. So what do you want me to do? + Remove the header, move the constants into the driver? + Use hard coded numbers in the DT and remove the header entirely? + Duplicate the header, keep the full one with the driver, and only list the CA7+UART0 one in the dt-binding and duplicate the ones I need as I go along? > > > applicable. > > You're 100% sure they're the same? Yes, the script logic hasn't changed in 2 years, and we've been using that hierarchy extensively since. Basically the logic is that if a clock doesn't have a gate and isn't a divi= sor of some sort, it's factored with it's parent clock... it used to be done with a DT alias of the same name. > > > This is all done automatically BTW -- a script takes the original clock= ing > > spreadsheet, and converts it into a table, correcting 'human input' as = it > > goes along. > > So the internal spreadsheet doesn't match the public documentation neithe= r? Nope, as usual, people who wrote the documentation went their own way at some point, and didn't backport any changes they made. > Gr{oetje,eeting}s, > > Geert Cheers, Michel