Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp1321853ybd; Sun, 23 Jun 2019 05:03:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqyKgTpqQ96YjaqjvVweoNbbf4OQ7Q0YaRUvxA8fAw4olXObdvg0Jucitz1x8jnBChK39g5p X-Received: by 2002:a63:78c3:: with SMTP id t186mr28570745pgc.340.1561291433921; Sun, 23 Jun 2019 05:03:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561291433; cv=none; d=google.com; s=arc-20160816; b=PmptCf61sHNl9IS8/q6XaLxdn+65xQESL4ww0K6WVuMsAXPLmeYZ3PVfZP9e11cXUA HJOBtn1PGQiqL6eoTWLpLUykmKoy/+ZxSUSEtgfWb5y+rPwuLw0R/EfRB/dbiyd1CriF SnWgW55YzxnWR/h8lJxOIHmwo3LZeuISosFW9/jUl8zzmi0wMQl6t9do0Sc8lHFqPiXP sOC61SVPPjEpWEg8ciJ4cM+qTm1p4ljCq6CeUhiRPLM+mtuGusARjBUc03jPBaugs36S MP2GDPgNcgmIMGC9sZB3qV7ljBj7OjRrYtdJ59KZWb4jB/igfXf1ZyIMWojRD7vATgJJ Tk8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=MGVA+4WSZLuA+ttRx/LgUSg+/+taUY9nu83624p4c3k=; b=YLjKVqOV0cvvUWJhMUJC1L0hUMKd9ccNEm40+N0ErRpXKERne0vJJUfDdSQ8kMoR+m /+8PaZ9BBHkVgsA32w09hHM9jWK5PVHz+Zxd+Tot0Aav7XJ1z4tmJ91P2KtFA496JnfA +VfcMqkFTvpSdCMg1OAa39clw1pz63XURQa3frloL89S0DnDsikZesfLYuUw6F0HgeLH OfFqs+y5oAh21fe4g+1h/ku/Orr7nDWtsBflQjsW7KxkJY//NY81pgFNNY3mJm8s582E Mfokiwf9eHQ+VqT0WSP6qfUWzFyWvVZhdz2kfBP+elvYVb8Td0vOt6RGJAai/cI7XZy+ VseA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cf7si8264666plb.435.2019.06.23.05.03.35; Sun, 23 Jun 2019 05:03:53 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726650AbfFWMC4 (ORCPT + 99 others); Sun, 23 Jun 2019 08:02:56 -0400 Received: from inva021.nxp.com ([92.121.34.21]:54208 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726535AbfFWMCx (ORCPT ); Sun, 23 Jun 2019 08:02:53 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id B5DF12003BB; Sun, 23 Jun 2019 14:02:51 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id C6AEB200277; Sun, 23 Jun 2019 14:02:42 +0200 (CEST) Received: from mega.ap.freescale.net (mega.ap.freescale.net [10.192.208.232]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id D96E14030C; Sun, 23 Jun 2019 20:02:31 +0800 (SGT) From: Anson.Huang@nxp.com To: daniel.lezcano@linaro.org, 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@nxp.com, 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: Linux-imx@nxp.com Subject: [PATCH V2 2/3] clocksource: imx-sysctr: Add of_clk skip option Date: Sun, 23 Jun 2019 20:04:33 +0800 Message-Id: <20190623120434.19556-2-Anson.Huang@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190623120434.19556-1-Anson.Huang@nxp.com> References: <20190623120434.19556-1-Anson.Huang@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Anson Huang On some i.MX8M platforms, clock driver uses platform driver model and it is NOT ready during timer initialization phase, the clock operations will fail and system counter driver will fail too. As all the i.MX8M platforms' system counter clock are from OSC which is always enabled, so it is no need to enable clock for system counter driver, the ONLY thing is to pass clock frequence to driver. This patch adds an option of skipping of_clk operation for system counter driver, an optional property "clock-frequency" is introduced to pass the frequency value to system counter driver and indicate driver to skip of_clk operations. Signed-off-by: Anson Huang --- No change. --- drivers/clocksource/timer-imx-sysctr.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/clocksource/timer-imx-sysctr.c b/drivers/clocksource/timer-imx-sysctr.c index fd7d680..8ff3d7e 100644 --- a/drivers/clocksource/timer-imx-sysctr.c +++ b/drivers/clocksource/timer-imx-sysctr.c @@ -129,6 +129,14 @@ static void __init sysctr_clockevent_init(void) static int __init sysctr_timer_init(struct device_node *np) { int ret = 0; + u32 rate; + + if (!of_property_read_u32(np, "clock-frequency", + &rate)) { + to_sysctr.of_clk.rate = rate; + to_sysctr.of_clk.period = DIV_ROUND_UP(rate, HZ); + to_sysctr.flags &= ~TIMER_OF_CLOCK; + } ret = timer_of_init(np, &to_sysctr); if (ret) -- 2.7.4