Thread (11 messages) 11 messages, 4 authors, 2026-01-26

Re: [PATCH v2 2/3] reset: tenstorrent: Add reset controller for Atlantis

From: Philipp Zabel <p.zabel@pengutronix.de>
Date: 2026-01-23 13:00:39
Also in: linux-clk, linux-riscv, lkml

On Do, 2026-01-22 at 16:36 -0600, Anirudh Srinivasan wrote:
Adds Atlantis Reset Controller and auxiliary device definitions for
reset to share same regmap interface as clock controller.

This version of the reset controller driver covers resets from the RCPU
syscon.

Signed-off-by: Anirudh Srinivasan <redacted>
---
 MAINTAINERS                                |   2 +
 drivers/reset/Kconfig                      |  11 ++
 drivers/reset/Makefile                     |   1 +
 drivers/reset/reset-tenstorrent-atlantis.c | 158 +++++++++++++++++++++++++++++
 include/soc/tenstorrent/atlantis-syscon.h  |  26 +++++
 5 files changed, 198 insertions(+)
[...]
quoted hunk ↗ jump to hunk
diff --git a/drivers/reset/reset-tenstorrent-atlantis.c b/drivers/reset/reset-tenstorrent-atlantis.c
new file mode 100644
index 000000000000..2e7f09409f79
--- /dev/null
+++ b/drivers/reset/reset-tenstorrent-atlantis.c
@@ -0,0 +1,158 @@
[...]
+static int atlantis_reset_update(struct reset_controller_dev *rcdev,
+				 unsigned long id, bool assert)
+{
+	unsigned int val;
+	struct atlantis_reset_controller *rst =
+		to_atlantis_reset_controller(rcdev);
+	const struct atlantis_reset_data *data = &rst->data->reset_data[id];
+	unsigned int mask = BIT(data->bit);
+	struct regmap *regmap = rst->regmap;
+
+	if (data->active_low ^ assert)
+		val = mask;
+	else
+		val = ~mask;
		val = 0;

The ~mask bits will be ignored anyway.

[...]
quoted hunk ↗ jump to hunk
diff --git a/include/soc/tenstorrent/atlantis-syscon.h b/include/soc/tenstorrent/atlantis-syscon.h
new file mode 100644
index 000000000000..2c6387e5c21a
--- /dev/null
+++ b/include/soc/tenstorrent/atlantis-syscon.h
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+/*
+ * Copyright (c) 2026 Tenstorrent
+ */
+#ifndef __SOC_ATLANTIS_SYSCON_H__
+#define __SOC_ATLANTIS_SYSCON_H__
+
+#include <linux/bits.h>
+#include <linux/types.h>
#include <linux/auxiliary_bus.h>

struct regmap;
+
+struct atlantis_ccu_adev {
+	struct auxiliary_device adev;
+	struct regmap *regmap;
+};
+
+#define to_atlantis_ccu_adev(_adev) \
+	container_of((_adev), struct atlantis_ccu_adev, adev)
Please use an inline function instead of a macro.
+
+/* RCPU Reset Register Offsets */
+#define RCPU_BLK_RST_REG	0x001c
+#define LSIO_BLK_RST_REG	0x0020
+#define HSIO_BLK_RST_REG	0x000c
+#define PCIE_SUBS_RST_REG	0x0000
+#define MM_RSTN_REG		0x0014
Why not move these into reset-tenstorrent-atlantis.c, they are not part
of the interface between clock and reset drivers.

regards
Philipp
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help