From patchwork Thu Aug 22 19:03:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 11109817 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9D9EC1399 for ; Thu, 22 Aug 2019 19:06:44 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 323E423401 for ; Thu, 22 Aug 2019 19:06:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="MZhaRIfr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 323E423401 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org 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 4B9211676; Thu, 22 Aug 2019 21:05:51 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4B9211676 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1566500801; bh=lP9Jk1pxeI5vy75TfV9rvcz649TAwz+1ypttd0b5Lac=; h=From:To:Date:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=MZhaRIfrxXnW1j7gDtmicIrE5CBbTmbYubnVRuXiTea59WaymHXGCD8UHu2J8D0ZQ GOh6cu6YGCoPDuq+uvx6CitK2ImGNYSHBl2ARrMjCVvRLH9/Bj5/YacDaNtJexdfSX 2jKDRmIxe2Wg0+cl9kmT1XCwYbvUs7IWvYdNFukc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id AF39FF8036E; Thu, 22 Aug 2019 21:05:01 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id BA765F805A1; Thu, 22 Aug 2019 21:04:53 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS autolearn=disabled version=3.4.0 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 D4040F800BF for ; Thu, 22 Aug 2019 21:04:41 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D4040F800BF X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Aug 2019 12:04:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,417,1559545200"; d="scan'208";a="203524200" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga004.fm.intel.com with ESMTP; 22 Aug 2019 12:04:39 -0700 From: Cezary Rojewski To: alsa-devel@alsa-project.org Date: Thu, 22 Aug 2019 21:03:50 +0200 Message-Id: <20190822190425.23001-1-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Cc: lgirdwood@gmail.com, Cezary Rojewski , broonie@kernel.org, tiwai@suse.com, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH 00/35] ASoC: Intel: Clenaup SST initialization 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" This segment targets initialization procedures for all SST drivers. For legacy: - it concentrates on updating ACPI loader so generic DSP framework is not fed any platform specific data. sst-acpi module ceases to exist and is replaced by hsw-acpi and byt-acpi For cAVS (Skylake+): - Repairs what is currently an initialization mess, given the order of invocation of engaged handlers and sheer amount of them. - provides interface to offload hardware-specifics away from driver Following is the order of Skylake initialization currently: - skl_probe -> schedule skl_probe_work - skl_first_init - skl_create -> skl_init_dsp --> skl/ bxt/ cnl_sst_dsp_init ---> skl_sst_ctx_init ----> skl_dsp_ctx_init -----> sst_dsp_new ------> sst_ops::init (invoked but unimplemented!) Listing all the types engaged together with the naming chosen for the above paints an even darker picture. Code is unreadable and hides initialization for diffenret members is various handlers. Moreover, due to existing ill relationship between skl_dev, sst_dsp and sst_generic_ipc, one must be extra careful when accessing so called "dsp/ thread_context" as they all don't get initialized immediately before object is yield for further processing. However, 100/100 series is nonsense and thus cleanups have been divided into chunks and prioritized. Code seen here is part of new Skylake fundament, located at the very bottom of internal mainline. Said mainline is tested constantly on at least sigle platform from every cAVS bucket (description below). This week, BDW has been added to the CI family and was essential in validating legacy changes. Baytrail platform is still missing. Changes for BYT directly mirror HSW/ BDW but due to current lack of platform were untested. Boards engaged in testing: rt286, rt298, rt274. !!! IMPORTANT !!! Some upstream FW binaries are not compatible with existing /skylake driver while changes found here (HARDWARE_CONFIG/ FIRMWARE_CONFIG) make use of firmware ability to offload hardware-specifics away from driver. These and more are core part of any cAVS design and are to be implemented and used by host. This too is missing on Linux upstream. As explanined once, five main FW branches are available: - kbl, 1.5 cAVS (supports SKL, KBL, KBL-R, ABL, more..) - apl_auto, 1.5+ cAVS (supports APL, GLK) - cnl, 1.8 cAVS (supports CNL, CFL, WHL, CML) - icl, 2.0 cAVS (supports ICL, LKF) - master, 2.5 cAVS (supports TGL, EHL and everything above) SKL FW binary existing on upstream is a descendant of old spt branch, obsoleted for 4-5 years now. That FW is a stub, quickly replaced by kbl which is to be used on all 1.5 cAVS platforms. The same story goes with bxtn binary, a descendant of apl branch, replaced by apl_auto 2-3 years ago. All vendors, entire validation and development is located on apl_auto. Message: all FW binaries are to be updated as we cannot guarantee these are still functional. Given the fact that all vendors are fed with new binaries on regular basis from all main branches, it's highly probable some scenarios fail with existing FWs. In consequence, linux-firmware patch will be provided with fresh, updated binaries, soon. Once more, please note, we do not support, nor test platforms using obsolete FW binaries. That includes all platforms, not just SKL or APL. Amadeusz Sławiński (1): ASoC: Intel: Skylake: Put FW runtime params defs in one place Cezary Rojewski (34): ASoC: Intel: Skylake: Add FIRMWARE_CONFIG IPC request ASoC: Intel: Skylake: Add HARDWARE_CONFIG IPC request ASoC: Intel: Skylake: Unify firmware loading mechanism ASoC: Intel: Skylake: Reload libraries on D0 entry for CNL ASoC: Intel: Skylake: Unhardcode dsp cores number ASoC: Intel: Skylake: Update interrupt disabling routine ASoC: Intel: Skylake: Inline ipc free operations ASoC: Intel: Skylake: Unify driver cleanup mechanism ASoC: Intel: Relocate irq thread header to sst_ops ASoC: Intel: Merge sst_dsp_device into sst_pdata ASoC: Intel: Skylake: Reuse sst_dsp_free ASoC: Intel: Skylake: Reuse sst_dsp_new ASoC: Intel: Skylake: Remove skl_dsp_acquire_irq ASoC: Intel: Skylake: Use dsp loading functions directly ASoC: Intel: Skylake: Make dsp_ops::stream_tag obsolete ASoC: Intel: Skylake: Remove skl_dsp_loader_ops ASoC: Intel: Skylake: Remove window0 sst_addr fields ASoC: Intel: Skylake: Remove redundant W0 and W1 macros ASoC: Intel: Skylake: Remove redundant SRAM fields ASoC: Intel: Expose ACPI loading members ASoC: Intel: Haswell: Define separate ACPI loader ASoC: Intel: Baytrail: Define separate ACPI loader ASoC: Intel: Refactor probing of ACPI devices ASoC: Intel: Skylake: Simplify skl_sst_ctx_init declaration ASoC: Intel: Skylake: Simplify all sst_dsp_init declarations ASoC: Intel: Skylake: Define platform descriptors ASoC: Intel: Skylake: Update skl_ids table ASoC: Intel: Skylake: Flip SST initialization order ASoC: Intel: Reuse sst_pdata::fw_name field ASoC: Intel: Reuse sst_pdata::fw field ASoC: Intel: Skylake: Remove skl_dsp_ops ASoC: Intel: Skylake: Privatize SST init handlers ASoC: Intel: Skylake: Merge skl_sst_ctx_init into skl_init_dsp ASoC: Intel: Remove obsolete firmware fields sound/soc/intel/Kconfig | 14 +- sound/soc/intel/baytrail/Makefile | 2 + sound/soc/intel/baytrail/acpi.c | 64 +++++ sound/soc/intel/baytrail/sst-baytrail-dsp.c | 2 +- sound/soc/intel/baytrail/sst-baytrail-ipc.c | 13 +- sound/soc/intel/baytrail/sst-baytrail-ipc.h | 2 + sound/soc/intel/common/Makefile | 4 +- .../intel/common/soc-acpi-intel-bxt-match.c | 2 - .../intel/common/soc-acpi-intel-byt-match.c | 2 - .../intel/common/soc-acpi-intel-cnl-match.c | 1 - .../intel/common/soc-acpi-intel-glk-match.c | 3 - .../intel/common/soc-acpi-intel-hda-match.c | 2 - .../common/soc-acpi-intel-hsw-bdw-match.c | 4 - .../intel/common/soc-acpi-intel-icl-match.c | 1 - .../intel/common/soc-acpi-intel-kbl-match.c | 12 - .../intel/common/soc-acpi-intel-skl-match.c | 3 - sound/soc/intel/common/sst-acpi.c | 117 +-------- sound/soc/intel/common/sst-dsp-priv.h | 8 +- sound/soc/intel/common/sst-dsp.h | 37 +-- sound/soc/intel/common/sst-firmware.c | 13 +- sound/soc/intel/haswell/Makefile | 2 + sound/soc/intel/haswell/acpi.c | 78 ++++++ sound/soc/intel/haswell/sst-haswell-dsp.c | 1 + sound/soc/intel/haswell/sst-haswell-ipc.c | 13 +- sound/soc/intel/haswell/sst-haswell-ipc.h | 2 + sound/soc/intel/skylake/bxt-sst.c | 143 ++++------- sound/soc/intel/skylake/cnl-sst-dsp.c | 13 +- sound/soc/intel/skylake/cnl-sst-dsp.h | 15 +- sound/soc/intel/skylake/cnl-sst.c | 142 ++++------- sound/soc/intel/skylake/skl-debug.c | 2 +- sound/soc/intel/skylake/skl-messages.c | 194 ++------------ sound/soc/intel/skylake/skl-pcm.c | 22 +- sound/soc/intel/skylake/skl-sst-cldma.c | 10 +- sound/soc/intel/skylake/skl-sst-dsp.c | 79 ++---- sound/soc/intel/skylake/skl-sst-dsp.h | 55 ++-- sound/soc/intel/skylake/skl-sst-ipc.c | 238 ++++++++++++++++-- sound/soc/intel/skylake/skl-sst-ipc.h | 124 ++++++++- sound/soc/intel/skylake/skl-sst-utils.c | 28 +-- sound/soc/intel/skylake/skl-sst.c | 150 ++++++----- sound/soc/intel/skylake/skl.c | 65 +++-- sound/soc/intel/skylake/skl.h | 26 +- 41 files changed, 877 insertions(+), 831 deletions(-) create mode 100644 sound/soc/intel/baytrail/acpi.c create mode 100644 sound/soc/intel/haswell/acpi.c