Received: by 10.223.185.116 with SMTP id b49csp3371249wrg; Tue, 13 Feb 2018 01:19:21 -0800 (PST) X-Google-Smtp-Source: AH8x227haiVNttnbbM2xz+C38OZD24OIdQuOSpw6zKyw6ISL9WI//YFQnKBuUYrqGRSPLiG9ak4H X-Received: by 2002:a17:902:3084:: with SMTP id v4-v6mr521602plb.131.1518513561539; Tue, 13 Feb 2018 01:19:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518513561; cv=none; d=google.com; s=arc-20160816; b=KUlgZvtvtC6S4rOmCR74UmYUIAfSqKrUKGxJEgZOavfVCPv4F7qmALjex7o7DVc6zU OTD+DhzU3ka9Ocn1+w8X7r2ssJbPhz31tv8vTgQNVzudTdDU6iLZaSmWFo2klhaDonUK uVMesYEq7fYizjndtuO7Q9MwckMHYyBm/KlcxLqnyiFPSjy2p3ofPaTobxl89WRoSXWH Pgt6UY6SwOKrEi5sInG16YeA8o8w5hqQXVp3VxsCee4EHT/ikyoyecDThv0ZzmO4NwG8 21gO0A56hAK/v9M2x9nEhoLe4NPjWlq6R1OUiUfneglEVQwfatYo4qp9fhputG34yBtR xvag== 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 :dkim-signature:arc-authentication-results; bh=oPibUifhk+3mqFA129iZtOfeuI/+kkgohuLOwFOjYmE=; b=MdoFzNFZiZMeNZpeiWaiMOE0zfMKuJgCp/1/a+SsyO+AyYteyK9rnMM+wN3uaUhwSB D1iXqXN9WL92Uo9sc4QVO8OiEeJSVWPWi+UP2VUiuDUIXOEBypyXWr/YQl/aBMtmC/cS 7hxijogmUhM1FiBjsv/lCgyDkvv67iLglUthk5qhCe1AYG6zdbOVRWjVXhCAXh9if5VT ZDGy3OcC6UNz163r+UI4sdb7LDh48KYmTw4rO4J/0Dz2aBXMXUX2IV0Ar3sQjZarWST3 LYba0xWgX385NTV3ZAWPKc3oHyatpON1cXgabZcJAleUNARQVsy5MrM2372SdIOqOlmA hWLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=f5csiQjP; 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 61-v6si2294100plq.737.2018.02.13.01.19.06; Tue, 13 Feb 2018 01:19:21 -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=f5csiQjP; 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 S934499AbeBMJOE (ORCPT + 99 others); Tue, 13 Feb 2018 04:14:04 -0500 Received: from mail-pl0-f68.google.com ([209.85.160.68]:33954 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933494AbeBMJOB (ORCPT ); Tue, 13 Feb 2018 04:14:01 -0500 Received: by mail-pl0-f68.google.com with SMTP id bd10so1519175plb.1; Tue, 13 Feb 2018 01:14:01 -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; bh=oPibUifhk+3mqFA129iZtOfeuI/+kkgohuLOwFOjYmE=; b=f5csiQjPzHN/FTiXKwqcwtVtck+jIyCZYppR3VkZWq8whNwxbTGwCRj49O9EjaUCCy QHP5Ci06zaCa7WmNuAzCI5KgKkfpmq8AcY9MtFmAjvpVZTtxnBzvM9Sh+5gFB58+m4Pa +blktS4V06tYJb+2U1inrobdFUiBscExhq1nrnAI1p9lZ6XZ1u9Zd2LWLLAdrUBrxHH3 +3AICQ31/tXkaCXDuyzRbGQhpmW2o26ogQnBeVgoXO4uanp9/XKHB/erdPM8BQjMJMIA zvJp2JfhGvEBItvJt19nan+gSY7eUOlPpBa+TEykocFsZMeHLZfNKKw7udAVYoWyJbfh HNtA== 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; bh=oPibUifhk+3mqFA129iZtOfeuI/+kkgohuLOwFOjYmE=; b=JJnCCnd9gCn9F4gyteCrjGVMcohSzwTHUf66MQ9jr6g+e09dSxz6urYekI0YRUYawB x5cqZgHiUWX4pU8UTVCEMZzPqt6VuMwmG6EytFaD3g2ZFgBg4KmT6v7dBfeySsoIY7ks cmobUkvuve19HPLPPuPFfn48+zgwefSgr/drmembwHJhHybqIaud+TTQyZuU88QO/P8E b2jxRF+cllVGc18tOIbZbLES0njiropK6F0Agha/jeiyFxpAFswWE5vm34nljuwNdQW+ sQgQmN4qfN1vM/TPSbNwkn/Oci3GXVm+ppd9OKSoxi5VK8chwCfTc6gVaSYT5lvTndSp 873Q== X-Gm-Message-State: APf1xPBVTcKbj+Uppw7H2Wa8hAExlKZg14cX7s1xqKNKJKg1cptE5Anz xEGiaOFQxK1ToMYXSoXYHEw= X-Received: by 2002:a17:902:6b82:: with SMTP id p2-v6mr537394plk.30.1518513240726; Tue, 13 Feb 2018 01:14:00 -0800 (PST) Received: from app09.andestech.com ([118.163.51.199]) by smtp.gmail.com with ESMTPSA id o7sm23288007pgp.18.2018.02.13.01.13.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Feb 2018 01:14:00 -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: green.hu@gmail.com Subject: [PATCH v7 0/3] clocksource/drivers/atcpit100: Add andestech atcpit100 timer Date: Tue, 13 Feb 2018 17:13:16 +0800 Message-Id: X-Mailer: git-send-email 2.16.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, all: ATCPIT100 is often used on the Andes architecture, This timer provide 4 PIT channels. Each PIT channel is a multi-function timer, can be configured as 32,16,8 bit timers or PWM as well. For system timer it will set channel 1 32-bit timer0 as clock source and count downwards until underflow and restart again. It also set channel 0 32-bit timer0 as clock event and count downwards until condition match. It will generate an interrupt for handling periodically. Changes in v7: - Fix atcpit100_clkevt_next_event(), before set reload register, clock source timer shall disable. And re-enable it after the setting. Without this modification, the test case 'clock_nanosleep02' of ltp_20170929 will fail. Changes in v6: - To select TIMER_OF in drivers/clocksource/Kconfig instead of arch/nds32/Kconfig - Refine Kconfig - Update license format to SPDX-License-Identifier Rick Chen (3): clocksource/drivers/atcpit100: Add andestech atcpit100 timer clocksource/drivers/atcpit100: VDSO support dt-bindings: timer: Add andestech atcpit100 timer binding doc .../bindings/timer/andestech,atcpit100-timer.txt | 33 +++ drivers/clocksource/Kconfig | 9 + drivers/clocksource/Makefile | 1 + drivers/clocksource/timer-atcpit100.c | 266 +++++++++++++++++++++ 4 files changed, 309 insertions(+) create mode 100644 Documentation/devicetree/bindings/timer/andestech,atcpit100-timer.txt create mode 100644 drivers/clocksource/timer-atcpit100.c -- 2.16.1