From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Wegner Date: Tue, 27 Oct 2009 13:51:46 +0100 Subject: [U-Boot] non-blocking flash functions - is this possible/acceptable? Message-ID: <20091027125146.GA3216@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 Hi, we have an update protocol that normally relies on data being received while the previous block is written to flash. We hacked our U-Boot to provide non-blocking variants for flash access for the relevant functions, which are: flash_status_check_nb() flash_full_status_check_nb() flash_erase_nb() (single-sector only) flash_write_cfibuffer_nb() write_buff_nb() Apart from flash_status_check_nb() and flash_erase_nb() (the latter being reduced to handle only one sector at a time), these are mainly the same functions as the originals, but use flash_[full_]status_check_nb() instead, so there is much duplicate code. Is such a use case generally acceptable in U-Boot, and if so, does anybody have an idea how to implement those without all this duplicate code? Of course I can also implement this stuff in our board code, but it seems a bit unlogical to break the flash handling apart and the bloat would remain, just in a different place. [I am bringing this topic up because I am trying to prepare patches for sending to the list, and this one seems to me as a real show-stopper right now.] Regards, Wolfgang