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=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 228FDC47096 for ; Thu, 3 Jun 2021 12:58:38 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id E253D613B4 for ; Thu, 3 Jun 2021 12:58:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E253D613B4 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=svenpeter.dev Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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:Subject:Cc:To:From:Date:References: In-Reply-To:Message-Id:Mime-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pFzG0LXAKauINVfdCTYzP3Ad5djIBmAIrw56X8XB320=; b=409IbKrD5upLts jWt0IlDGtqSz3yq5zLoCfsXkG4frz+2ugdE/IcDSUDo53wn6tU2qyr6tZqE5uNj4Wzh1c1QCRdyBo 6OO4iYpWpCX2CAPHModnwNTUkNN+baE1wrY4pl0IIbweqiO7QxfaLclJ0sKDbnyPb5udnZ5hb+O/F S9w1z3v+omTpBYoF2Q/IOVoT7dYEGH226Po9b+DzyAUDCx4IoJBicy2U3bmpWK4pvIvmHllKQuKs1 mn6EtfHc735XlBuHbiwzgI3YcVgtZ699GMO6c9P185+zOw4k6FqtYagyxLj4yM0WF8g2yZd7IyDFa JFxn4XdFhMW6LgIZEs4Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lomtk-008n3N-8W; Thu, 03 Jun 2021 12:56:32 +0000 Received: from wnew4-smtp.messagingengine.com ([64.147.123.18]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lomtQ-008mv3-5g for linux-arm-kernel@lists.infradead.org; Thu, 03 Jun 2021 12:56:16 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.west.internal (Postfix) with ESMTP id 31EBD10DE; Thu, 3 Jun 2021 08:56:08 -0400 (EDT) Received: from imap21 ([10.202.2.71]) by compute3.internal (MEProxy); Thu, 03 Jun 2021 08:56:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svenpeter.dev; h=mime-version:message-id:in-reply-to:references:date:from:to :cc:subject:content-type; s=fm1; bh=HFjpVEiJoJYTmtnTYuXMoFD2GTAK 1rJxCBIwvY1xZpg=; b=ySSo951o5sncVZgAfB55+kF/4km0fk2Amn5A4WLBEQ0V Nq34zRZXNMjAllZ2CWNCsx4sKXLAqztk6fckgAG/RyvW+v0Xp+P8K410P+4vxp21 AoZq7/E14y28gvVhvP02kYKQA0rnf37ywDMgikp0ajLJvpysjrr5E3MrxgLsnnqY qcsUgGQnPkiQ4o7t4M0MtZHnGhbYwqj2qIF/z6V5rEk/dLqGWStIbbK6dCH+IpZ3 O9waMWz6lxbsFg9/jveartCnXDvJJQPO3BmRDD9wWKtNHCw5219QdTERCKo7LlyK 77WHkGsMTM5XmJhDRophnFj02ca0GquAGUVSqn0drw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=HFjpVE iJoJYTmtnTYuXMoFD2GTAK1rJxCBIwvY1xZpg=; b=Xl+n3oHhBcL1hQnHtbnyJX eCRcmdYQu7nSH5kWriRXYu7Rf9AY0ovULXFljSFlVVXRuyRPp7fglWgE8QYvUp/8 2H86nGShhzEG+9RkjztQvkPVoFsk8+V+1cT3jpcnpQYaD7tsMxe7RO/s4ekxZSOM GpVj6DQ7r6ZJkyzpIw86TH1huoXfBEdZxyA45SNf9VJwKERBUbyc96PvG5ccp99z tqpVRXu/OdAGj3yzHV7tZ2/tBxoiyJaf4U3vDUnt0dFCYd3IpHqVra/Wjy2dOrzl 4aNamLiURNmCgM0kIaXlR2bpaAN92VlIWMS8f/Xnz9OIV3xxvEUbE2vqvfkHa9iQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdelledgheeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomhepfdfuvhgv nhcurfgvthgvrhdfuceoshhvvghnsehsvhgvnhhpvghtvghrrdguvghvqeenucggtffrrg htthgvrhhnpefgieegieffuefhtedtjefgteejteefleefgfefgfdvvddtgffhffduhedv feekffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hsvhgvnhesshhvvghnphgvthgvrhdruggvvh X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 88B6D51C0060; Thu, 3 Jun 2021 08:56:05 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-519-g27a961944e-fm-20210531.001-g27a96194 Mime-Version: 1.0 Message-Id: <1ff54382-7137-49d6-841d-318e400e956e@www.fastmail.com> In-Reply-To: References: <20210524182745.22923-1-sven@svenpeter.dev> <9ff6ec26-4b78-4684-9c23-16d5cbfef857@www.fastmail.com> Date: Thu, 03 Jun 2021 14:55:45 +0200 From: "Sven Peter" To: "Tony Lindgren" Cc: "Rob Herring" , devicetree@vger.kernel.org, linux-clk , linux-arm-kernel , "linux-kernel@vger.kernel.org" , "Hector Martin" , "Michael Turquette" , "Stephen Boyd" , "Mark Kettenis" , "Arnd Bergmann" Subject: Re: [PATCH 0/3] Apple M1 clock gate driver X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210603_055612_363053_BA31DB04 X-CRM114-Status: GOOD ( 21.55 ) 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 Hi Tony, On Wed, Jun 2, 2021, at 11:26, Tony Lindgren wrote: > * Sven Peter [210530 11:09]: > > > > Now the big question is *how* to describe this additional data in the > > dts. Essentially I need to specify that e.g. to enable clock 0x270 > > I first need to enable the (internal) clocks 0x1c0 and then 0x220. > > Are you aware of any generic way to describe this? I'm not even sure > > how a sane non-generic way would look like when I just have a single > > clock controller node. > > To me it seems you might be able to recycle the assigned-clocks and > assigned-clock-parents etc properties in the clock controller node. > > Sure the assigned-clocks property will point to clocks in the > clock controller itself, and will have tens of entries, but should > work :) Thanks for the suggestion, I really like that idea! If I understand the assigned-clocks-parent property correctly it's meant to select one of the possible parents of e.g. a mux clock at startup. Internally it just uses clk_set_parent which, unless I'm mistaken, would require to assign each clock as a possible parent of every other clock. Now the good news is that Apple seems to have sorted the clocks topologically on the bus, i.e. there never is a clock at address X that requires a parent with an address bigger than X. The bad news is that I'd probably still have to setup clocks at 0x0, 0x4, 0x8, ..., X-0x4 as possible parents of the clock at X. Another possibility this made me think of is to instead just use the clocks property the way it's usually used and simply refer to the controller itself, e.g. #define APPLE_CLK_UART0 0x270 #define APPLE_CLK_UART_P 0x220 #define APPLE_CLK_SIO 0x1c0 pmgr0: clock-controller@23b700000 { compatible = "apple,t8103-gate-clock"; #clock-cells = <1>; reg = <0x2 0x3b700000 0x0 0x4000>; clock-indices = , , ; clock-output-names = "clock-sio", "clock-uart-", "clock-uart0"; clocks = <&some_dummy_root_clock>, <&pmgr0 APPLE_CLK_SIO>, <&pmgr0 APPLE_CLK_UART_P>; }; to represent the UART clocks UART0 (0x23b700270), parent: UART_P UART_P (0x23b700220), parent: SIO SIO (0x23b7001c0), parent: n/a and then have the consumer as serial0: serial@235200000 { // ... clocks = <&pmgr0 APPLE_CLK_UART0>, <&clk24>; clock-names = "uart", "clk_uart_baud0"; // ... }; I'd have to see if it's possible to implement this sanely though if this binding was acceptable. The self-reference to a node that hasn't been fully initialized yet may turn out to be ugly. > > And sounds like you can generate that list with some script from the > Apple dtb. Yup, absolutely. I don't want to write this all out by hand if I can avoid that :-) > > Regards, > > Tony > Thanks, Sven _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel