ati-vga: Add dummy MEM_SDRAM_MODE_REG
authorBALATON Zoltan <balaton@eik.bme.hu>
Sun, 21 Jun 2020 11:12:38 +0000 (13:12 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 30 Jun 2020 20:54:24 +0000 (22:54 +0200)
Radeon chips have an SDRAM mode reg that is accessed by some drivers.
We don't emulate the memory controller but provide some default value
to prevent drivers getting unexpected 0.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Message-id: cc1324b9ef06beb8ae233ddc77dedd8bab9b8624.1592737958.git.balaton@eik.bme.hu
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/display/ati.c
hw/display/ati_dbg.c
hw/display/ati_regs.h

index 95fc443cac833ad099b3b17884654bb73dbac805..4c3ad8f47b0dd487552b1eceb3f232bd1af72c19 100644 (file)
@@ -361,6 +361,11 @@ static uint64_t ati_mm_read(void *opaque, hwaddr addr, unsigned int size)
     case MC_STATUS:
         val = 5;
         break;
+    case MEM_SDRAM_MODE_REG:
+        if (s->dev_id != PCI_DEVICE_ID_ATI_RAGE128_PF) {
+            val = BIT(28) | BIT(20);
+        }
+        break;
     case RBBM_STATUS:
     case GUI_STAT:
         val = 64; /* free CMDFIFO entries */
index 0ebbd36f1477e9981e80a316bfe40db16dccdb5e..bd0ecd48c7a743a797398ca65cd6109effff5472 100644 (file)
@@ -42,6 +42,7 @@ static struct ati_regdesc ati_reg_names[] = {
     {"MC_FB_LOCATION", 0x0148},
     {"MC_AGP_LOCATION", 0x014C},
     {"MC_STATUS", 0x0150},
+    {"MEM_SDRAM_MODE_REG", 0x0158},
     {"MEM_POWER_MISC", 0x015c},
     {"AGP_BASE", 0x0170},
     {"AGP_CNTL", 0x0174},
index ebd37ee30d3f35908d9e2a049b796525831f6dba..d6282b2ef21006f73a124081e8ee5a23a21f4347 100644 (file)
@@ -60,6 +60,7 @@
 #define MC_FB_LOCATION                          0x0148
 #define MC_AGP_LOCATION                         0x014C
 #define MC_STATUS                               0x0150
+#define MEM_SDRAM_MODE_REG                      0x0158
 #define MEM_POWER_MISC                          0x015c
 #define AGP_BASE                                0x0170
 #define AGP_CNTL                                0x0174