blob: bad985824aea808b3021b8dde98f282229ca8a1e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
/* Copyright 2019 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.
*/
/* Trogdor board configuration */
#ifndef __CROS_EC_BOARD_H
#define __CROS_EC_BOARD_H
#include "baseboard.h"
/* Board revision */
#include "board_revs.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 (1024 * 1024) /* 1MB internal spi flash */
/* BC 1.2 Charger */
#if BOARD_REV >= TROGDOR_REV1
#define CONFIG_BC12_DETECT_PI3USB9201
#else
#define CONFIG_BC12_DETECT_PI3USB9281
#define CONFIG_BC12_DETECT_PI3USB9281_CHIP_COUNT 2
#endif /* BOARD_REV */
/* USB */
#define CONFIG_USB_PD_TCPM_PS8805
#define CONFIG_USBC_PPC_SN5S330
/* 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 */
|