From patchwork Mon May 16 10:47:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 572994 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8F1D4C433F5 for ; Mon, 16 May 2022 10:48:57 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 7AAC11683; Mon, 16 May 2022 12:48:05 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7AAC11683 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1652698135; bh=slIqjPWW+Rd6+alkrS9Z+VVatgFw4UUPxCLZE+uVPtU=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=a5iTa0KXUXNK4fcJ983nx9CKhLwHgid6/iedDwPubk/f6ai8CYpTU39L+bv0M6wTq 0F6eJ/bI3avHW7L99+wZ1tejzchoISS+wTzngmcEAW/wQ/TtbuymYGmw/e709VAqsA /OJTz+vO0Bog7QWFDZXpbvFwJ3BDNrnZwGycsUaA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 895F2F8051D; Mon, 16 May 2022 12:47:34 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7AC8EF802DF; Mon, 16 May 2022 12:47:30 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id D3CC9F8012F for ; Mon, 16 May 2022 12:47:21 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D3CC9F8012F Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="BZ//2KvU" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652698045; x=1684234045; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=slIqjPWW+Rd6+alkrS9Z+VVatgFw4UUPxCLZE+uVPtU=; b=BZ//2KvU7RMqHSkdWbEuFVITqCongPvlvacze4OUfoXgR5dXaTCGa2kW VhWbvGdUrDoIYpRmb3OFCVJXvZqJ56zQ9GnZ9KWVAsy2qSvIlUYqKgdDa ZMcvwcUHHayjJEN309hwQsF/JrlKffLkZIU8WbmZUmGFOg/31DM3UUwPL AE2uAdVqrIIwxa2+vFfMQU9TCWMAjmNh4Mx/XloaptPWHThABCJl3+c03 RD5xZKHmBT7QcqQGKGWliWxdaTLrP0BUaImi4LtQmS7U5aTK4PlkQS1Vh f4/GeuRKnD9yTSWBEnMaCuW/M/gfAsXPwAEZWnmQ59+NkGELK9U1itvLM g==; X-IronPort-AV: E=McAfee;i="6400,9594,10348"; a="333853234" X-IronPort-AV: E=Sophos;i="5.91,229,1647327600"; d="scan'208";a="333853234" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 May 2022 03:46:49 -0700 X-IronPort-AV: E=Sophos;i="5.91,229,1647327600"; d="scan'208";a="596459727" Received: from afialcko-mobl.ger.corp.intel.com (HELO pujfalus-desk.ger.corp.intel.com) ([10.252.51.55]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 May 2022 03:46:47 -0700 From: Peter Ujfalusi To: lgirdwood@gmail.com, broonie@kernel.org, pierre-louis.bossart@linux.intel.com, daniel.baluta@nxp.com, AjitKumar.Pandey@amd.com Subject: [PATCH 1/8] ASoC: SOF: Introduce IPC independent ops for firmware tracing support Date: Mon, 16 May 2022 13:47:04 +0300 Message-Id: <20220516104711.26115-2-peter.ujfalusi@linux.intel.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220516104711.26115-1-peter.ujfalusi@linux.intel.com> References: <20220516104711.26115-1-peter.ujfalusi@linux.intel.com> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org, ranjani.sridharan@linux.intel.com, kai.vehmanen@linux.intel.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The current (dma-)trace is only supported with IPC3, it is not available when IPC4 is used. Signed-off-by: Peter Ujfalusi Reviewed-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart --- sound/soc/sof/sof-priv.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sound/soc/sof/sof-priv.h b/sound/soc/sof/sof-priv.h index 8ea196305e4b..a7ffb6ecf332 100644 --- a/sound/soc/sof/sof-priv.h +++ b/sound/soc/sof/sof-priv.h @@ -357,6 +357,22 @@ struct snd_sof_ipc_msg { bool ipc_complete; }; +/** + * struct sof_ipc_fw_tracing_ops - IPC-specific firmware tracing ops + * @init: Function pointer for initialization of the tracing + * @free: Optional function pointer for freeing of the tracing + * @fw_crashed: Optional function pointer to notify the tracing of a firmware crash + * @suspend: Function pointer for system/runtime suspend + * @resume: Function pointer for system/runtime resume + */ +struct sof_ipc_fw_tracing_ops { + int (*init)(struct snd_sof_dev *sdev); + void (*free)(struct snd_sof_dev *sdev); + void (*fw_crashed)(struct snd_sof_dev *sdev); + void (*suspend)(struct snd_sof_dev *sdev, pm_message_t pm_state); + int (*resume)(struct snd_sof_dev *sdev); +}; + /** * struct sof_ipc_pm_ops - IPC-specific PM ops * @ctx_save: Function pointer for context save @@ -395,6 +411,7 @@ struct sof_ipc_pcm_ops; * @pm: Pointer to PM ops * @pcm: Pointer to PCM ops * @fw_loader: Pointer to Firmware Loader ops + * @fw_tracing: Pointer to Firmware tracing ops * * @tx_msg: Function pointer for sending a 'short' IPC message * @set_get_data: Function pointer for set/get data ('large' IPC message). This @@ -415,6 +432,7 @@ struct sof_ipc_ops { const struct sof_ipc_pm_ops *pm; const struct sof_ipc_pcm_ops *pcm; const struct sof_ipc_fw_loader_ops *fw_loader; + const struct sof_ipc_fw_tracing_ops *fw_tracing; int (*tx_msg)(struct snd_sof_dev *sdev, void *msg_data, size_t msg_bytes, void *reply_data, size_t reply_bytes, bool no_pm);