Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3658994rwb; Tue, 20 Sep 2022 02:52:07 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4tmGw2S2Ms/8m1KxMDRc68qXRB8tyUJW/1SMPXu/a4GGtRi7eXUWVZ9STNDD9XWetJj9GO X-Received: by 2002:a17:907:a06:b0:77b:6eca:c089 with SMTP id bb6-20020a1709070a0600b0077b6ecac089mr15531506ejc.362.1663667527369; Tue, 20 Sep 2022 02:52:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663667527; cv=none; d=google.com; s=arc-20160816; b=rHDehsF2wDNlXgHmCbRuZ6YCouSjWOSIxLFsv7jH7MYlfx38398yiN3yT4zGfzqlMq KytcPAp2husI8hxpWEOndUR/9/5H85QOsq5+Ca+zdT1xpK9iM8GB7K7W3R9tKWwKIq8O 4H37WvaeMFXasI0JMHtRqSehy4yIWQQc1Jk4ezOSx/BCm/P0PAqwfu2lj9UJujo7gIA8 6Ci9L4+4fHOkAcL4PbdwWIssN8MgbsUKT1xdt3/5pfIy5pubR6TiXlNEnkDMGI5jgXlN cMKVM7r1WD00OyqW6PwVkmxMfXQbmtlr7+1Tg/gT89+PJAYAYqkv6WGhQqeoTk3Sk+LO z82g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=pbBbo0wS9RefiKHJAHea5Z+uUoKrx1Fu0kwL/SMeV7A=; b=jW349BEwL3TJRUi5belColkWg/fSiNISK/dCQxoprOtyROdE7gJ8WXF+5er65w2UB2 mJ/v1B/2VrftzNn4ZvvpRTZwloqruuvTmMXd//Tc6MWFiYh6u6ysu3zy2rLRgA4EoFNv 3BCyhhEjV7b/KQ8zJXaI6zuSKps8ecAJ5P8rMp7BhI7OTMlLmDWwx2OVhP+GNTh2fPPV szR8CVXrHk2UNI7R8Ji4rkA3h3VwXmNzg6Z1hnmDGZ07EamCGdBYnegyaoAoAoAO7K6m zvXITpDjEdc9H+C1fEGj07nlldZ8P0335NhRYCsbdKm1W7Y2M/4+3kPStPzZGUcyf90V rvhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dbQD2A90; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s21-20020a056402521500b004513a465ec6si1343313edd.94.2022.09.20.02.51.41; Tue, 20 Sep 2022 02:52:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dbQD2A90; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S229908AbiITJ1n (ORCPT + 99 others); Tue, 20 Sep 2022 05:27:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229812AbiITJ1l (ORCPT ); Tue, 20 Sep 2022 05:27:41 -0400 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05F536B160; Tue, 20 Sep 2022 02:27:40 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id u18so2746807lfo.8; Tue, 20 Sep 2022 02:27:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=pbBbo0wS9RefiKHJAHea5Z+uUoKrx1Fu0kwL/SMeV7A=; b=dbQD2A90p/pP5WBHjfMv0TH9z9lfoSt8o998wRryLQ//wjxln1WnlY2wsOldM0mqoV Jyv0ntKQKJKv7ASQtHmJcrpdj+VMjDHbJVe0pu0DBWoZ47b0GzUimsdDwStoWScTm+oJ 1h4KXWswd31nsQvElNONF2ft8gf9PHmAHp1+2p8utzLECIFqYsmfT5BxDrx/BkY9pGJD rmUZ02vWWN1ceRA6Y1a04QrTk03JLD5TZYga5wdsgpROTIZk2esKRtM8GHEAR6Nw2mPl mOyOVbeLXHjjs8jSjR16d6NYYXk6dNQlrj/a4mDFSy3IUUDm4G1Z9vUZMriPL/cXSXgS KHuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=pbBbo0wS9RefiKHJAHea5Z+uUoKrx1Fu0kwL/SMeV7A=; b=WCsDrfuSTa5NlEY16s/UMc60rAR81HLsLLPpDCX1XcuxeZbEPIUzHV82i8VCB0RMUL Z52lzXHOZp05k0uUAXiIuuxguFVnAB2SITqYTmaBi3RWIfTgYnodNKxtVWUKRBfFXGjr MC/KvLe71Fbwrh0/448epW7+/1LkcGOpE+CieVa7TuTcCdGnlkyddOCAmRv5fvumnNGp 2KB3Nst0HmUKSyEeOV7sEBUAvRBvQtcAI6fttUmNlXCLehyWG01Gv8GFm08s2U7LjXVa cjaZU9MLHC0QjhyyrS9OeNZBHKKoFb18La3qiX9jI9u66n/ULW5F2WeYhIgDr+SKRhBS y5JQ== X-Gm-Message-State: ACrzQf3kDy9wMTnlukDq9qeC4EUAMRcJw4xRYJciBBCxg/5Wc5VqIroN zeaPbckk/Y2o6zeNcUnxcyTB5RLAVKZ2uPkSgcI= X-Received: by 2002:a05:6512:2592:b0:49c:53de:7eb8 with SMTP id bf18-20020a056512259200b0049c53de7eb8mr7346350lfb.401.1663666058396; Tue, 20 Sep 2022 02:27:38 -0700 (PDT) MIME-Version: 1.0 References: <20220714122322.63663-1-tmaimon77@gmail.com> <20220714122322.63663-2-tmaimon77@gmail.com> <20220718211046.GA3547663-robh@kernel.org> <3981e6e8-d4bb-b13d-7aaa-7aea83ffaad9@linaro.org> <2b0e6e33-ef76-4bd4-8894-53f9a3fe68b4@linaro.org> <6f1ad082-74e4-e4e7-9304-5cdd95cc9f66@linaro.org> In-Reply-To: <6f1ad082-74e4-e4e7-9304-5cdd95cc9f66@linaro.org> From: Tomer Maimon Date: Tue, 20 Sep 2022 12:27:26 +0300 Message-ID: Subject: Re: [PATCH v2 1/2] dt-binding: pinctrl: Add NPCM8XX pinctrl and GPIO documentation To: Krzysztof Kozlowski Cc: Rob Herring , Avi Fishman , Tali Perry , Joel Stanley , Patrick Venture , Nancy Yuen , Benjamin Fair , Linus Walleij , Krzysztof Kozlowski , =?UTF-8?Q?Jonathan_Neusch=C3=A4fer?= , zhengbin13@huawei.com, OpenBMC Maillist , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List , devicetree Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 20 Sept 2022 at 11:47, Krzysztof Kozlowski wrote: > > On 20/09/2022 10:32, Tomer Maimon wrote: > > On Tue, 20 Sept 2022 at 11:21, Krzysztof Kozlowski > > wrote: > >> > >> On 20/09/2022 09:59, Tomer Maimon wrote: > >>>>>>>>> + pinctrl: pinctrl@f0800000 { > >>>>>>>>> + compatible = "nuvoton,npcm845-pinctrl"; > >>>>>>>>> + ranges = <0x0 0x0 0xf0010000 0x8000>; > >>>>>>>>> + #address-cells = <1>; > >>>>>>>>> + #size-cells = <1>; > >>>>>>>>> + nuvoton,sysgcr = <&gcr>; > >>>>>>>>> + > >>>>>>>>> + gpio0: gpio@f0010000 { > >>>>>>>> > >>>>>>>> gpio@0 > >>>>>>>> > >>>>>>>> Is this really a child block of the pinctrl? Doesn't really look like it > >>>>>>>> based on addressess. Where are the pinctrl registers? In the sysgcr? If > >>>>>>>> so, then pinctrl should be a child of it. But that doesn't really work > >>>>>>>> too well with gpio child nodes... > >>>>>>> the pin controller mux is handled by sysgcr this is why the sysgcr in > >>>>>>> the mother node, > >>>>>>> and the pin configuration are handled by the GPIO registers. each > >>>>>>> GPIO bank (child) contains 32 GPIO. > >>>>>>> this is why the GPIO is the child node. > >>>>>> > >>>>>> Then maybe pinctrl should be the sysgcr and expose regmap for other devices? > >>>>> The pin controller using the sysgcr to handle the pinmux, this is why > >>>>> the sysgcr is in the mother node, is it problematic? > >>>> > >>>> You said pin-controller mux registers are in sysgcr, so it should not be > >>>> used via syscon. > >>> Sorry but maybe I missed something. > >>> the sysgcr is used for miscellaneous features and not only for the pin > >>> controller mux, this is why it used syscon and defined in the dtsi: > >>> gcr: system-controller@f0800000 { > >>> compatible = "nuvoton,npcm845-gcr", "syscon"; > >>> reg = <0x0 0xf0800000 0x0 0x1000>; > >>> }; > >>>> > >>>> Please provide address map description to convince us that this is > >>>> correct HW representation. > >>> GCR (sysgcr) registers 0xf0800000-0xf0801000 - used for miscellaneous > >>> features, not only pin mux. > >>> GPIO0 0xf0010000-0xf0011000 > >>> GPIO1 0xf0011000-0xf0012000 > >>> ... > >>> GPIO7 0xf0017000-0xf0018000 > >>>> > >> > >> Then why your pinctrl is in sysgcr IO range? (pinctrl@f0800000) > > you suggest using pinctrl@0 or pinctrl@f0010000 and not > > pinctrl@f0800000 because 0xf0800000 is the GCR address that serve > > miscellaneous features and not only pinmux controller ? > > If you have a map like you pasted, then DTS like this: > > syscon@f0800000 {} > pinctrl@f0800000 { > gpio@f0010000 {} > } > > Is quite weird, don't you think? You have two devices on the same unit > address which is not allowed. You have child of pinctrl with entirely O.K. > different unit address, so how is it its child? The pinctrl node name will modify the pinctrl@f0010000 the same as the range property and the start of the child registers,is it fine? > Best regards, > Krzysztof Best regards, Tomer