From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kuo-Jung Su Date: Mon, 22 Apr 2013 09:52:20 +0800 Subject: [U-Boot] [PATCH v2 07/12] mtd: nand: add Faraday FTNANDC021 NAND controller support In-Reply-To: <20130418110437.6D22420019A@gemini.denx.de> References: <1366277139-29728-1-git-send-email-dantesu@gmail.com> <1364540788-13943-2-git-send-email-dantesu@gmail.com> <1366277139-29728-8-git-send-email-dantesu@gmail.com> <20130418110437.6D22420019A@gemini.denx.de> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 2013/4/18 Wolfgang Denk : > Dear Kuo-Jung Su, > > In message <1366277139-29728-8-git-send-email-dantesu@gmail.com> you wrote: > ... >> +/* Register access macros */ >> +#define NAND_READ(r) le32_to_cpu(readl(r)) >> +#define NAND_WRITE(v, r) writel(cpu_to_le32(v), r) >> +#define NAND_SETBITS(m, r) setbits_le32(r, m) >> +#define NAND_CLRBITS(m, r) clrbits_le32(r, m) > > As before: drop these. > Got it, thanks >> + /* wait until chip ready */ >> + while (NAND_READ(®s->srr) & SRR_CHIP_RESET) >> + ; > > Please add a timeout (and fix similar locations in the rest of the > code if there are such). > Got it, thanks >> + switch (priv->bksz / priv->pgsz) { >> + case 16: >> + bk = 0; >> + break; >> + case 32: >> + bk = 1; >> + break; >> + case 64: >> + bk = 2; >> + break; >> + case 128: >> + bk = 3; >> + break; >> + } > > bk = ffs(priv->bksz / priv->pgsz) - 4; > > ? > Got it, thanks >> + switch (priv->adrc) { >> + case 3: >> + ac = 0; >> + break; >> + case 4: >> + ac = 1; >> + break; >> + case 5: >> + ac = 2; >> + break; >> + } > > ac = priv->adrc - 3; > > ? > > Got it, thanks > Best regards, > > Wolfgang Denk > > -- > DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel > HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany > Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de > "You're just jealous." "What, of an overgrown puppy with a single- > figure IQ?" - Terry Pratchett, _Moving Pictures_ -- Best wishes, Kuo-Jung Su