Hi 2009/5/8 Ivo Clarysse <ivo.clary...@gmail.com>: > Ilya, > > On Wed, May 6, 2009 at 8:30 PM, Ilya Yanok <ya...@emcraft.com> wrote: >> Driver for NFC NAND controller found on Freescale's MX2 and MX3 >> processors. Ported from Linux. Tested only with i.MX27 but should >> works with other MX2 and MX3 processors too. > [..] >> --- /dev/null >> +++ b/drivers/mtd/nand/mxc_nand.c >> @@ -0,0 +1,891 @@ > [...] >> +/* This function polls the NANDFC to wait for the basic operation to >> + * complete by checking the INT bit of config2 register. >> + */ >> +static void wait_op_done(struct mxc_nand_host *host, int max_retries, >> + uint16_t param, int useirq) >> +{ >> + uint32_t tmp; >> + >> + while (max_retries-- > 0) { >> + if (readw(host->regs + NFC_CONFIG2) & NFC_INT) { >> + tmp = readw(host->regs + NFC_CONFIG2); >> + tmp &= ~NFC_INT; >> + writew(tmp, host->regs + NFC_CONFIG2); >> + break; >> + } >> + udelay(1); >> + } >> + if (max_retries <= 0) >> + MTDDEBUG(MTD_DEBUG_LEVEL0, "%s(%d): INT not set\n", >> + __func__, param); >> +} > > As you don't have an interrupt handler (as opposed to the Linux > driver), why keep the 'useirq' parameter ? > > [...] >> +static void send_cmd(struct mxc_nand_host *host, uint16_t cmd, int useirq) > > Same comment (also renders all 'islast' parameters obsolete).
I think it's a good idea to keep the code as close as possible to the original linux driver. That way it's easy to make a diff and update the U-boot driver with whatever changes are done in Linux. Regards, Magnus _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot