From nobody Tue Oct 7 05:33:23 2025 Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (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 C1BE323A9BB; Mon, 14 Jul 2025 08:23:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752481394; cv=none; b=PQXP9bq203R8qeHIVeZy0E/z/VnBUPZmsfFWghkWoiM5EERzjYyHAouHfrPcdI7OfbgjbetbUVmpDQalAZ8N69dVZnNHFpmnnJdzG3DD0Mw9NieiKdJUnuODfByvS+KZoAB5KSr1E5T0gi2NDR3AMs8sZOlRlf0hXm9VzTqMJuU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752481394; c=relaxed/simple; bh=e/AbcwBM9uIFEwZ/6mpXZP2Y3Z4bGt/eHFgnbobATzs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RtUcJglQn1RNVlEP0KGZtLQKR8mywQiCU2047d4kwHPuG9UyLXwzWsRqXdaX8XaQ/szyQkjaf315y6JVY8gcBMOksGoR3WcNvgGVhrapX26qgoMaE/ZcboaJC38itI/1KD/nN+UG4d0hHlMciRik7za2rD0x5pkyXwKgvyyr+jE= 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=EnrPjiH8; arc=none smtp.client-ip=209.85.167.45 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="EnrPjiH8" Received: by mail-lf1-f45.google.com with SMTP id 2adb3069b0e04-558facbc19cso3154066e87.3; Mon, 14 Jul 2025 01:23:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752481391; x=1753086191; 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=Jv63TPoByrIyI7mUvMKjVHJSZMGf19SIsGRaSMWTF9U=; b=EnrPjiH8KzLL5jpO9FLX22VsfMzB95Ul9bxaLH7u6FoB+Sbqdq+OWia1hB+6iBagTd hnYTKaTeunyBVbDRnMQLOknYHanXQ2nA96yMe+P0Z511VixCHUENnCvQ8rEHBY8LEuSV AVWHIxjot1JaWz9CQPbUaAGEzmDoWhyDhsIQJB+niZLL3qcooe9gNI+XhnHHbDtPfky8 5Xen0usHwlmaxVyGR4BYTKLmyMBTMP5QTBQbmwO/ebAoSMCWMY6oJ8MXknEqNR/uNQXN o56bKgvtYtCrjHM7Ci7/4qmkqr1Mj2HLfmfXUHlc2TQJ6l3nnW/ispLfEUW0RHDVT+XV Oqzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752481391; x=1753086191; 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=Jv63TPoByrIyI7mUvMKjVHJSZMGf19SIsGRaSMWTF9U=; b=vDrjr3DDe87Ii5VV4cYs/KeWxL/+IAnnf0lfYbqTCdNuwJG9NNtEZnhkuz0/Y5pBp9 AEGQJQp9dcua8XmS6FeSToqimbSAx9nmOmb+evovap8Y92Fu2wi/LAPHLkNiJuiCDeJ3 Z29/9GK8iOBPgHcno5r7CPPiZzjy5ZT01OA/suw6AgWAcuwLm9lEjZ++GjSqsZKOEgEW tJStnu5I/HKYcL4Q9efJTuycEUEbu4ryXhNA1lcwaGANGCWfMIBmU+ptEvVULfImsfSe xs9tyeRspC1gI3Co+W0pjTNi7F57Yq4Zkp3pQgxy3T9zpIBPzSVl9C/gQ4ed9PCoAj5N g8cQ== X-Forwarded-Encrypted: i=1; AJvYcCUiJnsE3ZqMg4vglshjWhLr68Z3Y8UTPI1IR8drW4Jo0+v7nHukjT9gLOpa8ehLkyrtMvZoHYM3bkos7gin@vger.kernel.org, AJvYcCV5uUE2wqmr3qXrXgpqsETyKeQjvKATTBSCdf7bpZ6t0jRVbNbatH8TSvIgRuJXtNnVhb+reM0RoL2D2U0=@vger.kernel.org, AJvYcCW21V60eVHeeZZK6PGabeLaT7xpRQ7r1LByy9sS6QxnZRFZ90KgS8n5XNL9+3/vI3yfDyeFrmPNLdHZ@vger.kernel.org X-Gm-Message-State: AOJu0YxaEkKsC88wbulj0btQeN2Y1QbYcUZ5ia5GLhxbkir9WSQ2+nSC ik/bHWHPLqJIpP00ohVmGBjV1jUG8awVJJ2z1Wrqn43Q47/DuecWdggbjWei9g== X-Gm-Gg: ASbGnctjo1qApcdFPhgRrYpYXdzuUf85YWem3i4Ik8poziQYnovWSl2JnoKCFzIuhrr 9/SS6RTZPeaXnY+ODtQ71sUujpjt4f0NhOH/9PWFrMOIZgC29nh+0iFfT985vRyITxP1mm6KXyl AwaUIyTlUi7Qg5zwRpF+3ve5Dl/FbNmpeeVAIiKBVf+D9u91QFFExvyESMOMqsNDO/paM4Pk0eo 47Kp1yhZj2crmvyjsaAo10pI4ZzkLKyrPCA0HMCNzSrQjHhc/dEKlXbR6eIYyqdOcxogvdsycxy gDt1L8P9h5vyTkoQfvldjG4KMiQ6CFPg9TGPnm9ZV+xjyBiprCSB960yqyz5Ktsy4UilFpZm3+e Mg12FsVqh41Mbfw== X-Google-Smtp-Source: AGHT+IFWIm/1du1E9goD8K0HMm58wP6nFtbtAkp6kgsVQZapdXpGamxEE2sU+7knP42ZSgmU+w5Pdw== X-Received: by 2002:a05:6512:a8f:b0:553:2154:7bda with SMTP id 2adb3069b0e04-55a04633fdfmr3678522e87.38.1752481390457; Mon, 14 Jul 2025 01:23:10 -0700 (PDT) Received: from xeon.. ([188.163.112.60]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5593c7bbd55sm1885717e87.23.2025.07.14.01.23.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Jul 2025 01:23:10 -0700 (PDT) From: Svyatoslav Ryhel To: "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Thierry Reding , Thierry Reding , Jonathan Hunter , Svyatoslav Ryhel Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/5] soc: tegra: fuse: add Tegra114 nvmem cells and fuse lookups Date: Mon, 14 Jul 2025 11:22:48 +0300 Message-ID: <20250714082252.9028-2-clamor95@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250714082252.9028-1-clamor95@gmail.com> References: <20250714082252.9028-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 --- 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 Tue Oct 7 05:33:23 2025 Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) (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 B8B4A23BCE7; Mon, 14 Jul 2025 08:23:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752481395; cv=none; b=U6lbEMM3uEbigvkwJvXbqpw/sgK7jLbWlGBITLLR1evET9hgLipwfypOBw2DiEDIVRoalSzJzxMqsdSIt26fKDKPkpXkdPd1q/7uu7ttweUyNcTt7X+oX/i/COnCUEcA/26/YoRb+DP6SK8WkvKT1C0hi8r5qPspVwFejLF+Ifw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752481395; c=relaxed/simple; bh=L4F7l6/zYxQr6YTmwMkqwY0oWd9rKPsyg57GCchM8Aw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NKG50+DpXw1gh7QdC1LBEIOWrBx3cSdxDXZuxPB2yOwsfmVDydZWjmUrzaFcWUSWVyBM8fC0m6NMZExB9ZAibG1sEbIBovexj4cn15iQ4uSa6NOjWLnQDqhFK+eAQi66aU90+1OEf9gGtvFOMrVnOfz339Y9ZYeyEJpbmOPXmJo= 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=kX0yo8VO; arc=none smtp.client-ip=209.85.167.42 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="kX0yo8VO" Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-553ba7f11cbso4059418e87.1; Mon, 14 Jul 2025 01:23:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752481392; x=1753086192; 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=kX0yo8VOuUnTTumu9yc8DdXppiYOXrSaxtEuLGtVh6LqboCYttpFfqhVXXpY74b+4t g0vZKvzDPr2wKs1JoPRinOfkc/+ZZybgpDXV50G3RhL8IUx+07Xm2S/RGOUz7yXfMRnm 3NQj/o0N48/HuC6xfoV+dGr1xbQrj0tLxRe2/nn0fUjNtW7lTfK/16YVmFVjA5MR1b1e Q3OBpNkPszPcTX3pbZrhi/XXfV1el10pxjXji7YSI8dJbYhMRYWSegADJS6Y12IH7wDO gqjE1VGx9bqwnpvmDCIPcJcqHeFxsYxuKmccbQ6SbhNJnVpbI+0jy/himZVgxBOWXoQN 2KsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752481392; x=1753086192; 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=v4hS/GKh9aPkBfdSgWhLAFnCS3Nv3xIOfBGjKmkUij2rTGIB442nZWz6MZqgnAJk91 4py7ISYXr7vN7vi574V+Ys/hgLycuDkaVJcrVIK3dT9h7C0ot+vMiMD8SLr5MXqlGsdl 4ucEGknabXUcCrKLEWCzRVkjmrg/wfcrM7Kf2EIaf6g+MiXfS4oqhgK/cXdKF6sufnON TnWb8ZjLjISi1zMGsJUMuI/SA7AyICLHnmv+0o4Xzp5v7d+L+LEI+ahm2i6ZS5IX4cKf T+/A45spI4othqn9wfRe0PcS7+4s54KR7Ha11HcLscMx0xSjKjt8sL1cnTPDCVO5cvpQ Z4zQ== X-Forwarded-Encrypted: i=1; AJvYcCV3wIyYgUMW271gE662Bg2nQ0GJTB01I3dv7NAOATITkx6Vp1x+2RcnRRWHZp/OU86pEMPi77MpqhvQynMu@vger.kernel.org, AJvYcCXRM7zN+s4KoSMohf23PuFbgvGFTGn+90HphzRHSFdF5bvyrYHt5SipSfBAKcFXMxyfamKi+TCd87/O@vger.kernel.org, AJvYcCXf03R7MxGb+cMiH+57wqZBhm4+s1NEpvwaNIbFqxK2af3Nh4tcOoOsuWmF0zW4eJBB0b1eBjtDCMr4ueM=@vger.kernel.org X-Gm-Message-State: AOJu0YyA6WfBttMvBun0xTSGsM3wrxjqdvXNVEW05Aoqj6CrafwLANBf +E3trrBGgnYjqgczklvhhwtbdaBZJ57bRBnzxWzsKDl6585m+5t57uG9 X-Gm-Gg: ASbGncsahE19NURF3GIScwg9IL4S1QSfnrCUkqKOTVCqA1D7LxTzRm4WpfSk70aco8o sbufAcBjd4wZvC1+826rto9VltQ2OCPdEdDBnkVqXVaar1hax5ffp+BG4TIjdWLMZl9TfJjDw9Q aqxVUIN/ofV1hKE7/9glQk9s3JI8AokwJsd97xW2YJjqZOTkN5wh3ktbKf0vKHA48qKRILNMwvx 9GECzkvK8VvM0oYX3x9xXq+0bCoxAf4eyn+gm10wf0d8jhSK6yv3yN4217G7N8rJuTT7X6u+yWq ELFMRq9cJ9i/R0w3RMC1QUiTSivVWeDwF2ros/nNSAt9C69ZBEhi7eI0G9I/v1MG+68TECDokji CwYlUYcDY5zFcNg== X-Google-Smtp-Source: AGHT+IHMAgKkWpEX3FsXPuaRIjrzy0JmSPPty76/YLtFw/J7YCaMvn4uKAxsmtffU09MvZ4cbh+Rrg== X-Received: by 2002:a05:6512:138a:b0:553:33b9:bd3a with SMTP id 2adb3069b0e04-55a0464fbe4mr3163683e87.53.1752481391576; Mon, 14 Jul 2025 01:23:11 -0700 (PDT) Received: from xeon.. ([188.163.112.60]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5593c7bbd55sm1885717e87.23.2025.07.14.01.23.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Jul 2025 01:23:11 -0700 (PDT) From: Svyatoslav Ryhel To: "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Thierry Reding , Thierry Reding , Jonathan Hunter , Svyatoslav Ryhel Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/5] dt-bindings: thermal: Document Tegra114 SOCTHERM Thermal Management System Date: Mon, 14 Jul 2025 11:22:49 +0300 Message-ID: <20250714082252.9028-3-clamor95@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250714082252.9028-1-clamor95@gmail.com> References: <20250714082252.9028-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 Tue Oct 7 05:33:23 2025 Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) (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 BB33C23BD1F; Mon, 14 Jul 2025 08:23:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752481396; cv=none; b=Eu4YzAqcd8Vtrz7udjA7R25sFOb8SudhGVzx4xQBVhXK8KA8OIPaHAT+APeb4rDB7yakZ8XccYmID0hk22BHg1VARXd33H97sJvmWQd1XAiIuEF5vXR4Q4pM0Z0mzIfc/DQmQVi44DIpoqVKndPawGgBrHup8o/UEFgDHefv/IU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752481396; c=relaxed/simple; bh=TgtXIAr3IGEHvtydhEWp8c7auiDqocGddu9PnevEWY4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MsocCvNkKEirJVmeJaUVumpDRZu+xfa1UDKRlRHCFTOdVSxxazTqunS7DLws7W63IgxCGN/p3Ek/sJ+sQaYqyPxPgudYXTbG8H08aEV8IKWVc1wyXDbP1zKhw99IjmWg85C+lrlvz5uiXCh/0FiE7z/JjAzOguZyFmgTM2ETIMI= 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=UX/8FocX; arc=none smtp.client-ip=209.85.167.47 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="UX/8FocX" Received: by mail-lf1-f47.google.com with SMTP id 2adb3069b0e04-5562838ce68so3698052e87.2; Mon, 14 Jul 2025 01:23:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752481393; x=1753086193; 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=miny/PoDyZMHIwzlLhKH1Yc3uh/Hp6mfXYgqs94khEQ=; b=UX/8FocXfhuym/E851IPv7eGG5zhUEmNfNz4hqcgoCKjuuJdnoWAde1BxPm9bhO9gD dZBirmp5uYoy44lcclbmFPpE826m9tCGLHAiGAAOPyFoBtjGxb3NKHa6cbFAznzgAesR JMwyDQRtxHW1oiTEjnjFQ1jxyUgZMeca6+eJNEaCESvV5I+2eJ380G3Te2Lj7btXr9Tu FfM7Y02nRoszTT3x7yHdZWrS/hvHgbw+iT6kygD43RPvtq8+kVU3GSlPuzjkO9dqcXJb 2t2ZF5SaA7HTqbzJLgKdp8+GIidO8q61sTNnO3jy+mdnoso7ZfJ3nEr6aPK19YX42bg7 U4XQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752481393; x=1753086193; 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=miny/PoDyZMHIwzlLhKH1Yc3uh/Hp6mfXYgqs94khEQ=; b=EUkEhhyOxGzbcTNnmt/uhdyCCvhkedroSolvdn9EDc/0c57cqLWNDGY6RLU17BPJ43 bdZlUItr3syTFtYJm5C3muJIp/Qi02eui0pDL5hszhiEN+FqEjelzvOmeAJ2ljWlbpH2 IfqljXVZJ1dQuQ1zZxo9gSjxIQexXJ6W7K4jNaX/kUU8bxuhRUazowaH9sviClxBqfki CZ+CIHgekjTp6tYkSIREglk2xLbnz92ijHqXR5OHMFcwd9kubQnpjYDsQq9iuJZ47yB2 ySMuie0/g7RYhF1368/atUfPxyQUWWDgdTrSk3i6e8H78x1foQvW8IzmrjPfZnCtfecL 665w== X-Forwarded-Encrypted: i=1; AJvYcCUQgLv9gTLisfNlX2U32hyntEpgM0QWphfNb5qbwWB2DB/27O1X3dr1skOpBy28Ivt8kpD/5GvcuISJ@vger.kernel.org, AJvYcCUtc0l/4tueDnw6+VuzmzldIbVG0n5ehFZ+vb9XXlygwIKXP1r45JdHd1WY2eny5zNpILdeQBGoyRjL9wk=@vger.kernel.org, AJvYcCW1Y30QpkOnO8XIrNZwuekj3U14RAqV/urWLgTvxZmrvvf7BzWq3oBXABWzE01DbCvEhA21IwScx58CYOsh@vger.kernel.org X-Gm-Message-State: AOJu0YwTn4q8/Xvszt//wRCiP8zb1vA1JqMEcGee0+a1//g+YxDaUAI4 yhrKQcBuY9OqK9AuOM4DzGmaw/jEzhq5JsNDyRZ1BxhkOFXRTjVNE7lN X-Gm-Gg: ASbGncvKed0pCrf7ARhtY/RS/scdiDvQseLXzS+UaZEBGtz9wM4FpOQ4FlMe1T5cv0H gzKQH81R/kgQ2Q6zUWco2WvDhWUFeXiFsaL69HXEsyyohrh6i4cwpmWdu1t8A7UWJSlYi5RhlBK 1skvpl+UJQhsRTEos8DBk/Qpk/yuxyb8vIOeb8bY7Qw+HWU6jW6OA9otDM/kQvlgf08edS5tCLr 15KPqNI1qWbujyZXhECyYbysu6wP/LaSsbEp3RuW3lh9600uBBdddFtyyECBRrSx1jPZgPyxeQ3 pYeTmMKo4vZ9EaXbgo/waQjKK+4sUDs1SyySz/KTwdH96x4Zp1bCJNrc7N4y3IG6FlpzfSMORg1 ffOOHGEa4mLcrGA== X-Google-Smtp-Source: AGHT+IEc0k/25lJHfPH/NAZGPwTE3tsVDZzLNsCMdRivHyYK6OkyC24M55OLkdNlSvsBdaqBoCnu0g== X-Received: by 2002:ac2:4c45:0:b0:553:2c65:f1ca with SMTP id 2adb3069b0e04-55a044e902cmr3118686e87.19.1752481392570; Mon, 14 Jul 2025 01:23:12 -0700 (PDT) Received: from xeon.. ([188.163.112.60]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5593c7bbd55sm1885717e87.23.2025.07.14.01.23.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Jul 2025 01:23:12 -0700 (PDT) From: Svyatoslav Ryhel To: "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Thierry Reding , Thierry Reding , Jonathan Hunter , Svyatoslav Ryhel Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/5] thermal: tegra: soctherm-fuse: parametrize configuration further Date: Mon, 14 Jul 2025 11:22:50 +0300 Message-ID: <20250714082252.9028-4-clamor95@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250714082252.9028-1-clamor95@gmail.com> References: <20250714082252.9028-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" Prepare soctherm fuse calibration for Tegra114 support. Signed-off-by: Svyatoslav Ryhel --- drivers/thermal/tegra/soctherm-fuse.c | 33 ++++++++++++++++------- drivers/thermal/tegra/soctherm.h | 13 ++++++++- drivers/thermal/tegra/tegra124-soctherm.c | 8 ++++++ drivers/thermal/tegra/tegra132-soctherm.c | 8 ++++++ drivers/thermal/tegra/tegra210-soctherm.c | 8 ++++++ 5 files changed, 59 insertions(+), 11 deletions(-) diff --git a/drivers/thermal/tegra/soctherm-fuse.c b/drivers/thermal/tegra/= soctherm-fuse.c index 190f95280e0b..3b808c4521b8 100644 --- a/drivers/thermal/tegra/soctherm-fuse.c +++ b/drivers/thermal/tegra/soctherm-fuse.c @@ -9,15 +9,10 @@ =20 #include "soctherm.h" =20 -#define NOMINAL_CALIB_FT 105 -#define NOMINAL_CALIB_CP 25 - #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 @@ -44,6 +39,13 @@ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * |---------------------------------------------------| SHIFT_CP | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * + * Tegra11x: 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 +79,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 @@ -88,7 +90,7 @@ int tegra_calc_shared_calib(const struct tegra_soctherm_f= use *tfuse, =20 shifted_ft =3D (val & tfuse->fuse_shift_ft_mask) >> tfuse->fuse_shift_ft_shift; - shifted_ft =3D sign_extend32(shifted_ft, 4); + shifted_ft =3D sign_extend32(shifted_ft, tfuse->fuse_shift_ft_bits); =20 if (tfuse->fuse_spare_realignment) { err =3D tegra_fuse_readl(tfuse->fuse_spare_realignment, &val); @@ -96,10 +98,21 @@ int tegra_calc_shared_calib(const struct tegra_soctherm= _fuse *tfuse, return err; } =20 - shifted_cp =3D sign_extend32(val, 5); + shifted_cp =3D (val & tfuse->fuse_shift_cp_mask) >> + tfuse->fuse_shift_cp_shift; + shifted_cp =3D sign_extend32(val, tfuse->fuse_shift_cp_bits); =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_cp =3D 2 * tfuse->nominal_calib_cp + shifted_cp; + shared->actual_temp_ft =3D 2 * tfuse->nominal_calib_ft + shifted_ft; + + /* + * Tegra114 provides fuse thermal corrections in 0.5C while expected + * precision should be 1C + */ + if (tfuse->lower_precision) { + shared->actual_temp_cp /=3D 2; + shared->actual_temp_ft /=3D 2; + } =20 return 0; } diff --git a/drivers/thermal/tegra/soctherm.h b/drivers/thermal/tegra/socth= erm.h index 70501e73d586..6c0e0cc594a5 100644 --- a/drivers/thermal/tegra/soctherm.h +++ b/drivers/thermal/tegra/soctherm.h @@ -56,6 +56,13 @@ #define SENSOR_TEMP2_MEM_TEMP_MASK (0xffff << 16) #define SENSOR_TEMP2_PLLX_TEMP_MASK 0xffff =20 +#define NOMINAL_CALIB_FT 105 +#define T114X_CALIB_FT 90 +#define NOMINAL_CALIB_CP 25 + +#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 +116,13 @@ 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_shift_cp_bits, fuse_shift_ft_bits; + u32 fuse_common_reg, fuse_spare_realignment; + u32 nominal_calib_cp, nominal_calib_ft; + bool lower_precision; }; =20 struct tsensor_shared_calib { diff --git a/drivers/thermal/tegra/tegra124-soctherm.c b/drivers/thermal/te= gra/tegra124-soctherm.c index 20ad27f4d1a1..dd4dd7e9014d 100644 --- a/drivers/thermal/tegra/tegra124-soctherm.c +++ b/drivers/thermal/tegra/tegra124-soctherm.c @@ -200,11 +200,19 @@ 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 0x1f, + .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_shift_cp_bits =3D 5, + .fuse_shift_ft_bits =3D 4, + .fuse_common_reg =3D FUSE_TSENSOR_COMMON, .fuse_spare_realignment =3D 0x1fc, + .nominal_calib_cp =3D NOMINAL_CALIB_CP, + .nominal_calib_ft =3D NOMINAL_CALIB_FT, + .lower_precision =3D false, }; =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..926836426688 100644 --- a/drivers/thermal/tegra/tegra132-soctherm.c +++ b/drivers/thermal/tegra/tegra132-soctherm.c @@ -200,11 +200,19 @@ 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 0x1f, + .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_shift_cp_bits =3D 5, + .fuse_shift_ft_bits =3D 4, + .fuse_common_reg =3D FUSE_TSENSOR_COMMON, .fuse_spare_realignment =3D 0x1fc, + .nominal_calib_cp =3D NOMINAL_CALIB_CP, + .nominal_calib_ft =3D NOMINAL_CALIB_FT, + .lower_precision =3D false, }; =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..2877a7b43f2a 100644 --- a/drivers/thermal/tegra/tegra210-soctherm.c +++ b/drivers/thermal/tegra/tegra210-soctherm.c @@ -201,11 +201,19 @@ 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 0x1f, + .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_shift_cp_bits =3D 5, + .fuse_shift_ft_bits =3D 4, + .fuse_common_reg =3D FUSE_TSENSOR_COMMON, .fuse_spare_realignment =3D 0, + .nominal_calib_cp =3D NOMINAL_CALIB_CP, + .nominal_calib_ft =3D NOMINAL_CALIB_FT, + .lower_precision =3D false, }; =20 static struct tsensor_group_thermtrips tegra210_tsensor_thermtrips[] =3D { --=20 2.48.1 From nobody Tue Oct 7 05:33:23 2025 Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) (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 C127523E350; Mon, 14 Jul 2025 08:23:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752481398; cv=none; b=Jx4ipMSBMzgf3sdTRo88CvCXZvqxRMFxQ5sSEtCz2H/qjFvfF5YzeYFBzB7ykXhcpMGbeEZwPM0KVElHztpGANR6jMbrzLC4afNo1xm8F40cskZj/1hKdQGRWJtJ0FkaAhnwWdOZiyiqm+IcJPYQeYvidlzIWuPP7vzunGZv6CE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752481398; c=relaxed/simple; bh=HN4x+rGbwFeeGQ9jkNrN2rjGKUNghNgRdAhOiIYBkVg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RbtjY2w4YHYZgaHbHFGzKoVVY6UNDE+mZ5BSogRpHUis/kWk4untOQTlT1FuyF05RBOeFhoXh9TzE9nGBwl4xhu/VTKReDkk6jrr9VmIUzRcJeDch5wUaNfY/m5mWON2kIRynuS3T5xQMvQiUUzo2dtSQ2sM0wqT/PtkQr+Vz5k= 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=jTZupbhV; arc=none smtp.client-ip=209.85.167.42 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="jTZupbhV" Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-55a10c74f31so1019381e87.1; Mon, 14 Jul 2025 01:23:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752481394; x=1753086194; 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=n161/sPnFiwcbLYbE50unUbqsgVzUjhparEDLVM1oPc=; b=jTZupbhVunmiPEQMgv0ex3m5ebJLCHdV7n0WyD3TbJ10cDGaLLUKPqGNJrfEo8eSZ6 VV0KQ/yaImUQVT2qG/qhWAl7/OmYjJq8LgIpK4qfl5QXy0s4BRwxWLLBgLjBRX145Dv5 XibYLN4rAVsG7mhCTMW/yc9FA58aIrQcMGCuxANnfr/zX6kRKFDCk/VwTMe6S7FYAi8X jf9wqIFkG2aoCyoEofODhffdQo3LczmFskB+USVOGJ+N948LoYQPq6ec5ee3sB3kYwEQ vBoBXkXKHn36B/CXglAp44uSigqWcycAXcmyaxhUYGzZAwITqU/d9cnkK8o1LBJW2QE8 /Jug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752481394; x=1753086194; 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=n161/sPnFiwcbLYbE50unUbqsgVzUjhparEDLVM1oPc=; b=ttu/D0Jr8l8c/dJpMwpqQ42XyyKPIjJM2ThK3udV6HGUK5Ug08bqmTBBgaawYd5XqB J8Gjsvxg19659lOdRWml2Nz3zeg4iY5tgINNoMFfw3j5zensukRIxgh5und6NVXjfWea 0jqPbtC71J2qLUS+DgQlYHeNWFqriOP20qriBuumlPnRivOX7z8dLndGicqmDfubaPoz L/qRtF1jqH3gxeT/6zMrM/UoJSAeJqBbpci2iJWUBaaox5FrO5mgTOu8qEFavURB6mQu dLjwYUAqbA8J4XhXOC9j+5WlXiJG3EJcwWLXC56kAUL5omKLBUnKeYRCXFfBXlZB8rDE A60A== X-Forwarded-Encrypted: i=1; AJvYcCUjNe3Hm5gZl+YpuV5c/EqQhDfLSgzWAcL8+TAlWSy8ibTTcI6XSMwF81zf0UQBnSDa2sSguIeam31UUb2I@vger.kernel.org, AJvYcCW3fXROFxMSilqBLXfo2ilx8iBVZZuvJrVWtWGZXu9DF3vu6rkpr4gK6GLtNjgr8X0VvFKJAfRHIszS@vger.kernel.org, AJvYcCW8RHfjK1KrIbZQCPTANsp8RwmWIa7QDds6D/fsXCx/+hbbPihhmf96dowGMmd/8WbXNfEzOj6AHo8Ik1U=@vger.kernel.org X-Gm-Message-State: AOJu0Ywu4GJ9ufn1ZHLf5BmeHK5qirpriUTx9PIJOKssadRnQnsL0CDh 0NDn35Vk/aQ5DKEOC3Rhz0mZL3fBjJCTqvi0QfaIebacYLu7brJIuB6v X-Gm-Gg: ASbGncsWn5ekXk9UVUNX/fdalSLeXSPJV9kppeJwvVdgXbuOhXCAmgu1gQTJM+s3e4j u50mdK+Y1tJzVh5N515OIln81ENOWJyWn4mAyPXN2OcLQG4bugKBvSQEfnhsPMti2d5WEtlPFHh FnWcFORRwdrrxNCIdGzUMIRl5Au1x/G7xrz18QVkdc2mR1Jp8b14JAbIwn6YKn6RRFO5qZ0tHtF W1/5KaS3YAEK8TqcluZk6OETFreb4NNh1im2NGRCObcNFcVf6+Lf8EnvdoVQFuQEaBoAin7+z8u kDuXC2Y0mXx48bFjP2oASt89VJSOGgBC0tzwv3u5ZCeoE1WVX+9oZXF7FIFcC8rgnLxDfiFldaY Ur0zKgEZ4Nejlbw== X-Google-Smtp-Source: AGHT+IEUUG5cBKShW5NaWvde+aF8M8RHEwkoUq29euhOPK2At83JPy6xfJiQTYlcS4gbwVfx4SRVug== X-Received: by 2002:a05:6512:10d6:b0:553:a3b0:4d2b with SMTP id 2adb3069b0e04-55a044c96cdmr3265169e87.6.1752481393583; Mon, 14 Jul 2025 01:23:13 -0700 (PDT) Received: from xeon.. ([188.163.112.60]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5593c7bbd55sm1885717e87.23.2025.07.14.01.23.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Jul 2025 01:23:13 -0700 (PDT) From: Svyatoslav Ryhel To: "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Thierry Reding , Thierry Reding , Jonathan Hunter , Svyatoslav Ryhel Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 4/5] thermal: tegra: add Tegra114 specific SOCTHERM driver Date: Mon, 14 Jul 2025 11:22:51 +0300 Message-ID: <20250714082252.9028-5-clamor95@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250714082252.9028-1-clamor95@gmail.com> References: <20250714082252.9028-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 | 213 ++++++++++++++++++++++ 4 files changed, 224 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 2c5ddf0db40c..7bdab2add7af 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 6c0e0cc594a5..75ee2a520886 100644 --- a/drivers/thermal/tegra/soctherm.h +++ b/drivers/thermal/tegra/soctherm.h @@ -148,6 +148,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..eca65ec6f8c1 --- /dev/null +++ b/drivers/thermal/tegra/tegra114-soctherm.c @@ -0,0 +1,213 @@ +// 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 TEGRA124_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 TEGRA124_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 TEGRA124_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 TEGRA124_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_shift_cp_bits =3D 6, + .fuse_shift_ft_bits =3D 5, + .fuse_common_reg =3D FUSE_VSENSOR_CALIB, + .fuse_spare_realignment =3D 0, + .nominal_calib_cp =3D NOMINAL_CALIB_CP, + .nominal_calib_ft =3D T114X_CALIB_FT, + .lower_precision =3D true, +}; + +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 Tue Oct 7 05:33:23 2025 Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) (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 CC51523BF83; Mon, 14 Jul 2025 08:23:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752481398; cv=none; b=t+GGaar4lT1Q1A7bclfmby5TNp3WZujgj0ysSPnmoTWdbBJKYjKttENLN1r6Psxtfs1vL2fbELkkBQU3l2s91TXb7SEitZmF0Ff5MOSndxF+AgYOeXe6IctBp2wuMZrK8Mz00GRHvda1K9GcuW6VNKKQeiCbE+V9lH+nFXVrWKs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752481398; c=relaxed/simple; bh=RbHojCbVC/Hq/OqnG628eJg4f5VkM1uFiH8D9O341j4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AukV3Vpc8UE4OcLWkO+6mSR4imZpdGXdR/o0rkCSXFGY9KeWkCnlTkQmhc+Z/YF4O6SiCrA0M9BGThqPfwGA49YTlLpIZmfBWeb15RgxfdDpfGZ0C6seYWx9iyre/CIgZMEqGWXJCoZqTRXRsE4+0tAqv3gD+dhQixRWd9VTkG4= 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=gW5p75Zb; arc=none smtp.client-ip=209.85.167.43 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="gW5p75Zb" Received: by mail-lf1-f43.google.com with SMTP id 2adb3069b0e04-553ba7f11cbso4059462e87.1; Mon, 14 Jul 2025 01:23:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752481395; x=1753086195; 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=xMm7DyHGHXbdPdoaT3XLOxvCXV+6TZVhfFm+ZVxjYW0=; b=gW5p75ZblDT/uG2PkuvKn3R+jQ+Bh1MPPmeDWj1JA1D2IIPGqE7MsRbp737qJSfzod d6gLGWuKj/Ek0eOJoxqQBBzVIDZQaO/blvaLjhUDGzXFdLOxTGdnO0n3y+b+1ozayvi6 LubzhD8mxDdqVZABj51CBrcyVlKdkiR27MHZVTKlrYzFL97xz06RTLfS1nT3c27MZ9Zp bICNp6x4mzh2xDmZzzEg3qokJttjm0qxnyp1H2jjNXDIumFzRFcj0HWnJ03+8jVMis8+ 0U19g4g8P68wYHgYVRVr0/zt/IFmo373Sa4wjGWZAfWmTW4fwyPuixS3iJfTua5y3tOL iXfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752481395; x=1753086195; 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=xMm7DyHGHXbdPdoaT3XLOxvCXV+6TZVhfFm+ZVxjYW0=; b=ZtX/5nMe1ERcA12rspt7nbvMn9pnRxtU8rrzPkvbTUwX0hUnYvoPqQqv6SDY/P8KoN h4bHfZBRuyvoierhmjXAVgW6TmuBL3tvUyVgH5GIfTZLJh8tlivlrOfMhibteEmqGPvj KiyZMGD7VH+GkT2ox2lW4HGGqGb/HIH4/OJPEmbEha0Z5HdQqTUoszwjOBF6cK9UYwTS n33lAMIK6yQq2xZhNa9oBsl/YCRQBGWD7PTYob0RomqmlTNW8SwVRcjNMyzyEWut5ukw lVzDT6yOQOOmRsC+UnRmSdhLabmJwGXWwBxLnoMgtBp4yUHYqi5TImkXSNuVH7PfwBw7 GXPQ== X-Forwarded-Encrypted: i=1; AJvYcCVZ10g6KCEt/t+SUjRp1GLHf83TrZQiEahf7RuUZ9eq5dYizrZF03tUHRn18/N8nK6+9BV0Ew0q4gtb@vger.kernel.org, AJvYcCVzHf3L7SUvCLxhXRNpT/5GsaIyERavW9b6xY4XJ0KLeM7147pEcRS2O6AbSp8d5f0JH2ryKiSjgXcYQt0=@vger.kernel.org, AJvYcCXtOTWfqc0ZO0NgiB0HN6IEqRn46x28VC95e9CY7KhjaPgOn1viFNf0pY2KPFbadUz5jaLMJROeRKfcIUiV@vger.kernel.org X-Gm-Message-State: AOJu0Yz+nVfcgG5ZWyj8RTr8UTPGQe8/YZu/17kyo9R2Rt6aGjWIKRfU Cu1AjRKMF8UvoPCEBj2Md9+eFexlrPtUe1aTEE45HlqEHORO4HJfiFw1 X-Gm-Gg: ASbGncsB+Lxn9dt1LnnvB+sqiLEnIMWJN7Zwq3bqtEeVlcpaPNUVzOYRhaui1e2zvEB t7zdF5cMJ3N26f2k5Wpr1AsO484eadTSPqmxrfKwKAIPC1LhlSj2ddKPnjFv+SHhLbO11x7sdM3 /eVxUXbhSax1yKrlwS9XW8M9gyX2E5sQ9wY5CMEm1FvO8xLNLTxRKWB5H0IQogtrYH3/J8H9SB6 QJNkVxR3IKoh4gXZD+e8+NtrXU7peh85UH8mIrgNRZ/Vlf4OOOx5O++Hykc+prkSUznu8NCf+tV 2oEUM24ed9BAQN5krkdPWSNISsRKWnPaWcM978ktWyzxOjvXCkVg3B13U0JjOAru4nKmpzZHvbz aZxC93F7eYdVuIju4yZNMzTEh X-Google-Smtp-Source: AGHT+IEe6S5kqUviV3u3C+WB/1UIJgAf9fqj+Tk6HiZAF5T3MEyPbDasWUUavrPThOLVynFogYcHqw== X-Received: by 2002:a05:6512:2251:b0:553:2dce:3aad with SMTP id 2adb3069b0e04-55a044b4aa7mr2858473e87.7.1752481394700; Mon, 14 Jul 2025 01:23:14 -0700 (PDT) Received: from xeon.. ([188.163.112.60]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5593c7bbd55sm1885717e87.23.2025.07.14.01.23.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Jul 2025 01:23:14 -0700 (PDT) From: Svyatoslav Ryhel To: "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Thierry Reding , Thierry Reding , Jonathan Hunter , Svyatoslav Ryhel Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 5/5] ARM: tegra: Add SOCTHERM support on Tegra114 Date: Mon, 14 Jul 2025 11:22:52 +0300 Message-ID: <20250714082252.9028-6-clamor95@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250714082252.9028-1-clamor95@gmail.com> References: <20250714082252.9028-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 --- 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..cb30a7948e19 100644 --- a/arch/arm/boot/dts/nvidia/tegra114.dtsi +++ b/arch/arm/boot/dts/nvidia/tegra114.dtsi @@ -5,6 +5,7 @@ #include #include #include +#include #include =20 / { @@ -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 TEGRA124_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 TEGRA124_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 TEGRA124_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 TEGRA124_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