public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 11/20] sunxi: spl: deassert the NAND controller reset line
Date: Sat, 24 Feb 2018 17:35:06 +0100	[thread overview]
Message-ID: <20180224173506.653f9635@xps13> (raw)
In-Reply-To: <20180222135335.q4kzk2gmodtuxvuj@flea.lan>

Hi Maxime,

On Thu, 22 Feb 2018 14:53:35 +0100, Maxime Ripard
<maxime.ripard@bootlin.com> wrote:

> On Thu, Feb 22, 2018 at 02:33:41PM +0100, Miquel Raynal wrote:
> > Ensure the NAND controller reset line is deasserted before use.
> > 
> > Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> > ---
> >  board/sunxi/board.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/board/sunxi/board.c b/board/sunxi/board.c
> > index 8891961dcc..54ac018b80 100644
> > --- a/board/sunxi/board.c
> > +++ b/board/sunxi/board.c
> > @@ -286,6 +286,7 @@ static void nand_clock_setup(void)
> >  		(struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
> >  
> >  	setbits_le32(&ccm->ahb_gate0, (CLK_GATE_OPEN << AHB_GATE_OFFSET_NAND0));
> > +	setbits_le32(&ccm->ahb_reset0_cfg, (1 << AHB_GATE_OFFSET_NAND0));  
> 
> This is only relevant for the SoCs after the A31 (sun6i, sun8i, and
> probably the A80 (sun9i) and the armv8 (sun50i) families), so you
> should put an ifdef there.

Can you tell me if something like this would fit?

 
         setbits_le32(&ccm->ahb_gate0, (CLK_GATE_OPEN << AHB_GATE_OFFSET_NAND0));
+#if defined CONFIG_MACH_SUN6I || defined CONFIG_MACH_SUN8I || \
+    defined CONFIG_MACH_SUN9I || defined CONFIG_MACH_SUN50I
         setbits_le32(&ccm->ahb_reset0_cfg, (1 << AHB_GATE_OFFSET_NAND0));
+#endif
         setbits_le32(&ccm->nand0_clk_cfg, CCM_NAND_CTRL_ENABLE | AHB_DIV_1);

Thanks,
Miquèl

-- 
Miquel Raynal, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

  reply	other threads:[~2018-02-24 16:35 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-22 13:33 [U-Boot] [PATCH v2 00/20] Bring NAND support to Nintendo NES Classic Miquel Raynal
2018-02-22 13:33 ` [U-Boot] [PATCH v2 01/20] spl: fix binman_sym output check Miquel Raynal
2018-02-22 14:21   ` Maxime Ripard
2018-02-22 13:33 ` [U-Boot] [PATCH v2 02/20] mtd: nand: sunxi: fix ECC strength choice Miquel Raynal
2018-02-22 13:33 ` [U-Boot] [PATCH v2 03/20] spl: nand: sunxi: fix second case of modulo by zero error Miquel Raynal
2018-02-22 13:33 ` [U-Boot] [PATCH v2 04/20] spl: nand: sunxi: fix typo on register name Miquel Raynal
2018-02-22 13:33 ` [U-Boot] [PATCH v2 05/20] spl: nand: sunxi: introduce the nand_wait_int() helper Miquel Raynal
2018-02-22 13:40   ` Boris Brezillon
2018-02-22 13:33 ` [U-Boot] [PATCH v2 06/20] spl: nand: sunxi: introduce the nand_wait_cmd_fifo_empty() helper Miquel Raynal
2018-02-22 13:33 ` [U-Boot] [PATCH v2 07/20] spl: nand: sunxi: add missing status clear Miquel Raynal
2018-02-22 13:33 ` [U-Boot] [PATCH v2 08/20] spl: nand: sunxi: create an helper to handle command execution Miquel Raynal
2018-02-22 13:33 ` [U-Boot] [PATCH v2 09/20] spl: nand: sunxi: ensure enough time has passed after changing the column Miquel Raynal
2018-02-22 13:45   ` Boris Brezillon
2018-02-22 13:33 ` [U-Boot] [PATCH v2 10/20] spl: nand: sunxi: make the reset column helper more generic Miquel Raynal
2018-02-22 13:33 ` [U-Boot] [PATCH v2 11/20] sunxi: spl: deassert the NAND controller reset line Miquel Raynal
2018-02-22 13:53   ` Maxime Ripard
2018-02-24 16:35     ` Miquel Raynal [this message]
2018-02-26  8:40       ` Maxime Ripard
2018-02-26  8:52         ` Wolfgang Denk
2018-02-26 10:53           ` Maxime Ripard
2018-02-22 13:33 ` [U-Boot] [PATCH v2 12/20] spl: nand: sunxi: declare the ecc_bytes array globally Miquel Raynal
2018-02-22 13:33 ` [U-Boot] [PATCH v2 13/20] spl: nand: sunxi: use PIO instead of DMA Miquel Raynal
2018-02-22 13:33 ` [U-Boot] [PATCH v2 14/20] sunxi: spl: remove DMA related settings of the NAND controller Miquel Raynal
2018-02-22 13:33 ` [U-Boot] [PATCH v2 15/20] sunxi: allow NAND support in SPL to be compiled for sun8i platforms Miquel Raynal
2018-02-22 14:15   ` Maxime Ripard
2018-02-22 13:33 ` [U-Boot] [PATCH v2 16/20] sunxi: dts: enable NAND on NES classic Miquel Raynal
2018-02-22 13:59   ` Maxime Ripard
2018-02-22 13:33 ` [U-Boot] [PATCH v2 17/20] sunxi: automatically select SPL_NAND_SUPPORT in Kconfig Miquel Raynal
2018-02-22 14:00   ` Maxime Ripard
2018-02-22 13:33 ` [U-Boot] [PATCH v2 18/20] sunxi: make NAND_SUNXI use ARCH_SUNXI as default " Miquel Raynal
2018-02-22 14:00   ` Maxime Ripard
2018-02-22 13:33 ` [U-Boot] [PATCH v2 19/20] sunxi: move the NAND parameters to Kconfig Miquel Raynal
2018-02-22 14:04   ` Maxime Ripard
2018-02-22 13:33 ` [U-Boot] [PATCH v2 20/20] configs: add NAND support for NES Classic Miquel Raynal
2018-02-22 14:05   ` Maxime Ripard
2018-02-22 14:06 ` [U-Boot] [PATCH v2 00/20] Bring NAND support to Nintendo " Boris Brezillon
2018-02-22 14:21   ` Boris Brezillon

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=20180224173506.653f9635@xps13 \
    --to=miquel.raynal@bootlin.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox