1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #ifndef __PSP_PLATFORM_ACCESS_H
4 #define __PSP_PLATFORM_ACCESS_H
8 enum psp_platform_access_msg {
10 PSP_I2C_REQ_BUS_CMD = 0x64,
11 PSP_DYNAMIC_BOOST_GET_NONCE,
12 PSP_DYNAMIC_BOOST_SET_UID,
15 struct psp_req_buffer_hdr {
21 struct psp_req_buffer_hdr header;
26 * psp_send_platform_access_msg() - Send a message to control platform features
28 * This function is intended to be used by drivers outside of ccp to communicate
33 * -%EBUSY: mailbox in recovery or in use
34 * -%ENODEV: driver not bound with PSP device
35 * -%ETIMEDOUT: request timed out
36 * -%EIO: unknown error (see kernel log)
38 int psp_send_platform_access_msg(enum psp_platform_access_msg, struct psp_request *req);
41 * psp_ring_platform_doorbell() - Ring platform doorbell
43 * This function is intended to be used by drivers outside of ccp to ring the
44 * platform doorbell with a message.
48 * -%EBUSY: mailbox in recovery or in use
49 * -%ENODEV: driver not bound with PSP device
50 * -%ETIMEDOUT: request timed out
51 * -%EIO: error will be stored in result argument
53 int psp_ring_platform_doorbell(int msg, u32 *result);
56 * psp_check_platform_access_status() - Checks whether platform features is ready
58 * This function is intended to be used by drivers outside of ccp to determine
59 * if platform features has initialized.
62 * 0 platform features is ready
63 * -%ENODEV platform features is not ready or present
65 int psp_check_platform_access_status(void);
67 #endif /* __PSP_PLATFORM_ACCESS_H */