Debian Codegraph @

src/ec/lenovo/mec1653/debug.h

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 #ifndef EC_LENOVO_MEC1653_DEBUG_H
4 #define EC_LENOVO_MEC1653_DEBUG_H
5
6 // The following location (via either EC0 or EC1) can be used to interact with the debug interface
7 #define EC_DEBUG_CMD 0x3d
8
9 // RW unlock key index
10 #define DEBUG_RW_KEY_IDX 1
11
12 #define EC_SEND_TIMEOUT_US 20000 // 20ms
13 #define EC_RECV_TIMEOUT_US 320000 // 320ms
14
15 #define EC0_CMD 0x0066
16 #define EC0_DATA 0x0062
17 #define EC1_CMD 0x1604
18 #define EC1_DATA 0x1600
19 #define EC2_CMD 0x1634
20 #define EC2_DATA 0x1630
21 #define EC3_CMD 0x161c
22 #define EC3_DATA 0x1618
23
24
25 // Read loaded debug key mask
26 uint16_t debug_loaded_keys(void);
27
28 void debug_read_key(uint8_t i, uint8_t *key);
29
30 void debug_write_key(uint8_t i, const char *hex_key);
31
32 uint32_t debug_read_dword(uint32_t addr);
33
34 void debug_write_dword(uint32_t addr, uint32_t val);
35
36 #endif /* EC_LENOVO_MEC1653_DEBUG_H */