Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp1897482ybd; Thu, 27 Jun 2019 03:28:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqwwjDB3GO+3z5Z3l/N9eUPhYMbsG71FVTz3tVMduv+91axZGeNVrFJ+Ii1tpcUQ2WgX/i8P X-Received: by 2002:a17:90a:80c4:: with SMTP id k4mr5238586pjw.74.1561631318928; Thu, 27 Jun 2019 03:28:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561631318; cv=none; d=google.com; s=arc-20160816; b=cvQs6CKv3QA7ZKNzsRGV6SMzR9E2A9r3+rdn+jZ4uBz4KPYaHHvJNTBWxm+vg36iyo YYX405hE4ydkoVA+Dlv/giCDzm9g94FQBYDPgQfVt281aaZSaQYm8E9+CtrXskzMiWOa w5cKTDWhEo2d5nPs3n1dsVdSiNqkuwVDqMUxplfPkz7F/S6xCushltDu1dxf8faecf7X fvtCjDkqPt23j5qdalXsWY9n9pRBmqV3XqB/zCgfQXmTYfEKjh9dIupYAklH0AD0TWUF z6zKzJZ24eY3hBESz7DB67q4iGj9b/FiakLBielQBqUBHYcqemfGfHmOzeWzOQ6Drsiv 3oeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject :dkim-signature; bh=Bbt3iD0RuM1MWWR+I8B1kKnSONTbv3aEdP5kqBIyOco=; b=fu+QY1UQelh9wahlAmL2kgum7hma671ePgHyueVxygDm2/9qxo6VmCDgWfAxOaInwx hb3UiPHmWpZNgm9MPotOh8pVJ2oyXgAXQgs1zAsCAh5CcCK2hq4F9Rfr8a0zavE9reWE dGARrGS6/2ysht4CHD6G0bmx2ei6lzM42j79MmA8mMi2gY9V2YfXk5PVxntdb/Zzozi6 R+DCXOJhL75VS2JNyVUGylLK7a8S/EjTBkuXgR5Y/lKorfBsrgDMBOX3EhVFgNdl/szP XxnBM0hhASnEirdM0Cd2C+3dveAzb1ju8PqyrXGF2tUOGzKQ4+PJTk4m8/zfpB4voW+l udQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UOWSXKTL; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f11si1784966pgl.402.2019.06.27.03.28.23; Thu, 27 Jun 2019 03:28:38 -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=@linaro.org header.s=google header.b=UOWSXKTL; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726650AbfF0K1p (ORCPT + 99 others); Thu, 27 Jun 2019 06:27:45 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:35969 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726370AbfF0K1p (ORCPT ); Thu, 27 Jun 2019 06:27:45 -0400 Received: by mail-wr1-f65.google.com with SMTP id n4so1932944wrs.3 for ; Thu, 27 Jun 2019 03:27:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Bbt3iD0RuM1MWWR+I8B1kKnSONTbv3aEdP5kqBIyOco=; b=UOWSXKTLXY4x4TfC/d0c9DZELYKd3roJE/3u1j2etH3otViKBlReANbLqJPxE5brNK ueeRf3Bef46tKFhuXK4yUfp+IRGdk68mQmkErqqRfLYqjqtXZGHs+PUUOo9QnaHAUUfL e1LZqET0ctg28UoWwUPwF/s8VehPibX9itNhcZtWz57dp1G2ZPRa2sNf/oenLzXuDj6B LEIeCfOmVMXb2EnpcKCRK8gamR/D+8tfhacUePO73aYRUk7NmGhGEo+Rd08zVN68qJiB 1IeP8VI1KsWaDDlVIrA+I3B1eQi9AoFNlXSUN8WyUlvzJZrgVGwbACRb5SvG7M/SbDLT hvPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=Bbt3iD0RuM1MWWR+I8B1kKnSONTbv3aEdP5kqBIyOco=; b=sTxJcfkglzWdUeX0xBD2Og1qB9BNuWVSuhIWaS6m67pJ63fqvK75ehAOxq5enefBit hq2jBfP3yb28NVCvkVLRywWAIrSVbjTt7ZuCe3sWlWcvqwEv/uG0lgOyGe75aZknxyQi t5mL/PWRl7xQDORo56J3OSH3mG2ewZw7eUpm/O77vIhvnnhVATQ0dyEZt0Q/d9oTLGnO LxcQgL4b7qCTjVXxMUplpMHRjJ1k6DyRJ2yvD3C3k9K2je+pLWzwxZ48dfvcCwCMejC8 2WH/FYKlH8DUfDKuGCP/6hRAgm8rRAlRGtC/wCy+KWbIU2E/yKUs4RYXPyosYYl7UJhn IjhQ== X-Gm-Message-State: APjAAAXbuDcY2aVyJ45DI5s/xesWjjjBq/1wMqBj3sHO7XP/zL5M6fBE wwG6mcWghL8bbJbI2GAcbwfNRgYBBok= X-Received: by 2002:a5d:40ca:: with SMTP id b10mr2785889wrq.171.1561631260868; Thu, 27 Jun 2019 03:27:40 -0700 (PDT) Received: from [192.168.0.41] (113.102.130.77.rev.sfr.net. [77.130.102.113]) by smtp.googlemail.com with ESMTPSA id b5sm1785802wru.69.2019.06.27.03.27.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Jun 2019 03:27:40 -0700 (PDT) Subject: Re: [PATCH RESEND V2 1/3] clocksource/drivers/sysctr: Add optional clock-frequency property To: Anson Huang , "tglx@linutronix.de" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "shawnguo@kernel.org" , "s.hauer@pengutronix.de" , "kernel@pengutronix.de" , "festevam@gmail.com" , "l.stach@pengutronix.de" , Abel Vesa , "ccaione@baylibre.com" , "angus@akkea.ca" , "andrew.smirnov@gmail.com" , "agx@sigxcpu.org" , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Cc: dl-linux-imx , Arnd Bergmann References: <20190623123850.22584-1-Anson.Huang@nxp.com> <55abafbd-c010-32b5-6d76-26040830d5b0@linaro.org> <9c017ba9-ac6b-480b-d1f3-120289343101@linaro.org> <8f8aa6e0-5f31-8047-14b5-0e1f65316453@linaro.org> From: Daniel Lezcano Openpgp: preference=signencrypt Autocrypt: addr=daniel.lezcano@linaro.org; prefer-encrypt=mutual; keydata= mQINBFv/yykBEADDdW8RZu7iZILSf3zxq5y8YdaeyZjI/MaqgnvG/c3WjFaunoTMspeusiFE sXvtg3ehTOoyD0oFjKkHaia1Zpa1m/gnNdT/WvTveLfGA1gH+yGes2Sr53Ht8hWYZFYMZc8V 2pbSKh8wepq4g8r5YI1XUy9YbcTdj5mVrTklyGWA49NOeJz2QbfytMT3DJmk40LqwK6CCSU0 9Ed8n0a+vevmQoRZJEd3Y1qXn2XHys0F6OHCC+VLENqNNZXdZE9E+b3FFW0lk49oLTzLRNIq 0wHeR1H54RffhLQAor2+4kSSu8mW5qB0n5Eb/zXJZZ/bRiXmT8kNg85UdYhvf03ZAsp3qxcr xMfMsC7m3+ADOtW90rNNLZnRvj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UWV9nUP92zpyByzd8HkRSPNZNlisU4gnz1tKhQl+j6G/l2lDYsqKeRG55TXbu9M LqJYccPJ85B0PXcy63fL9U5DTysmxKQ5RgaxcxIZCM528ULFQs3dfEx5euWTWnnh7pN30RLg a+0AjSGd886Bh0kT1Dznrite0dzYlTHlacbITZG84yRk/gS7DkYQdjL8zgFr/pxH5CbYJDk0 tYUhisTESeesbvWSPO5uNqqy1dAFw+dqRcF5gXIh3NKX0gqiAA87NM7nL5ym/CNpJ7z7nRC8 qePOXubgouxumi5RQs1+crBmCDa/AyJHKdG2mqCt9fx5EPbDpw6Zzx7hgURh4ikHoS7/tLjK iqWjuat8/HWc01yEd8rtkGuUcMqbCi1XhcAmkaOnX8FYscMRoyyMrWClRZEQRokqZIj79+PR adkDXtr4MeL8BaB7Ij2oyRVjXUwhFQNKi5Z5Rve0a3zvGkkqw8Mz20BOksjSWjAF6g9byukl CUVjC03PdMSufNLK06x5hPc/c4tFR4J9cLrV+XxdCX7r0zGos9SzTPGNuIk1LK++S3EJhLFj 4eoWtNhMWc1uiTf9ENza0ntqH9XBWEQ6IA1gubCniGG+Xg== Message-ID: Date: Thu, 27 Jun 2019 12:27:37 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Anson, On 27/06/2019 10:11, Anson Huang wrote: > Hi, Daniel > >> On 27/06/2019 02:43, Anson Huang wrote: >>> Hi, Daniel >>> >>>> On 26/06/2019 03:42, Anson Huang wrote: >>>>> Hi, Daniel >>>>> >>>>>> On 23/06/2019 14:38, Anson.Huang@nxp.com wrote: >>>>>>> From: Anson Huang >>>>>>> >>>>>>> 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 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 the optinal clock-frequency to the device tree bindings of the >>>>>>> NXP system counter, so the frequency can be handed in and the >>>>>>> of_clk operations can be skipped. >>>>>> >>>>>> Isn't it possible to create a fixed-clock and refer to it? So no >>>>>> need to create a specific action before calling timer_of_init() ? >>>>>> >>>>> >>>>> As the clock must be ready before the TIMER_OF_DECLARE, so adding a >>>>> CLK_OF_DECLARE_DRIVER in clock driver to ONLY register a fixed-clock? >>>>> The system counter's frequency are different on different platforms, >>>>> so adding fixed clock in system counter driver is NOT a good idea, >>>>> ONLY the DT node or the clock driver can create this fixed clock >>>>> according to >>>> platforms, can you advise where to create this fixed clock is better? >>>> >>>> Can you point me to a DT with the "nxp,sysctr-timer" ? >>> >>> The DT node of system counter is new added in 3/3 of this patch >>> series, also can be found from below link: >>> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatc >>> >> hwork.kernel.org%2Fpatch%2F11011703%2F&data=02%7C01%7Canson. >> huang% >>> >> 40nxp.com%7C8b9519ecceb346712be808d6fad675e4%7C686ea1d3bc2b4c6f >> a92cd99 >>> >> c5c301635%7C0%7C0%7C636972196338405582&sdata=sOQQzDFxoCqe >> VuHFuYPHh >>> F8Bdj2Zu9WS7Go%2FV9lrWa8%3D&reserved=0 >> >> Sorry, I was unclear. I meant a patch with the timer defined using a clock as >> defined currently in the binding (no clock-frequency). > > OK, for i.MX8MM, we use clocks, check below patch series: > > https://patchwork.kernel.org/patch/11008519/ > > code piece as below: > > + system_counter: timer@306a0000 { > + compatible = "nxp,sysctr-timer"; > + reg = <0x306a0000 0x30000>; > + interrupts = , > + ; > + clocks = <&clk IMX8MM_CLK_SYS_CTR>; > + clock-names = "per"; > + }; Thanks, The fixed-clock can help to keep the code and the DT definition for the timer untouched as the 'clocks' above will refer to it. But that means we describe a fake clock. So it is up to you to decide if you want to stick the clock-frequency or use a fixed-clock. -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog