[Skiboot] PNOR access utilizing libflash
Stewart Smith
stewart at linux.vnet.ibm.com
Thu Dec 1 11:09:22 AEDT 2016
Steven Janssen <janssens at us.ibm.com> writes:
> A bit of history
> Currently cronus has a server that gets loaded onto a fsp which allows the read/write of the
> PNOR.
> The cronus server currently utilizes the ffs_open, ffs_entry_read, ffs_entry_write, ffs_fsync, and
> ffs_close interfaces as part of the libffs2.h.
> It is compiled with the -lffs shared library.
I gather this is github.com/open-power/ffs - which is effectively
unmaintained, while libflash is actively maintained.
> This server supports listing the partition table within the PNOR (received via the ffs_open
> interface), and performing a read and write of the individual partitions.
> Looking to the future....
> I need to do something similar on the BMC. We are building a cronus server that runs on the
> BMC and need to enable this functionality that exists on the fsp based cronus server. This
> functionality was requested by Dean to allow this functionality to be used within manufacturing.
> Here are my questions:
> I'm currently not able to find the ability to list the partition table of the PNOR. Is this available
> somewhere or future plans to add support for this?
It exists! check out
https://github.com/open-power/skiboot/blob/master/external/pflash/pflash.c#L89
on how it's done in the pflash utility to print things out.
There's also
https://github.com/open-power/skiboot/blob/master/external/pflash/pflash.c#L149
which opens a partition by name.
libflash is somewhat separated into different layers, and there is a FFS
layer.
> How do I build in the libflash functionality within the openBMC environment? Is there a shared
> library I can link to?
There is!
Patrick maintains the bitbake recipe that builds libflash.so for
OpenBMC. So you should be able to just link against it.
--
Stewart Smith
OPAL Architect, IBM.
More information about the Skiboot
mailing list