[Skiboot] [PATCH v3 0/4] OpenBMC MBOX work

Cyril Bur cyril.bur at au1.ibm.com
Thu Feb 2 17:54:36 AEDT 2017


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

There is now a reference implementation of the daemon which runs on
the BMC. This is the other side of the protocol used in 3/4. The daemon
will undergo changes but hopefully the core of the protocol will
remain unchanged. https://github.com/openbmc/mboxbridge

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,


v2: Split patch 1 into two - the driver and using the driver.
    Check if we can use mbox from the device tree
    Removed a virtually unused queue - we can add it (better) when
    things become asynchronous
    Added checks for using the driver uninitialised
    Various cleanups
    Happy new year Joel

	Updated #defines for the mbox protocol to match updated spec
	Removed command that was removed from spec - this command was
	never implemented here on any daemon.
	Updated spec is marking its way upstream and is at
	https://github.com/cyrilbur-ibm/mboxbridge/blob/wip/README.md for

Cyril Bur (4):
  hw/lpc-mbox: Add skiboot driver for the BMC mbox regs
  ast-bmc: Use the mbox driver
  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       |  25 +++
 hw/lpc-mbox.c             | 278 +++++++++++++++++++++++
 include/ast.h             |   4 +
 include/lpc-mbox.h        |  58 +++++
 include/skiboot.h         |   1 +
 libflash/Makefile.inc     |   2 +-
 libflash/mbox-flash.c     | 562 ++++++++++++++++++++++++++++++++++++++++++++++
 libflash/mbox-flash.h     |  24 ++
 platforms/astbmc/common.c |  38 ++++
 platforms/astbmc/pnor.c   |  48 ++--
 11 files changed, 1023 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


More information about the Skiboot mailing list