vpnor: make PNOR block size configurable
The vpnor code would assume a PNOR FFS block size of 4K. Make it
possible to supply this value, since it needn't always be 4K.
Change-Id: I21463b05f1047e93705ba82d46f746056568dcc5
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
diff --git a/pnor_partition_table.hpp b/pnor_partition_table.hpp
index b6c50f4..d933b67 100644
--- a/pnor_partition_table.hpp
+++ b/pnor_partition_table.hpp
@@ -75,10 +75,23 @@
* that houses the PNOR partition files.
*
* @param[in] directory - path of the directory housing PNOR partitions
+ * @param[in] blockSize - PNOR block size, in bytes. See
+ * open-power/hostboot/blob/master/src/usr/pnor/ffs.h for
+ * the PNOR FFS structure.
+ * @param[in] pnorSize - PNOR size, in bytes
*/
- Table(fs::path&& directory);
+ Table(fs::path&& directory,
+ size_t blockSize,
+ size_t pnorSize);
- Table();
+ /** @brief Constructor - creates partition table
+ *
+ * @param[in] blockSize - PNOR block size, in bytes
+ * @param[in] pnorSize - PNOR size, in bytes
+ */
+ Table(size_t blockSize,
+ size_t pnorSize);
+
Table(const Table&) = delete;
Table& operator=(const Table&) = delete;
Table(Table&&) = delete;
@@ -207,6 +220,12 @@
/** @brief Number of partitions */
size_t numParts;
+
+ /** @brief PNOR block size, in bytes */
+ size_t blockSize;
+
+ /** @brief PNOR size, in bytes */
+ size_t pnorSize;
};
} // namespace partition