Commit 26fbb4c8 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/privring: rename from ibus

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
parent 5ef25f06
...@@ -3,7 +3,7 @@ NVKM_LAYOUT_ONCE(NVKM_SUBDEV_PCI , struct nvkm_pci , pci) ...@@ -3,7 +3,7 @@ NVKM_LAYOUT_ONCE(NVKM_SUBDEV_PCI , struct nvkm_pci , pci)
NVKM_LAYOUT_ONCE(NVKM_SUBDEV_VBIOS , struct nvkm_bios , bios) NVKM_LAYOUT_ONCE(NVKM_SUBDEV_VBIOS , struct nvkm_bios , bios)
NVKM_LAYOUT_ONCE(NVKM_SUBDEV_DEVINIT , struct nvkm_devinit , devinit) NVKM_LAYOUT_ONCE(NVKM_SUBDEV_DEVINIT , struct nvkm_devinit , devinit)
NVKM_LAYOUT_ONCE(NVKM_SUBDEV_TOP , struct nvkm_top , top) NVKM_LAYOUT_ONCE(NVKM_SUBDEV_TOP , struct nvkm_top , top)
NVKM_LAYOUT_ONCE(NVKM_SUBDEV_IBUS , struct nvkm_subdev , ibus) NVKM_LAYOUT_ONCE(NVKM_SUBDEV_PRIVRING, struct nvkm_subdev , privring)
NVKM_LAYOUT_ONCE(NVKM_SUBDEV_GPIO , struct nvkm_gpio , gpio) NVKM_LAYOUT_ONCE(NVKM_SUBDEV_GPIO , struct nvkm_gpio , gpio)
NVKM_LAYOUT_ONCE(NVKM_SUBDEV_I2C , struct nvkm_i2c , i2c) NVKM_LAYOUT_ONCE(NVKM_SUBDEV_I2C , struct nvkm_i2c , i2c)
NVKM_LAYOUT_ONCE(NVKM_SUBDEV_FUSE , struct nvkm_fuse , fuse) NVKM_LAYOUT_ONCE(NVKM_SUBDEV_FUSE , struct nvkm_fuse , fuse)
......
/* SPDX-License-Identifier: MIT */
#ifndef __NVKM_IBUS_H__
#define __NVKM_IBUS_H__
#include <core/subdev.h>
int gf100_ibus_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_subdev **);
int gf117_ibus_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_subdev **);
int gk104_ibus_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_subdev **);
int gk20a_ibus_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_subdev **);
int gm200_ibus_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_subdev **);
int gp10b_ibus_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_subdev **);
#endif
/* SPDX-License-Identifier: MIT */
#ifndef __NVKM_PRIVRING_H__
#define __NVKM_PRIVRING_H__
#include <core/subdev.h>
int gf100_privring_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_subdev **);
int gf117_privring_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_subdev **);
int gk104_privring_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_subdev **);
int gk20a_privring_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_subdev **);
int gm200_privring_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_subdev **);
int gp10b_privring_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_subdev **);
#endif
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include <subdev/gpio.h> #include <subdev/gpio.h>
#include <subdev/gsp.h> #include <subdev/gsp.h>
#include <subdev/i2c.h> #include <subdev/i2c.h>
#include <subdev/ibus.h>
#include <subdev/iccsense.h> #include <subdev/iccsense.h>
#include <subdev/instmem.h> #include <subdev/instmem.h>
#include <subdev/ltc.h> #include <subdev/ltc.h>
...@@ -24,6 +23,7 @@ ...@@ -24,6 +23,7 @@
#include <subdev/mxm.h> #include <subdev/mxm.h>
#include <subdev/pci.h> #include <subdev/pci.h>
#include <subdev/pmu.h> #include <subdev/pmu.h>
#include <subdev/privring.h>
#include <subdev/therm.h> #include <subdev/therm.h>
#include <subdev/timer.h> #include <subdev/timer.h>
#include <subdev/top.h> #include <subdev/top.h>
......
...@@ -11,7 +11,6 @@ include $(src)/nvkm/subdev/fuse/Kbuild ...@@ -11,7 +11,6 @@ include $(src)/nvkm/subdev/fuse/Kbuild
include $(src)/nvkm/subdev/gpio/Kbuild include $(src)/nvkm/subdev/gpio/Kbuild
include $(src)/nvkm/subdev/gsp/Kbuild include $(src)/nvkm/subdev/gsp/Kbuild
include $(src)/nvkm/subdev/i2c/Kbuild include $(src)/nvkm/subdev/i2c/Kbuild
include $(src)/nvkm/subdev/ibus/Kbuild
include $(src)/nvkm/subdev/iccsense/Kbuild include $(src)/nvkm/subdev/iccsense/Kbuild
include $(src)/nvkm/subdev/instmem/Kbuild include $(src)/nvkm/subdev/instmem/Kbuild
include $(src)/nvkm/subdev/ltc/Kbuild include $(src)/nvkm/subdev/ltc/Kbuild
...@@ -20,6 +19,7 @@ include $(src)/nvkm/subdev/mmu/Kbuild ...@@ -20,6 +19,7 @@ include $(src)/nvkm/subdev/mmu/Kbuild
include $(src)/nvkm/subdev/mxm/Kbuild include $(src)/nvkm/subdev/mxm/Kbuild
include $(src)/nvkm/subdev/pci/Kbuild include $(src)/nvkm/subdev/pci/Kbuild
include $(src)/nvkm/subdev/pmu/Kbuild include $(src)/nvkm/subdev/pmu/Kbuild
include $(src)/nvkm/subdev/privring/Kbuild
include $(src)/nvkm/subdev/therm/Kbuild include $(src)/nvkm/subdev/therm/Kbuild
include $(src)/nvkm/subdev/timer/Kbuild include $(src)/nvkm/subdev/timer/Kbuild
include $(src)/nvkm/subdev/top/Kbuild include $(src)/nvkm/subdev/top/Kbuild
......
...@@ -40,7 +40,7 @@ gf100_bus_intr(struct nvkm_bus *bus) ...@@ -40,7 +40,7 @@ gf100_bus_intr(struct nvkm_bus *bus)
(addr & 0x00000002) ? "write" : "read", data, (addr & 0x00000002) ? "write" : "read", data,
(addr & 0x00fffffc), (addr & 0x00fffffc),
(stat & 0x00000002) ? "!ENGINE " : "", (stat & 0x00000002) ? "!ENGINE " : "",
(stat & 0x00000004) ? "IBUS " : "", (stat & 0x00000004) ? "PRIVRING " : "",
(stat & 0x00000008) ? "TIMEOUT " : ""); (stat & 0x00000008) ? "TIMEOUT " : "");
nvkm_wr32(device, 0x009084, 0x00000000); nvkm_wr32(device, 0x009084, 0x00000000);
......
# SPDX-License-Identifier: MIT
nvkm-y += nvkm/subdev/ibus/gf100.o
nvkm-y += nvkm/subdev/ibus/gf117.o
nvkm-y += nvkm/subdev/ibus/gk104.o
nvkm-y += nvkm/subdev/ibus/gk20a.o
nvkm-y += nvkm/subdev/ibus/gm200.o
nvkm-y += nvkm/subdev/ibus/gp10b.o
/* SPDX-License-Identifier: MIT */
#ifndef __NVKM_IBUS_PRIV_H__
#define __NVKM_IBUS_PRIV_H__
#include <subdev/ibus.h>
void gf100_ibus_intr(struct nvkm_subdev *);
void gk104_ibus_intr(struct nvkm_subdev *);
#endif
...@@ -46,7 +46,7 @@ gf100_mc_intr[] = { ...@@ -46,7 +46,7 @@ gf100_mc_intr[] = {
{ 0x00000040, NVKM_ENGINE_CE, 1 }, { 0x00000040, NVKM_ENGINE_CE, 1 },
{ 0x00000020, NVKM_ENGINE_CE, 0 }, { 0x00000020, NVKM_ENGINE_CE, 0 },
{ 0x00000001, NVKM_ENGINE_MSPPP }, { 0x00000001, NVKM_ENGINE_MSPPP },
{ 0x40000000, NVKM_SUBDEV_IBUS }, { 0x40000000, NVKM_SUBDEV_PRIVRING },
{ 0x10000000, NVKM_SUBDEV_BUS }, { 0x10000000, NVKM_SUBDEV_BUS },
{ 0x08000000, NVKM_SUBDEV_FB }, { 0x08000000, NVKM_SUBDEV_FB },
{ 0x02000000, NVKM_SUBDEV_LTC }, { 0x02000000, NVKM_SUBDEV_LTC },
......
...@@ -34,7 +34,7 @@ const struct nvkm_mc_map ...@@ -34,7 +34,7 @@ const struct nvkm_mc_map
gk104_mc_intr[] = { gk104_mc_intr[] = {
{ 0x04000000, NVKM_ENGINE_DISP }, { 0x04000000, NVKM_ENGINE_DISP },
{ 0x00000100, NVKM_ENGINE_FIFO }, { 0x00000100, NVKM_ENGINE_FIFO },
{ 0x40000000, NVKM_SUBDEV_IBUS }, { 0x40000000, NVKM_SUBDEV_PRIVRING },
{ 0x10000000, NVKM_SUBDEV_BUS }, { 0x10000000, NVKM_SUBDEV_BUS },
{ 0x08000000, NVKM_SUBDEV_FB }, { 0x08000000, NVKM_SUBDEV_FB },
{ 0x02000000, NVKM_SUBDEV_LTC }, { 0x02000000, NVKM_SUBDEV_LTC },
......
...@@ -80,7 +80,7 @@ gp100_mc_intr[] = { ...@@ -80,7 +80,7 @@ gp100_mc_intr[] = {
{ 0x04000000, NVKM_ENGINE_DISP }, { 0x04000000, NVKM_ENGINE_DISP },
{ 0x00000100, NVKM_ENGINE_FIFO }, { 0x00000100, NVKM_ENGINE_FIFO },
{ 0x00000200, NVKM_SUBDEV_FAULT }, { 0x00000200, NVKM_SUBDEV_FAULT },
{ 0x40000000, NVKM_SUBDEV_IBUS }, { 0x40000000, NVKM_SUBDEV_PRIVRING },
{ 0x10000000, NVKM_SUBDEV_BUS }, { 0x10000000, NVKM_SUBDEV_BUS },
{ 0x08000000, NVKM_SUBDEV_FB }, { 0x08000000, NVKM_SUBDEV_FB },
{ 0x02000000, NVKM_SUBDEV_LTC }, { 0x02000000, NVKM_SUBDEV_LTC },
......
# SPDX-License-Identifier: MIT
nvkm-y += nvkm/subdev/privring/gf100.o
nvkm-y += nvkm/subdev/privring/gf117.o
nvkm-y += nvkm/subdev/privring/gk104.o
nvkm-y += nvkm/subdev/privring/gk20a.o
nvkm-y += nvkm/subdev/privring/gm200.o
nvkm-y += nvkm/subdev/privring/gp10b.o
...@@ -25,39 +25,39 @@ ...@@ -25,39 +25,39 @@
#include <subdev/timer.h> #include <subdev/timer.h>
static void static void
gf100_ibus_intr_hub(struct nvkm_subdev *ibus, int i) gf100_privring_intr_hub(struct nvkm_subdev *privring, int i)
{ {
struct nvkm_device *device = ibus->device; struct nvkm_device *device = privring->device;
u32 addr = nvkm_rd32(device, 0x122120 + (i * 0x0400)); u32 addr = nvkm_rd32(device, 0x122120 + (i * 0x0400));
u32 data = nvkm_rd32(device, 0x122124 + (i * 0x0400)); u32 data = nvkm_rd32(device, 0x122124 + (i * 0x0400));
u32 stat = nvkm_rd32(device, 0x122128 + (i * 0x0400)); u32 stat = nvkm_rd32(device, 0x122128 + (i * 0x0400));
nvkm_debug(ibus, "HUB%d: %06x %08x (%08x)\n", i, addr, data, stat); nvkm_debug(privring, "HUB%d: %06x %08x (%08x)\n", i, addr, data, stat);
} }
static void static void
gf100_ibus_intr_rop(struct nvkm_subdev *ibus, int i) gf100_privring_intr_rop(struct nvkm_subdev *privring, int i)
{ {
struct nvkm_device *device = ibus->device; struct nvkm_device *device = privring->device;
u32 addr = nvkm_rd32(device, 0x124120 + (i * 0x0400)); u32 addr = nvkm_rd32(device, 0x124120 + (i * 0x0400));
u32 data = nvkm_rd32(device, 0x124124 + (i * 0x0400)); u32 data = nvkm_rd32(device, 0x124124 + (i * 0x0400));
u32 stat = nvkm_rd32(device, 0x124128 + (i * 0x0400)); u32 stat = nvkm_rd32(device, 0x124128 + (i * 0x0400));
nvkm_debug(ibus, "ROP%d: %06x %08x (%08x)\n", i, addr, data, stat); nvkm_debug(privring, "ROP%d: %06x %08x (%08x)\n", i, addr, data, stat);
} }
static void static void
gf100_ibus_intr_gpc(struct nvkm_subdev *ibus, int i) gf100_privring_intr_gpc(struct nvkm_subdev *privring, int i)
{ {
struct nvkm_device *device = ibus->device; struct nvkm_device *device = privring->device;
u32 addr = nvkm_rd32(device, 0x128120 + (i * 0x0400)); u32 addr = nvkm_rd32(device, 0x128120 + (i * 0x0400));
u32 data = nvkm_rd32(device, 0x128124 + (i * 0x0400)); u32 data = nvkm_rd32(device, 0x128124 + (i * 0x0400));
u32 stat = nvkm_rd32(device, 0x128128 + (i * 0x0400)); u32 stat = nvkm_rd32(device, 0x128128 + (i * 0x0400));
nvkm_debug(ibus, "GPC%d: %06x %08x (%08x)\n", i, addr, data, stat); nvkm_debug(privring, "GPC%d: %06x %08x (%08x)\n", i, addr, data, stat);
} }
void void
gf100_ibus_intr(struct nvkm_subdev *ibus) gf100_privring_intr(struct nvkm_subdev *privring)
{ {
struct nvkm_device *device = ibus->device; struct nvkm_device *device = privring->device;
u32 intr0 = nvkm_rd32(device, 0x121c58); u32 intr0 = nvkm_rd32(device, 0x121c58);
u32 intr1 = nvkm_rd32(device, 0x121c5c); u32 intr1 = nvkm_rd32(device, 0x121c5c);
u32 hubnr = nvkm_rd32(device, 0x121c70); u32 hubnr = nvkm_rd32(device, 0x121c70);
...@@ -68,7 +68,7 @@ gf100_ibus_intr(struct nvkm_subdev *ibus) ...@@ -68,7 +68,7 @@ gf100_ibus_intr(struct nvkm_subdev *ibus)
for (i = 0; (intr0 & 0x0000ff00) && i < hubnr; i++) { for (i = 0; (intr0 & 0x0000ff00) && i < hubnr; i++) {
u32 stat = 0x00000100 << i; u32 stat = 0x00000100 << i;
if (intr0 & stat) { if (intr0 & stat) {
gf100_ibus_intr_hub(ibus, i); gf100_privring_intr_hub(privring, i);
intr0 &= ~stat; intr0 &= ~stat;
} }
} }
...@@ -76,7 +76,7 @@ gf100_ibus_intr(struct nvkm_subdev *ibus) ...@@ -76,7 +76,7 @@ gf100_ibus_intr(struct nvkm_subdev *ibus)
for (i = 0; (intr0 & 0xffff0000) && i < ropnr; i++) { for (i = 0; (intr0 & 0xffff0000) && i < ropnr; i++) {
u32 stat = 0x00010000 << i; u32 stat = 0x00010000 << i;
if (intr0 & stat) { if (intr0 & stat) {
gf100_ibus_intr_rop(ibus, i); gf100_privring_intr_rop(privring, i);
intr0 &= ~stat; intr0 &= ~stat;
} }
} }
...@@ -84,7 +84,7 @@ gf100_ibus_intr(struct nvkm_subdev *ibus) ...@@ -84,7 +84,7 @@ gf100_ibus_intr(struct nvkm_subdev *ibus)
for (i = 0; intr1 && i < gpcnr; i++) { for (i = 0; intr1 && i < gpcnr; i++) {
u32 stat = 0x00000001 << i; u32 stat = 0x00000001 << i;
if (intr1 & stat) { if (intr1 & stat) {
gf100_ibus_intr_gpc(ibus, i); gf100_privring_intr_gpc(privring, i);
intr1 &= ~stat; intr1 &= ~stat;
} }
} }
...@@ -97,9 +97,9 @@ gf100_ibus_intr(struct nvkm_subdev *ibus) ...@@ -97,9 +97,9 @@ gf100_ibus_intr(struct nvkm_subdev *ibus)
} }
static int static int
gf100_ibus_init(struct nvkm_subdev *ibus) gf100_privring_init(struct nvkm_subdev *privring)
{ {
struct nvkm_device *device = ibus->device; struct nvkm_device *device = privring->device;
nvkm_mask(device, 0x122310, 0x0003ffff, 0x00000800); nvkm_mask(device, 0x122310, 0x0003ffff, 0x00000800);
nvkm_wr32(device, 0x12232c, 0x00100064); nvkm_wr32(device, 0x12232c, 0x00100064);
nvkm_wr32(device, 0x122330, 0x00100064); nvkm_wr32(device, 0x122330, 0x00100064);
...@@ -109,14 +109,14 @@ gf100_ibus_init(struct nvkm_subdev *ibus) ...@@ -109,14 +109,14 @@ gf100_ibus_init(struct nvkm_subdev *ibus)
} }
static const struct nvkm_subdev_func static const struct nvkm_subdev_func
gf100_ibus = { gf100_privring = {
.init = gf100_ibus_init, .init = gf100_privring_init,
.intr = gf100_ibus_intr, .intr = gf100_privring_intr,
}; };
int int
gf100_ibus_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, gf100_privring_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
struct nvkm_subdev **pibus) struct nvkm_subdev **pprivring)
{ {
return nvkm_subdev_new_(&gf100_ibus, device, type, inst, pibus); return nvkm_subdev_new_(&gf100_privring, device, type, inst, pprivring);
} }
...@@ -24,9 +24,9 @@ ...@@ -24,9 +24,9 @@
#include "priv.h" #include "priv.h"
static int static int
gf117_ibus_init(struct nvkm_subdev *ibus) gf117_privring_init(struct nvkm_subdev *privring)
{ {
struct nvkm_device *device = ibus->device; struct nvkm_device *device = privring->device;
nvkm_mask(device, 0x122310, 0x0003ffff, 0x00000800); nvkm_mask(device, 0x122310, 0x0003ffff, 0x00000800);
nvkm_mask(device, 0x122348, 0x0003ffff, 0x00000100); nvkm_mask(device, 0x122348, 0x0003ffff, 0x00000100);
nvkm_mask(device, 0x1223b0, 0x0003ffff, 0x00000fff); nvkm_mask(device, 0x1223b0, 0x0003ffff, 0x00000fff);
...@@ -34,14 +34,14 @@ gf117_ibus_init(struct nvkm_subdev *ibus) ...@@ -34,14 +34,14 @@ gf117_ibus_init(struct nvkm_subdev *ibus)
} }
static const struct nvkm_subdev_func static const struct nvkm_subdev_func
gf117_ibus = { gf117_privring = {
.init = gf117_ibus_init, .init = gf117_privring_init,
.intr = gf100_ibus_intr, .intr = gf100_privring_intr,
}; };
int int
gf117_ibus_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, gf117_privring_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
struct nvkm_subdev **pibus) struct nvkm_subdev **pprivring)
{ {
return nvkm_subdev_new_(&gf117_ibus, device, type, inst, pibus); return nvkm_subdev_new_(&gf117_privring, device, type, inst, pprivring);
} }
...@@ -25,39 +25,39 @@ ...@@ -25,39 +25,39 @@
#include <subdev/timer.h> #include <subdev/timer.h>
static void static void
gk104_ibus_intr_hub(struct nvkm_subdev *ibus, int i) gk104_privring_intr_hub(struct nvkm_subdev *privring, int i)
{ {
struct nvkm_device *device = ibus->device; struct nvkm_device *device = privring->device;
u32 addr = nvkm_rd32(device, 0x122120 + (i * 0x0800)); u32 addr = nvkm_rd32(device, 0x122120 + (i * 0x0800));
u32 data = nvkm_rd32(device, 0x122124 + (i * 0x0800)); u32 data = nvkm_rd32(device, 0x122124 + (i * 0x0800));
u32 stat = nvkm_rd32(device, 0x122128 + (i * 0x0800)); u32 stat = nvkm_rd32(device, 0x122128 + (i * 0x0800));
nvkm_debug(ibus, "HUB%d: %06x %08x (%08x)\n", i, addr, data, stat); nvkm_debug(privring, "HUB%d: %06x %08x (%08x)\n", i, addr, data, stat);
} }
static void static void
gk104_ibus_intr_rop(struct nvkm_subdev *ibus, int i) gk104_privring_intr_rop(struct nvkm_subdev *privring, int i)
{ {
struct nvkm_device *device = ibus->device; struct nvkm_device *device = privring->device;
u32 addr = nvkm_rd32(device, 0x124120 + (i * 0x0800)); u32 addr = nvkm_rd32(device, 0x124120 + (i * 0x0800));
u32 data = nvkm_rd32(device, 0x124124 + (i * 0x0800)); u32 data = nvkm_rd32(device, 0x124124 + (i * 0x0800));
u32 stat = nvkm_rd32(device, 0x124128 + (i * 0x0800)); u32 stat = nvkm_rd32(device, 0x124128 + (i * 0x0800));
nvkm_debug(ibus, "ROP%d: %06x %08x (%08x)\n", i, addr, data, stat); nvkm_debug(privring, "ROP%d: %06x %08x (%08x)\n", i, addr, data, stat);
} }
static void static void
gk104_ibus_intr_gpc(struct nvkm_subdev *ibus, int i) gk104_privring_intr_gpc(struct nvkm_subdev *privring, int i)
{ {
struct nvkm_device *device = ibus->device; struct nvkm_device *device = privring->device;
u32 addr = nvkm_rd32(device, 0x128120 + (i * 0x0800)); u32 addr = nvkm_rd32(device, 0x128120 + (i * 0x0800));
u32 data = nvkm_rd32(device, 0x128124 + (i * 0x0800)); u32 data = nvkm_rd32(device, 0x128124 + (i * 0x0800));
u32 stat = nvkm_rd32(device, 0x128128 + (i * 0x0800)); u32 stat = nvkm_rd32(device, 0x128128 + (i * 0x0800));
nvkm_debug(ibus, "GPC%d: %06x %08x (%08x)\n", i, addr, data, stat); nvkm_debug(privring, "GPC%d: %06x %08x (%08x)\n", i, addr, data, stat);
} }
void void
gk104_ibus_intr(struct nvkm_subdev *ibus) gk104_privring_intr(struct nvkm_subdev *privring)
{ {
struct nvkm_device *device = ibus->device; struct nvkm_device *device = privring->device;
u32 intr0 = nvkm_rd32(device, 0x120058); u32 intr0 = nvkm_rd32(device, 0x120058);
u32 intr1 = nvkm_rd32(device, 0x12005c); u32 intr1 = nvkm_rd32(device, 0x12005c);
u32 hubnr = nvkm_rd32(device, 0x120070); u32 hubnr = nvkm_rd32(device, 0x120070);
...@@ -68,7 +68,7 @@ gk104_ibus_intr(struct nvkm_subdev *ibus) ...@@ -68,7 +68,7 @@ gk104_ibus_intr(struct nvkm_subdev *ibus)
for (i = 0; (intr0 & 0x0000ff00) && i < hubnr; i++) { for (i = 0; (intr0 & 0x0000ff00) && i < hubnr; i++) {
u32 stat = 0x00000100 << i; u32 stat = 0x00000100 << i;
if (intr0 & stat) { if (intr0 & stat) {
gk104_ibus_intr_hub(ibus, i); gk104_privring_intr_hub(privring, i);
intr0 &= ~stat; intr0 &= ~stat;
} }
} }
...@@ -76,7 +76,7 @@ gk104_ibus_intr(struct nvkm_subdev *ibus) ...@@ -76,7 +76,7 @@ gk104_ibus_intr(struct nvkm_subdev *ibus)
for (i = 0; (intr0 & 0xffff0000) && i < ropnr; i++) { for (i = 0; (intr0 & 0xffff0000) && i < ropnr; i++) {
u32 stat = 0x00010000 << i; u32 stat = 0x00010000 << i;
if (intr0 & stat) { if (intr0 & stat) {
gk104_ibus_intr_rop(ibus, i); gk104_privring_intr_rop(privring, i);
intr0 &= ~stat; intr0 &= ~stat;
} }
} }
...@@ -84,7 +84,7 @@ gk104_ibus_intr(struct nvkm_subdev *ibus) ...@@ -84,7 +84,7 @@ gk104_ibus_intr(struct nvkm_subdev *ibus)
for (i = 0; intr1 && i < gpcnr; i++) { for (i = 0; intr1 && i < gpcnr; i++) {
u32 stat = 0x00000001 << i; u32 stat = 0x00000001 << i;
if (intr1 & stat) { if (intr1 & stat) {
gk104_ibus_intr_gpc(ibus, i); gk104_privring_intr_gpc(privring, i);
intr1 &= ~stat; intr1 &= ~stat;
} }
} }
...@@ -97,9 +97,9 @@ gk104_ibus_intr(struct nvkm_subdev *ibus) ...@@ -97,9 +97,9 @@ gk104_ibus_intr(struct nvkm_subdev *ibus)
} }
static int static int
gk104_ibus_init(struct nvkm_subdev *ibus) gk104_privring_init(struct nvkm_subdev *privring)
{ {
struct nvkm_device *device = ibus->device; struct nvkm_device *device = privring->device;
nvkm_mask(device, 0x122318, 0x0003ffff, 0x00001000); nvkm_mask(device, 0x122318, 0x0003ffff, 0x00001000);
nvkm_mask(device, 0x12231c, 0x0003ffff, 0x00000200); nvkm_mask(device, 0x12231c, 0x0003ffff, 0x00000200);
nvkm_mask(device, 0x122310, 0x0003ffff, 0x00000800); nvkm_mask(device, 0x122310, 0x0003ffff, 0x00000800);
...@@ -111,15 +111,15 @@ gk104_ibus_init(struct nvkm_subdev *ibus) ...@@ -111,15 +111,15 @@ gk104_ibus_init(struct nvkm_subdev *ibus)
} }
static const struct nvkm_subdev_func static const struct nvkm_subdev_func
gk104_ibus = { gk104_privring = {
.preinit = gk104_ibus_init, .preinit = gk104_privring_init,
.init = gk104_ibus_init, .init = gk104_privring_init,
.intr = gk104_ibus_intr, .intr = gk104_privring_intr,
}; };
int int
gk104_ibus_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, gk104_privring_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
struct nvkm_subdev **pibus) struct nvkm_subdev **pprivring)
{ {
return nvkm_subdev_new_(&gk104_ibus, device, type, inst, pibus); return nvkm_subdev_new_(&gk104_privring, device, type, inst, pprivring);
} }
...@@ -19,13 +19,13 @@ ...@@ -19,13 +19,13 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE. * DEALINGS IN THE SOFTWARE.
*/ */
#include <subdev/ibus.h> #include <subdev/privring.h>
#include <subdev/timer.h> #include <subdev/timer.h>
static void static void
gk20a_ibus_init_ibus_ring(struct nvkm_subdev *ibus) gk20a_privring_init_privring_ring(struct nvkm_subdev *privring)
{ {
struct nvkm_device *device = ibus->device; struct nvkm_device *device = privring->device;
nvkm_mask(device, 0x137250, 0x3f, 0); nvkm_mask(device, 0x137250, 0x3f, 0);
nvkm_mask(device, 0x000200, 0x20, 0); nvkm_mask(device, 0x000200, 0x20, 0);
...@@ -46,14 +46,14 @@ gk20a_ibus_init_ibus_ring(struct nvkm_subdev *ibus) ...@@ -46,14 +46,14 @@ gk20a_ibus_init_ibus_ring(struct nvkm_subdev *ibus)
} }
static void static void
gk20a_ibus_intr(struct nvkm_subdev *ibus) gk20a_privring_intr(struct nvkm_subdev *privring)
{ {
struct nvkm_device *device = ibus->device; struct nvkm_device *device = privring->device;
u32 status0 = nvkm_rd32(device, 0x120058); u32 status0 = nvkm_rd32(device, 0x120058);
if (status0 & 0x7) { if (status0 & 0x7) {
nvkm_debug(ibus, "resetting ibus ring\n"); nvkm_debug(privring, "resetting privring ring\n");
gk20a_ibus_init_ibus_ring(ibus); gk20a_privring_init_privring_ring(privring);
} }
/* Acknowledge interrupt */ /* Acknowledge interrupt */
...@@ -65,21 +65,21 @@ gk20a_ibus_intr(struct nvkm_subdev *ibus) ...@@ -65,21 +65,21 @@ gk20a_ibus_intr(struct nvkm_subdev *ibus)
} }
static int static int
gk20a_ibus_init(struct nvkm_subdev *ibus) gk20a_privring_init(struct nvkm_subdev *privring)
{ {
gk20a_ibus_init_ibus_ring(ibus); gk20a_privring_init_privring_ring(privring);
return 0; return 0;
} }
static const struct nvkm_subdev_func static const struct nvkm_subdev_func
gk20a_ibus = { gk20a_privring = {
.init = gk20a_ibus_init, .init = gk20a_privring_init,
.intr = gk20a_ibus_intr, .intr = gk20a_privring_intr,
}; };
int int
gk20a_ibus_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, gk20a_privring_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
struct nvkm_subdev **pibus) struct nvkm_subdev **pprivring)
{ {
return nvkm_subdev_new_(&gk20a_ibus, device, type, inst, pibus); return nvkm_subdev_new_(&gk20a_privring, device, type, inst, pprivring);
} }
...@@ -24,13 +24,13 @@ ...@@ -24,13 +24,13 @@
#include "priv.h" #include "priv.h"
static const struct nvkm_subdev_func static const struct nvkm_subdev_func
gm200_ibus = { gm200_privring = {
.intr = gk104_ibus_intr, .intr = gk104_privring_intr,
}; };
int int
gm200_ibus_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, gm200_privring_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
struct nvkm_subdev **pibus) struct nvkm_subdev **pprivring)
{ {
return nvkm_subdev_new_(&gm200_ibus, device, type, inst, pibus); return nvkm_subdev_new_(&gm200_privring, device, type, inst, pprivring);
} }
...@@ -19,14 +19,14 @@ ...@@ -19,14 +19,14 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE. * DEALINGS IN THE SOFTWARE.
*/ */
#include <subdev/ibus.h> #include <subdev/privring.h>
#include "priv.h" #include "priv.h"
static int static int
gp10b_ibus_init(struct nvkm_subdev *ibus) gp10b_privring_init(struct nvkm_subdev *privring)
{ {
struct nvkm_device *device = ibus->device; struct nvkm_device *device = privring->device;
nvkm_wr32(device, 0x1200a8, 0x0); nvkm_wr32(device, 0x1200a8, 0x0);
...@@ -42,14 +42,14 @@ gp10b_ibus_init(struct nvkm_subdev *ibus) ...@@ -42,14 +42,14 @@ gp10b_ibus_init(struct nvkm_subdev *ibus)
} }
static const struct nvkm_subdev_func static const struct nvkm_subdev_func
gp10b_ibus = { gp10b_privring = {
.init = gp10b_ibus_init, .init = gp10b_privring_init,
.intr = gk104_ibus_intr, .intr = gk104_privring_intr,
}; };
int int
gp10b_ibus_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, gp10b_privring_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
struct nvkm_subdev **pibus) struct nvkm_subdev **pprivring)
{ {
return nvkm_subdev_new_(&gp10b_ibus, device, type, inst, pibus); return nvkm_subdev_new_(&gp10b_privring, device, type, inst, pprivring);
} }
/* SPDX-License-Identifier: MIT */
#ifndef __NVKM_PRIVRING_PRIV_H__
#define __NVKM_PRIVRING_PRIV_H__
#include <subdev/privring.h>
void gf100_privring_intr(struct nvkm_subdev *);
void gk104_privring_intr(struct nvkm_subdev *);
#endif
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