[U-Boot] [PATCH v2 07/12] mtd: nand: add Faraday FTNANDC021 NAND controller support

Kuo-Jung Su
2013-04-22T01:52:20Z

2013/4/18 Wolfgang Denk <wd@denx.de>:
> 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(&regs->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