1 #ifndef _ASM_X86_INTEL_SCU_IPC_H_ 2 #define _ASM_X86_INTEL_SCU_IPC_H_ 3 4 #include <linux/notifier.h> 5 6 #define IPCMSG_INDIRECT_READ 0x02 7 #define IPCMSG_INDIRECT_WRITE 0x05 8 9 #define IPCMSG_COLD_OFF 0x80 /* Only for Tangier */ 10 11 #define IPCMSG_WARM_RESET 0xF0 12 #define IPCMSG_COLD_RESET 0xF1 13 #define IPCMSG_SOFT_RESET 0xF2 14 #define IPCMSG_COLD_BOOT 0xF3 15 16 #define IPCMSG_VRTC 0xFA /* Set vRTC device */ 17 /* Command id associated with message IPCMSG_VRTC */ 18 #define IPC_CMD_VRTC_SETTIME 1 /* Set time */ 19 #define IPC_CMD_VRTC_SETALARM 2 /* Set alarm */ 20 21 /* Read single register */ 22 int intel_scu_ipc_ioread8(u16 addr, u8 *data); 23 24 /* Read two sequential registers */ 25 int intel_scu_ipc_ioread16(u16 addr, u16 *data); 26 27 /* Read four sequential registers */ 28 int intel_scu_ipc_ioread32(u16 addr, u32 *data); 29 30 /* Read a vector */ 31 int intel_scu_ipc_readv(u16 *addr, u8 *data, int len); 32 33 /* Write single register */ 34 int intel_scu_ipc_iowrite8(u16 addr, u8 data); 35 36 /* Write two sequential registers */ 37 int intel_scu_ipc_iowrite16(u16 addr, u16 data); 38 39 /* Write four sequential registers */ 40 int intel_scu_ipc_iowrite32(u16 addr, u32 data); 41 42 /* Write a vector */ 43 int intel_scu_ipc_writev(u16 *addr, u8 *data, int len); 44 45 /* Update single register based on the mask */ 46 int intel_scu_ipc_update_register(u16 addr, u8 data, u8 mask); 47 48 /* Issue commands to the SCU with or without data */ 49 int intel_scu_ipc_simple_command(int cmd, int sub); 50 int intel_scu_ipc_command(int cmd, int sub, u32 *in, int inlen, 51 u32 *out, int outlen); 52 int intel_scu_ipc_raw_command(int cmd, int sub, u8 *in, int inlen, 53 u32 *out, int outlen, u32 dptr, u32 sptr); 54 55 /* I2C control api */ 56 int intel_scu_ipc_i2c_cntrl(u32 addr, u32 *data); 57 58 /* Update FW version */ 59 int intel_scu_ipc_fw_update(u8 *buffer, u32 length); 60 61 extern struct blocking_notifier_head intel_scu_notifier; 62 63 static inline void intel_scu_notifier_add(struct notifier_block *nb) 64 { 65 blocking_notifier_chain_register(&intel_scu_notifier, nb); 66 } 67 68 static inline void intel_scu_notifier_remove(struct notifier_block *nb) 69 { 70 blocking_notifier_chain_unregister(&intel_scu_notifier, nb); 71 } 72 73 static inline int intel_scu_notifier_post(unsigned long v, void *p) 74 { 75 return blocking_notifier_call_chain(&intel_scu_notifier, v, p); 76 } 77 78 #define SCU_AVAILABLE 1 79 #define SCU_DOWN 2 80 81 #endif 82