Blame
102248 | deseven | 2025-07-08 21:12:40 | 1 | # Power Mode and Fan Control |
2 | ||||
3 | ### Problem |
|||
4 | No fan and power mode control is available in Linux. |
|||
5 | ||||
6 | ### Solution |
|||
7 | There is a [ec-su_axb35-linux kernel module](https://github.com/cmetz/ec-su_axb35-linux) written by Christoph Metz. |
|||
8 | ||||
9 | It allows you to: |
|||
10 | - read current fan speeds and modes |
|||
11 | - switch modes of each of the three available fans |
|||
12 | - control fan speed in `fixed` mode |
|||
13 | - control fan speed with custom curves in `curve` mode |
|||
14 | - read current power mode |
|||
15 | - change current power mode |
|||
16 | - read current APU temperature |
|||
17 | ||||
c6e621 | deseven | 2025-07-15 12:36:58 | 18 | :::warning |
19 | # Warning |
|||
20 | The module is a work in progress, use it at your own risk. It was tested on EC firmware version 1.06 and should theoretically only work on versions 1.04 and above. Please report any possible problems to the module's GitHub repo or in our Discord server. |
|||
bb7af8 | deseven | 2025-07-10 15:03:48 | 21 | ::: |
22 | ||||
102248 | deseven | 2025-07-08 21:12:40 | 23 | #### Generic Installation |
caf28c | deseven | 2025-07-11 20:29:16 | 24 | 1. Install module building dependencies (depends on your distro, on debian/ubuntu install `build-essential` and `linux-headers-$(uname -r)` packages). |
102248 | deseven | 2025-07-08 21:12:40 | 25 | 2. Clone the repo with `git clone https://github.com/cmetz/ec-su_axb35-linux.git`. |
caf28c | deseven | 2025-07-11 20:29:16 | 26 | 3. Build and install the module with `cd ec-su_axb35-linux && sudo make install`. |
102248 | deseven | 2025-07-08 21:12:40 | 27 | 4. Try loading the module with `modprobe ec_su_axb35` and check your `dmesg` afterwards. You should see the `Sixunited AXB35-02 EC driver loaded` message. |
28 | 5. Run `scripts/info.sh` and check that all information is there. |
|||
29 | 6. Run `scripts/test_fan_mode_fixed.sh`, it should test your fans on all 6 fixed levels. |
|||
caf28c | deseven | 2025-07-11 20:29:16 | 30 | 7. If everything is good, you can make the module automatically load on system boot with `sudo echo ec_su_axb35 >> /etc/modules`. If it says "permission denied", drop into root console with `su` or `sudo su -` and try again. |
102248 | deseven | 2025-07-08 21:12:40 | 31 | |
32 | #### Usage |
|||
33 | Reading and writing all of the parameters happens through sysfs with `/sys/class/ec_su_axb35` path. You can find detailed information in [the repo's readme file](https://github.com/cmetz/ec-su_axb35-linux/blob/main/README.md). |
|||
34 | ||||
35 | Some examples: |
|||
36 | - `cat /sys/class/ec_su_axb35/fan2/rpm` to get current rpm of fan2 |
|||
37 | - `echo fixed > /sys/class/ec_su_axb35/fan3/mode && echo 2 > /sys/class/ec_su_axb35/fan3/level` to switch fan3 to fixed mode and set speed to level 2 |
|||
38 | - `echo balanced > /sys/class/ec_su_axb35/apu/power_mode` to set power mode to balanced (85W) |
|||
39 | ||||
6a2028 | deseven | 2025-07-08 21:13:39 | 40 | You can also call `su_axb35_monitor` anywhere to monitor all available values in realtime: |
41 |  |
|||
102248 | deseven | 2025-07-08 21:12:40 | 42 | |
43 | To apply specific settings at system startup, place them in your `rc.local` file or utilize any other methods for executing commands during boot, such as creating a systemd unit. In the future, these parameters will also be configurable through module options. |
|||
44 | ||||
45 | #### Custom Curves |
|||
46 | The custom curves define temperature thresholds for fan power levels: |
|||
47 | - **Ramp-up curve** (`/sys/class/ec_su_axb35/fanX/rampup_curve`): temperature points where fan increases to the next level |
|||
259b3c | deseven | 2025-07-09 10:35:12 | 48 | - **Ramp-down curve** (`/sys/class/ec_su_axb35/fanX/rampdown_curve`): temperature points where fan decreases to the previous level |
102248 | deseven | 2025-07-08 21:12:40 | 49 | |
50 | For example, with these settings: |
|||
51 | - `rampup_curve = 60,70,83,95,97` |
|||
52 | - `rampdown_curve = 40,50,80,94,96` |
|||
53 | ||||
54 | **When CPU is heating up:** |
|||
55 | - Below 60°: Fan at level 0 (minimum) |
|||
56 | - At 60°: Increases to level 1 |
|||
57 | - At 70°: Increases to level 2 |
|||
58 | - At 83°: Increases to level 3 |
|||
59 | - At 95°: Increases to level 4 |
|||
60 | - At 97°: Increases to level 5 (maximum) |
|||
61 | ||||
62 | **When CPU is cooling down:** |
|||
63 | - Above 96°: Fan stays at level 5 |
|||
64 | - Below 96°: Decreases to level 4 |
|||
65 | - Below 94°: Decreases to level 3 |
|||
66 | - Below 80°: Decreases to level 2 |
|||
67 | - Below 50°: Decreases to level 1 |
|||
68 | - Below 40°: Decreases to level 0 |
|||
69 | ||||
70 | This creates a buffer at each level that prevents the fan from rapidly switching between speeds when temperature fluctuates around threshold values. |
|||
71 | ||||
72 | Curves are being applied only when `curve` mode is set on a specific fan, each fan has their own curves. |
|||
73 | ||||
bb7af8 | deseven | 2025-07-10 15:03:48 | 74 | ### Fine-tuning Power Limits |
75 | If you want more gradual control over power modes, there's a [RyzenAdj](https://github.com/FlyGoat/RyzenAdj) utility. |
|||
76 | ||||
77 | Main 3 parameters we are interested in are: |
|||
78 | - `STAPM LIMIT` (sustained power draw) |
|||
79 | - `PPT LIMIT FAST` (boost power draw) |
|||
80 | - `PPT LIMIT SLOW` (average power draw) |
|||
81 | ||||
82 | Default values on all 3 selectable power modes (use `ryzenadj --info` to read them): |
|||
83 | ||||
84 | | Power Mode | STAPM LIMIT | PPT LIMIT FAST | PPT LIMIT SLOW | |
|||
85 | | ----------- | ----------- | -------------- | -------------- | |
|||
86 | | Quiet | 54.0 | 100.0 | 54.0 | |
|||
87 | | Balanced | 85.0 | 120.0 | 120.0 | |
|||
88 | | Performance | 120.0 | 140.0 | 120.0 | |
|||
89 | ||||
90 | Example on setting the power limit to static 100W with no boost: |
|||
91 | `ryzenadj --stapm-limit=100000 --fast-limit=100000 --slow-limit=100000` |
|||
92 | ||||
93 | **Note that changing the power mode via the EC controller (using `ec-su_axb35-linux` or otherwise) resets these values to their defaults.** |
|||
94 | ||||
102248 | deseven | 2025-07-08 21:12:40 | 95 | ### Relevant Pages |
bb7af8 | deseven | 2025-07-10 15:03:48 | 96 | - [[Guides/Hardware-Monitoring]] |
97 | - [[Guides/Power-Modes-and-Performance]] |