vpnor table: Set base address to actual offset

The base address for the partitions is used by mboxd to find
requested partitions, and for simplicity it's just a continous
number sequence.
But this data is used by the host as the partition offsets,
which are expected to match to the offsets in the openpower xml:
https://github.com/open-power/pnor/blob/21d66daff697f8c13fb067340ca621e9208ab1ea/p9Layouts/defaultPnorLayout_64.xml

This xml pnor layout has empty spaces in between the partitions,
ex: part ends at address 0x2000 and the next partition HBEL starts
at 0x8000. Need to set base address to the actual offset that
corresponds to the xml file, so that the host traces that display
the partition offsets match the data in documented in the xml.
This doesn't affect the memory address allocation.

Part of openbmc/openbmc#2677

Change-Id: Ica142129aabd195655018a84f9a993596c333457
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
diff --git a/pnor_partition_table.cpp b/pnor_partition_table.cpp
index 3e3f1d1..eafdca5 100644
--- a/pnor_partition_table.cpp
+++ b/pnor_partition_table.cpp
@@ -28,7 +28,6 @@
 Table::Table(fs::path&& directory,
              size_t blockSize, size_t pnorSize):
     szBlocks(0),
-    imgBlocks(0),
     directory(std::move(directory)),
     numParts(0),
     blockSize(blockSize),
@@ -76,16 +75,14 @@
                             (num * sizeof(pnor_partition));
     size_t totalSizeAligned = align_up(totalSizeBytes, blockSize);
     szBlocks = totalSizeAligned / blockSize;
-    imgBlocks = szBlocks;
     tbl.resize(totalSizeAligned);
 }
 
 inline void Table::writeSizes(pnor_partition& part, size_t start, size_t end)
 {
     size_t size = end - start;
-    part.data.base = imgBlocks;
+    part.data.base = align_up(start, blockSize) / blockSize;
     size_t sizeInBlocks = align_up(size, blockSize) / blockSize;
-    imgBlocks += sizeInBlocks;
     part.data.size = sizeInBlocks;
 
     // If a a patch partition file exists, populate actual size with its file