dev-arm: Read correct version of ICC_BPR register
[gem5.git] / src / dev / arm / flash_device.cc
index 09b096790c0271ab54349ef0302fa0a43ef5d3f9..ba28cff4bfc675cca21f80a2b834f9c876e31e00 100644 (file)
@@ -54,6 +54,7 @@
 
 #include "dev/arm/flash_device.hh"
 
+#include "base/trace.hh"
 #include "debug/Drain.hh"
 
 /**
@@ -87,7 +88,7 @@ FlashDevice::FlashDevice(const FlashDeviceParams* p):
     blocksPerDisk(0),
     planeMask(numPlanes - 1),
     planeEventQueue(numPlanes),
-    planeEvent(this)
+    planeEvent([this]{ actionComplete(); }, name())
 {
 
     /*
@@ -98,7 +99,7 @@ FlashDevice::FlashDevice(const FlashDeviceParams* p):
      * bitwise AND with those two numbers results in an integer with all bits
      * cleared.
      */
-    if(numPlanes & planeMask)
+    if (numPlanes & planeMask)
         fatal("Number of planes is not a power of 2 in flash device.\n");
 }
 
@@ -245,7 +246,7 @@ FlashDevice::accessDevice(uint64_t address, uint32_t amount, Callback *event,
         DPRINTF(FlashDevice, "Plane %d is busy for %d ticks\n", count,
                 time[count]);
 
-        if  (time[count] != 0) {
+        if (time[count] != 0) {
 
             struct CallBackEntry cbe;
             /**
@@ -383,7 +384,6 @@ FlashDevice::remap(uint64_t logic_page_addr)
             assert(block + count < pagesPerDisk);
             locationTable[block + count].page = (block + count) %
                 pagesPerBlock;
-            ++count;
         }
 
         blockEmptyEntries[locationTable[logic_page_addr].block] =
@@ -472,6 +472,8 @@ FlashDevice::getUnknownPages(uint32_t index)
 void
 FlashDevice::regStats()
 {
+    AbstractNVM::regStats();
+
     using namespace Stats;
 
     std::string fd_name = name() + ".FlashDevice";