From: Andre Przywara <andre.przywara@arm.com> To: Vasily Khoruzhick <anarsoul@gmail.com>, Yangtao Li <tiny.windzz@gmail.com>, Chen-Yu Tsai <wens@csie.org>, Jernej Skrabec <jernej.skrabec@gmail.com>, Samuel Holland <samuel@sholland.org> Cc: "Rafael J . Wysocki" <rafael@kernel.org>, Daniel Lezcano <daniel.lezcano@linaro.org>, Zhang Rui <rui.zhang@intel.com>, Lukasz Luba <lukasz.luba@arm.com>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Martin Botka <martin.botka@somainline.org>, Maksim Kiselev <bigunclemax@gmail.com>, Bob McChesney <bob@electricworry.net>, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev Subject: [PATCH v4 0/7] add support for H616 thermal system Date: Fri, 9 Feb 2024 14:42:14 +0000 [thread overview] Message-ID: <20240209144221.3602382-1-andre.przywara@arm.com> (raw) Hi, this is v4 of the series originally by Martin, complemented by patches to fix the problem with way-too-high temperatures reported on some boards, and some refactoring and simplifications, compared to the original drop. For the SYS_CFG bit poke code I now avoided the term "syscon" at all, instead using "sram" instead, which seems to be less controversial. Apart from that the register poke part hasn't changed much, but I hope it's more acceptable now that it doesn't claim to be using a syscon device. Many thanks to Maksim's investigation into the code, which revealed that the calibrate functions between the H6 and H616 are actually the same, just with support for more sensors. So his new patch 4/7 refactors the existing function, to make it compatible to the H616, which makes the actual support patch 6/7 very simple. See the Changelog below for more details. ================== This series introduces support for the thermal sensors in the Allwinner H616 SoCs, which includes its siblings H618 and T507. The actual temperature reading turns out to be very similar to the H6 SoC, just with support for two more sensors. One nasty complication is caused by reports about temperatures above 200C, which are related to the firmware being run (because the vendor U-Boot contains a hack avoiding this problem). Some investigation and digging in BSP code later we identified that bit 16 in register 0x3000000 (SYS_CFG) needs to be cleared for the raw temperature register values to contain reasonable values. To achieve this, patch 1/7 exports this very register from the already existing SRAM/syscon device. Patch 5/7 then adds code to the thermal driver to find that device via a new DT property, and query its regmap to clear bit 16 in there. I am open to suggestions on how to solve this in a better way, but the current solution works, and uses an existing driver and an existing scheme (in the EMAC driver). The rest of the patches are fairly straight-forward and build on Martin's original work, with some simplifications, resulting in more code sharing. Please have a look! Cheers, Andre Changelog v3 .. v4: - rebase on top of v6.8-rc2 - rework SYS_CFG bit poking patches to avoid syscon - use sram lock for the SRAM driver regmap as well - correctly advertise new allwinner,sram property in binding - fix conditional definition of sram property - new patch 4/7 to make the H6 and H616 calibrate functions compatible - drop now obsolete definition of sun50i_h616_ths_calibrate() Changelog v2 .. v3: - rebase on top of v6.7-rc3 - add patches to clear bit 16 in SYS_CFG register 0x3000000 - add syscon to the binding documentation - add patch explaining the unknown control register value Changelog v1 .. v2: - Fix typos - Remove h616 calc and init functions - Use TEMP_CALIB_MASK insteaf of 0xffff - Adjust calibration function to new offset and scale - Add proper comment to bindings patch - Split delta calculations to 2 lines - Add parentheses around caldata[2|3] >> 12 - Negate bindings if for clocks Andre Przywara (3): soc: sunxi: sram: export register 0 for THS on H616 thermal: sun8i: explain unknown H6 register value thermal: sun8i: add SRAM register access code Maksim Kiselev (1): thermal: sun8i: extend H6 calibration to support 4 sensors Martin Botka (3): dt-bindings: thermal: sun8i: Add H616 THS controller thermal: sun8i: add support for H616 THS controller arm64: dts: allwinner: h616: Add thermal sensor and zones .../thermal/allwinner,sun8i-a83t-ths.yaml | 34 +++-- .../arm64/boot/dts/allwinner/sun50i-h616.dtsi | 88 +++++++++++++ drivers/soc/sunxi/sunxi_sram.c | 23 ++++ drivers/thermal/sun8i_thermal.c | 122 +++++++++++++++--- 4 files changed, 235 insertions(+), 32 deletions(-) -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID (diff)
From: Andre Przywara <andre.przywara@arm.com> To: Vasily Khoruzhick <anarsoul@gmail.com>, Yangtao Li <tiny.windzz@gmail.com>, Chen-Yu Tsai <wens@csie.org>, Jernej Skrabec <jernej.skrabec@gmail.com>, Samuel Holland <samuel@sholland.org> Cc: "Rafael J . Wysocki" <rafael@kernel.org>, Daniel Lezcano <daniel.lezcano@linaro.org>, Zhang Rui <rui.zhang@intel.com>, Lukasz Luba <lukasz.luba@arm.com>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Martin Botka <martin.botka@somainline.org>, Maksim Kiselev <bigunclemax@gmail.com>, Bob McChesney <bob@electricworry.net>, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev Subject: [PATCH v4 0/7] add support for H616 thermal system Date: Fri, 9 Feb 2024 14:42:14 +0000 [thread overview] Message-ID: <20240209144221.3602382-1-andre.przywara@arm.com> (raw) Hi, this is v4 of the series originally by Martin, complemented by patches to fix the problem with way-too-high temperatures reported on some boards, and some refactoring and simplifications, compared to the original drop. For the SYS_CFG bit poke code I now avoided the term "syscon" at all, instead using "sram" instead, which seems to be less controversial. Apart from that the register poke part hasn't changed much, but I hope it's more acceptable now that it doesn't claim to be using a syscon device. Many thanks to Maksim's investigation into the code, which revealed that the calibrate functions between the H6 and H616 are actually the same, just with support for more sensors. So his new patch 4/7 refactors the existing function, to make it compatible to the H616, which makes the actual support patch 6/7 very simple. See the Changelog below for more details. ================== This series introduces support for the thermal sensors in the Allwinner H616 SoCs, which includes its siblings H618 and T507. The actual temperature reading turns out to be very similar to the H6 SoC, just with support for two more sensors. One nasty complication is caused by reports about temperatures above 200C, which are related to the firmware being run (because the vendor U-Boot contains a hack avoiding this problem). Some investigation and digging in BSP code later we identified that bit 16 in register 0x3000000 (SYS_CFG) needs to be cleared for the raw temperature register values to contain reasonable values. To achieve this, patch 1/7 exports this very register from the already existing SRAM/syscon device. Patch 5/7 then adds code to the thermal driver to find that device via a new DT property, and query its regmap to clear bit 16 in there. I am open to suggestions on how to solve this in a better way, but the current solution works, and uses an existing driver and an existing scheme (in the EMAC driver). The rest of the patches are fairly straight-forward and build on Martin's original work, with some simplifications, resulting in more code sharing. Please have a look! Cheers, Andre Changelog v3 .. v4: - rebase on top of v6.8-rc2 - rework SYS_CFG bit poking patches to avoid syscon - use sram lock for the SRAM driver regmap as well - correctly advertise new allwinner,sram property in binding - fix conditional definition of sram property - new patch 4/7 to make the H6 and H616 calibrate functions compatible - drop now obsolete definition of sun50i_h616_ths_calibrate() Changelog v2 .. v3: - rebase on top of v6.7-rc3 - add patches to clear bit 16 in SYS_CFG register 0x3000000 - add syscon to the binding documentation - add patch explaining the unknown control register value Changelog v1 .. v2: - Fix typos - Remove h616 calc and init functions - Use TEMP_CALIB_MASK insteaf of 0xffff - Adjust calibration function to new offset and scale - Add proper comment to bindings patch - Split delta calculations to 2 lines - Add parentheses around caldata[2|3] >> 12 - Negate bindings if for clocks Andre Przywara (3): soc: sunxi: sram: export register 0 for THS on H616 thermal: sun8i: explain unknown H6 register value thermal: sun8i: add SRAM register access code Maksim Kiselev (1): thermal: sun8i: extend H6 calibration to support 4 sensors Martin Botka (3): dt-bindings: thermal: sun8i: Add H616 THS controller thermal: sun8i: add support for H616 THS controller arm64: dts: allwinner: h616: Add thermal sensor and zones .../thermal/allwinner,sun8i-a83t-ths.yaml | 34 +++-- .../arm64/boot/dts/allwinner/sun50i-h616.dtsi | 88 +++++++++++++ drivers/soc/sunxi/sunxi_sram.c | 23 ++++ drivers/thermal/sun8i_thermal.c | 122 +++++++++++++++--- 4 files changed, 235 insertions(+), 32 deletions(-) -- 2.25.1
next reply other threads:[~2024-02-09 14:42 UTC|newest] Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-02-09 14:42 Andre Przywara [this message] 2024-02-09 14:42 ` [PATCH v4 0/7] add support for H616 thermal system Andre Przywara 2024-02-09 14:42 ` [PATCH v4 1/7] soc: sunxi: sram: export register 0 for THS on H616 Andre Przywara 2024-02-09 14:42 ` Andre Przywara 2024-02-14 20:29 ` Jernej Škrabec 2024-02-14 20:29 ` Jernej Škrabec 2024-02-15 1:28 ` Andre Przywara 2024-02-15 1:28 ` Andre Przywara 2024-02-15 21:18 ` Jernej Škrabec 2024-02-15 21:18 ` Jernej Škrabec 2024-02-09 14:42 ` [PATCH v4 2/7] dt-bindings: thermal: sun8i: Add H616 THS controller Andre Przywara 2024-02-09 14:42 ` Andre Przywara 2024-02-11 16:31 ` Krzysztof Kozlowski 2024-02-11 16:31 ` Krzysztof Kozlowski 2024-02-09 14:42 ` [PATCH v4 3/7] thermal: sun8i: explain unknown H6 register value Andre Przywara 2024-02-09 14:42 ` Andre Przywara 2024-02-14 20:31 ` Jernej Škrabec 2024-02-14 20:31 ` Jernej Škrabec 2024-02-09 14:42 ` [PATCH v4 4/7] thermal: sun8i: extend H6 calibration to support 4 sensors Andre Przywara 2024-02-09 14:42 ` Andre Przywara 2024-02-14 20:35 ` Jernej Škrabec 2024-02-14 20:35 ` Jernej Škrabec 2024-02-09 14:42 ` [PATCH v4 5/7] thermal: sun8i: add SRAM register access code Andre Przywara 2024-02-09 14:42 ` Andre Przywara 2024-02-15 21:24 ` Jernej Škrabec 2024-02-15 21:24 ` Jernej Škrabec 2024-02-09 14:42 ` [PATCH v4 6/7] thermal: sun8i: add support for H616 THS controller Andre Przywara 2024-02-09 14:42 ` Andre Przywara 2024-02-09 14:42 ` [PATCH v4 7/7] arm64: dts: allwinner: h616: Add thermal sensor and zones Andre Przywara 2024-02-09 14:42 ` Andre Przywara
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=20240209144221.3602382-1-andre.przywara@arm.com \ --to=andre.przywara@arm.com \ --cc=anarsoul@gmail.com \ --cc=bigunclemax@gmail.com \ --cc=bob@electricworry.net \ --cc=conor+dt@kernel.org \ --cc=daniel.lezcano@linaro.org \ --cc=devicetree@vger.kernel.org \ --cc=jernej.skrabec@gmail.com \ --cc=krzysztof.kozlowski+dt@linaro.org \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-pm@vger.kernel.org \ --cc=linux-sunxi@lists.linux.dev \ --cc=lukasz.luba@arm.com \ --cc=martin.botka@somainline.org \ --cc=rafael@kernel.org \ --cc=robh+dt@kernel.org \ --cc=rui.zhang@intel.com \ --cc=samuel@sholland.org \ --cc=tiny.windzz@gmail.com \ --cc=wens@csie.org \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.