Giacomo Travaglini has submitted this change and it was merged. ( https://gem5-review.googlesource.com/c/public/gem5/+/15279 )

Change subject: dev, arm: Warn on PL011 DMA disable
......................................................................

dev, arm: Warn on PL011 DMA disable

The PL011 spec specifies a DMACR register at offset 0x48, which isn't
implemented in the model. Currently any attempt to access the register
results in a panic.

This change swaps the panic for a warning only when software writes into
DMACR to disable DMA, keeping the panic otherwise.

Change-Id: I04586b52df8d5d174536276fd7ae19e77ff4681a
Reviewed-by: Giacomo Travaglini <giacomo.travagl...@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/15279
Reviewed-by: Andreas Sandberg <andreas.sandb...@arm.com>
Maintainer: Andreas Sandberg <andreas.sandb...@arm.com>
---
M src/dev/arm/pl011.cc
M src/dev/arm/pl011.hh
2 files changed, 13 insertions(+), 0 deletions(-)

Approvals:
  Andreas Sandberg: Looks good to me, approved; Looks good to me, approved



diff --git a/src/dev/arm/pl011.cc b/src/dev/arm/pl011.cc
old mode 100644
new mode 100755
index fe73d96..2e80045
--- a/src/dev/arm/pl011.cc
+++ b/src/dev/arm/pl011.cc
@@ -133,6 +133,10 @@
         DPRINTF(Uart, "Reading Masked Int status as 0x%x\n", maskInt());
         data = maskInt();
         break;
+      case UART_DMACR:
+        warn("PL011: DMA not supported\n");
+        data = 0x0; // DMA never enabled
+        break;
       default:
         if (readId(pkt, AMBA_ID, pioAddr)) {
             // Hack for variable size accesses
@@ -239,6 +243,14 @@
             dataAvailable();
         }
         break;
+      case UART_DMACR:
+        // DMA is not supported, so panic if anyome tries to enable it.
+ // Bits 0, 1, 2 enables DMA on RX, TX, ERR respectively, others res0.
+        if (data & 0x7) {
+            panic("Tried to enable DMA on PL011\n");
+        }
+        warn("PL011: DMA not supported\n");
+        break;
       default:
panic("Tried to write PL011 at offset %#x that doesn't exist\n", daddr);
         break;
diff --git a/src/dev/arm/pl011.hh b/src/dev/arm/pl011.hh
old mode 100644
new mode 100755
index 5a92d88..dac2f68
--- a/src/dev/arm/pl011.hh
+++ b/src/dev/arm/pl011.hh
@@ -135,6 +135,7 @@
     static const int UART_RIS  = 0x03C;
     static const int UART_MIS  = 0x040;
     static const int UART_ICR  = 0x044;
+    static const int UART_DMACR = 0x048;

     static const uint16_t UART_RIINTR = 1 << 0;
     static const uint16_t UART_CTSINTR = 1 << 1;

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/15279
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I04586b52df8d5d174536276fd7ae19e77ff4681a
Gerrit-Change-Number: 15279
Gerrit-PatchSet: 2
Gerrit-Owner: Giacomo Travaglini <giacomo.travagl...@arm.com>
Gerrit-Reviewer: Andreas Sandberg <andreas.sandb...@arm.com>
Gerrit-Reviewer: Giacomo Travaglini <giacomo.travagl...@arm.com>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to