From patchwork Sun Oct 28 12:54:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 10658593 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 349B113A4 for ; Sun, 28 Oct 2018 12:55:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2140328387 for ; Sun, 28 Oct 2018 12:55:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1504D28505; Sun, 28 Oct 2018 12:55:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 955C928387 for ; Sun, 28 Oct 2018 12:55:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=EZoMhhtLfAJLfZad/3iDIlnTy/z/s5WycvDYS9VWy6I=; b=AbjFJwh7HDh8Iu LNmTFQPMM19Ng0POLkFh2wheFUw0TVmAO3NGLKyEzE+eh+KsgZCvSmBmnMdhDLfgdZ01LBzJ9FpI6 lU7IHeOitX5uRHE2Fl+Pqlsw69RoT0WlpRPXA7krLTc1lwA4b75pYtDjcAJxDenLls4QFP/N7GR0p mWdfLz0s7KC07Lhf2ZR8+Bv93DheCFTT1NONdObHRjgPYYchI7nCac6ysVLYBZSvThpEij+c3YmZd kt3BZeu3NgaoMguFcRdLBDxWf2ro3vP3a+fsKCQ/FOJ70MvlGSd5uDgsxviOA12ADP//s5fPN5q+q ofP0BZg22pYYqjkcnBRQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gGkbN-0002rw-Q4; Sun, 28 Oct 2018 12:55:33 +0000 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gGkbG-00027O-Gi; Sun, 28 Oct 2018 12:55:28 +0000 Received: by mail-wm1-x342.google.com with SMTP id q12-v6so2657047wmq.0; Sun, 28 Oct 2018 05:55:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=CI9NYKk9rl68vxziy4NzAMYLc4EmvVK+7lxE5tB43e4=; b=SECS7dEzzmF+awYfKj8XPiHpVOBNBVzJKS4QFWHVCrWwyaojnQTdGOG1NdNlIsLi2M 1ch9Kh0OMfystAIE2vVWaj87eDSrjnzE/0PZcMqz60J7dC2HknOQIESFKJx469+huOma OBraJK81azAPPunuxlcMviXqVHJtQrmDeYyhrInQhHnmWAAb/IpsCY+3p2wIZyX4g/4P XZsVbFKiuh2Y5Dzped7riKE6EKdyOdke6CR3TUComP33bJnKtWd7mV6GJ3Wz2FHAGGab mCqw7A1+lnYUShMXtJ8IyWA0HFzewLxWWfaHZIKSO3CINyWjmAoDSPcP6i80/V+7GhLK yIkQ== 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:mime-version :content-transfer-encoding; bh=CI9NYKk9rl68vxziy4NzAMYLc4EmvVK+7lxE5tB43e4=; b=C4fcMa4C/pSygU0KddoPNa65BKROpD/Pz5K0N3f2ZkWT7lRbJqgU2d6jp6k9JnLfXA dxBrFH+4MdSz/wjyKTY7fXEPBf9Fhd2qbuY9oxgK0Qy3ffXj+9hxxirFU7ymyzQBNxzF Of+GMEo30gXFqrPyeajtmS8IVCIgihFdgsb8euUeZA0pEiQJcu/YiNV5PboIyk8fKGHI SsfUl7/8PWQapYMJx6ejDzk+rDcChQdFEsSV4aRY3BpuibwtGAfX/caXePcfj5h076IV LO32n6tnWBr2BZe83/SXCW1bQIL3q6LkxaMdOvPiMnhSi8OAcee1je9gyzGM8UgGkEFV hQvA== X-Gm-Message-State: AGRZ1gIFucuJ2SgCEns9hc3bvw4PuTCN0ZGYbG9pYoqAu2Aj0ouoTGGg y18L53o587xykGLRABQo+Cs4+bPm X-Google-Smtp-Source: AJdET5cwMQD01YlqUcvEw3ssztU/711DMtzQYCnbr18KKWy/EteNb/ccQztxuF27JjJ3W2Sw9qKusQ== X-Received: by 2002:a1c:8015:: with SMTP id b21-v6mr3825443wmd.60.1540731314319; Sun, 28 Oct 2018 05:55:14 -0700 (PDT) Received: from blackbox.darklights.net (p200300DCD7072200691979D1FB980407.dip0.t-ipconnect.de. [2003:dc:d707:2200:6919:79d1:fb98:407]) by smtp.googlemail.com with ESMTPSA id u10-v6sm13759388wrt.59.2018.10.28.05.55.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Oct 2018 05:55:13 -0700 (PDT) From: Martin Blumenstingl To: linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, daniel.lezcano@linaro.org Subject: [PATCH 0/2] clocksource/meson6_timer: implement ARM delay timer Date: Sun, 28 Oct 2018 13:54:59 +0100 Message-Id: <20181028125501.17336-1-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181028_055526_585973_2B219419 X-CRM114-Status: GOOD ( 10.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: carlo@caione.org, khilman@baylibre.com, Martin Blumenstingl , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP While trying to add support for the ARM TWD Timer and the ARM Global Timer on Meson8, Meson8b and Meson8m2 (ARM Cortex-A5 and Cortex-A9 SoCs) I did a review of the existing driver. Unfortunately I found it hard to review because the pre-processor #defines did not match the names from the public S805 datasheet. Thus patch #1 adjusts these. No functional changes here, this is just preparation work for patch #2. Using the ARM Global Timer (drivers/clocksource/arm_global_timer.c) would have given us a timer-based delay implementation (so udelay() and friends would use the timer instead of using a loop-based delay implementation). Unfortunately we can't use the ARM Global Timer yet because it's input clock is derived from the CPU clock (which can change once we enable CPU frequency scaling on these SoCs, for which I will be sending patches in the near future). Amlogic's 3.10 kernel uses Timer E as delay timer which (with the current configuration) has a resolution of 1us. So patch #2 uses register_current_timer_delay() to register Timer E as ARM delay timer (which will be especially useful as we have to use udelay() when changing the CPU clocks during DVFS). Martin Blumenstingl (2): clocksource: meson6_timer: use register names from the datasheet clocksource: meson6_timer: implement ARM delay timer drivers/clocksource/meson6_timer.c | 130 ++++++++++++++++++++--------- 1 file changed, 89 insertions(+), 41 deletions(-)