xref: /openbmc/hiomapd/vpnor/README.md (revision 0971299fc65fa2a09428a19bab629da0ebe9f724)
1*0971299fSAndrew JefferyVirtual PNOR Functionality
2*0971299fSAndrew Jeffery==========================
3*0971299fSAndrew Jeffery
4*0971299fSAndrew JefferyIn the abstract, the virtual PNOR function shifts mboxd away from accessing raw
5*0971299fSAndrew Jefferyflash to dynamically presenting a raw flash image to the host from a set of
6*0971299fSAndrew Jefferybacking files.
7*0971299fSAndrew Jeffery
8*0971299fSAndrew JefferyEnabling the feature virtualises both the host's access to the flash (the mbox
9*0971299fSAndrew Jefferyprotocol), and the BMC's access to the flash (via some filesystem on top of the
10*0971299fSAndrew Jefferyflash device).
11*0971299fSAndrew Jeffery
12*0971299fSAndrew JefferyDo I want to use this feature in my platform?
13*0971299fSAndrew Jeffery---------------------------------------------
14*0971299fSAndrew Jeffery
15*0971299fSAndrew JefferyMaybe. It depends on how the image construction is managed, particularly the
16*0971299fSAndrew Jefferybehaviour around writes from the host. It is likely the scheme will prevent
17*0971299fSAndrew Jefferyfirmware updates from being correctly applied when using flash tools on the
18*0971299fSAndrew Jefferyhost.
19*0971299fSAndrew Jeffery
20*0971299fSAndrew JefferyUse-case Requirements
21*0971299fSAndrew Jeffery---------------------
22*0971299fSAndrew Jeffery
23*0971299fSAndrew JefferyCurrently, the virtual PNOR implementation requires that:
24*0971299fSAndrew Jeffery
25*0971299fSAndrew Jeffery* The host expect an FFS layout (OpenPOWER systems)
26*0971299fSAndrew Jeffery* The BMC provide a directory tree presenting the backing files in a hierarchy
27*0971299fSAndrew Jeffery  that reflects the partition properties in the FFS table of contents.
28*0971299fSAndrew Jeffery
29*0971299fSAndrew JefferyImplementation Behavioural Properties
30*0971299fSAndrew Jeffery-------------------------------------
31*0971299fSAndrew Jeffery
32*0971299fSAndrew Jeffery1.  The FFS ToC defines the set of valid access ranges in terms of partitions
33*0971299fSAndrew Jeffery2.  The read-only property of partitions is enforced
34*0971299fSAndrew Jeffery3.  The ToC is considered read-only
35*0971299fSAndrew Jeffery4.  Read access to valid ranges must be granted
36*0971299fSAndrew Jeffery5.  Write access to valid ranges may be granted
37*0971299fSAndrew Jeffery6.  Access ranges that are valid may map into a backing file associated with
38*0971299fSAndrew Jeffery    the partition
39*0971299fSAndrew Jeffery7.  A read of a valid access range that maps into the backing file will render
40*0971299fSAndrew Jeffery    the data held in the backing file at the appropriate offset
41*0971299fSAndrew Jeffery8.  A read of a valid access range that does not map into the backing file will
42*0971299fSAndrew Jeffery    appear erased
43*0971299fSAndrew Jeffery9.  A read of an invalid access range will appear erased
44*0971299fSAndrew Jeffery10. A write to a valid access range that maps into the backing file will update
45*0971299fSAndrew Jeffery    the data in the file at the appropriate offset
46*0971299fSAndrew Jeffery11. A write to a valid access range that does not map into the backing file
47*0971299fSAndrew Jeffery    will expand the backing file to accommodate the write.
48*0971299fSAndrew Jeffery12. A write to a valid access range may fail if the range is not marked as
49*0971299fSAndrew Jeffery    writeable. The error should be returned in response to the request to open
50*0971299fSAndrew Jeffery    the write window intersecting the read-only range.
51*0971299fSAndrew Jeffery13. A write of an invalid access range will return an error. The error should
52*0971299fSAndrew Jeffery    be returned in response to the request to open the write window covering
53*0971299fSAndrew Jeffery    the invalid range.
54*0971299fSAndrew Jeffery
55*0971299fSAndrew JefferyThe clarification on when the failure occurs in points 11 and 12 is useful for
56*0971299fSAndrew Jefferyhost-side error handling. Opening a write window gives the indication that
57*0971299fSAndrew Jefferyfuture writes are expected to succeed, but in both cases we define them as
58*0971299fSAndrew Jefferyalways failing. Therefore we should not give the impression to the host that
59*0971299fSAndrew Jefferywhat it is asking for can be satisfied.
60