Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9214026ybi; Wed, 10 Jul 2019 06:34:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqxnWZxXCdT+6ieDwljakyIrSrsdz35cc+arkdafFI8OSwfrQkB4Ur/fFoeuytFoYzoQlS6I X-Received: by 2002:a17:902:694a:: with SMTP id k10mr38687044plt.255.1562765687523; Wed, 10 Jul 2019 06:34:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562765687; cv=none; d=google.com; s=arc-20160816; b=PHzRcTzPmRvTeCBNmrh365HWmZJFcYnOs0u87F/w5lemcr1dq2bD6j7/599TVkuOjh ixRQ12pjbs5Q/NZ1PLr0NfyiK8Y+czkBf2UxrdN4iJFqnHo8yKMCNl4wWlbtQ/zAdGx+ RKTioLKee6zIaGzUaNLWMj/P6Him+7zAT06+0JoBFlwepKV3NnGwAIWLInxqFSIVm4qJ MdZhzYcmqV5AjylJDb8sUtK9Sv2kWmHXHJGpNM2cXQgNJ1moafQS+BZBk4ITzjB0zrY0 w9a3yz1/zVslGsyy92JDplJPQAoA/htXcUyMYWGT0h2zD5e4xyT/aX19Eh2PVE95cBZZ KdRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=DyNjcbFcJ+4651blitXgUqDsMKvtWHq2GaOVQsIKqRk=; b=ZRsPhGi6Kte5Mei+QnNxOESl0DVHUrfGdagpfbTJg8JT0Zf5ySjYGmHgFD6ChAhN3k RYg09wIBep7vn0o/FgHvljOpABW3Dn/NTuD1kSX6r3YF5eadMW71qR0739lw7mx4/eGH j8S1ZkFeAqsrbWvfTlN/3ZVDOM+M5Dax4HnjdhPbLMgJYKu0a6UMteJdtTYSByy4/ZRX nUY3ewP8hr5LXe8AQJf2Y/c1Ok3Iyx4vEQhYm+Fxjeb/ztL+baKX/BIT3+2ZCsXI4mz/ wEF1e+I7ebhgjxfPUKHJsdo16/RhjUlijNtVcXheeyaBUZ/oHJKaNazamd8s3syvJ+3d H03Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Ygq4G+Z9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r26si2340256pgv.189.2019.07.10.06.34.31; Wed, 10 Jul 2019 06:34:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Ygq4G+Z9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727402AbfGJNXh (ORCPT + 99 others); Wed, 10 Jul 2019 09:23:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:45422 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727229AbfGJNXh (ORCPT ); Wed, 10 Jul 2019 09:23:37 -0400 Received: from mail-qt1-f176.google.com (mail-qt1-f176.google.com [209.85.160.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9958A2087F; Wed, 10 Jul 2019 13:23:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562765016; bh=ptwe1rDFfCle9mAd7yUbzwHCUIplmYHPvUm9uxzozYw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Ygq4G+Z93uqVVpJVD5haYpXwweRb1Aq6snmGvdOmy8F1jygCrILzqs6RgP/d591b9 nUBz/e/yJa14QCMACtxj8udJ495dRYqX22DoUq4EzdfGme8B1cJHRdf15xPBLV4R4P xTiKoIThZpr8n+cZltoJbcnxVtJSmai1XHX+GIJE= Received: by mail-qt1-f176.google.com with SMTP id w17so2337245qto.10; Wed, 10 Jul 2019 06:23:36 -0700 (PDT) X-Gm-Message-State: APjAAAUohhkzezqI1mEaZbvwMSMtElcocmHgnkWY31pgKb1+oii+cGD6 0h3R23D3bg1cwpKI1po3gPWojaVKs3oFGXMUig== X-Received: by 2002:ac8:3908:: with SMTP id s8mr23635427qtb.224.1562765015828; Wed, 10 Jul 2019 06:23:35 -0700 (PDT) MIME-Version: 1.0 References: <20190701093826.5472-1-Anson.Huang@nxp.com> <20190701093826.5472-2-Anson.Huang@nxp.com> In-Reply-To: From: Rob Herring Date: Wed, 10 Jul 2019 07:23:23 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH V4 2/5] clocksource/drivers/sysctr: Add clock-frequency property To: Anson Huang Cc: Daniel Lezcano , Thomas Gleixner , Mark Rutland , Shawn Guo , Sascha Hauer , Sascha Hauer , Fabio Estevam , Leonard Crestez , Viresh Kumar , Daniel Baluta , Jacky Bai , Lucas Stach , Abel Vesa , Andrey Smirnov , Carlo Caione , "Angus Ainslie (Purism)" , =?UTF-8?Q?Guido_G=C3=BCnther?= , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , dl-linux-imx Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 9, 2019 at 7:30 PM Anson Huang wrote: > > Hi, Rob > > > On Mon, Jul 1, 2019 at 3:47 AM wrote: > > > > > > From: Anson Huang > > > > 'dt-bindings: timer: ...' for the subject. > > OK, I made a mistake. > > > > > > > > > Systems which use platform driver model for clock driver require the > > > clock frequency to be supplied via device tree when system counter > > > driver is enabled. > > > > This is a DT binding. What's a platform driver? > > It is just trying to explain why we need to introduce this "clock-frequency" > property, nothing about the binding and platform driver. > > > > > > > > > This is necessary as in the platform driver model the of_clk > > > operations do not work correctly because system counter driver is > > > initialized in early phase of system boot up, and clock driver using > > > platform driver model is NOT ready at that time, it will cause system > > > counter driver initialization failed. > > > > > > Add clock-frequency property to the device tree bindings of the NXP > > > system counter, so the driver can tell timer-of driver to get clock > > > frequency from DT directly instead of doing of_clk operations via clk > > > APIs. > > > > While you've now given a good explanation why you need this, it all sounds > > like linux specific issues and a DT change should not be necessary. > > > > Presumably, 'clocks' points to a fixed-clock node, right? Just parse the 'clocks' > > phandle and fetch the frequency from that node if you need to get the > > frequency 'early'. > > Sound like a better solution, I will try that, since the system counter's clock is > from osc_24m and divided by 3, since different platforms may have different divider, > so maybe I can create a fixed-clock node in DT, then system counter driver can parse > the clock and fetch the frequency from that node, will redo a V5 patch. The divide by 3 can be implied by the compatible. If you need a different divider, add another compatible. > > > > > Signed-off-by: Anson Huang > > > --- > > > No change. > > > --- > > > .../devicetree/bindings/timer/nxp,sysctr-timer.txt | 15 +++++++++------ > > > 1 file changed, 9 insertions(+), 6 deletions(-) > > > > > > diff --git > > > a/Documentation/devicetree/bindings/timer/nxp,sysctr-timer.txt > > > b/Documentation/devicetree/bindings/timer/nxp,sysctr-timer.txt > > > index d576599..7088a0e 100644 > > > --- a/Documentation/devicetree/bindings/timer/nxp,sysctr-timer.txt > > > +++ b/Documentation/devicetree/bindings/timer/nxp,sysctr-timer.txt > > > @@ -11,15 +11,18 @@ Required properties: > > > - reg : Specifies the base physical address and size of the comapre > > > frame and the counter control, read & compare. > > > - interrupts : should be the first compare frames' interrupt > > > -- clocks : Specifies the counter clock. > > > -- clock-names: Specifies the clock's name of this module > > > +- clocks : Specifies the counter clock, mutually exclusive with clock- > > frequency. > > > +- clock-names : Specifies the clock's name of this module, mutually > > exclusive with > > > + clock-frequency. > > > +- clock-frequency : Specifies system counter clock frequency, mutually > > exclusive with > > > + clocks/clock-names. > > > > It doesn't really work to say one or the other is needed unless you make the > > OS support both cases. > > The OS already support both cases now with this patch series. What about FreeBSD or any other OS? Rob