Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp445134pxb; Thu, 9 Sep 2021 04:45:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydDXlp8ZED6iNjfWJY9f5k8sMyE/o5mVUNUtNsx0NxOSZG1acWoVskF6RJKhd8Op9s+Gaj X-Received: by 2002:a05:6e02:1aa6:: with SMTP id l6mr1995771ilv.14.1631187958567; Thu, 09 Sep 2021 04:45:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631187958; cv=none; d=google.com; s=arc-20160816; b=imSKWs2uuP73TBG12wquk5FOPPRA6lPGk3lR9d7nefo4fwNdjMPBwsd8JOR+y3Si1i QZtrOJrN8x1FJEZMkpAZ5Nh/pd/8/tKFIMCw93CydEcuiaEzu2hupuSPmVN0wZR3ZmU0 lbt1azw95PWcBYtGwJFjpw12TFrisu68abivmkuyzc4Ea+2TDaQ9pRpSg9+F4iZPUWiC rfwMWUYBEgnPzWpihwYuJdCt1hVnU93g6nSTRbQbgRoAA8B1l2at4RLhoZCkHOn4f84g jbBWrUXmJNpznGCeixDK3tLfLCMh7XSUgnL8xb++ZKbpfLLm7zU3QhBA50A8mqyZ/09Z Gz1A== 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=o3+s3znWnmsDNofph5ptpAvdAi/ZRcY8Kt1VS3ynIE4=; b=BkWpLQ0L51ZAj+v4g2BIrFPuqU0KvS+/Y3xmmUvLw2jgIIjtvDwl1oh1EaUz+Foymn hfXMOvmCPM86r8zVPZ5hSHi7RYbzQ4URBWvr/ciWXPCi3fV313sYKDwfyrO8JYxVudRT G5Xr6oaMPfOSLrRpZTL6h78+A8GubXtnb71LdXW5ICj1q34XXDrH/BkKyHXaJUV4gT2w fbjvWbBktaa01O2M0/Z95vEJvrPj11ADdLJVLnlopt0yba+9wbMUcd2KOd1tmydfg559 JvGHBjWjp5g5dy4EfVobTsTp098/ogfa+1X6+TcPcRbyohDuV+oNP847JcZgsfAC4eS1 qHoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=affzZkJd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c39si1416032jaf.12.2021.09.09.04.45.45; Thu, 09 Sep 2021 04:45:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=affzZkJd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240700AbhIILqN (ORCPT + 99 others); Thu, 9 Sep 2021 07:46:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:46928 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239130AbhIILoE (ORCPT ); Thu, 9 Sep 2021 07:44:04 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2419B6120F; Thu, 9 Sep 2021 11:42:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631187741; bh=94Sj7VYusL5dEOCcE9kh4RJYvB8fUjJ0n0fYIhyXZLI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=affzZkJdXCWVnUJXgLRL069IwE/0wnn3TTeSY3kdFVZvTRnK1r14UrMaXQingL81v 5XfZk8Atb3APB5jo1+LbNaerPYlJ+ZowGIMr3mufdxRdb+K1McWeIY07tLVcOMN6Yk kiOGqFh2yFm3R82vTKB0V6E6vhPYm30+rx0uev9yx4wsr+b4mBQgh4DBcmucK14iOR YMQ4J2IOo3yqIjhR5kfso6zR27IvitZY2YG9qUPQ+VIpwzc3MJEPhtP0hMOoFFvAvJ scOR/qFHTowCTX5w+n/AP2NJYgGPsvpPQHSauEBLopXwoVPCk7L1ApxLATcHIaN8Qh UtwUj+lLP3fbA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Robin Gong , Lucas Stach , Mark Brown , Shawn Guo , Sasha Levin , linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 5.14 058/252] spi: imx: fix ERR009165 Date: Thu, 9 Sep 2021 07:37:52 -0400 Message-Id: <20210909114106.141462-58-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210909114106.141462-1-sashal@kernel.org> References: <20210909114106.141462-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Robin Gong [ Upstream commit 980f884866eed4dda2a18de888c5a67dde67d640 ] Change to XCH mode even in dma mode, please refer to the below errata: https://www.nxp.com/docs/en/errata/IMX6DQCE.pdf Signed-off-by: Robin Gong Reviewed-by: Lucas Stach Acked-by: Mark Brown Signed-off-by: Shawn Guo Signed-off-by: Sasha Levin --- drivers/spi/spi-imx.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index fa68e9817929..d89b11205815 100644 --- a/drivers/spi/spi-imx.c +++ b/drivers/spi/spi-imx.c @@ -622,8 +622,8 @@ static int mx51_ecspi_prepare_transfer(struct spi_imx_data *spi_imx, ctrl |= mx51_ecspi_clkdiv(spi_imx, spi_imx->spi_bus_clk, &clk); spi_imx->spi_bus_clk = clk; - if (spi_imx->usedma) - ctrl |= MX51_ECSPI_CTRL_SMC; + /* ERR009165: work in XHC mode as PIO */ + ctrl &= ~MX51_ECSPI_CTRL_SMC; writel(ctrl, spi_imx->base + MX51_ECSPI_CTRL); @@ -637,7 +637,7 @@ static void mx51_setup_wml(struct spi_imx_data *spi_imx) * and enable DMA request. */ writel(MX51_ECSPI_DMA_RX_WML(spi_imx->wml - 1) | - MX51_ECSPI_DMA_TX_WML(spi_imx->wml) | + MX51_ECSPI_DMA_TX_WML(0) | MX51_ECSPI_DMA_RXT_WML(spi_imx->wml) | MX51_ECSPI_DMA_TEDEN | MX51_ECSPI_DMA_RXDEN | MX51_ECSPI_DMA_RXTDEN, spi_imx->base + MX51_ECSPI_DMA); @@ -1253,10 +1253,6 @@ static int spi_imx_sdma_init(struct device *dev, struct spi_imx_data *spi_imx, { int ret; - /* use pio mode for i.mx6dl chip TKT238285 */ - if (of_machine_is_compatible("fsl,imx6dl")) - return 0; - spi_imx->wml = spi_imx->devtype_data->fifo_size / 2; /* Prepare for TX DMA: */ -- 2.30.2