-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable hwmon for thermal zones #3307
Conversation
The change to brcmstb_thermal.c should be submitted upstream first. |
Ah. Ok. I'll see what I can do, given the current state of RPi 4 upstream. |
Patch submitted upstream: https://lkml.org/lkml/2019/10/30/767 |
Thanks. Can you ping here when it is merged upstream. |
So it looks like the upstream brcmstb_thermal driver doesn't actually support BCM2711, as it targets a slightly different hardware block. @lategoodbye posted a new BCM2711 thermal driver [1] a few days ago. We'll see how that goes, or if it converges on the existing brcmstb_thermal driver. |
Looks like the new driver is on track to be included in v5.6. See |
Yes, but i'm not sure it make sense to backport it to 4.19, i suggest to rebase it on Linux 5.4 (#3385) which has a much smaller diff. |
The DT bindings in upstream don't match what is in the 5.4 branch. I assume a backport would include both the device tree stuff as well as the driver? |
Yes, you will need to backport the devicetree parts & driver from Linux 5.6. But also enable the different driver in the config. |
Done. The branch is now based on the commit |
@wens LGTM |
83784a1
to
971a2bb
Compare
Commit ee31ff3 upstream. Since the BCM2711 doesn't have a AVS TMON block, the thermal information must be retrieved from the AVS ring oscillator block. This block is part of the AVS monitor which contains a bunch of raw sensors. Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Reviewed-by: Rob Herring <robh@kernel.org> Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/1578941778-23321-2-git-send-email-stefan.wahren@i2se.com Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Commit 59b7813 upstream. This adds the thermal sensor driver for the Broadcom BCM2711 SoC, which is placed on the Raspberry Pi 4. The driver only provides SoC temperature reading so far. Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Tested-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/1578941778-23321-3-git-send-email-stefan.wahren@i2se.com Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Commit a1d6989 upstream. This enables thermal for the BCM2711 (used on Raspberry Pi 4) by adding the AVS monitor and a subnode for the thermal part. Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Tested-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/1578941778-23321-4-git-send-email-stefan.wahren@i2se.com Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Commit 1a90e73 upstream. This builds the BCM2711 thermal driver as module for the Raspberry Pi 4. Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Tested-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/1578941778-23321-5-git-send-email-stefan.wahren@i2se.com Signed-off-by: Chen-Yu Tsai <wens@csie.org>
This reverts commit 6642a4f. Signed-off-by: Chen-Yu Tsai <wens@csie.org>
This reverts commit 9d62448. Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
To expose thermal regions as hwmon devices, the HWMON core has to be built-in, so that THERMAL_HWMON can be enabled. Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Rebased onto latest rpi-5.4.y branch and fixed up commit hashes for the revert commits. |
@popcornmix ping |
@pelwell this looks good to me and compiled and appeared to work correctly. Any concerns? |
They're all reverts and back-ports, so if it compiles and appears to work then I have no problem with it. |
@wens @lategoodbye thanks! |
kernel: vc4: Set driver_name for card See: raspberrypi/linux#3656 kernel: configs: Add SND_SOC_MAX98357A=m See: https://www.raspberrypi.org/forums/viewtopic.php?f=107&t=275919 kernel: Add Micro Crystal RV-1805 to i2c-rtc overlays See: raspberrypi/linux#3651 kernel: media: bcm2835-isp: fix bytes per line calculations for some image formats See: raspberrypi/linux#3645 kernel: media: bcm2835-unicam: change minimum number of vb2_queue buffers to 1 See: raspberrypi/linux#3638 kernel: media: i2c: imx477: Return correct result on sensor id verification See: raspberrypi/linux#3630 kernel: Clean up the VCHIQ 2711 DMA support See: raspberrypi/linux#3629 kernel: overlays: i2c-rtc-gpio: Fix trickle-resistor-ohms param See: raspberrypi/linux#3642 kernel: Enable hwmon for thermal zones See: raspberrypi/linux#3307
kernel: vc4: Set driver_name for card See: raspberrypi/linux#3656 kernel: configs: Add SND_SOC_MAX98357A=m See: https://www.raspberrypi.org/forums/viewtopic.php?f=107&t=275919 kernel: Add Micro Crystal RV-1805 to i2c-rtc overlays See: raspberrypi/linux#3651 kernel: media: bcm2835-isp: fix bytes per line calculations for some image formats See: raspberrypi/linux#3645 kernel: media: bcm2835-unicam: change minimum number of vb2_queue buffers to 1 See: raspberrypi/linux#3638 kernel: media: i2c: imx477: Return correct result on sensor id verification See: raspberrypi/linux#3630 kernel: Clean up the VCHIQ 2711 DMA support See: raspberrypi/linux#3629 kernel: overlays: i2c-rtc-gpio: Fix trickle-resistor-ohms param See: raspberrypi/linux#3642 kernel: Enable hwmon for thermal zones See: raspberrypi/linux#3307
It would be nice to be able to use standard hwmon interfaces to read the temperature of the CPU thermal zone. This is accomplished by enabling
CONFIG_THERMAL_HWMON
, and also having thebrcmstb_thermal
driver add the hwmon sysfs entries. The older bcm2835_thermal driver already has support for this.The thermal driver patch does not directly apply to upstream, which has seen a change to
devm_thermal_zone_of_sensor_register()
, removing theremove()
driver callback.