summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/core/subdev/bios/init.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2012-12-19 21:48:51 (GMT)
committerBen Skeggs <bskeggs@redhat.com>2012-12-23 12:59:30 (GMT)
commit5ddf4d4a543dd3303b20d7e9a4b3549589c5f095 (patch)
treefb389fe146f844f6061670f651f20ff95613cb50 /drivers/gpu/drm/nouveau/core/subdev/bios/init.c
parent3d8ec277394ee0cf9fdd5a411017c3b4f1b0aff2 (diff)
downloadlinux-fsl-qoriq-5ddf4d4a543dd3303b20d7e9a4b3549589c5f095.tar.xz
drm/nouveau/bios: cache ramcfg strap on later chipsets
This fixes suspend/resume on at least Quadro 400. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/core/subdev/bios/init.c')
-rw-r--r--drivers/gpu/drm/nouveau/core/subdev/bios/init.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/core/subdev/bios/init.c b/drivers/gpu/drm/nouveau/core/subdev/bios/init.c
index 98f78cf..2917d55 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/bios/init.c
+++ b/drivers/gpu/drm/nouveau/core/subdev/bios/init.c
@@ -411,9 +411,25 @@ init_ram_restrict_group_count(struct nvbios_init *init)
}
static u8
+init_ram_restrict_strap(struct nvbios_init *init)
+{
+ /* This appears to be the behaviour of the VBIOS parser, and *is*
+ * important to cache the NV_PEXTDEV_BOOT0 on later chipsets to
+ * avoid fucking up the memory controller (somehow) by reading it
+ * on every INIT_RAM_RESTRICT_ZM_GROUP opcode.
+ *
+ * Preserving the non-caching behaviour on earlier chipsets just
+ * in case *not* re-reading the strap causes similar breakage.
+ */
+ if (!init->ramcfg || init->bios->version.major < 0x70)
+ init->ramcfg = init_rd32(init, 0x101000);
+ return (init->ramcfg & 0x00000003c) >> 2;
+}
+
+static u8
init_ram_restrict(struct nvbios_init *init)
{
- u32 strap = (init_rd32(init, 0x101000) & 0x0000003c) >> 2;
+ u8 strap = init_ram_restrict_strap(init);
u16 table = init_ram_restrict_table(init);
if (table)
return nv_ro08(init->bios, table + strap);