Skip to content

Commit c75100f

Browse files
committed
Merge remote-tracking branch 'github-private/marigold' into marigold.rw_support
2 parents 8ad272a + d3c5beb commit c75100f

37 files changed

Lines changed: 983 additions & 387 deletions

.github/workflows/zephyr-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
matrix:
2727
platform: [
2828
# Marigold builder uses same folder for all
29-
{ name: marigold, folder: marigold1, ver: "1.0.2", sha_len: 7, zephyr_ref: "marigold", cmsis_ref: "cros/chromeos-main" },
29+
{ name: marigold, folder: marigold1, ver: "2.0.0", sha_len: 7, zephyr_ref: "marigold", cmsis_ref: "cros/chromeos-main" },
3030
# Lotus and Azalea official releases are NOT coming from this branch
3131
{ name: lotus, folder: marigold1, ver: "0.0.0", sha_len: 7, zephyr_ref: "marigold", cmsis_ref: "cros/chromeos-main" },
3232
{ name: azalea, folder: marigold1, ver: "0.0.0", sha_len: 7, zephyr_ref: "marigold", cmsis_ref: "cros/chromeos-main" },

common/thermal.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ static void thermal_control(void)
9797
int fmax = 0;
9898
int temp_fan_configured = 0;
9999
#else
100-
int temp[TEMP_SENSOR_COUNT];
100+
int temp[TEMP_SENSOR_COUNT] = {0};
101101
#endif
102102
#endif
103103

@@ -121,16 +121,16 @@ static void thermal_control(void)
121121
/* read one */
122122
rv = temp_sensor_read(i, &t);
123123

124-
#if defined(CONFIG_FANS) && defined(CONFIG_CUSTOM_FAN_CONTROL)
125-
/* Store all sensors value */
126-
temp[i] = K_TO_C(t);
127-
#endif
128-
129124
if (rv != EC_SUCCESS)
130125
continue;
131126
else
132127
num_sensors_read++;
133128

129+
#if defined(CONFIG_FANS) && defined(CONFIG_CUSTOM_FAN_CONTROL)
130+
/* Store all sensors value */
131+
temp[i] = K_TO_C(t);
132+
#endif
133+
134134
/* check all the limits */
135135
for (j = 0; j < EC_TEMP_THRESH_COUNT; j++) {
136136
int limit = thermal_params[i].temp_host[j];

zephyr/program/framework/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ zephyr_library_sources("src/diagnostics.c")
1616
zephyr_library_sources("src/ucsi.c")
1717
zephyr_library_sources("src/als.c")
1818
zephyr_library_sources("src/hid_device.c")
19+
zephyr_library_sources("src/temperature_filter.c")
1920

2021
zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_LED_COMMON
2122
"src/led_pwm.c")
@@ -53,6 +54,8 @@ if(DEFINED CONFIG_BOARD_LOTUS)
5354
"lotus/src/thermal.c"
5455
"lotus/src/gpu_configuration.c"
5556
"lotus/src/gpu_f75303.c"
57+
"src/temperature_filter.c"
58+
5659

5760

5861
)
@@ -92,6 +95,7 @@ if(DEFINED CONFIG_BOARD_MARIGOLD)
9295
"marigold/src/project_diagnostics.c"
9396
"marigold/src/power_button_x86.c"
9497
"marigold/src/temperature.c"
98+
"marigold/src/thermal.c"
9599
)
96100

97101
endif()

zephyr/program/framework/Kconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ config CHIPSET_AMD
3535
Framework project which uses the AMD chipset.
3636
Enable the AMD feature.
3737

38+
config PD_USB_PID
39+
hex "PD Controller's USB PID"
40+
default 0x0001
41+
help
42+
The USB Product ID (PID) of the PD controller
43+
Default is the one we used on 11th Gen and forgot to update on every project since.
44+
3845
config PD_CHIP_CCG8
3946
bool "Select CCG8 PD chip"
4047
default n
@@ -81,6 +88,14 @@ config PD_CCG6_SOC_UART_DEBUG_PORT
8188
EC needs to switch the external mux to turn on the path for SoC
8289
uart.
8390

91+
config PD_CCG6_WAIT_STABLE_TIMER
92+
int "The timer to wait X ms to setup the PD chip"
93+
default 0
94+
depends on PD_CHIP_CCG6
95+
help
96+
EC should wait X ms the PD chip run in stable mode then start to
97+
communicate.
98+
8499
config PD_COMMON_VBUS_CONTROL
85100
bool "Enable CCG common vbus control"
86101
help

zephyr/program/framework/azalea/led_pins.dtsi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080

8181
color_power_white: color-power-white {
8282
led-color = "LED_WHITE";
83+
/* maximum duty */
8384
led-values = <55>;
8485
};
8586
};

zephyr/program/framework/azalea/led_policy.dtsi

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,31 @@
101101

102102
power_led {
103103
led-id = "EC_LED_ID_POWER_LED";
104+
transition = "LED_TRANSITION_LINEAR";
105+
106+
/* period-ms =
107+
* target time * tick time (200ms) / deferred time (10ms)
108+
*/
109+
110+
/* Fade time target 600ms (In, low to high) */
104111
color-0 {
112+
led-color = "LED_WHITE";
113+
period-ms = <12000>;
114+
};
115+
/* Duration time target 900ms */
116+
color-1 {
117+
led-color = "LED_WHITE";
118+
period-ms = <18000>;
119+
};
120+
/* Fade time target 600ms (Out, high to low) */
121+
color-2 {
122+
led-color = "LED_OFF";
123+
period-ms = <12000>;
124+
};
125+
/* Interval time target 1900ms */
126+
color-3 {
105127
led-color = "LED_OFF";
128+
period-ms = <37000>;
106129
};
107130
};
108131
};

zephyr/program/framework/azalea/src/power_sequence.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ enum power_state power_handle_state(enum power_state state)
428428
/* wait VR power good */
429429
if (power_wait_signals(IN_VR_PGOOD)) {
430430
/* something wrong, turn off power and force to g3 */
431-
set_diagnostic(DIAGNOSTICS_VCCIN_AUX_VR, 1);
431+
set_diagnostic(DIAGNOSTICS_HW_PGOOD_VR, 1);
432432
chipset_force_g3();
433433
return POWER_G3;
434434
}

zephyr/program/framework/include/cypress_pd_common.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,15 @@
4949
#define CCG_CUST_C_CTRL_CONTROL_REG 0x003B
5050
#define CCG_HPI_VERSION 0x003C
5151
/*User registers from 0x40 to 0x48 are used for BB retimer */
52+
#ifdef CONFIG_PD_CHIP_CCG8
5253
#define CCG_DPM_CMD_REG 0x0040
5354
#define CCG_MUX_CFG_REG 0x0041
5455
#define CCG_DEINIT_PORT_REG 0x0042
56+
#elif defined(CONFIG_PD_CHIP_CCG6)
57+
#define CCG_DPM_CMD_REG 0x004C
58+
#define CCG_MUX_CFG_REG 0x004D
59+
#define CCG_DEINIT_PORT_REG 0x004E
60+
#endif
5561
#define CCG_ICL_STS_REG 0x0042
5662
#define CCG_ICL_BB_RETIMER_CMD_REG 0x0046
5763
#define CCG_ICL_BB_RETIMER_DAT_REG 0x0048
@@ -426,6 +432,7 @@ enum ccg_response {
426432

427433
enum ccg_pd_state {
428434
CCG_STATE_ERROR,
435+
CCG_STATE_WAIT_STABLE,
429436
CCG_STATE_POWER_ON,
430437
CCG_STATE_APP_SETUP,
431438
CCG_STATE_READY,
@@ -765,6 +772,13 @@ int cypd_vbus_state_check(void);
765772
*/
766773
int cypd_get_ac_power(void);
767774

775+
/**
776+
* Return active port voltage, return by mV.
777+
*
778+
* @return int
779+
*/
780+
int cypd_get_active_port_voltage(void);
781+
768782
/**
769783
* Set Pdo profile for safety action
770784
*

zephyr/program/framework/include/intel_cpu_power_interface.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
#ifndef __CROS_EC_INTEL_CPU_POWER_INTERFACE_H
77
#define __CROS_EC_INTEL_CPU_POWER_INTERFACE_H
88

9-
#define POWER_LIMIT_1_W 30
10-
119
/******************** Tau Value (TimeWindow)*************************************
1210
* 0.5sec: 0x1; 0.6sec : 0x52, 0.7sec: 0x92; 0.8sec : 0xD2
1311
* 1sec: 0x14; 1.25sec: 0x54; 1.5sec: 0x94; 1.75sec: 0xD4
@@ -19,6 +17,7 @@
1917
*******************************************************************************/
2018
#define TIME_WINDOW_PL1 0xDC
2119
#define TIME_WINDOW_PL2 0xDC
20+
#define TIME_WINDOW_PSYSPL2 0xDC
2221

2322
/******************** PL3 TimeWindow *******************************************
2423
* 1ms: 0x00; 1.25ms: 0x40; 1.5ms: 0xC0; 1.75ms: 0x80
@@ -64,9 +63,10 @@
6463

6564
extern int pl1_watt;
6665
extern int pl2_watt;
67-
extern int pl4_watt;
6866
extern int pl3_watt;
67+
extern int pl4_watt;
68+
extern int psyspl2_watt;
6969

70-
int set_pl_limits(int pl1, int pl2, int pl4);
70+
int set_pl_limits(int pl1, int pl2, int pl4, int psyspl2);
7171

7272
#endif

zephyr/program/framework/include/led.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,6 @@
2929
#define FP_LED_MEDIUM 40
3030
#define FP_LED_LOW 15
3131

32-
#define BREATH_ON_LENGTH_HIGH 62
33-
#define BREATH_ON_LENGTH_MID 72
34-
#define BREATH_ON_LENGTH_LOW 90
35-
36-
#define BREATH_OFF_LENGTH 200
37-
3832
enum led_color {
3933
LED_OFF,
4034
LED_RED,
@@ -172,7 +166,7 @@ void led_set_color_with_pattern(const struct led_pattern_node_t *led);
172166
*/
173167
void board_led_apply_color(void);
174168

175-
void pwm_set_breath_dt(int percent);
169+
void update_pwr_led_level(void);
176170

177171
#ifdef TEST_BUILD
178172
const struct led_pins_node_t *led_get_node(enum led_color color,

0 commit comments

Comments
 (0)