Received: by 2002:ac8:156:0:b0:3e0:cd10:60c8 with SMTP id f22csp2352506qtg; Wed, 22 Mar 2023 22:32:46 -0700 (PDT) X-Google-Smtp-Source: AK7set99hqcGFdYyB8K1ZTeg2rWmgnvYF4wuwZSU5MJI8qT7H7nX1+RLB8CdEQghjXiJHVPpGYhi X-Received: by 2002:a62:5fc7:0:b0:625:d875:5987 with SMTP id t190-20020a625fc7000000b00625d8755987mr4816578pfb.6.1679549566670; Wed, 22 Mar 2023 22:32:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679549566; cv=none; d=google.com; s=arc-20160816; b=YE+Qvm1yv/ddPNEuMBrtoJlALUmDeWqJLf1QETggVWeNV7iQS9raD75tDM843Yf1sG tOWC2zCajHwBSngPN7yvKDpIvCZ5Iwg1t6PWD6ScxeF504Ywdkx2QlYs9tqo/gwQoaqN oqFSHtXPca14fn0L8NnLj8M3E//jC4hHuTx69qwpnBTDVhqfWljrTvfRxCMayh8M5ksu ifMUQWKIYqSLk1jGZT3GbMPiMn7yC3xeCMED1aYoU7zqkW6A4mO7flstYXO4xU3fdJqt Lo2JUDsfExilOSrciilfjeK9u7fVLVCRJanFkR8m+54AYpjjH9UeZGLderRj0j6Wc7JD SEvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BuN332LlWRILto+6ZVpa1k75y8CzVdjyqN06NA3VucU=; b=gElwrRNFfzf88OnH88pQUIyoEXiwcC0uwr19PqB1v1cY/U4drAC/VQ2jKg+4ZwhG30 q6ofpaH2JWWSPMT84PxJWYQbs5WdlYjKEOgVon97QZvuFbXcc2eox6Q9dVyyGeOQSZlT r0FwKWjnYRw07T+JoDQfywPzUO4Mt9FfA+OOKLxtbK9Y0pW1BqCcXpGysWoAAD5hNZLj UUM37Zm6LAnSmSIcwbmj8CcLp2oaOZNVHxiNpA/ZL+JxuXlb2EXdD9I0+pDx0cwAQ9ii Jq0dn1MFSrLM9OhPmnO9POYHYdsvhou9/NXw6wgRMXT7EA9KlZ9JwIwH9lADOHUuGpUq eGfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=TJH7MxmD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h187-20020a636cc4000000b0050bedf49bb6si17538469pgc.11.2023.03.22.22.32.33; Wed, 22 Mar 2023 22:32:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=TJH7MxmD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230363AbjCWFax (ORCPT + 99 others); Thu, 23 Mar 2023 01:30:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230282AbjCWFah (ORCPT ); Thu, 23 Mar 2023 01:30:37 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3116B222F8 for ; Wed, 22 Mar 2023 22:30:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679549419; x=1711085419; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=PSkxVbe47xbUsq7avOoYR8upNoWBv4uK3aM/asFJSEA=; b=TJH7MxmDgLy9N7rxTVfE6M+uszLK5LYTlsBPnH8sTYGXTJHPaXz2At8f yrUeijr4hBfnouts/YI3Po9w7sUW7ip/OrsdVLTEDbcU8q7YJSA4Rv+ow mL9ka/LNaMFFA8MJDA+bT+L0JWBJvx/JPuejJakfI9qTDfIbLm5ilhMR2 c0sFLz7kKjs9HCDyon+aP7+GtFOlwUnTzzhbJoqRca/G2phuQWW4ub2wx hh6iKH8617FX/HoC4MmV4MrW5FOxe2PX9XoHIx7R6HbcPB2lq9yqvDbpS 10L/mb4uZwoJ/xcU3yFLpoac0YOab0qBbMGewRoqzBB+UbnoOo/kGQv8k Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10657"; a="327779308" X-IronPort-AV: E=Sophos;i="5.98,283,1673942400"; d="scan'208";a="327779308" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Mar 2023 22:30:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10657"; a="675566998" X-IronPort-AV: E=Sophos;i="5.98,283,1673942400"; d="scan'208";a="675566998" Received: from bard-ubuntu.sh.intel.com ([10.239.185.57]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Mar 2023 22:29:58 -0700 From: Bard Liao To: alsa-devel@alsa-project.org, vkoul@kernel.org, broonie@kernel.org Cc: vinod.koul@linaro.org, linux-kernel@vger.kernel.org, pierre-louis.bossart@linux.intel.com, bard.liao@intel.com, tiwai@suse.de Subject: [PATCH 04/20] soundwire/ASOC: Intel: update offsets for LunarLake Date: Thu, 23 Mar 2023 13:44:36 +0800 Message-Id: <20230323054452.1543233-5-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230323054452.1543233-1-yung-chuan.liao@linux.intel.com> References: <20230323054452.1543233-1-yung-chuan.liao@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pierre-Louis Bossart The previous settings are not applicable, use a flag to determine what the register layout is. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Péter Ujfalusi Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao --- drivers/soundwire/intel.h | 2 ++ drivers/soundwire/intel_init.c | 14 ++++++++++---- include/linux/soundwire/sdw_intel.h | 2 ++ sound/soc/sof/intel/hda.c | 21 +++++++++++++++++---- 4 files changed, 31 insertions(+), 8 deletions(-) diff --git a/drivers/soundwire/intel.h b/drivers/soundwire/intel.h index 09d479f2c77b..51aa42a5a824 100644 --- a/drivers/soundwire/intel.h +++ b/drivers/soundwire/intel.h @@ -11,6 +11,7 @@ * @mmio_base: mmio base of SoundWire registers * @registers: Link IO registers base * @shim: Audio shim pointer + * @shim_vs: Audio vendor-specific shim pointer * @alh: ALH (Audio Link Hub) pointer * @irq: Interrupt line * @ops: Shim callback ops @@ -28,6 +29,7 @@ struct sdw_intel_link_res { void __iomem *mmio_base; /* not strictly needed, useful for debug */ void __iomem *registers; void __iomem *shim; + void __iomem *shim_vs; void __iomem *alh; int irq; const struct sdw_intel_ops *ops; diff --git a/drivers/soundwire/intel_init.c b/drivers/soundwire/intel_init.c index cbe56b993c6c..e0023af9e0e1 100644 --- a/drivers/soundwire/intel_init.c +++ b/drivers/soundwire/intel_init.c @@ -63,10 +63,16 @@ static struct sdw_intel_link_dev *intel_link_dev_register(struct sdw_intel_res * link = &ldev->link_res; link->hw_ops = res->hw_ops; link->mmio_base = res->mmio_base; - link->registers = res->mmio_base + SDW_LINK_BASE - + (SDW_LINK_SIZE * link_id); - link->shim = res->mmio_base + res->shim_base; - link->alh = res->mmio_base + res->alh_base; + if (!res->ext) { + link->registers = res->mmio_base + SDW_LINK_BASE + + (SDW_LINK_SIZE * link_id); + link->shim = res->mmio_base + res->shim_base; + link->alh = res->mmio_base + res->alh_base; + } else { + link->registers = res->mmio_base + SDW_IP_BASE(link_id); + link->shim = res->mmio_base + SDW_SHIM2_GENERIC_BASE(link_id); + link->shim_vs = res->mmio_base + SDW_SHIM2_VS_BASE(link_id); + } link->ops = res->ops; link->dev = res->dev; diff --git a/include/linux/soundwire/sdw_intel.h b/include/linux/soundwire/sdw_intel.h index 66687e83a94f..88eb5bf98140 100644 --- a/include/linux/soundwire/sdw_intel.h +++ b/include/linux/soundwire/sdw_intel.h @@ -323,6 +323,7 @@ struct sdw_intel_ctx { * DSP driver. The quirks are common for all links for now. * @shim_base: sdw shim base. * @alh_base: sdw alh base. + * @ext: extended HDaudio link support */ struct sdw_intel_res { const struct sdw_intel_hw_ops *hw_ops; @@ -337,6 +338,7 @@ struct sdw_intel_res { u32 clock_stop_quirks; u32 shim_base; u32 alh_base; + bool ext; }; /* diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c index 81c697e20108..db103524be4f 100644 --- a/sound/soc/sof/intel/hda.c +++ b/sound/soc/sof/intel/hda.c @@ -198,6 +198,7 @@ static int hda_sdw_acpi_scan(struct snd_sof_dev *sdev) static int hda_sdw_probe(struct snd_sof_dev *sdev) { + const struct sof_intel_dsp_desc *chip; struct sof_intel_hda_dev *hdev; struct sdw_intel_res res; void *sdw; @@ -206,10 +207,22 @@ static int hda_sdw_probe(struct snd_sof_dev *sdev) memset(&res, 0, sizeof(res)); - res.hw_ops = &sdw_intel_cnl_hw_ops; - res.mmio_base = sdev->bar[HDA_DSP_BAR]; - res.shim_base = hdev->desc->sdw_shim_base; - res.alh_base = hdev->desc->sdw_alh_base; + chip = get_chip_info(sdev->pdata); + if (chip->hw_ip_version < SOF_INTEL_ACE_2_0) { + res.mmio_base = sdev->bar[HDA_DSP_BAR]; + res.hw_ops = &sdw_intel_cnl_hw_ops; + res.shim_base = hdev->desc->sdw_shim_base; + res.alh_base = hdev->desc->sdw_alh_base; + res.ext = false; + } else { + res.mmio_base = sdev->bar[HDA_DSP_HDA_BAR]; + /* + * the SHIM and SoundWire register offsets are link-specific + * and will be determined when adding auxiliary devices + */ + res.hw_ops = &sdw_intel_lnl_hw_ops; + res.ext = true; + } res.irq = sdev->ipc_irq; res.handle = hdev->info.handle; res.parent = sdev->dev; -- 2.25.1