0297e5b8 | 14-Mar-2019 |
Andrew Jeffery <andrew@aj.id.au> |
mboxd: Remove flash API compatibility shim
The flash API compatibility was kept to reduce the line noise in the previous backend patch. Remove the compatibility layer now and convert the remaining c
mboxd: Remove flash API compatibility shim
The flash API compatibility was kept to reduce the line noise in the previous backend patch. Remove the compatibility layer now and convert the remaining call-sites.
Change-Id: I4b6e54f4463059a7804918add81e7572db7b7c21 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
f1e547c7 | 13-Mar-2019 |
Evan Lojewski <github@meklort.com> |
mboxd: Add a backend abstraction layer to mboxd.
Introduce a backend abstraction, enabling multiple implementations to be compiled in at once. This change formally abstracts the two existing backend
mboxd: Add a backend abstraction layer to mboxd.
Introduce a backend abstraction, enabling multiple implementations to be compiled in at once. This change formally abstracts the two existing backends, mtd and vpnor.
With the backend abstraction in place, subsequent backends are easier to implement.
This change is based of Evan's work and he retains authorship credit. I (AJ) have reworked the patch to pass the vpnor tests, refactored some parts to enable broader use of const structures and others to clarify the initialisation sequences.
Due to the existing lack of abstraction the patch has unfortunately wide-ranging impacts. I've whittled it down as much as I consider reasonable.
Change-Id: I29984a36dae4ea86ec00b853d2a756f0b9afb3ec Signed-off-by: Evan Lojewski <github@meklort.com> Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
cb93504e | 14-Mar-2019 |
Andrew Jeffery <andrew@aj.id.au> |
flash: Introduce flash_validate()
Clean up the protocol_negotiate_version() mess. The existing approach came about due to viewing the vpnor implementation as an edge case in its own right. The code
flash: Introduce flash_validate()
Clean up the protocol_negotiate_version() mess. The existing approach came about due to viewing the vpnor implementation as an edge case in its own right. The code becomes much neater if we consider all backends as equal and afford them the callbacks necessary for correct behaviour.
Change-Id: Ifaeee9da459818cf22b2f137ddc5b8d0356b9be9 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
4e75a27a | 14-Mar-2019 |
Andrew Jeffery <andrew@aj.id.au> |
vpnor: Test if HBB placement exceeds reserved memory bounds
If a host firmware image is provided where the placement of HBB exceeds the reserved memory size then an out-of-bounds write would occur.
vpnor: Test if HBB placement exceeds reserved memory bounds
If a host firmware image is provided where the placement of HBB exceeds the reserved memory size then an out-of-bounds write would occur.
Change-Id: I0a98cb7417511cc8dd5bd2e12c9232ebc912dcd6 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
261f61a1 | 13-Mar-2019 |
Andrew Jeffery <andrew@aj.id.au> |
vpnor: Shuffle and rework includes for sanity
Include ordering and whether or not C linkage is forced by `extern "C"` blocks can cause headaches at link time. Ensure that all C dependencies are incl
vpnor: Shuffle and rework includes for sanity
Include ordering and whether or not C linkage is forced by `extern "C"` blocks can cause headaches at link time. Ensure that all C dependencies are included in an `extern C` block before other includes occur. Also include the C++ versions of string.h and assert.h
Change-Id: Ia96f6044d40c8eccb907b65924efcf62ac7a89c3 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
7a85d22a | 13-Nov-2018 |
Andrew Jeffery <andrew@aj.id.au> |
vpnor: Enforce a read-only FFS ToC regardless of flags
The virtual PNOR implementation never properly honoured writes to the FFS ToC, as the ToC's binary representation is generated from the CSV fil
vpnor: Enforce a read-only FFS ToC regardless of flags
The virtual PNOR implementation never properly honoured writes to the FFS ToC, as the ToC's binary representation is generated from the CSV file shipped in the PNOR squashfs image.
What *did* happen was that opening a write window to the ToC region succeeded and writes could be flushed, but the flushed writes were never read, and ToC representation internal to mboxd was never updated to match the written state. Thus the written values "persisted" until the ToC's window fell out of the cache (with 64MiB reserved regions, probably on a host reboot).
Short circuit the insanity of handling FFS more than we have to by forcefully marking the ToC as read-only, regardless of the flag configuration shipped in the CSV representation. This prevents the host from successfully opening a write window and thus the host can have no expectation of write persistence.
Change-Id: Ib2788c56b245da506cb7d607c0758b17785766cf Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
8a0efd5e | 13-Nov-2018 |
Andrew Jeffery <andrew@aj.id.au> |
vpnor: test: Add force_readonly_toc
This ensures that the ToC presented to the host indicates that it is not writable. The virtual PNOR implementation has never properly honoured writes to the ToC,
vpnor: test: Add force_readonly_toc
This ensures that the ToC presented to the host indicates that it is not writable. The virtual PNOR implementation has never properly honoured writes to the ToC, so lets at least tell the host.
As the code has not yet been fixed to implement the desired behaviour, add the test to XFAIL_TESTS.
Change-Id: Ia13a0f907f916d6dec3979b17685d54bc578a106 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
89985754 | 12-Nov-2018 |
Andrew Jeffery <andrew@aj.id.au> |
vpnor: Add write-to-writable-ToC test
Tests if mutations survive re-opening the window. They don't, so add the test to XFAIL_TESTS.
Change-Id: Ic2f844c30a7da35033bf03012ea452718d2843e4 Signed-off-b
vpnor: Add write-to-writable-ToC test
Tests if mutations survive re-opening the window. They don't, so add the test to XFAIL_TESTS.
Change-Id: Ic2f844c30a7da35033bf03012ea452718d2843e4 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
d5f1d40f | 11-Oct-2018 |
William A. Kennington III <wak@google.com> |
clang-format: Pull the format rules from the openbmc/docs repo
This makes it consistent with other openbmc projects for c++ formatting.
Tested: Run through the unit test suite.
Change-Id: I920
clang-format: Pull the format rules from the openbmc/docs repo
This makes it consistent with other openbmc projects for c++ formatting.
Tested: Run through the unit test suite.
Change-Id: I92030ce5b42de01360393687fb438faf26f36ac8 Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|
cc650618 | 29-Aug-2018 |
Andrew Jeffery <andrew@aj.id.au> |
vpnor: pnor_partition: Debugging for Request.fulfil()
Change-Id: If74d8d1983c2b32b3ed6264bbdb7f49118d5a1f2 Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
26558dbb | 09-Aug-2018 |
Andrew Jeffery <andrew@aj.id.au> |
mboxd: Refactor and rename mbox.h to mboxd.h
Refine the purpose of the header file to represent what's required for the daemon itself, not its constituent pieces. Rather, split those definitions out
mboxd: Refactor and rename mbox.h to mboxd.h
Refine the purpose of the header file to represent what's required for the daemon itself, not its constituent pieces. Rather, split those definitions out to their respective header files and include them as necessary.
Finally the header file is renamed to better reflect its purpose.
Change-Id: I48c409f57d96c844589cd865b24f197477dfe87c Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
8eab2151 | 09-Aug-2018 |
Andrew Jeffery <andrew@aj.id.au> |
mboxd: Cleanup errnos not captured by tests
Change-Id: I95d1eee536e4113867fceb5dcda45e15dc032002 Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
c7d1947e | 07-Aug-2018 |
Andrew Jeffery <andrew@aj.id.au> |
vpnor: Hijack protocol rather than transport
By hijacking the transport the changes in behaviour were limited to the mailbox interface. Now that we have a DBus interface as well this would lead to i
vpnor: Hijack protocol rather than transport
By hijacking the transport the changes in behaviour were limited to the mailbox interface. Now that we have a DBus interface as well this would lead to inconsistent behaviour dependent on the transport.
Instead of hooking the transport, push the hook down to the protocol level where we will achieve consistent behaviour across all transports.
Change-Id: I437866a6dbda107149336c15a00ee1aa058f5875 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
1e531afd | 06-Aug-2018 |
Andrew Jeffery <andrew@aj.id.au> |
protocol: Add get_info
Change-Id: Ie3338714813bb65f5d37fcd046dd5bebc0ba21f0 Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
457a6e5f | 07-Aug-2018 |
Andrew Jeffery <andrew@aj.id.au> |
mboxd: Rename mboxd_msg to transport_mbox
Change-Id: I0f4e206648c02a98fa938a7e582470c8d90904f1 Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
f593b1bd | 07-Aug-2018 |
Andrew Jeffery <andrew@aj.id.au> |
mboxd: Rename windows files
Change-Id: I44e110906fd0f751f8f34b175f971e65896a7301 Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
17971e44 | 08-Aug-2018 |
Andrew Jeffery <andrew@aj.id.au> |
lpc: Rename reset_lpc to lpc_reset
Change-Id: Iee234830b7ea93a7c51b45217d87162e14ef56ee Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
17079d1d | 08-Aug-2018 |
Andrew Jeffery <andrew@aj.id.au> |
lpc: Rename point_to_memory to lpc_map_memory
Change-Id: Iee32689e1c222a422aadf217d1fb0c817250de6b Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
856c7176 | 08-Aug-2018 |
Andrew Jeffery <andrew@aj.id.au> |
lpc: Drop __cplusplus guard
C++ concepts should go in C++ files.
Change-Id: I7a0979dda90b7968000e05fdf7029dea748a33cc Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
cd18611e | 07-Aug-2018 |
Andrew Jeffery <andrew@aj.id.au> |
mboxd: Rename lpc source files
Change-Id: I289618c90b2df8911e362397b7eab99403c86c05 Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
0293f2f5 | 08-Aug-2018 |
Andrew Jeffery <andrew@aj.id.au> |
flash: Rename write_flash to flash_write
Change-Id: I4b41aac597299c93369d8998b03a7d3e2a128742 Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
4f5d29cf | 08-Aug-2018 |
Andrew Jeffery <andrew@aj.id.au> |
flash: Rename erase_flash to flash_erase
Change-Id: I417319aadb2fdbfa2d688bb26b5515d2f9265994 Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
f953f798 | 08-Aug-2018 |
Andrew Jeffery <andrew@aj.id.au> |
flash: Rename set_flash_bytemap to flash_set_bytemap
Change-Id: I0bd244ab1f8f37cdf54a5dc9198651ade7ed0876 Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
e0cdd3ea | 08-Aug-2018 |
Andrew Jeffery <andrew@aj.id.au> |
flash: Rename copy_flash to flash_copy
Change-Id: If449889fca3370e25a65719d2f5c5ec90258d633 Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
dec6ca61 | 08-Aug-2018 |
Andrew Jeffery <andrew@aj.id.au> |
flash: Rename free_flash_dev to flash_dev_free
Change-Id: I3d3da6312217b6b869fa3f62a1d4752be98fd609 Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |