Example #1
0
void op_display(enum op_severity sev, enum op_module mod, uint16_t code)
{
	uint32_t w0 = sev << 16 | mod;
	uint32_t w1;
	bool clean_lock;

	if (!fsp_present())
		return;

	w1 =  tohex((code >> 12) & 0xf) << 24;
	w1 |= tohex((code >>  8) & 0xf) << 16;
	w1 |= tohex((code >>  4) & 0xf) <<  8;
	w1 |= tohex((code      ) & 0xf);

	/*
	 * We use lock_recursive to detect recursion. We avoid sending
	 * the message if that happens as this could be a case of a
	 * locking error in the FSP driver for example
	 */
	clean_lock = lock_recursive(&op_lock);
	if (!clean_lock)
		return;

	/* We don't use mkmsg, we use a preallocated msg to avoid
	 * going down the malloc path etc... since this can be called
	 * in case of fatal errors
	 */
	fsp_fillmsg(&op_msg, FSP_CMD_DISP_SRC_DIRECT, 3, 1, w0, w1);
	fsp_sync_msg(&op_msg, false);
	unlock(&op_lock);
}
Example #2
0
void op_display(enum op_severity sev, enum op_module mod, uint16_t code)
{
	struct fsp_msg *op_msg;
	uint32_t w0;
	uint32_t w1;

	if (!fsp_present())
		return;

	w0 = sev << 16 | mod;

	w1 =  tohex((code >> 12) & 0xf) << 24;
	w1 |= tohex((code >>  8) & 0xf) << 16;
	w1 |= tohex((code >>  4) & 0xf) <<  8;
	w1 |= tohex((code      ) & 0xf);

	if (sev == OP_FATAL) {
		fsp_op_display_fatal(w0, w1);
	} else {
		op_msg = fsp_allocmsg(true);
		if (!op_msg) {
			prerror("Failed to allocate FSP message for PANEL\n");
			return;
		}

		fsp_fillmsg(op_msg, FSP_CMD_DISP_SRC_DIRECT, 3, 1, w0, w1);

		if(fsp_queue_msg(op_msg, fsp_freemsg))
			prerror("Failed to queue FSP message for OP PANEL\n");
	}
}
Example #3
0
void op_panel_clear_src(void)
{
	if (!fsp_present())
		return;

	lock(&op_lock);
	fsp_fillmsg(&op_msg, FSP_CMD_CLEAR_SRC, 0);
	fsp_sync_msg(&op_msg, false);
	unlock(&op_lock);
}
Example #4
0
void op_panel_disable_src_echo(void)
{
	if (!fsp_present())
		return;

	lock(&op_lock);
	fsp_fillmsg(&op_msg, FSP_CMD_DIS_SRC_ECHO, 0);
	fsp_sync_msg(&op_msg, false);
	unlock(&op_lock);
}
Example #5
0
static void fsp_op_display_fatal(uint32_t w0, uint32_t w1)
{
	static struct fsp_msg op_msg_resp;
	static struct fsp_msg op_msg = {
		.resp = &op_msg_resp,
	};

	fsp_fillmsg(&op_msg, FSP_CMD_DISP_SRC_DIRECT, 3, 1, w0, w1);

	fsp_sync_msg(&op_msg, false);
}
Example #6
0
void op_panel_clear_src(void)
{
	struct fsp_msg op_msg_resp;
	struct fsp_msg op_msg = {
		.resp = &op_msg_resp,
	};

	if (!fsp_present())
		return;

	fsp_fillmsg(&op_msg, FSP_CMD_CLEAR_SRC, 0);
	fsp_sync_msg(&op_msg, false);
}
Example #7
0
void op_panel_disable_src_echo(void)
{
	struct fsp_msg op_msg_resp;
	struct fsp_msg op_msg = {
		.resp = &op_msg_resp,
	};

	if (!fsp_present())
		return;

	fsp_fillmsg(&op_msg, FSP_CMD_DIS_SRC_ECHO, 0);
	fsp_sync_msg(&op_msg, false);
}