diff options
author | Siyu Qin <qinsiyu@huaqin.corp-partner.google.com> | 2021-08-16 10:43:46 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-08-19 18:01:30 +0000 |
commit | b6df95c03b050c464b66991c945071b28682083d (patch) | |
tree | 3c8a6722fc817558dcaa96dfdc556264f7364ce3 /board/wormdingler/board.h | |
parent | 7876375707a7bc59d298a88e1b0dac55610d6d1e (diff) | |
download | chrome-ec-b6df95c03b050c464b66991c945071b28682083d.tar.gz |
wormdingler: Initial EC image
Create the initial EC image for the wormdingler variant by copying the
homestar reference board EC files into a new directory named for
the variant.
BUG=b:196748140
BRANCH=trogdor
TEST=make BOARD=wormdingler
Verify build and powered on homestar board
Signed-off-by: Siyu Qin <qinsiyu@huaqin.corp-partner.google.com>
Change-Id: I3afdff08d1a7683cdc057dff87ee022dc6633266
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3096811
Reviewed-by: Bob Moragues <moragues@chromium.org>
Reviewed-by: Wai-Hong Tam <waihong@google.com>
Commit-Queue: Wai-Hong Tam <waihong@google.com>
Diffstat (limited to 'board/wormdingler/board.h')
-rw-r--r-- | board/wormdingler/board.h | 117 |
1 files changed, 117 insertions, 0 deletions
diff --git a/board/wormdingler/board.h b/board/wormdingler/board.h new file mode 100644 index 0000000000..aaa05a9b62 --- /dev/null +++ b/board/wormdingler/board.h @@ -0,0 +1,117 @@ +/* Copyright 2021 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* Wormdingler board configuration */ + +#ifndef __CROS_EC_BOARD_H +#define __CROS_EC_BOARD_H + +#include "baseboard.h" + +/* TODO(waihong): Remove the following bringup features */ +#define CONFIG_BRINGUP +#define CONFIG_SYSTEM_UNLOCKED /* Allow dangerous commands. */ +#define CONFIG_USB_PD_DEBUG_LEVEL 3 +#define CONFIG_CMD_GPIO_EXTENDED +#define CONFIG_CMD_POWERINDEBUG +#define CONFIG_I2C_DEBUG + +#define CONFIG_BUTTON_TRIGGERED_RECOVERY + +/* Internal SPI flash on NPCX7 */ +#define CONFIG_FLASH_SIZE_BYTES (512 * 1024) /* 512KB internal spi flash */ + +/* Switchcap */ +#define CONFIG_LN9310 + +/* Battery */ +#define CONFIG_BATTERY_DEVICE_CHEMISTRY "LION" +#define CONFIG_BATTERY_REVIVE_DISCONNECT +#define CONFIG_BATTERY_FUEL_GAUGE +#define CONFIG_BATTERY_VENDOR_PARAM + +/* Enable PD3.0 */ +#define CONFIG_USB_PD_REV30 + +/* BC 1.2 Charger */ +#define CONFIG_BC12_DETECT_PI3USB9201 + +/* USB */ +#define CONFIG_USB_PD_TCPM_MULTI_PS8XXX +#define CONFIG_USB_PD_TCPM_PS8755 +#define CONFIG_USB_PD_TCPM_PS8805 +#define CONFIG_USBC_PPC_SN5S330 +#define CONFIG_USB_PD_PORT_MAX_COUNT 2 + +/* Lid accel/gyro */ +#define CONFIG_ACCELGYRO_BMI160 +#define CONFIG_ACCEL_INTERRUPTS +#define CONFIG_ACCELGYRO_BMI160_INT_EVENT \ + TASK_EVENT_MOTION_SENSOR_INTERRUPT(LID_ACCEL) +#define OPT3001_I2C_ADDR_FLAGS OPT3001_I2C_ADDR1_FLAGS +#define CONFIG_ACCELGYRO_ICM42607 +#define CONFIG_ACCELGYRO_ICM42607_INT_EVENT \ + TASK_EVENT_MOTION_SENSOR_INTERRUPT(LID_ACCEL) + +#define CONFIG_TABLET_MODE +#define CONFIG_TABLET_MODE_SWITCH +#define CONFIG_FRONT_PROXIMITY_SWITCH + +#define CONFIG_DETACHABLE_BASE +#define CONFIG_BASE_ATTACHED_SWITCH + +/* GPIO alias */ +#define GPIO_AC_PRESENT GPIO_CHG_ACOK_OD +#define GPIO_WP_L GPIO_EC_FLASH_WP_ODL +#define GPIO_PMIC_RESIN_L GPIO_PM845_RESIN_L +#define GPIO_SWITCHCAP_PG_INT_L GPIO_LN9310_INT + +#define CONFIG_MKBP_INPUT_DEVICES + +#ifndef __ASSEMBLER__ + +#include "gpio_signal.h" +#include "registers.h" + +enum adc_channel { + ADC_VBUS, + ADC_AMON_BMON, + ADC_PSYS, + ADC_BASE_DET, + ADC_CH_COUNT +}; + +/* Motion sensors */ +enum sensor_id { + LID_ACCEL = 0, + LID_GYRO, + SENSOR_COUNT, +}; + +enum pwm_channel { + PWM_CH_DISPLIGHT = 0, + PWM_CH_COUNT +}; + +/* List of possible batteries */ +enum battery_type { + BATTERY_L19C2PD7, + BATTERY_TBD, + BATTERY_L21D4PG0, + BATTERY_L21M4PG0, + BATTERY_TYPE_COUNT, +}; + +/* Reset all TCPCs. */ +void board_reset_pd_mcu(void); +void board_set_tcpc_power_mode(int port, int mode); +/* Base detection */ +void base_detect_interrupt(enum gpio_signal signal); + +void motion_interrupt(enum gpio_signal signal); + +#endif /* !defined(__ASSEMBLER__) */ + +#endif /* __CROS_EC_BOARD_H */ |