From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 32815ECAAD5 for ; Tue, 6 Sep 2022 16:22:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6DqCLZwQy5oQPe++BZ3a67qyZB4cTeUt51uI5qawNgE=; b=tihqokXicEoXHe ZiupidHJuU06idBJpGLJDNqfflpgcQ3Zo/Ky7sR284skJ1/gYskujXxTlN1T3/Dd0yDAadiW+71Uv nHgzbnnmAARb7qSWlO0aBF1SvI3pn2P++DmIkpEFgTmZqRV8F7Clcu9BkUiI4LKIsePH3zTOch81T JZJmH+9UDYIx4HUYoBtbjFLTjBsBofO6CKFhBUZvxJQO7f9fOUqQtxQxqf2qvLYVNZOYkqPEv68bA A4pA88HV04sRO/IgoOoRgD5mtfeDnjA1Zmhi1unIaGNr86VbouM3UgMJrT9ycqZ8bSTQPlp/BvqiI LaONDaC0TRmy7ks1ZKzg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVbK1-00FKrB-DT; Tue, 06 Sep 2022 16:21:09 +0000 Received: from mail-oa1-f50.google.com ([209.85.160.50]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVavc-00F5I4-P1 for linux-arm-kernel@lists.infradead.org; Tue, 06 Sep 2022 15:55:58 +0000 Received: by mail-oa1-f50.google.com with SMTP id 586e51a60fabf-11eab59db71so29138984fac.11 for ; Tue, 06 Sep 2022 08:55:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=2Fy4H2MBwjVVVrFLZsY4ti38bj+tXW/iTfIXfNTv+3g=; b=QLrl17DXo/3DoKYKBPMEX4+8t0NH3Y0KfkOonRNuFHLGbu80qwGl/1T1ZzWsnaulXm 5RKxu7vGT2t/aZSdemKC4Cio5ZlNdQffqfrMjbYD0+KhN3ioOO4UZa2Xk+N7YAM+7mhP qCRtYdUFntyBTBvusuz6CY7dBZ0BhBMG+tcX7EKMJSYkiozu+pgCaRLH8k+SZOfy3V+c SCdGEP2WaW0SBLh0jVPA3X/3gfXVHCcEHq7moI7qiojPGQ+41TYbfO9CdEdSI8cUdtN7 4LpawfGGUOpsFRuYv4XFFnqULPTNQ0+2jlnj3kng8xv0tTTPx0aZc/GlavNykWDimliH 00Iw== X-Gm-Message-State: ACgBeo2KbHjdYV0YPXVuvAhWctoJIZnYX8jvjBP2q3HPzowhX8qB2+g4 LHKZZqHqiGK0RJELMYPzQQ== X-Google-Smtp-Source: AA6agR6qziKVqiJIw7PdgqemkFs/WLC9+0abUzjCVXa8LjJdoJxpx0czecK1Nr0cIDU7nnpcz2j3+w== X-Received: by 2002:a05:6870:6195:b0:127:3394:9c with SMTP id a21-20020a056870619500b001273394009cmr6323369oah.218.1662479754538; Tue, 06 Sep 2022 08:55:54 -0700 (PDT) Received: from robh.at.kernel.org (66-90-144-107.dyn.grandenetworks.net. [66.90.144.107]) by smtp.gmail.com with ESMTPSA id b20-20020a05687061d400b001275f056133sm3074236oah.51.2022.09.06.08.55.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Sep 2022 08:55:54 -0700 (PDT) Received: (nullmailer pid 594109 invoked by uid 1000); Tue, 06 Sep 2022 15:55:53 -0000 Date: Tue, 6 Sep 2022 10:55:53 -0500 From: Rob Herring To: "Russell King (Oracle)" Cc: Mark Kettenis , Hector Martin , linus.walleij@linaro.org, krzysztof.kozlowski@linaro.org, arnd@arndb.de, lee@kernel.org, alyssa@rosenzweig.io, asahi@lists.linux.dev, brgl@bgdev.pl, linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, sven@svenpeter.dev, krzysztof.kozlowski+dt@linaro.org, devicetree@vger.kernel.org Subject: Re: [PATCH 1/6] dt-bindings: mfd: add binding for Apple Mac System Management Controller Message-ID: <20220906155553.GB534217-robh@kernel.org> References: <909bb4e7-5bd2-2903-5bba-87ae37f3448a@marcan.st> <5b75dc7e-5337-73eb-450f-b72f479793c4@marcan.st> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220906_085556_866762_5E7E5562 X-CRM114-Status: GOOD ( 36.71 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Sep 06, 2022 at 03:54:50PM +0100, Russell King (Oracle) wrote: > On Tue, Sep 06, 2022 at 04:25:49PM +0200, Mark Kettenis wrote: > > > Date: Tue, 6 Sep 2022 22:53:47 +0900 > > > From: Hector Martin > > > > > > I agree that this is something to think about (I was about to reply on > > > the subject). > > > > > > I can think of two ways: using `reg` for the key name, but that feels > > > icky since it's ASCII and not *really* a register number/address, or > > > something like this: > > > > > > gpio@0 { > > > apple,smc-key-base = "gP00"; > > > ... > > > } > > > > > > gpio@1 { > > > apple,smc-key-base = "gp00"; > > > ... > > > } > > > > This would still require us to add a (one-cell) "reg" property and > > would require adding the appropriate "#address-cells" and > > "#size-cells" properties to the SMC node. > > Yes, and at that point, as I suggested, it probably would be better > to use: > > #address-cells = <1>; > #size-cells = <0>; > > gpio@67503030 { > reg = <0x67503030>; > }; > > gpio@67703030 { > reg = <0x67703030>; > }; > > Then the "reg" has a meaning that is directly related to the SMC. That's certainly odd, but if that's how it is addressed, then okay I suppose. > > > > But this ties back to the device enumeration too, since right now the DT > > > does not drive that (we'd have to add the subdevice to the mfd subdevice > > > list somehow anyway, if we don't switch to compatibles). > > > > > > I'd love to hear Rob's opinion on this one, and also whether the > > > existing Linux and OpenBSD code would currently find gpio@0 {} instead > > > of gpio {} for backwards compat. Node names are generally not considered ABI except when they are. :) Generally, core code doesn't care. Specific bindings with defined child nodes often do, but finding nodes by compatible is strongly preferred. Linux drivers can bind by node name (w/o unit-address), but that's really only ever done on ancient h/w. > > > > The OpenBSD driver does a lookup by name and the "@0" is part of that > > name. So that would break backwards compat. > > Oh, that's annoying - and is a different behaviour to Linux. > > On Linux, we only look at the node name up to the @ when matching (see > of_node_name_eq() in drivers/of/base.c, so it doesn't matter to Linux > what follows the @ when you try to look up a node named "gpio" - you'll > find gpio@anythingyoulike. > > > Maybe just name the slave GPIO controller "gpio-slave"? If we add > > compatibles, the compatibles for the nodes should propbably be > > different such that we can switch to do a lookup by compatible? > > I don't think the DT folk would be happy with "gpio-slave" because > node names are supposed to be generic. Also, "slave" probably isn't > a good choice of name in this modern era given past history. Yeah, not a great choice for both reasons. > Rather than the above, we could use "reg" to indicate which GPIO > controller we're talking about, and lookup the reg value in a table > to give the key. So gpio@0, reg=<0> => gP00, gpio@1, reg=<1> => gp00. > gpio@2, reg=<2> => whatever next. Keep in mind that for any level, there is only 1 address space. So if there's anything else with multiple instances, they share the same address space. IOW, you couldn't have say 'rtc@1'. (Another example of why I want to see a full picture.) > > That sounds like it won't break the existing OpenBSD. No? Isn't OpenBSD looking for 'gpio' which wouldn't find 'gpio@0'? Rob _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel