[Skiboot] [PATCH V2 0/7] Improvements to flash reading code
cyril.bur at au1.ibm.com
Tue Jun 16 19:01:03 AEST 2015
>From V1 Coverletter:
Firstly apologies Stewart I should have had the patches I posted a few days
ago with this series. This series will be need to be applied after those.
These patches keep improving the blocklevel interface.
I've added the ability for ecc to be done at blocklevel, I've purposefully
left libflash _corrected() functions and their use within skiboot, as that
kind of change could wreck havoc. I'd like for skiboot to be the last that
migrates and I haven't done pflash yet.
I've also implemented smart_write() at blocklevel, in writing this I've
realised that smart can often be quite subjective, feedback requested here.
Rather than use a dodgy file accessing backend to libflash, use a file
backend at the blocklevel. This will make pflash and the gard tool much
nicer, and also make it easy for pflash to migrate to using /dev/mtd on
hosts to flash as well as being able to manipulate images on x86 machines.
I have a working gard tool with this code. Note: keen observers will
notice that the new file backend contains a fix to the MEMERASE MTD ioctl
when compared to what was in file_flash.c.
Patch 2/7 received a pretty substantial rewrite as adding test cases
highlighted some badly defined corner case behaviour in the region
Addressed Alistair's comments
Cyril Bur (7):
libflash/ecc: Simplify and cleanup ecc code.
libflash/blocklevel: Extend the block level to be able to do ecc
libflash/blocklevel: add blocklevel flags.
libflash/file: Add a file access backend to for the blocklevel
libflash: Delete file_file.[ch] files
libflash/blocklevel: add a smart write function which wraps up
eraseing and writing
libffs: init with ecc protection at blocklevel level
core/flash.c | 14 +-
external/gard/gard.c | 2 +-
external/pflash/pflash.c | 4 +-
libc/include/errno.h | 2 +
libflash/blocklevel.c | 223 +++++++++++++++++++++++++++++-
libflash/blocklevel.h | 20 +++
libflash/ecc.c | 51 ++++---
libflash/ecc.h | 44 +++---
libflash/file.c | 293 ++++++++++++++++++++++++++++++++++++++++
libflash/file.h | 45 ++++++
libflash/file_flash.c | 224 ------------------------------
libflash/file_flash.h | 11 --
libflash/libffs.c | 14 +-
libflash/libffs.h | 2 +-
libflash/libflash.c | 28 ++--
libflash/test/Makefile.check | 4 +-
libflash/test/test-blocklevel.c | 153 +++++++++++++++++++++
libflash/test/test-ecc.c | 16 +--
18 files changed, 834 insertions(+), 316 deletions(-)
create mode 100644 libflash/file.c
create mode 100644 libflash/file.h
delete mode 100644 libflash/file_flash.c
delete mode 100644 libflash/file_flash.h
create mode 100644 libflash/test/test-blocklevel.c
More information about the Skiboot