Skip to content

Commit fbe367a

Browse files
authored
Merge pull request #704 from FrameworkComputer/azalea.power_limit_implement
Azalea.power limit implement
2 parents 20ab366 + 20cd25a commit fbe367a

File tree

10 files changed

+474
-12
lines changed

10 files changed

+474
-12
lines changed

common/thermal.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,16 @@ static void thermal_control(void)
238238
/* Wait until after the sensors have been read */
239239
DECLARE_HOOK(HOOK_SECOND, thermal_control, HOOK_PRIO_TEMP_SENSOR_DONE);
240240

241+
/*****************************************************************************/
242+
/* Project */
243+
bool thermal_warn_trigger(void)
244+
{
245+
if (cond_went_true(&cond_hot[EC_TEMP_THRESH_WARN]))
246+
return true;
247+
else
248+
return false;
249+
}
250+
241251
/*****************************************************************************/
242252
/* Console commands */
243253

include/thermal.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,6 @@ int thermal_fan_percent(int low, int high, int cur);
2727
*/
2828
void board_override_fan_control(int fan, int *tmp);
2929

30+
bool thermal_warn_trigger(void);
31+
3032
#endif /* __CROS_EC_THERMAL_H */

zephyr/program/lotus/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ zephyr_library_sources("src/board_function.c")
1010
zephyr_library_sources("src/board_host_command.c")
1111
zephyr_library_sources("src/cypress_pd_common.c")
1212
zephyr_library_sources("src/flash_storage.c")
13-
zephyr_library_sources("src/cpu_power.c")
1413
zephyr_library_sources("src/factory.c")
1514
zephyr_library_sources("src/diagnostics.c")
1615
zephyr_library_sources("src/ucsi.c")
@@ -30,6 +29,7 @@ if(DEFINED CONFIG_BOARD_LOTUS)
3029
zephyr_library_sources(
3130
"lotus/src/battery.c"
3231
"lotus/src/charger.c"
32+
"lotus/src/cpu_power.c"
3333
"lotus/src/input_module.c"
3434
"lotus/src/gpu.c"
3535
"lotus/src/power_sequence.c"
@@ -47,6 +47,7 @@ if(DEFINED CONFIG_BOARD_AZALEA)
4747
zephyr_library_sources(
4848
"azalea/src/battery.c"
4949
"azalea/src/charger.c"
50+
"azalea/src/cpu_power.c"
5051
"azalea/src/power_sequence.c"
5152
"azalea/src/keyboard_customization.c"
5253
"azalea/src/project_diagnostics.c"

zephyr/program/lotus/azalea/fan.dtsi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
fan0: fan_0 {
1111
pwms = <&pwm0 0 PWM_KHZ(25) PWM_POLARITY_NORMAL>;
1212
tach = <&tach2>;
13-
rpm_min = <1800>;
14-
rpm_start = <1800>;
13+
rpm_min = <2100>;
14+
rpm_start = <2100>;
1515
rpm_max = <6800>;
1616
rpm_deviation = <3>;
1717
pgood_gpio = <&gpio_slp_s3_l>;

zephyr/program/lotus/azalea/overlay.dtsi

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,31 +11,31 @@
1111
named-temp-sensors {
1212
compatible = "cros-ec,temp-sensors";
1313
local-f75303 {
14-
temp_host_warn = <67>;
14+
temp_host_warn = <52>;
1515
temp_host_high = <70>;
1616
temp_host_halt = <120>;
1717
temp_host_release_warn = <45>;
1818
temp_host_release_high = <55>;
1919
temp_host_release_halt = <115>;
20-
temp_fan_off = <41>;
21-
temp_fan_max = <100>;
20+
temp_fan_off = <40>;
21+
temp_fan_max = <70>;
2222
power-good-pin = <&gpio_slp_s3_l>;
2323
sensor = <&local_f75303>;
2424
};
2525
cpu-f75303 {
26-
temp_host_warn = <67>;
26+
temp_host_warn = <61>;
2727
temp_host_high = <70>;
2828
temp_host_halt = <120>;
29-
temp_host_release_warn = <45>;
29+
temp_host_release_warn = <50>;
3030
temp_host_release_high = <55>;
3131
temp_host_release_halt = <115>;
32-
temp_fan_off = <47>;
33-
temp_fan_max = <55>;
32+
temp_fan_off = <46>;
33+
temp_fan_max = <54>;
3434
power-good-pin = <&gpio_slp_s3_l>;
3535
sensor = <&cpu_f75303>;
3636
};
3737
ddr-f75303 {
38-
temp_host_warn = <55>;
38+
temp_host_warn = <49>;
3939
temp_host_high = <70>;
4040
temp_host_halt = <120>;
4141
temp_host_release_warn = <45>;

zephyr/program/lotus/azalea/src/charger.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ void board_set_charge_limit(int port, int supplier, int charge_ma,
148148
* And needs to be at least 128mA bigger than the adapter current
149149
*/
150150
prochot_ma = (DIV_ROUND_UP(charge_ma, 128) * 128);
151-
charge_ma = charge_ma * 95 / 100;
151+
charge_ma = charge_ma * 85 / 100;
152152

153153
if ((prochot_ma - charge_ma) < 128) {
154154
charge_ma = prochot_ma - 128;

0 commit comments

Comments
 (0)