Commit 151abd44 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/devinit: convert to new-style nvkm_subdev

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 6625f55c
#ifndef __NVBIOS_INIT_H__ #ifndef __NVBIOS_INIT_H__
#define __NVBIOS_INIT_H__ #define __NVBIOS_INIT_H__
struct nvbios_init { struct nvbios_init {
struct nvkm_subdev *subdev; struct nvkm_subdev *subdev;
struct nvkm_bios *bios; struct nvkm_bios *bios;
......
#ifndef __NVKM_DEVINIT_H__ #ifndef __NVKM_DEVINIT_H__
#define __NVKM_DEVINIT_H__ #define __NVKM_DEVINIT_H__
#include <core/subdev.h> #include <core/subdev.h>
struct nvkm_devinit;
struct nvkm_devinit { struct nvkm_devinit {
const struct nvkm_devinit_func *func;
struct nvkm_subdev subdev; struct nvkm_subdev subdev;
bool post; bool post;
void (*meminit)(struct nvkm_devinit *);
int (*pll_set)(struct nvkm_devinit *, u32 type, u32 freq);
u32 (*mmio)(struct nvkm_devinit *, u32 addr);
}; };
static inline struct nvkm_devinit * u32 nvkm_devinit_mmio(struct nvkm_devinit *, u32 addr);
nvkm_devinit(void *obj) int nvkm_devinit_pll_set(struct nvkm_devinit *, u32 type, u32 khz);
{ void nvkm_devinit_meminit(struct nvkm_devinit *);
return (void *)nvkm_subdev(obj, NVDEV_SUBDEV_DEVINIT); u64 nvkm_devinit_disable(struct nvkm_devinit *);
}
extern struct nvkm_oclass *nv04_devinit_oclass; int nv04_devinit_new(struct nvkm_device *, int, struct nvkm_devinit **);
extern struct nvkm_oclass *nv05_devinit_oclass; int nv05_devinit_new(struct nvkm_device *, int, struct nvkm_devinit **);
extern struct nvkm_oclass *nv10_devinit_oclass; int nv10_devinit_new(struct nvkm_device *, int, struct nvkm_devinit **);
extern struct nvkm_oclass *nv1a_devinit_oclass; int nv1a_devinit_new(struct nvkm_device *, int, struct nvkm_devinit **);
extern struct nvkm_oclass *nv20_devinit_oclass; int nv20_devinit_new(struct nvkm_device *, int, struct nvkm_devinit **);
extern struct nvkm_oclass *nv50_devinit_oclass; int nv50_devinit_new(struct nvkm_device *, int, struct nvkm_devinit **);
extern struct nvkm_oclass *g84_devinit_oclass; int g84_devinit_new(struct nvkm_device *, int, struct nvkm_devinit **);
extern struct nvkm_oclass *g98_devinit_oclass; int g98_devinit_new(struct nvkm_device *, int, struct nvkm_devinit **);
extern struct nvkm_oclass *gt215_devinit_oclass; int gt215_devinit_new(struct nvkm_device *, int, struct nvkm_devinit **);
extern struct nvkm_oclass *mcp89_devinit_oclass; int mcp89_devinit_new(struct nvkm_device *, int, struct nvkm_devinit **);
extern struct nvkm_oclass *gf100_devinit_oclass; int gf100_devinit_new(struct nvkm_device *, int, struct nvkm_devinit **);
extern struct nvkm_oclass *gm107_devinit_oclass; int gm107_devinit_new(struct nvkm_device *, int, struct nvkm_devinit **);
extern struct nvkm_oclass *gm204_devinit_oclass; int gm204_devinit_new(struct nvkm_device *, int, struct nvkm_devinit **);
#endif #endif
...@@ -33,7 +33,6 @@ gf100_identify(struct nvkm_device *device) ...@@ -33,7 +33,6 @@ gf100_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &gt215_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &gt215_therm_oclass;
device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = gf100_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = gf100_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = gf100_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = gf100_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = gf100_fb_oclass;
...@@ -61,7 +60,6 @@ gf100_identify(struct nvkm_device *device) ...@@ -61,7 +60,6 @@ gf100_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &gt215_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &gt215_therm_oclass;
device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = gf100_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = gf100_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = gf100_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = gf100_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = gf100_fb_oclass;
...@@ -89,7 +87,6 @@ gf100_identify(struct nvkm_device *device) ...@@ -89,7 +87,6 @@ gf100_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &gt215_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &gt215_therm_oclass;
device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = gf100_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = gf106_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = gf106_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = gf100_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = gf100_fb_oclass;
...@@ -116,7 +113,6 @@ gf100_identify(struct nvkm_device *device) ...@@ -116,7 +113,6 @@ gf100_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &gt215_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &gt215_therm_oclass;
device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = gf100_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = gf100_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = gf100_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = gf100_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = gf100_fb_oclass;
...@@ -144,7 +140,6 @@ gf100_identify(struct nvkm_device *device) ...@@ -144,7 +140,6 @@ gf100_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &gt215_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &gt215_therm_oclass;
device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = gf100_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = gf106_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = gf106_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = gf100_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = gf100_fb_oclass;
...@@ -171,7 +166,6 @@ gf100_identify(struct nvkm_device *device) ...@@ -171,7 +166,6 @@ gf100_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &gt215_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &gt215_therm_oclass;
device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = gf100_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = gf106_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = gf106_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = gf100_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = gf100_fb_oclass;
...@@ -198,7 +192,6 @@ gf100_identify(struct nvkm_device *device) ...@@ -198,7 +192,6 @@ gf100_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &gt215_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &gt215_therm_oclass;
device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = gf100_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = gf100_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = gf100_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = gf100_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = gf100_fb_oclass;
...@@ -226,7 +219,6 @@ gf100_identify(struct nvkm_device *device) ...@@ -226,7 +219,6 @@ gf100_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &gf110_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &gf110_therm_oclass;
device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = gf100_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = gf106_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = gf106_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = gf100_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = gf100_fb_oclass;
...@@ -253,7 +245,6 @@ gf100_identify(struct nvkm_device *device) ...@@ -253,7 +245,6 @@ gf100_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &gf110_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &gf110_therm_oclass;
device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = gf100_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = gf106_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = gf106_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = gf100_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = gf100_fb_oclass;
......
...@@ -33,7 +33,6 @@ gk104_identify(struct nvkm_device *device) ...@@ -33,7 +33,6 @@ gk104_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &gf110_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &gf110_therm_oclass;
device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = gf100_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = gf106_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = gf106_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = gk104_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = gk104_fb_oclass;
...@@ -62,7 +61,6 @@ gk104_identify(struct nvkm_device *device) ...@@ -62,7 +61,6 @@ gk104_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &gf110_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &gf110_therm_oclass;
device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = gf100_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = gf106_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = gf106_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = gk104_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = gk104_fb_oclass;
...@@ -91,7 +89,6 @@ gk104_identify(struct nvkm_device *device) ...@@ -91,7 +89,6 @@ gk104_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &gf110_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &gf110_therm_oclass;
device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = gf100_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = gf106_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = gf106_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = gk104_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = gk104_fb_oclass;
...@@ -138,7 +135,6 @@ gk104_identify(struct nvkm_device *device) ...@@ -138,7 +135,6 @@ gk104_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &gf110_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &gf110_therm_oclass;
device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = gf100_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = gf106_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = gf106_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = gk104_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = gk104_fb_oclass;
...@@ -167,7 +163,6 @@ gk104_identify(struct nvkm_device *device) ...@@ -167,7 +163,6 @@ gk104_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &gf110_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &gf110_therm_oclass;
device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = gf100_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = gf106_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = gf106_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = gk104_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = gk104_fb_oclass;
...@@ -196,7 +191,6 @@ gk104_identify(struct nvkm_device *device) ...@@ -196,7 +191,6 @@ gk104_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &gf110_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &gf110_therm_oclass;
device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = gf100_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = gk20a_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = gk20a_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = gk104_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = gk104_fb_oclass;
...@@ -224,7 +218,6 @@ gk104_identify(struct nvkm_device *device) ...@@ -224,7 +218,6 @@ gk104_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &gf100_fuse_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &gf110_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &gf110_therm_oclass;
device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = gf100_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = gk20a_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = gk20a_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = gk104_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = gk104_fb_oclass;
......
...@@ -33,7 +33,6 @@ gm100_identify(struct nvkm_device *device) ...@@ -33,7 +33,6 @@ gm100_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_FUSE ] = &gm107_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &gm107_fuse_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &gm107_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &gm107_therm_oclass;
device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = gm107_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = gk20a_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = gk20a_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &gk20a_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &gk20a_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = gm107_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = gm107_fb_oclass;
...@@ -72,7 +71,6 @@ gm100_identify(struct nvkm_device *device) ...@@ -72,7 +71,6 @@ gm100_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_THERM ] = &gm107_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &gm107_therm_oclass;
#endif #endif
device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = gm204_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = gk20a_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = gk20a_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &gk20a_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &gk20a_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = gm107_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = gm107_fb_oclass;
...@@ -108,7 +106,6 @@ gm100_identify(struct nvkm_device *device) ...@@ -108,7 +106,6 @@ gm100_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_THERM ] = &gm107_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &gm107_therm_oclass;
#endif #endif
device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = gm204_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = gk20a_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = gk20a_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &gk20a_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &gk20a_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = gm107_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = gm107_fb_oclass;
......
...@@ -29,7 +29,6 @@ nv04_identify(struct nvkm_device *device) ...@@ -29,7 +29,6 @@ nv04_identify(struct nvkm_device *device)
switch (device->chipset) { switch (device->chipset) {
case 0x04: case 0x04:
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = nv04_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = nv04_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv04_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nv04_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = nv04_fb_oclass;
...@@ -43,7 +42,6 @@ nv04_identify(struct nvkm_device *device) ...@@ -43,7 +42,6 @@ nv04_identify(struct nvkm_device *device)
break; break;
case 0x05: case 0x05:
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = nv05_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = nv04_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv04_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nv04_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = nv04_fb_oclass;
......
...@@ -30,7 +30,6 @@ nv10_identify(struct nvkm_device *device) ...@@ -30,7 +30,6 @@ nv10_identify(struct nvkm_device *device)
case 0x10: case 0x10:
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = nv10_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = nv04_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv04_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nv10_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = nv10_fb_oclass;
...@@ -43,7 +42,6 @@ nv10_identify(struct nvkm_device *device) ...@@ -43,7 +42,6 @@ nv10_identify(struct nvkm_device *device)
case 0x15: case 0x15:
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = nv10_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = nv04_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv04_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nv10_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = nv10_fb_oclass;
...@@ -58,7 +56,6 @@ nv10_identify(struct nvkm_device *device) ...@@ -58,7 +56,6 @@ nv10_identify(struct nvkm_device *device)
case 0x16: case 0x16:
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = nv10_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = nv04_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv04_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nv10_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = nv10_fb_oclass;
...@@ -73,7 +70,6 @@ nv10_identify(struct nvkm_device *device) ...@@ -73,7 +70,6 @@ nv10_identify(struct nvkm_device *device)
case 0x1a: case 0x1a:
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = nv1a_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = nv04_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv04_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nv1a_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = nv1a_fb_oclass;
...@@ -88,7 +84,6 @@ nv10_identify(struct nvkm_device *device) ...@@ -88,7 +84,6 @@ nv10_identify(struct nvkm_device *device)
case 0x11: case 0x11:
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = nv10_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = nv04_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv04_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nv10_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = nv10_fb_oclass;
...@@ -103,7 +98,6 @@ nv10_identify(struct nvkm_device *device) ...@@ -103,7 +98,6 @@ nv10_identify(struct nvkm_device *device)
case 0x17: case 0x17:
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = nv10_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = nv04_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv04_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nv10_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = nv10_fb_oclass;
...@@ -118,7 +112,6 @@ nv10_identify(struct nvkm_device *device) ...@@ -118,7 +112,6 @@ nv10_identify(struct nvkm_device *device)
case 0x1f: case 0x1f:
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = nv1a_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = nv04_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv04_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nv1a_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = nv1a_fb_oclass;
...@@ -133,7 +126,6 @@ nv10_identify(struct nvkm_device *device) ...@@ -133,7 +126,6 @@ nv10_identify(struct nvkm_device *device)
case 0x18: case 0x18:
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = nv10_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = nv04_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv04_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nv10_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = nv10_fb_oclass;
......
...@@ -30,7 +30,6 @@ nv20_identify(struct nvkm_device *device) ...@@ -30,7 +30,6 @@ nv20_identify(struct nvkm_device *device)
case 0x20: case 0x20:
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = nv20_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = nv04_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv04_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nv20_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = nv20_fb_oclass;
...@@ -45,7 +44,6 @@ nv20_identify(struct nvkm_device *device) ...@@ -45,7 +44,6 @@ nv20_identify(struct nvkm_device *device)
case 0x25: case 0x25:
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = nv20_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = nv04_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv04_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nv25_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = nv25_fb_oclass;
...@@ -60,7 +58,6 @@ nv20_identify(struct nvkm_device *device) ...@@ -60,7 +58,6 @@ nv20_identify(struct nvkm_device *device)
case 0x28: case 0x28:
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = nv20_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = nv04_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv04_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nv25_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = nv25_fb_oclass;
...@@ -75,7 +72,6 @@ nv20_identify(struct nvkm_device *device) ...@@ -75,7 +72,6 @@ nv20_identify(struct nvkm_device *device)
case 0x2a: case 0x2a:
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = nv20_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = nv04_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv04_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nv25_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = nv25_fb_oclass;
......
...@@ -30,7 +30,6 @@ nv30_identify(struct nvkm_device *device) ...@@ -30,7 +30,6 @@ nv30_identify(struct nvkm_device *device)
case 0x30: case 0x30:
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = nv20_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = nv04_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv04_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nv30_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = nv30_fb_oclass;
...@@ -45,7 +44,6 @@ nv30_identify(struct nvkm_device *device) ...@@ -45,7 +44,6 @@ nv30_identify(struct nvkm_device *device)
case 0x35: case 0x35:
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = nv20_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = nv04_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv04_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nv35_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = nv35_fb_oclass;
...@@ -60,7 +58,6 @@ nv30_identify(struct nvkm_device *device) ...@@ -60,7 +58,6 @@ nv30_identify(struct nvkm_device *device)
case 0x31: case 0x31:
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = nv20_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = nv04_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv04_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nv30_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = nv30_fb_oclass;
...@@ -76,7 +73,6 @@ nv30_identify(struct nvkm_device *device) ...@@ -76,7 +73,6 @@ nv30_identify(struct nvkm_device *device)
case 0x36: case 0x36:
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = nv20_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = nv04_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv04_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nv36_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = nv36_fb_oclass;
...@@ -92,7 +88,6 @@ nv30_identify(struct nvkm_device *device) ...@@ -92,7 +88,6 @@ nv30_identify(struct nvkm_device *device)
case 0x34: case 0x34:
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = nv10_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = nv04_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv04_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nv10_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = nv10_fb_oclass;
......
...@@ -31,7 +31,6 @@ nv40_identify(struct nvkm_device *device) ...@@ -31,7 +31,6 @@ nv40_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &nv40_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &nv40_therm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = nv1a_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = nv40_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv40_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nv40_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = nv40_fb_oclass;
...@@ -50,7 +49,6 @@ nv40_identify(struct nvkm_device *device) ...@@ -50,7 +49,6 @@ nv40_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &nv40_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &nv40_therm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = nv1a_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = nv40_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv40_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nv41_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = nv41_fb_oclass;
...@@ -69,7 +67,6 @@ nv40_identify(struct nvkm_device *device) ...@@ -69,7 +67,6 @@ nv40_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &nv40_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &nv40_therm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = nv1a_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = nv40_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv40_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nv41_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = nv41_fb_oclass;
...@@ -88,7 +85,6 @@ nv40_identify(struct nvkm_device *device) ...@@ -88,7 +85,6 @@ nv40_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &nv40_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &nv40_therm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = nv1a_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = nv40_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv40_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nv41_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = nv41_fb_oclass;
...@@ -107,7 +103,6 @@ nv40_identify(struct nvkm_device *device) ...@@ -107,7 +103,6 @@ nv40_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &nv40_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &nv40_therm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = nv1a_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = nv40_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv40_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nv40_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = nv40_fb_oclass;
...@@ -126,7 +121,6 @@ nv40_identify(struct nvkm_device *device) ...@@ -126,7 +121,6 @@ nv40_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &nv40_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &nv40_therm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = nv1a_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = nv40_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv40_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nv47_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = nv47_fb_oclass;
...@@ -145,7 +139,6 @@ nv40_identify(struct nvkm_device *device) ...@@ -145,7 +139,6 @@ nv40_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &nv40_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &nv40_therm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = nv1a_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = nv40_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv40_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nv49_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = nv49_fb_oclass;
...@@ -164,7 +157,6 @@ nv40_identify(struct nvkm_device *device) ...@@ -164,7 +157,6 @@ nv40_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &nv40_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &nv40_therm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = nv1a_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = nv40_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv40_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nv49_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = nv49_fb_oclass;
...@@ -183,7 +175,6 @@ nv40_identify(struct nvkm_device *device) ...@@ -183,7 +175,6 @@ nv40_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &nv40_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &nv40_therm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = nv1a_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = nv44_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv44_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nv44_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = nv44_fb_oclass;
...@@ -202,7 +193,6 @@ nv40_identify(struct nvkm_device *device) ...@@ -202,7 +193,6 @@ nv40_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &nv40_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &nv40_therm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = nv1a_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = nv4c_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv4c_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nv46_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = nv46_fb_oclass;
...@@ -221,7 +211,6 @@ nv40_identify(struct nvkm_device *device) ...@@ -221,7 +211,6 @@ nv40_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &nv40_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &nv40_therm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = nv1a_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = nv44_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv44_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nv44_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = nv44_fb_oclass;
...@@ -240,7 +229,6 @@ nv40_identify(struct nvkm_device *device) ...@@ -240,7 +229,6 @@ nv40_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &nv40_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &nv40_therm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = nv1a_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = nv4c_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv4c_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nv46_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = nv46_fb_oclass;
...@@ -259,7 +247,6 @@ nv40_identify(struct nvkm_device *device) ...@@ -259,7 +247,6 @@ nv40_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv4e_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv4e_i2c_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &nv40_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &nv40_therm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = nv1a_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = nv4c_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv4c_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nv4e_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = nv4e_fb_oclass;
...@@ -278,7 +265,6 @@ nv40_identify(struct nvkm_device *device) ...@@ -278,7 +265,6 @@ nv40_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &nv40_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &nv40_therm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = nv1a_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = nv4c_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv4c_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nv46_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = nv46_fb_oclass;
...@@ -297,7 +283,6 @@ nv40_identify(struct nvkm_device *device) ...@@ -297,7 +283,6 @@ nv40_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &nv40_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &nv40_therm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = nv1a_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = nv4c_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv4c_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nv46_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = nv46_fb_oclass;
...@@ -316,7 +301,6 @@ nv40_identify(struct nvkm_device *device) ...@@ -316,7 +301,6 @@ nv40_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass; device->oclass[NVDEV_SUBDEV_GPIO ] = nv10_gpio_oclass;
device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass; device->oclass[NVDEV_SUBDEV_I2C ] = nv04_i2c_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &nv40_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &nv40_therm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = nv1a_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = nv4c_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv4c_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nv46_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = nv46_fb_oclass;
......
...@@ -33,7 +33,6 @@ nv50_identify(struct nvkm_device *device) ...@@ -33,7 +33,6 @@ nv50_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &nv50_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &nv50_therm_oclass;
device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = nv50_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = nv50_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv50_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = nv50_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = nv50_fb_oclass;
...@@ -54,7 +53,6 @@ nv50_identify(struct nvkm_device *device) ...@@ -54,7 +53,6 @@ nv50_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &g84_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &g84_therm_oclass;
device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = g84_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = nv50_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv50_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = g84_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = g84_fb_oclass;
...@@ -78,7 +76,6 @@ nv50_identify(struct nvkm_device *device) ...@@ -78,7 +76,6 @@ nv50_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &g84_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &g84_therm_oclass;
device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = g84_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = nv50_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv50_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = g84_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = g84_fb_oclass;
...@@ -102,7 +99,6 @@ nv50_identify(struct nvkm_device *device) ...@@ -102,7 +99,6 @@ nv50_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &g84_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &g84_therm_oclass;
device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = g84_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = nv50_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = nv50_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = g84_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = g84_fb_oclass;
...@@ -126,7 +122,6 @@ nv50_identify(struct nvkm_device *device) ...@@ -126,7 +122,6 @@ nv50_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &g84_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &g84_therm_oclass;
device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = g84_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = g94_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = g94_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = g84_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = g84_fb_oclass;
...@@ -150,7 +145,6 @@ nv50_identify(struct nvkm_device *device) ...@@ -150,7 +145,6 @@ nv50_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &g84_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &g84_therm_oclass;
device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = g84_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = g94_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = g94_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = g84_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = g84_fb_oclass;
...@@ -174,7 +168,6 @@ nv50_identify(struct nvkm_device *device) ...@@ -174,7 +168,6 @@ nv50_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &g84_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &g84_therm_oclass;
device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = g98_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = g98_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = g98_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = g84_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = g84_fb_oclass;
...@@ -198,7 +191,6 @@ nv50_identify(struct nvkm_device *device) ...@@ -198,7 +191,6 @@ nv50_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &g84_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &g84_therm_oclass;
device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = g84_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = g98_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = g98_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = g84_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = g84_fb_oclass;
...@@ -222,7 +214,6 @@ nv50_identify(struct nvkm_device *device) ...@@ -222,7 +214,6 @@ nv50_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &g84_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &g84_therm_oclass;
device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = g98_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = g98_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = g98_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = mcp77_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = mcp77_fb_oclass;
...@@ -246,7 +237,6 @@ nv50_identify(struct nvkm_device *device) ...@@ -246,7 +237,6 @@ nv50_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &g84_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &g84_therm_oclass;
device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = g98_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = g98_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = g98_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = mcp77_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = mcp77_fb_oclass;
...@@ -270,7 +260,6 @@ nv50_identify(struct nvkm_device *device) ...@@ -270,7 +260,6 @@ nv50_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &gt215_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &gt215_therm_oclass;
device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = gt215_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = g98_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = g98_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = gt215_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = gt215_fb_oclass;
...@@ -296,7 +285,6 @@ nv50_identify(struct nvkm_device *device) ...@@ -296,7 +285,6 @@ nv50_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &gt215_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &gt215_therm_oclass;
device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = gt215_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = g98_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = g98_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = gt215_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = gt215_fb_oclass;
...@@ -321,7 +309,6 @@ nv50_identify(struct nvkm_device *device) ...@@ -321,7 +309,6 @@ nv50_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &gt215_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &gt215_therm_oclass;
device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = gt215_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = g98_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = g98_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = gt215_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = gt215_fb_oclass;
...@@ -346,7 +333,6 @@ nv50_identify(struct nvkm_device *device) ...@@ -346,7 +333,6 @@ nv50_identify(struct nvkm_device *device)
device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass; device->oclass[NVDEV_SUBDEV_FUSE ] = &nv50_fuse_oclass;
device->oclass[NVDEV_SUBDEV_THERM ] = &gt215_therm_oclass; device->oclass[NVDEV_SUBDEV_THERM ] = &gt215_therm_oclass;
device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass;
device->oclass[NVDEV_SUBDEV_DEVINIT] = mcp89_devinit_oclass;
device->oclass[NVDEV_SUBDEV_MC ] = g98_mc_oclass; device->oclass[NVDEV_SUBDEV_MC ] = g98_mc_oclass;
device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass; device->oclass[NVDEV_SUBDEV_TIMER ] = &nv04_timer_oclass;
device->oclass[NVDEV_SUBDEV_FB ] = mcp89_fb_oclass; device->oclass[NVDEV_SUBDEV_FB ] = mcp89_fb_oclass;
......
...@@ -236,7 +236,7 @@ gf119_disp_intr_unk2_1(struct nv50_disp *disp, int head) ...@@ -236,7 +236,7 @@ gf119_disp_intr_unk2_1(struct nv50_disp *disp, int head)
struct nvkm_devinit *devinit = device->devinit; struct nvkm_devinit *devinit = device->devinit;
u32 pclk = nvkm_rd32(device, 0x660450 + (head * 0x300)) / 1000; u32 pclk = nvkm_rd32(device, 0x660450 + (head * 0x300)) / 1000;
if (pclk) if (pclk)
devinit->pll_set(devinit, PLL_VPLL0 + head, pclk); nvkm_devinit_pll_set(devinit, PLL_VPLL0 + head, pclk);
nvkm_wr32(device, 0x612200 + (head * 0x800), 0x00000000); nvkm_wr32(device, 0x612200 + (head * 0x800), 0x00000000);
} }
......
...@@ -358,7 +358,7 @@ nv50_disp_intr_unk20_1(struct nv50_disp *disp, int head) ...@@ -358,7 +358,7 @@ nv50_disp_intr_unk20_1(struct nv50_disp *disp, int head)
struct nvkm_devinit *devinit = device->devinit; struct nvkm_devinit *devinit = device->devinit;
u32 pclk = nvkm_rd32(device, 0x610ad0 + (head * 0x540)) & 0x3fffff; u32 pclk = nvkm_rd32(device, 0x610ad0 + (head * 0x540)) & 0x3fffff;
if (pclk) if (pclk)
devinit->pll_set(devinit, PLL_VPLL0 + head, pclk); nvkm_devinit_pll_set(devinit, PLL_VPLL0 + head, pclk);
} }
static void static void
......
...@@ -173,9 +173,7 @@ init_nvreg(struct nvbios_init *init, u32 reg) ...@@ -173,9 +173,7 @@ init_nvreg(struct nvbios_init *init, u32 reg)
if (reg & ~0x00fffffc) if (reg & ~0x00fffffc)
warn("unknown bits in register 0x%08x\n", reg); warn("unknown bits in register 0x%08x\n", reg);
if (devinit->mmio) return nvkm_devinit_mmio(devinit, reg);
reg = devinit->mmio(devinit, reg);
return reg;
} }
static u32 static u32
...@@ -338,8 +336,8 @@ static void ...@@ -338,8 +336,8 @@ static void
init_prog_pll(struct nvbios_init *init, u32 id, u32 freq) init_prog_pll(struct nvbios_init *init, u32 id, u32 freq)
{ {
struct nvkm_devinit *devinit = init->bios->subdev.device->devinit; struct nvkm_devinit *devinit = init->bios->subdev.device->devinit;
if (devinit->pll_set && init_exec(init)) { if (init_exec(init)) {
int ret = devinit->pll_set(devinit, id, freq); int ret = nvkm_devinit_pll_set(devinit, id, freq);
if (ret) if (ret)
warn("failed to prog pll 0x%08x to %dkHz\n", id, freq); warn("failed to prog pll 0x%08x to %dkHz\n", id, freq);
} }
...@@ -1453,8 +1451,8 @@ init_compute_mem(struct nvbios_init *init) ...@@ -1453,8 +1451,8 @@ init_compute_mem(struct nvbios_init *init)
init->offset += 1; init->offset += 1;
init_exec_force(init, true); init_exec_force(init, true);
if (init_exec(init) && devinit->meminit) if (init_exec(init))
devinit->meminit(devinit); nvkm_devinit_meminit(devinit);
init_exec_force(init, false); init_exec_force(init, false);
} }
......
...@@ -26,70 +26,104 @@ ...@@ -26,70 +26,104 @@
#include <core/option.h> #include <core/option.h>
#include <subdev/vga.h> #include <subdev/vga.h>
u32
nvkm_devinit_mmio(struct nvkm_devinit *init, u32 addr)
{
if (init->func->mmio)
addr = init->func->mmio(init, addr);
return addr;
}
int int
_nvkm_devinit_fini(struct nvkm_object *object, bool suspend) nvkm_devinit_pll_set(struct nvkm_devinit *init, u32 type, u32 khz)
{
return init->func->pll_set(init, type, khz);
}
void
nvkm_devinit_meminit(struct nvkm_devinit *init)
{
if (init->func->meminit)
init->func->meminit(init);
}
u64
nvkm_devinit_disable(struct nvkm_devinit *init)
{ {
struct nvkm_devinit *init = (void *)object; if (init->func->disable)
return init->func->disable(init);
return 0;
}
static int
nvkm_devinit_fini(struct nvkm_subdev *subdev, bool suspend)
{
struct nvkm_devinit *init = nvkm_devinit(subdev);
/* force full reinit on resume */ /* force full reinit on resume */
if (suspend) if (suspend)
init->post = true; init->post = true;
return 0;
}
/* unlock the extended vga crtc regs */ static int
nvkm_lockvgac(init->subdev.device, false); nvkm_devinit_preinit(struct nvkm_subdev *subdev)
{
struct nvkm_devinit *init = nvkm_devinit(subdev);
if (init->func->preinit)
init->func->preinit(init);
return nvkm_subdev_fini_old(&init->subdev, suspend); /* unlock the extended vga crtc regs */
nvkm_lockvgac(subdev->device, false);
return 0;
} }
int static int
_nvkm_devinit_init(struct nvkm_object *object) nvkm_devinit_init(struct nvkm_subdev *subdev)
{ {
struct nvkm_devinit_impl *impl = (void *)object->oclass; struct nvkm_devinit *init = nvkm_devinit(subdev);
struct nvkm_devinit *init = (void *)object;
int ret; int ret;
ret = nvkm_subdev_init_old(&init->subdev); ret = init->func->post(init, init->post);
if (ret) if (ret)
return ret; return ret;
ret = impl->post(&init->subdev, init->post); if (init->func->init)
if (ret) init->func->init(init);
return ret;
if (impl->disable) if (init->func->disable)
nv_device(init)->disable_mask |= impl->disable(init); subdev->device->disable_mask |= init->func->disable(init);
return 0; return 0;
} }
void static void *
_nvkm_devinit_dtor(struct nvkm_object *object) nvkm_devinit_dtor(struct nvkm_subdev *subdev)
{ {
struct nvkm_devinit *init = (void *)object; struct nvkm_devinit *init = nvkm_devinit(subdev);
void *data = init;
/* lock crtc regs */ if (init->func->dtor)
nvkm_lockvgac(init->subdev.device, true); data = init->func->dtor(init);
nvkm_subdev_destroy(&init->subdev); /* lock crtc regs */
nvkm_lockvgac(subdev->device, true);
return data;
} }
int static const struct nvkm_subdev_func
nvkm_devinit_create_(struct nvkm_object *parent, struct nvkm_object *engine, nvkm_devinit = {
struct nvkm_oclass *oclass, int size, void **pobject) .dtor = nvkm_devinit_dtor,
{ .preinit = nvkm_devinit_preinit,
struct nvkm_devinit_impl *impl = (void *)oclass; .init = nvkm_devinit_init,
struct nvkm_device *device = nv_device(parent); .fini = nvkm_devinit_fini,
struct nvkm_devinit *init; };
int ret;
ret = nvkm_subdev_create_(parent, engine, oclass, 0, "DEVINIT",
"init", size, pobject);
init = *pobject;
if (ret)
return ret;
void
nvkm_devinit_ctor(const struct nvkm_devinit_func *func,
struct nvkm_device *device, int index,
struct nvkm_devinit *init)
{
nvkm_subdev_ctor(&nvkm_devinit, device, index, 0, &init->subdev);
init->func = func;
init->post = nvkm_boolopt(device->cfgopt, "NvForcePost", false); init->post = nvkm_boolopt(device->cfgopt, "NvForcePost", false);
init->meminit = impl->meminit;
init->pll_set = impl->pll_set;
init->mmio = impl->mmio;
return 0;
} }
...@@ -51,16 +51,18 @@ g84_devinit_disable(struct nvkm_devinit *init) ...@@ -51,16 +51,18 @@ g84_devinit_disable(struct nvkm_devinit *init)
return disable; return disable;
} }
struct nvkm_oclass * static const struct nvkm_devinit_func
g84_devinit_oclass = &(struct nvkm_devinit_impl) { g84_devinit = {
.base.handle = NV_SUBDEV(DEVINIT, 0x84), .preinit = nv50_devinit_preinit,
.base.ofuncs = &(struct nvkm_ofuncs) { .init = nv50_devinit_init,
.ctor = nv50_devinit_ctor, .post = nv04_devinit_post,
.dtor = _nvkm_devinit_dtor,
.init = nv50_devinit_init,
.fini = _nvkm_devinit_fini,
},
.pll_set = nv50_devinit_pll_set, .pll_set = nv50_devinit_pll_set,
.disable = g84_devinit_disable, .disable = g84_devinit_disable,
.post = nvbios_init, };
}.base;
int
g84_devinit_new(struct nvkm_device *device, int index,
struct nvkm_devinit **pinit)
{
return nv50_devinit_new_(&g84_devinit, device, index, pinit);
}
...@@ -50,16 +50,18 @@ g98_devinit_disable(struct nvkm_devinit *init) ...@@ -50,16 +50,18 @@ g98_devinit_disable(struct nvkm_devinit *init)
return disable; return disable;
} }
struct nvkm_oclass * static const struct nvkm_devinit_func
g98_devinit_oclass = &(struct nvkm_devinit_impl) { g98_devinit = {
.base.handle = NV_SUBDEV(DEVINIT, 0x98), .preinit = nv50_devinit_preinit,
.base.ofuncs = &(struct nvkm_ofuncs) { .init = nv50_devinit_init,
.ctor = nv50_devinit_ctor, .post = nv04_devinit_post,
.dtor = _nvkm_devinit_dtor,
.init = nv50_devinit_init,
.fini = _nvkm_devinit_fini,
},
.pll_set = nv50_devinit_pll_set, .pll_set = nv50_devinit_pll_set,
.disable = g98_devinit_disable, .disable = g98_devinit_disable,
.post = nvbios_init, };
}.base;
int
g98_devinit_new(struct nvkm_device *device, int index,
struct nvkm_devinit **pinit)
{
return nv50_devinit_new_(&g98_devinit, device, index, pinit);
}
...@@ -90,38 +90,18 @@ gf100_devinit_disable(struct nvkm_devinit *init) ...@@ -90,38 +90,18 @@ gf100_devinit_disable(struct nvkm_devinit *init)
return disable; return disable;
} }
static const struct nvkm_devinit_func
gf100_devinit = {
.preinit = nv50_devinit_preinit,
.init = nv50_devinit_init,
.post = nv04_devinit_post,
.pll_set = gf100_devinit_pll_set,
.disable = gf100_devinit_disable,
};
int int
gf100_devinit_ctor(struct nvkm_object *parent, struct nvkm_object *engine, gf100_devinit_new(struct nvkm_device *device, int index,
struct nvkm_oclass *oclass, void *data, u32 size, struct nvkm_devinit **pinit)
struct nvkm_object **pobject)
{ {
struct nvkm_devinit_impl *impl = (void *)oclass; return nv50_devinit_new_(&gf100_devinit, device, index, pinit);
struct nv50_devinit *init;
u64 disable;
int ret;
ret = nvkm_devinit_create(parent, engine, oclass, &init);
*pobject = nv_object(init);
if (ret)
return ret;
disable = impl->disable(&init->base);
if (disable & (1ULL << NVDEV_ENGINE_DISP))
init->base.post = true;
return 0;
} }
struct nvkm_oclass *
gf100_devinit_oclass = &(struct nvkm_devinit_impl) {
.base.handle = NV_SUBDEV(DEVINIT, 0xc0),
.base.ofuncs = &(struct nvkm_ofuncs) {
.ctor = gf100_devinit_ctor,
.dtor = _nvkm_devinit_dtor,
.init = nv50_devinit_init,
.fini = _nvkm_devinit_fini,
},
.pll_set = gf100_devinit_pll_set,
.disable = gf100_devinit_disable,
.post = nvbios_init,
}.base;
...@@ -44,16 +44,18 @@ gm107_devinit_disable(struct nvkm_devinit *init) ...@@ -44,16 +44,18 @@ gm107_devinit_disable(struct nvkm_devinit *init)
return disable; return disable;
} }
struct nvkm_oclass * static const struct nvkm_devinit_func
gm107_devinit_oclass = &(struct nvkm_devinit_impl) { gm107_devinit = {
.base.handle = NV_SUBDEV(DEVINIT, 0x07), .preinit = nv50_devinit_preinit,
.base.ofuncs = &(struct nvkm_ofuncs) { .init = nv50_devinit_init,
.ctor = gf100_devinit_ctor, .post = nv04_devinit_post,
.dtor = _nvkm_devinit_dtor,
.init = nv50_devinit_init,
.fini = _nvkm_devinit_fini,
},
.pll_set = gf100_devinit_pll_set, .pll_set = gf100_devinit_pll_set,
.disable = gm107_devinit_disable, .disable = gm107_devinit_disable,
.post = nvbios_init, };
}.base;
int
gm107_devinit_new(struct nvkm_device *device, int index,
struct nvkm_devinit **pinit)
{
return nv50_devinit_new_(&gm107_devinit, device, index, pinit);
}
...@@ -107,9 +107,10 @@ pmu_load(struct nv50_devinit *init, u8 type, bool post, ...@@ -107,9 +107,10 @@ pmu_load(struct nv50_devinit *init, u8 type, bool post,
} }
static int static int
gm204_devinit_post(struct nvkm_subdev *subdev, bool post) gm204_devinit_post(struct nvkm_devinit *base, bool post)
{ {
struct nv50_devinit *init = (void *)nvkm_devinit(subdev); struct nv50_devinit *init = nv50_devinit(base);
struct nvkm_subdev *subdev = &init->base.subdev;
struct nvkm_device *device = subdev->device; struct nvkm_device *device = subdev->device;
struct nvkm_bios *bios = device->bios; struct nvkm_bios *bios = device->bios;
struct bit_entry bit_I; struct bit_entry bit_I;
...@@ -163,16 +164,18 @@ gm204_devinit_post(struct nvkm_subdev *subdev, bool post) ...@@ -163,16 +164,18 @@ gm204_devinit_post(struct nvkm_subdev *subdev, bool post)
return pmu_load(init, 0x01, post, NULL, NULL); return pmu_load(init, 0x01, post, NULL, NULL);
} }
struct nvkm_oclass * static const struct nvkm_devinit_func
gm204_devinit_oclass = &(struct nvkm_devinit_impl) { gm204_devinit = {
.base.handle = NV_SUBDEV(DEVINIT, 0x07), .preinit = nv50_devinit_preinit,
.base.ofuncs = &(struct nvkm_ofuncs) { .init = nv50_devinit_init,
.ctor = gf100_devinit_ctor, .post = gm204_devinit_post,
.dtor = _nvkm_devinit_dtor,
.init = nv50_devinit_init,
.fini = _nvkm_devinit_fini,
},
.pll_set = gf100_devinit_pll_set, .pll_set = gf100_devinit_pll_set,
.disable = gm107_devinit_disable, .disable = gm107_devinit_disable,
.post = gm204_devinit_post, };
}.base;
int
gm204_devinit_new(struct nvkm_device *device, int index,
struct nvkm_devinit **pinit)
{
return nv50_devinit_new_(&gm204_devinit, device, index, pinit);
}
...@@ -99,9 +99,9 @@ gt215_devinit_mmio_part[] = { ...@@ -99,9 +99,9 @@ gt215_devinit_mmio_part[] = {
}; };
static u32 static u32
gt215_devinit_mmio(struct nvkm_devinit *obj, u32 addr) gt215_devinit_mmio(struct nvkm_devinit *base, u32 addr)
{ {
struct nv50_devinit *init = container_of(obj, typeof(*init), base); struct nv50_devinit *init = nv50_devinit(base);
struct nvkm_device *device = init->base.subdev.device; struct nvkm_device *device = init->base.subdev.device;
u32 *mmio = gt215_devinit_mmio_part; u32 *mmio = gt215_devinit_mmio_part;
...@@ -135,17 +135,19 @@ gt215_devinit_mmio(struct nvkm_devinit *obj, u32 addr) ...@@ -135,17 +135,19 @@ gt215_devinit_mmio(struct nvkm_devinit *obj, u32 addr)
return addr; return addr;
} }
struct nvkm_oclass * static const struct nvkm_devinit_func
gt215_devinit_oclass = &(struct nvkm_devinit_impl) { gt215_devinit = {
.base.handle = NV_SUBDEV(DEVINIT, 0xa3), .preinit = nv50_devinit_preinit,
.base.ofuncs = &(struct nvkm_ofuncs) { .init = nv50_devinit_init,
.ctor = nv50_devinit_ctor, .post = nv04_devinit_post,
.dtor = _nvkm_devinit_dtor, .mmio = gt215_devinit_mmio,
.init = nv50_devinit_init,
.fini = _nvkm_devinit_fini,
},
.pll_set = gt215_devinit_pll_set, .pll_set = gt215_devinit_pll_set,
.disable = gt215_devinit_disable, .disable = gt215_devinit_disable,
.mmio = gt215_devinit_mmio, };
.post = nvbios_init,
}.base; int
gt215_devinit_new(struct nvkm_device *device, int index,
struct nvkm_devinit **pinit)
{
return nv50_devinit_new_(&gt215_devinit, device, index, pinit);
}
...@@ -51,16 +51,18 @@ mcp89_devinit_disable(struct nvkm_devinit *init) ...@@ -51,16 +51,18 @@ mcp89_devinit_disable(struct nvkm_devinit *init)
return disable; return disable;
} }
struct nvkm_oclass * static const struct nvkm_devinit_func
mcp89_devinit_oclass = &(struct nvkm_devinit_impl) { mcp89_devinit = {
.base.handle = NV_SUBDEV(DEVINIT, 0xaf), .preinit = nv50_devinit_preinit,
.base.ofuncs = &(struct nvkm_ofuncs) { .init = nv50_devinit_init,
.ctor = nv50_devinit_ctor, .post = nv04_devinit_post,
.dtor = _nvkm_devinit_dtor,
.init = nv50_devinit_init,
.fini = _nvkm_devinit_fini,
},
.pll_set = gt215_devinit_pll_set, .pll_set = gt215_devinit_pll_set,
.disable = mcp89_devinit_disable, .disable = mcp89_devinit_disable,
.post = nvbios_init, };
}.base;
int
mcp89_devinit_new(struct nvkm_device *device, int index,
struct nvkm_devinit **pinit)
{
return nv50_devinit_new_(&mcp89_devinit, device, index, pinit);
}
...@@ -391,32 +391,25 @@ nv04_devinit_pll_set(struct nvkm_devinit *devinit, u32 type, u32 freq) ...@@ -391,32 +391,25 @@ nv04_devinit_pll_set(struct nvkm_devinit *devinit, u32 type, u32 freq)
} }
int int
nv04_devinit_fini(struct nvkm_object *object, bool suspend) nv04_devinit_post(struct nvkm_devinit *init, bool execute)
{ {
struct nv04_devinit *init = (void *)object; return nvbios_init(&init->subdev, execute);
struct nvkm_device *device = init->base.subdev.device; }
int ret;
void
nv04_devinit_preinit(struct nvkm_devinit *base)
{
struct nv04_devinit *init = nv04_devinit(base);
struct nvkm_subdev *subdev = &init->base.subdev;
struct nvkm_device *device = subdev->device;
/* make i2c busses accessible */ /* make i2c busses accessible */
nvkm_mask(device, 0x000200, 0x00000001, 0x00000001); nvkm_mask(device, 0x000200, 0x00000001, 0x00000001);
ret = nvkm_devinit_fini(&init->base, suspend);
if (ret)
return ret;
/* unslave crtcs */ /* unslave crtcs */
if (init->owner < 0) if (init->owner < 0)
init->owner = nvkm_rdvgaowner(device); init->owner = nvkm_rdvgaowner(device);
nvkm_wrvgaowner(device, 0); nvkm_wrvgaowner(device, 0);
return 0;
}
int
nv04_devinit_init(struct nvkm_object *object)
{
struct nv04_devinit *init = (void *)object;
struct nvkm_subdev *subdev = &init->base.subdev;
struct nvkm_device *device = subdev->device;
if (!init->base.post) { if (!init->base.post) {
u32 htotal = nvkm_rdvgac(device, 0, 0x06); u32 htotal = nvkm_rdvgac(device, 0, 0x06);
...@@ -429,48 +422,45 @@ nv04_devinit_init(struct nvkm_object *object) ...@@ -429,48 +422,45 @@ nv04_devinit_init(struct nvkm_object *object)
init->base.post = true; init->base.post = true;
} }
} }
return nvkm_devinit_init(&init->base);
} }
void void *
nv04_devinit_dtor(struct nvkm_object *object) nv04_devinit_dtor(struct nvkm_devinit *base)
{ {
struct nv04_devinit *init = (void *)object; struct nv04_devinit *init = nv04_devinit(base);
/* restore vga owner saved at first init */ /* restore vga owner saved at first init */
nvkm_wrvgaowner(init->base.subdev.device, init->owner); nvkm_wrvgaowner(init->base.subdev.device, init->owner);
return init;
nvkm_devinit_destroy(&init->base);
} }
int int
nv04_devinit_ctor(struct nvkm_object *parent, struct nvkm_object *engine, nv04_devinit_new_(const struct nvkm_devinit_func *func,
struct nvkm_oclass *oclass, void *data, u32 size, struct nvkm_device *device, int index,
struct nvkm_object **pobject) struct nvkm_devinit **pinit)
{ {
struct nv04_devinit *init; struct nv04_devinit *init;
int ret;
ret = nvkm_devinit_create(parent, engine, oclass, &init); if (!(init = kzalloc(sizeof(*init), GFP_KERNEL)))
*pobject = nv_object(init); return -ENOMEM;
if (ret) *pinit = &init->base;
return ret;
nvkm_devinit_ctor(func, device, index, &init->base);
init->owner = -1; init->owner = -1;
return 0; return 0;
} }
struct nvkm_oclass * static const struct nvkm_devinit_func
nv04_devinit_oclass = &(struct nvkm_devinit_impl) { nv04_devinit = {
.base.handle = NV_SUBDEV(DEVINIT, 0x04), .dtor = nv04_devinit_dtor,
.base.ofuncs = &(struct nvkm_ofuncs) { .preinit = nv04_devinit_preinit,
.ctor = nv04_devinit_ctor, .post = nv04_devinit_post,
.dtor = nv04_devinit_dtor,
.init = nv04_devinit_init,
.fini = nv04_devinit_fini,
},
.meminit = nv04_devinit_meminit, .meminit = nv04_devinit_meminit,
.pll_set = nv04_devinit_pll_set, .pll_set = nv04_devinit_pll_set,
.post = nvbios_init, };
}.base;
int
nv04_devinit_new(struct nvkm_device *device, int index,
struct nvkm_devinit **pinit)
{
return nv04_devinit_new_(&nv04_devinit, device, index, pinit);
}
#ifndef __NVKM_DEVINIT_NV04_H__ #ifndef __NV04_DEVINIT_H__
#define __NVKM_DEVINIT_NV04_H__ #define __NV04_DEVINIT_H__
#define nv04_devinit(p) container_of((p), struct nv04_devinit, base)
#include "priv.h" #include "priv.h"
struct nvkm_pll_vals; struct nvkm_pll_vals;
...@@ -8,12 +9,11 @@ struct nv04_devinit { ...@@ -8,12 +9,11 @@ struct nv04_devinit {
int owner; int owner;
}; };
int nv04_devinit_ctor(struct nvkm_object *, struct nvkm_object *, int nv04_devinit_new_(const struct nvkm_devinit_func *, struct nvkm_device *,
struct nvkm_oclass *, void *, u32, int, struct nvkm_devinit **);
struct nvkm_object **); void *nv04_devinit_dtor(struct nvkm_devinit *);
void nv04_devinit_dtor(struct nvkm_object *); void nv04_devinit_preinit(struct nvkm_devinit *);
int nv04_devinit_init(struct nvkm_object *); void nv04_devinit_fini(struct nvkm_devinit *);
int nv04_devinit_fini(struct nvkm_object *, bool);
int nv04_devinit_pll_set(struct nvkm_devinit *, u32, u32); int nv04_devinit_pll_set(struct nvkm_devinit *, u32, u32);
void setPLL_single(struct nvkm_devinit *, u32, struct nvkm_pll_vals *); void setPLL_single(struct nvkm_devinit *, u32, struct nvkm_pll_vals *);
......
...@@ -126,16 +126,18 @@ nv05_devinit_meminit(struct nvkm_devinit *init) ...@@ -126,16 +126,18 @@ nv05_devinit_meminit(struct nvkm_devinit *init)
fbmem_fini(fb); fbmem_fini(fb);
} }
struct nvkm_oclass * static const struct nvkm_devinit_func
nv05_devinit_oclass = &(struct nvkm_devinit_impl) { nv05_devinit = {
.base.handle = NV_SUBDEV(DEVINIT, 0x05), .dtor = nv04_devinit_dtor,
.base.ofuncs = &(struct nvkm_ofuncs) { .preinit = nv04_devinit_preinit,
.ctor = nv04_devinit_ctor, .post = nv04_devinit_post,
.dtor = nv04_devinit_dtor,
.init = nv04_devinit_init,
.fini = nv04_devinit_fini,
},
.meminit = nv05_devinit_meminit, .meminit = nv05_devinit_meminit,
.pll_set = nv04_devinit_pll_set, .pll_set = nv04_devinit_pll_set,
.post = nvbios_init, };
}.base;
int
nv05_devinit_new(struct nvkm_device *device, int index,
struct nvkm_devinit **pinit)
{
return nv04_devinit_new_(&nv05_devinit, device, index, pinit);
}
...@@ -96,16 +96,18 @@ nv10_devinit_meminit(struct nvkm_devinit *init) ...@@ -96,16 +96,18 @@ nv10_devinit_meminit(struct nvkm_devinit *init)
fbmem_fini(fb); fbmem_fini(fb);
} }
struct nvkm_oclass * static const struct nvkm_devinit_func
nv10_devinit_oclass = &(struct nvkm_devinit_impl) { nv10_devinit = {
.base.handle = NV_SUBDEV(DEVINIT, 0x10), .dtor = nv04_devinit_dtor,
.base.ofuncs = &(struct nvkm_ofuncs) { .preinit = nv04_devinit_preinit,
.ctor = nv04_devinit_ctor, .post = nv04_devinit_post,
.dtor = nv04_devinit_dtor,
.init = nv04_devinit_init,
.fini = nv04_devinit_fini,
},
.meminit = nv10_devinit_meminit, .meminit = nv10_devinit_meminit,
.pll_set = nv04_devinit_pll_set, .pll_set = nv04_devinit_pll_set,
.post = nvbios_init, };
}.base;
int
nv10_devinit_new(struct nvkm_device *device, int index,
struct nvkm_devinit **pinit)
{
return nv04_devinit_new_(&nv10_devinit, device, index, pinit);
}
...@@ -26,15 +26,17 @@ ...@@ -26,15 +26,17 @@
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/init.h> #include <subdev/bios/init.h>
struct nvkm_oclass * static const struct nvkm_devinit_func
nv1a_devinit_oclass = &(struct nvkm_devinit_impl) { nv1a_devinit = {
.base.handle = NV_SUBDEV(DEVINIT, 0x1a), .dtor = nv04_devinit_dtor,
.base.ofuncs = &(struct nvkm_ofuncs) { .preinit = nv04_devinit_preinit,
.ctor = nv04_devinit_ctor, .post = nv04_devinit_post,
.dtor = nv04_devinit_dtor,
.init = nv04_devinit_init,
.fini = nv04_devinit_fini,
},
.pll_set = nv04_devinit_pll_set, .pll_set = nv04_devinit_pll_set,
.post = nvbios_init, };
}.base;
int
nv1a_devinit_new(struct nvkm_device *device, int index,
struct nvkm_devinit **pinit)
{
return nv04_devinit_new_(&nv1a_devinit, device, index, pinit);
}
...@@ -39,7 +39,7 @@ nv20_devinit_meminit(struct nvkm_devinit *init) ...@@ -39,7 +39,7 @@ nv20_devinit_meminit(struct nvkm_devinit *init)
struct io_mapping *fb; struct io_mapping *fb;
/* Map the framebuffer aperture */ /* Map the framebuffer aperture */
fb = fbmem_init(nv_device(init)); fb = fbmem_init(device);
if (!fb) { if (!fb) {
nvkm_error(subdev, "failed to map fb\n"); nvkm_error(subdev, "failed to map fb\n");
return; return;
...@@ -62,16 +62,18 @@ nv20_devinit_meminit(struct nvkm_devinit *init) ...@@ -62,16 +62,18 @@ nv20_devinit_meminit(struct nvkm_devinit *init)
fbmem_fini(fb); fbmem_fini(fb);
} }
struct nvkm_oclass * static const struct nvkm_devinit_func
nv20_devinit_oclass = &(struct nvkm_devinit_impl) { nv20_devinit = {
.base.handle = NV_SUBDEV(DEVINIT, 0x20), .dtor = nv04_devinit_dtor,
.base.ofuncs = &(struct nvkm_ofuncs) { .preinit = nv04_devinit_preinit,
.ctor = nv04_devinit_ctor, .post = nv04_devinit_post,
.dtor = nv04_devinit_dtor,
.init = nv04_devinit_init,
.fini = nv04_devinit_fini,
},
.meminit = nv20_devinit_meminit, .meminit = nv20_devinit_meminit,
.pll_set = nv04_devinit_pll_set, .pll_set = nv04_devinit_pll_set,
.post = nvbios_init, };
}.base;
int
nv20_devinit_new(struct nvkm_device *device, int index,
struct nvkm_devinit **pinit)
{
return nv04_devinit_new_(&nv20_devinit, device, index, pinit);
}
...@@ -91,19 +91,27 @@ nv50_devinit_disable(struct nvkm_devinit *init) ...@@ -91,19 +91,27 @@ nv50_devinit_disable(struct nvkm_devinit *init)
return disable; return disable;
} }
int void
nv50_devinit_init(struct nvkm_object *object) nv50_devinit_preinit(struct nvkm_devinit *base)
{ {
struct nv50_devinit *init = (void *)object; struct nv50_devinit *init = nv50_devinit(base);
struct nvkm_subdev *subdev = &init->base.subdev; struct nvkm_subdev *subdev = &init->base.subdev;
struct nvkm_device *device = subdev->device; struct nvkm_device *device = subdev->device;
struct nvkm_bios *bios = device->bios;
struct nvkm_subdev *ibus = device->ibus; struct nvkm_subdev *ibus = device->ibus;
struct nvbios_outp info;
struct dcb_output outp;
u8 ver = 0xff, hdr, cnt, len;
int ret, i = 0;
/* our heuristics can't detect whether the board has had its
* devinit scripts executed or not if the display engine is
* missing, assume it's a secondary gpu which requires post
*/
if (!init->base.post) {
u64 disable = nvkm_devinit_disable(&init->base);
if (disable & (1ULL << NVDEV_ENGINE_DISP))
init->base.post = true;
}
/* magic to detect whether or not x86 vbios code has executed
* the devinit scripts to initialise the board
*/
if (!init->base.post) { if (!init->base.post) {
if (!nvkm_rdvgac(device, 0, 0x00) && if (!nvkm_rdvgac(device, 0, 0x00) &&
!nvkm_rdvgac(device, 0, 0x1a)) { !nvkm_rdvgac(device, 0, 0x1a)) {
...@@ -118,10 +126,19 @@ nv50_devinit_init(struct nvkm_object *object) ...@@ -118,10 +126,19 @@ nv50_devinit_init(struct nvkm_object *object)
*/ */
if (init->base.post && ibus) if (init->base.post && ibus)
nvkm_object_init(&ibus->object); nvkm_object_init(&ibus->object);
}
ret = nvkm_devinit_init(&init->base); void
if (ret) nv50_devinit_init(struct nvkm_devinit *base)
return ret; {
struct nv50_devinit *init = nv50_devinit(base);
struct nvkm_subdev *subdev = &init->base.subdev;
struct nvkm_device *device = subdev->device;
struct nvkm_bios *bios = device->bios;
struct nvbios_outp info;
struct dcb_output outp;
u8 ver = 0xff, hdr, cnt, len;
int i = 0;
/* if we ran the init tables, we have to execute the first script /* if we ran the init tables, we have to execute the first script
* pointer of each dcb entry's display encoder table in order * pointer of each dcb entry's display encoder table in order
...@@ -131,7 +148,7 @@ nv50_devinit_init(struct nvkm_object *object) ...@@ -131,7 +148,7 @@ nv50_devinit_init(struct nvkm_object *object)
if (nvbios_outp_match(bios, outp.hasht, outp.hashm, if (nvbios_outp_match(bios, outp.hasht, outp.hashm,
&ver, &hdr, &cnt, &len, &info)) { &ver, &hdr, &cnt, &len, &info)) {
struct nvbios_init exec = { struct nvbios_init exec = {
.subdev = nv_subdev(init), .subdev = subdev,
.bios = bios, .bios = bios,
.offset = info.script[0], .offset = info.script[0],
.outp = &outp, .outp = &outp,
...@@ -143,36 +160,35 @@ nv50_devinit_init(struct nvkm_object *object) ...@@ -143,36 +160,35 @@ nv50_devinit_init(struct nvkm_object *object)
} }
i++; i++;
} }
return 0;
} }
int int
nv50_devinit_ctor(struct nvkm_object *parent, struct nvkm_object *engine, nv50_devinit_new_(const struct nvkm_devinit_func *func,
struct nvkm_oclass *oclass, void *data, u32 size, struct nvkm_device *device, int index,
struct nvkm_object **pobject) struct nvkm_devinit **pinit)
{ {
struct nv50_devinit *init; struct nv50_devinit *init;
int ret;
ret = nvkm_devinit_create(parent, engine, oclass, &init); if (!(init = kzalloc(sizeof(*init), GFP_KERNEL)))
*pobject = nv_object(init); return -ENOMEM;
if (ret) *pinit = &init->base;
return ret;
nvkm_devinit_ctor(func, device, index, &init->base);
return 0; return 0;
} }
struct nvkm_oclass * static const struct nvkm_devinit_func
nv50_devinit_oclass = &(struct nvkm_devinit_impl) { nv50_devinit = {
.base.handle = NV_SUBDEV(DEVINIT, 0x50), .preinit = nv50_devinit_preinit,
.base.ofuncs = &(struct nvkm_ofuncs) { .init = nv50_devinit_init,
.ctor = nv50_devinit_ctor, .post = nv04_devinit_post,
.dtor = _nvkm_devinit_dtor,
.init = nv50_devinit_init,
.fini = _nvkm_devinit_fini,
},
.pll_set = nv50_devinit_pll_set, .pll_set = nv50_devinit_pll_set,
.disable = nv50_devinit_disable, .disable = nv50_devinit_disable,
.post = nvbios_init, };
}.base;
int
nv50_devinit_new(struct nvkm_device *device, int index,
struct nvkm_devinit **pinit)
{
return nv50_devinit_new_(&nv50_devinit, device, index, pinit);
}
#ifndef __NVKM_DEVINIT_NV50_H__ #ifndef __NV50_DEVINIT_H__
#define __NVKM_DEVINIT_NV50_H__ #define __NV50_DEVINIT_H__
#define nv50_devinit(p) container_of((p), struct nv50_devinit, base)
#include "priv.h" #include "priv.h"
struct nv50_devinit { struct nv50_devinit {
...@@ -7,10 +8,10 @@ struct nv50_devinit { ...@@ -7,10 +8,10 @@ struct nv50_devinit {
u32 r001540; u32 r001540;
}; };
int nv50_devinit_ctor(struct nvkm_object *, struct nvkm_object *, int nv50_devinit_new_(const struct nvkm_devinit_func *, struct nvkm_device *,
struct nvkm_oclass *, void *, u32, int, struct nvkm_devinit **);
struct nvkm_object **); void nv50_devinit_preinit(struct nvkm_devinit *);
int nv50_devinit_init(struct nvkm_object *); void nv50_devinit_init(struct nvkm_devinit *);
int nv50_devinit_pll_set(struct nvkm_devinit *, u32, u32); int nv50_devinit_pll_set(struct nvkm_devinit *, u32, u32);
int gt215_devinit_pll_set(struct nvkm_devinit *, u32, u32); int gt215_devinit_pll_set(struct nvkm_devinit *, u32, u32);
......
#ifndef __NVKM_DEVINIT_PRIV_H__ #ifndef __NVKM_DEVINIT_PRIV_H__
#define __NVKM_DEVINIT_PRIV_H__ #define __NVKM_DEVINIT_PRIV_H__
#define nvkm_devinit(p) container_of((p), struct nvkm_devinit, subdev)
#include <subdev/devinit.h> #include <subdev/devinit.h>
struct nvkm_devinit_impl { struct nvkm_devinit_func {
struct nvkm_oclass base; void *(*dtor)(struct nvkm_devinit *);
void (*preinit)(struct nvkm_devinit *);
void (*init)(struct nvkm_devinit *);
int (*post)(struct nvkm_devinit *, bool post);
u32 (*mmio)(struct nvkm_devinit *, u32);
void (*meminit)(struct nvkm_devinit *); void (*meminit)(struct nvkm_devinit *);
int (*pll_set)(struct nvkm_devinit *, u32 type, u32 freq); int (*pll_set)(struct nvkm_devinit *, u32 type, u32 freq);
u64 (*disable)(struct nvkm_devinit *); u64 (*disable)(struct nvkm_devinit *);
u32 (*mmio)(struct nvkm_devinit *, u32);
int (*post)(struct nvkm_subdev *, bool);
}; };
#define nvkm_devinit_create(p,e,o,d) \ void nvkm_devinit_ctor(const struct nvkm_devinit_func *, struct nvkm_device *,
nvkm_devinit_create_((p), (e), (o), sizeof(**d), (void **)d) int index, struct nvkm_devinit *);
#define nvkm_devinit_destroy(p) ({ \
struct nvkm_devinit *d = (p); \
_nvkm_devinit_dtor(nv_object(d)); \
})
#define nvkm_devinit_init(p) ({ \
struct nvkm_devinit *d = (p); \
_nvkm_devinit_init(nv_object(d)); \
})
#define nvkm_devinit_fini(p,s) ({ \
struct nvkm_devinit *d = (p); \
_nvkm_devinit_fini(nv_object(d), (s)); \
})
int nvkm_devinit_create_(struct nvkm_object *, struct nvkm_object *, int nv04_devinit_post(struct nvkm_devinit *, bool);
struct nvkm_oclass *, int, void **);
void _nvkm_devinit_dtor(struct nvkm_object *);
int _nvkm_devinit_init(struct nvkm_object *);
int _nvkm_devinit_fini(struct nvkm_object *, bool suspend);
#endif #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