Dear Kuo-Jung Su, In message <1366277139-29728-8-git-send-email-dant...@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. > + /* 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). > + 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; ? > + switch (priv->adrc) { > + case 3: > + ac = 0; > + break; > + case 4: > + ac = 1; > + break; > + case 5: > + ac = 2; > + break; > + } ac = priv->adrc - 3; ? 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: w...@denx.de "You're just jealous." "What, of an overgrown puppy with a single- figure IQ?" - Terry Pratchett, _Moving Pictures_ _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot