Commit 8ff86056 authored by Emil Velikov's avatar Emil Velikov Committed by Ben Skeggs

drm/nv50/gpio: post-nv92 cards have 32 interrupt lines

Since the original merge of nouveau to upstream kernel, we were assuming
that nv90 (and later) cards have 32 lines.

Based on mmio traces of the binary driver, as well as PBUS error messages
during read/write of the e070/e074 registers, we can conclude that nv92
has only 16 lines whereas nv94 (and later) cards have 32.
Reported-and-tested-by: default avatarDavid M. Lloyd <david.lloyd@redhat.com>
Signed-off-by: default avatarEmil Velikov <emil.l.velikov@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Cc: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent dedaa8f0
...@@ -103,7 +103,7 @@ nv50_gpio_intr(struct nouveau_subdev *subdev) ...@@ -103,7 +103,7 @@ nv50_gpio_intr(struct nouveau_subdev *subdev)
int i; int i;
intr0 = nv_rd32(priv, 0xe054) & nv_rd32(priv, 0xe050); intr0 = nv_rd32(priv, 0xe054) & nv_rd32(priv, 0xe050);
if (nv_device(priv)->chipset >= 0x90) if (nv_device(priv)->chipset > 0x92)
intr1 = nv_rd32(priv, 0xe074) & nv_rd32(priv, 0xe070); intr1 = nv_rd32(priv, 0xe074) & nv_rd32(priv, 0xe070);
hi = (intr0 & 0x0000ffff) | (intr1 << 16); hi = (intr0 & 0x0000ffff) | (intr1 << 16);
...@@ -115,7 +115,7 @@ nv50_gpio_intr(struct nouveau_subdev *subdev) ...@@ -115,7 +115,7 @@ nv50_gpio_intr(struct nouveau_subdev *subdev)
} }
nv_wr32(priv, 0xe054, intr0); nv_wr32(priv, 0xe054, intr0);
if (nv_device(priv)->chipset >= 0x90) if (nv_device(priv)->chipset > 0x92)
nv_wr32(priv, 0xe074, intr1); nv_wr32(priv, 0xe074, intr1);
} }
...@@ -146,7 +146,7 @@ nv50_gpio_ctor(struct nouveau_object *parent, struct nouveau_object *engine, ...@@ -146,7 +146,7 @@ nv50_gpio_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
int ret; int ret;
ret = nouveau_gpio_create(parent, engine, oclass, ret = nouveau_gpio_create(parent, engine, oclass,
nv_device(parent)->chipset >= 0x90 ? 32 : 16, nv_device(parent)->chipset > 0x92 ? 32 : 16,
&priv); &priv);
*pobject = nv_object(priv); *pobject = nv_object(priv);
if (ret) if (ret)
...@@ -182,7 +182,7 @@ nv50_gpio_init(struct nouveau_object *object) ...@@ -182,7 +182,7 @@ nv50_gpio_init(struct nouveau_object *object)
/* disable, and ack any pending gpio interrupts */ /* disable, and ack any pending gpio interrupts */
nv_wr32(priv, 0xe050, 0x00000000); nv_wr32(priv, 0xe050, 0x00000000);
nv_wr32(priv, 0xe054, 0xffffffff); nv_wr32(priv, 0xe054, 0xffffffff);
if (nv_device(priv)->chipset >= 0x90) { if (nv_device(priv)->chipset > 0x92) {
nv_wr32(priv, 0xe070, 0x00000000); nv_wr32(priv, 0xe070, 0x00000000);
nv_wr32(priv, 0xe074, 0xffffffff); nv_wr32(priv, 0xe074, 0xffffffff);
} }
...@@ -195,7 +195,7 @@ nv50_gpio_fini(struct nouveau_object *object, bool suspend) ...@@ -195,7 +195,7 @@ nv50_gpio_fini(struct nouveau_object *object, bool suspend)
{ {
struct nv50_gpio_priv *priv = (void *)object; struct nv50_gpio_priv *priv = (void *)object;
nv_wr32(priv, 0xe050, 0x00000000); nv_wr32(priv, 0xe050, 0x00000000);
if (nv_device(priv)->chipset >= 0x90) if (nv_device(priv)->chipset > 0x92)
nv_wr32(priv, 0xe070, 0x00000000); nv_wr32(priv, 0xe070, 0x00000000);
return nouveau_gpio_fini(&priv->base, suspend); return nouveau_gpio_fini(&priv->base, suspend);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment