diff options
Diffstat (limited to 'board')
35 files changed, 93 insertions, 49 deletions
diff --git a/board/boldar/board.c b/board/boldar/board.c index 19b8f44020..1076ccc040 100644 --- a/board/boldar/board.c +++ b/board/boldar/board.c @@ -474,6 +474,7 @@ void ppc_interrupt(enum gpio_signal signal) break; case GPIO_USB_C1_PPC_INT_ODL: syv682x_interrupt(USBC_PORT_C1); + break; default: break; } diff --git a/board/burnet/led.c b/board/burnet/led.c index 4aa91c63e2..68c4c9e839 100644 --- a/board/burnet/led.c +++ b/board/burnet/led.c @@ -147,7 +147,7 @@ static void led_set_battery(void) led_set_color_battery(LED_WHITE); break; } - /* Intentional fall-through */ + __fallthrough; case PWR_STATE_DISCHARGE: /* * Blink white light (1 sec on, 1 sec off) diff --git a/board/careena/led.c b/board/careena/led.c index 48a065fdb9..9a280a011b 100644 --- a/board/careena/led.c +++ b/board/careena/led.c @@ -110,7 +110,7 @@ static void led_set_battery(void) led_set_color_battery(LED_WHITE); break; } - /* Intentional fall-through */ + __fallthrough; case PWR_STATE_DISCHARGE: /* * Blink white light (1 sec on, 1 sec off) diff --git a/board/chronicler/usbc_config.c b/board/chronicler/usbc_config.c index b05cd4ecfd..85c40e93e1 100644 --- a/board/chronicler/usbc_config.c +++ b/board/chronicler/usbc_config.c @@ -68,6 +68,7 @@ void ppc_interrupt(enum gpio_signal signal) break; case GPIO_USB_C1_PPC_INT_ODL: syv682x_interrupt(USBC_PORT_C1); + break; default: break; } diff --git a/board/collis/board.c b/board/collis/board.c index 6b2c81bc02..56c67989a5 100644 --- a/board/collis/board.c +++ b/board/collis/board.c @@ -270,6 +270,7 @@ void ppc_interrupt(enum gpio_signal signal) break; case GPIO_USB_C1_PPC_INT_ODL: syv682x_interrupt(USBC_PORT_C1); + break; default: break; } diff --git a/board/copano/board.c b/board/copano/board.c index b4a8c5eb20..8d58fa1101 100644 --- a/board/copano/board.c +++ b/board/copano/board.c @@ -310,6 +310,7 @@ void ppc_interrupt(enum gpio_signal signal) break; case GPIO_USB_C1_PPC_INT_ODL: syv682x_interrupt(USBC_PORT_C1); + break; default: break; } diff --git a/board/coral/led.c b/board/coral/led.c index 8af0f6f3e2..b8515c14c7 100644 --- a/board/coral/led.c +++ b/board/coral/led.c @@ -188,7 +188,7 @@ static enum led_states led_get_state(void) new_state = STATE_CHARGING_LVL_3; break; } - /* Intentional fall-through */ + __fallthrough; case PWR_STATE_DISCHARGE /* and PWR_STATE_DISCHARGE_FULL */: if (chipset_in_state(CHIPSET_STATE_ON)) new_state = STATE_DISCHARGE_S0; diff --git a/board/corori/led.c b/board/corori/led.c index 89799c8e74..f47871a4ed 100644 --- a/board/corori/led.c +++ b/board/corori/led.c @@ -127,7 +127,7 @@ static enum led_states led_get_state(void) new_state = STATE_CHARGING_FULL_CHARGE; break; } - /* Intentional fall-through */ + __fallthrough; case PWR_STATE_DISCHARGE /* and PWR_STATE_DISCHARGE_FULL */: if (chipset_in_state(CHIPSET_STATE_ON)) new_state = (led_get_charge_percent() < 10) ? diff --git a/board/corori2/board.h b/board/corori2/board.h index 0fc4423020..3483d96f88 100644 --- a/board/corori2/board.h +++ b/board/corori2/board.h @@ -21,7 +21,7 @@ #define CONFIG_CHIP_INIT_ROM_REGION #undef CONFIG_CONSOLE_CMDHELP #define CONFIG_DEBUG_ASSERT_BRIEF -#define CONFIG_USB_PD_DEBUG_LEVEL 2 +#define CONFIG_USB_PD_DEBUG_LEVEL 0 /* EC console commands */ #define CONFIG_CMD_CHARGER_DUMP @@ -29,6 +29,8 @@ /* Remove default commands to free flash space */ #undef CONFIG_CMD_ACCELSPOOF #undef CONFIG_CMD_BATTFAKE +#undef CONFIG_CMD_GETTIME +#undef CONFIG_CMD_MEM /* Battery */ #define CONFIG_BATTERY_FUEL_GAUGE diff --git a/board/crota/board.c b/board/crota/board.c index fbcb6c7865..cb3e79ee56 100644 --- a/board/crota/board.c +++ b/board/crota/board.c @@ -53,7 +53,11 @@ DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, board_chipset_suspend, HOOK_PRIO_DEFAULT); static bool board_is_convertible(void) { - return !!get_fw_config().form_factor; + /* + * convertible = 0 + * clamshell = 1 + */ + return !get_fw_config().form_factor; } int board_sensor_at_360(void) diff --git a/board/crota/gpio.inc b/board/crota/gpio.inc index 7668442b7b..0a3471b5c0 100644 --- a/board/crota/gpio.inc +++ b/board/crota/gpio.inc @@ -104,6 +104,7 @@ ALTERNATE(PIN_MASK(8, 0x04), 0, MODULE_KB, GPIO_ODR_HIGH) /* KSO14/GPIO82 */ /* PMU alternate functions */ ALTERNATE(PIN_MASK(0, 0x01), 0, MODULE_PMU, GPIO_INT_BOTH | GPIO_HIB_WAKE_HIGH) /* PSL_IN2_L&GPI00/GPIO00 */ ALTERNATE(PIN_MASK(0, 0x02), 0, MODULE_PMU, GPIO_INT_BOTH | GPIO_HIB_WAKE_LOW) /* GPIO01/PSL_IN3_L&GPI01 */ +ALTERNATE(PIN_MASK(D, 0x04), 0, MODULE_PMU, GPIO_INT_BOTH | GPIO_HIB_WAKE_HIGH) /* PSL_IN1_L&GPID2/GPIOD2 */ /* Unused Pins */ UNUSED(PIN(D, 6)) /* GPOD6/CR_SOUT3/SHDF_ESPI_L */ diff --git a/board/delbin/board.c b/board/delbin/board.c index 1cdb42d954..28a0c929e2 100644 --- a/board/delbin/board.c +++ b/board/delbin/board.c @@ -370,6 +370,7 @@ void ppc_interrupt(enum gpio_signal signal) break; case GPIO_USB_C1_PPC_INT_ODL: syv682x_interrupt(USBC_PORT_C1); + break; default: break; } diff --git a/board/dojo/board.c b/board/dojo/board.c index 65a1635111..62f2e6ac09 100644 --- a/board/dojo/board.c +++ b/board/dojo/board.c @@ -24,6 +24,7 @@ #include "hooks.h" #include "keyboard_scan.h" #include "motion_sense.h" +#include "power.h" #include "pwm.h" #include "pwm_chip.h" #include "system.h" @@ -476,6 +477,24 @@ void board_set_charge_limit(int port, int supplier, int charge_ma, int max_ma, MAX(charge_ma, CONFIG_CHARGER_INPUT_CURRENT), charge_mv); } +/* NVME */ +static void nvme_enable(int enable) +{ + gpio_set_level(GPIO_EN_PP3300_SSD, enable); +} + +void suspend_resume_power_signal_interrupt(enum gpio_signal signal) +{ + /* AP resume */ + if (gpio_get_level(signal) == GPIO_SIGNAL_RESUME) + nvme_enable(1); + /* AP suspend */ + else + nvme_enable(0); + + power_signal_interrupt(signal); +} + /* Initialize board. */ static void board_init(void) { @@ -489,23 +508,17 @@ static void board_init(void) /* Store base sensor to recognize which base sensor we are using */ base_sensor = get_cbi_ssfc_base_sensor(); + /* Make sure that nvme can be enabled/disabled when board init */ + if (gpio_get_level(GPIO_AP_IN_SLEEP_L) == GPIO_SIGNAL_RESUME) + nvme_enable(1); + else + nvme_enable(0); + board_update_motion_sensor_config(); board_update_vol_up_key(); } DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT); -static void enable_nvme(void) -{ - gpio_set_level(GPIO_EN_PP3300_SSD, 1); -} -DECLARE_HOOK(HOOK_CHIPSET_RESUME_INIT, enable_nvme, HOOK_PRIO_FIRST); - -static void disable_nvme(void) -{ - gpio_set_level(GPIO_EN_PP3300_SSD, 0); -} -DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, disable_nvme, HOOK_PRIO_DEFAULT); - static void board_do_chipset_resume(void) { gpio_set_level(GPIO_EN_KB_BL, 1); diff --git a/board/dojo/board.h b/board/dojo/board.h index cc2d5eba2f..ad34d7679c 100644 --- a/board/dojo/board.h +++ b/board/dojo/board.h @@ -154,6 +154,13 @@ struct vol_up_key { uint8_t col; }; +/* AP in sleep power signal */ +enum ap_in_sleep_l_signal { + GPIO_SIGNAL_SUSPEND = 0, + GPIO_SIGNAL_RESUME, +}; +void suspend_resume_power_signal_interrupt(enum gpio_signal signal); + int board_accel_force_mode_mask(void); void motion_interrupt(enum gpio_signal signal); diff --git a/board/dojo/gpio.inc b/board/dojo/gpio.inc index 0fb85b47b7..35a0fa0eae 100644 --- a/board/dojo/gpio.inc +++ b/board/dojo/gpio.inc @@ -24,7 +24,8 @@ GPIO_INT(AP_EC_WARM_RST_REQ, PIN(D, 3), GPIO_INT_RISING | GPIO_SEL_1P8V, GPIO_INT(AP_EC_WATCHDOG_L, PIN(C, 7), GPIO_INT_BOTH | GPIO_SEL_1P8V, chipset_watchdog_interrupt) GPIO_INT(AP_IN_SLEEP_L, PIN(F, 2), - GPIO_INT_BOTH | GPIO_PULL_DOWN | GPIO_SEL_1P8V, power_signal_interrupt) + GPIO_INT_BOTH | GPIO_PULL_DOWN | GPIO_SEL_1P8V, + suspend_resume_power_signal_interrupt) GPIO_INT(PMIC_EC_PWRGD, PIN(F, 3), GPIO_INT_BOTH | GPIO_PULL_DOWN | GPIO_SEL_1P8V, power_signal_interrupt) diff --git a/board/drawcia/led.c b/board/drawcia/led.c index 8e6263fbbc..0fee248506 100644 --- a/board/drawcia/led.c +++ b/board/drawcia/led.c @@ -142,7 +142,7 @@ static void led_set_battery(void) led_set_color_battery(LED_WHITE); break; } - /* Intentional fall-through */ + __fallthrough; case PWR_STATE_DISCHARGE: /* * Blink white light (1 sec on, 1 sec off) diff --git a/board/drawcia_riscv/led.c b/board/drawcia_riscv/led.c index 3cb7cb835e..d72626b2a2 100644 --- a/board/drawcia_riscv/led.c +++ b/board/drawcia_riscv/led.c @@ -142,7 +142,7 @@ static void led_set_battery(void) led_set_color_battery(LED_WHITE); break; } - /* Intentional fall-through */ + __fallthrough; case PWR_STATE_DISCHARGE: /* * Blink white light (1 sec on, 1 sec off) diff --git a/board/drobit/board.c b/board/drobit/board.c index 19b5162092..1a20870d1f 100644 --- a/board/drobit/board.c +++ b/board/drobit/board.c @@ -303,6 +303,7 @@ void ppc_interrupt(enum gpio_signal signal) break; case GPIO_USB_C1_PPC_INT_ODL: syv682x_interrupt(USBC_PORT_C1); + break; default: break; } diff --git a/board/eldrid/board.c b/board/eldrid/board.c index 717878bc95..81fdf22ffc 100644 --- a/board/eldrid/board.c +++ b/board/eldrid/board.c @@ -516,6 +516,7 @@ void ppc_interrupt(enum gpio_signal signal) break; case GPIO_USB_C1_PPC_INT_ODL: syv682x_interrupt(USBC_PORT_C1); + break; default: break; } diff --git a/board/elemi/board.c b/board/elemi/board.c index 6b166e1206..96860d2335 100644 --- a/board/elemi/board.c +++ b/board/elemi/board.c @@ -347,6 +347,7 @@ void ppc_interrupt(enum gpio_signal signal) break; case GPIO_USB_C1_PPC_INT_ODL: syv682x_interrupt(USBC_PORT_C1); + break; default: break; } diff --git a/board/haboki/led.c b/board/haboki/led.c index b31d4fab75..c6e481e285 100644 --- a/board/haboki/led.c +++ b/board/haboki/led.c @@ -142,7 +142,7 @@ static void led_set_battery(void) led_set_color_battery(LED_WHITE); break; } - /* Intentional fall-through */ + __fallthrough; case PWR_STATE_DISCHARGE: /* * Blink white light (1 sec on, 1 sec off) diff --git a/board/hatch_fp/build.mk b/board/hatch_fp/build.mk index 4afdb1c1c3..828e7523b3 100644 --- a/board/hatch_fp/build.mk +++ b/board/hatch_fp/build.mk @@ -55,6 +55,7 @@ test-list-y=\ sha256_unrolled \ static_if \ stdlib \ + std_vector \ stm32f_rtc \ system_is_locked \ timer_dos \ diff --git a/board/kappa/led.c b/board/kappa/led.c index 1c7979eac0..1dc86013d7 100644 --- a/board/kappa/led.c +++ b/board/kappa/led.c @@ -104,7 +104,7 @@ static void led_set_battery(void) led_set_color_battery(LED_WHITE); break; } - /* Intentional fall-through */ + __fallthrough; case PWR_STATE_DISCHARGE: /* * Blink white light (1 sec on, 1 sec off) diff --git a/board/kuldax/led.c b/board/kuldax/led.c index 8da760193b..39b79e2196 100644 --- a/board/kuldax/led.c +++ b/board/kuldax/led.c @@ -182,6 +182,16 @@ static void led_resume(void) } DECLARE_HOOK(HOOK_CHIPSET_RESUME, led_resume, HOOK_PRIO_DEFAULT); +void board_led_auto_control(void) +{ + if (chipset_in_state(CHIPSET_STATE_ON)) + led_resume(); + else if (chipset_in_state(CHIPSET_STATE_SUSPEND)) + led_suspend_hook(); + else if (chipset_in_state(CHIPSET_STATE_ANY_OFF)) + led_shutdown_hook(); +} + void led_alert(int enable) { if (enable) { diff --git a/board/lantis/led.c b/board/lantis/led.c index d6dbc929a8..3b66ad6d6b 100644 --- a/board/lantis/led.c +++ b/board/lantis/led.c @@ -199,7 +199,7 @@ static void led_set_battery(void) set_active_port_color(LED_WHITE); break; } - /* Intentional fall-through */ + __fallthrough; case PWR_STATE_DISCHARGE: /* * Blink white/amber light (1 sec on, 1 sec off) diff --git a/board/lindar/board.c b/board/lindar/board.c index 5bb155550e..e3ee0ff9c4 100644 --- a/board/lindar/board.c +++ b/board/lindar/board.c @@ -479,6 +479,7 @@ void ppc_interrupt(enum gpio_signal signal) break; case GPIO_USB_C1_PPC_INT_ODL: syv682x_interrupt(USBC_PORT_C1); + break; default: break; } diff --git a/board/moli/thermal.c b/board/moli/thermal.c index 110d8ae2db..16aaa5c069 100644 --- a/board/moli/thermal.c +++ b/board/moli/thermal.c @@ -52,21 +52,21 @@ static const struct fan_step fan_table[] = { }, { /* level 3 */ - .on = { -1, 70, -1 }, - .off = { -1, 67, -1 }, - .rpm = { 3500 }, + .on = { -1, 64, -1 }, + .off = { -1, 61, -1 }, + .rpm = { 3700 }, }, { /* level 4 */ - .on = { -1, 80, -1 }, - .off = { -1, 77, -1 }, - .rpm = { 4000 }, + .on = { -1, 67, -1 }, + .off = { -1, 64, -1 }, + .rpm = { 4400 }, }, { /* level 5 */ - .on = { -1, 90, -1 }, - .off = { -1, 87, -1 }, - .rpm = { 4500 }, + .on = { -1, 70, -1 }, + .off = { -1, 67, -1 }, + .rpm = { 5000 }, }, }; const int num_fan_levels = ARRAY_SIZE(fan_table); diff --git a/board/nocturne_fp/build.mk b/board/nocturne_fp/build.mk index c15535555e..65ffd6c096 100644 --- a/board/nocturne_fp/build.mk +++ b/board/nocturne_fp/build.mk @@ -55,6 +55,7 @@ test-list-y=\ sha256_unrolled \ static_if \ stdlib \ + std_vector \ system_is_locked \ timer_dos \ utils \ diff --git a/board/reef/led.c b/board/reef/led.c index 95db062d10..8bc52dbc75 100644 --- a/board/reef/led.c +++ b/board/reef/led.c @@ -104,7 +104,7 @@ static void led_set_battery(void) led_set_color_battery(LED_BLUE); break; } - /* Intentional fall-through */ + __fallthrough; case PWR_STATE_DISCHARGE /* and PWR_STATE_DISCHARGE_FULL */: if (chipset_in_state(CHIPSET_STATE_ON)) { led_set_color_battery(LED_BLUE); diff --git a/board/reef_it8320/led.c b/board/reef_it8320/led.c index 1b521b9409..630fdf336d 100644 --- a/board/reef_it8320/led.c +++ b/board/reef_it8320/led.c @@ -105,7 +105,7 @@ static void led_set_battery(void) led_set_color_battery(LED_BLUE); break; } - /* Intentional fall-through */ + __fallthrough; case PWR_STATE_DISCHARGE /* and PWR_STATE_DISCHARGE_FULL */: if (chipset_in_state(CHIPSET_STATE_ON)) { led_set_color_battery(LED_BLUE); diff --git a/board/reef_mchp/led.c b/board/reef_mchp/led.c index 469758dc26..96ea6bb958 100644 --- a/board/reef_mchp/led.c +++ b/board/reef_mchp/led.c @@ -105,7 +105,7 @@ static void led_set_battery(void) led_set_color_battery(LED_BLUE); break; } - /* Intentional fall-through */ + __fallthrough; case PWR_STATE_DISCHARGE /* and PWR_STATE_DISCHARGE_FULL */: if (chipset_in_state(CHIPSET_STATE_ON)) { led_set_color_battery(LED_BLUE); diff --git a/board/vell/sensors.c b/board/vell/sensors.c index f088fc8867..4957055a7d 100644 --- a/board/vell/sensors.c +++ b/board/vell/sensors.c @@ -217,7 +217,6 @@ BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT); [EC_TEMP_THRESH_HIGH] = C_TO_K(85), \ }, \ } -__maybe_unused static const struct ec_thermal_config thermal_cpu = THERMAL_CPU; /* * TODO(b/203839956): update for Alder Lake/vell @@ -235,8 +234,6 @@ __maybe_unused static const struct ec_thermal_config thermal_cpu = THERMAL_CPU; [EC_TEMP_THRESH_HIGH] = C_TO_K(85), \ }, \ } -__maybe_unused static const struct ec_thermal_config thermal_charger = - THERMAL_CHARGER; /* * TODO(b/203839956): update for vell WWAN module @@ -254,8 +251,6 @@ __maybe_unused static const struct ec_thermal_config thermal_charger = [EC_TEMP_THRESH_HIGH] = C_TO_K(65), \ }, \ } -__maybe_unused static const struct ec_thermal_config thermal_wwan = - THERMAL_WWAN; /* * TODO(b/203839956): update for Alder Lake/vell @@ -274,7 +269,6 @@ __maybe_unused static const struct ec_thermal_config thermal_wwan = [EC_TEMP_THRESH_HIGH] = C_TO_K(75), \ }, \ } -__maybe_unused static const struct ec_thermal_config thermal_ddr = THERMAL_DDR; /* * TODO(b/203839956): update for Alder Lake/vell @@ -293,13 +287,11 @@ __maybe_unused static const struct ec_thermal_config thermal_ddr = THERMAL_DDR; [EC_TEMP_THRESH_HIGH] = C_TO_K(75), \ }, \ } -__maybe_unused static const struct ec_thermal_config thermal_regulator = - THERMAL_REGULATOR; struct ec_thermal_config thermal_params[] = { - [TEMP_SENSOR_1_SOC] = thermal_cpu, - [TEMP_SENSOR_2_CHARGER] = thermal_charger, - [TEMP_SENSOR_3_WWAN] = thermal_wwan, - [TEMP_SENSOR_4_DDR] = thermal_ddr, - [TEMP_SENSOR_5_REGULATOR] = thermal_regulator, + [TEMP_SENSOR_1_SOC] = THERMAL_CPU, + [TEMP_SENSOR_2_CHARGER] = THERMAL_CHARGER, + [TEMP_SENSOR_3_WWAN] = THERMAL_WWAN, + [TEMP_SENSOR_4_DDR] = THERMAL_DDR, + [TEMP_SENSOR_5_REGULATOR] = THERMAL_REGULATOR, }; diff --git a/board/voema/board.c b/board/voema/board.c index c4563df105..363cc603ad 100644 --- a/board/voema/board.c +++ b/board/voema/board.c @@ -309,6 +309,7 @@ void ppc_interrupt(enum gpio_signal signal) break; case GPIO_USB_C1_PPC_INT_ODL: syv682x_interrupt(USBC_PORT_C1); + break; default: break; } diff --git a/board/volet/board.c b/board/volet/board.c index 474ec9cb0e..47140464b6 100644 --- a/board/volet/board.c +++ b/board/volet/board.c @@ -369,6 +369,7 @@ void ppc_interrupt(enum gpio_signal signal) break; case GPIO_USB_C1_PPC_INT_ODL: syv682x_interrupt(USBC_PORT_C1); + break; default: break; } diff --git a/board/voxel/board.c b/board/voxel/board.c index 40dfbe8dc4..4c8badeb1c 100644 --- a/board/voxel/board.c +++ b/board/voxel/board.c @@ -367,6 +367,7 @@ void ppc_interrupt(enum gpio_signal signal) break; case GPIO_USB_C1_PPC_INT_ODL: syv682x_interrupt(USBC_PORT_C1); + break; default: break; } |