From nobody Fri Oct 3 20:58:16 2025 Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) (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 B33D72D12EB; Mon, 25 Aug 2025 10:40:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756118452; cv=none; b=qdRxG5kzfM0KdPZKd9EB7uHVEAg275gwc3VMuP7HR6F50YpBKv5bcjg5TKfeGmJuQlUI4/tAauK4N+Vib40PgmotZXdI+eaf5Ag/jAJw9mxWm6LtOMI7TQBbaQAT+4LkIVuS/5tSnq065TyGFYnWgfqPKtGjJm81RQ4TSXAA0jw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756118452; c=relaxed/simple; bh=TjyhYDQ/zRCXfpTVzRC6ISsclBwUA55fk1Rmf4ipb18=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MtA8wCLNJ1IgLAgUDvmKwWqpbDwZtaKuSmB7Hp38c64KqArQ9IX1iWXIVX8RIKkuUUylY7U7u3a2m+FwHgqjy9BjIAoIBDnVbG8JrknENZ5NEYmfeQXWzYv64dfP+1eGWwBHOJdy2lfDP+SYD0JP2H7stELbH7yZ08e4eX6P5V8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=icxytZkI; arc=none smtp.client-ip=209.85.218.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="icxytZkI" Received: by mail-ej1-f44.google.com with SMTP id a640c23a62f3a-afcb7a7bad8so575236266b.3; Mon, 25 Aug 2025 03:40:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1756118449; x=1756723249; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=PN85YgtDrrFHbobx3x/MsgHdStbhFeF97ePi8WMVRQI=; b=icxytZkIM5322vOvEW0mrHMvlntLH6xniDDu/Dn0/g0qvQBoP2CUmI+rGIbL2MmtYa MxeVnGYm+DUEqP5HFSIU3rt3RCJEGxsCsBcjdH3XXe+8ms8+hzjjyiGrYM1ZchImsPlb bUSY3rOQa1Qr/7sZFLlNzcP247jjuL7kKPkCek9RIbFYj+jhV2T2Zqa6ZnhJup0JIRYS R4B4yXcaQH8OO/galKCaAbSliUFC/tMi/vxYkesBXPvgEcROsf/ni70zynDGe7e6EFDS sDpC+HF7u/fLY85llerVRZwY2viYXi1vryCcREuARk2i6BkdB3OtiyLb9EFe5mhpTSX6 yQTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756118449; x=1756723249; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PN85YgtDrrFHbobx3x/MsgHdStbhFeF97ePi8WMVRQI=; b=pjR/2SV9/wUP0As4JcPoQVJ7QpHu+Tyove6ajSXYO2rfwqjK8w2G4i8TxyPxFnM0xu SPQPE7G9nQWENJ0qt/Gkb1L/5rSOYc+eyL77G/QJoNgAD87ymhN/NSOl+arRB/Qjb1yN MmSu3/RunbZ7PVbBAD/cyznmB8xm4RsKp3F2xVFQFyJTFPsFJ/OqZrOz3slCNK+oDbjO nw21Rv7OMF4bPk0P0GabCUR9dGeS6eaO2OhR+mMrvjbN57qzxBi3s+Uaazsk8TOSLFg2 9wJGLHplwNV5v82834nh1LG7fAOLxymPnSa36Lp5GRSs7DLpPnQ1a0aaOq24OGRVKr4+ C0+g== X-Forwarded-Encrypted: i=1; AJvYcCUARv2FB/ANd7U1I1wz3y6PydsLRcg3UC0xSmrSfZ7esgAua0oI8ZddzoGgREOEqmvTX2LabnMyi5OY@vger.kernel.org, AJvYcCUJo+in5uc2dw6kU2XFLa4Bo1yQfNoeDuSNMuCWci0DHInqR2w0GiNz2MaVf8R8M1dIRn37vStjJ5GJhKU=@vger.kernel.org, AJvYcCUgF/hDHlSWy1muB+QOJzAs0HHkHKECiRFNaViPcZvQtifxhxRCd1L+tKkHe1vrrPV1y965wEzP4SYYQp4e@vger.kernel.org X-Gm-Message-State: AOJu0YzQpCyYgHsxizsqw8mqkA8drFQ8A66wStDkhK+7fA71tlYKbiKX 3oxvbLJ1kIWYQC4hMskGP2YvFC15Tf7yUVLDUq/SZZrYvj6XtU2/fZCr X-Gm-Gg: ASbGnctilbUHfwZH3/nJIggcj2jenbEJKXHexmHAqormC47nWcGgXsPo/KiX0/8aPHK upTw7AcQzJPjh5lO4Ifdy0GVMuM0MpUx2XwqezlGtzDHOF7ElzK0s2KOsH/mehC5MQExZmwxXCX nJ4SjUNBoEl6fX+/i3fHo4yEbEHzSwAMjgXpx49Itu/iNRn93Bj0qfWXPNSMnQYd5FZPxRdMVxE x5lTShcjFyuWRqULzioHnrfX8n1PLr9fJSVlA1K2hYwxO/q2a3tBzeYy4VO27W5crke+nFS0DZS gQS82UqG7G6PwyKD+H5pBS+vs3vbPBiOgdW39Djr2oJK+JjgkyElm14zJkVcHjyZhHrhtI6A0w8 5o9nxage3jZw44xX+wrsg2S9R/bGV9jLp0A8= X-Google-Smtp-Source: AGHT+IEG43zwHszteWNKNTJH6z5etcz29R+4YFsUtGmKxlmAqSwMGWO5sE/lRYdBJIz4zR/n2kGQZw== X-Received: by 2002:a17:907:985:b0:afe:6648:a24c with SMTP id a640c23a62f3a-afe6648c0damr429613466b.52.1756118448494; Mon, 25 Aug 2025 03:40:48 -0700 (PDT) Received: from xeon.. ([188.163.112.76]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-afe48fc0912sm531683166b.42.2025.08.25.03.40.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Aug 2025 03:40:47 -0700 (PDT) From: Svyatoslav Ryhel To: "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Thierry Reding , Thierry Reding , Mikko Perttunen , Jonathan Hunter , Svyatoslav Ryhel , "Jiri Slaby (SUSE)" , Jonathan Cameron , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 1/6] soc: tegra: fuse: add Tegra114 nvmem cells and fuse lookups Date: Mon, 25 Aug 2025 13:40:21 +0300 Message-ID: <20250825104026.127911-2-clamor95@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250825104026.127911-1-clamor95@gmail.com> References: <20250825104026.127911-1-clamor95@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add missing Tegra114 nvmem cells and fuse lookups which were added for Tegra124+ but omitted for Tegra114. Signed-off-by: Svyatoslav Ryhel Reviewed-by: Mikko Perttunen --- drivers/soc/tegra/fuse/fuse-tegra30.c | 122 ++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) diff --git a/drivers/soc/tegra/fuse/fuse-tegra30.c b/drivers/soc/tegra/fuse= /fuse-tegra30.c index e24ab5f7d2bf..524fa1b0cd3d 100644 --- a/drivers/soc/tegra/fuse/fuse-tegra30.c +++ b/drivers/soc/tegra/fuse/fuse-tegra30.c @@ -117,6 +117,124 @@ const struct tegra_fuse_soc tegra30_fuse_soc =3D { #endif =20 #ifdef CONFIG_ARCH_TEGRA_114_SOC +static const struct nvmem_cell_info tegra114_fuse_cells[] =3D { + { + .name =3D "tsensor-cpu1", + .offset =3D 0x084, + .bytes =3D 4, + .bit_offset =3D 0, + .nbits =3D 32, + }, { + .name =3D "tsensor-cpu2", + .offset =3D 0x088, + .bytes =3D 4, + .bit_offset =3D 0, + .nbits =3D 32, + }, { + .name =3D "tsensor-common", + .offset =3D 0x08c, + .bytes =3D 4, + .bit_offset =3D 0, + .nbits =3D 32, + }, { + .name =3D "tsensor-cpu0", + .offset =3D 0x098, + .bytes =3D 4, + .bit_offset =3D 0, + .nbits =3D 32, + }, { + .name =3D "xusb-pad-calibration", + .offset =3D 0x0f0, + .bytes =3D 4, + .bit_offset =3D 0, + .nbits =3D 32, + }, { + .name =3D "tsensor-cpu3", + .offset =3D 0x12c, + .bytes =3D 4, + .bit_offset =3D 0, + .nbits =3D 32, + }, { + .name =3D "tsensor-gpu", + .offset =3D 0x154, + .bytes =3D 4, + .bit_offset =3D 0, + .nbits =3D 32, + }, { + .name =3D "tsensor-mem0", + .offset =3D 0x158, + .bytes =3D 4, + .bit_offset =3D 0, + .nbits =3D 32, + }, { + .name =3D "tsensor-mem1", + .offset =3D 0x15c, + .bytes =3D 4, + .bit_offset =3D 0, + .nbits =3D 32, + }, { + .name =3D "tsensor-pllx", + .offset =3D 0x160, + .bytes =3D 4, + .bit_offset =3D 0, + .nbits =3D 32, + }, +}; + +static const struct nvmem_cell_lookup tegra114_fuse_lookups[] =3D { + { + .nvmem_name =3D "fuse", + .cell_name =3D "xusb-pad-calibration", + .dev_id =3D "7009f000.padctl", + .con_id =3D "calibration", + }, { + .nvmem_name =3D "fuse", + .cell_name =3D "tsensor-common", + .dev_id =3D "700e2000.thermal-sensor", + .con_id =3D "common", + }, { + .nvmem_name =3D "fuse", + .cell_name =3D "tsensor-cpu0", + .dev_id =3D "700e2000.thermal-sensor", + .con_id =3D "cpu0", + }, { + .nvmem_name =3D "fuse", + .cell_name =3D "tsensor-cpu1", + .dev_id =3D "700e2000.thermal-sensor", + .con_id =3D "cpu1", + }, { + .nvmem_name =3D "fuse", + .cell_name =3D "tsensor-cpu2", + .dev_id =3D "700e2000.thermal-sensor", + .con_id =3D "cpu2", + }, { + .nvmem_name =3D "fuse", + .cell_name =3D "tsensor-cpu3", + .dev_id =3D "700e2000.thermal-sensor", + .con_id =3D "cpu3", + }, { + .nvmem_name =3D "fuse", + .cell_name =3D "tsensor-mem0", + .dev_id =3D "700e2000.thermal-sensor", + .con_id =3D "mem0", + }, { + .nvmem_name =3D "fuse", + .cell_name =3D "tsensor-mem1", + .dev_id =3D "700e2000.thermal-sensor", + .con_id =3D "mem1", + }, { + .nvmem_name =3D "fuse", + .cell_name =3D "tsensor-gpu", + .dev_id =3D "700e2000.thermal-sensor", + .con_id =3D "gpu", + }, { + .nvmem_name =3D "fuse", + .cell_name =3D "tsensor-pllx", + .dev_id =3D "700e2000.thermal-sensor", + .con_id =3D "pllx", + }, +}; + static const struct tegra_fuse_info tegra114_fuse_info =3D { .read =3D tegra30_fuse_read, .size =3D 0x2a0, @@ -127,6 +245,10 @@ const struct tegra_fuse_soc tegra114_fuse_soc =3D { .init =3D tegra30_fuse_init, .speedo_init =3D tegra114_init_speedo_data, .info =3D &tegra114_fuse_info, + .lookups =3D tegra114_fuse_lookups, + .num_lookups =3D ARRAY_SIZE(tegra114_fuse_lookups), + .cells =3D tegra114_fuse_cells, + .num_cells =3D ARRAY_SIZE(tegra114_fuse_cells), .soc_attr_group =3D &tegra_soc_attr_group, .clk_suspend_on =3D false, }; --=20 2.48.1 From nobody Fri Oct 3 20:58:16 2025 Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) (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 A7D232D97BF; Mon, 25 Aug 2025 10:40:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756118453; cv=none; b=Vhj1dl4JVI8C5o2UlMVXGHWqZDEthiyyV/B3tx/JMkJJ+bfMPqpNnVV8doX8HwWGbExJQ7QCw4muzyL5CQGyX71BJhWQLfy1MMXlff3PsY9gGtPki6lQn/lNd6Tl+K6Sx5KYUJXOjYv0Bc82R+2Tn4UDa6Uw+Ca2pNg4/KUSm8k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756118453; c=relaxed/simple; bh=L4F7l6/zYxQr6YTmwMkqwY0oWd9rKPsyg57GCchM8Aw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ohOVg+FOIQbT5+5Y+5F919M8DWiIu064ZW4dw0ArisZ4k/HYk5pPNSkH8JZArpvvVdLk1JwSNGTyrYJQiH/TuklgylBciPTJRJmGhEXWe34cPRDcgwh+ZnumjaZ40nBVSgIBJzft/1BW5uogzC1WK6KxJJH/Tq76Cg792DOyyJE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=GHbHIJ6N; arc=none smtp.client-ip=209.85.218.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GHbHIJ6N" Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-afcb7a0442bso683899166b.2; Mon, 25 Aug 2025 03:40:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1756118450; x=1756723250; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DSrkbcQygzyv3Mie6iN1oQzHFwmPp08jaxR7FqBTcno=; b=GHbHIJ6Ni1vq/npisC2kXKybgnXEISHbHNqIhyph7zmE8/wQfy5KwxAGd4TGG5i7+m dCgdat1OA2q2w3rbciQIFAMA6ptyOX9g6F1HtTKevexZBnEgCplAZIs6ngxKP6tKBWXj y/022FEQsdof14Ve+0NMYrAcELhQQdnmeDuuPXzBl6PcPrtB+myrxW0v6vEm/yV1+yLY 9E0KtCz8ji8BIzOuJp77yeJ4LKY7m5ZOpOLqLBhkci+iIwy2hIoQDMjvHP23yZU8wVv2 EdFos+2zIflmtK18cO7DrLkUAynTp1qtmQlAI6U3zzq/cXBMFOFMsTgC1ssAsQ2am5Sb yfZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756118450; x=1756723250; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DSrkbcQygzyv3Mie6iN1oQzHFwmPp08jaxR7FqBTcno=; b=CHN3piCuwl2wiQIe3esBlh0tyeYa/U21bh8KD2pIdmBZI8K9xtH/WB7WVxzGYaQNzy uNNo5OJNmlDBKC7N/qBLarMxkONT3ashTEx7+M/emm81wNOa9eYHqarR1dcSXGgcsgwi nfowRlu6x5sDa+K9wHQToP+sUXgaiq5hOh9aaL4EaI91QGGeHPojaQUOyjOvJGwEBJOH qCUwujA0jNHHsM4pBC2ZOz7rOgn2wPiEMXqxi1yt1XPWEdByZBMnGAZewxwlRV+lRXq0 i3xASHfeRb3IgXCajMzYZjDA/kcuWaXUUWvxC5ksaJcbOkUyEHDMPW1eSkCnu2eQFauD cE2A== X-Forwarded-Encrypted: i=1; AJvYcCUZuwZrw4JxbUKUKqYS6NoiSKEYpBZ7Jc+5Zij2yjnn6jgG+t3Kc9rjuov/bHWPnY3fVTi2GuKmtFGPuwqF@vger.kernel.org, AJvYcCUoKy4MVojt6fibkSa+l2mVgnz6hMDsIcYNj9R3/+YfSkbSTJCsrNKhHVApuftq+lBF1WO2R5xrELlskWM=@vger.kernel.org, AJvYcCVUGs3oIcUZuMwP3Q2R/cKAg6/LvzCyWeEpFhwjFCaODAUSd9swnMN0k8kfr3zEnrPsQ26aAUlmQcyl@vger.kernel.org X-Gm-Message-State: AOJu0YwjTZKHXcSXSXDZ8fYVfNlxW1ROHicV/9EEfqqjMnGXdmNYPmMk IiOBJW8H3QBzFQJb+BICCvpmhMQLunXNM2atvFgYGpdwBUE66TI60J0D X-Gm-Gg: ASbGnctaDmLsaskPQZ5A2m/sfsns+02A0gzj9R4aAO+3kjEb3z7yBQwgxtZzEmdvgd/ L2rIGE/BElNiJgbd6YwSzZ5EyoQDM5010gx1qK817NB0XmVvR6i7RxJflaormTJLXCMxUfZG0Hf QZJVIJjjqz1XeTC8D9F5lMh2OKN0jDrc+X6IzFMMZCxleGSYCs9Ux3JFZMr+FJaoVh27pfcjqZv QOtuFIHzQ3K3+PaIOVwxRwqIXoC2wFthta8JSlIEAX8X5t7xK48AYA9UZvwWmnQjwLc7PqaESbj qdrZhBUi3RIsVnHQvvEnYXTeX7eVJJ+D6MPqh7IR4kg/q+qPe6F4NY/uIgoDcybZxfX+nTb/cBV DbEF+pXBKjEI0MQ== X-Google-Smtp-Source: AGHT+IHAfkFcoQRhraeiFz0ZOQDIyEc89aUV0fmUXypSf12mRipHjKJQ+jiBaTi9dZRqm/RQFSAIBg== X-Received: by 2002:a17:907:7fa7:b0:ae9:ca8f:9642 with SMTP id a640c23a62f3a-afe29046523mr1079798166b.15.1756118449894; Mon, 25 Aug 2025 03:40:49 -0700 (PDT) Received: from xeon.. ([188.163.112.76]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-afe48fc0912sm531683166b.42.2025.08.25.03.40.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Aug 2025 03:40:49 -0700 (PDT) From: Svyatoslav Ryhel To: "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Thierry Reding , Thierry Reding , Mikko Perttunen , Jonathan Hunter , Svyatoslav Ryhel , "Jiri Slaby (SUSE)" , Jonathan Cameron , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 2/6] dt-bindings: thermal: document Tegra114 SOCTHERM Thermal Management System Date: Mon, 25 Aug 2025 13:40:22 +0300 Message-ID: <20250825104026.127911-3-clamor95@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250825104026.127911-1-clamor95@gmail.com> References: <20250825104026.127911-1-clamor95@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Document SOCTHERM Thermal Management System found in the Tegra 4 SoC. Signed-off-by: Svyatoslav Ryhel Acked-by: Rob Herring (Arm) --- .../devicetree/bindings/thermal/nvidia,tegra124-soctherm.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/thermal/nvidia,tegra124-soct= herm.yaml b/Documentation/devicetree/bindings/thermal/nvidia,tegra124-socth= erm.yaml index 19bb1f324183..2fd493fcca63 100644 --- a/Documentation/devicetree/bindings/thermal/nvidia,tegra124-soctherm.ya= ml +++ b/Documentation/devicetree/bindings/thermal/nvidia,tegra124-soctherm.ya= ml @@ -18,6 +18,7 @@ description: The SOCTHERM IP block contains thermal senso= rs, support for properties: compatible: enum: + - nvidia,tegra114-soctherm - nvidia,tegra124-soctherm - nvidia,tegra132-soctherm - nvidia,tegra210-soctherm @@ -205,6 +206,7 @@ allOf: compatible: contains: enum: + - nvidia,tegra114-soctherm - nvidia,tegra124-soctherm - nvidia,tegra210-soctherm then: --=20 2.48.1 From nobody Fri Oct 3 20:58:16 2025 Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) (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 25C612DC334; Mon, 25 Aug 2025 10:40:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756118455; cv=none; b=ZmmPlTq4e9+8XWmBBE+62JOuMw1p4dztTMHDacXipHXGBlE7W4LzLMeeZFnIj1OHVPILO8dK75yG7TEzl/tn+Ht2TgGAPxkShtbexsMTFQbuBYNhGde9N8tSCrLEiV7+4G4VvlnyD6z+F2GXSynr3V4DcPsrhT2QV24O7e+hdL0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756118455; c=relaxed/simple; bh=Xnt45zbD35wLoTl+5AbCCdKKoirSW1oz8V3Bwu2UoxQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sMtIx5HxSRI/E36M+JRDj+YrAPfZjCu91tDcyGfSjgf009jyYz5UdqZVjLohBkAt0fSyGGYT+JEs97ZUH8DAjZ1ejtxYYdZXihCTgzG4At+swjwCdjDlUI/lNtklabTli/AcpkIrf966ILU4hHmaqRO2YvPfear7s9mTZ8fgyQc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=K3f3gdp6; arc=none smtp.client-ip=209.85.208.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="K3f3gdp6" Received: by mail-ed1-f51.google.com with SMTP id 4fb4d7f45d1cf-61c7942597fso753411a12.0; Mon, 25 Aug 2025 03:40:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1756118451; x=1756723251; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zyE6oXJ2IS2LcgbbXFvVftjrnRH0L4njKeQQ5fQnHMg=; b=K3f3gdp6EJ/USYk/2WbgGDU7KjVtjX9Kfg3ulE5PxZ7Y7Qyss84HDzOVtOLwaODSbK qg3xtlesneG/N0aesvXHTcpYRDKS14NiXHdi5v2/hNIkrFJuQDQdJpfAD2grZeL9J4fj twFnLVBB0ElvYvrDsdwKbtJSPx2E0pzt8TqEIlTZmaTlKoiHtfhCSqrzaoHbyOkaVu6v o+YXB2uZu44eJEgCsey762lqZEEHU6hZTwVRgOAj3z6QY34HcCIP0WiaZ2wjmawwttIn 2wa1ZYAu7ikihvWpASrPZlgpIlO9GlwYXkppdwLiJ7aq0XKpOBzNgyTrhYBHK3tGZgi9 brKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756118451; x=1756723251; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zyE6oXJ2IS2LcgbbXFvVftjrnRH0L4njKeQQ5fQnHMg=; b=m5A2fgA1EoUqMPPIRUnwmHDBWReOkX48rr/F7Iau2jZZ51FFADjXadOWbHg1B0W9rg fSJF5bQD2BlSQAb+lnJJmhINGa3NDcKEz17rZXmSkUu00K8Ith2LlN9OlJAF5pSXo/Sw Cvnp0xPVRfKZ3fJsf7Gkpc/i+JMIp/TK7N6mE7DvAmY1ThjDp8qDWD4hxyDzB4l4sCxP cfxuF6+Lh3XIsBHym4zbDAxKVUML+wlzG44MyVK3ixIIV/TyYBhJHTMhD0PgGN8iJqFg eaPtjjWeAbuAasSjf+pLDYXIYpvqAOdb+tf5bRyODSOtu3oRH+y3Wx+DuWl7gSCRU7CQ KuIg== X-Forwarded-Encrypted: i=1; AJvYcCUgoNeANTLWFB+O7v2yVe8TagAklS0XRfXW+exQ1EuBoo8KlFIXlsj8ldJelsKZFJtVojaccz3Fd1FmcE4=@vger.kernel.org, AJvYcCWGP/R0roUQPgcRpKT3tZJIqZaitOebUx6zNYI4Y4c2gL9cywRDacYL6qPhwwMfvYbOLR2g8XnWFR8UC2fR@vger.kernel.org, AJvYcCXJ+iGeHrPXGdegI380sdmRgMWDo/sFGj8itaPPuSpdo4N2lNv9E9SlWwYcoemDXQI3RASH01sCsNPT@vger.kernel.org X-Gm-Message-State: AOJu0Yw3zzmyUocNZ/L5fa0G/wJ5RD0dQpreZewxzwZuywndX4r/GOPV jmeYHWe/Jq4WRO5Qua5V5rIlbyakctQD+2D0hODoKyg5DnAyyozCsssK X-Gm-Gg: ASbGncvo0ZoHirmQcBxgIBmezfRr7g0PCvZFtkqS1/0fKoeSK7jAb3k8cbHVjbidgjP GtVI4uq0CuEoL0oAvhUduP2HzFcZMHjoc723v1Yo5dGc4yhQn0inPlJpS4Sqv3g5M7ha8VJlt/n tM9fkjQljb6qlO9bLlI7xNSlbXgRacqWUFwiSBLD7Lnbq6uAgcy/R66Q7/VxA5obj6yK4nXGQXv 5BRMWTV7qTygfWL52PhJkbUg+PzE7GnN1IOHbkZy2RmwkrZQc4GclhFL3K4AXrGUHxHwSn0qIyF oeTIYCfM0r/kfPQotLStXzQ+Wo3XmsR5jZgY+PZXyjavKY3izWEKo5RFu/1Qdx9RQ66vl1YT8Uj FjRnDqkaTIhNxDw== X-Google-Smtp-Source: AGHT+IHDJZ5eAUFCgeYyRkFXmY57VnWYdlYZ8q/iUOvxKQXhjKrlkA38oVpRnDDM/xZ4QYfXyqJK2w== X-Received: by 2002:a17:906:bc47:b0:afe:834e:ac6c with SMTP id a640c23a62f3a-afe834eb4e2mr177878866b.7.1756118451285; Mon, 25 Aug 2025 03:40:51 -0700 (PDT) Received: from xeon.. ([188.163.112.76]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-afe48fc0912sm531683166b.42.2025.08.25.03.40.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Aug 2025 03:40:50 -0700 (PDT) From: Svyatoslav Ryhel To: "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Thierry Reding , Thierry Reding , Mikko Perttunen , Jonathan Hunter , Svyatoslav Ryhel , "Jiri Slaby (SUSE)" , Jonathan Cameron , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 3/6] thermal: tegra: soctherm-fuse: prepare calibration for Tegra114 support Date: Mon, 25 Aug 2025 13:40:23 +0300 Message-ID: <20250825104026.127911-4-clamor95@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250825104026.127911-1-clamor95@gmail.com> References: <20250825104026.127911-1-clamor95@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The Tegra114 has a different fuse calibration register layout and address compared to other Tegra SoCs, requiring SOCTHERM shift, mask, register address, and nominal tf calibration value to be configurable. Signed-off-by: Svyatoslav Ryhel Reviewed-by: Mikko Perttunen --- drivers/thermal/tegra/soctherm-fuse.c | 18 ++++++++++++------ drivers/thermal/tegra/soctherm.h | 7 ++++++- drivers/thermal/tegra/tegra124-soctherm.c | 4 ++++ drivers/thermal/tegra/tegra132-soctherm.c | 4 ++++ drivers/thermal/tegra/tegra210-soctherm.c | 4 ++++ 5 files changed, 30 insertions(+), 7 deletions(-) diff --git a/drivers/thermal/tegra/soctherm-fuse.c b/drivers/thermal/tegra/= soctherm-fuse.c index 190f95280e0b..8d37cd8c9122 100644 --- a/drivers/thermal/tegra/soctherm-fuse.c +++ b/drivers/thermal/tegra/soctherm-fuse.c @@ -9,15 +9,12 @@ =20 #include "soctherm.h" =20 -#define NOMINAL_CALIB_FT 105 #define NOMINAL_CALIB_CP 25 =20 #define FUSE_TSENSOR_CALIB_CP_TS_BASE_MASK 0x1fff #define FUSE_TSENSOR_CALIB_FT_TS_BASE_MASK (0x1fff << 13) #define FUSE_TSENSOR_CALIB_FT_TS_BASE_SHIFT 13 =20 -#define FUSE_TSENSOR_COMMON 0x180 - /* * Tegra210: Layout of bits in FUSE_TSENSOR_COMMON: * 3 2 1 0 @@ -26,7 +23,7 @@ * | BASE_FT | BASE_CP | SHFT_FT | SHIFT_CP | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * - * Tegra12x, etc: + * Tegra124: * In chips prior to Tegra210, this fuse was incorrectly sized as 26 bits, * and didn't hold SHIFT_CP in [31:26]. Therefore these missing six bits * were obtained via the FUSE_SPARE_REALIGNMENT_REG register [5:0]. @@ -44,6 +41,13 @@ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * |---------------------------------------------------| SHIFT_CP | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * + * Tegra114: Layout of bits in FUSE_TSENSOR_COMMON aka FUSE_VSENSOR_CALIB: + * 3 2 1 0 + * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | SHFT_FT | BASE_FT | SHIFT_CP | BASE_CP | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ =20 #define CALIB_COEFFICIENT 1000000LL @@ -77,7 +81,7 @@ int tegra_calc_shared_calib(const struct tegra_soctherm_f= use *tfuse, s32 shifted_cp, shifted_ft; int err; =20 - err =3D tegra_fuse_readl(FUSE_TSENSOR_COMMON, &val); + err =3D tegra_fuse_readl(tfuse->fuse_common_reg, &val); if (err) return err; =20 @@ -96,10 +100,12 @@ int tegra_calc_shared_calib(const struct tegra_socther= m_fuse *tfuse, return err; } =20 + shifted_cp =3D (val & tfuse->fuse_shift_cp_mask) >> + tfuse->fuse_shift_cp_shift; shifted_cp =3D sign_extend32(val, 5); =20 shared->actual_temp_cp =3D 2 * NOMINAL_CALIB_CP + shifted_cp; - shared->actual_temp_ft =3D 2 * NOMINAL_CALIB_FT + shifted_ft; + shared->actual_temp_ft =3D 2 * tfuse->nominal_calib_ft + shifted_ft; =20 return 0; } diff --git a/drivers/thermal/tegra/soctherm.h b/drivers/thermal/tegra/socth= erm.h index 70501e73d586..083388094fd4 100644 --- a/drivers/thermal/tegra/soctherm.h +++ b/drivers/thermal/tegra/soctherm.h @@ -56,6 +56,9 @@ #define SENSOR_TEMP2_MEM_TEMP_MASK (0xffff << 16) #define SENSOR_TEMP2_PLLX_TEMP_MASK 0xffff =20 +#define FUSE_VSENSOR_CALIB 0x08c +#define FUSE_TSENSOR_COMMON 0x180 + /** * struct tegra_tsensor_group - SOC_THERM sensor group data * @name: short name of the temperature sensor group @@ -109,9 +112,11 @@ struct tsensor_group_thermtrips { =20 struct tegra_soctherm_fuse { u32 fuse_base_cp_mask, fuse_base_cp_shift; + u32 fuse_shift_cp_mask, fuse_shift_cp_shift; u32 fuse_base_ft_mask, fuse_base_ft_shift; u32 fuse_shift_ft_mask, fuse_shift_ft_shift; - u32 fuse_spare_realignment; + u32 fuse_common_reg, fuse_spare_realignment; + u32 nominal_calib_ft; }; =20 struct tsensor_shared_calib { diff --git a/drivers/thermal/tegra/tegra124-soctherm.c b/drivers/thermal/te= gra/tegra124-soctherm.c index 20ad27f4d1a1..d86acff1b234 100644 --- a/drivers/thermal/tegra/tegra124-soctherm.c +++ b/drivers/thermal/tegra/tegra124-soctherm.c @@ -200,11 +200,15 @@ static const struct tegra_tsensor tegra124_tsensors[]= =3D { static const struct tegra_soctherm_fuse tegra124_soctherm_fuse =3D { .fuse_base_cp_mask =3D 0x3ff, .fuse_base_cp_shift =3D 0, + .fuse_shift_cp_mask =3D 0x3f, + .fuse_shift_cp_shift =3D 0, .fuse_base_ft_mask =3D 0x7ff << 10, .fuse_base_ft_shift =3D 10, .fuse_shift_ft_mask =3D 0x1f << 21, .fuse_shift_ft_shift =3D 21, + .fuse_common_reg =3D FUSE_TSENSOR_COMMON, .fuse_spare_realignment =3D 0x1fc, + .nominal_calib_ft =3D 105, }; =20 const struct tegra_soctherm_soc tegra124_soctherm =3D { diff --git a/drivers/thermal/tegra/tegra132-soctherm.c b/drivers/thermal/te= gra/tegra132-soctherm.c index b76308fdad9e..64c0363b9717 100644 --- a/drivers/thermal/tegra/tegra132-soctherm.c +++ b/drivers/thermal/tegra/tegra132-soctherm.c @@ -200,11 +200,15 @@ static struct tegra_tsensor tegra132_tsensors[] =3D { static const struct tegra_soctherm_fuse tegra132_soctherm_fuse =3D { .fuse_base_cp_mask =3D 0x3ff, .fuse_base_cp_shift =3D 0, + .fuse_shift_cp_mask =3D 0x3f, + .fuse_shift_cp_shift =3D 0, .fuse_base_ft_mask =3D 0x7ff << 10, .fuse_base_ft_shift =3D 10, .fuse_shift_ft_mask =3D 0x1f << 21, .fuse_shift_ft_shift =3D 21, + .fuse_common_reg =3D FUSE_TSENSOR_COMMON, .fuse_spare_realignment =3D 0x1fc, + .nominal_calib_ft =3D 105, }; =20 const struct tegra_soctherm_soc tegra132_soctherm =3D { diff --git a/drivers/thermal/tegra/tegra210-soctherm.c b/drivers/thermal/te= gra/tegra210-soctherm.c index d0ff793f18c5..f6e1493f0202 100644 --- a/drivers/thermal/tegra/tegra210-soctherm.c +++ b/drivers/thermal/tegra/tegra210-soctherm.c @@ -201,11 +201,15 @@ static const struct tegra_tsensor tegra210_tsensors[]= =3D { static const struct tegra_soctherm_fuse tegra210_soctherm_fuse =3D { .fuse_base_cp_mask =3D 0x3ff << 11, .fuse_base_cp_shift =3D 11, + .fuse_shift_cp_mask =3D 0x3f, + .fuse_shift_cp_shift =3D 0, .fuse_base_ft_mask =3D 0x7ff << 21, .fuse_base_ft_shift =3D 21, .fuse_shift_ft_mask =3D 0x1f << 6, .fuse_shift_ft_shift =3D 6, + .fuse_common_reg =3D FUSE_TSENSOR_COMMON, .fuse_spare_realignment =3D 0, + .nominal_calib_ft =3D 105, }; =20 static struct tsensor_group_thermtrips tegra210_tsensor_thermtrips[] =3D { --=20 2.48.1 From nobody Fri Oct 3 20:58:16 2025 Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (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 8894E2DF701; Mon, 25 Aug 2025 10:40:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756118457; cv=none; b=F7eu2LbhG2HUOykSfU+kjLF8+7yNvmGiaz+xjIbje37MCvCL+aaTF3QQOL9OqEusvzYyOIyIGL6DyKBkMISPy78OCfzU+nN0xGD4xX5fMkUgtEfq12IvEjOjX90IVB5A15H2jo2U5lJkLntPbYJKgr1iqExiL8jNTu4Y1YZYhXU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756118457; c=relaxed/simple; bh=gUmQ+Nf46bwGxjK8pVp+PQhFLZpu+LepZfvOsoRg3wc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=To3YubdoyP07aNQCV9vBVZqlHVyfXKSn+AYtNU6gM6xhUB3KpAMov+tMyMFmgxqCpVnMounD80qxQTp0dMBXt+oQEQaUakLVW2mzsw0X5t9NFmOP2YD/uQrLyoUczaUnPhHEBH2Fo0IHwLCxTodSZTCfw927erHBBooRnmXSSfs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=lHTduqsx; arc=none smtp.client-ip=209.85.218.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lHTduqsx" Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-afcb78c66dcso579393666b.1; Mon, 25 Aug 2025 03:40:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1756118453; x=1756723253; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=b/qizeYAvE4ouJx8E6D3heoPlpVqhCwX4j8ynBkYKjc=; b=lHTduqsxsufeHg1+vhSYK5V2d9H741V6m3wJtCs8XGjotGAgh+zkSGD51cC3o0dLuI qAK/595gBex5WyRjAKx/IUcWMkgJSPBBtJGVxN+8TWlqqskt5CivE8wxp7fhtkAMWRjh 0pdRElyDXjnQsT6jh3+WxdiQaRB5a4bpd2DtaATdfZaKgDefbjgiOoTw8BEyWZMzB6Hm KFZ7MWa6siI8b4aieJOpuDd9XRa3TnKkTwJCbCmZTZ/w+GPUA4lHL83ELFjWEuM177Gt jdUsEnJaRSEVm+CZTuWvLnBpmmZZlhGHV9f3qeq5hir7dzmTzaLmGkcsZDSxzlZW5Ddt oX9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756118453; x=1756723253; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=b/qizeYAvE4ouJx8E6D3heoPlpVqhCwX4j8ynBkYKjc=; b=D2Lbsac0yJlUUxkm0YqYe7tAJAapd68zN1x5iMMXH+DYLtYJlAM8QFUEj7bRL4KJmB NK3xh/1JGmTvzfp9y+pD6IvRPEPzF/aJnLwifO25zMHYEwWCM1BsRoA0R0uS9dCpMxxm Mj3IJaIDy1gj6F7RNNHj2EQ4Xu6ZVPkTqtaWTcFH2IzptHP9mgb71qJWgFBW1NrHDv0R m++sGgM14UJPhgc6p+XcIaq4BVq/iDy5D0PGZai6u4o/wsp7VRHvwymRLEH1bIX+4iNn D83BHb3jeQoWRNa1Hf/Qc/ot8qhI+qnOfRLKc8WBRH2Zh3iHtJNkeWiOcS4ch2ZcXzPS M/cg== X-Forwarded-Encrypted: i=1; AJvYcCVlGrIULCLFELDgwPb3SmH5yu0NVHxAJcpmaJN09XUC9qgFOflO9SMlvvLSzSlXIw4naUM/PfFkKJYWGbQ=@vger.kernel.org, AJvYcCWgb2J3eCAMTY1FPCJUFM9A4MpN3N4QyYe+yOo4ZJTA60oGA7ztHWCXZN+eZICAUdNme/Vy9uDqiX15ijzz@vger.kernel.org, AJvYcCX0euy3FaVk77er+AY5FPY0AK2Yp378ABG8Yhr75FHrEgG/h6ll4UoJBT4E+DsPh1Fbzr4qXtC94Sgr@vger.kernel.org X-Gm-Message-State: AOJu0YzLO7IXsfljnKCQagmg2H2iSG1pC/4TyLxW6tfni9ndzBWGrorJ 5p2BrrdJpaXm+K1WJTkLFfDwxbVEfX+PFmTGzuy4G1NCt6H/7Ge++6d7 X-Gm-Gg: ASbGnctc/kviijG9ge/j+FQlKahDrSD859g5ZflQDLaqNOBjgwe4qGpfXjydIFnO//7 YNGrUWBClY2vq/26q+Y//Bsiq9G2pqK6WU6QAkz5xW4Pz7dz3voziiUnzOKYh0OKmZYxCkoN4fT nVnD9pd8Dexz2iuPzcZY8MSFNpqsVMnR2KwsBq77Vs/6tjm4Wa8yIHOp/OCu3ddObSffwPNIGUv MUwka5gPomqWMATuvF/5WDewJSOQrEbu8xPF0IgtMvj+c7oE+EIKYrPeHeraQIpGzk8tsJosAeG YbzrX3C9UiIxBFNWABxiIv7uy0oAZU6lhyTvvyDZHOIGs5rDZZpvdpLhAtHlBUzKoKox4EjBJir kSRb7AOm8Q2rzDQ== X-Google-Smtp-Source: AGHT+IGBeiEhEejt8YHJ6sKKYFMjlFHRpzqgxuKF3WkFLDUjedUVpHRu79+/uIv8WkDg+Pi07J+ahg== X-Received: by 2002:a17:907:7b85:b0:afd:ff8c:1307 with SMTP id a640c23a62f3a-afe28ec571fmr1082375566b.11.1756118452699; Mon, 25 Aug 2025 03:40:52 -0700 (PDT) Received: from xeon.. ([188.163.112.76]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-afe48fc0912sm531683166b.42.2025.08.25.03.40.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Aug 2025 03:40:52 -0700 (PDT) From: Svyatoslav Ryhel To: "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Thierry Reding , Thierry Reding , Mikko Perttunen , Jonathan Hunter , Svyatoslav Ryhel , "Jiri Slaby (SUSE)" , Jonathan Cameron , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 4/6] dt-bindings: thermal: add Tegra114 soctherm header Date: Mon, 25 Aug 2025 13:40:24 +0300 Message-ID: <20250825104026.127911-5-clamor95@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250825104026.127911-1-clamor95@gmail.com> References: <20250825104026.127911-1-clamor95@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This adds header for the Tegra114 SOCTHERM device tree node. Signed-off-by: Svyatoslav Ryhel Acked-by: Conor Dooley Reviewed-by: Mikko Perttunen --- .../dt-bindings/thermal/tegra114-soctherm.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 include/dt-bindings/thermal/tegra114-soctherm.h diff --git a/include/dt-bindings/thermal/tegra114-soctherm.h b/include/dt-b= indings/thermal/tegra114-soctherm.h new file mode 100644 index 000000000000..b766a61cd1ce --- /dev/null +++ b/include/dt-bindings/thermal/tegra114-soctherm.h @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ +/* + * This header provides constants for binding nvidia,tegra114-soctherm. + */ + +#ifndef _DT_BINDINGS_THERMAL_TEGRA114_SOCTHERM_H +#define _DT_BINDINGS_THERMAL_TEGRA114_SOCTHERM_H + +#define TEGRA114_SOCTHERM_SENSOR_CPU 0 +#define TEGRA114_SOCTHERM_SENSOR_MEM 1 +#define TEGRA114_SOCTHERM_SENSOR_GPU 2 +#define TEGRA114_SOCTHERM_SENSOR_PLLX 3 + +#define TEGRA114_SOCTHERM_THROT_LEVEL_NONE 0 +#define TEGRA114_SOCTHERM_THROT_LEVEL_LOW 1 +#define TEGRA114_SOCTHERM_THROT_LEVEL_MED 2 +#define TEGRA114_SOCTHERM_THROT_LEVEL_HIGH 3 + +#endif --=20 2.48.1 From nobody Fri Oct 3 20:58:16 2025 Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) (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 431182DFF22; Mon, 25 Aug 2025 10:40:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756118458; cv=none; b=stEBBd85onrI8HLR6HgnyXI0JBK4G+GPOY4DoGwGNbp2mPTqst4YLFoyxoGBG9oKJM9IcYO4yxryAkSDCBFAEeeVchlkJcTWimLF57EfoJDwT7nlTgN1zAC+od+elCzz9zO8PwJSWiTiLRRyhvOxlJtma7YbUphpjREmhT3YiDo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756118458; c=relaxed/simple; bh=CMXGyan1mmi1dMEqZVsTBl5PSLejoP74ZPwN8+ompKQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PUNJtpEXxCaG3USMWMAb5kwiarD7QJWO/JYGD8vs6mPSuGwFqkDID+3L1zDmlEABo9MsOHzJY5ZQ0laqLTdmIzcd/VBYnwqG+/Q6j36rA2wv1vAQe+GbTXdg/ZvkaYhAAy7G6Rdrr4tZczKYgyrGqYzdBj3t0wybrLCltwNUWiw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=jRjLQfsA; arc=none smtp.client-ip=209.85.218.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jRjLQfsA" Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-afcb7a0442bso683910266b.2; Mon, 25 Aug 2025 03:40:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1756118454; x=1756723254; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wnKIz9nHEJ95XCItaOfD3Ca0Wjon4QgJyPWYb+yhaeY=; b=jRjLQfsAg77u5a1Z3gUUK4Q+MnuQMQTCvRTSyClviKIuFTyA6Le+I8O1JT+1clThZs mcyPsogRtEXL1Kle26dF0h8B8MMS/2i4lBWyhKfshKXFUKHANLQwhyLffO+UA+2iEaYS pfkjk4wxLrCB6CnVE4WsbC7SID9641sKFcgZZo5TFBNJgaH4CWLD6O5Qei/kg1vhg5MA wvEfBeE38nKHNoRdJi3BbDIBaXdzFf142/CS8f5gjbMkONTYL+ulYUyKKbaA6M/ubf8g KkmDA01ATG74iiOFYRUFu4OzMi2/SYmSks5ye6JXV52p5F307GjZCiphgO27HjLQHQKu QK4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756118454; x=1756723254; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wnKIz9nHEJ95XCItaOfD3Ca0Wjon4QgJyPWYb+yhaeY=; b=Ld1ouLbe0xkkVsDFGKetOaNxFA+ogfNMMYXXRC7UYT/Z+vQuoWppHpRI62Zy1Jlue0 Wi78Ch/Cpwn/AudYeKcWrKeIkzQNvQiUIDgz58CHRR6VFdv1IhZaLilkrZkOn9bzf59E BRDGzDEjW6scsulZRZdMFq9dmsKla+JGvgQNp7CnXFQvQJ3E9QnBBpHBrOjQadWB93HQ X+DOoIadjA/tTi39TVZar2I3npYu8U4kPiA09qbEOrHZjQaGxuz3Cd01+EPovk+t7yKK 1d2SiJsI+ns7yOo1eGb/SEkEl0lOSxanlV3JrOKVWr+LhHOkrt84D6R9anTccHpLXTo+ K3qQ== X-Forwarded-Encrypted: i=1; AJvYcCW4qjwBDkOCQ7z7zH13HF0IQezZDreAjlYMuBzsbjwlyuNt/khvbyQIR/58x/QDxuNNELY8KWTySlCA@vger.kernel.org, AJvYcCXojsXeRLGXavpkF6xb+HLSA3XrOxy/gBO2hEmNpF/8Z9jPvbTAIcpPKZGH3OqC+HKq5X7nav0KVfh0XWM=@vger.kernel.org, AJvYcCXusZLLPiBapfIy23rDJ2xs8UEDMOR4rOd7E5JIWeVm5U+vLPCVKPB19b+Rqt4xo0QM5TNSAx6ZNt8cpcJf@vger.kernel.org X-Gm-Message-State: AOJu0YwjFJY9jMmJkckiuTzheVENraQj1GL4xDeAWi+kU/0h3GU6ShJT XQ594uni1EZSwjA+//Qb0Z0/9I9XsVfKrV+nnG3O07swLE0p/jbM8X0l X-Gm-Gg: ASbGncvQvTy1AfatPJtp756ajT7JSREkBSmikgMT1pzYplcjJm1pwzKwtW8yU+qpPt6 8k2YK1cqrUAAFIyjJhSEDzsGYykyvIngjhthsx0DxVJS5PrsrqHK0sxzOokCZJKB55D2CYqnHhf lDCLvK36K9us90gqmK7upFTFwYmjYrs8Z+dhhBZwJp95r0FmHOdEyt68efgrUExWOKZYuH3TcZI z4IaVks5mF820tQnuvYcVkVS7Zp4sV3LgCHDmZckIXnP1CJrxNu8v53ftxap8ci6eMt88QAgF6w PuYRWJqJoNRWPGGeZbgYOkZK34P4PvTUZ6N0JIDb7Ta0o+hc3SR33Qw9WiKaX6UTQ4zBfjWj7M8 htEGTjl+ztbmp+A== X-Google-Smtp-Source: AGHT+IGfOGHbaewzwZHlD3JKTq0m9oqX3rR+1CiqKKvPziqMkYcR3fF61yk0PmVT02Gv8Am1qoToBQ== X-Received: by 2002:a17:907:6e92:b0:af9:5b3f:2dfc with SMTP id a640c23a62f3a-afe2965ac9fmr925010466b.47.1756118454081; Mon, 25 Aug 2025 03:40:54 -0700 (PDT) Received: from xeon.. ([188.163.112.76]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-afe48fc0912sm531683166b.42.2025.08.25.03.40.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Aug 2025 03:40:53 -0700 (PDT) From: Svyatoslav Ryhel To: "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Thierry Reding , Thierry Reding , Mikko Perttunen , Jonathan Hunter , Svyatoslav Ryhel , "Jiri Slaby (SUSE)" , Jonathan Cameron , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 5/6] thermal: tegra: add Tegra114 specific SOCTHERM driver Date: Mon, 25 Aug 2025 13:40:25 +0300 Message-ID: <20250825104026.127911-6-clamor95@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250825104026.127911-1-clamor95@gmail.com> References: <20250825104026.127911-1-clamor95@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add Tegra114 specific SOCTHERM driver. Signed-off-by: Svyatoslav Ryhel --- drivers/thermal/tegra/Makefile | 1 + drivers/thermal/tegra/soctherm.c | 6 + drivers/thermal/tegra/soctherm.h | 4 + drivers/thermal/tegra/tegra114-soctherm.c | 209 ++++++++++++++++++++++ 4 files changed, 220 insertions(+) create mode 100644 drivers/thermal/tegra/tegra114-soctherm.c diff --git a/drivers/thermal/tegra/Makefile b/drivers/thermal/tegra/Makefile index eb27d194c583..9b3e91f7fb97 100644 --- a/drivers/thermal/tegra/Makefile +++ b/drivers/thermal/tegra/Makefile @@ -4,6 +4,7 @@ obj-$(CONFIG_TEGRA_BPMP_THERMAL) +=3D tegra-bpmp-thermal.o obj-$(CONFIG_TEGRA30_TSENSOR) +=3D tegra30-tsensor.o =20 tegra-soctherm-y :=3D soctherm.o soctherm-fuse.o +tegra-soctherm-$(CONFIG_ARCH_TEGRA_114_SOC) +=3D tegra114-soctherm.o tegra-soctherm-$(CONFIG_ARCH_TEGRA_124_SOC) +=3D tegra124-soctherm.o tegra-soctherm-$(CONFIG_ARCH_TEGRA_132_SOC) +=3D tegra132-soctherm.o tegra-soctherm-$(CONFIG_ARCH_TEGRA_210_SOC) +=3D tegra210-soctherm.o diff --git a/drivers/thermal/tegra/soctherm.c b/drivers/thermal/tegra/socth= erm.c index 926f1052e6de..bfc438fbdc59 100644 --- a/drivers/thermal/tegra/soctherm.c +++ b/drivers/thermal/tegra/soctherm.c @@ -2048,6 +2048,12 @@ static void soctherm_init(struct platform_device *pd= ev) } =20 static const struct of_device_id tegra_soctherm_of_match[] =3D { +#ifdef CONFIG_ARCH_TEGRA_114_SOC + { + .compatible =3D "nvidia,tegra114-soctherm", + .data =3D &tegra114_soctherm, + }, +#endif #ifdef CONFIG_ARCH_TEGRA_124_SOC { .compatible =3D "nvidia,tegra124-soctherm", diff --git a/drivers/thermal/tegra/soctherm.h b/drivers/thermal/tegra/socth= erm.h index 083388094fd4..aa4af9268b05 100644 --- a/drivers/thermal/tegra/soctherm.h +++ b/drivers/thermal/tegra/soctherm.h @@ -142,6 +142,10 @@ int tegra_calc_tsensor_calib(const struct tegra_tsenso= r *sensor, const struct tsensor_shared_calib *shared, u32 *calib); =20 +#ifdef CONFIG_ARCH_TEGRA_114_SOC +extern const struct tegra_soctherm_soc tegra114_soctherm; +#endif + #ifdef CONFIG_ARCH_TEGRA_124_SOC extern const struct tegra_soctherm_soc tegra124_soctherm; #endif diff --git a/drivers/thermal/tegra/tegra114-soctherm.c b/drivers/thermal/te= gra/tegra114-soctherm.c new file mode 100644 index 000000000000..a573a9d1439c --- /dev/null +++ b/drivers/thermal/tegra/tegra114-soctherm.c @@ -0,0 +1,209 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2014-2018, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2024, Svyatoslav Ryhel + */ + +#include +#include + +#include + +#include "soctherm.h" + +#define TEGRA114_THERMTRIP_ANY_EN_MASK (0x1 << 28) +#define TEGRA114_THERMTRIP_MEM_EN_MASK (0x1 << 27) +#define TEGRA114_THERMTRIP_GPU_EN_MASK (0x1 << 26) +#define TEGRA114_THERMTRIP_CPU_EN_MASK (0x1 << 25) +#define TEGRA114_THERMTRIP_TSENSE_EN_MASK (0x1 << 24) +#define TEGRA114_THERMTRIP_GPUMEM_THRESH_MASK (0xff << 16) +#define TEGRA114_THERMTRIP_CPU_THRESH_MASK (0xff << 8) +#define TEGRA114_THERMTRIP_TSENSE_THRESH_MASK 0xff + +#define TEGRA114_THERMCTL_LVL0_UP_THRESH_MASK (0xff << 17) +#define TEGRA114_THERMCTL_LVL0_DN_THRESH_MASK (0xff << 9) + +#define TEGRA114_THRESH_GRAIN 1000 +#define TEGRA114_BPTT 8 + +static const struct tegra_tsensor_configuration tegra114_tsensor_config = =3D { + .tall =3D 16300, + .tiddq_en =3D 1, + .ten_count =3D 1, + .tsample =3D 163, + .tsample_ate =3D 655, +}; + +static const struct tegra_tsensor_group tegra114_tsensor_group_cpu =3D { + .id =3D TEGRA114_SOCTHERM_SENSOR_CPU, + .name =3D "cpu", + .sensor_temp_offset =3D SENSOR_TEMP1, + .sensor_temp_mask =3D SENSOR_TEMP1_CPU_TEMP_MASK, + .pdiv =3D 10, + .pdiv_ate =3D 10, + .pdiv_mask =3D SENSOR_PDIV_CPU_MASK, + .pllx_hotspot_diff =3D 10, + .pllx_hotspot_mask =3D SENSOR_HOTSPOT_CPU_MASK, + .thermtrip_any_en_mask =3D TEGRA114_THERMTRIP_ANY_EN_MASK, + .thermtrip_enable_mask =3D TEGRA114_THERMTRIP_CPU_EN_MASK, + .thermtrip_threshold_mask =3D TEGRA114_THERMTRIP_CPU_THRESH_MASK, + .thermctl_isr_mask =3D THERM_IRQ_CPU_MASK, + .thermctl_lvl0_offset =3D THERMCTL_LEVEL0_GROUP_CPU, + .thermctl_lvl0_up_thresh_mask =3D TEGRA114_THERMCTL_LVL0_UP_THRESH_MASK, + .thermctl_lvl0_dn_thresh_mask =3D TEGRA114_THERMCTL_LVL0_DN_THRESH_MASK, +}; + +static const struct tegra_tsensor_group tegra114_tsensor_group_gpu =3D { + .id =3D TEGRA114_SOCTHERM_SENSOR_GPU, + .name =3D "gpu", + .sensor_temp_offset =3D SENSOR_TEMP1, + .sensor_temp_mask =3D SENSOR_TEMP1_GPU_TEMP_MASK, + .pdiv =3D 10, + .pdiv_ate =3D 10, + .pdiv_mask =3D SENSOR_PDIV_GPU_MASK, + .pllx_hotspot_diff =3D 5, + .pllx_hotspot_mask =3D SENSOR_HOTSPOT_GPU_MASK, + .thermtrip_any_en_mask =3D TEGRA114_THERMTRIP_ANY_EN_MASK, + .thermtrip_enable_mask =3D TEGRA114_THERMTRIP_GPU_EN_MASK, + .thermtrip_threshold_mask =3D TEGRA114_THERMTRIP_GPUMEM_THRESH_MASK, + .thermctl_isr_mask =3D THERM_IRQ_GPU_MASK, + .thermctl_lvl0_offset =3D THERMCTL_LEVEL0_GROUP_GPU, + .thermctl_lvl0_up_thresh_mask =3D TEGRA114_THERMCTL_LVL0_UP_THRESH_MASK, + .thermctl_lvl0_dn_thresh_mask =3D TEGRA114_THERMCTL_LVL0_DN_THRESH_MASK, +}; + +static const struct tegra_tsensor_group tegra114_tsensor_group_pll =3D { + .id =3D TEGRA114_SOCTHERM_SENSOR_PLLX, + .name =3D "pll", + .sensor_temp_offset =3D SENSOR_TEMP2, + .sensor_temp_mask =3D SENSOR_TEMP2_PLLX_TEMP_MASK, + .pdiv =3D 10, + .pdiv_ate =3D 10, + .pdiv_mask =3D SENSOR_PDIV_PLLX_MASK, + .thermtrip_any_en_mask =3D TEGRA114_THERMTRIP_ANY_EN_MASK, + .thermtrip_enable_mask =3D TEGRA114_THERMTRIP_TSENSE_EN_MASK, + .thermtrip_threshold_mask =3D TEGRA114_THERMTRIP_TSENSE_THRESH_MASK, + .thermctl_isr_mask =3D THERM_IRQ_TSENSE_MASK, + .thermctl_lvl0_offset =3D THERMCTL_LEVEL0_GROUP_TSENSE, + .thermctl_lvl0_up_thresh_mask =3D TEGRA114_THERMCTL_LVL0_UP_THRESH_MASK, + .thermctl_lvl0_dn_thresh_mask =3D TEGRA114_THERMCTL_LVL0_DN_THRESH_MASK, +}; + +static const struct tegra_tsensor_group tegra114_tsensor_group_mem =3D { + .id =3D TEGRA114_SOCTHERM_SENSOR_MEM, + .name =3D "mem", + .sensor_temp_offset =3D SENSOR_TEMP2, + .sensor_temp_mask =3D SENSOR_TEMP2_MEM_TEMP_MASK, + .pdiv =3D 10, + .pdiv_ate =3D 10, + .pdiv_mask =3D SENSOR_PDIV_MEM_MASK, + .pllx_hotspot_diff =3D 0, + .pllx_hotspot_mask =3D SENSOR_HOTSPOT_MEM_MASK, + .thermtrip_any_en_mask =3D TEGRA114_THERMTRIP_ANY_EN_MASK, + .thermtrip_enable_mask =3D TEGRA114_THERMTRIP_MEM_EN_MASK, + .thermtrip_threshold_mask =3D TEGRA114_THERMTRIP_GPUMEM_THRESH_MASK, + .thermctl_isr_mask =3D THERM_IRQ_MEM_MASK, + .thermctl_lvl0_offset =3D THERMCTL_LEVEL0_GROUP_MEM, + .thermctl_lvl0_up_thresh_mask =3D TEGRA114_THERMCTL_LVL0_UP_THRESH_MASK, + .thermctl_lvl0_dn_thresh_mask =3D TEGRA114_THERMCTL_LVL0_DN_THRESH_MASK, +}; + +static const struct tegra_tsensor_group *tegra114_tsensor_groups[] =3D { + &tegra114_tsensor_group_cpu, + &tegra114_tsensor_group_gpu, + &tegra114_tsensor_group_pll, + &tegra114_tsensor_group_mem, +}; + +static const struct tegra_tsensor tegra114_tsensors[] =3D { + { + .name =3D "cpu0", + .base =3D 0xc0, + .config =3D &tegra114_tsensor_config, + .calib_fuse_offset =3D 0x098, + .fuse_corr_alpha =3D 1196400, + .fuse_corr_beta =3D -13600000, + .group =3D &tegra114_tsensor_group_cpu, + }, { + .name =3D "cpu1", + .base =3D 0xe0, + .config =3D &tegra114_tsensor_config, + .calib_fuse_offset =3D 0x084, + .fuse_corr_alpha =3D 1196400, + .fuse_corr_beta =3D -13600000, + .group =3D &tegra114_tsensor_group_cpu, + }, { + .name =3D "cpu2", + .base =3D 0x100, + .config =3D &tegra114_tsensor_config, + .calib_fuse_offset =3D 0x088, + .fuse_corr_alpha =3D 1196400, + .fuse_corr_beta =3D -13600000, + .group =3D &tegra114_tsensor_group_cpu, + }, { + .name =3D "cpu3", + .base =3D 0x120, + .config =3D &tegra114_tsensor_config, + .calib_fuse_offset =3D 0x12c, + .fuse_corr_alpha =3D 1196400, + .fuse_corr_beta =3D -13600000, + .group =3D &tegra114_tsensor_group_cpu, + }, { + .name =3D "mem0", + .base =3D 0x140, + .config =3D &tegra114_tsensor_config, + .calib_fuse_offset =3D 0x158, + .fuse_corr_alpha =3D 1000000, + .fuse_corr_beta =3D 0, + .group =3D &tegra114_tsensor_group_mem, + }, { + .name =3D "mem1", + .base =3D 0x160, + .config =3D &tegra114_tsensor_config, + .calib_fuse_offset =3D 0x15c, + .fuse_corr_alpha =3D 1000000, + .fuse_corr_beta =3D 0, + .group =3D &tegra114_tsensor_group_mem, + }, { + .name =3D "gpu", + .base =3D 0x180, + .config =3D &tegra114_tsensor_config, + .calib_fuse_offset =3D 0x154, + .fuse_corr_alpha =3D 1124500, + .fuse_corr_beta =3D -9793100, + .group =3D &tegra114_tsensor_group_gpu, + }, { + .name =3D "pllx", + .base =3D 0x1a0, + .config =3D &tegra114_tsensor_config, + .calib_fuse_offset =3D 0x160, + .fuse_corr_alpha =3D 1224200, + .fuse_corr_beta =3D -14665000, + .group =3D &tegra114_tsensor_group_pll, + }, +}; + +static const struct tegra_soctherm_fuse tegra114_soctherm_fuse =3D { + .fuse_base_cp_mask =3D 0x3ff, + .fuse_base_cp_shift =3D 0, + .fuse_shift_cp_mask =3D 0x3f << 10, + .fuse_shift_cp_shift =3D 10, + .fuse_base_ft_mask =3D 0x7ff << 16, + .fuse_base_ft_shift =3D 16, + .fuse_shift_ft_mask =3D 0x1f << 27, + .fuse_shift_ft_shift =3D 27, + .fuse_common_reg =3D FUSE_VSENSOR_CALIB, + .fuse_spare_realignment =3D 0, + .nominal_calib_ft =3D 90, +}; + +const struct tegra_soctherm_soc tegra114_soctherm =3D { + .tsensors =3D tegra114_tsensors, + .num_tsensors =3D ARRAY_SIZE(tegra114_tsensors), + .ttgs =3D tegra114_tsensor_groups, + .num_ttgs =3D ARRAY_SIZE(tegra114_tsensor_groups), + .tfuse =3D &tegra114_soctherm_fuse, + .thresh_grain =3D TEGRA114_THRESH_GRAIN, + .bptt =3D TEGRA114_BPTT, + .use_ccroc =3D false, +}; --=20 2.48.1 From nobody Fri Oct 3 20:58:16 2025 Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) (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 7604E2E040F; Mon, 25 Aug 2025 10:40:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756118459; cv=none; b=VaGlBxamjkxk2RwsYxbOFMjnqogcUOwuXSNPvv/HTCNV91wrXnypJ0HABZrgenRmtXvpSe4pmuaC4iALLMBri+/oTHoDgEi/MgAw9aEsimC2N20kh9khU4wn05/hlhNzS9GePBplp+HAuULsHYlAEYsrdPN3AQNZBLtFkcj9wdM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756118459; c=relaxed/simple; bh=LiQDhV5f50/8Y18H5j2Jv/XJTXQqqr5RKG1oaz5HZEw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=m57nBjNmfTgm7/aRpipEfeFQUld3EZvdVQbOAu4W5OAjwsBJoO/M6rVzCCDWizBWFzr3ypsMy2UU7UIvAdZcKRIYxUCr4eE7PaBEBNjh7WGXWtnW/q8UrdVCc3206n1GRUMkqY3PFyVG2IxL6c57tYMH2CHLBLobD1hLFzahpS0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=nDA4KYTy; arc=none smtp.client-ip=209.85.218.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nDA4KYTy" Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-afcb78d5dcbso606390666b.1; Mon, 25 Aug 2025 03:40:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1756118456; x=1756723256; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=c4CtVhRMDKYM8zIqd1+1OnEIHPKtfkbQqhJ8+qtXKU4=; b=nDA4KYTy9vBa5K1QWxNE3p9UQ34rqmmfiHP8OvqFM2sXQE3M6x5ZsWQI5MMq3KOC6m PdevP2blB3XN5Se8+kSypyrFggrYRCw2dwgp9TyJEWLL9lM+aipP41CPV7QXndrmyduu 8EMx6pWAZJCmFWhY5N+psaLnShz+IsQG8FxP3ETrvSShuuOj6S0PaBmYhq6eKZryLvBe 8IA6v3PjDUQ2OKXYd7r4NlxIegN+gWiIggTGcz+JpYAO3FXcfPxyBw5SCIYV2/5qgQ+v JHjSnoiXbPnfXSkstLUEUNOMIMxKlK0njq0KzPAGGTNSjDLDEdqzAvAFJWHqO8Sl3gfp bMWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756118456; x=1756723256; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=c4CtVhRMDKYM8zIqd1+1OnEIHPKtfkbQqhJ8+qtXKU4=; b=h7VQGvfTpQ2an2XIKqdQQibGgu7TFDIvgdHDzoHZJng6QkNCY2TCSkIauUYYI5hIfy u61oyv3eLfQ+rg3w6agj1dBlSekWNLXsIW9t2KtbRpsto0dL64CnH9bS5Tsh/9Shefl4 SbaejPQ1FZHBHzXhODhb33DwDMGlbsvpo2xAj280pWB7EyuxVTYxO7qNHzpIEgpvasTy 8HvIizc7IhFOuY1AIDa9zygObXqF6oWRkRHfm+Rupw/T6CL1mv7+UuVYsCUrvWZ5sSgg XdqoYUOuyLsZcFa97tKQmIMPNVV5yBkQp1UejpiFy0wqV5DSGquR+aCah1l8KCEe+dJq 8bdg== X-Forwarded-Encrypted: i=1; AJvYcCWKuP2+87st6KVT5hdYxN8OgZ0DZpioHyZMEGJUrSD7CPvJ+Zcv1AhqttsXp//M6x/XixL3Sc+jWJ/4j6E=@vger.kernel.org, AJvYcCWkMgzXMX+CmuN8S7uQLKM8lljFjHx/CU/3S6Rx4WbThKgvWi/DZ8Ne1fWEA4vyNVjtjORZoeE5sDF4AjVz@vger.kernel.org, AJvYcCXkSWcXLkTptnEBqsGwwMSXLNglgFtf54T1p7T/Xic00Hwp9PKadTiVWrbSWTGqZeUsXDqPmkzkUc1C@vger.kernel.org X-Gm-Message-State: AOJu0Yxbvj8y8ubj1j4c1a98X4EMhpCpQmwtbcJADCVT2wZ7iNsQ6/78 YwGqjNQI8IV19RtwP61kS67/0v44qvE5znP7ULoy7UazpZ2F+9AYnTt7 X-Gm-Gg: ASbGncuCb0V9GXPK21R1Zpnxchx8+rHuN9iiu00OohnH4QT2iN6PX4Q9JxN3k7u9R0W hfgu9iuyHb8ETMnfmzQcp76bRTV678RqqaR9So43Bd0/dESrNWQQq2641kh+AMjJ7SQK3dDblnh BKDFwN9dLzsXn77vHnEtYa2mIbWfEiVS6EJg7/lCrAS1cm04qNHfCIvlkH8JMoVMResE8TBRqr7 Q4yAqjk/+AHQVb8qtUKufjHitF+K/0/ZN6Z+tQha+8u3JaDyyrLvDLKQtXLGsmrMdyyqf8WSfxU ZpKUQY4OwANK4NwLSUt+XR41N3OkCASo8UrzOJZI8DGPJxsRKJdCEWLBl3TxHjQOXttvJGFY7Ih ojW6nV6VCUjx29BXrUv5yrvne X-Google-Smtp-Source: AGHT+IEeYr9TNk1VWe9Wo+X3NG7lISQ5/rcfCyk22+fD0nbjU56v5ZMUJZwenXbvl7cGuOACYB7uDQ== X-Received: by 2002:a17:907:268b:b0:af9:c31b:c558 with SMTP id a640c23a62f3a-afe29537f96mr1026367266b.35.1756118455513; Mon, 25 Aug 2025 03:40:55 -0700 (PDT) Received: from xeon.. ([188.163.112.76]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-afe48fc0912sm531683166b.42.2025.08.25.03.40.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Aug 2025 03:40:55 -0700 (PDT) From: Svyatoslav Ryhel To: "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Thierry Reding , Thierry Reding , Mikko Perttunen , Jonathan Hunter , Svyatoslav Ryhel , "Jiri Slaby (SUSE)" , Jonathan Cameron , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 6/6] ARM: tegra: add SOCTHERM support on Tegra114 Date: Mon, 25 Aug 2025 13:40:26 +0300 Message-ID: <20250825104026.127911-7-clamor95@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250825104026.127911-1-clamor95@gmail.com> References: <20250825104026.127911-1-clamor95@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add SOCTHERM and thermal zones nodes into common Tegra 4 device tree. Signed-off-by: Svyatoslav Ryhel Reviewed-by: Mikko Perttunen --- arch/arm/boot/dts/nvidia/tegra114.dtsi | 197 +++++++++++++++++++++++++ 1 file changed, 197 insertions(+) diff --git a/arch/arm/boot/dts/nvidia/tegra114.dtsi b/arch/arm/boot/dts/nvi= dia/tegra114.dtsi index 3ee51d7f3935..c666db564204 100644 --- a/arch/arm/boot/dts/nvidia/tegra114.dtsi +++ b/arch/arm/boot/dts/nvidia/tegra114.dtsi @@ -6,6 +6,7 @@ #include #include #include +#include =20 / { compatible =3D "nvidia,tegra114"; @@ -694,6 +695,46 @@ mipi: mipi@700e3000 { #nvidia,mipi-calibrate-cells =3D <1>; }; =20 + soctherm: thermal-sensor@700e2000 { + compatible =3D "nvidia,tegra114-soctherm"; + reg =3D <0x700e2000 0x600>, /* SOC_THERM reg_base */ + <0x60006000 0x400>; /* CAR reg_base */ + reg-names =3D "soctherm-reg", "car-reg"; + interrupts =3D , + ; + interrupt-names =3D "thermal", "edp"; + clocks =3D <&tegra_car TEGRA114_CLK_TSENSOR>, + <&tegra_car TEGRA114_CLK_SOC_THERM>; + clock-names =3D "tsensor", "soctherm"; + resets =3D <&tegra_car 78>; + reset-names =3D "soctherm"; + + assigned-clocks =3D <&tegra_car TEGRA114_CLK_TSENSOR>, + <&tegra_car TEGRA114_CLK_SOC_THERM>; + assigned-clock-rates =3D <500000>, <51000000>; + + assigned-clock-parents =3D <&tegra_car TEGRA114_CLK_CLK_M>, + <&tegra_car TEGRA114_CLK_PLL_P>; + + #thermal-sensor-cells =3D <1>; + + throttle-cfgs { + throttle_heavy: heavy { + nvidia,priority =3D <100>; + nvidia,cpu-throt-percent =3D <80>; + nvidia,gpu-throt-level =3D ; + #cooling-cells =3D <2>; + }; + + throttle_light: light { + nvidia,priority =3D <80>; + nvidia,cpu-throt-percent =3D <50>; + nvidia,gpu-throt-level =3D ; + #cooling-cells =3D <2>; + }; + }; + }; + dfll: clock@70110000 { compatible =3D "nvidia,tegra114-dfll"; reg =3D <0x70110000 0x100>, /* DFLL control */ @@ -858,24 +899,28 @@ cpu0: cpu@0 { clock-names =3D "cpu_g", "cpu_lp", "pll_x", "pll_p", "dfll"; /* FIXME: what's the actual transition time? */ clock-latency =3D <300000>; + #cooling-cells =3D <2>; }; =20 cpu1: cpu@1 { device_type =3D "cpu"; compatible =3D "arm,cortex-a15"; reg =3D <1>; + #cooling-cells =3D <2>; }; =20 cpu2: cpu@2 { device_type =3D "cpu"; compatible =3D "arm,cortex-a15"; reg =3D <2>; + #cooling-cells =3D <2>; }; =20 cpu3: cpu@3 { device_type =3D "cpu"; compatible =3D "arm,cortex-a15"; reg =3D <3>; + #cooling-cells =3D <2>; }; }; =20 @@ -888,6 +933,158 @@ pmu { interrupt-affinity =3D <&cpu0>, <&cpu1>, <&cpu2>, <&cpu3>; }; =20 + thermal-zones { + cpu-thermal { + polling-delay-passive =3D <1000>; + polling-delay =3D <1000>; + + thermal-sensors =3D + <&soctherm TEGRA114_SOCTHERM_SENSOR_CPU>; + + trips { + cpu-shutdown-trip { + temperature =3D <102000>; + hysteresis =3D <0>; + type =3D "critical"; + }; + + cpu_throttle_trip: cpu-throttle-trip { + temperature =3D <100000>; + hysteresis =3D <1000>; + type =3D "hot"; + }; + + cpu_balanced_trip: cpu-balanced-trip { + temperature =3D <90000>; + hysteresis =3D <1000>; + type =3D "passive"; + }; + }; + + cooling-maps { + map0 { + trip =3D <&cpu_throttle_trip>; + cooling-device =3D <&throttle_heavy 1 1>; + }; + + map1 { + trip =3D <&cpu_balanced_trip>; + cooling-device =3D <&throttle_light 1 1>; + }; + }; + }; + + mem-thermal { + polling-delay-passive =3D <1000>; + polling-delay =3D <1000>; + + thermal-sensors =3D + <&soctherm TEGRA114_SOCTHERM_SENSOR_MEM>; + + trips { + mem-shutdown-trip { + temperature =3D <102000>; + hysteresis =3D <0>; + type =3D "critical"; + }; + + mem_throttle_trip: mem-throttle-trip { + temperature =3D <100000>; + hysteresis =3D <1000>; + type =3D "hot"; + }; + + mem_balanced_trip: mem-balanced-trip { + temperature =3D <90000>; + hysteresis =3D <1000>; + type =3D "passive"; + }; + }; + + cooling-maps { + /* + * There are currently no cooling maps, + * because there are no cooling devices. + */ + }; + }; + + gpu-thermal { + polling-delay-passive =3D <1000>; + polling-delay =3D <1000>; + + thermal-sensors =3D + <&soctherm TEGRA114_SOCTHERM_SENSOR_GPU>; + + trips { + gpu-shutdown-trip { + temperature =3D <102000>; + hysteresis =3D <0>; + type =3D "critical"; + }; + + gpu_throttle_trip: gpu-throttle-trip { + temperature =3D <100000>; + hysteresis =3D <1000>; + type =3D "hot"; + }; + + gpu_balanced_trip: gpu-balanced-trip { + temperature =3D <90000>; + hysteresis =3D <1000>; + type =3D "passive"; + }; + }; + + cooling-maps { + map0 { + trip =3D <&gpu_throttle_trip>; + cooling-device =3D <&throttle_heavy 1 1>; + }; + + map1 { + trip =3D <&gpu_balanced_trip>; + cooling-device =3D <&throttle_light 1 1>; + }; + }; + }; + + pllx-thermal { + polling-delay-passive =3D <1000>; + polling-delay =3D <1000>; + + thermal-sensors =3D + <&soctherm TEGRA114_SOCTHERM_SENSOR_PLLX>; + + trips { + pllx-shutdown-trip { + temperature =3D <102000>; + hysteresis =3D <0>; + type =3D "critical"; + }; + + pllx_throttle_trip: pllx-throttle-trip { + temperature =3D <100000>; + hysteresis =3D <1000>; + type =3D "hot"; + }; + + pllx_balanced_trip: pllx-balanced-trip { + temperature =3D <90000>; + hysteresis =3D <1000>; + type =3D "passive"; + }; + }; + + cooling-maps { + /* + * There are currently no cooling maps, + * because there are no cooling devices. + */ + }; + }; + }; + timer { compatible =3D "arm,armv7-timer"; interrupts =3D --=20 2.48.1