qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: qemu-ppc@nongnu.org, Gerd Hoffmann <kraxel@redhat.com>
Subject: [PULL 12/13] ati-vga: Add dummy MEM_SDRAM_MODE_REG
Date: Wed,  1 Jul 2020 17:04:24 +0200	[thread overview]
Message-ID: <20200701150425.13739-13-kraxel@redhat.com> (raw)
In-Reply-To: <20200701150425.13739-1-kraxel@redhat.com>

From: BALATON Zoltan <balaton@eik.bme.hu>

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_regs.h | 1 +
 hw/display/ati.c      | 5 +++++
 hw/display/ati_dbg.c  | 1 +
 3 files changed, 7 insertions(+)

diff --git a/hw/display/ati_regs.h b/hw/display/ati_regs.h
index ebd37ee30d3f..d6282b2ef210 100644
--- a/hw/display/ati_regs.h
+++ b/hw/display/ati_regs.h
@@ -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
diff --git a/hw/display/ati.c b/hw/display/ati.c
index 95fc443cac83..4c3ad8f47b0d 100644
--- a/hw/display/ati.c
+++ b/hw/display/ati.c
@@ -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 */
diff --git a/hw/display/ati_dbg.c b/hw/display/ati_dbg.c
index 0ebbd36f1477..bd0ecd48c7a7 100644
--- a/hw/display/ati_dbg.c
+++ b/hw/display/ati_dbg.c
@@ -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},
-- 
2.18.4



  parent reply	other threads:[~2020-07-01 15:13 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-01 15:04 [PULL 00/13] Vga 20200701 patches Gerd Hoffmann
2020-07-01 15:04 ` [PULL 01/13] sm501: Fix bounds checks Gerd Hoffmann
2020-07-01 15:04 ` [PULL 02/13] sm501: Drop unneded variable Gerd Hoffmann
2020-07-01 15:04 ` [PULL 03/13] sm501: Ignore no-op blits Gerd Hoffmann
2020-07-01 15:04 ` [PULL 04/13] sm501: Introduce variable for commonly used value for better readability Gerd Hoffmann
2020-07-01 15:04 ` [PULL 05/13] sm501: Optimise 1 pixel 2d ops Gerd Hoffmann
2020-07-01 15:04 ` [PULL 06/13] sm501: Use stn_he_p/ldn_he_p instead of switch/case Gerd Hoffmann
2020-07-01 15:04 ` [PULL 07/13] sm501: Do not allow guest to set invalid format Gerd Hoffmann
2020-07-01 15:04 ` [PULL 08/13] sm501: Convert debug printfs to traces Gerd Hoffmann
2020-07-01 15:04 ` [PULL 09/13] sm501: Fix and optimize overlap check Gerd Hoffmann
2020-07-01 15:04 ` [PULL 10/13] ati-vga: Support unaligned access to hardware cursor registers Gerd Hoffmann
2020-07-01 15:04 ` [PULL 11/13] ati-vga: Do not assert on error Gerd Hoffmann
2020-07-01 15:04 ` Gerd Hoffmann [this message]
2020-07-01 15:04 ` [PULL 13/13] configure: vgabios cleanups Gerd Hoffmann
2020-07-02 14:53 ` [PULL 00/13] Vga 20200701 patches Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200701150425.13739-13-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).