817d2216 | 27-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
mboxd_pnor_partition_table: Remove redundant wrapper functions
Change-Id: I5a4d6bb7b019767c19d45e68d4ac01c92c024abe Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
3af92a49 | 28-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
pnor_partition: Remove redundant ReturnCode enum
Change-Id: I25726e9fe97b37d9be0bab10a84f20d0bab9f5c9 Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
889ab518 | 28-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
pnor_partition: Remove redundant Descriptor class
Change-Id: Ic15daa8198df660d7c2e7c26921ce43e671d5c38 Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
ad343101 | 27-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
pnor_partition: Refactor to enforce stronger boundaries for abstractions
The RORequest and RWRequest classes did not provide a clear abstraction over the operation of populating a window or partitio
pnor_partition: Refactor to enforce stronger boundaries for abstractions
The RORequest and RWRequest classes did not provide a clear abstraction over the operation of populating a window or partition associated with a CREATE_{READ,WRITE}_WINDOW request. The role of the classes was to find the partition for the provided offset, locate and then open its backing file.
However, the file-descriptor for the backing file was exposed outside of the class, as was the FFS partition struct, both of which were managed _internal_ to the class. Thus the classes provided no encapsulation of state and awkwardly split the tasks of managing and utilising the resources between the callee and caller.
This commit inverts the behaviour in a fulfil() method handles the mechanics of locating, opening, manipulating and closing the backing file, requiring nothing of the caller. The pnor_partition reference is managed entirely inside the Request class, derived from the offset passed to the constructor.
Unifying the mechanics into fulfil() results in a decent reduction in lines of code at the expense of some cyclomatic complexity. fulfil() is publicly exposed via read() and write() wrappers on the class, and the RORequest and RWRequest classes are removed as a result.
Change-Id: Ie587ed31f1a6db97bcb490dbcc2e27ece0b1f82c Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
fc62158c | 28-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
mboxd_flash_virtual: Remove dependence on vpnor_get_partition_table_size
Change-Id: Ide8012846732649780a8989c8040bece8ffdf272 Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
730e3b04 | 23-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
test: vpnor: Add create_read_window_partition_invalid
The CREATE_READ_WINDOW request asks for an offset below the one defined partition, between it and the ToC.
Change-Id: Iafaa530a3d6b02626106508b
test: vpnor: Add create_read_window_partition_invalid
The CREATE_READ_WINDOW request asks for an offset below the one defined partition, between it and the ToC.
Change-Id: Iafaa530a3d6b02626106508b81c7aa7eaef9c876 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
ae1edb94 | 28-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
pnor_partition_table: Raise exception for unmapped offsets
Allow reads and writes of offsets that don't map onto partitions defined in the ToC. Do so by ignoring the mapping failure and filling a wi
pnor_partition_table: Raise exception for unmapped offsets
Allow reads and writes of offsets that don't map onto partitions defined in the ToC. Do so by ignoring the mapping failure and filling a window with 0xff in the hole from the requested offset to the following partition.
This change also removes the reliance on InternalFailure as the exception of choice for communicating failures. We can do better without the teeth-pulling required by phosphor-logging by translating custom exceptions into phosphor-logging exceptions at the edges.
Change-Id: Ibfa961a66b0b979354c6dc226ccbe7e9fbafc16d Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
cd928513 | 28-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
pnor_partition_table: Improve readability of Table::partition(size_t)
Create a local variable for the partition of interest.
Change-Id: I7c0ec008f8b616cec15f10664afca73736324029 Signed-off-by: Andr
pnor_partition_table: Improve readability of Table::partition(size_t)
Create a local variable for the partition of interest.
Change-Id: I7c0ec008f8b616cec15f10664afca73736324029 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
2ceba89a | 28-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
pnor_partition_table: Move struct vpnor_partition_table to header
Allow use of the definition in other parts of the codebase.
Change-Id: I5f4f23c909a09f12fd16728183aadbf36b565dba Signed-off-by: And
pnor_partition_table: Move struct vpnor_partition_table to header
Allow use of the definition in other parts of the codebase.
Change-Id: I5f4f23c909a09f12fd16728183aadbf36b565dba Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
bd38c210 | 27-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
pnor_partition_table: Rename offt to blockOffset in Table::partition()
Change-Id: I0523a451c03c05f2851f06f99326c792149849b6 Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
2b73f172 | 28-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
test: vpnor: Add create_read_window_straddle_partitions
Change-Id: Icde607847812bcba3c7e2a131d7f46e223d44440 Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
7eed6de0 | 28-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
test: vpnor: Add create_read_window_toc
As the handling of the ToC is separate to the mapping of other partitions, ensure we have appropriate coverage of copy_flash.
Change-Id: If362c667df65b264884
test: vpnor: Add create_read_window_toc
As the handling of the ToC is separate to the mapping of other partitions, ensure we have appropriate coverage of copy_flash.
Change-Id: If362c667df65b2648849cab2e0c11ebe0416d254 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
3c9bb3e4 | 23-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
test: vpnor: Add create_read_window_oob
Attempts to access an offset beyond the end of what's defined in the partition table.
Change-Id: I43c55423625261947965155cb1d53ef276a4ed05 Signed-off-by: And
test: vpnor: Add create_read_window_oob
Attempts to access an offset beyond the end of what's defined in the partition table.
Change-Id: I43c55423625261947965155cb1d53ef276a4ed05 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
bfe6f803 | 27-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
test: vpnor: Add toc_missing_file
Change-Id: I6fb96c921bead334ff178d0d78e9c7e7c7234f0a Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
3376dacd | 27-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
test: vpnor: Add toc_lookup_failed
Change-Id: I3dbb4a14c5052c1689f930744a59b465b482fb68 Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
a138f56a | 27-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
test: vpnor: Add toc_lookup_found
Change-Id: I5243ee9d093445437cc6d75400d1d51ff5885719 Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
4ca1aa59 | 01-Mar-2018 |
Andrew Jeffery <andrew@aj.id.au> |
pnor_partition_table: Disallow overlapping partitions
Change-Id: I25c6a6c4cee69ce9ba28c238851c7b7c622bb9b3 Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
f5a5138f | 26-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
test: vpnor: Add toc_overlap
Change-Id: Iafddb01ad174b27e3f12272e107cc0323d824c81 Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
0f9fbd68 | 01-Mar-2018 |
Andrew Jeffery <andrew@aj.id.au> |
pnor_partition_table: Fixes for flag handling in writeUserData()
This is a collection of small fixes:
* Always initialise the field for PARTITION_ECC_PROTECTED so it doesn't contain garbage * Pro
pnor_partition_table: Fixes for flag handling in writeUserData()
This is a collection of small fixes:
* Always initialise the field for PARTITION_ECC_PROTECTED so it doesn't contain garbage * Provide a warning when we encounter a flag we don't understand * Ignore empty flags so we don't trigger the unknown flag warning * Unset the READONLY bit if we encounter READWRITE, implementing last-configuration-wins rather than sticky-readonly
Change-Id: I3dd45139716fe241f9d3e7997e1269d13de638ca Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
9b25b591 | 25-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
test: vpnor: Add toc_flags
Exercises the flags associated with FFS properties.
Change-Id: Id710784cbbf3115712f7ce55e1fd38c8889b2c1f Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
a11a3b06 | 25-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
test: vpnor: Add toc_no_version
Change-Id: I17e876fcb18b69d29bcc439e0f270760e015f246 Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
50ab1de1 | 25-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
test: vpnor: Add toc_no_end
Change-Id: I0122a2239df3ec7c83e2bf778d4d8df5a348d495 Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
437c80f3 | 25-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
test: vpnor: Add toc_no_start
Change-Id: If712eac2e0f7b2c46e8bd473a5dc1c5b62c534b4 Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
db493410 | 01-Mar-2018 |
Andrew Jeffery <andrew@aj.id.au> |
pnor_partition_table: Disallow ToC entries with start greater than end
Change-Id: If0861efb0f6bccf82a2df94204821f22198e17b0 Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
17bbf453 | 25-Feb-2018 |
Andrew Jeffery <andrew@aj.id.au> |
test: vpnor: Add toc_start_gt_end
Change-Id: Iaac0e7783f1ceba0d009fcd4865861b0109639e4 Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |