On 04/19/2016 07:48 PM, Salvador Eduardo Tropea wrote: > Hi All! > > Now I'm using an FPGA board with 4 MiB of flash, was using one with > 128 kiB. So now the time to read/write/verify the whole memory is > enough to annoy me ;-) > So I tried creating a layout like this: > > <-- > 00000000:00007e2b fpga > 00007e2c:003fffff free > <-- > > Note: yes only 32300 bytes used, the rest can be used for other > purposes (0,77%). > > And then I used "-i fpga". > But it didn't help ... flashrom read the 4 MiB twice (one at the > beggining and another for the verification). > Looking at the code I found a variable named read_all_first with a > comment about the lack of implementation. > So I implemented the needed code to: > 1) Add a command line option to make it 0 (avoiding the big reads). > This option can be used only when at least one image is indicated with -i > 2) Skip the big read when read_all_first is 0. Only the regions > indicated by the user are actually fetched from the memory. > 3) Same for the verification stage. Just a quick question: How does this mix with range erasure? Most likely, I can't erase 0-7e2b, but I have to erase 0-8000, or even the whole chip. If the chip was not read before erasing, the contents of those areas get destroyed. There are use cases for "-i" with the intention to keep everything in the chip intact except for the selected address range. What you need is a way to differentiate between "must not change" and "I don't care" areas, but the current layout system provides no way to do that. Traditionally "-i" is interpreted as declaring everything outside as "must not change", but your description sound like your patch changes the interpretation to "I don't care".
Regards, Michael Karcher _______________________________________________ flashrom mailing list flashrom@flashrom.org https://www.flashrom.org/mailman/listinfo/flashrom