Skip to content

Commit 2bbcaa7

Browse files
zbalatonkraxel
authored andcommitted
ati-vga: Add dummy MEM_SDRAM_MODE_REG
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 <[email protected]> Message-id: cc1324b9ef06beb8ae233ddc77dedd8bab9b8624.1592737958.git.balaton@eik.bme.hu Signed-off-by: Gerd Hoffmann <[email protected]>
1 parent 41977c6 commit 2bbcaa7

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

hw/display/ati.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,11 @@ static uint64_t ati_mm_read(void *opaque, hwaddr addr, unsigned int size)
361361
case MC_STATUS:
362362
val = 5;
363363
break;
364+
case MEM_SDRAM_MODE_REG:
365+
if (s->dev_id != PCI_DEVICE_ID_ATI_RAGE128_PF) {
366+
val = BIT(28) | BIT(20);
367+
}
368+
break;
364369
case RBBM_STATUS:
365370
case GUI_STAT:
366371
val = 64; /* free CMDFIFO entries */

hw/display/ati_dbg.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ static struct ati_regdesc ati_reg_names[] = {
4242
{"MC_FB_LOCATION", 0x0148},
4343
{"MC_AGP_LOCATION", 0x014C},
4444
{"MC_STATUS", 0x0150},
45+
{"MEM_SDRAM_MODE_REG", 0x0158},
4546
{"MEM_POWER_MISC", 0x015c},
4647
{"AGP_BASE", 0x0170},
4748
{"AGP_CNTL", 0x0174},

hw/display/ati_regs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
#define MC_FB_LOCATION 0x0148
6161
#define MC_AGP_LOCATION 0x014C
6262
#define MC_STATUS 0x0150
63+
#define MEM_SDRAM_MODE_REG 0x0158
6364
#define MEM_POWER_MISC 0x015c
6465
#define AGP_BASE 0x0170
6566
#define AGP_CNTL 0x0174

0 commit comments

Comments
 (0)