1
2
3
4
5
6
7
8 #ifndef __CROS_EC_LPC_MEC_H
9 #define __CROS_EC_LPC_MEC_H
10
11 enum cros_ec_lpc_mec_emi_access_mode {
12
13 ACCESS_TYPE_BYTE = 0x0,
14
15 ACCESS_TYPE_WORD = 0x1,
16
17 ACCESS_TYPE_LONG = 0x2,
18
19
20
21
22 ACCESS_TYPE_LONG_AUTO_INCREMENT = 0x3,
23 };
24
25 enum cros_ec_lpc_mec_io_type {
26 MEC_IO_READ,
27 MEC_IO_WRITE,
28 };
29
30
31 #define MEC_EMI_HOST_TO_EC(MEC_EMI_BASE) ((MEC_EMI_BASE) + 0)
32 #define MEC_EMI_EC_TO_HOST(MEC_EMI_BASE) ((MEC_EMI_BASE) + 1)
33 #define MEC_EMI_EC_ADDRESS_B0(MEC_EMI_BASE) ((MEC_EMI_BASE) + 2)
34 #define MEC_EMI_EC_ADDRESS_B1(MEC_EMI_BASE) ((MEC_EMI_BASE) + 3)
35 #define MEC_EMI_EC_DATA_B0(MEC_EMI_BASE) ((MEC_EMI_BASE) + 4)
36 #define MEC_EMI_EC_DATA_B1(MEC_EMI_BASE) ((MEC_EMI_BASE) + 5)
37 #define MEC_EMI_EC_DATA_B2(MEC_EMI_BASE) ((MEC_EMI_BASE) + 6)
38 #define MEC_EMI_EC_DATA_B3(MEC_EMI_BASE) ((MEC_EMI_BASE) + 7)
39
40
41
42
43
44
45
46 void cros_ec_lpc_mec_init(unsigned int base, unsigned int end);
47
48
49
50
51
52
53 void cros_ec_lpc_mec_destroy(void);
54
55
56
57
58
59
60
61
62
63
64 int cros_ec_lpc_mec_in_range(unsigned int offset, unsigned int length);
65
66
67
68
69
70
71
72
73
74
75
76 u8 cros_ec_lpc_io_bytes_mec(enum cros_ec_lpc_mec_io_type io_type,
77 unsigned int offset, unsigned int length, u8 *buf);
78
79 #endif