0001
0002
0003
0004
0005
0006
0007
0008 #ifndef __CROS_EC_LPC_MEC_H
0009 #define __CROS_EC_LPC_MEC_H
0010
0011 enum cros_ec_lpc_mec_emi_access_mode {
0012
0013 ACCESS_TYPE_BYTE = 0x0,
0014
0015 ACCESS_TYPE_WORD = 0x1,
0016
0017 ACCESS_TYPE_LONG = 0x2,
0018
0019
0020
0021
0022 ACCESS_TYPE_LONG_AUTO_INCREMENT = 0x3,
0023 };
0024
0025 enum cros_ec_lpc_mec_io_type {
0026 MEC_IO_READ,
0027 MEC_IO_WRITE,
0028 };
0029
0030
0031 #define MEC_EMI_HOST_TO_EC(MEC_EMI_BASE) ((MEC_EMI_BASE) + 0)
0032 #define MEC_EMI_EC_TO_HOST(MEC_EMI_BASE) ((MEC_EMI_BASE) + 1)
0033 #define MEC_EMI_EC_ADDRESS_B0(MEC_EMI_BASE) ((MEC_EMI_BASE) + 2)
0034 #define MEC_EMI_EC_ADDRESS_B1(MEC_EMI_BASE) ((MEC_EMI_BASE) + 3)
0035 #define MEC_EMI_EC_DATA_B0(MEC_EMI_BASE) ((MEC_EMI_BASE) + 4)
0036 #define MEC_EMI_EC_DATA_B1(MEC_EMI_BASE) ((MEC_EMI_BASE) + 5)
0037 #define MEC_EMI_EC_DATA_B2(MEC_EMI_BASE) ((MEC_EMI_BASE) + 6)
0038 #define MEC_EMI_EC_DATA_B3(MEC_EMI_BASE) ((MEC_EMI_BASE) + 7)
0039
0040
0041
0042
0043
0044
0045
0046 void cros_ec_lpc_mec_init(unsigned int base, unsigned int end);
0047
0048
0049
0050
0051
0052
0053 void cros_ec_lpc_mec_destroy(void);
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064 int cros_ec_lpc_mec_in_range(unsigned int offset, unsigned int length);
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076 u8 cros_ec_lpc_io_bytes_mec(enum cros_ec_lpc_mec_io_type io_type,
0077 unsigned int offset, unsigned int length, u8 *buf);
0078
0079 #endif