Jump to content

PetrozPL

Members
  • Posts

    7
  • Joined

  • Last visited

Reputation Activity

  1. Like
    PetrozPL got a reaction from Rodrigo V. Lopes in Rock Pi4 pwm control - no overlay?   
    ok, I've managed to sort this out on my own. I've decompiled the rockchip-rockpi4.dtb and find out that pwm is disabled by default. So I've wrote new overlay for pwm, just to enable it : 
     
    /dts-v1/; / { compatible = "rockchip,rk3399"; fragment@0 { target-path = "/aliases"; __overlay__ { pwm0 = "/pwm@ff420000"; pwm1 = "/pwm@ff420010"; }; }; fragment@1 { target-path = "/pwm@ff420000"; __overlay__ { status = "okay"; }; }; fragment@2 { target-path = "/pwm@ff420010"; __overlay__ { status = "okay"; }; }; }; next, compiled it with dtc : 
    dtc -O dtb -o rockchip-pwm-gpio.dtbo -b 0 -@ rockchip-pwm-gpio.dts and moved dtbo to /boot/dtc/rockchip/overlays, and activated it in overlays in /boot/armbianEnv.txt.
     
    Now PWM works like a charm. I'm just leaving this thread and my resolution as reference, for anyone with the same problem.
     
  2. Like
    PetrozPL reacted to lanefu in Rock Pi4 pwm control - no overlay?   
    Thanks @PetrozPL
    Added
    https://armbian.atlassian.net/browse/AR-735
  3. Like
    PetrozPL reacted to tony013 in Rock Pi4 pwm control - no overlay?   
    Thank you - that finally did the trick!
  4. Like
    PetrozPL got a reaction from Piscenois in Rock Pi4 pwm control - no overlay?   
    I've created the repository on github with all required files, including 2 scripts I'm using to control and query PWM FAN speed.
     
    https://github.com/PetrozPL/rockpi4_pwm_overlay
     
    Hope You'll find it usefull.
     
    EDIT : Also, to control fan speed based on HDD temperature you can use smartctl tool to read HDD temperature from SMART. Example output for my NVMe : 
    sudo smartctl -a /dev/nvme0 | grep Temperature Temperature: 76 Celsius Warning Comp. Temperature Time: 0 Critical Comp. Temperature Time: 0 Temperature Sensor 2: 83 Celsius  
    If you would like to get system temperature instead hdd You can use another script to check thermal_zone0 temperature: 
    #!/bin/bash _temp=`cat /sys/class/thermal/thermal_zone0/temp` _temp1=${_temp::-3} _temp2=${_temp::(-3)} echo ${_temp::-3}.${_temp:(-3)} C  
    Best regards,
    PetrozPL 
     
  5. Like
    PetrozPL got a reaction from Piscenois in Rock Pi4 pwm control - no overlay?   
    ok, I've managed to sort this out on my own. I've decompiled the rockchip-rockpi4.dtb and find out that pwm is disabled by default. So I've wrote new overlay for pwm, just to enable it : 
     
    /dts-v1/; / { compatible = "rockchip,rk3399"; fragment@0 { target-path = "/aliases"; __overlay__ { pwm0 = "/pwm@ff420000"; pwm1 = "/pwm@ff420010"; }; }; fragment@1 { target-path = "/pwm@ff420000"; __overlay__ { status = "okay"; }; }; fragment@2 { target-path = "/pwm@ff420010"; __overlay__ { status = "okay"; }; }; }; next, compiled it with dtc : 
    dtc -O dtb -o rockchip-pwm-gpio.dtbo -b 0 -@ rockchip-pwm-gpio.dts and moved dtbo to /boot/dtc/rockchip/overlays, and activated it in overlays in /boot/armbianEnv.txt.
     
    Now PWM works like a charm. I'm just leaving this thread and my resolution as reference, for anyone with the same problem.
     
  6. Like
    PetrozPL reacted to Piscenois in Rock Pi4 pwm control - no overlay?   
    Thank you PetrozPL !
    I tried pwm, pwm0, pwm1 but no pwm-gpio...
     
    Regards.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines