
On Thursday 17 May 2012 18:35:25 Timur Tabi wrote:
Well, I already have code in U-boot that does this. If you look at board/freescale/p1022ds/diu.c, you'll see that I override each of the NOR flash accessors. This is horribly inefficient, but it works. Unfortunately, it only covers NOR flash. The new design covers NOR and NAND.
oh, i see what you're on about now. we do a similar thing, but to support some address lines being controlled via GPIOs. you can see what we did here: board/cm-bf537e/gpio_cfi_flash.c
unfortunately, we run up to the same issue you describe where doing saveenv doesn't go through the normal flash API, so the lines don't get set right, so we end up writing to the wrong part of flash.
when i brought this up before, the suggestion was to extend the existing mtd framework to support this because the existing nor flash framework is supposed to make the assumption that the entire thing is directly addressable. but i never found time or inclination, and i'm much less likely to do so today :).
the thread was titled: flread: new command for reading indirect mapped flashes and dates June 2009 :) -mike