Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp218624ybb; Tue, 31 Mar 2020 21:35:52 -0700 (PDT) X-Google-Smtp-Source: APiQypIAwfiUlCyImL+fuH5/9sdhyBijOaMQhxje//pk5LJMxKalsjMK2ciJiUk7UJ5WPJqNqccS X-Received: by 2002:a05:6808:495:: with SMTP id z21mr1612536oid.30.1585715752656; Tue, 31 Mar 2020 21:35:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585715752; cv=none; d=google.com; s=arc-20160816; b=XtFXps6cWHD6cn8CjzpvBAoih9SI8CIPNBEHCRGgQLnJNDfGMrp/9jcsWa5XZsVnWb OFPSbNxJSe9AXKqCrn0nbkwvHHXJE0xmJiOEw3uxngxWFFrEPCWohsim+M+Qp8gfAv2d 3RivIUJJKnAqLKP9eQPZmA08DGD2HmhuZFWHQH/DCz8EapouK0y+wd9iDjpzZhAoxhpZ AzbZk1zlHIM7gC95EV27+WjjPDokSxdyxQosHBFTjAQS9MErgZitD8tTTonPZAhlfypZ LoS1PndwguIQVsV2M0UDH4LiEpr7GPU2pfQv3/XJDWZhG6IzQgbgDYB9+0Ta3Oa9My4M tPiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=4MMNG41BDHB8exad93FbVRX9D26UibDtBNyM1+V2/C0=; b=XP2nY+TgB7kr9tDCCyv4RxwNcxvBcrPhR4j8veAncjfSJOPMgZ2NAAUD3tW5/mU4Sx P0ehNrPnlnReRXPzubuelZbAjpipUKrg43FBBcJxBawzuSxmH1n0GjFChIp+GUgSd7Bw 3dwZiwGH6TL3ukQVMtJi4xNq7lbAql3XRglsh+Np8FTlRs0vJwENL1xiCskbWJ8trNo+ v85LBhtArcdhYIHMyW+ynLnxuJTinpZqSAzvDGZeiATm1OX9dxN8rM9bgLJzqGDNKpOu kCAtGB8JBRUY/57Ph9G9fcDicSNZBYJ4beOq8AWMUMkU4XzhdFnujgCKIDzh+jud6fWa DlKQ== 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 z11si392299oih.253.2020.03.31.21.35.34; Tue, 31 Mar 2020 21:35:52 -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 S1727412AbgDAEeg (ORCPT + 99 others); Wed, 1 Apr 2020 00:34:36 -0400 Received: from inva020.nxp.com ([92.121.34.13]:37018 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726125AbgDAEeg (ORCPT ); Wed, 1 Apr 2020 00:34:36 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id D75D41A0C60; Wed, 1 Apr 2020 06:34:32 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 0448E1A0C68; Wed, 1 Apr 2020 06:34:28 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id B6DD74024E; Wed, 1 Apr 2020 12:34:21 +0800 (SGT) From: Anson Huang To: daniel.lezcano@linaro.org, tglx@linutronix.de, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Linux-imx@nxp.com Subject: [PATCH] clocksource/drivers/imx-tpm: Add support for ARM64 Date: Wed, 1 Apr 2020 12:27:02 +0800 Message-Id: <1585715222-24489-1-git-send-email-Anson.Huang@nxp.com> X-Mailer: git-send-email 2.7.4 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 Allows building and compile-testing the i.MX TPM driver also for ARM64. The delay_timer is only supported on ARMv7. Signed-off-by: Anson Huang --- drivers/clocksource/timer-imx-tpm.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/clocksource/timer-imx-tpm.c b/drivers/clocksource/timer-imx-tpm.c index 6334a35..2cdc077 100644 --- a/drivers/clocksource/timer-imx-tpm.c +++ b/drivers/clocksource/timer-imx-tpm.c @@ -61,17 +61,19 @@ static inline void tpm_irq_acknowledge(void) writel(TPM_STATUS_CH0F, timer_base + TPM_STATUS); } -static struct delay_timer tpm_delay_timer; - static inline unsigned long tpm_read_counter(void) { return readl(timer_base + TPM_CNT); } +#if defined(CONFIG_ARM) +static struct delay_timer tpm_delay_timer; + static unsigned long tpm_read_current_timer(void) { return tpm_read_counter(); } +#endif static u64 notrace tpm_read_sched_clock(void) { @@ -144,9 +146,11 @@ static struct timer_of to_tpm = { static int __init tpm_clocksource_init(void) { +#if defined(CONFIG_ARM) tpm_delay_timer.read_current_timer = &tpm_read_current_timer; tpm_delay_timer.freq = timer_of_rate(&to_tpm) >> 3; register_current_timer_delay(&tpm_delay_timer); +#endif sched_clock_register(tpm_read_sched_clock, counter_width, timer_of_rate(&to_tpm) >> 3); -- 2.7.4