From patchwork Mon Mar 22 04:47:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 12153683 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CD7D9C433DB for ; Mon, 22 Mar 2021 04:49:28 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5BC1261930 for ; Mon, 22 Mar 2021 04:49:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5BC1261930 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sholland.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=v9bwgHHENTQVMpLoqO/A+9e+8VRF+2AVxM+6Hiq7BPM=; b=JpVFooOPAxD9BQOYClC8kzgO9 /CHapiL/mI9E8rZF++UpKKZXwi830PfjRL1AEWrIQxW01moQwApNFM62bdd4rWSABCJ0Vo5rNa7qW 1fouq0tIUeXy7xE2eytuc340PRqvnpXgMFMw3NuZ0EbkQ0RWME8xaKHa0BoZA/PfpyfGjO4RVCWbf QxiExPk+0F960UGVKdYLVnRuMb9dL+5VtzUsj5vvRbEd7vHXgX1WEXe6zo9NmHber9SlaH+TEFNFM KosYQmJaHxGGpXUhUXFzEGVuYJ3+GYTT0hB54hzn8FPmzphLq1bOc7o6vsAhyoKP+NMVvRcXe9hGK Qe3SZ3ybg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lOCTW-00As5N-1J; Mon, 22 Mar 2021 04:47:34 +0000 Received: from new2-smtp.messagingengine.com ([66.111.4.224]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lOCTG-00As1A-Kq for linux-arm-kernel@lists.infradead.org; Mon, 22 Mar 2021 04:47:22 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.nyi.internal (Postfix) with ESMTP id 52381581B0E; Mon, 22 Mar 2021 00:47:11 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 22 Mar 2021 00:47:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=zVvRScYqkYw0i iQoV9fFJJZCE1ioY/h9YnzWp/1T1Jg=; b=pZslr0lKkydtv0S2keiG8Yvbbf6Td XfNeSN2Mt68zhxQ556O1GJTy3NdGrQCQbeODEc3V4Uw2LV655d083rnp+XZ/Q9cm 7D4F1T4ko+1UIO4ARnoL0l5QQcrxZCTxVbpc3uKKMJ/ADhCawfJu4g0THG6B9hR/ ZSFpc2b1/P/ODGMqb+9dZvtNMmxSzb3+xIv/P/Pw4YRKaYOFvcoaX9zZ/BcWyp6L CPvxU5ZVLgruNB+TbGjjYAEcNLQVtMHHFaG5BiqabNShbMZ/Wqzfxv0OiZtnmzh4 qfcBk5e+lt3aaDEbuHfHzS/WYge5XstQUC6DQ4o1WHvbFnmQ9Y3epO54A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=zVvRScYqkYw0iiQoV9fFJJZCE1ioY/h9YnzWp/1T1Jg=; b=uGkqQXs6 OD4q15+TcNuFZUPQJT5G3L4LBLlwnWIBwiXjYwhUA8s+NBozmT5EYJXKzwXlSspj ysaIhoyW8ACY3u4g4Dg6bFBvW+1Cc1FKholemx81iPDYg+2Bs0+rYjaOwusXSbWE SIC7HLR913/tpIWDRn4uKt88qD6zQu77Zka8nNZHqyXvX/C9tqZ+jHoyYp/tyVPb 8WP3RZxYOk7b0SMzPBFSxpbmnDouBSCywV8ttvz4d4EEBc0B9QHrYZgvq7QHRTDc oqHEEs27aIvQh8LQ8OmIX9OqZdg+enySK+VRVf2Pnp5nkLpVfPRZj6WkVLqt2Vbw B5sgP6AfR60J+A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudegfedgjeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf frrghtthgvrhhnpeduhfejfedvhffgfeehtefghfeiiefgfeehgfdvvdevfeegjeehjedv gfejheeuieenucfkphepjedtrddufeehrddugeekrdduhedunecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepshgrmhhuvghlsehshhholhhlrghn ugdrohhrgh X-ME-Proxy: Received: from titanium.stl.sholland.net (70-135-148-151.lightspeed.stlsmo.sbcglobal.net [70.135.148.151]) by mail.messagingengine.com (Postfix) with ESMTPA id 97FBF1080068; Mon, 22 Mar 2021 00:47:10 -0400 (EDT) From: Samuel Holland To: Daniel Lezcano , Thomas Gleixner , Rob Herring , Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , Catalin Marinas , Will Deacon Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Samuel Holland Subject: [PATCH v2 4/5] arm64: dts: allwinner: Add sun4i MMIO timer nodes Date: Sun, 21 Mar 2021 23:47:06 -0500 Message-Id: <20210322044707.19479-5-samuel@sholland.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210322044707.19479-1-samuel@sholland.org> References: <20210322044707.19479-1-samuel@sholland.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210322_044719_975216_5B4B2658 X-CRM114-Status: GOOD ( 13.35 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org For a CPU to enter an idle state, some timer must be available to trigger an IRQ and wake it back up. The local ARM architectural timer is not sufficient, because that timer stops when the CPU is powered down. The ARM architectural timer from some other CPU can be used, but doing so prevents that other CPU from entering an idle state. For all CPUs to power down at the same time, Linux needs a timer which is not tied to any CPU. Hook up the "sun4i" timer so it can be used for this purpose. It runs at 24 MHz, which balances resolution and power consumption. Signed-off-by: Samuel Holland --- arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 9 +++++++++ arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi index 9cac88576975..c89032dfb316 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi @@ -798,6 +798,15 @@ uart4_rts_cts_pins: uart4-rts-cts-pins { }; }; + timer@1c20c00 { + compatible = "allwinner,sun50i-a64-timer", + "allwinner,sun8i-a23-timer"; + reg = <0x01c20c00 0xa0>; + interrupts = , + ; + clocks = <&osc24M>; + }; + wdt0: watchdog@1c20ca0 { compatible = "allwinner,sun50i-a64-wdt", "allwinner,sun6i-a31-wdt"; diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi index 49e979794094..01884b32390d 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi @@ -271,6 +271,15 @@ cpu_speed_grade: cpu-speed-grade@1c { }; }; + timer@3009000 { + compatible = "allwinner,sun50i-h6-timer", + "allwinner,sun8i-a23-timer"; + reg = <0x03009000 0xa0>; + interrupts = , + ; + clocks = <&osc24M>; + }; + watchdog: watchdog@30090a0 { compatible = "allwinner,sun50i-h6-wdt", "allwinner,sun6i-a31-wdt";