Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8605999ybl; Thu, 16 Jan 2020 20:45:52 -0800 (PST) X-Google-Smtp-Source: APXvYqxow99hjNcUltrjR0BmdxaEtG+tYatNDIhiREyPe6acG3EcjU3OfvLZb0v/nKkuiwci/LVt X-Received: by 2002:a05:6808:618:: with SMTP id y24mr2016048oih.86.1579236352306; Thu, 16 Jan 2020 20:45:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579236352; cv=none; d=google.com; s=arc-20160816; b=BdRI5506uVCSWz98LPi73CulSoE5tstk+aDhOhJ0pgpcoRf2yy15j3Jj4Xs7FYImRM KLOh0f7xZqgwS5vYrjBGUooeucXvHlr3OFNduy3ef164KeH6gQC59qCEmq5xz+WIHekW hHMbC7uQXr/y/rDXlBVGOeFXYX58DZvff7RBtrxu7OaV6ilK+/4HrRa6NbWuaW8/ZzvQ cSKVA/w11Laxj8QumkdQFh+4o9Iq3twp67PLufhl7VYnYvbd7CsdtmIJbUNmB6Ip+ib1 FKxuGtZR6VUyEEOK1KnXMkls3/DaqGAyN2sGhq4wSzPmxjp7UV+Nc1NetNRTO9yCf+BT l8+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=jDdO9rnlKgnSBJEkKEY1RSy9A0I9/wu7je+yiPBEiss=; b=duR8v9ubRvC1WpbKaJ85aXx7N1Wwf7fm3S+1fm788L9+3zPbu4LNCuBp7fJZSImFVL WrEdF8r/X7FBAEZX4dnlLz0eyMR3XNx3FRH4KYO7GDnnvk/KXnwFIie79hXeFTLjiDs4 rcVJo1MI7BHc4U9p/Fb+hehMpMNGn9pK0g+0GAjMK3ePAYhMcudcZvMNGIMSVtTu95EG c9kOEPPCdBYALYmxz0fcFr6oE0mPBPHPpmExmgGau10hBwXrfmDaq5xBUJIXNWDoH/Wu StyaNecKCzDQ6O2ABgfecxTMXuv1w0fk1kp1wkKpSQKCPJ0wHA0KahVG7U2As8g6vKer GNLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vQfhrPMo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q2si14751203otn.220.2020.01.16.20.45.41; Thu, 16 Jan 2020 20:45:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vQfhrPMo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387953AbgAPXsC (ORCPT + 99 others); Thu, 16 Jan 2020 18:48:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:46856 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389714AbgAPXUW (ORCPT ); Thu, 16 Jan 2020 18:20:22 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2E56A2072B; Thu, 16 Jan 2020 23:20:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579216821; bh=Wm62BUT+vMuMnI0P9WkNov+yr3SAdiRPTc7piLuoO0I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vQfhrPMo1DQ5a5hUITmRESMB6VlSy1lQ6yU3GHTTsXdSVY6B4uJRH/ZTxZ2Gw5tvx y+bLRCi0aANeT4QU9JkuGRW5RL1h/sf8nFcgKM8zNVgH+1jyVLZWymhpJHMiDPfuk9 gvjQt0E4fzABiuLvpJwv4SpV3xScjUQ7Xh6yPtR8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel Baluta , Pierre-Louis Bossart , Mark Brown Subject: [PATCH 5.4 016/203] ASoC: SOF: imx8: Fix dsp_box offset Date: Fri, 17 Jan 2020 00:15:33 +0100 Message-Id: <20200116231746.164130836@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200116231745.218684830@linuxfoundation.org> References: <20200116231745.218684830@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Daniel Baluta commit dcf08d0f8f09081b16f69071dd55d51d5e964e84 upstream. 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 Link: https://lore.kernel.org/r/20191220170531.10423-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- sound/soc/sof/imx/imx8.c | 3 +++ 1 file changed, 3 insertions(+) --- 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->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: