Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2135924pxv; Fri, 2 Jul 2021 23:47:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy21VGPoobrB+nIbJKABmA9lpT/TKinqiLyKhfgvzQfNX7OPcqwRZrivMnvrLu066sacNtf X-Received: by 2002:a17:906:7314:: with SMTP id di20mr3639458ejc.283.1625294840437; Fri, 02 Jul 2021 23:47:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625294840; cv=none; d=google.com; s=arc-20160816; b=KeFQnAREHawRH3M8I088KeGr37B/EIghJlRM21aVNyS4Z0PKf8Njmhu72JC2AYhCUd 6NYyqzpGt3m7LI39VROXn0oH/zjJFQCk2Y/dqC7wqdMl0SsZmkOXQCnQGgt8Ja7DuzMK 8o50m7T6iR+W8ugo7bKxiq0ij7vmWq3CqUK04AMwfE1+aTqbrdS5y+FcT29xwyB/Hk5Q 4rJyRJTrLd/fwqsScmay1AFwClt4UON0VWMMSO9EnImXQvjdsMyyAL8ScuEFA9HnKd5B WWOMnR3uaN446XZP6yIFn9sL7bmIxncHDbGUo7RXzGXnHHk0dN16dsFXmVbhPUxkd12V d92w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=In75uxFR1f0iXFnBnQMn4UIW5uQb27tGmOe3rOogkRU=; b=l5tdw5QyUdOzcwC6iZnWZ7UV/TpDoqttNHntTYjRK7SjKw0GdW+W8ZtVWk/YZcB+ck 9nhyRDg8N9O3sq8j8JfMfVLwRGSv+hhLIi4vXIxu7z65TaLn9vActXtebqoR1aqEzPmQ XJ/5HSRGSZIcRyzm9fwzSeOfbWK4MAXbB33Fxnth60DIy5mNj1B3pxOib3U511ug3we8 +sPMsw1OJOZNDTldAsTkGjd9+Nn8sPh6UIyriNCpqqjBOTB0T9gvH2JD4SIqYBrAITHp AT9JMSlwnUwkBjrQdhXOemd2Oy7eNNnzaEQj7lRxK2amntWw9Gr0nMgNH0V9bJx/BbJ5 NZqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@beagleboard-org.20150623.gappssmtp.com header.s=20150623 header.b=YNnAZq2A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t12si6314971edc.333.2021.07.02.23.46.57; Fri, 02 Jul 2021 23:47:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@beagleboard-org.20150623.gappssmtp.com header.s=20150623 header.b=YNnAZq2A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229807AbhGCGsi (ORCPT + 99 others); Sat, 3 Jul 2021 02:48:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229528AbhGCGsh (ORCPT ); Sat, 3 Jul 2021 02:48:37 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F515C061762 for ; Fri, 2 Jul 2021 23:46:04 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id b14-20020a17090a7aceb029017261c7d206so4695672pjl.5 for ; Fri, 02 Jul 2021 23:46:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beagleboard-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=In75uxFR1f0iXFnBnQMn4UIW5uQb27tGmOe3rOogkRU=; b=YNnAZq2AKyT9OOLR+3d2bWD1lC1lF4flke9oKN3/785NvB132pNtaZ30aSz0StJoXp kgAiNDKb4EohrIW0HzJifWeHOx58nE8OH0Z+81AT3WUO/S9jYP0fctUIECHJ2dYodCJ5 DIu5FJiHIqgcnRwWufYGzxUsrSCQQU+uX5NxsXbiX5kgVBEeQyvs/2pWdvKxmM3vZILS 3TXTrTJ2t1jqQUNDLReT8omjNu36VmGmISofUAqFVInOfxrf/1eFao6WXZS82VimFIhn XzDp84Sm91ytaXTj7x7j+ejlUpAIqjdlB+BszbTjR8PwmkQMqTcH9TPXlEnoKJ4ilark lL7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=In75uxFR1f0iXFnBnQMn4UIW5uQb27tGmOe3rOogkRU=; b=F742uWFSFuyoxAhZufaD9m89Whrq1ymb0YL2Q69Fr3c6SDfi8K9m7B/2qm8W0kZrSv W8DEO7D2JvNBb3VcN8TZ4+8K0cNX/+TBzIiTu/Jsq9UzkHbd1shmFjhl/YbpNKUz9jNt I1zvPzG4ykCC7lMJdjFbXERLnyUb2Nzo8nR5Xsfj+HYYGdxSfWws+QnFFBoVpe2cjvYP br3vv0+cEMHjkFQabkJMjUNTvxt7p5OtbXDTJUQY0534J2zwUSsWvsxsAh/hDi3scva0 P5cpGvYQOfue2OCbDc5D4/g7GV82ONFP6m0XUJSy8420IHRNk0HeModCDfY4/FScyguv J/wQ== X-Gm-Message-State: AOAM533IldguXeeVsehTU4McgdN/T1jmmMAhOYO15g1mzNOV+w2zKnrE GkS6WyM9Af23+tinxYgEKmZZpw== X-Received: by 2002:a17:90a:c484:: with SMTP id j4mr363259pjt.218.1625294763472; Fri, 02 Jul 2021 23:46:03 -0700 (PDT) Received: from x1 ([2601:1c0:4701:ae70:f236:257f:88f9:445e]) by smtp.gmail.com with ESMTPSA id s8sm2733556pfg.190.2021.07.02.23.46.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jul 2021 23:46:02 -0700 (PDT) Date: Fri, 2 Jul 2021 23:46:00 -0700 From: Drew Fustini To: Geert Uytterhoeven Cc: Rob Herring , Linus Walleij , Bartosz Golaszewski , Paul Walmsley , Palmer Dabbelt , Michael Zhu , Fu Wei , Linux Kernel Mailing List , "open list:GPIO SUBSYSTEM" , linux-riscv , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Huan Feng Subject: Re: [RFC PATH 1/2] dt-bindings: gpio: add starfive,jh7100-gpio bindings Message-ID: <20210703064600.GA1050194@x1> References: <20210701002037.912625-1-drew@beagleboard.org> <20210701002037.912625-2-drew@beagleboard.org> <20210702205622.GA1035183@x1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 02, 2021 at 11:03:56PM +0200, Geert Uytterhoeven wrote: > Hi Drew, > > On Fri, Jul 2, 2021 at 10:56 PM Drew Fustini wrote: > > On Thu, Jul 01, 2021 at 10:34:56AM +0200, Geert Uytterhoeven wrote: > > > On Thu, Jul 1, 2021 at 2:22 AM Drew Fustini wrote: > > > > Add bindings for the GPIO controller in the StarFive JH7100 SoC [1]. > > > > > > > > [1] https://github.com/starfive-tech/beaglev_doc > > > > > > > > Signed-off-by: Drew Fustini > > > > Signed-off-by: Huan Feng > > > > > > Thanks for your patch! > > > > > > > --- /dev/null > > > > +++ b/Documentation/devicetree/bindings/gpio/starfive,jh7100-gpio.yaml > > > > @@ -0,0 +1,60 @@ > > > > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > > > > +%YAML 1.2 > > > > +--- > > > > +$id: http://devicetree.org/schemas/gpio/starfive,jh7100-gpio.yaml# > > > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > > > + > > > > +title: StarFive JH7100 GPIO controller > > > > + > > > > +maintainers: > > > > + - Huan Feng > > > > + - Drew Fustini > > > > + > > > > +properties: > > > > + compatible: > > > > + items: > > > > + - const: starfive,jh7100-gpio > > > > + > > > > + reg: > > > > + maxItems: 1 > > > > + > > > > + interrupts: > > > > + description: > > > > + Interrupt mapping, one per GPIO. Maximum 32 GPIOs. > > > > + minItems: 1 > > > > + maxItems: 32 > > > > > > What about clocks and resets? > > > > Thank you for your feedback, Geert. > > > > GPIO controller uses clk_apb1_bus under dom0_sys. I believe the device > > tree node would use something like this: > > > > clocks = <&clkgen JH7100_CLK_APB1>; > > > > I see the sifive-gpio.yaml has: > > > > clocks: > > maxItems: 1 > > > > Would that be the correct way to do it for the starfive gpio yaml? > > Yep. > > > The reset for GPIO controller is presetn under dom_sys. Do you think > > know you know an example that has reset in the YAML? Is there some code > > that would actually make use of that information? > > > > > > > > > + > > > > + gpio-controller: true > > > > + > > > > + "#gpio-cells": > > > > + const: 2 > > > > + > > > > + interrupt-controller: true > > > > + > > > > + "#interrupt-cells": > > > > + const: 2 > > > > + > > > > +required: > > > > + - compatible > > > > + - reg > > > > + - interrupts > > > > + - interrupt-controller > > > > + - "#interrupt-cells" > > > > + - "#gpio-cells" > > > > + - gpio-controller > > > > Do you think I should add 'clocks' to 'required:'? > > I'm still having issues with i2c if the GPIO block lists a clock, due to > fw_devlink dependencies. > > > > > + > > > > +additionalProperties: false > > > > + > > > > +examples: > > > > + - | > > > > + gpio@11910000 { > > > > + compatible = "starfive,jh7100-gpio"; > > > > + reg = <0x11910000 0x10000>; > > > > + gpio-controller; > > > > + #gpio-cells = <2>; > > > > + interrupt-controller; > > > > + #interrupt-cells = <2>; > > > > + interrupts = <32>; > > > > I would add: > > > > clocks = <&clkgen JH7100_CLK_APB1>; > > > > But I am not sure how reset would work? > > That should become "resets = <&rstgen JH7100_RSTN_GPIO_APB>", > but we don't have the reset controller in Linux yet (we do in barebox). Do you think I should add reset item like this? resets: maxItems: 1 I suppose this is supposed to describe the hardware and it shouldn't matter whether or not Linux uses the property, right? Thank you, Drew