Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp4074010rwb; Tue, 20 Sep 2022 08:28:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4QX1b4y/+k4qGAM2G263MrHh9S8332nBlxoCi6Hf/ZwD/CqybY3sE/BqDGwg7tzhpkgGke X-Received: by 2002:a17:90a:203:b0:200:8df6:84c with SMTP id c3-20020a17090a020300b002008df6084cmr4441661pjc.24.1663687680911; Tue, 20 Sep 2022 08:28:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663687680; cv=none; d=google.com; s=arc-20160816; b=jimU62Gb9P2KzwA9Ru741j5bzPedhNtGOiuQN23evApr0I+QU1JTD4pUKWKuv2nGgC 1yXdf9q9ZcUdrCldBSVPoZS4RxtOW0wVzyTcdMhU7z1VQgRoD62bGGh5mHWl+8Xhzx+D rCb5mK2vK0eJFsaDNS+r6KvAHENHctccomt/kXjI3oT0pZmhNF8SaGCd9xXdjKj3FHvc 2jDlm6RH+3VzpypoUA0vpNQ6GgZl5VlrzevcMCcz5pSf71llG+VPdeqU8mNLCMcM2v0b db+V9njyT4oLAgq2ZjVS4Oeov6xY879/tQfU7WDSoMDsDVYesIMRuwviYU6xp/Xd+bUu KdeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=LBJXkuxhmse5P1lyWiiuBqBUGrfjJdoy9vn87fbJbbE=; b=C2+INFaWi7fBKRo+zN+ZZjvDWWREJ+M7GpHAtD0kmH5Tdj4P/FGxHD39HlmWqigf38 wXzkI8wzUhSt4bbhlO4J0srb4RXKoS75EpDrZBr1B0r45+qRVg9wIlbqa++KDYB+OTgM hDiRtVL5vUxsOf6QU3KIjExAPNrjvr/D9oeImDmuB6u9QGD/reZ2XdQu1ww0jynW2+fq Skpp2IcxyedHi2+dd8XdfM5VafQiiWy95JmiHcSTvaTjY3opIG4kaWQlQ7c8tTVM305R G3GEh4aLznlAv+U0waxdgo2D4M0TStX82Jy7BZE+kgqX0FGLTw4XyysYQVeZ0MEdBqzu Gk+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Z8+4YFNv; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h15-20020a170902f70f00b00176a6c988c6si55962plo.218.2022.09.20.08.27.44; Tue, 20 Sep 2022 08:28:00 -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=@linaro.org header.s=google header.b=Z8+4YFNv; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231367AbiITPRe (ORCPT + 99 others); Tue, 20 Sep 2022 11:17:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230467AbiITPRL (ORCPT ); Tue, 20 Sep 2022 11:17:11 -0400 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B111647DB for ; Tue, 20 Sep 2022 08:16:54 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id s6so4332317lfo.7 for ; Tue, 20 Sep 2022 08:16:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date; bh=LBJXkuxhmse5P1lyWiiuBqBUGrfjJdoy9vn87fbJbbE=; b=Z8+4YFNvQpl0pK3twnvrjV0GrnqkQyNjD4XoPyfhgQ0kMzL3xC1YdrNlobjz4u0q38 1ZHc3WI5zWPwRyPAiT0x3qVF0tfnsZTAPl0E+d1OgZqXQ1sQSBsb8MltMigMtSqt9p3l QsqpQeQTJ3C+7vcxP9TNIxoorYesosdGLp4anmGPy9K+h4Jp71gIZk7o/nlBoZq0xciT O8AbvGY+uai3Re7ZDT6d2D1Y8u1v3ARaMKpkcmjLFIXufIadSyB2BZmH3v6iok7QpoNd H9NrPUwGlS84FnOGUy9iQiQ1++ZeS7x8yMwqeF+qNNI49iP1WpEohenKwgDWIb8kbr0g bJZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=LBJXkuxhmse5P1lyWiiuBqBUGrfjJdoy9vn87fbJbbE=; b=1uqUUO16lotTHwQMxY2rr0zwWbiJwFozyU5NwUYMJqoJTuCrX3AQdZKo/4t5nuE7eI EwJRZd4BKP4f53kf/lFGX+o7yMpbPLQzn2CKEgonhVbMqM5AB6/3Kum2UsjkHrpkCY9W tlaCtHUN858ACyppMO0dTD1y1fb6ngPx4WAMMQb77xeAXYPymjZEOcA295DYdJURGkRU QP5jxD3n0NqEauMIcRr8UG+aDANj1B21FCtiC6a8u35I9OXI5Wn7XZM5xZ86BT9kmtpP nd5bsBIfiBOTGF22vv1aqzuOg1X1O5B4sqP/U08xN1cYc3uFaJf6o+SlwNaFjh74g5LA MW9g== X-Gm-Message-State: ACrzQf12uB7OMQ2iJjZYqIh2NYHz8uv/w9KyzDeCTG6BY6kaA/gg6YPT aA5THW8nm0JDM2Ym5XEKKQQW0w== X-Received: by 2002:a05:6512:32c1:b0:49f:5c95:5146 with SMTP id f1-20020a05651232c100b0049f5c955146mr6050239lfg.469.1663687012826; Tue, 20 Sep 2022 08:16:52 -0700 (PDT) Received: from [192.168.0.21] (78-11-189-27.static.ip.netia.com.pl. [78.11.189.27]) by smtp.gmail.com with ESMTPSA id du8-20020a056512298800b00492f0f66956sm351627lfb.284.2022.09.20.08.16.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 20 Sep 2022 08:16:52 -0700 (PDT) Message-ID: Date: Tue, 20 Sep 2022 17:16:51 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 Subject: Re: [PATCH v2 1/2] dt-binding: pinctrl: Add NPCM8XX pinctrl and GPIO documentation Content-Language: en-US To: Tomer Maimon 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 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> From: Krzysztof Kozlowski In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 20/09/2022 11:27, Tomer Maimon wrote: > 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? We are all busy, so I don't have that much bandwidth to review each of your many solutions and instead poking me with every possible solution, I would prefer if you think a bit how this all should work and look. I don't know if it is fine. Why you should have two devices like this: pinctrl@f0010000 { gpio@f0010000 {} } ??? Instead of one device? Answer such questions to yourself before asking me. Please come with reasonable DTS describing the hardware. Best regards, Krzysztof