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 83D31C3DA4A for ; Thu, 5 Sep 2024 16:35:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To: Content-Type:MIME-Version:References:Message-ID:Subject:To:Date:From:Reply-To :Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=kJHk6dVcMot+83fqcyHPWmLjMUPxP5z8vxp/ZBkDsTM=; b=YGlkk1HTVSnCmGliut2/ZkU12F 5KaK58f+7Ecc+FiQJLx9yBF/u8kfIm27C+ePvBs0tiA8yWmCTO2clFfqiER+Tdx5VO6Y50XCtqL3E 5UsCaSq3tTaJiQKXU7QlrGR4QGK8ruG6h02bVhsciNL8j92uZT0u2XgyiPzpifNYFvh/j0Ph1pd2D 08lue3lAXXC6aEMsCN1JEF1PHPwZZiJgJGmWcsDfdpCo+bMR1wYf+4WaBNuw7Eeps13EZuuntzPvo 4mMAaBJEsEgU9/q9Vlpe0na+s/u1yDGPTDF9jyS/LVxhvfK5gadDm1XZudG6znk73jvH+tga2fHtl /abjNxWg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1smFSM-000000099QM-01NJ; Thu, 05 Sep 2024 16:35:38 +0000 Received: from mail-ed1-x542.google.com ([2a00:1450:4864:20::542]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1smFQU-000000098tC-245m for linux-arm-kernel@lists.infradead.org; Thu, 05 Sep 2024 16:33:44 +0000 Received: by mail-ed1-x542.google.com with SMTP id 4fb4d7f45d1cf-5c26311c6f0so1255934a12.3 for ; Thu, 05 Sep 2024 09:33:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1725554018; x=1726158818; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:from:to:cc:subject:date:message-id:reply-to; bh=kJHk6dVcMot+83fqcyHPWmLjMUPxP5z8vxp/ZBkDsTM=; b=eORm2hEtAA1PU7dZ/jeuHTM6u8StmFmHWz8fE+LDd1WwMR2iLqryaWH14mRETq9y6r 6kfenhMs1+brTw4zZnc8Y7tTuxkZ2qZPzbBU8/1QPi0TKDp516b3j/CLtkIokJGNfaC8 bO2IN31ehnbhhLrIveHLwc0SnJOw14KjFlyljxLRwAd+VCGRx3ZR6dD8iJYhMBAwpeEc Egf1RRQN5N7i7kpQzW/pvQqDrgOLIfRKh6VdLFlh/Au275IQfha3vg00TeqVYhpQIzK3 8Yyjx4hV11eauHbgrw3xuGr7Ss7qqEu8gi1eiRrSVLSFqjKRi+EEMOJq/KvpkmnJaP/y BIEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725554018; x=1726158818; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=kJHk6dVcMot+83fqcyHPWmLjMUPxP5z8vxp/ZBkDsTM=; b=lQu7KKkixKgKjAetHAEM1o/M5yBIB9w0XHCAeeJZwWmdB740Q118Da50Wv6mKeglXW XQIRdYEp8ANpYqHEX0C65ANXG9CWls0joZhp2q9R+D4zF01oMlcUk3G7CBY4TBfrMiEU EHOY6s/0KNQ/+g8H3G9oUcPlQD3sjwq8oSN3xGi0hqjgBEDQwkZA5s+Wt2EuvQ/pN3vg 6hkm6aYUe3XdIvaHrXAhoKvOEPNmNsD73Ps11MKqCf3Utm0Pi6aYKBOjkU1A0j4xkvEF uQSLU2ajD6E/qm7A+j1XCZMqEG41hQiCZ5p8QfmfCy8P4galc+d4R93Yi1R5Z+Rkjj14 j4cw== X-Forwarded-Encrypted: i=1; AJvYcCVo24+MkfNs8mJI5IlHB7hGljLw3LNnQJJyP9hQyunGBeKGwN9fUPgIyZD5zQUN4iDDt2yRFrd9SnhfelgK4V3K@lists.infradead.org X-Gm-Message-State: AOJu0Yzm0bxgYWp0jEASSOv6Aw33miStoDPze5OclIe9/7232RolZEhw dAUy3HfoK5PYXGZ5ss+Y4+z5jT6S486rRDXGkBjEdyPh21U1FbNntrOx2zbvkj8= X-Google-Smtp-Source: AGHT+IHU/avyIpf1tRzphlO3ca0BhbKJKByf8ZqboDAgvuiywTcmj9UX7KVZcHdK/Ol0/Wbwf0Mx9g== X-Received: by 2002:a05:6402:3226:b0:5c2:6bf7:8531 with SMTP id 4fb4d7f45d1cf-5c2caf33541mr5644250a12.33.1725554018023; Thu, 05 Sep 2024 09:33:38 -0700 (PDT) Received: from localhost (host-80-182-198-72.pool80182.interbusiness.it. [80.182.198.72]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c3cc528bcfsm1430637a12.16.2024.09.05.09.33.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2024 09:33:37 -0700 (PDT) From: Andrea della Porta X-Google-Original-From: Andrea della Porta Date: Thu, 5 Sep 2024 18:33:45 +0200 To: Krzysztof Kozlowski Subject: Re: [PATCH 08/11] misc: rp1: RaspberryPi RP1 misc driver Message-ID: References: <5954e4dccc0e158cf434d2c281ad57120538409b.1724159867.git.andrea.porta@suse.com> <39735704-ae94-4ff8-bf4d-d2638b046c8e@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <39735704-ae94-4ff8-bf4d-d2638b046c8e@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240905_093342_561360_B9E565E9 X-CRM114-Status: GOOD ( 34.35 ) 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: , Cc: Andrew Lunn , Catalin Marinas , Michael Turquette , Claudiu Beznea , Eric Dumazet , Dragan Cvetic , Will Deacon , linux-clk@vger.kernel.org, linux-arch@vger.kernel.org, Rob Herring , Florian Fainelli , Lee Jones , Saravana Kannan , Broadcom internal kernel review list , linux-pci@vger.kernel.org, Jakub Kicinski , Paolo Abeni , Linus Walleij , devicetree@vger.kernel.org, Conor Dooley , Arnd Bergmann , linux-gpio@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, Bjorn Helgaas , Andrea della Porta , linux-arm-kernel@lists.infradead.org, Derek Kiernan , Stephen Boyd , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Stefan Wahren , netdev@vger.kernel.org, Krzysztof Kozlowski , "David S. Miller" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Krzysztof, On 20:27 Tue 03 Sep , Krzysztof Kozlowski wrote: > On 03/09/2024 17:15, Andrea della Porta wrote: > >>>>> + > >>>>> + rp1_clocks: clocks@c040018000 { > >>>> > >>>> Why do you mix MMIO with non-MMIO nodes? This really does not look > >>>> correct. > >>>> > >>> > >>> Right. This is already under discussion here: > >>> https://lore.kernel.org/all/ZtBzis5CzQMm8loh@apocalypse/ > >>> > >>> IIUC you proposed to instantiate the non-MMIO nodes (the three clocks) by > >>> using CLK_OF_DECLARE. > >> > >> Depends. Where are these clocks? Naming suggests they might not be even > >> part of this device. But if these are part of the device, then why this > >> is not a clock controller (if they are controllable) or even removed > >> (because we do not represent internal clock tree in DTS). > > > > xosc is a crystal connected to the oscillator input of the RP1, so I would > > consider it an external fixed-clock. If we were in the entire dts, I would have > > put it in root under /clocks node, but here we're in the dtbo so I'm not sure > > where else should I put it. > > But physically, on which PCB, where is this clock located? xosc is a crystal, feeding the reference clock oscillator input pins of the RP1, please see page 12 of the following document: https://datasheets.raspberrypi.com/rp1/rp1-peripherals.pdf On Rpi5, the PCB is the very same as the one on which the BCM2712 (SoC) and RP1 are soldered. Would you consider it external (since the crystal is outside the RP1) or internal (since the oscillator feeded by the crystal is inside the RP1)? > > > > > Regarding pclk and hclk, I'm still trying to understand where they come from. > > If they are external clocks (since they are fixed-clock too), they should be > > in the same node as xosc. CLK_OF_DECLARE does not seem to fit here because > > There is no such node as "/clocks" so do not focus on that. That's just > placeholder but useless and it is inconsistent with other cases (e.g. > regulators). Fine, I beleve that the root node would be okay then, or some other carefully named node in root, if the clock is not internal to any chip. > > If this is external oscillator then it is not part of RP1 and you cannot > put it inside just to satisfy your drivers. Ack. > > > there's no special management of these clocks, so no new clock definition is > > needed. > > > If they are internal tree, I cannot simply get rid of them because rp1_eth node > > references these two clocks (see clocks property), so they must be decalred > > somewhere. Any hint about this?. > > > > Describe the hardware. Show the diagram or schematics where is which device. Unfortunately I don't have the documentation (schematics or other info) about how these two clocks (pclk and hclk) are arranged, but I'm trying to get some insight about that from various sources. While we're waiting for some (hopefully) more certain info, I'd like to speculate a bit. I would say that they both probably be either external (just like xosc), or generated internally to the RP1: If externals, I would place them in the same position as xosc, so root node or some other node under root (eg.: /rp1-clocks) If internals, I would leave them just where they are, i.e. inside the rp1 node Does it make sense? Many thnaks, Andrea > > Best regards, > Krzysztof >