From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) (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 008AC389105; Wed, 24 Jun 2026 11:30:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.75.126.72 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782300644; cv=none; b=h+9A+QoSJ6xD9PLdss8E2EgLxT5FId4ojSwAu4IgQS78eQ+phjWk9nSAAP0tvJyXWjTHXzPeWRuU/CKLttdYAB+Ats3+F1R0T/pX5oi+/RmcBVB905HV9sALQKUG4oWs7pxndWcT2/e7boMIA37uTm7YRBCMRoXgc5NrIZuHnyQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782300644; c=relaxed/simple; bh=JPVFGbgeUcgDWsGS/cLnYPU1hHSl3/cJH11c9XxtZ9c=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=LR7Lgf5NVKDa4ECJ124xuQ23ZLI0hs8i6FOaheuiNiuBqprUjPZ3tsww33v/mtDuemLPCzi7hU1yo/TetNlRuhZ56iwC9Q344n2OTAPnMXx5BiuDieqI4tQwO2BBwLS1xBSh31lBcoiH7OcTF35yyIAEkgOEvUNDbbfZoMuE3XI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com; spf=pass smtp.mailfrom=realtek.com; dkim=pass (2048-bit key) header.d=realtek.com header.i=@realtek.com header.b=ejRbpWeb; arc=none smtp.client-ip=211.75.126.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=realtek.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=realtek.com header.i=@realtek.com header.b="ejRbpWeb" X-SpamFilter-By: ArmorX SpamTrap 5.80 with qID 65OBTj3vA4147251, This message is accepted by code: ctloc85258 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=realtek.com; s=dkim; t=1782300585; bh=qAOUbo/1p128tVHptJ4mU0jT91GW4wZCWa80G9NU8gU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding:Content-Type; b=ejRbpWebxPQZHG+yqwTkzbmC7cHNVKbImI0jue12Ac++OYuVALNf1y3i+cXqGbSKG GyNPt+s9ySAirmaYscVp5TL4U+yfE2gIfgUCEHKvMM1y+PyNv5U/XrOeHF8h+xUt6n Nu2QRpc26/S1sTm/B1KPOZcZ5p6leCPNVKnjbT1Yljc8QUzqoS9M1g8bfa4L2w5YgD P63BTcoT3wCwmg8Am5WhsGiT6sBZKi+xzhvRLk1z+nAijl1QJmzy4y+1wbIOGgNHWS IUwrf4jiV4p0Qzo6LTXItgk4X7WmTf7KUcR/CdNo/uKzRiCHtzM/zzwFCYxo6rLVBW RDzdYcg7pF5Dg== Received: from mail.realtek.com (rtkexhmbs04.realtek.com.tw[10.21.1.54]) by rtits2.realtek.com.tw (8.15.2/3.29/5.94) with ESMTPS id 65OBTj3vA4147251 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 24 Jun 2026 19:29:45 +0800 Received: from RTKEXHMBS05.realtek.com.tw (10.21.1.55) by RTKEXHMBS04.realtek.com.tw (10.21.1.54) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 24 Jun 2026 19:29:45 +0800 Received: from RTKEXHMBS05.realtek.com.tw (10.21.1.55) by RTKEXHMBS05.realtek.com.tw (10.21.1.55) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 24 Jun 2026 19:29:45 +0800 Received: from cn1dhc-k02 (172.21.252.101) by RTKEXHMBS05.realtek.com.tw (10.21.1.55) with Microsoft SMTP Server id 15.2.2562.17 via Frontend Transport; Wed, 24 Jun 2026 19:29:45 +0800 From: Yu-Chun Lin To: , , , , , , , , , CC: , , , , , , , , Subject: [PATCH v9 04/12] reset: realtek: Add RTD1625-ISO reset controller driver Date: Wed, 24 Jun 2026 19:29:32 +0800 Message-ID: <20260624112940.3475605-5-eleanor.lin@realtek.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260624112940.3475605-1-eleanor.lin@realtek.com> References: <20260624112940.3475605-1-eleanor.lin@realtek.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain From: Cheng-Yu Lee Add support for the ISO (Isolation) domain reset controller on the Realtek RTD1625 SoC. The reset controller shares the same register space with the ISO clock controller. To handle this shared register space, the reset driver is implemented as an auxiliary driver. It will be instantiated and probed via the auxiliary bus by the RTD1625-ISO clock controller driver. Signed-off-by: Cheng-Yu Lee Co-developed-by: Yu-Chun Lin Signed-off-by: Yu-Chun Lin --- Changes in v9: - Extract reset-related code from the previous clock driver patch (formerly patch 9 in v8). --- drivers/reset/realtek/Makefile | 2 +- drivers/reset/realtek/reset-rtd1625-iso.c | 99 +++++++++++++++++++++++ 2 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 drivers/reset/realtek/reset-rtd1625-iso.c diff --git a/drivers/reset/realtek/Makefile b/drivers/reset/realtek/Makefile index c3f605ffb11c..9007c9d5683b 100644 --- a/drivers/reset/realtek/Makefile +++ b/drivers/reset/realtek/Makefile @@ -1,3 +1,3 @@ # SPDX-License-Identifier: GPL-2.0-only obj-$(CONFIG_RESET_RTK_COMMON) += reset-rtk-common.o -obj-$(CONFIG_RESET_RTD1625) += reset-rtd1625-crt.o +obj-$(CONFIG_RESET_RTD1625) += reset-rtd1625-crt.o reset-rtd1625-iso.o diff --git a/drivers/reset/realtek/reset-rtd1625-iso.c b/drivers/reset/realtek/reset-rtd1625-iso.c new file mode 100644 index 000000000000..78eaabb408f0 --- /dev/null +++ b/drivers/reset/realtek/reset-rtd1625-iso.c @@ -0,0 +1,99 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (C) 2026 Realtek Semiconductor Corporation + */ + +#include +#include +#include +#include +#include +#include +#include "reset-rtk-common.h" + +#define RTD1625_ISO_RSTN_MAX 29 +#define RTD1625_ISO_S_RSTN_MAX 5 + +static const struct rtk_reset_desc rtd1625_iso_reset_descs[] = { + [RTD1625_ISO_RSTN_VFD] = { .ofs = 0x88, .bit = 0 }, + [RTD1625_ISO_RSTN_CEC0] = { .ofs = 0x88, .bit = 2 }, + [RTD1625_ISO_RSTN_CEC1] = { .ofs = 0x88, .bit = 3 }, + [RTD1625_ISO_RSTN_CBUSTX] = { .ofs = 0x88, .bit = 5 }, + [RTD1625_ISO_RSTN_CBUSRX] = { .ofs = 0x88, .bit = 6 }, + [RTD1625_ISO_RSTN_USB3_PHY2_XTAL_POW] = { .ofs = 0x88, .bit = 7 }, + [RTD1625_ISO_RSTN_UR0] = { .ofs = 0x88, .bit = 8 }, + [RTD1625_ISO_RSTN_GMAC] = { .ofs = 0x88, .bit = 9 }, + [RTD1625_ISO_RSTN_GPHY] = { .ofs = 0x88, .bit = 10 }, + [RTD1625_ISO_RSTN_I2C_0] = { .ofs = 0x88, .bit = 11 }, + [RTD1625_ISO_RSTN_I2C_1] = { .ofs = 0x88, .bit = 12 }, + [RTD1625_ISO_RSTN_CBUS] = { .ofs = 0x88, .bit = 13 }, + [RTD1625_ISO_RSTN_USB_DRD] = { .ofs = 0x88, .bit = 14 }, + [RTD1625_ISO_RSTN_USB_HOST] = { .ofs = 0x88, .bit = 15 }, + [RTD1625_ISO_RSTN_USB_PHY_0] = { .ofs = 0x88, .bit = 16 }, + [RTD1625_ISO_RSTN_USB_PHY_1] = { .ofs = 0x88, .bit = 17 }, + [RTD1625_ISO_RSTN_USB_PHY_2] = { .ofs = 0x88, .bit = 18 }, + [RTD1625_ISO_RSTN_USB] = { .ofs = 0x88, .bit = 19 }, + [RTD1625_ISO_RSTN_TYPE_C] = { .ofs = 0x88, .bit = 20 }, + [RTD1625_ISO_RSTN_USB_U3_HOST] = { .ofs = 0x88, .bit = 21 }, + [RTD1625_ISO_RSTN_USB3_PHY0_POW] = { .ofs = 0x88, .bit = 22 }, + [RTD1625_ISO_RSTN_USB3_P0_MDIO] = { .ofs = 0x88, .bit = 23 }, + [RTD1625_ISO_RSTN_USB3_PHY1_POW] = { .ofs = 0x88, .bit = 24 }, + [RTD1625_ISO_RSTN_USB3_P1_MDIO] = { .ofs = 0x88, .bit = 25 }, + [RTD1625_ISO_RSTN_VTC] = { .ofs = 0x88, .bit = 26 }, + [RTD1625_ISO_RSTN_USB3_PHY2_POW] = { .ofs = 0x88, .bit = 27 }, + [RTD1625_ISO_RSTN_USB3_P2_MDIO] = { .ofs = 0x88, .bit = 28 }, + [RTD1625_ISO_RSTN_USB_PHY_3] = { .ofs = 0x88, .bit = 29 }, + [RTD1625_ISO_RSTN_USB_PHY_4] = { .ofs = 0x88, .bit = 30 }, +}; + +static const struct rtk_reset_desc rtd1625_iso_s_reset_descs[] = { + [RTD1625_ISO_S_RSTN_ISOM_MIS] = { .ofs = 0x310, .bit = 0, .write_en = 1 }, + [RTD1625_ISO_S_RSTN_GPIOM] = { .ofs = 0x310, .bit = 2, .write_en = 1 }, + [RTD1625_ISO_S_RSTN_TIMER7] = { .ofs = 0x310, .bit = 4, .write_en = 1 }, + [RTD1625_ISO_S_RSTN_IRDA] = { .ofs = 0x310, .bit = 6, .write_en = 1 }, + [RTD1625_ISO_S_RSTN_UR10] = { .ofs = 0x310, .bit = 8, .write_en = 1 }, +}; + +static int rtd1625_iso_reset_probe(struct auxiliary_device *adev, + const struct auxiliary_device_id *id) +{ + struct device *dev = &adev->dev; + struct device *parent = dev->parent; + struct rtk_reset_data *data; + + data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL); + if (!data) + return -ENOMEM; + + if (of_device_is_compatible(parent->of_node, "realtek,rtd1625-iso-s-clk")) { + data->descs = rtd1625_iso_s_reset_descs; + data->rcdev.nr_resets = RTD1625_ISO_S_RSTN_MAX; + } else { + data->descs = rtd1625_iso_reset_descs; + data->rcdev.nr_resets = RTD1625_ISO_RSTN_MAX; + } + + data->rcdev.owner = THIS_MODULE; + + return rtk_reset_controller_add(dev, data); +} + +static const struct auxiliary_device_id rtd1625_iso_reset_ids[] = { + { .name = "clk_rtk.iso_rst" }, + { .name = "clk_rtk.iso_s_rst" }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(auxiliary, rtd1625_iso_reset_ids); + +static struct auxiliary_driver rtd1625_iso_driver = { + .probe = rtd1625_iso_reset_probe, + .id_table = rtd1625_iso_reset_ids, + .driver = { + .name = "rtd1625-iso-reset", + }, +}; +module_auxiliary_driver(rtd1625_iso_driver); + +MODULE_DESCRIPTION("Realtek RTD1625 ISO Reset Controller Driver"); +MODULE_LICENSE("GPL"); +MODULE_IMPORT_NS("REALTEK_RESET"); -- 2.43.0