All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Markus Hoffrogge <mhoffrogge@gmail.com>
Cc: u-boot@lists.denx.de, macromorgan@hotmail.com,
	Maxime Ripard <maxime@cerno.tech>
Subject: Re: [PATCH] sunxi-nand: fix the PIO instead of DMA implementation
Date: Thu, 30 Jun 2022 09:13:22 +0200	[thread overview]
Message-ID: <20220630091322.090dab73@xps-13> (raw)
In-Reply-To: <CAHpJTQqVxTgAmU4ZOyCKg8o1YECaefBagqBNSNHFfC1UpT2r6Q@mail.gmail.com>

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.
> 
> Root cause for this issue is the NFC control flag NFC_CTL_RAM_METHOD
> being set by method nand_apply_config.
> 
> 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.
> 
> 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 <mhoffrogge@gmail.com>
> ---
>  drivers/mtd/nand/raw/sunxi_nand_spl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 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)
> 
>   val = readl(SUNXI_NFC_BASE + NFC_CTL);
>   val &= ~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èl

  reply	other threads:[~2022-06-30  7:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-29 23:26 [PATCH] sunxi-nand: fix the PIO instead of DMA implementation Markus Hoffrogge
2022-06-30  7:13 ` Miquel Raynal [this message]
2022-06-30  7:31   ` Maxime Ripard
2022-06-30  8:04     ` Markus Hoffrogge
2022-06-30  9:19       ` Maxime Ripard
2022-06-30 14:01       ` andrés ramírez
2022-06-30 14:28         ` Markus Hoffrogge
2022-06-30 21:30           ` Markus Hoffrogge
2022-07-01  9:57             ` Andre Przywara
2022-07-01 14:31               ` Markus Hoffrogge
2022-06-30 13:03     ` Michael Nazzareno Trimarchi
2022-07-18 10:38 ` Andre Przywara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220630091322.090dab73@xps-13 \
    --to=miquel.raynal@bootlin.com \
    --cc=macromorgan@hotmail.com \
    --cc=maxime@cerno.tech \
    --cc=mhoffrogge@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.