UBI: ignore/overwrite old data/PEBs after flashing
Rafał Miłecki
zajec5 at gmail.com
Thu Oct 16 03:29:07 PDT 2014
On 16 October 2014 12:09, Artem Bityutskiy <dedekind1 at gmail.com> wrote:
> On Thu, 2014-10-16 at 07:34 +0200, Rafał Miłecki wrote:
>> Hi,
>>
>> I need some help with flashing UBI images.
>>
>> I work with Broadcom ARM SoCs that use a CFE bootloader. In most cases
>> it doesn't provide a way to clear flash content before flashing the
>> firmware. It means that if I have 120 MiB of space for the firmware
>> and I flash 20 MiB firmware, the rest of flash (100 MiB) won't be
>> cleared. My partitioner driver will create 2 MiB partition for kernel
>> and 118 MiB partition for UBI.
>
> So what I hear is that the flasher does not provide users the "erase"
> operation, but only provides users a "write" operation?
That's right (at least for some/most of the CFE versions). Some
vendors hack CFE on their own, but the main problem still affects many
devices.
> Then the solution would be to pad your image with 0xFFs and write it.
> UBI will notice PEBs which do not contain UBI headers and will erase
> them in background.
That would be trivial trick to implement, however it's far from being
user friendly. Most devices have 128 MiB flash and our firmware
(OpenWrt) is only ~4 MiB big. It would be a waste of
space/bandwidth/time to provide firmware images padded with over 120
MiB of 0xFF.
--
Rafał
More information about the linux-mtd
mailing list