From patchwork Tue Oct 18 12:09:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 616482 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 A6FFDC4332F for ; Tue, 18 Oct 2022 12:11:50 +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 B9CBE9C64; Tue, 18 Oct 2022 14:10:58 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B9CBE9C64 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1666095108; bh=+VbW1XXRCFSOR+SHo27Ir/bLlx2ipKcCYnuw+5nVouI=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=OkF6OP2D30Xdk5cLLy/UM4cbLLXXArHyvvrdnuplptYdp6CeCRCSLGzco0bbKaU0K k6nBXO1QygihqUHoqGSkwp7lRsDhtuw+FrNVfXlVx8xZHe4dMA9SAD9N2MzIzmS0Nc XcNyQgSg3SF4hV3FWat4HbLA8XTfQ5ewttav2zKM= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 1BA64F8057F; Tue, 18 Oct 2022 14:09:34 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 923C2F8057E; Tue, 18 Oct 2022 14:09:31 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (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 0520BF80564 for ; Tue, 18 Oct 2022 14:09:24 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0520BF80564 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Au2pElVF" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666094966; x=1697630966; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+VbW1XXRCFSOR+SHo27Ir/bLlx2ipKcCYnuw+5nVouI=; b=Au2pElVFk19SdNo4aiCB5UnWclQtKXJlvwnkMPYrE2+9hJaWOM6FQy8t ZM60R3E9CP6jKeMCStoa+Z5iNQvHy2ywEkQIcuLK6t30WMc7HyO6Nq3mA mCoeHL1B48s7M0STzNoRHfo6Wf5n6fSv2YYsUTk7/Q0aGjX56uuqqZNUy 1yk2yn7PpURsy5OJc2zdie9evsCjtRPFLgF6KofrlqJLSkzczATEY52wU YM/j+e/pBA7tRCnplBX5h9lXAiAoW42UdK/bj3ObNqLdqp2Mwwx9URZW3 kz5bJc0/pKN9IrmlKH1ozsKY16t5Pzm7UK49/spaKpg9mTqpvDYOE89RR A==; X-IronPort-AV: E=McAfee;i="6500,9779,10503"; a="293452948" X-IronPort-AV: E=Sophos;i="5.95,193,1661842800"; d="scan'208";a="293452948" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2022 05:09:19 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10503"; a="579757918" X-IronPort-AV: E=Sophos;i="5.95,193,1661842800"; d="scan'208";a="579757918" Received: from mariaca1-mobl.ger.corp.intel.com (HELO pujfalus-desk.ger.corp.intel.com) ([10.252.27.127]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2022 05:09:14 -0700 From: Peter Ujfalusi To: lgirdwood@gmail.com, broonie@kernel.org Subject: [PATCH 08/19] ASoC: SOF: ipc4-loader: Save the maximum number of libraries supported Date: Tue, 18 Oct 2022 15:09:05 +0300 Message-Id: <20221018120916.19820-9-peter.ujfalusi@linux.intel.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221018120916.19820-1-peter.ujfalusi@linux.intel.com> References: <20221018120916.19820-1-peter.ujfalusi@linux.intel.com> MIME-Version: 1.0 Cc: chao.song@intel.com, alsa-devel@alsa-project.org, pierre-louis.bossart@linux.intel.com, kai.vehmanen@linux.intel.com, ranjani.sridharan@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 firmware supports external libraries (containing modules) to be loaded runtime. The firmware configuration contains the maximum number of libraries supported, including the base firmware (which is library 0). Signed-off-by: Peter Ujfalusi Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Reviewed-by: Chao Song Reviewed-by: Kai Vehmanen --- sound/soc/sof/ipc4-loader.c | 7 +++++++ sound/soc/sof/ipc4-priv.h | 3 +++ 2 files changed, 10 insertions(+) diff --git a/sound/soc/sof/ipc4-loader.c b/sound/soc/sof/ipc4-loader.c index 9f433e9b4cd3..2495a205ef78 100644 --- a/sound/soc/sof/ipc4-loader.c +++ b/sound/soc/sof/ipc4-loader.c @@ -202,6 +202,13 @@ static int sof_ipc4_query_fw_configuration(struct snd_sof_dev *sdev) trace_sof_ipc4_fw_config(sdev, "Trace log size", *tuple->value); ipc4_data->mtrace_log_bytes = *tuple->value; break; + case SOF_IPC4_FW_CFG_MAX_LIBS_COUNT: + trace_sof_ipc4_fw_config(sdev, "maximum number of libraries", + *tuple->value); + ipc4_data->max_libs_count = *tuple->value; + if (!ipc4_data->max_libs_count) + ipc4_data->max_libs_count = 1; + break; default: break; } diff --git a/sound/soc/sof/ipc4-priv.h b/sound/soc/sof/ipc4-priv.h index e3b8484a2f1f..7f5c7a47b3a7 100644 --- a/sound/soc/sof/ipc4-priv.h +++ b/sound/soc/sof/ipc4-priv.h @@ -32,6 +32,8 @@ enum sof_ipc4_mtrace_type { * @nhlt: NHLT table either from the BIOS or the topology manifest * @mtrace_type: mtrace type supported on the booted platform * @mtrace_log_bytes: log bytes as reported by the firmware via fw_config reply + * @max_libs_count: Maximum number of libraries support by the FW including the + * base firmware */ struct sof_ipc4_fw_data { u32 manifest_fw_hdr_offset; @@ -40,6 +42,7 @@ struct sof_ipc4_fw_data { void *nhlt; enum sof_ipc4_mtrace_type mtrace_type; u32 mtrace_log_bytes; + u32 max_libs_count; }; /**