From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Wegner Date: Tue, 27 Oct 2009 16:24:51 +0100 Subject: [U-Boot] non-blocking flash functions - is this possible/acceptable? In-Reply-To: <4AE6F3D5.5060403@ge.com> References: <20091027125146.GA3216@leila.ping.de> <4AE6F3D5.5060403@ge.com> Message-ID: <20091027152451.GC3216@leila.ping.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tue, Oct 27, 2009 at 09:21:25AM -0400, Jerry Van Baren wrote: > Wolfgang Wegner wrote: > >Is such a use case generally acceptable in U-Boot, and if so, > > I'll defer to Wolfgang Denk, Stefan Roese, (Scott Wood?), and others for > this half. :-) > >anybody have an idea how to implement those without all this duplicate > >code? > > Move the code to the non-blocking functions (which you have already > done), and then implement the blocking versions as wrappers that simply > call the non-blocking write followed by a loop calling > flash_status_check_nb() until the write is complete. For erase, you > would need a loop to do the multi-sector erase as multiple non-blocking > + wait operations. I will try this and see if it looks clean after implementing. Thanks for the hint. Regards, Wolfgang