From a1a0dd8d97ca8af6dea085264d41b332217d5508 Mon Sep 17 00:00:00 2001 From: Giacomo Travaglini Date: Fri, 10 Jul 2020 16:16:22 +0100 Subject: [PATCH] dev-arm: Relax size constraint on AMBA ID registers This patch is allowing non word sized accesses to the AMBA ID registers. Change-Id: I61a7163a3b4120e8dbcdbd6d9b83d33a7996f979 Signed-off-by: Giacomo Travaglini Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31175 Reviewed-by: Andreas Sandberg Maintainer: Andreas Sandberg Tested-by: kokoro --- src/dev/arm/amba_device.cc | 4 ++-- src/dev/arm/kmi.cc | 2 +- src/dev/arm/pl011.cc | 2 +- src/dev/arm/pl111.cc | 2 +- src/dev/arm/rtc_pl031.cc | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/dev/arm/amba_device.cc b/src/dev/arm/amba_device.cc index 2ab274336..76872b197 100644 --- a/src/dev/arm/amba_device.cc +++ b/src/dev/arm/amba_device.cc @@ -80,7 +80,7 @@ AmbaDevice::readId(PacketPtr pkt, uint64_t amba_id, Addr pio_addr) DPRINTF(AMBA, "Returning %#x for offset %#x(%d)\n", (amba_id >> byte) & 0xFF, pkt->getAddr() - pio_addr, byte); - assert(pkt->getSize() == 4); - pkt->setLE((amba_id >> byte) & 0xFF); + + pkt->setUintX((amba_id >> byte) & 0xFF, LittleEndianByteOrder); return true; } diff --git a/src/dev/arm/kmi.cc b/src/dev/arm/kmi.cc index 9d991c396..246fedb39 100644 --- a/src/dev/arm/kmi.cc +++ b/src/dev/arm/kmi.cc @@ -95,7 +95,7 @@ Pl050::read(PacketPtr pkt) default: if (readId(pkt, ambaId, pioAddr)) { // Hack for variable size accesses - data = pkt->getLE(); + data = pkt->getUintX(LittleEndianByteOrder); break; } diff --git a/src/dev/arm/pl011.cc b/src/dev/arm/pl011.cc index 11485b56f..a60276d5c 100755 --- a/src/dev/arm/pl011.cc +++ b/src/dev/arm/pl011.cc @@ -137,7 +137,7 @@ Pl011::read(PacketPtr pkt) default: if (readId(pkt, AMBA_ID, pioAddr)) { // Hack for variable size accesses - data = pkt->getLE(); + data = pkt->getUintX(LittleEndianByteOrder); break; } diff --git a/src/dev/arm/pl111.cc b/src/dev/arm/pl111.cc index f2b8e508f..27606e11d 100644 --- a/src/dev/arm/pl111.cc +++ b/src/dev/arm/pl111.cc @@ -182,7 +182,7 @@ Pl111::read(PacketPtr pkt) default: if (readId(pkt, AMBA_ID, pioAddr)) { // Hack for variable size accesses - data = pkt->getLE(); + data = pkt->getUintX(LittleEndianByteOrder); break; } else if (daddr >= CrsrImage && daddr <= 0xBFC) { // CURSOR IMAGE diff --git a/src/dev/arm/rtc_pl031.cc b/src/dev/arm/rtc_pl031.cc index 713d3f7f3..b2b232249 100644 --- a/src/dev/arm/rtc_pl031.cc +++ b/src/dev/arm/rtc_pl031.cc @@ -90,7 +90,7 @@ PL031::read(PacketPtr pkt) default: if (readId(pkt, ambaId, pioAddr)) { // Hack for variable sized access - data = pkt->getLE(); + data = pkt->getUintX(LittleEndianByteOrder); break; } panic("Tried to read PL031 at offset %#x that doesn't exist\n", daddr); -- 2.30.2