dev-arm: Allow 32 bit accesses to GITS_C(WRITER/READR/BASER)
authorGiacomo Travaglini <giacomo.travaglini@arm.com>
Thu, 15 Aug 2019 10:45:53 +0000 (11:45 +0100)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Thu, 22 Aug 2019 08:49:00 +0000 (08:49 +0000)
For those registers (GITS_CWRITER, GITS_READR and GITS_CBASER)
Bits [63:32] and bits [31:0] are accessible separately.

Change-Id: Ibf60b5e4fd20efb21a63570e6012862e37946877
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/20256
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/dev/arm/gic_v3_its.cc
src/dev/arm/gic_v3_its.hh

index 26c123c033ad7eb192994b46391018fc94c3dc44..de2683c24baf35ba49d15bb1eab093b7027dedf4 100644 (file)
@@ -826,14 +826,26 @@ Gicv3Its::read(PacketPtr pkt)
         value = gitsCbaser;
         break;
 
+      case GITS_CBASER + 4:
+        value = gitsCbaser.high;
+        break;
+
       case GITS_CWRITER:
         value = gitsCwriter;
         break;
 
+      case GITS_CWRITER + 4:
+        value = gitsCwriter.high;
+        break;
+
       case GITS_CREADR:
         value = gitsCreadr;
         break;
 
+      case GITS_CREADR + 4:
+        value = gitsCreadr.high;
+        break;
+
       case GITS_PIDR2:
         value = gic->getDistributor()->gicdPidr2;
         break;
@@ -879,16 +891,41 @@ Gicv3Its::write(PacketPtr pkt)
         panic("GITS_TYPER is Read Only\n");
 
       case GITS_CBASER:
-        assert(pkt->getSize() == sizeof(uint64_t));
-        gitsCbaser = pkt->getLE<uint64_t>();
+        if (pkt->getSize() == sizeof(uint32_t)) {
+            gitsCbaser.low = pkt->getLE<uint32_t>();
+        } else {
+            assert(pkt->getSize() == sizeof(uint64_t));
+            gitsCbaser = pkt->getLE<uint64_t>();
+        }
+
+        gitsCreadr = 0; // Cleared when CBASER gets written
+
+        checkCommandQueue();
+        break;
+
+      case GITS_CBASER + 4:
+        assert(pkt->getSize() == sizeof(uint32_t));
+        gitsCbaser.high = pkt->getLE<uint32_t>();
+
         gitsCreadr = 0; // Cleared when CBASER gets written
 
         checkCommandQueue();
         break;
 
       case GITS_CWRITER:
-        assert(pkt->getSize() == sizeof(uint64_t));
-        gitsCwriter = pkt->getLE<uint64_t>();
+        if (pkt->getSize() == sizeof(uint32_t)) {
+            gitsCwriter.low = pkt->getLE<uint32_t>();
+        } else {
+            assert(pkt->getSize() == sizeof(uint64_t));
+            gitsCwriter = pkt->getLE<uint64_t>();
+        }
+
+        checkCommandQueue();
+        break;
+
+      case GITS_CWRITER + 4:
+        assert(pkt->getSize() == sizeof(uint32_t));
+        gitsCwriter.high = pkt->getLE<uint32_t>();
 
         checkCommandQueue();
         break;
index e09f712be38a665f92a6b66bc0bf46f1b54db748..dae18d516d3ef84f0551bc7bbc09dfc9cf91412e 100644 (file)
@@ -149,12 +149,16 @@ class Gicv3Its : public BasicPioDevice
 
     // Command read/write, (CREADR, CWRITER)
     BitUnion64(CRDWR)
+        Bitfield<63, 32> high;
+        Bitfield<31, 0> low;
         Bitfield<19, 5> offset;
         Bitfield<0> retry;
         Bitfield<0> stalled;
     EndBitUnion(CRDWR)
 
     BitUnion64(CBASER)
+        Bitfield<63, 32> high;
+        Bitfield<31, 0> low;
         Bitfield<63> valid;
         Bitfield<61, 59> innerCache;
         Bitfield<55, 53> outerCache;