From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jens Gehrlein Date: Mon, 03 Nov 2008 12:15:47 +0100 Subject: [U-Boot] CFI: flash_write_cfiword() slow Message-ID: <490EDD63.1010403@tqs.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 list, having a look at function drivers/mtd/cfi_flash.c::flash_write_cfiword(), I found that find_sector() is called twice when having AMD standard, extended or legacy device. The first time, when writing the command. The second time, when calling flash_full_status_check(). Maybe this is the reason, why this programming mode is so slow. find_sector() loops through the sector table from the last sector to the current sector. And the more sectors the device has, the slower the algorithm becomes. And this process for every sector to be programmed. And yes, there are still devices around without (standard) write buffer, e.g. the Samsung K8P2815UQB. Before spending time to create a patch, I would like to read your opinion about this proposal/question: Would it be sufficient to just add a flag, that indicates, that the sector number has already been calculated for AMD flashes or would it be better to pass parameters to flash_full_status_check() dependent on the command set? Other proposals? Do you see any unwanted side effects? -- Kind regards, Jens