summaryrefslogtreecommitdiff
path: root/board/dojo/board.h
blob: 734b73bac7dac08d7796f75e7019aa557bf9d7e3 (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
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
/* 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.
 */
/* Dojo board configuration */

#ifndef __CROS_EC_BOARD_H
#define __CROS_EC_BOARD_H

#include "baseboard.h"

/* Optional features */
#define CONFIG_LTO
#define CONFIG_PRESERVE_LOGS

/*
 * TODO: Remove this option once the VBAT no longer keeps high when
 * system's power isn't presented.
 */
#define CONFIG_IT83XX_RESET_PD_CONTRACT_IN_BRAM

/* Battery */
#undef CONFIG_BATTERY_PRESENT_GPIO
#define CONFIG_BATTERY_V2
#define CONFIG_BATTERY_COUNT 1
#define CONFIG_HOSTCMD_BATTERY_V2
#define CONFIG_BATTERY_PRESENT_CUSTOM
#define CONFIG_BATTERY_VENDOR_PARAM

/* BC12 */

/* Charger */
#define CONFIG_CHARGER_PROFILE_OVERRIDE

/* PD / USB-C / PPC */
#undef CONFIG_USB_PD_DEBUG_LEVEL /* default to 1, configurable in ec console */

/* Optional console commands */
#define CONFIG_CMD_FLASH
#define CONFIG_CMD_SCRATCHPAD
#define CONFIG_CMD_STACKOVERFLOW

#define CONFIG_BATT_FULL_CHIPSET_OFF_INPUT_LIMIT_MV	9000

/* Keyboard */
#define CONFIG_KEYBOARD_REFRESH_ROW3

/* Sensor */
#define CONFIG_GMR_TABLET_MODE
#define CONFIG_TABLET_MODE
#define CONFIG_TABLET_MODE_SWITCH
#define CONFIG_I2C_XFER_LARGE_TRANSFER

/* ICM426XX Base accel/gyro */
#define CONFIG_ACCELGYRO_ICM426XX
#define CONFIG_ACCELGYRO_ICM426XX_INT_EVENT \
	TASK_EVENT_MOTION_SENSOR_INTERRUPT(BASE_ACCEL)

/* BMI260 accel/gyro in base */
#define CONFIG_ACCELGYRO_BMI260
#define CONFIG_ACCELGYRO_BMI260_INT_EVENT \
	TASK_EVENT_MOTION_SENSOR_INTERRUPT(BASE_ACCEL)

/* KX022 Lid accel */
#define CONFIG_ACCEL_KX022

#define CONFIG_ACCEL_FORCE_MODE_MASK BIT(LID_ACCEL)

#define CONFIG_LID_ANGLE
#define CONFIG_LID_ANGLE_SENSOR_BASE BASE_ACCEL
#define CONFIG_LID_ANGLE_SENSOR_LID LID_ACCEL
#define CONFIG_LID_ANGLE_UPDATE

/* SPI / Host Command */
#undef CONFIG_HOSTCMD_DEBUG_MODE
#define CONFIG_HOSTCMD_DEBUG_MODE HCDEBUG_OFF

/* USB-A */
#define USBA_PORT_COUNT 1

/* Temperature */
#define CONFIG_TEMP_SENSOR
#define CONFIG_THERMISTOR
#define CONFIG_STEINHART_HART_3V3_30K9_47K_4050B

#ifndef __ASSEMBLER__

#include "gpio_signal.h"
#include "registers.h"

enum battery_type {
	BATTERY_DYNAPACK_COS,
	BATTERY_DYNAPACK_ATL,
	BATTERY_SIMPLO_COS,
	BATTERY_SIMPLO_HIGHPOWER,
	BATTERY_COS,
	BATTERY_TYPE_COUNT,
};

enum sensor_id {
	BASE_ACCEL = 0,
	BASE_GYRO,
	LID_ACCEL,
	SENSOR_COUNT,
};

enum pwm_channel {
	PWM_CH_LED_C1_WHITE,
	PWM_CH_LED_C1_AMBER,
	PWM_CH_LED_PWR,
	PWM_CH_KBLIGHT,
	PWM_CH_LED_C0_WHITE,
	PWM_CH_LED_C0_AMBER,
	PWM_CH_COUNT,
};

/* Temperature charging level */
enum temp_chg_lvl {
	LEVEL_0 = 0,
	LEVEL_1,
	LEVEL_2,
	CHG_LEVEL_COUNT,
};

/* Temperature charging struct */
struct temp_chg_struct {
	int lo_thre;
	int hi_thre;
	int chg_curr;
};

/* Forward declaration of temperature charging table */
extern const struct temp_chg_struct temp_chg_table[];

/* Vol-up key matrix struct */
struct vol_up_key {
	uint8_t row;
	uint8_t col;
};

int board_accel_force_mode_mask(void);
void motion_interrupt(enum gpio_signal signal);

#endif /* !__ASSEMBLER__ */
#endif /* __CROS_EC_BOARD_H */