Any how to for applying the 3705 fan?

plz check my info

root@Tone:/#  grep "" /sys/devices/soc0/*
/sys/devices/soc0/family:Amlogic Meson
/sys/devices/soc0/machine:Khadas VIM3
/sys/devices/soc0/revision:29:b - 10:2
/sys/devices/soc0/soc_id:G12B (A311D)
root@Tone:/# uname -a
Linux Tone 5.3.0-rc6 #1 SMP PREEMPT Tue Oct 15 16:27:18 MSK 2019 aarch64 GNU/Linux
root@Tone:/# i2cdetect -y -a 0 
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00: -- -- -- -- -- -- -- -- -- -- -- -- -- -- 0e -- 
10: -- -- -- -- -- -- -- -- 18 -- -- -- -- -- -- -- 
20: UU -- 22 -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- 51 -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 

or i2cdetect -y -a 1 or i2cdetect -y -a 2

!!! u must find 18 is mcu with fan !!!

if u dont have it u used wrong dtb

after

root@Tone:/# fan 1
[i] set FUN SPEED: 1
root@Tone:/# fan 2
[i] set FUN SPEED: 2
root@Tone:/# fan off
[i] set FUN SPEED: 0
root@Tone:/# 
1 Like

I used your dtb only from the link I shared above. By using that dtb the i2c node was lost, but when I use the one I compiled it shows all 3 nodes.

I will try again and check.

Update: It worked on my dtb. Great. Works like a charm. Nice fan codes. @hyphop. I have this pkg ready for arch/manjaro with your fan script and have added the i2c3 definition patch in the dtb from next built onwards. And will put fan bg default in autostart.

Update 2: the script works with mainline dtb also without the i2c3 definition patch.

Update 3: worked fine with vim1 v14 but only on manual mode. Bg cannot get temp.

We can redistribute your script right?

Vim 1 mainline lost thermal sensor node in dtb but u can make it )))

Can you share the codes needs for thermal sensor node? Or should I use the same i2c3 definition from vim3?

We tested fan script in systemd using fan bg but it fails. So we tried fan monitor and it works fine. We have made arch/manjaro pkg and it will be installed by default in the next built. Can you advice why fan bg doesnt work as systemd service?

User can install khadas-utils using pacman -S khadas-utils and start the service and enable in on boot.

Thanks.

  • fan monitor - start in foreground ( suitable for systemd )
  • fan bg - same monitor but start in background (not for systemd becouse need fan as foreground process)
1 Like

https://github.com/hyphop/khadas-linux-kernel/blob/master/patches/0185-arm64-dts-VIM1-add-thermal-zones.patch

Hi @hyphop Hyphop,
I have tried to patched this i2c3 definition in Mainline Kernel 5.6-rc1 but it doesnt seem to work after compiling.
I have CONFIG_I2C_MESON=y already.

patch is applied to https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi this already have #include <dt-bindings/gpio/meson-g12a-gpio.h> binding.

What else is required?

Please advice. Thanks.

plz show more info ==> like there Any how to for applying the 3705 fan?

i will try to check 5.6.x kernel soon (what new in this version ??? )! may be dts definitions changed ?
I still stay on 5.4.5 which works fine (https://github.com/hyphop/khadas-linux-kernel/blob/master/scripts/auto_openwrt_next - build script )

1 Like

Wifi seems to work fine and we like to use Mainline for most of the Device we support at Manjaro Linux, as it is easier to Maintain 1 Kernel package for all the devices.
Other than Wifi we have stable HW Accel with LLVMPile using mesa-git without the need of fbturbo. We also have GLES qt versions which can be utilised for Desktop Accel.

Here is the outputs on 5.6-Rc1

ls /dev/i2c-? 
Cannot find anything with i2c*
$ zcat /proc/config.gz  | grep I2C_MESON
CONFIG_I2C_MESON=y
$ fan 1
i2c devs not found

When I move back to Kernel 5.3.0 it works fine. All I have patched in 5.6-rc1 is the dtsi file only.

Patch I tried

---
 .../boot/dts/amlogic/meson-khadas-vim3.dtsi     | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi b/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi
index 124a80901084..63f3cfe8d067 100644
--- a/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi
@@ -364,4 +364,10 @@ &usb {
	status = "okay";
	dr_mode = "peripheral";
 };
+
+&i2c3{
+    pinctrl-0 = <&i2c3_sck_a_pins>, <&i2c3_sda_a_pins>;
+    clock-frequency = <100000>; /* default 100k */
+    pinctrl-names = "default";
+    status = "okay";
+};
-- 

i2c3_sda_a_pins & i2c3_sck_a_pins are defined in here.

Now I am not sure what else is missing. Please check when you have time.

Thanks.

Hello @Spikerguy, @hyphop

I received my VIM3 Pro on NYE, and it’s a very nice device. I got it with the new heatsink and fan. I ended up flashing u-boot mainline and now have Manjaro running on emmc. Kernel 5.10.1-2

It’s very nice and I want to leave it on 24/7, but I notice that the fan does not turn on (unlike when in Android).

I read the thread above, and also the documentation on setting up the fan, and basically I have this:

[aurion@neurofire ~]$ ls /dev/i2c-?
/dev/i2c-0 /dev/i2c-1
[aurion@neurofire ~]$ find /sys/firmware/devicetree -name β€œi2c@*”
/sys/firmware/devicetree/base/soc/bus@ff800000/i2c@5000
/sys/firmware/devicetree/base/soc/bus@ffd00000/i2c@1d000
/sys/firmware/devicetree/base/soc/bus@ffd00000/i2c@1f000
/sys/firmware/devicetree/base/soc/bus@ffd00000/i2c@1c000
/sys/firmware/devicetree/base/soc/bus@ffd00000/i2c@1e000
[aurion@neurofire ~]$ zcat /proc/config.gz | grep I2C_MESON
CONFIG_I2C_MESON=y
[aurion@neurofire ~]$ sudo i2cdetect -l
i2c-1 i2c DesignWare HDMI I2C adapter
i2c-0 i2c Meson I2C adapter I2C adapter
[aurion@neurofire ~]$ sudo i2cdetect -y -a 0
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – -- – -- – -- – -- – -- – -- – -- 0e –
10: – -- – -- – -- – -- 18 – -- – -- – -- –
20: UU – 22 – -- – -- – -- – -- – -- – -- –
30: – -- – -- – -- – -- – -- – -- – -- – --
40: – -- – -- – -- – -- – -- – -- – -- – --
50: – UU – -- – -- – -- – -- – -- – -- – --
60: – -- – -- – -- – -- – -- – -- – -- – --
70: – -- – -- – -- – -- – -- – -- – -- – --
[aurion@neurofire ~]$ fan 1
[i] i2c device not found by 0x18 0x88
[aurion@neurofire ~]$ fan l
[i] i2c device not found by 0x18 0x88
[aurion@neurofire ~]$ ^C
[aurion@neurofire ~]$

Also:
[aurion@neurofire ~]$ zcat /proc/config.gz | grep KHADAS

CONFIG_MFD_KHADAS_MCU is not set

I’m not a computer guru, but I have used Linux for a couple of years. It looks like the fan is not detected in the above, but 18 is there… could someone help me out with setting the fan up for Manjaro? Thanks

Please share the output of the following.

sudo pacman -ss linux | grep installed

I think I might have missed it in linux-vim
Thank you for informing.
I will put a new build with mcu enabled fan will only run once cpu reaches 80Β°c just for information.

Update: Put a new kernel to build with MCU enabled wiil upload it to unstable once it is built and tested.

[aurion@neurofire ~]$ sudo pacman -Ss linux | grep installed
core/archlinux-keyring 20201210-1 [installed]
core/archlinuxarm-keyring 20140119-1 [installed]
core/base 2-2 [installed]
core/hdparm 9.58-3 [installed]
core/iptables 1:1.8.6-1 [installed]
core/keyutils 1.6.3-1 [installed]
core/kmod 27-2 [installed]
core/libaio 0.3.112-2 [installed]
core/linux-api-headers 5.8-1 [installed]
core/linux-firmware 20201218.646f159-1 [installed]
core/linux-vim 5.10.1-2 [installed]
core/man-pages 5.09-2 [installed]
core/manjaro-hotfixes 2018.08-6 [installed]
core/manjaro-system 20200428-1 [installed]
core/mdadm 4.1-2 [installed]
core/pacman-mirrors 4.19.1-1 [installed]
core/util-linux 2.36.1-4 [installed]
core/util-linux-libs 2.36.1-4 [installed]
extra/alsa-lib 1.2.4-3 [installed]
extra/alsa-utils 1.2.4-2 [installed]
extra/archlinux-appstream-data 20200720-1.1 [installed]
extra/avahi 0.8+15+ge8a3dd0-3 [installed]
extra/libiec61883 1.2.0-6 [installed]
extra/libimobiledevice 1.3.0-3 [installed]
extra/libraw1394 2.1.2-3 [installed]
extra/libva 2.10.0-0.1 [installed]
extra/libxshmfence 1.3-2 [installed]
extra/manjaro-settings-manager 0.5.6-6 [installed]
extra/manjaro-settings-manager-kcm 0.5.6-6 [installed]
extra/ndctl 71-1 [installed]
Submit a list of installed packages to the Arch Linux project
extra/v4l-utils 1.20.0-1 [installed]
community/i2c-tools 4.1-6 [installed]
community/mntray 1.1.3-1 [installed]
community/tlp 1.3.1-2 [installed]

Here it is.

Here it is, linux-vim-5.10.1-3 is compiled.

Please try this pkg.

1 Like

Thank you for doing this so quickly. I installed the package, kernel was successfully updated and boots as before, however the output fan l command still has not changed. Also,

[aurion@neurofire ~]$ sudo i2cdetect -y -a 0
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – -- – -- – -- – -- – -- – -- – -- 0e –
10: – -- – -- – -- – -- UU – -- – -- – -- –
20: UU – 22 – -- – -- – -- – -- – -- – -- –
30: – -- – -- – -- – -- – -- – -- – -- – --
40: – -- – -- – -- – -- – -- – -- – -- – --
50: – UU – -- – -- – -- – -- – -- – -- – --
60: – -- – -- – -- – -- – -- – -- – -- – --
70: – -- – -- – -- – -- – -- – -- – -- – --

This was the old method.

Follow this thread where @numbqq have explained how fan operates on mainline linux kernel.

5.7x version issues

Try to set a lower temperature and see if it works.

1 Like

@Spikerguy, @numbqq
I tried to do as directed in the thread https://forum.khadas.com/t/5-7x-version-issues/9831/10. So need to edit /sys/class/thermal/thermal_zone0/trip_point_3_temp

Ran into permission error, tried chmod 777 for the file, now get:

[aurion@neurofire ~]$ sudo -i
[sudo] password for aurion:
[root@neurofire ~]# echo 60000 > /sys/class/thermal/thermal_zone0/trip_point_3_temp
-bash: echo: write error: Input/output error

I can view the contents of the file (80000), but cannot write

Also tried:
echo 45000 | sudo tee /sys/class/thermal/thermal_zone0/trip_point_3_temp
which also doesn’t work

Also tried:
[root@neurofire ~]# echo 1 > /sys/class/thermal/cooling_device2/cur_state
[root@neurofire ~]# echo 2 > /sys/class/thermal/cooling_device2/cur_state
[root@neurofire ~]# echo 3 > /sys/class/thermal/cooling_device2/cur_state

However the fan does not do anything, but then again temperature is not 80C and apparently it is always on auto

It really does get hot!

Hi, the main thing is that the processor with thermal pad and heatsink have contact with each other. By the way, what is it under vim3 in the photo?

Yes, I have the regular heatsink and also the block which passively cools through the bottom metal plate. I have the VIM3 sitting on a frying pan to help it cool :sweat_smile:

1 Like

Okay, I hope you turned off the pan?:wink:

1 Like

The VIM3 is heating up the pan, it’s almost lunch time here :wink:

1 Like