From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 86949C43334 for ; Thu, 30 Jun 2022 07:13:33 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DD38E843DC; Thu, 30 Jun 2022 09:13:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=bootlin.com header.i=@bootlin.com header.b="L2C9W21R"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 239C9843E8; Thu, 30 Jun 2022 09:13:29 +0200 (CEST) Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [IPv6:2001:4b98:dc4:8::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 96092842C6 for ; Thu, 30 Jun 2022 09:13:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=miquel.raynal@bootlin.com Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 8152110000A; Thu, 30 Jun 2022 07:13:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1656573206; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xOuwSlGSHOiwHf4dNTadqyvn99E2+YydjP83Bvv+E6c=; b=L2C9W21RYU+nyttN870zXP16WD/Z03gEQaVgAWdC+w78li2SZQP86RFCfWK7O3AJ3g18uW fao6WR/+ss7A1zqQmeTbZBeLYHJEHI20f6sYn/2SOfjJ7vIUTZ/eaVjXgrv4lqd0pPir+U +kj4h7x7O885QAaBvQE1ocmSLGKYozmMDvNxaqF2iU4QHf86s28Nr1EkDFkE0Pen0nyUIL 1MxI6sco62fxOYJd2GwVBzb2daeIn9ivujZOUARVhogr8bEOBlOp+/jsr3wqzc8qt1EdU4 hKEmVWuESwwROLXrunKYfNgjJKzqkWBMq3chbu3vUWaKEXtfLnmLkyn2ZAWCsg== Date: Thu, 30 Jun 2022 09:13:22 +0200 From: Miquel Raynal To: Markus Hoffrogge Cc: u-boot@lists.denx.de, macromorgan@hotmail.com, Maxime Ripard Subject: Re: [PATCH] sunxi-nand: fix the PIO instead of DMA implementation Message-ID: <20220630091322.090dab73@xps-13> In-Reply-To: References: Organization: Bootlin X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Hi Markus, + Maxime, for the record :) mhoffrogge@gmail.com wrote on Thu, 30 Jun 2022 01:26:39 +0200: > The sunxi nand SPL loader was broken at least for SUN4I, > SUN5I and SUN7I SOCs since the implementation change > from DMA to PIO usage - commit 6ddbb1e. >=20 > Root cause for this issue is the NFC control flag NFC_CTL_RAM_METHOD > being set by method nand_apply_config. >=20 > This flag controls the bus being used for the NFCs internal RAM access. > It must be set for the DMA use case only. > See A33_Nand_Flash_Controller_Specification.pdf page 12. >=20 > This fix is tested by myself on a Cubietruck A20 board. > Others should test it on new generation SOCs as well. Good to know that someone tackled this, Maxime already reported some time ago that it was broken for a number of boards but I never took the time to investigate, apologies. > Signed-off-by: Markus Hoffrogge > --- > drivers/mtd/nand/raw/sunxi_nand_spl.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/drivers/mtd/nand/raw/sunxi_nand_spl.c > b/drivers/mtd/nand/raw/sunxi_nand_spl.c > index a29a76c58d..6de0b0a355 100644 > --- a/drivers/mtd/nand/raw/sunxi_nand_spl.c > +++ b/drivers/mtd/nand/raw/sunxi_nand_spl.c > @@ -208,7 +208,7 @@ static void nand_apply_config(const struct nfc_config > *conf) >=20 > val =3D readl(SUNXI_NFC_BASE + NFC_CTL); > val &=3D ~NFC_CTL_PAGE_SIZE_MASK; > - writel(val | NFC_CTL_RAM_METHOD | NFC_CTL_PAGE_SIZE(conf->page_size), > + writel(val | NFC_CTL_PAGE_SIZE(conf->page_size), > SUNXI_NFC_BASE + NFC_CTL); > writel(conf->ecc_size, SUNXI_NFC_BASE + NFC_CNT); > writel(conf->page_size, SUNXI_NFC_BASE + NFC_SPARE_AREA); > -- Thanks, Miqu=C3=A8l