From 127f60b78799a6e2d4c49f94f639f1326acd9e47 Mon Sep 17 00:00:00 2001 From: Aditya Prayoga Date: Fri, 26 Jul 2019 15:50:52 +0800 Subject: [PATCH 1/3] PWM: Update hwmon device list and configuration The changes on recent Armbian with LK 4.14 and LK 4.19 make the hwmon device order changed. pwm-fan become hwmon3 & hwmon4 and board temp sensor become hwmon2. Also sync the fancontrol configuration with the one on Armbian. --- docs/pwm.md | 45 ++++++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/docs/pwm.md b/docs/pwm.md index 49d6153..dd333be 100644 --- a/docs/pwm.md +++ b/docs/pwm.md @@ -143,12 +143,11 @@ List of devices can be checked under /sys/class/hwmon ``` ls -l /sys/class/hwmon/ total 0 -lrwxrwxrwx 1 root root 0 Nov 7 07:23 hwmon0 -> ../../devices/platform/soc/soc:internal-regs/f1072004.mdio/mdio_bus/f1072004.mdio-mii/f1072004.mdio-mii:00/hwmon/hwmon0 -lrwxrwxrwx 1 root root 0 Nov 7 07:23 hwmon1 -> ../../devices/virtual/hwmon/hwmon1 -lrwxrwxrwx 1 root root 0 Nov 7 07:23 hwmon2 -> ../../devices/platform/j10-pwm/hwmon/hwmon2 -lrwxrwxrwx 1 root root 0 Nov 7 07:23 hwmon3 -> ../../devices/platform/j17-pwm/hwmon/hwmon3 -lrwxrwxrwx 1 root root 0 Nov 7 07:23 hwmon4 -> ../../devices/platform/soc/soc:internal-regs/f1011000.i2c/i2c-0/0-004c/hwmon/hwmon4 - +lrwxrwxrwx 1 root root 0 Jul 26 07:39 hwmon0 -> ../../devices/platform/soc/soc:internal-regs/f1072004.mdio/mdio_bus/f1072004.mdio-mii/f1072004.mdio-mii:00/hwmon/hwmon0 +lrwxrwxrwx 1 root root 0 Jul 26 07:39 hwmon1 -> ../../devices/virtual/thermal/thermal_zone0/hwmon1 +lrwxrwxrwx 1 root root 0 Jul 26 07:39 hwmon2 -> ../../devices/platform/soc/soc:internal-regs/f1011000.i2c/i2c-0/0-004c/hwmon/hwmon2 +lrwxrwxrwx 1 root root 0 Jul 26 07:39 hwmon3 -> ../../devices/platform/j10-pwm/hwmon/hwmon3 +lrwxrwxrwx 1 root root 0 Jul 26 07:39 hwmon4 -> ../../devices/platform/j17-pwm/hwmon/hwmon4 ``` !!! info @@ -157,20 +156,20 @@ lrwxrwxrwx 1 root root 0 Nov 7 07:23 hwmon4 -> ../../devices/platform/soc/soc:i To identify which hwmon belong to fan, look for *j10-pwm* and *j17-pwm*. On above example ``` -hwmon2 -> ../../devices/platform/j10-pwm/hwmon/hwmon2 -hwmon3 -> ../../devices/platform/j17-pwm/hwmon/hwmon3 +hwmon3 -> ../../devices/platform/j10-pwm/hwmon/hwmon3 +hwmon4 -> ../../devices/platform/j17-pwm/hwmon/hwmon4 ``` To read current PWM ``` -cat /sys/class/hwmon2/pwm1 cat /sys/class/hwmon3/pwm1 +cat /sys/class/hwmon4/pwm1 ``` To set PWM ``` -echo NEW_PWM_VALUE > /sys/class/hwmon2/pwm1 echo NEW_PWM_VALUE > /sys/class/hwmon3/pwm1 +echo NEW_PWM_VALUE > /sys/class/hwmon4/pwm1 ``` ### Fancontrol - automated software based fan speed control @@ -196,13 +195,13 @@ fancontrol uses **/etc/fancontrol** as configuration file. Below is an example c # Helios4 PWM Fan Control Configuration # Temp source : armada_thermal sensor INTERVAL=10 -DEVPATH=hwmon2=devices/platform/j10-pwm hwmon3=devices/platform/j17-pwm hwmon4=devices/platform/soc/soc:internal-regs/f1011000.i2c/i2c-0/0-004c -DEVNAME=hwmon1=armada_thermal -FCTEMPS=hwmon2/pwm1=hwmon1/temp1_input hwmon3/pwm1=hwmon1/temp1_input -MINTEMP=hwmon2/pwm1=60 hwmon3/pwm1=60 -MAXTEMP=hwmon2/pwm1=80 hwmon3/pwm1=80 -MINSTART=hwmon2/pwm1=20 hwmon3/pwm1=20 -MINSTOP=hwmon2/pwm1=29 hwmon3/pwm1=29 +DEVPATH=hwmon3=devices/platform/j10-pwm hwmon4=devices/platform/j17-pwm hwmon2=devices/platform/soc/soc:internal-regs/f1011000.i2c/i2c-0/0-004c +DEVNAME=hwmon1=f10e4078.thermal +FCTEMPS=hwmon3/pwm1=hwmon1/temp1_input hwmon4/pwm1=hwmon1/temp1_input +MINTEMP=hwmon3/pwm1=40 hwmon4/pwm1=40 +MAXTEMP=hwmon3/pwm1=80 hwmon4/pwm1=80 +MINSTART=hwmon3/pwm1=20 hwmon4/pwm1=20 +MINSTOP=hwmon3/pwm1=29 hwmon4/pwm1=29 MINPWM=20 ``` @@ -226,7 +225,7 @@ FCTEMPS Maps PWM outputs to temperature sensors so fancontrol knows which temperature sensors should be used for calculation of new values for the corresponding PWM outputs. -Fans (**hwmon2** & **hwmon3**) are controlled based on CPU thermal sensor (**hwmon1**) reading. +Fans (**hwmon3** & **hwmon4**) are controlled based on CPU thermal sensor (**hwmon1**) reading. MINSTART @@ -248,13 +247,13 @@ MINTEMP The temperature below which the fan gets switched to minimum speed. -Fans (hwmon2 & hwmon3) runs in minimum speed if the CPU temperature below **70** degree C. +Fans (hwmon2 & hwmon3) runs in minimum speed if the CPU temperature below **40** degree C. MAXTEMP The temperature over which the fan gets switched to maximum speed. -Fans (hwmon2 & hwmon3) runs in maximum speed if the CPU temperature above **90** degree C. +Fans (hwmon2 & hwmon3) runs in maximum speed if the CPU temperature above **80** degree C. MINPWM @@ -264,7 +263,7 @@ Set minimum PWM value to **0**. On Type-C fan, it would stopped the fan while on !!! note - The Helios4 fancontrol configuration file can be found [here](https://raw.githubusercontent.com/armbian/build/master/packages/bsp/helios4/fancontrol_pwm-fan-mvebu-next.conf). + The Helios4 fancontrol configuration file can be found [here](https://raw.githubusercontent.com/armbian/build/master/packages/bsp/helios4/fancontrol_pwm-fan.conf). ### Thermal Zone on Device Tree @@ -305,14 +304,14 @@ Below is an example of device tree nodes that can be added to Helios4 device tre trips { cpu_active: cpu_active { /* millicelsius */ - temperature = <70000>; + temperature = <40000>; hysteresis = <2000>; type = "active"; }; cpu_alert: cpu_alert { /* millicelsius */ - temperature = <90000>; + temperature = <80000>; hysteresis = <2000>; type = "hot"; }; From 6723446e26093f2f76f637a6ac063c70e0c5dc60 Mon Sep 17 00:00:00 2001 From: Aditya Prayoga Date: Fri, 26 Jul 2019 19:59:13 +0800 Subject: [PATCH 2/3] SDIO: Added missing instruction and note for LK 4.19 --- docs/sdcard.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/sdcard.md b/docs/sdcard.md index ea1cbcc..82d9961 100644 --- a/docs/sdcard.md +++ b/docs/sdcard.md @@ -30,11 +30,13 @@ Install the dependencies and extract the source into ~/src/linux ``` sudo apt-get -y install build-essential linux-source-4.14.87-next-mvebu mkdir -p ~/src/linux -tar Jxf /usr/src/linux-source-4.14.87-mvebu.tar.xz -C ~/src/linux +tar Jxf /usr/src/linux-source-$(uname -r).tar.xz -C ~/src/linux ``` !!! note - You will need to choose the right *linux-source* package that matches the kernel version you are running. Check kernel version with command **uname -a** + You will need to choose the right *linux-source* package that matches the kernel version you are running. Check kernel version with command **uname -r**. + + Currently it does NOT work with *Linux Kernel 4.19* onward. ### Patching and Compilation @@ -51,6 +53,7 @@ git apply --apply --verbose helios4_dtb_sd_uhs_linux_stable.patch Compile the device tree into dtb ``` +cp /boot/config-$(uname -r) .config make armada-388-helios4.dtb cp arch/arm/boot/dts/armada-388-helios4.dtb armada-388-helios4.dtb.uhs ``` @@ -118,7 +121,7 @@ To automate the test, a test script named [run_sdcard_test.sh](/files/sdcard/run **3.** Install iozone and download the test script ``` -sudo apt-get -y install iozone +sudo apt-get -y install iozone3 wget https://wiki.kobol.io/files/sdcard/run_sdcard_test.sh chmod 755 run_sdcard_test.sh From e20d3f7f1c26478c706c8fd504296f8cfd987c12 Mon Sep 17 00:00:00 2001 From: Gauthier Provost Date: Sat, 27 Jul 2019 11:28:47 +0800 Subject: [PATCH 3/3] Reword important note on UHS support from LK 4.19 onwards. --- docs/sdcard.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/sdcard.md b/docs/sdcard.md index 82d9961..b0ab355 100644 --- a/docs/sdcard.md +++ b/docs/sdcard.md @@ -15,6 +15,9 @@ However, it is not compatible with all cards even though the SD cards are declar !!! Warning Enabling High Speed and UHS-I support could lead to unbootable system because of incompatible microSD card. +!!! Important + From *Linux Kernel 4.19* onwards, High Speed and UHS-I modes for Helios4 do NOT work. It requires further work on our side. + ## Device Tree Modification To enable High Speed mode and UHS-I support, Helios4 device tree need to be modified. @@ -36,9 +39,6 @@ tar Jxf /usr/src/linux-source-$(uname -r).tar.xz -C ~/src/linux !!! note You will need to choose the right *linux-source* package that matches the kernel version you are running. Check kernel version with command **uname -r**. - Currently it does NOT work with *Linux Kernel 4.19* onward. - - ### Patching and Compilation Download and apply [this patch](/files/sdcard/helios4_dtb_sd_uhs_linux_stable.patch) to Linux kernel source code.