corsola: Initial zephyr config for chinchou
Initial EC Zephyr config for Corsola/chinchou.
Reuse most of Krabby sources.
Configure the battery/gpio/led in the later CLs.
BUG=b:306997368
TEST=zmake build chinchou
LOW_COVERAGE_REASON=Tests will be added in b:306997368
Change-Id: I3d6b6d1d8dd2b512f420f931aeed780d3507c635
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4929574
Code-Coverage: Knox Chiou <knoxchiou@chromium.org>
Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
Tested-by: Jiahong Wei <weijiahong@huaqin.corp-partner.google.com>
Reviewed-by: Siyu Qin <qinsiyu@huaqin.corp-partner.google.com>
Reviewed-by: Knox Chiou <knoxchiou@chromium.org>
Commit-Queue: Jiahong Wei <weijiahong@huaqin.corp-partner.google.com>
diff --git a/bazel/all_targets.generated.bzl b/bazel/all_targets.generated.bzl
index 67ae3e5..a6f1205 100644
--- a/bazel/all_targets.generated.bzl
+++ b/bazel/all_targets.generated.bzl
@@ -357,6 +357,10 @@
zephyr = False,
)
ec_target(
+ name = "chinchou",
+ board = "chinchou",
+ )
+ ec_target(
name = "chocodile_vpdmcu",
board = "chocodile_vpdmcu",
chip = "stm32",
diff --git a/zephyr/program/corsola/BUILD.py b/zephyr/program/corsola/BUILD.py
index 286e813..87b2bda 100644
--- a/zephyr/program/corsola/BUILD.py
+++ b/zephyr/program/corsola/BUILD.py
@@ -78,3 +78,5 @@
project_name="ponyta",
chip="npcx9m3f",
)
+
+register_corsola_project("chinchou")
diff --git a/zephyr/program/corsola/CMakeLists.txt b/zephyr/program/corsola/CMakeLists.txt
index 2b72e71..3b89204 100644
--- a/zephyr/program/corsola/CMakeLists.txt
+++ b/zephyr/program/corsola/CMakeLists.txt
@@ -44,4 +44,7 @@
elseif(DEFINED CONFIG_BOARD_PONYTA)
project(ponyta)
add_subdirectory(ponyta)
+elseif(DEFINED CONFIG_BOARD_CHINCHOU)
+ project(chinchou)
+ add_subdirectory(chinchou)
endif()
diff --git a/zephyr/program/corsola/Kconfig b/zephyr/program/corsola/Kconfig
index e3a00ec..f11e6bb 100644
--- a/zephyr/program/corsola/Kconfig
+++ b/zephyr/program/corsola/Kconfig
@@ -50,6 +50,12 @@
Build Google Ponyta variant board. Ponyta is a variant of Kingler
and has MediaTek MT8186 SoC with NPCX993FA0BX EC.
+config BOARD_CHINCHOU
+ bool "Google Chinchou Board"
+ help
+ Build Google Chinchou variant board. Chinchou is a variant of Krabby
+ and has MediaTek MT8186 SoC with ITE it81202-bx EC
+
config VARIANT_CORSOLA_DB_DETECTION
bool "Corsola Platform Runtime Daughter Board Detection"
depends on PLATFORM_EC_USB_PD_TCPC_RUNTIME_CONFIG
diff --git a/zephyr/program/corsola/chinchou/CMakeLists.txt b/zephyr/program/corsola/chinchou/CMakeLists.txt
new file mode 100644
index 0000000..5809cba
--- /dev/null
+++ b/zephyr/program/corsola/chinchou/CMakeLists.txt
@@ -0,0 +1,12 @@
+# Copyright 2023 The ChromiumOS Authors
+# Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+# Chinchou Makeifile
+
+zephyr_library_sources("../src/ite_hooks.c")
+zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_I2C "../src/ite_i2c.c")
+zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_USBC
+ "../src/ite_usb_pd_policy.c" "../src/ite_usbc.c")
+zephyr_library_sources("src/ppc.c")
+zephyr_library_sources("src/board.c")
diff --git a/zephyr/program/corsola/chinchou/project.conf b/zephyr/program/corsola/chinchou/project.conf
new file mode 100644
index 0000000..9a6f88b
--- /dev/null
+++ b/zephyr/program/corsola/chinchou/project.conf
@@ -0,0 +1,34 @@
+# Copyright 2023 The ChromiumOS Authors
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# Variant config
+CONFIG_BOARD_CHINCHOU=y
+
+# Motion sensor
+CONFIG_PLATFORM_EC_ACCEL_LIS2DW12=n
+CONFIG_PLATFORM_EC_ACCELGYRO_ICM42607=n
+CONFIG_PLATFORM_EC_ACCELGYRO_ICM_COMM_I2C=n
+CONFIG_PLATFORM_EC_ACCEL_BMA4XX=y
+CONFIG_PLATFORM_EC_ACCELGYRO_BMI3XX=y
+CONFIG_PLATFORM_EC_ACCELGYRO_BMI_COMM_I2C=y
+CONFIG_PLATFORM_EC_ACCEL_SPOOF_MODE=y
+CONFIG_PLATFORM_EC_DYNAMIC_MOTION_SENSOR_COUNT=y
+
+#BC1.2
+CONFIG_PLATFORM_EC_BC12_CLIENT_MODE_ONLY_PI3USB9201=n
+
+# USB-C
+CONFIG_PLATFORM_EC_USB_MUX_TUSB546=n
+
+# battery
+CONFIG_PLATFORM_EC_I2C_NACK_RETRY_COUNT=10
+CONFIG_PLATFORM_EC_SMBUS_PEC=y
+CONFIG_PLATFORM_EC_BATT_HOST_FULL_FACTOR=99
+CONFIG_PLATFORM_EC_SMART_BATTERY_OPTIONAL_MFG_FUNC=y
+
+# Keyboard
+CONFIG_PLATFORM_EC_KEYBOARD_KEYPAD=y
+CONFIG_PLATFORM_EC_KEYBOARD_REFRESH_ROW3=y
+CONFIG_PLATFORM_EC_KEYBOARD_PWRBTN_ASSERTS_KSI3=y
+CONFIG_PLATFORM_EC_KEYBOARD_STRICT_DEBOUNCE=y
diff --git a/zephyr/program/corsola/chinchou/project.overlay b/zephyr/program/corsola/chinchou/project.overlay
new file mode 100644
index 0000000..dd47eac
--- /dev/null
+++ b/zephyr/program/corsola/chinchou/project.overlay
@@ -0,0 +1,547 @@
+/* Copyright 2023 The ChromiumOS Authors
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+/* Corsola program common DTS includes */
+
+#include "../common.dtsi"
+#include "../power_signal.dtsi"
+#include "../usba.dtsi"
+#include "../ite_adc.dtsi"
+#include "../ite_gpio.dtsi"
+#include "../ite_keyboard.dtsi"
+#include "../ite_i2c.dtsi"
+#include "../ite_interrupts.dtsi"
+/*Chinchou and Kingler use the same motionsense */
+#include "../npcx_motionsense.dtsi"
+#include "../ite_usbc.dtsi"
+#include "../ite_shi.dtsi"
+
+#include <cros/thermistor/thermistor.dtsi>
+#include <dt-bindings/battery.h>
+
+/ {
+ aliases {
+ bma4xx-int = &lid_accel;
+ };
+
+ motionsense-sensor-info {
+ compatible = "cros-ec,motionsense-sensor-info";
+
+ /*
+ * list of GPIO interrupts that have to
+ * be enabled at initial stage
+ */
+ sensor-irqs = <&int_base_imu &int_lid_imu>;
+ };
+
+ batteries {
+ default_battery: c31n2005 {
+ compatible = "smp,c31n2005", "battery-smart";
+ };
+ };
+ /* Rotation matrix used by drivers. */
+ motionsense-rotation-ref {
+ compatible = "cros-ec,motionsense-rotation-ref";
+ lid_rot_ref: lid-rotation-ref {
+ mat33 = <0 (-1) 0
+ (-1) 0 0
+ 0 0 (-1)>;
+ };
+ base_rot_ref: base-rotation-ref {
+ mat33 = <0 1 0
+ 1 0 0
+ 0 0 (-1)>;
+ };
+ };
+
+ gpio-interrupts {
+ /delete-node/ x_ec_gpio2;
+ /delete-node/ usb_c1_bc12_charger;
+
+ int_base_imu: base_imu {
+ irq-pin = <&base_imu_int_l>;
+ flags = <GPIO_INT_EDGE_FALLING>;
+ handler = "bmi3xx_interrupt";
+ };
+ int_lid_imu: lid_imu {
+ irq-pin = <&lid_accel_int_l>;
+ flags = <GPIO_INT_EDGE_FALLING>;
+ handler = "bma4xx_interrupt";
+ };
+ int_x_ec_gpio2: x_ec_gpio2 {
+ irq-pin = <&gpio_x_ec_gpio2>;
+ flags = <GPIO_INT_EDGE_BOTH>;
+ handler = "hdmi_hpd_interrupt";
+ };
+ int_usb_c0_ppc_bc12: usb_c0_ppc_bc12 {
+ irq-pin = <&usb_c0_ppc_bc12_int_odl>;
+ flags = <GPIO_INT_EDGE_FALLING>;
+ handler = "c0_ppc_interrupt";
+ };
+ int_usb_c0_bc12_charger: usb_c0_bc12_charger {
+ irq-pin = <&usb_c0_bc12_charger_int_odl>;
+ flags = <GPIO_INT_EDGE_FALLING>;
+ handler = "rt9490_bc12_dt_interrupt";
+ };
+ };
+
+ named-gpios {
+ compatible = "named-gpios";
+ /delete-node/ entering_rw;
+ /delete-node/ usb_c0_ppc_frsinfo;
+ /delete-node/ usb_c1_bc12_charger_int_odl;
+
+ ec_en_pp3300_ucam: ec_en_pp3300_ucam{
+ gpios = <&gpioa 2 GPIO_OUTPUT_HIGH>;
+ };
+
+ ec_en_u2hub: ec_en_u2hub{
+ gpios = <&gpioa 3 GPIO_OUTPUT_HIGH>;
+ };
+
+ usb_a1_fault_odl: usb_a1_fault_odl {
+ gpios = <&gpioa 6 GPIO_INPUT>;
+ };
+
+ en_pp5000_usb_a1_vbus_x: en_pp5000_usb_a1_vbus_x{
+ gpios = <&gpioa 7 GPIO_OUTPUT_LOW>;
+ };
+ entering_rw: entering_rw {
+ enum-name = "GPIO_ENTERING_RW";
+ };
+ usb_c0_bc12_charger_int_odl: usb_c0_bc12_charger_int_odl {
+ gpios = <&gpioj 4 GPIO_INPUT>;
+ };
+ touchpad_en: touchpad_en {
+ gpios = <&gpioh 2 GPIO_OUTPUT_HIGH>;
+ };
+ usb_c0_frs_en: usb_c0_frs_en {
+ gpios = <&gpiof 0 GPIO_OUTPUT_LOW>;
+ enum-name = "GPIO_USB_C0_FRS_EN";
+ };
+ pg_pp4200_s5_od: pg-pp4200-s5-od {
+ gpios = <&gpioc 5 GPIO_INPUT>;
+ };
+ };
+
+ unused-pins {
+ compatible = "unused-gpios";
+
+ unused-gpios =
+ <&gpiod 7 GPIO_INPUT>,
+ <&gpioh 3 GPIO_ODR_HIGH>,
+ <&gpiod 2 GPIO_INPUT_PULL_DOWN>,
+ <&gpiof 1 GPIO_INPUT_PULL_DOWN>,
+ <&gpiog 2 GPIO_INPUT_PULL_DOWN>,
+ <&gpioh 0 GPIO_INPUT_PULL_DOWN>,
+ <&gpioh 1 GPIO_INPUT_PULL_DOWN>,
+ <&gpioh 6 GPIO_INPUT_PULL_DOWN>,
+ <&gpioi 1 GPIO_INPUT_PULL_DOWN>,
+ <&gpioi 2 GPIO_INPUT_PULL_DOWN>,
+ <&gpioi 3 GPIO_INPUT_PULL_DOWN>,
+ <&gpioi 5 GPIO_INPUT_PULL_DOWN>,
+ <&gpioi 6 GPIO_INPUT_PULL_DOWN>,
+ <&gpiom 6 (GPIO_INPUT_PULL_DOWN | GPIO_VOLTAGE_1P8)>;
+ };
+
+ named-adc-channels {
+ compatible = "named-adc-channels";
+
+ adc_temp_sensor_1: adc-temp-sensor-1 {
+ enum-name = "ADC_TEMP_SENSOR_1";
+ io-channels = <&adc0 7>;
+ };
+ };
+
+ temp_sensor_1_thermistor: sensor-1-thermistor {
+ compatible = "cros-ec,temp-sensor-thermistor";
+ thermistor = <&thermistor_1V8_100K_100K_4250B>;
+ adc = <&adc_temp_sensor_1>;
+ };
+
+ named-temp-sensors {
+ compatible = "cros-ec,temp-sensors";
+ temp_sensor_1 {
+ sensor = <&temp_sensor_1_thermistor>;
+ };
+ };
+
+ named-i2c-ports {
+ compatible = "named-i2c-ports";
+
+ /delete-node/ usb-c1;
+
+ i2c_hdmi: i2c_hdmi {
+ i2c-port = <&i2c4>;
+ enum-names = "I2C_PORT_USB_C1",
+ "I2C_PORT_USB_MUX1";
+ };
+ };
+
+ cros-keyscan {
+ compatible = "cros-ec,keyscan";
+
+ actual-key-mask = <
+ 0x1c /* C0 */
+ 0xff /* C1 */
+ 0xff /* C2 */
+ 0xff /* C3 */
+ 0xff /* C4 */
+ 0xff /* C5 */
+ 0xff /* C6 */
+ 0xa4 /* C7 */
+ 0xff /* C8 */
+ 0xff /* C9 */
+ 0x15 /* C10 */
+ 0xff /* C11 */
+ 0xca /* C12 */
+ 0xc4 /*C13 */
+ 0x0a /*C14 */
+ >;
+ };
+
+ Chinchou-fw-config {
+ compatible = "cros-ec,cbi-fw-config";
+
+ /*
+ * FW_CONFIG field to indicate the device is clamshell
+ * or convertible.
+ */
+ form_factor {
+ enum-name = "FORM_FACTOR";
+ start = <13>;
+ size = <3>;
+
+ convertible {
+ compatible = "cros-ec,cbi-fw-config-value";
+ enum-name = "CONVERTIBLE";
+ value = <1>;
+ };
+ clamshell {
+ compatible = "cros-ec,cbi-fw-config-value";
+ enum-name = "CLAMSHELL";
+ value = <0>;
+ };
+ };
+
+ /* FW_CONFIG field to indicate which DB is attached. */
+ db_config: db {
+ enum-name = "DB";
+ start = <0>;
+ size = <1>;
+
+ sub-board-1 {
+ compatible = "cros-ec,cbi-fw-config-value";
+ enum-name = "DB_NONE";
+ value = <0>;
+ };
+ sub-board-2 {
+ compatible = "cros-ec,cbi-fw-config-value";
+ enum-name = "DB_USBA_HDMI";
+ value = <1>;
+ };
+ };
+ };
+
+ led-colors {
+ compatible = "cros-ec,led-policy";
+
+ bat-power-state-charge-1 {
+ charge-state = "LED_PWRS_CHARGE";
+ /* Battery display percent range (>= 0, <= 97%) */
+ batt-lvl = <BATTERY_LEVEL_EMPTY 97>;
+
+ battery-led {
+ led-id = "EC_LED_ID_BATTERY_LED";
+
+ color-0 {
+ led-color = "LED_AMBER";
+ };
+ };
+ };
+
+ bat-power-state-charge-2 {
+ charge-state = "LED_PWRS_CHARGE";
+ /* Battery display percent range (>= 98, <= 99%) */
+ batt-lvl = <98 99>;
+
+ battery-led {
+ led-id = "EC_LED_ID_BATTERY_LED";
+
+ color-0 {
+ led-color = "LED_WHITE";
+ };
+ };
+ };
+
+ bat-power-state-near-full {
+ charge-state = "LED_PWRS_CHARGE_NEAR_FULL";
+
+ battery-led {
+ led-id = "EC_LED_ID_BATTERY_LED";
+
+ color-0 {
+ led-color = "LED_WHITE";
+ };
+ };
+ };
+
+ bat-power-state-discharge-s0 {
+ charge-state = "LED_PWRS_DISCHARGE";
+ chipset-state = "POWER_S0";
+
+ battery-led {
+ led-id = "EC_LED_ID_BATTERY_LED";
+
+ color-0 {
+ led-color = "LED_WHITE";
+ };
+ };
+ };
+
+ bat-power-state-discharge-s3 {
+ charge-state = "LED_PWRS_DISCHARGE";
+ chipset-state = "POWER_S3";
+
+ battery-led {
+ led-id = "EC_LED_ID_BATTERY_LED";
+
+ color-0 {
+ led-color = "LED_WHITE";
+ period-ms = <1000>;
+ };
+ color-1 {
+ led-color = "LED_OFF";
+ period-ms = <3000>;
+ };
+ };
+ };
+
+ bat-power-state-discharge-s5 {
+ charge-state = "LED_PWRS_DISCHARGE";
+ chipset-state = "POWER_S5";
+
+ battery-led {
+ led-id = "EC_LED_ID_BATTERY_LED";
+
+ color-0 {
+ led-color = "LED_OFF";
+ };
+ };
+ };
+
+ bat-power-state-discharge-s0-bat-low {
+ charge-state = "LED_PWRS_DISCHARGE";
+ chipset-state = "POWER_S0";
+ batt-lvl = <BATTERY_LEVEL_EMPTY 7>;
+
+ battery-led {
+ led-id = "EC_LED_ID_BATTERY_LED";
+
+ color-0 {
+ led-color = "LED_AMBER";
+ period-ms = <1000>;
+ };
+ color-1 {
+ led-color = "LED_OFF";
+ period-ms = <3000>;
+ };
+ };
+ };
+
+ bat-power-state-s0-error {
+ charge-state = "LED_PWRS_ERROR";
+ chipset-state = "POWER_S0";
+
+ battery-led {
+ led-id = "EC_LED_ID_BATTERY_LED";
+
+ color-0 {
+ led-color = "LED_AMBER";
+ period-ms = <1000>;
+ };
+ color-1 {
+ led-color = "LED_OFF";
+ period-ms = <1000>;
+ };
+ };
+ };
+
+ bat-power-state-s3-error {
+ charge-state = "LED_PWRS_ERROR";
+ chipset-state = "POWER_S3";
+
+ battery-led {
+ led-id = "EC_LED_ID_BATTERY_LED";
+
+ color-0 {
+ led-color = "LED_WHITE";
+ period-ms = <1000>;
+ };
+ color-1 {
+ led-color = "LED_OFF";
+ period-ms = <3000>;
+ };
+ };
+ };
+
+ bat-power-state-s5-error {
+ charge-state = "LED_PWRS_ERROR";
+ chipset-state = "POWER_S5";
+
+ battery-led {
+ led-id = "EC_LED_ID_BATTERY_LED";
+
+ color-0 {
+ led-color = "LED_OFF";
+ };
+ };
+ };
+
+ /* Chinchou LED power idle */
+ power-state-idle {
+ charge-state = "LED_PWRS_IDLE";
+
+ battery-led {
+ led-id = "EC_LED_ID_BATTERY_LED";
+
+ color-0 {
+ led-color = "LED_WHITE";
+ };
+ };
+ };
+
+ /* Chinchou LED power forced idle */
+ power-state-forced-idle {
+ charge-state = "LED_PWRS_FORCED_IDLE";
+
+ battery-led {
+ led-id = "EC_LED_ID_BATTERY_LED";
+
+ color-0 {
+ led-color = "LED_AMBER";
+ period-ms = <2000>;
+ };
+ color-1 {
+ led-color = "LED_WHITE";
+ period-ms = <2000>;
+ };
+ };
+ };
+ };
+
+ pwmleds {
+ compatible = "pwm-leds";
+
+ led_battery_white: ec_led1_odl {
+ pwms = <&pwm0 PWM_CHANNEL_0 PWM_HZ(324) PWM_POLARITY_INVERTED>;
+ };
+ led_battery_amber: ec_led2_odl {
+ pwms = <&pwm1 PWM_CHANNEL_1 PWM_HZ(324) PWM_POLARITY_INVERTED>;
+ };
+ };
+
+ pwm-led-pins {
+ compatible = "cros-ec,pwm-led-pins";
+
+ combo_led: combo-led {
+ led-id = "EC_LED_ID_BATTERY_LED";
+ led-pwms = <&led_battery_amber &led_battery_white>;
+
+ color-battery-off {
+ led-color = "LED_OFF";
+ led-values = <0 0>;
+ };
+
+ color-battery-amber {
+ led-color = "LED_AMBER";
+ led-values = <100 0>;
+ };
+
+ color-battery-white {
+ led-color = "LED_WHITE";
+ led-values = <0 100>;
+ };
+ };
+ };
+
+ usbc {
+ port0@0 {
+ bc12 = <&charger_bc12_port1>;
+ ppc = <&ppc_port0>;
+ };
+ port1@1 {
+ /delete-property/ bc12;
+ /delete-property/ ppc;
+ /delete-property/ tcpc;
+ /delete-property/ usb-mux-chain-1-hdmi-db;
+
+ usb-mux-chain-1 {
+ compatible = "cros-ec,usb-mux-chain";
+ usb-muxes = <&virtual_mux_1>;
+ };
+ };
+ };
+};
+
+/* LED1-WHITE */
+&pwm0 {
+ status = "okay";
+ prescaler-cx = <PWM_PRESCALER_C4>;
+ pinctrl-0 = <&pwm0_gpa0_default>;
+ pinctrl-names = "default";
+};
+
+/* LED2-Amber */
+&pwm1 {
+ status = "okay";
+ prescaler-cx = <PWM_PRESCALER_C4>;
+ pinctrl-0 = <&pwm1_gpa1_default>;
+ pinctrl-names = "default";
+};
+
+&i2c0 {
+ charger_bc12_port1: rt9490@53 {
+ compatible = "richtek,rt9490";
+ status = "okay";
+ reg = <0x53>;
+ irq = <&int_usb_c0_bc12_charger>;
+ mivr = <4000>;
+ };
+};
+
+&i2c2 {
+ /delete-node/ rt1739@70;
+ ppc_port0: syv682x@40 {
+ compatible = "silergy,syv682x";
+ status = "okay";
+ reg = <0x40>;
+ frs_en_gpio = <&usb_c0_frs_en>;
+ };
+};
+
+&i2c4 {
+ /delete-node/ syv682x@40;
+ /delete-node/ tusb1064-mux-1@44;
+};
+
+&adc0 {
+ status = "okay";
+ pinctrl-0 = <&adc0_ch0_gpi0_default
+ &adc0_ch1_gpi1_default
+ &adc0_ch2_gpi2_default
+ &adc0_ch7_gpi7_default>;
+ pinctrl-names = "default";
+};
+
+&thermistor_1V8_100K_100K_4250B{
+ status = "okay";
+};
+
+/* chinchou usba port enable config */
+&usba_port_enable_list {
+ enable-pins = <&en_pp5000_usb_a0_vbus
+ &en_pp5000_usb_a1_vbus_x>;
+};
diff --git a/zephyr/program/corsola/chinchou/src/board.c b/zephyr/program/corsola/chinchou/src/board.c
new file mode 100644
index 0000000..78edbee
--- /dev/null
+++ b/zephyr/program/corsola/chinchou/src/board.c
@@ -0,0 +1,48 @@
+/* Copyright 2023 The ChromiumOS Authors
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "common.h"
+#include "cros_cbi.h"
+#include "gpio.h"
+#include "gpio/gpio_int.h"
+#include "hooks.h"
+#include "motion_sense.h"
+#include "tablet_mode.h"
+
+#include <zephyr/drivers/gpio.h>
+#include <zephyr/logging/log.h>
+
+LOG_MODULE_REGISTER(board_init, LOG_LEVEL_ERR);
+
+static bool board_is_clamshell;
+
+static void board_setup_init(void)
+{
+ int ret;
+ uint32_t val;
+
+ ret = cros_cbi_get_fw_config(FORM_FACTOR, &val);
+ if (ret != 0) {
+ LOG_ERR("Error retrieving CBI FW_CONFIG field %d", FORM_FACTOR);
+ return;
+ }
+ if (val == CLAMSHELL) {
+ board_is_clamshell = true;
+ motion_sensor_count = 0;
+ gmr_tablet_switch_disable();
+ }
+}
+DECLARE_HOOK(HOOK_INIT, board_setup_init, HOOK_PRIO_PRE_DEFAULT);
+
+static void disable_base_imu_irq(void)
+{
+ if (board_is_clamshell) {
+ gpio_disable_dt_interrupt(
+ GPIO_INT_FROM_NODELABEL(int_base_imu));
+ gpio_pin_configure_dt(GPIO_DT_FROM_NODELABEL(base_imu_int_l),
+ GPIO_INPUT | GPIO_PULL_UP);
+ }
+}
+DECLARE_HOOK(HOOK_INIT, disable_base_imu_irq, HOOK_PRIO_POST_DEFAULT);
diff --git a/zephyr/program/corsola/chinchou/src/ppc.c b/zephyr/program/corsola/chinchou/src/ppc.c
new file mode 100644
index 0000000..b1d114e
--- /dev/null
+++ b/zephyr/program/corsola/chinchou/src/ppc.c
@@ -0,0 +1,22 @@
+/* Copyright 2023 The ChromiumOS Authors
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+/* Chinchou PPC-syv682x BC12-RT9490 configuration */
+
+#include "baseboard_usbc_config.h"
+#include "driver/charger/rt9490.h"
+#include "driver/ppc/syv682x.h"
+#include "gpio/gpio_int.h"
+#include "hooks.h"
+
+void c0_ppc_interrupt(enum gpio_signal signal)
+{
+ syv682x_interrupt(0);
+}
+static void board_usbc_init(void)
+{
+ gpio_enable_dt_interrupt(GPIO_INT_FROM_NODELABEL(int_usb_c0_ppc_bc12));
+}
+DECLARE_HOOK(HOOK_INIT, board_usbc_init, HOOK_PRIO_POST_DEFAULT);
diff --git a/zephyr/program/corsola/src/variant_db_detection.c b/zephyr/program/corsola/src/variant_db_detection.c
index 9ade144..7610e2e 100644
--- a/zephyr/program/corsola/src/variant_db_detection.c
+++ b/zephyr/program/corsola/src/variant_db_detection.c
@@ -90,6 +90,8 @@
CPRINTS("Error retrieving CBI FW_CONFIG field %d", DB);
} else if (val == DB_NONE) {
db = CORSOLA_DB_NONE;
+ } else if (val == DB_USBA_HDMI) {
+ db = CORSOLA_DB_HDMI;
}
#endif