From: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>
To: sbabic@denx.de, festevam@gmail.com
Cc: u-boot@lists.denx.de, Alice Guo <alice.guo@nxp.com>,
Ye Li <ye.li@nxp.com>, Peng Fan <peng.fan@nxp.com>
Subject: [PATCH 18/20] imx8ulp: implement to obtain the SoC current temperature
Date: Fri, 29 Oct 2021 09:46:32 +0800 [thread overview]
Message-ID: <20211029014634.20949-19-peng.fan@oss.nxp.com> (raw)
In-Reply-To: <20211029014634.20949-1-peng.fan@oss.nxp.com>
From: Alice Guo <alice.guo@nxp.com>
Obatin the SoC current temperature in print_cpuinfo().
Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Alice Guo <alice.guo@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
arch/arm/mach-imx/imx8ulp/soc.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/arch/arm/mach-imx/imx8ulp/soc.c b/arch/arm/mach-imx/imx8ulp/soc.c
index 943ea7fb7e..934b0ef038 100644
--- a/arch/arm/mach-imx/imx8ulp/soc.c
+++ b/arch/arm/mach-imx/imx8ulp/soc.c
@@ -24,6 +24,7 @@
#include <dm/device.h>
#include <dm/uclass-internal.h>
#include <fuse.h>
+#include <thermal.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -216,6 +217,22 @@ int print_cpuinfo(void)
(cpurev & 0x000F0) >> 4, (cpurev & 0x0000F) >> 0,
mxc_get_clock(MXC_ARM_CLK) / 1000000);
+#if defined(CONFIG_IMX_PMC_TEMPERATURE)
+ struct udevice *udev;
+ int ret, temp;
+
+ ret = uclass_get_device(UCLASS_THERMAL, 0, &udev);
+ if (!ret) {
+ ret = thermal_get_temp(udev, &temp);
+ if (!ret)
+ printf("CPU current temperature: %d\n", temp);
+ else
+ debug(" - failed to get CPU current temperature\n");
+ } else {
+ debug(" - failed to get CPU current temperature\n");
+ }
+#endif
+
printf("Reset cause: %s\n", get_reset_cause(cause));
printf("Boot mode: ");
--
2.30.0
next prev parent reply other threads:[~2021-10-29 1:17 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-29 1:46 [PATCH 00/20] i.MX8ULP misc update Peng Fan (OSS)
2021-10-29 1:46 ` [PATCH 01/20] imx8ulp: soc: Check the DBD_EN fuse before setting RDC Peng Fan (OSS)
2022-02-05 16:42 ` sbabic
2021-10-29 1:46 ` [PATCH 02/20] arm: imx8ulp: Allocate LPAV resources to AP domain Peng Fan (OSS)
2022-02-05 16:39 ` sbabic
2021-10-29 1:46 ` [PATCH 03/20] imx8ulp: assign PXP/HIFI4/EPDC to APD domain Peng Fan (OSS)
2022-02-05 16:43 ` sbabic
2021-10-29 1:46 ` [PATCH 04/20] imx8ulp: clock: Support LPAV clocks in cgc and pcc Peng Fan (OSS)
2022-02-05 16:39 ` sbabic
2021-10-29 1:46 ` [PATCH 05/20] imx8ulp: clock: Add MIPI DSI clock and DCNano clock Peng Fan (OSS)
2022-02-05 16:44 ` sbabic
2021-10-29 1:46 ` [PATCH 06/20] imx8ulp: rdc: allow A35 access flexspi0 mem Peng Fan (OSS)
2022-02-05 16:43 ` sbabic
2021-10-29 1:46 ` [PATCH 07/20] imx8ulp_evk: Control LPI2C0 PCA6416 and TPM0 for display Peng Fan (OSS)
2022-02-05 16:43 ` sbabic
2021-10-29 1:46 ` [PATCH 08/20] imx8ulp: Set DCNANO read QoS on NIC_LPAV to highest Peng Fan (OSS)
2022-02-05 16:39 ` sbabic
2021-10-29 1:46 ` [PATCH 09/20] imx8ulp: Fix DCNANO QoS setting Peng Fan (OSS)
2022-02-05 16:42 ` sbabic
2021-10-29 1:46 ` [PATCH 10/20] imx8ulp: Remove freescale name from CPU revision Peng Fan (OSS)
2022-02-05 16:41 ` sbabic
2021-10-29 1:46 ` [PATCH 11/20] imx8ulp: Workaround LPOSC_TRIM fuse load issue Peng Fan (OSS)
2022-02-05 16:40 ` sbabic
2021-10-29 1:46 ` [PATCH 12/20] imx8ulp: clock: Reset DDR controller before clock enable Peng Fan (OSS)
2022-02-05 16:41 ` sbabic
2021-10-29 1:46 ` [PATCH 13/20] imx8ulp: clock: Support to reset DCNano and MIPI DSI Peng Fan (OSS)
2022-02-05 16:41 ` sbabic
2021-10-29 1:46 ` [PATCH 14/20] imx8ulp: Update ethernet mac to get from fuse Peng Fan (OSS)
2022-02-05 16:40 ` sbabic
2021-10-29 1:46 ` [PATCH 15/20] imx8ulp: clock: Support to enable/disable the ADC1 clock Peng Fan (OSS)
2022-02-05 16:43 ` sbabic
2021-10-29 1:46 ` [PATCH 16/20] imx8ulp: clock: Handle the DDRLOCKED when setting DDR clock Peng Fan (OSS)
2022-02-05 16:43 ` sbabic
2021-10-29 1:46 ` Peng Fan (OSS) [this message]
2022-02-05 16:42 ` [PATCH 18/20] imx8ulp: implement to obtain the SoC current temperature sbabic
2021-10-29 1:46 ` [PATCH 19/20] imx8ulp:ddr: saving the dram config timing data into sram Peng Fan (OSS)
2022-02-05 16:40 ` sbabic
2021-10-29 1:46 ` [PATCH 20/20] imx8ulp: ddr: Fix DDR frequency request issue Peng Fan (OSS)
2022-02-05 16:40 ` sbabic
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211029014634.20949-19-peng.fan@oss.nxp.com \
--to=peng.fan@oss.nxp.com \
--cc=alice.guo@nxp.com \
--cc=festevam@gmail.com \
--cc=peng.fan@nxp.com \
--cc=sbabic@denx.de \
--cc=u-boot@lists.denx.de \
--cc=ye.li@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).