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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1DDFBC433E0 for ; Wed, 10 Feb 2021 11:37:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DC78564E42 for ; Wed, 10 Feb 2021 11:37:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230160AbhBJLgx (ORCPT ); Wed, 10 Feb 2021 06:36:53 -0500 Received: from muru.com ([72.249.23.125]:59812 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229600AbhBJLfn (ORCPT ); Wed, 10 Feb 2021 06:35:43 -0500 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 3301280EB; Wed, 10 Feb 2021 11:35:16 +0000 (UTC) Date: Wed, 10 Feb 2021 13:34:50 +0200 From: Tony Lindgren To: Hector Martin List-Id: Cc: Arnd Bergmann , devicetree@vger.kernel.org, Marc Zyngier , linux-kernel@vger.kernel.org, Krzysztof Kozlowski , soc@kernel.org, robh+dt@kernel.org, Olof Johansson , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 18/18] arm64: apple: Add initial Mac Mini 2020 (M1) devicetree Message-ID: References: <20210204203951.52105-1-marcan@marcan.st> <20210204203951.52105-19-marcan@marcan.st> <20210208110441.25qc6yken4effd6c@kozik-lap> <4481998a-27f6-951e-bb4f-a9d2b95f211f@marcan.st> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4481998a-27f6-951e-bb4f-a9d2b95f211f@marcan.st> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Hector Martin [210210 11:14]: > On 10/02/2021 19.19, Tony Lindgren wrote: > > * Hector Martin 'marcan' [210208 12:05]: > > > On 08/02/2021 20.04, Krzysztof Kozlowski wrote: > > ... > > > > > > > + clk24: clk24 { > > > > > > > > Just "clock". Node names should be generic. > > > > > > Really? Almost every other device device tree uses unique clock node names. > > > > Yeah please just use generic node name "clock". FYI, we're still hurting > > because of this for the TI clock node names years after because the drivers > > got a chance to rely on the clock node name.. > > > > Using "clock" means your clock driver code won't get a chance to wrongly > > use the node name and you avoid similar issues. > > That means it'll end up like this (so that we can have more than one > fixed-clock): > > clocks { > #address-cells = <1>; > #size-cells = <0>; > > clk123: clock@0 { > ... > reg = <0> > } > > clk456: clock@1 { > ... > reg = <1> > } > } > > Correct? Yeah, just don't use an imaginary dummy index for the reg. Use a real register offset from a clock controller instance base, and a register bit offset too if needed. That way if you discover a new clock inbetween somewhere, you don't have renumber any imaginary lists in the driver or device tree. So try to follow sort of what the standard interrupts binding is doing only describing the hardware. > Incidentally, there is just one example in the kernel tree of doing this > right (in arch/arm/boot/dts/imx6qdl-tx6.dtsi). All the others that use > non-mmio clocks called `clock`, including the various tegra devicetrees, > violate the DT spec by not including a dummy reg property matching the > unit-address. Doing it right will save you tons of time later on ;) FYI, for the TI clocks, we ended up redoing most of the clocks as documented in Documentation/devicetree/bindings/clock/ti-clkctrl.txt. Regards, Tony