From patchwork Fri Dec 20 17:05:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 182311 Delivered-To: patch@linaro.org Received: by 2002:a92:1f98:0:0:0:0:0 with SMTP id f24csp789316ilf; Fri, 20 Dec 2019 09:06:36 -0800 (PST) X-Google-Smtp-Source: APXvYqx92ee8wW1yKR+9aWDuCGC+6ovlDZauMgNHFgqrwejNnrqS9eMd9b18zRaoGOFgfPRps1xw X-Received: by 2002:a7b:c001:: with SMTP id c1mr17755851wmb.96.1576861596076; Fri, 20 Dec 2019 09:06:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576861596; cv=none; d=google.com; s=arc-20160816; b=SPrLNP/FU0dau9Jy2Tm6SoaD8xD1yFU2NC2cksLidWQTJl+dFzVKqvTlPmoeJtvG/z 7tvgS/qIBOdrZrZi0fUtqco8kmYsk0FJ7pPip78t6daGV4kAmM/P5G7g1s79e1jCQMps zmvaB8dYfZ7AgW9WXOjaCU+Ue28j5Ci61oJgEntPRqByANu4JvwCQGr4V8CGnskBMc+I dpULM4CD7ynB2BgYp2nXqr92xDjdxPXq+OUYBliE5UZR7J5Yq2iBriwiN2/P5APs2HDT UdkESVyHCdDtTk33Kul9Hky5Iv06R53jnE8Mn4T3uw215z8p6niSXLyYwFmzWK+zjX4I KLHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :cc:mime-version:message-id:date:to:from:dkim-filter:delivered-to :dkim-signature:dkim-filter; bh=xQYQ2HhkkeIw+yDKGR1uSAkRoiArCBdfJHSp91lqy70=; b=pqabxb0jLXygHXkyCmkhE8Hs2KJB9g7OBz2A7uLLyGaZ4idhdxifEBuKUreYcyQQ3T maQJeBTmaxVwvfv/jxx4Fl2b5zEE1kRpvZMVVM9tAXYWfFMBeN4cy3t5pf0A/zJKdUSi 3nTbn2JqbmZQXGUlRGxzmUJL0f/dxTQ7Hs88M4mJqFYlrPXF+pUm+kkVxcsJ18Is4RlQ NDYMimceXfDK8ifoiu+I40yGhP1WM/YxtSwLR/BMpdHv0aOSam9SjCyliqEFdh+dVXiJ gABm7TJud1b2G2Ac68/gT36qenUy4jZ+32EHrKSzYZuAxwydg7Th0qxVljTC2uU4lMEu bx8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alsa-project.org header.s=default header.b=Y5dk+9lT; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTPS id g14si9387211wrm.219.2019.12.20.09.06.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Dec 2019 09:06:36 -0800 (PST) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=pass header.i=@alsa-project.org header.s=default header.b=Y5dk+9lT; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 30FFB852; Fri, 20 Dec 2019 18:05:45 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 30FFB852 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1576861595; bh=5PMPmkp7hX6FOiebQwMZWgve8VlEcyRJK2E3l40obBo=; h=From:To:Date:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=Y5dk+9lTu3Vmg69Civc2iaZAvaN86yG4BGAf/43yt2wO3DwBJ98j69/d4mtbrxp4j 3DRr8x5k8D6MOz1u7gUzg5zqBlZMK2ZNQMP+sVXT3wktVPoT3DAcvu53bVqgJwRe8a uXLUj3oIt5DFmezT6csx9rgpEtc5O0254GCcq+tk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 80674F8014F; Fri, 20 Dec 2019 18:05:44 +0100 (CET) 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 3A0E5F8015A; Fri, 20 Dec 2019 18:05:42 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: * X-Spam-Status: No, score=1.0 required=5.0 tests=PRX_BODY_29,SPF_HELO_NONE, SPF_NONE, SURBL_BLOCKED, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) (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 00FD8F80059 for ; Fri, 20 Dec 2019 18:05:37 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 00FD8F80059 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Dec 2019 09:05:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,336,1571727600"; d="scan'208";a="213344434" Received: from landre-mobl.amr.corp.intel.com (HELO pbossart-mobl3.amr.corp.intel.com) ([10.251.133.224]) by fmsmga007.fm.intel.com with ESMTP; 20 Dec 2019 09:05:34 -0800 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Date: Fri, 20 Dec 2019 11:05:31 -0600 Message-Id: <20191220170531.10423-1-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Cc: tiwai@suse.de, broonie@kernel.org, Daniel Baluta , Pierre-Louis Bossart Subject: [alsa-devel] [PATCH] ASoC: SOF: imx8: Fix dsp_box offset 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" From: Daniel Baluta dsp_box is used to keep DSP initiated messages. The value of dsp_offset is set by the DSP with the first message, so we need a way to bootstrap it in order to get the first message. We do this by setting the correct default dsp_box offset which on i.MX8 is not zero. Very interesting is why it has worked until now. On i.MX8, DSP communicates with ARM core using a shared SDRAM memory area. Actually, there are two shared areas: * SDRAM0 - starting at 0x92400000, size 0x800000 * SDRAM1 - starting at 0x92C00000, size 0x800000 SDRAM0 keeps the data sections, starting with .rodata. By chance fw_ready structure was placed at the beginning of .rodata. dsp_box_base is defined as SDRAM0 + dsp_box_offset and it is placed at the beginning of SDRAM1 (dsp_box_offset should be 0x800000). But because it is zero initialized by default it points to SDRAM0 where by chance the fw_ready was placed in the SOF firmware. Anyhow, SOF commit 7466bee378dd811b ("clk: make freq arrays constant") fw_ready is no longer at the beginning of SDRAM0 and everything shows how lucky we were until now. Fix this by properly setting the default dsp_box offset. Fixes: 202acc565a1f050 ("ASoC: SOF: imx: Add i.MX8 HW support") Signed-off-by: Daniel Baluta Signed-off-by: Pierre-Louis Bossart --- sound/soc/sof/imx/imx8.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.20.1 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org https://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/sof/imx/imx8.c b/sound/soc/sof/imx/imx8.c index cfefcfd92798..dca85cf07ffa 100644 --- a/sound/soc/sof/imx/imx8.c +++ b/sound/soc/sof/imx/imx8.c @@ -304,6 +304,9 @@ static int imx8_probe(struct snd_sof_dev *sdev) } sdev->mailbox_bar = SOF_FW_BLK_TYPE_SRAM; + /* set default mailbox offset for FW ready message */ + sdev->dsp_box.offset = MBOX_OFFSET; + return 0; exit_pdev_unregister: