Received: by 10.223.185.116 with SMTP id b49csp3371394wrg; Tue, 13 Feb 2018 01:19:31 -0800 (PST) X-Google-Smtp-Source: AH8x226ThhZy0LvCA7V1Dm6Uwc8x2o2gcgV72o8csxFRe7rIr8nYXj3f93udmO9dedZZXhXAgHv2 X-Received: by 2002:a17:902:1486:: with SMTP id k6-v6mr537039pla.376.1518513571738; Tue, 13 Feb 2018 01:19:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518513571; cv=none; d=google.com; s=arc-20160816; b=R4Kw9GaDcqmKQVMbJIfDhQD+CsbLJOoK28M6I87Ft8sZSQvQTViQQluW2sylFO0jvE L9UNfW12Gjah8cR89PteVRPLxcbYa7EjyAzG3x0i/bovKklzyb9JkmTklFKrOXrQ3GlE WW5i+6os1GyOO2t311yqSiObEI0oF2Ot9z4Gg5CvVa7S0mESVEsVozdIGZoXJSb6nd8K OUw1Wo+Q0rtlYLoX0TUbRCLOa0kxBPo5mtmLfRnZkesGrPyTSgSf5Fd97xBqAeCJ/KZM IwppnM1iZ7/VH9nDkYk7rZjJ4F+si6jHO0zpHxRTP3k92TkgswAt+xeyWRtaB0G3DleE Td1w== 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:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=zLVet+OWhr997Wwul3+mbiHPuceMesvlfi3Ik7QpOQk=; b=FuMj2bsQhsnZedBXKlvWv04YUWWeLaaX1C1SOH1ZcYH1Ed9gazneSlNYI+k1LXruS1 KN3dr4UxhjsSEgUfeDaFhdPAKIYbIJknIJWPyRF9RDhCiL1fs6hrjAeAzLnCbUzjPNP4 bGLwbxPZbRvPtyGrB1Bm1kq/lbrOcBDBpq0Ro7jH7Int2YSc1va/xeg/3qR7Nq6kX4rr rxFTtYq29PfT+M7QGGqcJeUnVyHczXHS6G1zfKu7V0lLsamzGtWz8rLS59jLenWiCD3U 0yKZBLBCfWab0eE9b1C75psssjSutdtzkdqbPfitekeewHquKf7hNv7/0E2AVBvYm8sT UAYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ihDMITE+; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d9si1264038pfb.104.2018.02.13.01.19.16; Tue, 13 Feb 2018 01:19:31 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=ihDMITE+; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934599AbeBMJQz (ORCPT + 99 others); Tue, 13 Feb 2018 04:16:55 -0500 Received: from mail-pl0-f67.google.com ([209.85.160.67]:44327 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934504AbeBMJOL (ORCPT ); Tue, 13 Feb 2018 04:14:11 -0500 Received: by mail-pl0-f67.google.com with SMTP id f8so6351822plk.11; Tue, 13 Feb 2018 01:14:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=zLVet+OWhr997Wwul3+mbiHPuceMesvlfi3Ik7QpOQk=; b=ihDMITE+Nq8tuL08yK4i2ala9IyXUlKjr4tocFvMqh7mFmvr9I2zoIpkwUF+tNSVzR sa41R0WzdhtuDyVj+6r3OLgjUIaZhJrJa031SxWTFYT9aFBZVlrPGssdPTyGkgBY0DL2 cuSfnw/17xcmHeRUCsYpPBvivAh7Joh2gfgh7Jy253jAOrW/qb8+z7pnmfiv2jwW0l1b V/+U2EIDdXED3+LkOKOKDZ5BovPg0uuXeu8z33e1lmBnIOZBU59V3mefSUOMeyONi8TV xRx3T+86G8cp+WDm7VRfqQ5JBff3zS11Htn5nmVMwfj2HZ3+ZTrOtH2VIZcx7xgCQFGt p4mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=zLVet+OWhr997Wwul3+mbiHPuceMesvlfi3Ik7QpOQk=; b=ljvc07gTEgRPfBmWugbeD6TolYLpBzNMCQCYLwqdyfQuSEMKxDWVxLHXqs4stAmeVT Yqm5BPxY6+aHJIY1hf8eUO0OKy34ZfoQBSA6enDqB7U6TdoB9/3FZS7zQvEmk/PHBwuB ADFLQ7tT5n269Ymgz4QsJVPk/Hd+QmmCs6BCbBzVaF5JtImVGHcMDyYxPDfYErDNeGeG +JS/uRzlJ0kTdoqftT+lNDD6q5GJduTfmuU8z7vG299FDFjJN4J4I3SzeNjn9thRGeHS eVLugVle6BGAfqP9MYC3s7uBBUgcWLK+VSMerjfrBQ015T9Tlyy5unQa6lJ1K+BK/Cw4 osLg== X-Gm-Message-State: APf1xPC1TnPHVKOo8SN8ds278+jRu3ClUJXPyq7TdXv1/5ZmoNHA5jPy ei/FvqJQ40eju/migk6rvV4= X-Received: by 2002:a17:902:3f83:: with SMTP id a3-v6mr489390pld.263.1518513250627; Tue, 13 Feb 2018 01:14:10 -0800 (PST) Received: from app09.andestech.com ([118.163.51.199]) by smtp.gmail.com with ESMTPSA id o7sm23288007pgp.18.2018.02.13.01.14.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Feb 2018 01:14:10 -0800 (PST) From: Greentime Hu X-Google-Original-From: Greentime Hu To: greentime@andestech.com, linux-kernel@vger.kernel.org, arnd@arndb.de, linux-arch@vger.kernel.org, tglx@linutronix.de, jason@lakedaemon.net, marc.zyngier@arm.com, robh+dt@kernel.org, netdev@vger.kernel.org, deanbo422@gmail.com, devicetree@vger.kernel.org, viro@zeniv.linux.org.uk, dhowells@redhat.com, will.deacon@arm.com, daniel.lezcano@linaro.org, linux-serial@vger.kernel.org, geert.uytterhoeven@gmail.com, linus.walleij@linaro.org, mark.rutland@arm.com, greg@kroah.com, ren_guo@c-sky.com, rdunlap@infradead.org, davem@davemloft.net, jonas@southpole.se, stefan.kristiansson@saunalahti.fi, shorne@gmail.com Cc: Rick Chen , green.hu@gmail.com, Vincent Chen Subject: [PATCH v7 2/3] clocksource/drivers/atcpit100: VDSO support Date: Tue, 13 Feb 2018 17:13:18 +0800 Message-Id: <43bd7f8f5379f2c63af9dc0672e19f0e4671d425.1518505425.git.greentime@andestech.com> X-Mailer: git-send-email 2.16.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rick Chen VDSO needs real-time cycle count to ensure the time accuracy. Unlike others, nds32 architecture does not define clock source, hence VDSO needs atcpit100 offering real-time cycle count to derive the correct time. Signed-off-by: Vincent Chen Signed-off-by: Rick Chen Signed-off-by: Greentime Hu --- drivers/clocksource/timer-atcpit100.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/clocksource/timer-atcpit100.c b/drivers/clocksource/timer-atcpit100.c index 2190096cffa3..5e23d7b4a722 100644 --- a/drivers/clocksource/timer-atcpit100.c +++ b/drivers/clocksource/timer-atcpit100.c @@ -18,6 +18,9 @@ #include #include #include "timer-of.h" +#ifdef CONFIG_NDS32 +#include +#endif /* * Definition of register offsets @@ -204,6 +207,17 @@ static u64 notrace atcpit100_timer_sched_read(void) return ~readl(timer_of_base(&to) + CH1_CNT); } +#ifdef CONFIG_NDS32 +static void fill_vdso_need_info(struct device_node *node) +{ + struct resource timer_res; + of_address_to_resource(node, 0, &timer_res); + timer_info.mapping_base = (unsigned long)timer_res.start; + timer_info.cycle_count_down = true; + timer_info.cycle_count_reg_offset = CH1_CNT; +} +#endif + static int __init atcpit100_timer_init(struct device_node *node) { int ret; @@ -242,6 +256,10 @@ static int __init atcpit100_timer_init(struct device_node *node) val = readl(base + INT_EN); writel(val | CH0INT0EN, base + INT_EN); +#ifdef CONFIG_NDS32 + fill_vdso_need_info(node); +#endif + return ret; } -- 2.16.1