Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2237870rdb; Sun, 3 Dec 2023 08:09:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IGGnCoU+JkjSNmaH+fqKOmW6BDS85u9Mn+qgDRQ/06yNaBgYKjHTPrGSWBtnbJ4uPbiY1zk X-Received: by 2002:a17:902:700b:b0:1d0:a0ee:28eb with SMTP id y11-20020a170902700b00b001d0a0ee28ebmr171441plk.131.1701619757119; Sun, 03 Dec 2023 08:09:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701619757; cv=none; d=google.com; s=arc-20160816; b=CQ7iDBaOCW7+fpgeK9DixyvC8E+iYCospSzIyiKHQWe6tR+rDFfRVABa/7DGKuFk8W DQdETcSPAjSaPvj3aaoLTf+45LK0X/t8rlcsS8HznxRngO5fXF2xw7q6SHZxm6v6Tq0r E6h2o492HlifYAwV2kKoNtri8QacmQQmsfNsO8lRAFS7RtEDR6U/rD4hW0ItqbgVhgLN kPJ+jEsyRFmCf9RWJIlsS7kNhHKGrb/ilJGLuTA3EgMC929M4YC6boXYgW/D2aUm9zWk Dbz+3SjIWvb0TvickV+NodZU2pNFLk4z9odhGWcMXlteUg2z8wmZbWy0CaAtofB3vIti RVbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:mime-version :references:in-reply-to:from:dkim-signature; bh=Jr2viQE+KNXdoLwjt3YG8fOnB+WKPmtD8qV0RS5wcNE=; fh=Bb7oeQWPhpEoyOpvYqnEijfDMjYXlrQOCid+HoSpyIs=; b=dvg3N3S2ErapF0xIIDOE8U3yl+ED/541V7GGrwYmG3FGnDf/2oCOCi81CK9xOLJ1ki OhOCc59qyinKCsABEdCYOztjrEo41xfykn4XXhV86976BHh4J2CMzt6MvfwHfwo56jbt SRIijfszCq5ANuIWLnm7hiU6a8/AysdWVmzJLO86ORW3b6DJ+5PZyptO76DfKZni4Ipw d3fJaniij34eZw49h/XvXp46ABmCTFWP4FB5NLQmSZRlA8FfDB7jLBWccVKNQ5I5kVCC LbFJGuCVbJSBeAeieq5jeO+2gwpWx4lGzw+mjngUgsNUs9qiJghNXeCm2aTHRmA72aPM CKuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=SIihe6oh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id t12-20020a170902a5cc00b001cc692bf120si6046757plq.61.2023.12.03.08.09.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Dec 2023 08:09:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=SIihe6oh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 86CC1804738B; Sun, 3 Dec 2023 08:09:14 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233386AbjLCQJA (ORCPT + 99 others); Sun, 3 Dec 2023 11:09:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbjLCQI7 (ORCPT ); Sun, 3 Dec 2023 11:08:59 -0500 Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E0E1CA for ; Sun, 3 Dec 2023 08:09:04 -0800 (PST) Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id AFB613F322 for ; Sun, 3 Dec 2023 16:09:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1701619742; bh=Jr2viQE+KNXdoLwjt3YG8fOnB+WKPmtD8qV0RS5wcNE=; h=From:In-Reply-To:References:Mime-Version:Date:Message-ID:Subject: To:Cc:Content-Type; b=SIihe6oh8Pdg/qzj6ZLeulNjUKAEY45iD1C8Y/jpN0FxCuX2ETt716dOAsORS97Ps a1uf5lM6VcCn9E3oVhMu3fhyhiJoboAgpsYExq/KQ1nen2N2S2YBLFhB83zxkIU1CK NOuOLsUnPeBl38U95GCTX6PFtCoemsqw5vqvrTuu/jA/KhEPlJzN1gajiNmlTjv0U8 u3Trk+aLtJqeB06EsxkASd43Gvn4I9M7EJA/5cGmVqR3nzEvAcOsU1sNOOeeoWcG3A EBWgsHEffQaZKUgWyZiEAxUMPB2dTWVyHbhEyzpInhAZ9FupqVZ0GvAeriyVzjlF1T Udb7SW279X9bQ== Received: by mail-qt1-f199.google.com with SMTP id d75a77b69052e-423e22075f4so53278581cf.0 for ; Sun, 03 Dec 2023 08:09:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701619741; x=1702224541; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Jr2viQE+KNXdoLwjt3YG8fOnB+WKPmtD8qV0RS5wcNE=; b=qhiQJacWWZhWxATTi0I5ZE0S3sDOpMZbZ118ouDLp4jxOP0/lSHGzHx7ghj/0tJk4L xQiKT6HUs9rCpaUELDRf5cv1wgF0T0W2Koi/exOwe6rcmoNebrpTzi7FM2fJJAbbJZlI vH8iNg/7rmCScBTSj/hho8pt9ZSCH+EzmfHjDEbaIctfRYj1rGMsyznxMYc8/v4qai1Z xJUfuIVlgP0M5LjQY2TBmcjwLkO2SBqIwAOD17Xoz4DrVuB6UFOMKOhL8Hd+W8g+dY3B se+vWmuII52+KuJQqwuI6hzxbTIxvq0NBvncJtJJvzrGHLw8jtxNS2s+Di0Y8T4HJzMM uuRA== X-Gm-Message-State: AOJu0YyLoC3t8Z4crA3nKX7NkawwMA+jZQn5hCzN8JFbhNj20GA8i7px dMkZxYpGZxmgQvAzFiLYPlqsXmiBxTCEU7yacw4FY6gRhFdKaKWFlyQawudvW1jgGuZk4bQQS5L tiW11Q7wPYQ0TXNiCGIuj+xdwOeibpwOVZLrfvlIIlkPKOn3vqBEdfgR8lw== X-Received: by 2002:a05:622a:1010:b0:425:4043:1db6 with SMTP id d16-20020a05622a101000b0042540431db6mr4559531qte.137.1701619741644; Sun, 03 Dec 2023 08:09:01 -0800 (PST) X-Received: by 2002:a05:622a:1010:b0:425:4043:1db6 with SMTP id d16-20020a05622a101000b0042540431db6mr4559513qte.137.1701619741411; Sun, 03 Dec 2023 08:09:01 -0800 (PST) Received: from 348282803490 named unknown by gmailapi.google.com with HTTPREST; Sun, 3 Dec 2023 08:09:01 -0800 From: Emil Renner Berthing In-Reply-To: <20231203-mountable-snowsuit-24e4252c9eb5@spud> References: <20231130-bobbing-valid-b97f26fe8edc@spud> <20231203-mountable-snowsuit-24e4252c9eb5@spud> Mime-Version: 1.0 Date: Sun, 3 Dec 2023 08:09:00 -0800 Message-ID: Subject: Re: [PATCH v1] riscv: dts: starfive: move timebase-frequency to .dtsi To: Conor Dooley , Emil Renner Berthing Cc: linux-riscv@lists.infradead.org, Conor Dooley , Emil Renner Berthing , Rob Herring , Krzysztof Kozlowski , Paul Walmsley , Palmer Dabbelt , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Walker Chen , JeeHeng Sia , Leyfoon Tan Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Sun, 03 Dec 2023 08:09:14 -0800 (PST) Conor Dooley wrote: > On Fri, Dec 01, 2023 at 02:44:58PM +0100, Emil Renner Berthing wrote: > > Conor Dooley wrote: > > > From: Conor Dooley > > > > > > Properties fixed by the SoC should be defined in the $soc.dtsi, and the > > > timebase-frequency is not sourced directly from an off-chip oscillator. > > > > Yes, according to the JH7100 docs[1] the mtime register is sourced from the > > osc_sys external oscillator through u74rtc_toggle. However I haven't yet found > > a place in the docs that describe where that clock is divided by 4 to get > > 6.25MHz from the 25MHz. > > > > I expect the JH7110 mtime is set up in a similar way, but haven't yet dug into > > the available documentation. > > Your other reply suggests that this is a fixed division for the jh7110, > in which case it makes sense to leave it as-is. mpfs is different in > that it is fixed to 1 MHz regardless of which of the permitted external > oscillator frequencies you use. This is what I've found for the JH7100: osc_sys (25MHz) -> u74rtc_toggle (gate) -> ? (div 4) -> mtime The divide by 4 is not in the regular clock tree, so if it is configurable it must be some bits hidden in the syscon area or something. The only restriction I've found in the docs is that it must be strictly less than half the rate of the core clock. For the JH7110 it goes: osc (24MHz) -> rtc_toggle (div N) -> mtime ..where N defaults to 6 and this is also the maximum N. /Emil