1 /* SPDX-License-Identifier: GPL-2.0-only */ 1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 2 3 #ifndef __PSP_PLATFORM_ACCESS_H 3 #ifndef __PSP_PLATFORM_ACCESS_H 4 #define __PSP_PLATFORM_ACCESS_H 4 #define __PSP_PLATFORM_ACCESS_H 5 5 6 #include <linux/psp.h> 6 #include <linux/psp.h> 7 7 8 enum psp_platform_access_msg { 8 enum psp_platform_access_msg { 9 PSP_CMD_NONE = 0x0, !! 9 PSP_CMD_NONE = 0x0, 10 PSP_CMD_HSTI_QUERY = 0x14 !! 10 PSP_I2C_REQ_BUS_CMD = 0x64, 11 PSP_I2C_REQ_BUS_CMD = 0x64 << 12 PSP_DYNAMIC_BOOST_GET_NONCE, 11 PSP_DYNAMIC_BOOST_GET_NONCE, 13 PSP_DYNAMIC_BOOST_SET_UID, 12 PSP_DYNAMIC_BOOST_SET_UID, 14 PSP_DYNAMIC_BOOST_GET_PARAMETER, 13 PSP_DYNAMIC_BOOST_GET_PARAMETER, 15 PSP_DYNAMIC_BOOST_SET_PARAMETER, 14 PSP_DYNAMIC_BOOST_SET_PARAMETER, 16 }; 15 }; 17 16 18 struct psp_req_buffer_hdr { 17 struct psp_req_buffer_hdr { 19 u32 payload_size; 18 u32 payload_size; 20 u32 status; 19 u32 status; 21 } __packed; 20 } __packed; 22 21 23 struct psp_request { 22 struct psp_request { 24 struct psp_req_buffer_hdr header; 23 struct psp_req_buffer_hdr header; 25 void *buf; 24 void *buf; 26 } __packed; 25 } __packed; 27 26 28 /** 27 /** 29 * psp_send_platform_access_msg() - Send a mes 28 * psp_send_platform_access_msg() - Send a message to control platform features 30 * 29 * 31 * This function is intended to be used by dri 30 * This function is intended to be used by drivers outside of ccp to communicate 32 * with the platform. 31 * with the platform. 33 * 32 * 34 * Returns: 33 * Returns: 35 * 0: success 34 * 0: success 36 * -%EBUSY: mailbox in recovery or in use 35 * -%EBUSY: mailbox in recovery or in use 37 * -%ENODEV: driver not bound with PSP dev 36 * -%ENODEV: driver not bound with PSP device 38 * -%ETIMEDOUT: request timed out 37 * -%ETIMEDOUT: request timed out 39 * -%EIO: unknown error (see kernel log 38 * -%EIO: unknown error (see kernel log) 40 */ 39 */ 41 int psp_send_platform_access_msg(enum psp_plat 40 int psp_send_platform_access_msg(enum psp_platform_access_msg, struct psp_request *req); 42 41 43 /** 42 /** 44 * psp_ring_platform_doorbell() - Ring platfor 43 * psp_ring_platform_doorbell() - Ring platform doorbell 45 * 44 * 46 * This function is intended to be used by dri 45 * This function is intended to be used by drivers outside of ccp to ring the 47 * platform doorbell with a message. 46 * platform doorbell with a message. 48 * 47 * 49 * Returns: 48 * Returns: 50 * 0: success 49 * 0: success 51 * -%EBUSY: mailbox in recovery or in use 50 * -%EBUSY: mailbox in recovery or in use 52 * -%ENODEV: driver not bound with PSP dev 51 * -%ENODEV: driver not bound with PSP device 53 * -%ETIMEDOUT: request timed out 52 * -%ETIMEDOUT: request timed out 54 * -%EIO: error will be stored in resul 53 * -%EIO: error will be stored in result argument 55 */ 54 */ 56 int psp_ring_platform_doorbell(int msg, u32 *r 55 int psp_ring_platform_doorbell(int msg, u32 *result); 57 56 58 /** 57 /** 59 * psp_check_platform_access_status() - Checks 58 * psp_check_platform_access_status() - Checks whether platform features is ready 60 * 59 * 61 * This function is intended to be used by dri 60 * This function is intended to be used by drivers outside of ccp to determine 62 * if platform features has initialized. 61 * if platform features has initialized. 63 * 62 * 64 * Returns: 63 * Returns: 65 * 0 platform features is ready 64 * 0 platform features is ready 66 * -%ENODEV platform features is not ready o 65 * -%ENODEV platform features is not ready or present 67 */ 66 */ 68 int psp_check_platform_access_status(void); 67 int psp_check_platform_access_status(void); 69 68 70 #endif /* __PSP_PLATFORM_ACCESS_H */ 69 #endif /* __PSP_PLATFORM_ACCESS_H */ 71 70
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.