Skip to contentSkip to conversation

hw/misc/mps2-scc.c: fix scc_partno and cfg7 write

PATCH Applied Simon Xu 3 participants 5 messages Jul 24 – Jul 27 Arm/versatile express platform

lore
Share & tools
lore

Simon Xu

author
#0 lore raw

cover hw/misc/mps2-scc.c: fix scc_partno and cfg7 write

Split commit from v1 into 2 as they are unrelated.

Simon Xu (2):
hw/misc/mps2-scc.c: fix cfg7 write
hw/misc/mps2-scc.c: fix scc_partno field width

 hw/misc/mps2-scc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
2.53.0
author
#1 lore raw

PATCH 1/2 hw/misc/mps2-scc.c: fix cfg7 write

Change the CFG7 write function to modify the correct variable. This only affects the an536 machine currently as only it uses cfg7 to store the core 1 vector table base address.

---
 hw/misc/mps2-scc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/misc/mps2-scc.c +1 -1
index 7877b31479..1ecb2879e3 100644
@@ -299,7 +299,7 @@ static void mps2_scc_write(void *opaque, hwaddr offset, uint64_t value,
             goto bad_offset;
         }
         /* AN536: Core 1 vector table base address */
-        s->cfg6 = value;
+        s->cfg7 = value;
         break;
     case A_CFGDATA_OUT:
         s->cfgdata_out = value;
Signature · 1 line
2.53.0
author
#2 lore raw

PATCH 2/2 hw/misc/mps2-scc.c: fix scc_partno field width

In reply to Simon Xu

Increase the extract32 length from 8 to 12. The Primary part number is defined as bits[15:4] by the "SSE-310 with M85 and U55 FPGA" documentation. For example for the mps3-an547, 0x547 is 12 bits but we only return 8 bits right now.

---
 hw/misc/mps2-scc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/misc/mps2-scc.c +1 -1
index 1ecb2879e3..554b504c72 100644
@@ -57,7 +57,7 @@ REG32(ID, 0xFFC)
 static int scc_partno(MPS2SCC *s)
 {
     /* Return the partno field of the SCC_ID (0x524, 0x511, etc) */
-    return extract32(s->id, 4, 8);
+    return extract32(s->id, 4, 12);
 }
 
 /* Is CFG_REG2 present? */
Signature · 1 line
2.53.0
#4 lore raw
In reply to Simon Xu
Quoted 12 lines · Simon Xu

Split commit from v1 into 2 as they are unrelated.

Simon Xu (2):
hw/misc/mps2-scc.c: fix cfg7 write
hw/misc/mps2-scc.c: fix scc_partno field width

 hw/misc/mps2-scc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Applied to target-arm.next, thanks.

-- PMM