From nobody Fri Apr 3 05:04:23 2026 Received: from mail-yw1-f171.google.com (mail-yw1-f171.google.com [209.85.128.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B148B285CA4 for ; Mon, 16 Feb 2026 22:16:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771280208; cv=none; b=KAx23EdM9MSF92rBBeDTFbd2VAE9FZtJXr5Ug0FbgaQ3nWkyC1Khua2FeHnD5rBkd9RdtwoU08gsayrb40EvfqKW2tCtPN5k23hmy7iVpfW2uNhP3DOkmldT9+43OvtfAcfI2kFCwojKmOJ/0kVoQqCTT/LLfAf7rz5u7XXLQVg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771280208; c=relaxed/simple; bh=BgY55UPaZvWk0gKVzmGD/1Tuzd8yij510nNGgAMAKGc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=nRtMnlgkzhl9MHuG1o1FZA90n19AT2E2ngB1UCS5+k5SzBnu9grwcNOtLdLlBci2kNXzSwFQeZARKyezTP/9IKDdNdZORP+/w7QPfrReaCS52nBz0jDwsCu9AxQfHP4ouVlPJWQqAeATlY2PB/6uXmg9wYo4OcAaR79zm5/gaAs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oss.tenstorrent.com; spf=pass smtp.mailfrom=tenstorrent.com; dkim=pass (2048-bit key) header.d=tenstorrent.com header.i=@tenstorrent.com header.b=LvJ2UdIr; arc=none smtp.client-ip=209.85.128.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oss.tenstorrent.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tenstorrent.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tenstorrent.com header.i=@tenstorrent.com header.b="LvJ2UdIr" Received: by mail-yw1-f171.google.com with SMTP id 00721157ae682-797afd2e872so19254837b3.0 for ; Mon, 16 Feb 2026 14:16:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tenstorrent.com; s=google; t=1771280206; x=1771885006; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=QU90MQWAl93DOAWC+lPTJbwL0gbIXlpAiKhxQBMuK6k=; b=LvJ2UdIrcUawAI7XDIHZPmp9j/j7uiOkMOOL7eCweRluDJtX29BID26gnhBtfK0i10 zdjqBavITKz+5cz/eLALt1WTf9APwWowenomnYlEeU8WifoEtVPJjvusMcgXjdQoxd3X abkNyzso55dHNP5g3BuGzkA3yNYeilp9J4K+rCyDk+QGGsIwiKZdLGeKAEV0KBwpjOcU bhXR6CrVS16Uo2dMZpx1/Zk+VbbQWQU9/GYoCM0v9y+v2R51lYItt3ADWct5UIa9GIhd 0qbXoEDwVrlkxTAg2ZizHmP7hq8HuflofWQEeQCU+V2AYA5bpLiPlQc225K4jQ6PY9Zv auPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771280206; x=1771885006; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=QU90MQWAl93DOAWC+lPTJbwL0gbIXlpAiKhxQBMuK6k=; b=V8SbNwFHg3cW2XBp1BV3t0cTOUgdjhRT1ElRCiZdx7fjAyTt2PSzAX9xsEqy717xul IopwrHkKyXfAMco2mjjtDH5GtzDHTPSIFyaWdLJEtd5Qb/64uCJwAbWGuheQ5DsKLlD/ 02+UTYnbS0A5Ll76zkewtwINLrtSLflgy2jwI6go+v8Uxk8Wkvae4PcniAn247BQFLZc itiihA5P+rDL7TVVD82frMsJ7ERgIAs4Mb5ymOTsZ/746CxKWQLLMVlqjldvO8XiwhM/ hTSOo00v5KbFIWrhulTxYv1o8SceuxCaYiiJSVXy+m8G1myEu6tGnbXkueMVcIXYq97M 4stA== X-Forwarded-Encrypted: i=1; AJvYcCUq9WzuplYaWfSZK0WRI0wYLhuMgRv/2AB2Dwi4DXCPxWZ7S9WdKjvEDAvZAXHEKnjOdkoJ+KRcIQx47ZM=@vger.kernel.org X-Gm-Message-State: AOJu0YzOgmxauBOGO59djgtJQY4zD+JJNhLShYmSTZ3jAtgpnhCe40Wi 5NZjBMVb6GRTAwSOew91uTCTehoI19MYcBWyc4qQcGcz2s7xnRj5HKnaxrEdM4c7c84= X-Gm-Gg: AZuq6aIB3s04lmGXOiM6B+RyK7rmyggA1zC1gfywouwUiBqxswEnDz1W56KVQXMCJ8U ea97X+Pf0XRfvcfcZWRfPBhoYkSr4Pm7DG6/NYzwBugJR1ClS4kGcwO76bAZ3xzasWfhnBTAASx fObCNeyd8fIZjajd2JU18up58awrLu3iFyxc6c5bDKgErRN9cTQq7I2thP0jNPdfJm6N4aoO88S PExTlg3Q5UZ/WxHE9P/8qAHosbb7XKD/2uLJFIqGymZYQ48bDDDb7z0fu0lLWEOUCM8hoJU5wYW IdFVIcWRAXYaNRfP6Vl1tfVwphWcxlCIoNmsGO4VX/J5z+xOPL7DIZXT4RW3T/ttTpF2qkKr5rD Tg37d8BTnzE6A+z65oL+ZKRRR/+/7Sna6Fz1/9+SVkhoqWusx90hlUrEPXNIJzCpNJw/8mwm5j0 lbQi2fBgosL/zllglqhFETAEj66Bz+ckUGx9mMIKywUAufu6krlpp7XsQOUE/NAGMdvCpOL/u6N DlEgSSryuU= X-Received: by 2002:a05:690c:6a0c:b0:796:3d5f:a2be with SMTP id 00721157ae682-797ac66c027mr80356017b3.64.1771280205751; Mon, 16 Feb 2026 14:16:45 -0800 (PST) Received: from [192.168.5.15] ([68.95.197.245]) by smtp.gmail.com with ESMTPSA id 00721157ae682-7966c1a8222sm106705757b3.23.2026.02.16.14.16.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Feb 2026 14:16:45 -0800 (PST) From: Anirudh Srinivasan Date: Mon, 16 Feb 2026 16:16:33 -0600 Subject: [PATCH v6 2/3] reset: tenstorrent: Add reset controller for Atlantis Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260216-atlantis-clocks-v6-2-cb46d6a59c73@oss.tenstorrent.com> References: <20260216-atlantis-clocks-v6-0-cb46d6a59c73@oss.tenstorrent.com> In-Reply-To: <20260216-atlantis-clocks-v6-0-cb46d6a59c73@oss.tenstorrent.com> To: Drew Fustini , Joel Stanley , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michael Turquette , Stephen Boyd , Anirudh Srinivasan , Philipp Zabel Cc: linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, joel@jms.id.au, fustini@kernel.org, mpe@kernel.org, mpe@oss.tenstorrent.com, npiggin@oss.tenstorrent.com, agross@kernel.org, agross@oss.tenstorrent.com, bmasney@redhat.com X-Mailer: b4 0.14.3 Adds Atlantis Reset Controller driver, which shares the same regmap as prcm ( clock controller). This version of the reset controller driver covers resets from the RCPU prcm. Signed-off-by: Anirudh Srinivasan Acked-by: Philipp Zabel Reviewed-by: Philipp Zabel --- MAINTAINERS | 1 + drivers/reset/Kconfig | 11 ++ drivers/reset/Makefile | 1 + drivers/reset/reset-tenstorrent-atlantis.c | 173 +++++++++++++++++++++++++= ++++ 4 files changed, 186 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 24cd2bbe1c78..93f4e860e589 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -22537,6 +22537,7 @@ T: git https://github.com/tenstorrent/linux.git F: Documentation/devicetree/bindings/clock/tenstorrent,atlantis-prcm-rcpu.= yaml F: Documentation/devicetree/bindings/riscv/tenstorrent.yaml F: arch/riscv/boot/dts/tenstorrent/ +F: drivers/reset/reset-tenstorrent-atlantis.c F: include/dt-bindings/clock/tenstorrent,atlantis-prcm-rcpu.h =20 RISC-V THEAD SoC SUPPORT diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig index 6e5d6deffa7d..cade77717492 100644 --- a/drivers/reset/Kconfig +++ b/drivers/reset/Kconfig @@ -324,6 +324,17 @@ config RESET_SUNXI help This enables the reset driver for Allwinner SoCs. =20 +config RESET_TENSTORRENT_ATLANTIS + tristate "Tenstorrent atlantis reset driver" + depends on ARCH_TENSTORRENT || COMPILE_TEST + select AUXILIARY_BUS + default ARCH_TENSTORRENT + help + This enables the driver for the reset controller + present in the Tenstorrent Atlantis SoC. + Enable this option to be able to use hardware + resets on Atalantis based systems. + config RESET_TH1520 tristate "T-HEAD TH1520 reset controller" depends on ARCH_THEAD || COMPILE_TEST diff --git a/drivers/reset/Makefile b/drivers/reset/Makefile index 9c3e484dfd81..a31959da0a88 100644 --- a/drivers/reset/Makefile +++ b/drivers/reset/Makefile @@ -41,6 +41,7 @@ obj-$(CONFIG_RESET_SOCFPGA) +=3D reset-socfpga.o obj-$(CONFIG_RESET_SPACEMIT) +=3D reset-spacemit.o obj-$(CONFIG_RESET_SUNPLUS) +=3D reset-sunplus.o obj-$(CONFIG_RESET_SUNXI) +=3D reset-sunxi.o +obj-$(CONFIG_RESET_TENSTORRENT_ATLANTIS) +=3D reset-tenstorrent-atlantis.o obj-$(CONFIG_RESET_TH1520) +=3D reset-th1520.o obj-$(CONFIG_RESET_TI_SCI) +=3D reset-ti-sci.o obj-$(CONFIG_RESET_TI_SYSCON) +=3D reset-ti-syscon.o diff --git a/drivers/reset/reset-tenstorrent-atlantis.c b/drivers/reset/res= et-tenstorrent-atlantis.c new file mode 100644 index 000000000000..ab8be52fdd5e --- /dev/null +++ b/drivers/reset/reset-tenstorrent-atlantis.c @@ -0,0 +1,173 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Tenstorrent Atlantis PRCM Reset Driver + * + * Copyright (c) 2026 Tenstorrent + */ + +#include +#include +#include +#include + +/* 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 + +struct atlantis_reset_data { + u8 bit; + u16 reg; + bool active_low; +}; + +struct atlantis_reset_controller_data { + const struct atlantis_reset_data *reset_data; + size_t count; +}; + +struct atlantis_reset_controller { + struct reset_controller_dev rcdev; + const struct atlantis_reset_controller_data *data; + struct regmap *regmap; +}; + +static inline struct atlantis_reset_controller * +to_atlantis_reset_controller(struct reset_controller_dev *rcdev) +{ + return container_of(rcdev, struct atlantis_reset_controller, rcdev); +} + +#define RESET_DATA(_reg, _bit, _active_low) \ + { \ + .bit =3D _bit, .reg =3D _reg, .active_low =3D _active_low, \ + } + +static const struct atlantis_reset_data atlantis_rcpu_resets[] =3D { + [RST_SMNDMA0] =3D RESET_DATA(RCPU_BLK_RST_REG, 0, true), + [RST_SMNDMA1] =3D RESET_DATA(RCPU_BLK_RST_REG, 1, true), + [RST_WDT0] =3D RESET_DATA(RCPU_BLK_RST_REG, 2, true), + [RST_WDT1] =3D RESET_DATA(RCPU_BLK_RST_REG, 3, true), + [RST_TMR] =3D RESET_DATA(RCPU_BLK_RST_REG, 4, true), + [RST_PVTC] =3D RESET_DATA(RCPU_BLK_RST_REG, 12, true), + [RST_PMU] =3D RESET_DATA(RCPU_BLK_RST_REG, 13, true), + [RST_MAILBOX] =3D RESET_DATA(RCPU_BLK_RST_REG, 14, true), + [RST_SPACC] =3D RESET_DATA(RCPU_BLK_RST_REG, 26, true), + [RST_OTP] =3D RESET_DATA(RCPU_BLK_RST_REG, 28, true), + [RST_TRNG] =3D RESET_DATA(RCPU_BLK_RST_REG, 29, true), + [RST_CRC] =3D RESET_DATA(RCPU_BLK_RST_REG, 30, true), + [RST_QSPI] =3D RESET_DATA(LSIO_BLK_RST_REG, 0, true), + [RST_I2C0] =3D RESET_DATA(LSIO_BLK_RST_REG, 1, true), + [RST_I2C1] =3D RESET_DATA(LSIO_BLK_RST_REG, 2, true), + [RST_I2C2] =3D RESET_DATA(LSIO_BLK_RST_REG, 3, true), + [RST_I2C3] =3D RESET_DATA(LSIO_BLK_RST_REG, 4, true), + [RST_I2C4] =3D RESET_DATA(LSIO_BLK_RST_REG, 5, true), + [RST_UART0] =3D RESET_DATA(LSIO_BLK_RST_REG, 6, true), + [RST_UART1] =3D RESET_DATA(LSIO_BLK_RST_REG, 7, true), + [RST_UART2] =3D RESET_DATA(LSIO_BLK_RST_REG, 8, true), + [RST_UART3] =3D RESET_DATA(LSIO_BLK_RST_REG, 9, true), + [RST_UART4] =3D RESET_DATA(LSIO_BLK_RST_REG, 10, true), + [RST_SPI0] =3D RESET_DATA(LSIO_BLK_RST_REG, 11, true), + [RST_SPI1] =3D RESET_DATA(LSIO_BLK_RST_REG, 12, true), + [RST_SPI2] =3D RESET_DATA(LSIO_BLK_RST_REG, 13, true), + [RST_SPI3] =3D RESET_DATA(LSIO_BLK_RST_REG, 14, true), + [RST_GPIO] =3D RESET_DATA(LSIO_BLK_RST_REG, 15, true), + [RST_CAN0] =3D RESET_DATA(LSIO_BLK_RST_REG, 17, true), + [RST_CAN1] =3D RESET_DATA(LSIO_BLK_RST_REG, 18, true), + [RST_I2S0] =3D RESET_DATA(LSIO_BLK_RST_REG, 19, true), + [RST_I2S1] =3D RESET_DATA(LSIO_BLK_RST_REG, 20, true), + +}; + +static const struct atlantis_reset_controller_data atlantis_rcpu_reset_dat= a =3D { + .reset_data =3D atlantis_rcpu_resets, + .count =3D ARRAY_SIZE(atlantis_rcpu_resets), +}; + +static int atlantis_reset_update(struct reset_controller_dev *rcdev, + unsigned long id, bool assert) +{ + unsigned int val; + struct atlantis_reset_controller *rst =3D + to_atlantis_reset_controller(rcdev); + const struct atlantis_reset_data *data =3D &rst->data->reset_data[id]; + unsigned int mask =3D BIT(data->bit); + struct regmap *regmap =3D rst->regmap; + + if (data->active_low ^ assert) + val =3D mask; + else + val =3D 0; + + return regmap_update_bits(regmap, data->reg, mask, val); +} + +static int atlantis_reset_assert(struct reset_controller_dev *rcdev, + unsigned long id) +{ + return atlantis_reset_update(rcdev, id, true); +} + +static int atlantis_reset_deassert(struct reset_controller_dev *rcdev, + unsigned long id) +{ + return atlantis_reset_update(rcdev, id, false); +} + +static const struct reset_control_ops atlantis_reset_control_ops =3D { + .assert =3D atlantis_reset_assert, + .deassert =3D atlantis_reset_deassert, +}; + +static int +atlantis_reset_controller_register(struct device *dev, + struct atlantis_reset_controller *controller) +{ + struct reset_controller_dev *rcdev =3D &controller->rcdev; + + rcdev->ops =3D &atlantis_reset_control_ops; + rcdev->owner =3D THIS_MODULE; + rcdev->of_node =3D dev->of_node; + rcdev->nr_resets =3D controller->data->count; + + return devm_reset_controller_register(dev, &controller->rcdev); +} +static int atlantis_reset_probe(struct auxiliary_device *adev, + const struct auxiliary_device_id *id) +{ + struct atlantis_reset_controller *controller; + struct device *dev =3D &adev->dev; + struct regmap *regmap; + + regmap =3D dev_get_regmap(dev->parent, NULL); + if (!regmap) + return -ENODEV; + + controller =3D devm_kzalloc(dev, sizeof(*controller), GFP_KERNEL); + if (!controller) + return -ENOMEM; + controller->data =3D + (const struct atlantis_reset_controller_data *)id->driver_data; + controller->regmap =3D regmap; + + return atlantis_reset_controller_register(dev, controller); +} + +static const struct auxiliary_device_id atlantis_reset_ids[] =3D { + { .name =3D "atlantis_prcm.rcpu-reset", + .driver_data =3D (kernel_ulong_t)&atlantis_rcpu_reset_data }, + {}, +}; +MODULE_DEVICE_TABLE(auxiliary, atlantis_reset_ids); + +static struct auxiliary_driver atlantis_reset_driver =3D { + .probe =3D atlantis_reset_probe, + .id_table =3D atlantis_reset_ids, +}; +module_auxiliary_driver(atlantis_reset_driver); + +MODULE_AUTHOR("Anirudh Srinivasan "); +MODULE_DESCRIPTION("Atlantis PRCM reset controller driver"); +MODULE_LICENSE("GPL"); --=20 2.43.0