diff options
author | Tom Hughes <tomhughes@chromium.org> | 2022-09-21 14:08:36 -0700 |
---|---|---|
committer | Tom Hughes <tomhughes@chromium.org> | 2022-09-22 12:59:38 -0700 |
commit | c453fd704268ef72de871b0c5ac7a989de662334 (patch) | |
tree | fcf6ce5810f9ff9e3c8cce434812dd75492269ed /board/drawcia_riscv | |
parent | 6c1587ca70f558b4f96b3f0b18ad8b027d3ba99d (diff) | |
parent | 28712dae9d7ed1e694f7622cc083afa71090d4d5 (diff) | |
download | chrome-ec-firmware-fpmcu-dartmonkey-release.tar.gz |
Merge remote-tracking branch cros/main into firmware-fpmcu-dartmonkey-releasefirmware-fpmcu-dartmonkey-release
Generated by: ./util/update_release_branch.py --board dartmonkey --relevant_paths_file
./util/fingerprint-relevant-paths.txt firmware-fpmcu-dartmonkey-release
Relevant changes:
git log --oneline 6c1587ca70..28712dae9d -- board/nocturne_fp
board/dartmonkey common/fpsensor docs/fingerprint driver/fingerprint
util/getversion.sh
ded9307b79 util/getversion.sh: Fix version when not in a git repo
956055e692 board: change Google USB vendor info
71b2ef709d Update license boilerplate text in source code files
33e11afda0 Revert "fpsensor: Build fpsensor source file with C++"
c8d0360723 fpsensor: Build fpsensor source file with C++
bc113abd53 fpsensor: Fix g++ compiler error
150a58a0dc fpsensor: Fix fp_set_sensor_mode return type
b33b5ce85b fpsensor: Remove nested designators for C++ compatibility
2e864b2539 tree-wide: const-ify argv for console commands
56d8b360f9 test: Add test for get ikm failure when seed not set
3a3d6c3690 test: Add test for fpsensor trivial key failure
233e6bbd08 fpsensor_crypto: Abstract calls to hmac_SHA256
0a041b285b docs/fingerprint: Typo correction
c03fab67e2 docs/fingerprint: Fix the path of fputils.py
0b5d4baf5a util/getversion.sh: Fix empty file list handling
6e128fe760 FPMCU dev board environment with Satlab
3eb29b6aa5 builtin: Move ssize_t to sys/types.h
345d62ebd1 docs/fingerprint: Update power numbers for latest dartmonkey release
c25ffdb316 common: Conditionally support printf %l and %i modifiers
9a3c514b45 test: Add a test to check if the debugger is connected
54e603413f Move standard library tests to their own file
43fa6b4bf8 docs/fingerprint: Update power numbers for latest bloonchipper release
25536f9a84 driver/fingerprint/fpc/bep/fpc_sensor_spi.c: Format with clang-format
4face99efd driver/fingerprint/fpc/libfp/fpc_sensor_pal.h: Format with clang-format
738de2b575 trng: Rename rand to trng_rand
14b8270edd docs/fingerprint: Update dragonclaw power numbers
0b268f93d1 driver/fingerprint/fpc/libfp/fpc_private.c: Format with clang-format
f80da163f2 driver/fingerprint/fpc/libfp/fpc_private.h: Format with clang-format
a0751778f4 board/nocturne_fp/ro_workarounds.c: Format with clang-format
5e9c85c9b1 driver/fingerprint/fpc/libfp/fpc_sensor_pal.c: Format with clang-format
c1f9dd3cf8 driver/fingerprint/fpc/libfp/fpc_bio_algorithm.h: Format with clang-format
eb1e1bed8d driver/fingerprint/fpc/libfp/fpc1145_private.h: Format with clang-format
6e7b611821 driver/fingerprint/fpc/bep/fpc_bio_algorithm.h: Format with clang-format
e0589cd5e2 driver/fingerprint/fpc/bep/fpc1035_private.h: Format with clang-format
58f0246dbe board/nocturne_fp/board_ro.c: Format with clang-format
7905e556a0 common/fpsensor/fpsensor_crypto.c: Format with clang-format
21289d170c driver/fingerprint/fpc/bep/fpc1025_private.h: Format with clang-format
98a20f937e common/fpsensor/fpsensor_state.c: Format with clang-format
a2d255d8af common/fpsensor/fpsensor.c: Format with clang-format
84e53a65da board/nocturne_fp/board.h: Format with clang-format
73055eeb3f driver/fingerprint/fpc/bep/fpc_private.c: Format with clang-format
0f7b5cb509 common/fpsensor/fpsensor_private.h: Format with clang-format
1ceade6e65 driver/fingerprint/fpc/bep/fpc_private.h: Format with clang-format
dca9d74321 Revert "trng: Rename rand to trng_rand"
a6b0b3554f trng: Rename rand to trng_rand
28d0b75b70 third_party/boringssl: Remove unused header
BRANCH=None
BUG=b:244387210 b:242720240 b:215613183 b:242720910 b:236386294
BUG=b:234181908 b:244781166 b:234781655 b:234143158 b:234181908
BUG=b:237344361 b:236025198 b:234181908 b:180945056 chromium:1098010
BUG=b:246424843 b:234181908 b:131913998
TEST=`make -j buildall`
TEST=./util/run_device_tests.py --board dartmonkey
Test "aes": PASSED
Test "cec": PASSED
Test "cortexm_fpu": PASSED
Test "crc": PASSED
Test "flash_physical": PASSED
Test "flash_write_protect": PASSED
Test "fpsensor_hw": PASSED
Test "fpsensor_spi_ro": PASSED
Test "fpsensor_spi_rw": PASSED
Test "fpsensor_uart_ro": PASSED
Test "fpsensor_uart_rw": PASSED
Test "mpu_ro": PASSED
Test "mpu_rw": PASSED
Test "mutex": PASSED
Test "pingpong": PASSED
Test "printf": PASSED
Test "queue": PASSED
Test "rollback_region0": PASSED
Test "rollback_region1": PASSED
Test "rollback_entropy": PASSED
Test "rtc": PASSED
Test "sha256": PASSED
Test "sha256_unrolled": PASSED
Test "static_if": PASSED
Test "stdlib": PASSED
Test "system_is_locked_wp_on": PASSED
Test "system_is_locked_wp_off": PASSED
Test "timer_dos": PASSED
Test "utils": PASSED
Test "utils_str": PASSED
Test "panic_data_dartmonkey_v2.0.2887": PASSED
Test "panic_data_nocturne_fp_v2.2.64": PASSED
Test "panic_data_nami_fp_v2.2.144": PASSED
Force-Relevant-Builds: all
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: I2c312583a709fedae8fe11d92c22328c3b634bc7
Diffstat (limited to 'board/drawcia_riscv')
-rw-r--r-- | board/drawcia_riscv/battery.c | 2 | ||||
-rw-r--r-- | board/drawcia_riscv/board.c | 204 | ||||
-rw-r--r-- | board/drawcia_riscv/board.h | 45 | ||||
-rw-r--r-- | board/drawcia_riscv/build.mk | 2 | ||||
-rw-r--r-- | board/drawcia_riscv/cbi_ssfc.c | 6 | ||||
-rw-r--r-- | board/drawcia_riscv/cbi_ssfc.h | 3 | ||||
-rw-r--r-- | board/drawcia_riscv/ec.tasklist | 2 | ||||
-rw-r--r-- | board/drawcia_riscv/gpio.inc | 2 | ||||
-rw-r--r-- | board/drawcia_riscv/led.c | 34 | ||||
-rw-r--r-- | board/drawcia_riscv/usb_pd_policy.c | 19 |
10 files changed, 147 insertions, 172 deletions
diff --git a/board/drawcia_riscv/battery.c b/board/drawcia_riscv/battery.c index 4aa0f49043..074bc78d58 100644 --- a/board/drawcia_riscv/battery.c +++ b/board/drawcia_riscv/battery.c @@ -1,4 +1,4 @@ -/* Copyright 2021 The Chromium OS Authors. All rights reserved. +/* Copyright 2021 The ChromiumOS Authors * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. * diff --git a/board/drawcia_riscv/board.c b/board/drawcia_riscv/board.c index e770d17818..cbc977d64b 100644 --- a/board/drawcia_riscv/board.c +++ b/board/drawcia_riscv/board.c @@ -1,4 +1,4 @@ -/* Copyright 2021 The Chromium OS Authors. All rights reserved. +/* Copyright 2021 The ChromiumOS Authors * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ @@ -42,7 +42,7 @@ #include "usb_pd.h" #include "usb_pd_tcpm.h" -#define CPRINTUSB(format, args...) cprints(CC_USBCHARGE, format, ## args) +#define CPRINTUSB(format, args...) cprints(CC_USBCHARGE, format, ##args) #define INT_RECHECK_US 5000 @@ -165,48 +165,36 @@ static void pen_detect_interrupt(enum gpio_signal s) /* ADC channels */ const struct adc_t adc_channels[] = { - [ADC_VSNS_PP3300_A] = { - .name = "PP3300_A_PGOOD", - .factor_mul = ADC_MAX_MVOLT, - .factor_div = ADC_READ_MAX + 1, - .shift = 0, - .channel = CHIP_ADC_CH0 - }, - [ADC_TEMP_SENSOR_1] = { - .name = "TEMP_SENSOR1", - .factor_mul = ADC_MAX_MVOLT, - .factor_div = ADC_READ_MAX + 1, - .shift = 0, - .channel = CHIP_ADC_CH2 - }, - [ADC_TEMP_SENSOR_2] = { - .name = "TEMP_SENSOR2", - .factor_mul = ADC_MAX_MVOLT, - .factor_div = ADC_READ_MAX + 1, - .shift = 0, - .channel = CHIP_ADC_CH3 - }, - [ADC_SUB_ANALOG] = { - .name = "SUB_ANALOG", - .factor_mul = ADC_MAX_MVOLT, - .factor_div = ADC_READ_MAX + 1, - .shift = 0, - .channel = CHIP_ADC_CH13 - }, - [ADC_TEMP_SENSOR_3] = { - .name = "TEMP_SENSOR3", - .factor_mul = ADC_MAX_MVOLT, - .factor_div = ADC_READ_MAX + 1, - .shift = 0, - .channel = CHIP_ADC_CH15 - }, - [ADC_TEMP_SENSOR_4] = { - .name = "TEMP_SENSOR4", - .factor_mul = ADC_MAX_MVOLT, - .factor_div = ADC_READ_MAX + 1, - .shift = 0, - .channel = CHIP_ADC_CH16 - }, + [ADC_VSNS_PP3300_A] = { .name = "PP3300_A_PGOOD", + .factor_mul = ADC_MAX_MVOLT, + .factor_div = ADC_READ_MAX + 1, + .shift = 0, + .channel = CHIP_ADC_CH0 }, + [ADC_TEMP_SENSOR_1] = { .name = "TEMP_SENSOR1", + .factor_mul = ADC_MAX_MVOLT, + .factor_div = ADC_READ_MAX + 1, + .shift = 0, + .channel = CHIP_ADC_CH2 }, + [ADC_TEMP_SENSOR_2] = { .name = "TEMP_SENSOR2", + .factor_mul = ADC_MAX_MVOLT, + .factor_div = ADC_READ_MAX + 1, + .shift = 0, + .channel = CHIP_ADC_CH3 }, + [ADC_SUB_ANALOG] = { .name = "SUB_ANALOG", + .factor_mul = ADC_MAX_MVOLT, + .factor_div = ADC_READ_MAX + 1, + .shift = 0, + .channel = CHIP_ADC_CH13 }, + [ADC_TEMP_SENSOR_3] = { .name = "TEMP_SENSOR3", + .factor_mul = ADC_MAX_MVOLT, + .factor_div = ADC_READ_MAX + 1, + .shift = 0, + .channel = CHIP_ADC_CH15 }, + [ADC_TEMP_SENSOR_4] = { .name = "TEMP_SENSOR4", + .factor_mul = ADC_MAX_MVOLT, + .factor_div = ADC_READ_MAX + 1, + .shift = 0, + .channel = CHIP_ADC_CH16 }, }; BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT); @@ -255,19 +243,25 @@ const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_MAX_COUNT] = { }; /* USB Muxes */ -const struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = { +const struct usb_mux_chain usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = { { - .usb_port = 0, - .i2c_port = I2C_PORT_USB_C0, - .i2c_addr_flags = IT5205_I2C_ADDR1_FLAGS, - .driver = &it5205_usb_mux_driver, + .mux = + &(const struct usb_mux){ + .usb_port = 0, + .i2c_port = I2C_PORT_USB_C0, + .i2c_addr_flags = IT5205_I2C_ADDR1_FLAGS, + .driver = &it5205_usb_mux_driver, + }, }, { - .usb_port = 1, - .i2c_port = I2C_PORT_SUB_USB_C1, - .i2c_addr_flags = PS8XXX_I2C_ADDR1_FLAGS, - .driver = &tcpci_tcpm_usb_mux_driver, - .hpd_update = &ps8xxx_tcpc_update_hpd_status, + .mux = + &(const struct usb_mux){ + .usb_port = 1, + .i2c_port = I2C_PORT_SUB_USB_C1, + .i2c_addr_flags = PS8XXX_I2C_ADDR1_FLAGS, + .driver = &tcpci_tcpm_usb_mux_driver, + .hpd_update = &ps8xxx_tcpc_update_hpd_status, + }, }, }; @@ -280,17 +274,13 @@ static struct accelgyro_saved_data_t g_bma253_data; static struct lsm6dsm_data lsm6dsm_data = LSM6DSM_DATA; /* Matrix to rotate accelrator into standard reference frame */ -static const mat33_fp_t base_standard_ref = { - { FLOAT_TO_FP(1), 0, 0}, - { 0, FLOAT_TO_FP(-1), 0}, - { 0, 0, FLOAT_TO_FP(-1)} -}; +static const mat33_fp_t base_standard_ref = { { FLOAT_TO_FP(1), 0, 0 }, + { 0, FLOAT_TO_FP(-1), 0 }, + { 0, 0, FLOAT_TO_FP(-1) } }; -static const mat33_fp_t lid_standard_ref = { - { FLOAT_TO_FP(1), 0, 0}, - { 0, FLOAT_TO_FP(-1), 0}, - { 0, 0, FLOAT_TO_FP(-1)} -}; +static const mat33_fp_t lid_standard_ref = { { FLOAT_TO_FP(1), 0, 0 }, + { 0, FLOAT_TO_FP(-1), 0 }, + { 0, 0, FLOAT_TO_FP(-1) } }; /* Drivers */ struct motion_sensor_t motion_sensors[] = { @@ -496,8 +486,8 @@ __override void board_power_5v_enable(int enable) if (board_get_charger_chip_count() > 1) { if (sm5803_set_gpio0_level(1, !!enable)) - CPRINTUSB("Failed to %sable sub rails!", enable ? - "en" : "dis"); + CPRINTUSB("Failed to %sable sub rails!", + enable ? "en" : "dis"); } } @@ -505,11 +495,11 @@ __override uint8_t board_get_usb_pd_port_count(void) { enum fw_config_db db = get_cbi_fw_config_db(); - if (db == DB_1A_HDMI || db == DB_NONE || db == DB_LTE_HDMI - || db == DB_1A_HDMI_LTE) + if (db == DB_1A_HDMI || db == DB_NONE || db == DB_LTE_HDMI || + db == DB_1A_HDMI_LTE) return CONFIG_USB_PD_PORT_MAX_COUNT - 1; - else if (db == DB_1C || db == DB_1C_LTE || db == DB_1C_1A - || db == DB_1C_1A_LTE) + else if (db == DB_1C || db == DB_1C_LTE || db == DB_1C_1A || + db == DB_1C_1A_LTE) return CONFIG_USB_PD_PORT_MAX_COUNT; ccprints("Unhandled DB configuration: %d", db); @@ -520,11 +510,11 @@ __override uint8_t board_get_charger_chip_count(void) { enum fw_config_db db = get_cbi_fw_config_db(); - if (db == DB_1A_HDMI || db == DB_NONE || db == DB_LTE_HDMI - || db == DB_1A_HDMI_LTE) + if (db == DB_1A_HDMI || db == DB_NONE || db == DB_LTE_HDMI || + db == DB_1A_HDMI_LTE) return CHARGER_NUM - 1; - else if (db == DB_1C || db == DB_1C_LTE || db == DB_1C_1A - || db == DB_1C_1A_LTE) + else if (db == DB_1C || db == DB_1C_LTE || db == DB_1C_1A || + db == DB_1C_1A_LTE) return CHARGER_NUM; ccprints("Unhandled DB configuration: %d", db); @@ -629,33 +619,31 @@ __override void typec_set_source_current_limit(int port, enum tcpc_rp_value rp) } /* PWM channels. Must be in the exactly same order as in enum pwm_channel. */ -const struct pwm_t pwm_channels[] = { - [PWM_CH_KBLIGHT] = { - .channel = 0, - .flags = PWM_CONFIG_DSLEEP, - .freq_hz = 10000, - } -}; +const struct pwm_t pwm_channels[] = { [PWM_CH_KBLIGHT] = { + .channel = 0, + .flags = PWM_CONFIG_DSLEEP, + .freq_hz = 10000, + } }; BUILD_ASSERT(ARRAY_SIZE(pwm_channels) == PWM_CH_COUNT); /* Thermistors */ const struct temp_sensor_t temp_sensors[] = { - [TEMP_SENSOR_1] = {.name = "Memory", - .type = TEMP_SENSOR_TYPE_BOARD, - .read = get_temp_3v3_51k1_47k_4050b, - .idx = ADC_TEMP_SENSOR_1}, - [TEMP_SENSOR_2] = {.name = "Ambient", - .type = TEMP_SENSOR_TYPE_BOARD, - .read = get_temp_3v3_51k1_47k_4050b, - .idx = ADC_TEMP_SENSOR_2}, - [TEMP_SENSOR_3] = {.name = "Charger", - .type = TEMP_SENSOR_TYPE_BOARD, - .read = get_temp_3v3_51k1_47k_4050b, - .idx = ADC_TEMP_SENSOR_3}, - [TEMP_SENSOR_4] = {.name = "5V regular", - .type = TEMP_SENSOR_TYPE_BOARD, - .read = get_temp_3v3_51k1_47k_4050b, - .idx = ADC_TEMP_SENSOR_4}, + [TEMP_SENSOR_1] = { .name = "Memory", + .type = TEMP_SENSOR_TYPE_BOARD, + .read = get_temp_3v3_51k1_47k_4050b, + .idx = ADC_TEMP_SENSOR_1 }, + [TEMP_SENSOR_2] = { .name = "Ambient", + .type = TEMP_SENSOR_TYPE_BOARD, + .read = get_temp_3v3_51k1_47k_4050b, + .idx = ADC_TEMP_SENSOR_2 }, + [TEMP_SENSOR_3] = { .name = "Charger", + .type = TEMP_SENSOR_TYPE_BOARD, + .read = get_temp_3v3_51k1_47k_4050b, + .idx = ADC_TEMP_SENSOR_3 }, + [TEMP_SENSOR_4] = { .name = "5V regular", + .type = TEMP_SENSOR_TYPE_BOARD, + .read = get_temp_3v3_51k1_47k_4050b, + .idx = ADC_TEMP_SENSOR_4 }, }; BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT); @@ -685,9 +673,8 @@ __override void lid_angle_peripheral_enable(int enable) } } -__override void ocpc_get_pid_constants(int *kp, int *kp_div, - int *ki, int *ki_div, - int *kd, int *kd_div) +__override void ocpc_get_pid_constants(int *kp, int *kp_div, int *ki, + int *ki_div, int *kd, int *kd_div) { *kp = 3; *kp_div = 20; @@ -706,14 +693,17 @@ __override void ocpc_get_pid_constants(int *kp, int *kp_div, * The connector has 24 pins total, and there is no pin 0. */ const int keyboard_factory_scan_pins[][2] = { - {-1, -1}, {GPIO_KSO_H, 4}, {GPIO_KSO_H, 0}, {GPIO_KSO_H, 1}, - {GPIO_KSO_H, 3}, {GPIO_KSO_H, 2}, {GPIO_KSO_L, 5}, {GPIO_KSO_L, 6}, - {GPIO_KSO_L, 3}, {GPIO_KSO_L, 2}, {GPIO_KSI, 0}, {GPIO_KSO_L, 1}, - {GPIO_KSO_L, 4}, {GPIO_KSI, 3}, {GPIO_KSI, 2}, {GPIO_KSO_L, 0}, - {GPIO_KSI, 5}, {GPIO_KSI, 4}, {GPIO_KSO_L, 7}, {GPIO_KSI, 6}, - {GPIO_KSI, 7}, {GPIO_KSI, 1}, {-1, -1}, {-1, -1}, {-1, -1}, + { -1, -1 }, { GPIO_KSO_H, 4 }, { GPIO_KSO_H, 0 }, + { GPIO_KSO_H, 1 }, { GPIO_KSO_H, 3 }, { GPIO_KSO_H, 2 }, + { GPIO_KSO_L, 5 }, { GPIO_KSO_L, 6 }, { GPIO_KSO_L, 3 }, + { GPIO_KSO_L, 2 }, { GPIO_KSI, 0 }, { GPIO_KSO_L, 1 }, + { GPIO_KSO_L, 4 }, { GPIO_KSI, 3 }, { GPIO_KSI, 2 }, + { GPIO_KSO_L, 0 }, { GPIO_KSI, 5 }, { GPIO_KSI, 4 }, + { GPIO_KSO_L, 7 }, { GPIO_KSI, 6 }, { GPIO_KSI, 7 }, + { GPIO_KSI, 1 }, { -1, -1 }, { -1, -1 }, + { -1, -1 }, }; const int keyboard_factory_scan_pins_used = - ARRAY_SIZE(keyboard_factory_scan_pins); + ARRAY_SIZE(keyboard_factory_scan_pins); #endif diff --git a/board/drawcia_riscv/board.h b/board/drawcia_riscv/board.h index 45f16c9ac3..2867412cf8 100644 --- a/board/drawcia_riscv/board.h +++ b/board/drawcia_riscv/board.h @@ -1,4 +1,4 @@ -/* Copyright 2021 The Chromium OS Authors. All rights reserved. +/* Copyright 2021 The ChromiumOS Authors * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ @@ -37,20 +37,23 @@ /* Charger */ #define CONFIG_CHARGE_RAMP_HW -#define CONFIG_CHARGER_SM5803 /* C0 and C1: Charger */ +#define CONFIG_CHARGER_SM5803 /* C0 and C1: Charger */ +#define PD_MAX_VOLTAGE_MV 15000 #define CONFIG_USB_PD_VBUS_DETECT_CHARGER #define CONFIG_USB_PD_5V_CHARGER_CTRL #define CONFIG_CHARGER_OTG -#undef CONFIG_CHARGER_SINGLE_CHIP +#undef CONFIG_CHARGER_SINGLE_CHIP #define CONFIG_OCPC -#define CONFIG_OCPC_DEF_RBATT_MOHMS 21 /* R_DS(on) 10.7mOhm + 10mOhm sns rstr */ +#define CONFIG_OCPC_DEF_RBATT_MOHMS \ + 21 /* R_DS(on) 10.7mOhm + 10mOhm sns rstr \ + */ /* PWM */ #define CONFIG_PWM /* Sensors */ -#define CONFIG_ACCEL_BMA255 /* Lid accel */ -#define CONFIG_ACCELGYRO_LSM6DSM /* Base accel */ +#define CONFIG_ACCEL_BMA255 /* Lid accel */ +#define CONFIG_ACCELGYRO_LSM6DSM /* Base accel */ /* Sensors without hardware FIFO are in forced mode */ #define CONFIG_ACCEL_FORCE_MODE_MASK BIT(LID_ACCEL) @@ -83,8 +86,8 @@ /* TCPC */ #define CONFIG_USB_PD_PORT_MAX_COUNT 2 -#define CONFIG_USB_PD_TCPM_ITE_ON_CHIP /* C0: ITE EC TCPC */ -#define CONFIG_USB_PD_TCPM_PS8705 /* C1: PS8705 TCPC*/ +#define CONFIG_USB_PD_TCPM_ITE_ON_CHIP /* C0: ITE EC TCPC */ +#define CONFIG_USB_PD_TCPM_PS8705 /* C1: PS8705 TCPC*/ #define CONFIG_USB_PD_ITE_ACTIVE_PORT_COUNT 1 #define CONFIG_USB_PD_DUAL_ROLE_AUTO_TOGGLE #define CONFIG_USB_PD_TCPC_LOW_POWER @@ -95,13 +98,16 @@ #define CONFIG_STEINHART_HART_3V3_51K1_47K_4050B /* USB Mux and Retimer */ -#define CONFIG_USB_MUX_IT5205 /* C1: ITE Mux */ -#define I2C_PORT_USB_MUX I2C_PORT_USB_C0 /* Required for ITE Mux */ +#define CONFIG_USB_MUX_IT5205 /* C1: ITE Mux */ +#define I2C_PORT_USB_MUX I2C_PORT_USB_C0 /* Required for ITE Mux */ /* USB Type A Features */ #define USB_PORT_COUNT 1 #define CONFIG_USB_PORT_POWER_DUMB +/* Reduce flash image footprint */ +#undef CONFIG_CMD_ACCELS + #ifndef __ASSEMBLER__ #include "gpio_signal.h" @@ -119,21 +125,16 @@ enum pwm_channel { }; /* Motion sensors */ -enum sensor_id { - LID_ACCEL, - BASE_ACCEL, - BASE_GYRO, - SENSOR_COUNT -}; +enum sensor_id { LID_ACCEL, BASE_ACCEL, BASE_GYRO, SENSOR_COUNT }; /* ADC channels */ enum adc_channel { - ADC_VSNS_PP3300_A, /* ADC0 */ - ADC_TEMP_SENSOR_1, /* ADC2 */ - ADC_TEMP_SENSOR_2, /* ADC3 */ - ADC_SUB_ANALOG, /* ADC13 */ - ADC_TEMP_SENSOR_3, /* ADC15 */ - ADC_TEMP_SENSOR_4, /* ADC16 */ + ADC_VSNS_PP3300_A, /* ADC0 */ + ADC_TEMP_SENSOR_1, /* ADC2 */ + ADC_TEMP_SENSOR_2, /* ADC3 */ + ADC_SUB_ANALOG, /* ADC13 */ + ADC_TEMP_SENSOR_3, /* ADC15 */ + ADC_TEMP_SENSOR_4, /* ADC16 */ ADC_CH_COUNT }; diff --git a/board/drawcia_riscv/build.mk b/board/drawcia_riscv/build.mk index cf62dfc823..b63b7a58b9 100644 --- a/board/drawcia_riscv/build.mk +++ b/board/drawcia_riscv/build.mk @@ -1,5 +1,5 @@ # -*- makefile -*- -# Copyright 2021 The Chromium OS Authors. All rights reserved. +# Copyright 2021 The ChromiumOS Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # diff --git a/board/drawcia_riscv/cbi_ssfc.c b/board/drawcia_riscv/cbi_ssfc.c index c4b859f133..81f3ee0dad 100644 --- a/board/drawcia_riscv/cbi_ssfc.c +++ b/board/drawcia_riscv/cbi_ssfc.c @@ -1,4 +1,4 @@ -/* Copyright 2021 The Chromium OS Authors. All rights reserved. +/* Copyright 2021 The ChromiumOS Authors * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ @@ -27,10 +27,10 @@ DECLARE_HOOK(HOOK_INIT, cbi_ssfc_init, HOOK_PRIO_FIRST); enum ec_ssfc_base_sensor get_cbi_ssfc_base_sensor(void) { - return (enum ec_ssfc_base_sensor) cached_ssfc.base_sensor; + return (enum ec_ssfc_base_sensor)cached_ssfc.base_sensor; } enum ec_ssfc_lid_sensor get_cbi_ssfc_lid_sensor(void) { - return (enum ec_ssfc_lid_sensor) cached_ssfc.lid_sensor; + return (enum ec_ssfc_lid_sensor)cached_ssfc.lid_sensor; } diff --git a/board/drawcia_riscv/cbi_ssfc.h b/board/drawcia_riscv/cbi_ssfc.h index 935049b6ae..bf8853a43a 100644 --- a/board/drawcia_riscv/cbi_ssfc.h +++ b/board/drawcia_riscv/cbi_ssfc.h @@ -1,4 +1,4 @@ -/* Copyright 2021 The Chromium OS Authors. All rights reserved. +/* Copyright 2021 The ChromiumOS Authors * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ @@ -56,5 +56,4 @@ enum ec_ssfc_base_sensor get_cbi_ssfc_base_sensor(void); */ enum ec_ssfc_lid_sensor get_cbi_ssfc_lid_sensor(void); - #endif /* _DEDEDE_CBI_SSFC__H_ */ diff --git a/board/drawcia_riscv/ec.tasklist b/board/drawcia_riscv/ec.tasklist index 5c9a2d1a01..c13df44543 100644 --- a/board/drawcia_riscv/ec.tasklist +++ b/board/drawcia_riscv/ec.tasklist @@ -1,4 +1,4 @@ -/* Copyright 2021 The Chromium OS Authors. All rights reserved. +/* Copyright 2021 The ChromiumOS Authors * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ diff --git a/board/drawcia_riscv/gpio.inc b/board/drawcia_riscv/gpio.inc index cf0e3377cd..ad20442673 100644 --- a/board/drawcia_riscv/gpio.inc +++ b/board/drawcia_riscv/gpio.inc @@ -1,6 +1,6 @@ /* -*- mode:c -*- * - * Copyright 2021 The Chromium OS Authors. All rights reserved. + * Copyright 2021 The ChromiumOS Authors * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ diff --git a/board/drawcia_riscv/led.c b/board/drawcia_riscv/led.c index d13862cdcd..3cb7cb835e 100644 --- a/board/drawcia_riscv/led.c +++ b/board/drawcia_riscv/led.c @@ -1,4 +1,4 @@ -/* Copyright 2021 The Chromium OS Authors. All rights reserved. +/* Copyright 2021 The ChromiumOS Authors * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ @@ -18,10 +18,8 @@ #define POWER_LED_ON 0 #define POWER_LED_OFF 1 -const enum ec_led_id supported_led_ids[] = { - EC_LED_ID_BATTERY_LED, - EC_LED_ID_POWER_LED -}; +const enum ec_led_id supported_led_ids[] = { EC_LED_ID_BATTERY_LED, + EC_LED_ID_POWER_LED }; const int supported_led_ids_count = ARRAY_SIZE(supported_led_ids); @@ -29,7 +27,7 @@ enum led_color { LED_OFF = 0, LED_AMBER, LED_WHITE, - LED_COLOR_COUNT /* Number of colors, not a color itself */ + LED_COLOR_COUNT /* Number of colors, not a color itself */ }; static int led_set_color_battery(enum led_color color) @@ -116,7 +114,6 @@ static void led_set_battery(void) { static int battery_ticks; static int power_ticks; - uint32_t chflags = charge_get_flags(); battery_ticks++; @@ -127,9 +124,9 @@ static void led_set_battery(void) */ if (get_cbi_fw_config_tablet_mode() == TABLET_MODE_ABSENT) { if (chipset_in_state(CHIPSET_STATE_ANY_SUSPEND) && - charge_get_state() != PWR_STATE_CHARGE) { - led_set_color_battery(power_ticks++ & 0x2 ? - LED_WHITE : LED_OFF); + charge_get_state() != PWR_STATE_CHARGE) { + led_set_color_battery(power_ticks++ & 0x2 ? LED_WHITE : + LED_OFF); return; } } @@ -158,18 +155,18 @@ static void led_set_battery(void) led_set_color_battery(LED_OFF); break; case PWR_STATE_ERROR: - led_set_color_battery( - (battery_ticks % 0x2) ? LED_WHITE : LED_OFF); + led_set_color_battery((battery_ticks % 0x2) ? LED_WHITE : + LED_OFF); break; case PWR_STATE_CHARGE_NEAR_FULL: led_set_color_battery(LED_WHITE); break; case PWR_STATE_IDLE: /* External power connected in IDLE */ - if (chflags & CHARGE_FLAG_FORCE_IDLE) - led_set_color_battery( - (battery_ticks & 0x2) ? LED_AMBER : LED_OFF); - else - led_set_color_battery(LED_WHITE); + led_set_color_battery(LED_WHITE); + break; + case PWR_STATE_FORCED_IDLE: + led_set_color_battery((battery_ticks & 0x2) ? LED_AMBER : + LED_OFF); break; default: /* Other states don't alter LED behavior */ @@ -186,8 +183,7 @@ static void led_set_power(void) if (chipset_in_state(CHIPSET_STATE_ON)) led_set_color_power(LED_WHITE); else if (chipset_in_state(CHIPSET_STATE_ANY_SUSPEND)) - led_set_color_power( - (power_tick & 0x2) ? LED_WHITE : LED_OFF); + led_set_color_power((power_tick & 0x2) ? LED_WHITE : LED_OFF); else led_set_color_power(LED_OFF); } diff --git a/board/drawcia_riscv/usb_pd_policy.c b/board/drawcia_riscv/usb_pd_policy.c index 3ff7152541..8a2c07c575 100644 --- a/board/drawcia_riscv/usb_pd_policy.c +++ b/board/drawcia_riscv/usb_pd_policy.c @@ -1,4 +1,4 @@ -/* Copyright 2021 The Chromium OS Authors. All rights reserved. +/* Copyright 2021 The ChromiumOS Authors * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ @@ -13,8 +13,8 @@ #include "driver/tcpm/tcpci.h" #include "usb_pd.h" -#define CPRINTF(format, args...) cprintf(CC_USBPD, format, ## args) -#define CPRINTS(format, args...) cprints(CC_USBPD, format, ## args) +#define CPRINTF(format, args...) cprintf(CC_USBPD, format, ##args) +#define CPRINTS(format, args...) cprints(CC_USBPD, format, ##args) int pd_check_vconn_swap(int port) { @@ -65,18 +65,7 @@ int pd_set_power_supply_ready(int port) __override bool pd_check_vbus_level(int port, enum vbus_level level) { - int vbus_voltage; - - /* If we're unable to speak to the charger, best to guess false */ - if (charger_get_vbus_voltage(port, &vbus_voltage)) - return false; - - if (level == VBUS_SAFE0V) - return vbus_voltage < PD_V_SAFE0V_MAX; - else if (level == VBUS_PRESENT) - return vbus_voltage > PD_V_SAFE5V_MIN; - else - return vbus_voltage < PD_V_SINK_DISCONNECT_MAX; + return sm5803_check_vbus_level(port, level); } int pd_snk_is_vbus_provided(int port) |