From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=54.243.244.52 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796364164; b=vo55nQZ0/32BNmDSzX3wEjDTCQBw69TqesrBDw1NQHRRvHPOYgp3wZI4InUxD3mP7m/v 7g1w2udT5556OxBzKPkUrrkhetYKwpxPOl5BAiuIFHNWe/D+FhSGN5S4f6CAAr5I75nEg KKTN1KRszqFg8IgzqDGh5BThd2/cEXWgSxwWn6WCdiUnmajBTPrshBn5UCThbAIR87y4U pVrqQBnX7fyCqO/HVETSS5D+j+/kDtyj24QIV9mSXU7Xbp78hoqot8fB7oo7I99875tqK ko8CSOfL4rKPS8DiMtO3lc+tT/G9NOr/oAL3Y8SyTwUo4tTu8Kvwvb06SDf+8bZ1rFQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796364164; h=DMARC-Filter:DKIM-Signature:X-QQ-mid:X-QQ-Originating-IP:Received: X-QQ-SSF:X-QQ-GoodBg:X-BIZMAIL-ID:EX-QQ-RecipientCnt:From:Subject: Date:Message-Id:MIME-Version:Content-Type:Content-Transfer-Encoding: X-B4-Tracking:X-Change-ID:To:Cc:X-Mailer:X-Developer-Signature: X-Developer-Key:X-QQ-SENDSIZE:Feedback-ID:X-QQ-XMAILINFO:X-QQ-XMRINFO: X-QQ-RECHKSPAM; bh=sp+QtlPQ5KvPoGDEP8tES3eC0oWKRI1k3mfa9XRlqTw=; b=GHLRDOXrVqiMEjb18jhZl7zVJZudjd9oAYZUCC3Q5tZ46h5sS38bwG2V6gEWyLmzGA31 Gr3joJ6NM/k6YzFx6me6kalRihhbwmEy7TQFYqnphCAzYk+Afq57MlUTpOEg25CAIOlzM eKX7B/o7OMUdsGWeQxKKgidCmZ61sHDtz/Qj8nSjMy8I/l2ZVS/hfgQB1iZm+eK8oLcK2 oaplyWLeKN3PVAuZv/IeyBZCgW1gfc/yPjLKXYQ4DFHWYe8xsr8p/Z1CcsYNWz8MaCC/5 yh0fu8iiUMquWswi0xSuB7vYXlQ12gVedPbKOZysfO+Go611/7KrQOpW/cQngCMbGgw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=linux.spacemit.com; spf=none smtp.mailfrom=linux.spacemit.com; dkim=pass header.d=linux.spacemit.com header.i=@linux.spacemit.com header.a=rsa-sha256 header.s=mxsw2412 header.b=Bx9YCkkr; arc=none smtp.remote-ip=54.243.244.52 Received: from smtpbguseast3.qq.com (smtpbguseast3.qq.com [54.243.244.52]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0F022606A32F; Fri, 4 Dec 2026 06:02:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 0F022606A32F Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux.spacemit.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.spacemit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.spacemit.com header.i=@linux.spacemit.com header.a=rsa-sha256 header.s=mxsw2412 header.b=Bx9YCkkr DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.spacemit.com; s=mxsw2412; t=1796364104; bh=sp+QtlPQ5KvPoGDEP8tES3eC0oWKRI1k3mfa9XRlqTw=; h=From:Subject:Date:Message-Id:MIME-Version:To; b=Bx9YCkkrJ13EUY8ei4JovUVKUWYwZ/FaL2rHNtANrZtqOQrqFWYat8k6c7nJiWTvu k2cUCFVhJdyMZj3MxVM8j1qqbgxi2jgdmrsAwXok3DPbsm1UF48Sg7zDQ8k0lY8bCO TEDpz7Xhw3LH9LwyzsVKRZAUZyvbelAvi1eW5Kvw= X-QQ-mid: zesmtpgz5t1796364097t98b43d28 X-QQ-Originating-IP: xWb/fAQ7k72+MBHNipP1nTTfIzaeLcadzZUMsUJKrEI= Received: from = ( [120.237.158.181]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 04 Dec 2026 14:01:33 +0800 (CST) X-QQ-SSF: 0000000000000000000000000000000 X-QQ-GoodBg: 0 X-BIZMAIL-ID: 11728135844146701181 EX-QQ-RecipientCnt: 19 From: Troy Mitchell Subject: [PATCH v5 0/5] Add SpacemiT K1/K3 SoC timer support Date: Fri, 04 Dec 2026 06:01:30 +0000 Message-Id: <20261204-spacemit-soc-timer-v5-0-c863b6ffc645@linux.spacemit.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAAAAAAAC/3XNTW7CMBQE4KsgrzGyn3/TVe9RdeHYL2BEEmSHC IRydxxQVRZmOdLMN3eSMUXM5GtzJwnnmOM4lKC2G+IPbtgjjaFkAgw0Z7yh+ew89nGiefR0ij0 m6l3oBLM2gNWkDM8Ju3h9oj+/r5wv7RH9tEpr4xDzNKbb83Xma+91wJmoHcycMiq0AZDAQ6vx+ xSHy3X3V935sSfr0wxvFjdVC4rVgJaBoTNGqY+WeLNAVS1RLNSiYZ1wKJ3+aMl/CxivWrJYRtg 2KMc7i75qLcvyAFji6zWzAQAA X-Change-ID: 20261019-spacemit-soc-timer-cadf3088d286 To: Troy Mitchell , Daniel Lezcano , Thomas Gleixner , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Yixun Lan , Philipp Zabel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, spacemit@lists.linux.dev, Iker Pedrosa , Anand Moon , =?utf-8?q?Fr=C3=A9d=C3=A9ric_Mah=C3=A9?= X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=3120; i=troy.mitchell@linux.spacemit.com; h=from:subject:message-id; bh=0/Vm09bzo+n4cbXF+/sJDz58gEqB77mfc/BSLO6jWc0=; b=owGbwMvMwCU2g/N9w09jE33G02pJDNlC4TYM7IelmXd9uRG2RqK9W+3XuoKcnwq+Z05faFvL8 eTSvNb/HaUsDGJcDLJiiizdD3i2FfhE2RYIFPrCzGFlAhvCxSkAE/m3juEPr42E+/sg9cr18kcl vtlNFzkrfWjOJdXdF7It+Z02H186keF/ZvbuX3Vh9TLvVze8v7b8elNKxY2eygcNVcbCjx5JCC7 kBgA= X-Developer-Key: i=troy.mitchell@linux.spacemit.com; a=openpgp; fpr=3FE5535CF1B0E658E57DB59BAE1C2FBEA7DB42E1 X-QQ-SENDSIZE: 520 Feedback-ID: zesmtpgz:linux.spacemit.com:qybglogicsvrgz:qybglogicsvrgz3a-0 X-QQ-XMAILINFO: Oe8h3eEiaLAOBo+Ad/eEa9BH0gzF2DbsMk8osZDsy5HAc7gvD6hn0rDJ jxH3puenjqnrsaKtL54bsbZnoZs+I5t13edt5aOtP+P+nFfP9Xp/S09+qb2GY/mJhcsZlaq KI2Bf8Iko9GFIt4BDcEFxIfnealdrFEXUS1LnTuinpkeZGM1P6/mKChlHbJ8Y3qaYinu0UC Aj0cMgXHsnSzErcCy03NOlIvmVf8fBICXCFJur+OAbvdm033JEOpjcM3R9Ff7ZSAST/NQeT cuKKWnweKRpdiaSFSnANH1LaEPXfKU/KKyOag/S3aS/U80yGNGw6LGEfUqAjTa0Nbsr0X7q UjRzhTkRA+ba9vIkcD4ByslZeAa1dzCJBI0rxYjehYqi828hHGl9iL/ANqha/aQiwrHmgPI QX8kLgSaiaOCjw1KlRl+44rTe+EGtpsg2t5Ji6VU0E2/TMjG4yv9lShrEMu6Ad/qbVWHInr rFk9jPRk/KwQaa0CT7crtlEgJutmyr4A3raydZUVSQi6KKsdKvDY4Y3CivisvEVqKGjwLef N65Vho/Jj7kgWLn67n5W0PY7SNwZRBBPvpAQZwTt9J6BLep/EPCHvQUhI7I7kT/eDNUs4q/ iKEIt6X3MKUXDPmPaUSXcIgJ/PTyN5p9mGjRQyI5hIh4MTOJ2mfgeC/0Y43IFplXaj4dVPq T8BcpQRXlqqCS0z7pEQVrx/jhDAKmdBmU0umLXB4zhATksK5mA/0wRr2C+FZdJBPrL449gW 9MlXCjuEGS/bRmdyzrCrgb/NFuQHxZr3RtaxhKQoTt1BD8aimts56p60M1zijQFNXFcZeVj fzNkRKsoY73QG4mc4CE3FR4AY3TFLiAvkQiEM/sdgaHuo7wQcX+ZMCFwgVfglWHjHJrOY+M 9ctwcEqkYERCsnVkWlrX14rvIspmMBpra+1FCti0YEMYdsrmmxineptd0BTu5t+LqQxO6Cj LnXqqXxx/SEsblm0S+dytJLOh8PbJCb8ESM0dfRZ/obI3Aupt7wiIWzISDeEyrC/IB+/MoV urhvdAYcmm9nDDk3krc49H9YyD0wl18rXRlqHG1A+GIKoQhJ2xeNpyFJWC9+2/KZEPFh6q/ bfCPGRHVa4Tl6iu/7l5b8xy0L+YEvyTfjqPfNV7dIX3tKjv+BvSl/4= X-QQ-XMRINFO: Nq+8W0+stu50tPAe92KXseR0ZZmBTk3gLg== X-QQ-RECHKSPAM: 0 The SpacemiT K1 and K3 SoCs have APB timers that run independently of the CPU cores. Each timer block has three 32-bit up counters, and each counter has three match comparators and its own interrupt. A counter can be clocked from the functional clock or from the 32.768 kHz clock, and can run in free-running or periodic mode. This series uses counter 0 as a oneshot clockevent. It is registered for tick broadcast, so it can wake up CPUs whose local RISC-V timer stops in idle. K3 uses the same register interface as K1 and falls back to the K1 compatible. Both SoCs run the timer from a 1 MHz functional clock. --- Changes in v5: - Drop the Tested-by tags from the binding and MAINTAINERS patches (Krzysztof), and from the K3 DTS patch, which was only tested on K1 - Link to v4: https://patch.msgid.link/20261201-spacemit-soc-timer-v4-0-738bd5a1f8ec@linux.spacemit.com Changes in v4: - List clocks and clock-names before interrupts in the binding and DT nodes (Sashiko) - Collect tags - Link to v3: https://patch.msgid.link/20261125-spacemit-soc-timer-v3-0-e6390f3ae4a6@linux.spacemit.com Changes in v3: - Drop the unnecessary RESET_CONTROLLER dependency (Philipp) - Link to v2: https://patch.msgid.link/20261117-spacemit-soc-timer-v2-0-9264d0ea7755@linux.spacemit.com Changes in v2: - Use named constants with comments for the counter sync latency and the minimum clock rate (Iker) - Link to v1: https://patch.msgid.link/20261103-spacemit-soc-timer-v1-0-36722421db6e@linux.spacemit.com To: Troy Mitchell To: Daniel Lezcano To: Thomas Gleixner To: Rob Herring To: Krzysztof Kozlowski To: Conor Dooley To: Yixun Lan To: Philipp Zabel To: Paul Walmsley To: Palmer Dabbelt To: Albert Ou To: Alexandre Ghiti Cc: linux-kernel@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: linux-riscv@lists.infradead.org Cc: spacemit@lists.linux.dev --- Troy Mitchell (5): dt-bindings: timer: Add SpacemiT K1 timer clocksource/drivers/spacemit: Add K1 timer support riscv: dts: spacemit: Add the K1 APB timer riscv: dts: spacemit: Add the K3 APB timer MAINTAINERS: Add entry for SpacemiT timer .../bindings/timer/spacemit,k1-timer.yaml | 71 +++++ MAINTAINERS | 6 + arch/riscv/boot/dts/spacemit/k1.dtsi | 12 + arch/riscv/boot/dts/spacemit/k3.dtsi | 12 + drivers/clocksource/Kconfig | 11 + drivers/clocksource/Makefile | 1 + drivers/clocksource/timer-spacemit.c | 317 +++++++++++++++++++++ 7 files changed, 430 insertions(+) --- base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4 change-id: 20261019-spacemit-soc-timer-cadf3088d286 Best regards, -- Troy Mitchell