Пример #1
0
static u32 __secure_readl(u32 addr)
{
	u32 r;
	r = scm_call_atomic1(SCM_SVC_IO, SCM_IO_READ, addr);
	__iormb();
	return r;
}
Пример #2
0
/**
 * mc_read_response - reads the response for the last MC command from a
 * Management Complex (MC) portal
 *
 * @portal: pointer to an MC portal
 * @resp: pointer to command response buffer
 *
 * Returns MC_CMD_STATUS_OK on Success; Error code otherwise.
 */
static inline enum mc_cmd_status mc_read_response(struct mc_command __iomem *
						  portal,
						  struct mc_command *resp)
{
	int i;
	enum mc_cmd_status status;

	/* Copy command response header from MC portal: */
	__iormb();
	resp->header = __raw_readq(&portal->header);
	__iormb();
	status = mc_cmd_hdr_read_status(resp);
	if (status != MC_CMD_STATUS_OK)
		return status;

	/* Copy command response data from MC portal: */
	for (i = 0; i < MC_CMD_NUM_OF_PARAMS; i++)
		resp->params[i] = __raw_readq(&portal->params[i]);
	__iormb();

	return status;
}