diff options
author | Wai-Hong Tam <waihong@google.com> | 2020-03-25 16:00:58 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-04-02 03:35:05 +0000 |
commit | 6c151316e396a78156371be972c4997bb1266524 (patch) | |
tree | 3cad9c2bebcdff8b0476a02c7bbdfe4a846209dd /board/lazor/board.h | |
parent | e1b0e96927b44a4816bab3d95114ef76bb864271 (diff) | |
download | chrome-ec-6c151316e396a78156371be972c4997bb1266524.tar.gz |
Lazor: Initial commit for Lazor board
Major changes:
* EC chip: NPCX796FC
* Flash size: 512KB
* TCPC chips: PS8751
* BC1.2 chips: PI3USB9201
* Update GPIOs
BRANCH=None
BUG=b:150793669
TEST=Built the Lazor image successfully.
Change-Id: I28b53b9aa7867153f86c947e3a441f3c5c081549
Signed-off-by: Wai-Hong Tam <waihong@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2123050
Reviewed-by: Alexandru M Stan <amstan@chromium.org>
Diffstat (limited to 'board/lazor/board.h')
-rw-r--r-- | board/lazor/board.h | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/board/lazor/board.h b/board/lazor/board.h new file mode 100644 index 0000000000..6b5a05cd1f --- /dev/null +++ b/board/lazor/board.h @@ -0,0 +1,79 @@ +/* Copyright 2020 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. + */ + +/* Lazor 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_AP_RESET_LOG +#define CONFIG_CMD_POWERINDEBUG +#define CONFIG_HOSTCMD_AP_RESET + +/* Internal SPI flash on NPCX7 */ +#define CONFIG_FLASH_SIZE (512 * 1024) /* 512KB internal spi flash */ + +/* BC 1.2 Charger */ +#define CONFIG_BC12_DETECT_PI3USB9201 + +/* USB */ +#define CONFIG_USB_PD_TCPM_PS8751 +#define CONFIG_USBC_PPC_SN5S330 +/* PS8751 can only run with PD 2.0 */ +#define CONFIG_USB_PD_REV20 + +/* USB-A */ +#define USB_PORT_COUNT 1 +#define CONFIG_USB_PORT_POWER_DUMB + +/* Sensors */ +#define CONFIG_ACCELGYRO_BMI160 +#define CONFIG_ACCEL_INTERRUPTS +#define CONFIG_ACCELGYRO_BMI160_INT_EVENT \ + TASK_EVENT_MOTION_SENSOR_INTERRUPT(BASE_ACCEL) +#define OPT3001_I2C_ADDR_FLAGS OPT3001_I2C_ADDR1_FLAGS + +#ifndef __ASSEMBLER__ + +#include "gpio_signal.h" +#include "registers.h" + +enum adc_channel { + ADC_VBUS, + ADC_AMON_BMON, + ADC_PSYS, + ADC_CH_COUNT +}; + +/* Motion sensors */ +enum sensor_id { + BASE_ACCEL = 0, + BASE_GYRO, + SENSOR_COUNT, +}; + +enum pwm_channel { + PWM_CH_KBLIGHT = 0, + PWM_CH_DISPLIGHT, + PWM_CH_COUNT +}; + +/* Custom function to indicate if sourcing VBUS */ +int board_is_sourcing_vbus(int port); +/* Enable VBUS sink for a given port */ +int board_vbus_sink_enable(int port, int enable); +/* Reset all TCPCs. */ +void board_reset_pd_mcu(void); +void board_set_tcpc_power_mode(int port, int mode); + +#endif /* !defined(__ASSEMBLER__) */ + +#endif /* __CROS_EC_BOARD_H */ |