From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Tue, 11 Dec 2012 16:24:37 -0600 Subject: [U-Boot] [PATCH] [DFU] Implement NAND dfu support In-Reply-To: <20121211011650.GV9044@bill-the-cat> (from trini@ti.com on Mon Dec 10 19:16:50 2012) References: <1355153072-6047-1-git-send-email-panto@antoniou-consulting.com> <1355188195.5334.24@snotra> <20121211011650.GV9044@bill-the-cat> Message-ID: <1355264677.13481.13@snotra> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 12/10/2012 07:16:50 PM, Tom Rini wrote: > On Mon, Dec 10, 2012 at 07:09:55PM -0600, Scott Wood wrote: > > On 12/10/2012 09:24:32 AM, Pantelis Antoniou wrote: > > >+ sprintf(cmd_buf, "nand %s %p %llx %llx", > > >+ op == DFU_OP_READ ? "read" : "write", > > >+ buf, start, count); > > >+ > > >+ debug("%s: %s 0x%p\n", __func__, cmd_buf, cmd_buf); > > >+ ret = run_command(cmd_buf, 0); > > > > Why not use the C interface to NAND? > > > > >+ /* find out how much actual bytes have been written */ > > >+ /* the difference is the amount of skip we must add from now on > > >*/ > > >+ actual = nand_extent_skip_bad(&nand_info[dev], start, count); > > > > ...especially since you already need to interact with it here? > > I've been talking with Pantelis about this as well and in short, this > series adds NAND support ala MMC (which is to say, (ab)using the > command > interface). I think he was thinking we need a bit more generic help > to > avoid having to duplicate the code the command interface also uses > (state, sanity checking), iirc. Some elaboration on what exactly he's relying on from the command line interface would be nice. -Scott