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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
|
/* 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.
*/
/* Configuration for Willow */
#ifndef __CROS_EC_BOARD_H
#define __CROS_EC_BOARD_H
#define VARIANT_KUKUI_JACUZZI
#define VARIANT_KUKUI_BATTERY_SMART
#define VARIANT_KUKUI_CHARGER_ISL9238
#define VARIANT_KUKUI_EC_STM32F098
#ifndef SECTION_IS_RW
#define VARIANT_KUKUI_NO_SENSORS
#endif /* SECTION_IS_RW */
#include "baseboard.h"
#undef CONFIG_CHIPSET_POWER_SEQ_VERSION
#define CONFIG_CHIPSET_POWER_SEQ_VERSION 1
#undef CONFIG_SYSTEM_UNLOCKED
#define CONFIG_BATTERY_HW_PRESENT_CUSTOM
#define CONFIG_CHARGER_PSYS
#define CONFIG_CHARGER_RUNTIME_CONFIG
#define CONFIG_BC12_DETECT_PI3USB9201
#define CONFIG_EXTPOWER_GPIO
#undef CONFIG_EXTPOWER_DEBOUNCE_MS
#define CONFIG_EXTPOWER_DEBOUNCE_MS 200
#define CONFIG_I2C_BITBANG
#define I2C_BITBANG_PORT_COUNT 1
#undef CONFIG_I2C_NACK_RETRY_COUNT
#define CONFIG_I2C_NACK_RETRY_COUNT 10
#define CONFIG_SMBUS_PEC
#define CONFIG_USB_PD_TCPM_FUSB302
#define CONFIG_USB_PD_DISCHARGE_GPIO
#define CONFIG_USB_PD_TCPC_LOW_POWER
#define CONFIG_USB_MUX_IT5205
/* Motion Sensors */
#ifndef VARIANT_KUKUI_NO_SENSORS
#define CONFIG_ACCEL_KX022 /* Lid accel */
#define CONFIG_ACCELGYRO_BMI160 /* Base accel */
#define CONFIG_ACCEL_INTERRUPTS
#define CONFIG_ACCELGYRO_BMI160_INT_EVENT \
TASK_EVENT_MOTION_SENSOR_INTERRUPT(BASE_ACCEL)
#define CONFIG_ALS
#define CONFIG_CMD_ACCEL_INFO
#define CONFIG_LID_ANGLE
#define CONFIG_LID_ANGLE_UPDATE
#define CONFIG_LID_ANGLE_SENSOR_BASE BASE_ACCEL
#define CONFIG_LID_ANGLE_SENSOR_LID LID_ACCEL
#define CONFIG_ACCEL_FORCE_MODE_MASK BIT(LID_ACCEL)
#endif /* VARIANT_KUKUI_NO_SENSORS */
/* I2C ports */
#define I2C_PORT_BC12 0
#define I2C_PORT_TCPC0 0
#define I2C_PORT_USB_MUX 0
#define I2C_PORT_CHARGER board_get_charger_i2c()
#define I2C_PORT_SENSORS 1
#define IT8801_KEYBOARD_PWM_I2C_PORT 1
#define I2C_PORT_VIRTUAL_BATTERY I2C_PORT_BATTERY
#define I2C_PORT_BATTERY 2
/* IT8801 I2C address */
#define IT8801_KEYBOARD_PWM_I2C_ADDR_FLAGS IT8801_I2C_ADDR1
/* Enable Accel over SPI */
#define CONFIG_SPI_ACCEL_PORT 0 /* The first SPI controller port (SPI2) */
#define CONFIG_KEYBOARD_PROTOCOL_MKBP
#define CONFIG_MKBP_EVENT
#define CONFIG_MKBP_USE_GPIO
#define CONFIG_LED_ONOFF_STATES
#undef CONFIG_GMR_TABLET_MODE
#undef GMR_TABLET_MODE_GPIO_L
#undef CONFIG_TABLET_MODE
#undef CONFIG_TABLET_MODE_SWITCH
#ifndef __ASSEMBLER__
enum adc_channel {
/* Real ADC channels begin here */
ADC_BOARD_ID = 0,
ADC_EC_SKU_ID,
ADC_CH_COUNT
};
/* power signal definitions */
enum power_signal {
AP_IN_S3_L,
PMIC_PWR_GOOD,
/* Number of signals */
POWER_SIGNAL_COUNT,
};
/* Motion sensors */
enum sensor_id {
LID_ACCEL = 0,
BASE_ACCEL,
BASE_GYRO,
SENSOR_COUNT,
};
enum charge_port {
CHARGE_PORT_USB_C,
};
enum battery_type {
BATTERY_PANASONIC_AC15A3J,
BATTERY_PANASONIC_AC16L5J,
BATTERY_LGC_AC16L8J,
BATTERY_PANASONIC_AC16L5J_KT00205009,
BATTERY_LGC_AP18C8K,
BATTERY_MURATA_AP18C4K,
BATTERY_PANASONIC_AP19B5K_KT00305011,
BATTERY_LGC_AP19B8K,
BATTERY_TYPE_COUNT,
};
#include "gpio_signal.h"
#include "registers.h"
#ifdef SECTION_IS_RO
/* Interrupt handler for emmc task */
void emmc_cmd_interrupt(enum gpio_signal signal);
#endif
void bc12_interrupt(enum gpio_signal signal);
void board_reset_pd_mcu(void);
int board_get_version(void);
/* returns the i2c port number of charger/battery */
int board_get_charger_i2c(void);
int board_get_battery_i2c(void);
#endif /* !__ASSEMBLER__ */
#endif /* __CROS_EC_BOARD_H */
|