Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d6e5f393 authored by Bhalchandra Gajare's avatar Bhalchandra Gajare Committed by Gerrit - the friendly Code Review server
Browse files

ASoC: wcd_cpe_services: Change boot event to include SFR details



In case of CPE crash, it is possible to retrieve the SFR (Software
Failure Reason) details from CPE. Add the support in the CPE boot event
to parse the SFR buffer address and size after CPE bootup is done. In
case of crash, the SFR data will be read from this address.

Change-Id: I8802e844f10d15fd14080cc7597ebfde0e5073d7
Signed-off-by: default avatarBhalchandra Gajare <gajare@codeaurora.org>
parent b6d89b7b
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2014, Linux Foundation. All rights reserved.
 * Copyright (c) 2014-2015, Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -38,6 +38,8 @@
#define CPE_BOOT_SUCCESS 0x00
#define CPE_BOOT_FAILED 0x01

#define CPE_CORE_VERSION_SYSTEM_BOOT_EVENT 0x01

/* LSM Service command opcodes */
#define CPE_LSM_SESSION_CMD_OPEN_TX		(0x2000)
#define CPE_LSM_SESSION_CMD_SET_PARAMS		(0x2001)
@@ -221,6 +223,9 @@ struct cmi_obm_msg {

struct cmi_core_svc_event_system_boot {
	u8 status;
	u8 version;
	u16 sfr_buff_size;
	u32 sfr_buff_address;
} __packed;

struct cmi_core_svc_cmd_shared_mem_alloc {
+16 −1
Original line number Diff line number Diff line
/* Copyright (c) 2014, The Linux Foundation. All rights reserved.
/* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -215,6 +215,7 @@ static struct cpe_info *cpe_default_handle;
static void (*cpe_irq_control_callback)(u32 enable);
static u32 cpe_msg_buffer;
static struct mutex cpe_api_mutex;
static struct cpe_svc_boot_event cpe_debug_vector;

static enum cpe_svc_result
cpe_is_command_valid(const struct cpe_info *t_info,
@@ -815,6 +816,20 @@ static bool cpe_mt_process_cmd(struct cpe_command_node *command_node)
			break;
		}

		/* boot was successful */
		if (ev_boot->version ==
		    CPE_CORE_VERSION_SYSTEM_BOOT_EVENT) {
			cpe_debug_vector.debug_address =
					ev_boot->sfr_buff_address;
			cpe_debug_vector.debug_buffer_size =
					ev_boot->sfr_buff_size;
			cpe_debug_vector.status = ev_boot->status;
			payload.event = CPE_SVC_BOOT;
			payload.result = CPE_SVC_SUCCESS;
			payload.payload = (void *)&cpe_debug_vector;
			cpe_broadcast_notification(t_info, &payload);
		}

		t_info->substate = CPE_SS_BOOT_INIT;
		cpe_send_msg_to_inbox(t_info, NULL);
		break;
+8 −1
Original line number Diff line number Diff line
/* Copyright (c) 2014, The Linux Foundation. All rights reserved.
/* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -40,6 +40,7 @@ enum cpe_svc_event {
	CPE_SVC_BOOT_FAILED		= 0x08,
	CPE_SVC_READ_COMPLETE		= 0x10,
	CPE_SVC_READ_ERROR		= 0x20,
	CPE_SVC_BOOT			= 0x40,
	CPE_SVC_CMI_CLIENTS_DEREG	= 0x100,
	CPE_SVC_EVENT_ANCHOR		= 0x7FFF
};
@@ -95,6 +96,12 @@ struct cpe_svc_read_complete {
	size_t   size;
};

struct cpe_svc_boot_event {
	u32 debug_address;
	size_t debug_buffer_size;
	u32 status;
};

struct cpe_svc_mem_segment {
	enum cpe_svc_mem_type type;
	u32 cpe_addr;