[Skiboot] [RFC PATCH 0/3] OpenBMC MBOX work

Cyril Bur cyril.bur at au1.ibm.com
Thu Jan 12 16:26:16 AEDT 2017


Hi,

On OpenBMC platforms we currently expect the BMC to have pointed the
LPC bus at the flash where we can do flash read/writes/erases. This
makes controlling access between the host and the BMC difficult.

A better strategy is to say that the BMC owns the flash and the host
must request access. Doing so instantly solves the concurrent access
problem but also allows for some abstraction of the flash by the BMC.
How this is going to work is that skiboot requests access to (a region
of) the flash and the BMC places it in its own RAM and points the LPC
bus at it. The current implementation on the BMC is a copy of the
flash into ram and a write back to the flash when needed but it could
be much better.

These patches attempt to achieve this by using the MBOX registers to
talk to the BMC and request the flash. Once requested the 'flash' can
just be read from the LPC bus with the regular accessors, same for
writing

There isn't really an 'official' specification of the protocol just
yet although it is unlikely to change from what is there. As is
obvious from the code some of the finer points as still being decided
on.

It may be worth noting here that the BMC communication is done
synchronously, not exactly fast. Future work may look at making this
interface asynchronous where it makes sense.

Thanks for the review,

Cyril

Cyril Bur (3):
  hw/lpc-mbox: Add skiboot drivers for the BMC mbox regs
  libflash: blocklevel backend for MBOX flash access
  astbmc/pnor: Use mbox-flash for flash accesses

 hw/Makefile.inc           |   2 +-
 hw/ast-bmc/ast-io.c       |  28 +++
 hw/lpc-mbox.c             | 300 +++++++++++++++++++++++++++
 include/ast.h             |   4 +
 include/lpc-mbox.h        |  58 ++++++
 include/skiboot.h         |   1 +
 libflash/Makefile.inc     |   2 +-
 libflash/mbox-flash.c     | 515 ++++++++++++++++++++++++++++++++++++++++++++++
 libflash/mbox-flash.h     |  24 +++
 platforms/astbmc/common.c |  38 ++++
 platforms/astbmc/pnor.c   |  48 +++--
 11 files changed, 1001 insertions(+), 19 deletions(-)
 create mode 100644 hw/lpc-mbox.c
 create mode 100644 include/lpc-mbox.h
 create mode 100644 libflash/mbox-flash.c
 create mode 100644 libflash/mbox-flash.h

-- 
2.11.0



More information about the Skiboot mailing list