Commit b8a89f53 authored by Dave Airlie's avatar Dave Airlie

Merge branch 'linux-4.16' of git://github.com/skeggsb/linux into drm-next

- initial kepler clock gating support
- atomic gamma handling fixes
- support for gp108 "secure boot" (enables acceleration, finally)

* 'linux-4.16' of git://github.com/skeggsb/linux:
  drm/nouveau/clk: fix gcc-7 -Wint-in-bool-context warning
  drm/nouveau/mmu: Fix trailing semicolon
  drm/nouveau: Introduce NvPmEnableGating option
  drm/nouveau: Add support for SLCG for Kepler2
  drm/nouveau: Add support for BLCG on Kepler2
  drm/nouveau: Add support for BLCG on Kepler1
  drm/nouveau: Add support for basic clockgating on Kepler1
  drm/nouveau/kms/nv50: fix handling of gamma since atomic conversion
  drm/nouveau/kms/nv50: use INTERPOLATE_257_UNITY_RANGE LUT on newer chipsets
  drm/nouveau/kms/nv50: use "low res" lut for indexed mode
  drm/nouveau/kms/nv50: prepare for double-buffered LUTs
  drm/nouveau/bo: add helper functions for handling pinned+mapped buffers
  drm/nouveau/fbcon: add module parameter to select bits-per-pixel
  drm/nouveau/secboot/gp108: implement on top of acr_r370
  drm/nouveau/secboot/r370: implement support for booting LS SEC2 ucode
  drm/nouveau/secboot/r370: move a bunch of r375 stuff to a new implementation
  drm/nouveau: nouveau: use correct string length
  drm/nouveau/drm/nouveau/mmu: fix odd_ptr_err.cocci warnings
  drm/nouveau/pmu/fuc: don't use movw directly anymore
parents d6a841a4 b515483e
...@@ -75,6 +75,7 @@ int mcp89_fb_new(struct nvkm_device *, int, struct nvkm_fb **); ...@@ -75,6 +75,7 @@ int mcp89_fb_new(struct nvkm_device *, int, struct nvkm_fb **);
int gf100_fb_new(struct nvkm_device *, int, struct nvkm_fb **); int gf100_fb_new(struct nvkm_device *, int, struct nvkm_fb **);
int gf108_fb_new(struct nvkm_device *, int, struct nvkm_fb **); int gf108_fb_new(struct nvkm_device *, int, struct nvkm_fb **);
int gk104_fb_new(struct nvkm_device *, int, struct nvkm_fb **); int gk104_fb_new(struct nvkm_device *, int, struct nvkm_fb **);
int gk110_fb_new(struct nvkm_device *, int, struct nvkm_fb **);
int gk20a_fb_new(struct nvkm_device *, int, struct nvkm_fb **); int gk20a_fb_new(struct nvkm_device *, int, struct nvkm_fb **);
int gm107_fb_new(struct nvkm_device *, int, struct nvkm_fb **); int gm107_fb_new(struct nvkm_device *, int, struct nvkm_fb **);
int gm200_fb_new(struct nvkm_device *, int, struct nvkm_fb **); int gm200_fb_new(struct nvkm_device *, int, struct nvkm_fb **);
......
...@@ -60,6 +60,7 @@ int nvkm_secboot_reset(struct nvkm_secboot *, unsigned long); ...@@ -60,6 +60,7 @@ int nvkm_secboot_reset(struct nvkm_secboot *, unsigned long);
int gm200_secboot_new(struct nvkm_device *, int, struct nvkm_secboot **); int gm200_secboot_new(struct nvkm_device *, int, struct nvkm_secboot **);
int gm20b_secboot_new(struct nvkm_device *, int, struct nvkm_secboot **); int gm20b_secboot_new(struct nvkm_device *, int, struct nvkm_secboot **);
int gp102_secboot_new(struct nvkm_device *, int, struct nvkm_secboot **); int gp102_secboot_new(struct nvkm_device *, int, struct nvkm_secboot **);
int gp108_secboot_new(struct nvkm_device *, int, struct nvkm_secboot **);
int gp10b_secboot_new(struct nvkm_device *, int, struct nvkm_secboot **); int gp10b_secboot_new(struct nvkm_device *, int, struct nvkm_secboot **);
#endif #endif
...@@ -46,6 +46,16 @@ enum nvkm_therm_attr_type { ...@@ -46,6 +46,16 @@ enum nvkm_therm_attr_type {
NVKM_THERM_ATTR_THRS_SHUTDOWN_HYST = 17, NVKM_THERM_ATTR_THRS_SHUTDOWN_HYST = 17,
}; };
struct nvkm_therm_clkgate_init {
u32 addr;
u8 count;
u32 data;
};
struct nvkm_therm_clkgate_pack {
const struct nvkm_therm_clkgate_init *init;
};
struct nvkm_therm { struct nvkm_therm {
const struct nvkm_therm_func *func; const struct nvkm_therm_func *func;
struct nvkm_subdev subdev; struct nvkm_subdev subdev;
...@@ -85,17 +95,24 @@ struct nvkm_therm { ...@@ -85,17 +95,24 @@ struct nvkm_therm {
int (*attr_get)(struct nvkm_therm *, enum nvkm_therm_attr_type); int (*attr_get)(struct nvkm_therm *, enum nvkm_therm_attr_type);
int (*attr_set)(struct nvkm_therm *, enum nvkm_therm_attr_type, int); int (*attr_set)(struct nvkm_therm *, enum nvkm_therm_attr_type, int);
bool clkgating_enabled;
}; };
int nvkm_therm_temp_get(struct nvkm_therm *); int nvkm_therm_temp_get(struct nvkm_therm *);
int nvkm_therm_fan_sense(struct nvkm_therm *); int nvkm_therm_fan_sense(struct nvkm_therm *);
int nvkm_therm_cstate(struct nvkm_therm *, int, int); int nvkm_therm_cstate(struct nvkm_therm *, int, int);
void nvkm_therm_clkgate_init(struct nvkm_therm *,
const struct nvkm_therm_clkgate_pack *);
void nvkm_therm_clkgate_enable(struct nvkm_therm *);
void nvkm_therm_clkgate_fini(struct nvkm_therm *, bool);
int nv40_therm_new(struct nvkm_device *, int, struct nvkm_therm **); int nv40_therm_new(struct nvkm_device *, int, struct nvkm_therm **);
int nv50_therm_new(struct nvkm_device *, int, struct nvkm_therm **); int nv50_therm_new(struct nvkm_device *, int, struct nvkm_therm **);
int g84_therm_new(struct nvkm_device *, int, struct nvkm_therm **); int g84_therm_new(struct nvkm_device *, int, struct nvkm_therm **);
int gt215_therm_new(struct nvkm_device *, int, struct nvkm_therm **); int gt215_therm_new(struct nvkm_device *, int, struct nvkm_therm **);
int gf119_therm_new(struct nvkm_device *, int, struct nvkm_therm **); int gf119_therm_new(struct nvkm_device *, int, struct nvkm_therm **);
int gk104_therm_new(struct nvkm_device *, int, struct nvkm_therm **);
int gm107_therm_new(struct nvkm_device *, int, struct nvkm_therm **); int gm107_therm_new(struct nvkm_device *, int, struct nvkm_therm **);
int gm200_therm_new(struct nvkm_device *, int, struct nvkm_therm **); int gm200_therm_new(struct nvkm_device *, int, struct nvkm_therm **);
int gp100_therm_new(struct nvkm_device *, int, struct nvkm_therm **); int gp100_therm_new(struct nvkm_device *, int, struct nvkm_therm **);
......
...@@ -105,4 +105,32 @@ nvbo_kmap_obj_iovirtual(struct nouveau_bo *nvbo) ...@@ -105,4 +105,32 @@ nvbo_kmap_obj_iovirtual(struct nouveau_bo *nvbo)
return ioptr; return ioptr;
} }
static inline void
nouveau_bo_unmap_unpin_unref(struct nouveau_bo **pnvbo)
{
if (*pnvbo) {
nouveau_bo_unmap(*pnvbo);
nouveau_bo_unpin(*pnvbo);
nouveau_bo_ref(NULL, pnvbo);
}
}
static inline int
nouveau_bo_new_pin_map(struct nouveau_cli *cli, u64 size, int align, u32 flags,
struct nouveau_bo **pnvbo)
{
int ret = nouveau_bo_new(cli, size, align, flags,
0, 0, NULL, NULL, pnvbo);
if (ret == 0) {
ret = nouveau_bo_pin(*pnvbo, flags, true);
if (ret == 0) {
ret = nouveau_bo_map(*pnvbo);
if (ret == 0)
return ret;
nouveau_bo_unpin(*pnvbo);
}
nouveau_bo_ref(NULL, pnvbo);
}
return ret;
}
#endif #endif
...@@ -60,7 +60,6 @@ struct nouveau_crtc { ...@@ -60,7 +60,6 @@ struct nouveau_crtc {
} cursor; } cursor;
struct { struct {
struct nouveau_bo *nvbo;
int depth; int depth;
} lut; } lut;
......
...@@ -56,6 +56,10 @@ MODULE_PARM_DESC(nofbaccel, "Disable fbcon acceleration"); ...@@ -56,6 +56,10 @@ MODULE_PARM_DESC(nofbaccel, "Disable fbcon acceleration");
int nouveau_nofbaccel = 0; int nouveau_nofbaccel = 0;
module_param_named(nofbaccel, nouveau_nofbaccel, int, 0400); module_param_named(nofbaccel, nouveau_nofbaccel, int, 0400);
MODULE_PARM_DESC(fbcon_bpp, "fbcon bits-per-pixel (default: auto)");
static int nouveau_fbcon_bpp;
module_param_named(fbcon_bpp, nouveau_fbcon_bpp, int, 0400);
static void static void
nouveau_fbcon_fillrect(struct fb_info *info, const struct fb_fillrect *rect) nouveau_fbcon_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
{ {
...@@ -488,7 +492,7 @@ nouveau_fbcon_init(struct drm_device *dev) ...@@ -488,7 +492,7 @@ nouveau_fbcon_init(struct drm_device *dev)
{ {
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_fbdev *fbcon; struct nouveau_fbdev *fbcon;
int preferred_bpp; int preferred_bpp = nouveau_fbcon_bpp;
int ret; int ret;
if (!dev->mode_config.num_crtc || if (!dev->mode_config.num_crtc ||
...@@ -512,13 +516,15 @@ nouveau_fbcon_init(struct drm_device *dev) ...@@ -512,13 +516,15 @@ nouveau_fbcon_init(struct drm_device *dev)
if (ret) if (ret)
goto fini; goto fini;
if (drm->client.device.info.ram_size <= 32 * 1024 * 1024) if (preferred_bpp != 8 && preferred_bpp != 16 && preferred_bpp != 32) {
preferred_bpp = 8; if (drm->client.device.info.ram_size <= 32 * 1024 * 1024)
else preferred_bpp = 8;
if (drm->client.device.info.ram_size <= 64 * 1024 * 1024) else
preferred_bpp = 16; if (drm->client.device.info.ram_size <= 64 * 1024 * 1024)
else preferred_bpp = 16;
preferred_bpp = 32; else
preferred_bpp = 32;
}
/* disable all the possible outputs/crtcs before entering KMS mode */ /* disable all the possible outputs/crtcs before entering KMS mode */
if (!drm_drv_uses_atomic_modeset(dev)) if (!drm_drv_uses_atomic_modeset(dev))
......
...@@ -137,8 +137,10 @@ struct nv50_head_atom { ...@@ -137,8 +137,10 @@ struct nv50_head_atom {
} mode; } mode;
struct { struct {
bool visible;
u32 handle; u32 handle;
u64 offset:40; u64 offset:40;
u8 mode:4;
} lut; } lut;
struct { struct {
...@@ -192,6 +194,7 @@ struct nv50_head_atom { ...@@ -192,6 +194,7 @@ struct nv50_head_atom {
union { union {
struct { struct {
bool ilut:1;
bool core:1; bool core:1;
bool curs:1; bool curs:1;
}; };
...@@ -200,6 +203,7 @@ struct nv50_head_atom { ...@@ -200,6 +203,7 @@ struct nv50_head_atom {
union { union {
struct { struct {
bool ilut:1;
bool core:1; bool core:1;
bool curs:1; bool curs:1;
bool view:1; bool view:1;
...@@ -660,6 +664,10 @@ nv50_ovly_create(struct nvif_device *device, struct nvif_object *disp, ...@@ -660,6 +664,10 @@ nv50_ovly_create(struct nvif_device *device, struct nvif_object *disp,
struct nv50_head { struct nv50_head {
struct nouveau_crtc base; struct nouveau_crtc base;
struct {
struct nouveau_bo *nvbo[2];
int next;
} lut;
struct nv50_ovly ovly; struct nv50_ovly ovly;
struct nv50_oimm oimm; struct nv50_oimm oimm;
}; };
...@@ -1794,6 +1802,54 @@ nv50_head_lut_clr(struct nv50_head *head) ...@@ -1794,6 +1802,54 @@ nv50_head_lut_clr(struct nv50_head *head)
} }
} }
static void
nv50_head_lut_load(struct drm_property_blob *blob, int mode,
struct nouveau_bo *nvbo)
{
struct drm_color_lut *in = (struct drm_color_lut *)blob->data;
void __iomem *lut = (u8 *)nvbo_kmap_obj_iovirtual(nvbo);
const int size = blob->length / sizeof(*in);
int bits, shift, i;
u16 zero, r, g, b;
/* This can't happen.. But it shuts the compiler up. */
if (WARN_ON(size != 256))
return;
switch (mode) {
case 0: /* LORES. */
case 1: /* HIRES. */
bits = 11;
shift = 3;
zero = 0x0000;
break;
case 7: /* INTERPOLATE_257_UNITY_RANGE. */
bits = 14;
shift = 0;
zero = 0x6000;
break;
default:
WARN_ON(1);
return;
}
for (i = 0; i < size; i++) {
r = (drm_color_lut_extract(in[i]. red, bits) + zero) << shift;
g = (drm_color_lut_extract(in[i].green, bits) + zero) << shift;
b = (drm_color_lut_extract(in[i]. blue, bits) + zero) << shift;
writew(r, lut + (i * 0x08) + 0);
writew(g, lut + (i * 0x08) + 2);
writew(b, lut + (i * 0x08) + 4);
}
/* INTERPOLATE modes require a "next" entry to interpolate with,
* so we replicate the last entry to deal with this for now.
*/
writew(r, lut + (i * 0x08) + 0);
writew(g, lut + (i * 0x08) + 2);
writew(b, lut + (i * 0x08) + 4);
}
static void static void
nv50_head_lut_set(struct nv50_head *head, struct nv50_head_atom *asyh) nv50_head_lut_set(struct nv50_head *head, struct nv50_head_atom *asyh)
{ {
...@@ -1802,18 +1858,18 @@ nv50_head_lut_set(struct nv50_head *head, struct nv50_head_atom *asyh) ...@@ -1802,18 +1858,18 @@ nv50_head_lut_set(struct nv50_head *head, struct nv50_head_atom *asyh)
if ((push = evo_wait(core, 7))) { if ((push = evo_wait(core, 7))) {
if (core->base.user.oclass < G82_DISP_CORE_CHANNEL_DMA) { if (core->base.user.oclass < G82_DISP_CORE_CHANNEL_DMA) {
evo_mthd(push, 0x0840 + (head->base.index * 0x400), 2); evo_mthd(push, 0x0840 + (head->base.index * 0x400), 2);
evo_data(push, 0xc0000000); evo_data(push, 0x80000000 | asyh->lut.mode << 30);
evo_data(push, asyh->lut.offset >> 8); evo_data(push, asyh->lut.offset >> 8);
} else } else
if (core->base.user.oclass < GF110_DISP_CORE_CHANNEL_DMA) { if (core->base.user.oclass < GF110_DISP_CORE_CHANNEL_DMA) {
evo_mthd(push, 0x0840 + (head->base.index * 0x400), 2); evo_mthd(push, 0x0840 + (head->base.index * 0x400), 2);
evo_data(push, 0xc0000000); evo_data(push, 0x80000000 | asyh->lut.mode << 30);
evo_data(push, asyh->lut.offset >> 8); evo_data(push, asyh->lut.offset >> 8);
evo_mthd(push, 0x085c + (head->base.index * 0x400), 1); evo_mthd(push, 0x085c + (head->base.index * 0x400), 1);
evo_data(push, asyh->lut.handle); evo_data(push, asyh->lut.handle);
} else { } else {
evo_mthd(push, 0x0440 + (head->base.index * 0x300), 4); evo_mthd(push, 0x0440 + (head->base.index * 0x300), 4);
evo_data(push, 0x83000000); evo_data(push, 0x80000000 | asyh->lut.mode << 24);
evo_data(push, asyh->lut.offset >> 8); evo_data(push, asyh->lut.offset >> 8);
evo_data(push, 0x00000000); evo_data(push, 0x00000000);
evo_data(push, 0x00000000); evo_data(push, 0x00000000);
...@@ -1896,7 +1952,7 @@ nv50_head_view(struct nv50_head *head, struct nv50_head_atom *asyh) ...@@ -1896,7 +1952,7 @@ nv50_head_view(struct nv50_head *head, struct nv50_head_atom *asyh)
static void static void
nv50_head_flush_clr(struct nv50_head *head, struct nv50_head_atom *asyh, bool y) nv50_head_flush_clr(struct nv50_head *head, struct nv50_head_atom *asyh, bool y)
{ {
if (asyh->clr.core && (!asyh->set.core || y)) if (asyh->clr.ilut && (!asyh->set.ilut || y))
nv50_head_lut_clr(head); nv50_head_lut_clr(head);
if (asyh->clr.core && (!asyh->set.core || y)) if (asyh->clr.core && (!asyh->set.core || y))
nv50_head_core_clr(head); nv50_head_core_clr(head);
...@@ -1909,7 +1965,15 @@ nv50_head_flush_set(struct nv50_head *head, struct nv50_head_atom *asyh) ...@@ -1909,7 +1965,15 @@ nv50_head_flush_set(struct nv50_head *head, struct nv50_head_atom *asyh)
{ {
if (asyh->set.view ) nv50_head_view (head, asyh); if (asyh->set.view ) nv50_head_view (head, asyh);
if (asyh->set.mode ) nv50_head_mode (head, asyh); if (asyh->set.mode ) nv50_head_mode (head, asyh);
if (asyh->set.core ) nv50_head_lut_set (head, asyh); if (asyh->set.ilut ) {
struct nouveau_bo *nvbo = head->lut.nvbo[head->lut.next];
struct drm_property_blob *blob = asyh->state.gamma_lut;
if (blob)
nv50_head_lut_load(blob, asyh->lut.mode, nvbo);
asyh->lut.offset = nvbo->bo.offset;
head->lut.next ^= 1;
nv50_head_lut_set(head, asyh);
}
if (asyh->set.core ) nv50_head_core_set(head, asyh); if (asyh->set.core ) nv50_head_core_set(head, asyh);
if (asyh->set.curs ) nv50_head_curs_set(head, asyh); if (asyh->set.curs ) nv50_head_curs_set(head, asyh);
if (asyh->set.base ) nv50_head_base (head, asyh); if (asyh->set.base ) nv50_head_base (head, asyh);
...@@ -2043,6 +2107,37 @@ nv50_head_atomic_check_view(struct nv50_head_atom *armh, ...@@ -2043,6 +2107,37 @@ nv50_head_atomic_check_view(struct nv50_head_atom *armh,
asyh->set.view = true; asyh->set.view = true;
} }
static void
nv50_head_atomic_check_lut(struct nv50_head *head,
struct nv50_head_atom *armh,
struct nv50_head_atom *asyh)
{
struct nv50_disp *disp = nv50_disp(head->base.base.dev);
/* An I8 surface without an input LUT makes no sense, and
* EVO will throw an error if you try.
*
* Legacy clients actually cause this due to the order in
* which they call ioctls, so we will enable the LUT with
* whatever contents the buffer already contains to avoid
* triggering the error check.
*/
if (!asyh->state.gamma_lut && asyh->base.cpp != 1) {
asyh->lut.handle = 0;
asyh->clr.ilut = armh->lut.visible;
return;
}
if (disp->disp->oclass < GF110_DISP) {
asyh->lut.mode = (asyh->base.cpp == 1) ? 0 : 1;
asyh->set.ilut = true;
} else {
asyh->lut.mode = 7;
asyh->set.ilut = asyh->state.color_mgmt_changed;
}
asyh->lut.handle = disp->mast.base.vram.handle;
}
static void static void
nv50_head_atomic_check_mode(struct nv50_head *head, struct nv50_head_atom *asyh) nv50_head_atomic_check_mode(struct nv50_head *head, struct nv50_head_atom *asyh)
{ {
...@@ -2128,6 +2223,11 @@ nv50_head_atomic_check(struct drm_crtc *crtc, struct drm_crtc_state *state) ...@@ -2128,6 +2223,11 @@ nv50_head_atomic_check(struct drm_crtc *crtc, struct drm_crtc_state *state)
if (asyh->state.mode_changed) if (asyh->state.mode_changed)
nv50_head_atomic_check_mode(head, asyh); nv50_head_atomic_check_mode(head, asyh);
if (asyh->state.color_mgmt_changed ||
asyh->base.cpp != armh->base.cpp)
nv50_head_atomic_check_lut(head, armh, asyh);
asyh->lut.visible = asyh->lut.handle != 0;
if (asyc) { if (asyc) {
if (asyc->set.scaler) if (asyc->set.scaler)
nv50_head_atomic_check_view(armh, asyh, asyc); nv50_head_atomic_check_view(armh, asyh, asyc);
...@@ -2143,7 +2243,8 @@ nv50_head_atomic_check(struct drm_crtc *crtc, struct drm_crtc_state *state) ...@@ -2143,7 +2243,8 @@ nv50_head_atomic_check(struct drm_crtc *crtc, struct drm_crtc_state *state)
asyh->core.w = asyh->base.w; asyh->core.w = asyh->base.w;
asyh->core.h = asyh->base.h; asyh->core.h = asyh->base.h;
} else } else
if ((asyh->core.visible = asyh->curs.visible)) { if ((asyh->core.visible = asyh->curs.visible) ||
(asyh->core.visible = asyh->lut.visible)) {
/*XXX: We need to either find some way of having the /*XXX: We need to either find some way of having the
* primary base layer appear black, while still * primary base layer appear black, while still
* being able to display the other layers, or we * being able to display the other layers, or we
...@@ -2161,11 +2262,10 @@ nv50_head_atomic_check(struct drm_crtc *crtc, struct drm_crtc_state *state) ...@@ -2161,11 +2262,10 @@ nv50_head_atomic_check(struct drm_crtc *crtc, struct drm_crtc_state *state)
asyh->core.layout = 1; asyh->core.layout = 1;
asyh->core.block = 0; asyh->core.block = 0;
asyh->core.pitch = ALIGN(asyh->core.w, 64) * 4; asyh->core.pitch = ALIGN(asyh->core.w, 64) * 4;
asyh->lut.handle = disp->mast.base.vram.handle;
asyh->lut.offset = head->base.lut.nvbo->bo.offset;
asyh->set.base = armh->base.cpp != asyh->base.cpp; asyh->set.base = armh->base.cpp != asyh->base.cpp;
asyh->set.ovly = armh->ovly.cpp != asyh->ovly.cpp; asyh->set.ovly = armh->ovly.cpp != asyh->ovly.cpp;
} else { } else {
asyh->lut.visible = false;
asyh->core.visible = false; asyh->core.visible = false;
asyh->curs.visible = false; asyh->curs.visible = false;
asyh->base.cpp = 0; asyh->base.cpp = 0;
...@@ -2189,8 +2289,10 @@ nv50_head_atomic_check(struct drm_crtc *crtc, struct drm_crtc_state *state) ...@@ -2189,8 +2289,10 @@ nv50_head_atomic_check(struct drm_crtc *crtc, struct drm_crtc_state *state)
asyh->clr.curs = true; asyh->clr.curs = true;
} }
} else { } else {
asyh->clr.ilut = armh->lut.visible;
asyh->clr.core = armh->core.visible; asyh->clr.core = armh->core.visible;
asyh->clr.curs = armh->curs.visible; asyh->clr.curs = armh->curs.visible;
asyh->set.ilut = asyh->lut.visible;
asyh->set.core = asyh->core.visible; asyh->set.core = asyh->core.visible;
asyh->set.curs = asyh->curs.visible; asyh->set.curs = asyh->curs.visible;
} }
...@@ -2200,47 +2302,11 @@ nv50_head_atomic_check(struct drm_crtc *crtc, struct drm_crtc_state *state) ...@@ -2200,47 +2302,11 @@ nv50_head_atomic_check(struct drm_crtc *crtc, struct drm_crtc_state *state)
return 0; return 0;
} }
static void
nv50_head_lut_load(struct drm_crtc *crtc)
{
struct nv50_disp *disp = nv50_disp(crtc->dev);
struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc);
void __iomem *lut = nvbo_kmap_obj_iovirtual(nv_crtc->lut.nvbo);
u16 *r, *g, *b;
int i;
r = crtc->gamma_store;
g = r + crtc->gamma_size;
b = g + crtc->gamma_size;
for (i = 0; i < 256; i++) {
if (disp->disp->oclass < GF110_DISP) {
writew((*r++ >> 2) + 0x0000, lut + (i * 0x08) + 0);
writew((*g++ >> 2) + 0x0000, lut + (i * 0x08) + 2);
writew((*b++ >> 2) + 0x0000, lut + (i * 0x08) + 4);
} else {
/* 0x6000 interferes with the 14-bit color??? */
writew((*r++ >> 2) + 0x6000, lut + (i * 0x20) + 0);
writew((*g++ >> 2) + 0x6000, lut + (i * 0x20) + 2);
writew((*b++ >> 2) + 0x6000, lut + (i * 0x20) + 4);
}
}
}
static const struct drm_crtc_helper_funcs static const struct drm_crtc_helper_funcs
nv50_head_help = { nv50_head_help = {
.atomic_check = nv50_head_atomic_check, .atomic_check = nv50_head_atomic_check,
}; };
static int
nv50_head_gamma_set(struct drm_crtc *crtc, u16 *r, u16 *g, u16 *b,
uint32_t size,
struct drm_modeset_acquire_ctx *ctx)
{
nv50_head_lut_load(crtc);
return 0;
}
static void static void
nv50_head_atomic_destroy_state(struct drm_crtc *crtc, nv50_head_atomic_destroy_state(struct drm_crtc *crtc,
struct drm_crtc_state *state) struct drm_crtc_state *state)
...@@ -2296,17 +2362,15 @@ nv50_head_reset(struct drm_crtc *crtc) ...@@ -2296,17 +2362,15 @@ nv50_head_reset(struct drm_crtc *crtc)
static void static void
nv50_head_destroy(struct drm_crtc *crtc) nv50_head_destroy(struct drm_crtc *crtc)
{ {
struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc);
struct nv50_disp *disp = nv50_disp(crtc->dev); struct nv50_disp *disp = nv50_disp(crtc->dev);
struct nv50_head *head = nv50_head(crtc); struct nv50_head *head = nv50_head(crtc);
int i;
nv50_dmac_destroy(&head->ovly.base, disp->disp); nv50_dmac_destroy(&head->ovly.base, disp->disp);
nv50_pioc_destroy(&head->oimm.base); nv50_pioc_destroy(&head->oimm.base);
nouveau_bo_unmap(nv_crtc->lut.nvbo); for (i = 0; i < ARRAY_SIZE(head->lut.nvbo); i++)
if (nv_crtc->lut.nvbo) nouveau_bo_unmap_unpin_unref(&head->lut.nvbo[i]);
nouveau_bo_unpin(nv_crtc->lut.nvbo);
nouveau_bo_ref(NULL, &nv_crtc->lut.nvbo);
drm_crtc_cleanup(crtc); drm_crtc_cleanup(crtc);
kfree(crtc); kfree(crtc);
...@@ -2315,7 +2379,7 @@ nv50_head_destroy(struct drm_crtc *crtc) ...@@ -2315,7 +2379,7 @@ nv50_head_destroy(struct drm_crtc *crtc)
static const struct drm_crtc_funcs static const struct drm_crtc_funcs
nv50_head_func = { nv50_head_func = {
.reset = nv50_head_reset, .reset = nv50_head_reset,
.gamma_set = nv50_head_gamma_set, .gamma_set = drm_atomic_helper_legacy_gamma_set,
.destroy = nv50_head_destroy, .destroy = nv50_head_destroy,
.set_config = drm_atomic_helper_set_config, .set_config = drm_atomic_helper_set_config,
.page_flip = drm_atomic_helper_page_flip, .page_flip = drm_atomic_helper_page_flip,
...@@ -2333,7 +2397,7 @@ nv50_head_create(struct drm_device *dev, int index) ...@@ -2333,7 +2397,7 @@ nv50_head_create(struct drm_device *dev, int index)
struct nv50_base *base; struct nv50_base *base;
struct nv50_curs *curs; struct nv50_curs *curs;
struct drm_crtc *crtc; struct drm_crtc *crtc;
int ret; int ret, i;
head = kzalloc(sizeof(*head), GFP_KERNEL); head = kzalloc(sizeof(*head), GFP_KERNEL);
if (!head) if (!head)
...@@ -2355,22 +2419,14 @@ nv50_head_create(struct drm_device *dev, int index) ...@@ -2355,22 +2419,14 @@ nv50_head_create(struct drm_device *dev, int index)
drm_crtc_helper_add(crtc, &nv50_head_help); drm_crtc_helper_add(crtc, &nv50_head_help);
drm_mode_crtc_set_gamma_size(crtc, 256); drm_mode_crtc_set_gamma_size(crtc, 256);
ret = nouveau_bo_new(&drm->client, 8192, 0x100, TTM_PL_FLAG_VRAM, for (i = 0; i < ARRAY_SIZE(head->lut.nvbo); i++) {
0, 0x0000, NULL, NULL, &head->base.lut.nvbo); ret = nouveau_bo_new_pin_map(&drm->client, 1025 * 8, 0x100,
if (!ret) { TTM_PL_FLAG_VRAM,
ret = nouveau_bo_pin(head->base.lut.nvbo, TTM_PL_FLAG_VRAM, true); &head->lut.nvbo[i]);
if (!ret) {
ret = nouveau_bo_map(head->base.lut.nvbo);
if (ret)
nouveau_bo_unpin(head->base.lut.nvbo);
}
if (ret) if (ret)
nouveau_bo_ref(NULL, &head->base.lut.nvbo); goto out;
} }
if (ret)
goto out;
/* allocate overlay resources */ /* allocate overlay resources */
ret = nv50_oimm_create(device, disp->disp, index, &head->oimm); ret = nv50_oimm_create(device, disp->disp, index, &head->oimm);
if (ret) if (ret)
...@@ -4350,7 +4406,6 @@ nv50_display_init(struct drm_device *dev) ...@@ -4350,7 +4406,6 @@ nv50_display_init(struct drm_device *dev)
{ {
struct drm_encoder *encoder; struct drm_encoder *encoder;
struct drm_plane *plane; struct drm_plane *plane;
struct drm_crtc *crtc;
u32 *push; u32 *push;
push = evo_wait(nv50_mast(dev), 32); push = evo_wait(nv50_mast(dev), 32);
...@@ -4369,10 +4424,6 @@ nv50_display_init(struct drm_device *dev) ...@@ -4369,10 +4424,6 @@ nv50_display_init(struct drm_device *dev)
} }
} }
drm_for_each_crtc(crtc, dev) {
nv50_head_lut_load(crtc);
}
drm_for_each_plane(plane, dev) { drm_for_each_plane(plane, dev) {
struct nv50_wndw *wndw = nv50_wndw(plane); struct nv50_wndw *wndw = nv50_wndw(plane);
if (plane->funcs != &nv50_wndw) if (plane->funcs != &nv50_wndw)
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <core/option.h> #include <core/option.h>
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/therm.h>
static DEFINE_MUTEX(nv_devices_mutex); static DEFINE_MUTEX(nv_devices_mutex);
static LIST_HEAD(nv_devices); static LIST_HEAD(nv_devices);
...@@ -1682,7 +1683,7 @@ nve4_chipset = { ...@@ -1682,7 +1683,7 @@ nve4_chipset = {
.mxm = nv50_mxm_new, .mxm = nv50_mxm_new,
.pci = gk104_pci_new, .pci = gk104_pci_new,
.pmu = gk104_pmu_new, .pmu = gk104_pmu_new,
.therm = gf119_therm_new, .therm = gk104_therm_new,
.timer = nv41_timer_new, .timer = nv41_timer_new,
.top = gk104_top_new, .top = gk104_top_new,
.volt = gk104_volt_new, .volt = gk104_volt_new,
...@@ -1721,7 +1722,7 @@ nve6_chipset = { ...@@ -1721,7 +1722,7 @@ nve6_chipset = {
.mxm = nv50_mxm_new, .mxm = nv50_mxm_new,
.pci = gk104_pci_new, .pci = gk104_pci_new,
.pmu = gk104_pmu_new, .pmu = gk104_pmu_new,
.therm = gf119_therm_new, .therm = gk104_therm_new,
.timer = nv41_timer_new, .timer = nv41_timer_new,
.top = gk104_top_new, .top = gk104_top_new,
.volt = gk104_volt_new, .volt = gk104_volt_new,
...@@ -1760,7 +1761,7 @@ nve7_chipset = { ...@@ -1760,7 +1761,7 @@ nve7_chipset = {
.mxm = nv50_mxm_new, .mxm = nv50_mxm_new,
.pci = gk104_pci_new, .pci = gk104_pci_new,
.pmu = gk104_pmu_new, .pmu = gk104_pmu_new,
.therm = gf119_therm_new, .therm = gk104_therm_new,
.timer = nv41_timer_new, .timer = nv41_timer_new,
.top = gk104_top_new, .top = gk104_top_new,
.volt = gk104_volt_new, .volt = gk104_volt_new,
...@@ -1811,7 +1812,7 @@ nvf0_chipset = { ...@@ -1811,7 +1812,7 @@ nvf0_chipset = {
.bus = gf100_bus_new, .bus = gf100_bus_new,
.clk = gk104_clk_new, .clk = gk104_clk_new,
.devinit = gf100_devinit_new, .devinit = gf100_devinit_new,
.fb = gk104_fb_new, .fb = gk110_fb_new,
.fuse = gf100_fuse_new, .fuse = gf100_fuse_new,
.gpio = gk104_gpio_new, .gpio = gk104_gpio_new,
.i2c = gk104_i2c_new, .i2c = gk104_i2c_new,
...@@ -1824,7 +1825,7 @@ nvf0_chipset = { ...@@ -1824,7 +1825,7 @@ nvf0_chipset = {
.mxm = nv50_mxm_new, .mxm = nv50_mxm_new,
.pci = gk104_pci_new, .pci = gk104_pci_new,
.pmu = gk110_pmu_new, .pmu = gk110_pmu_new,
.therm = gf119_therm_new, .therm = gk104_therm_new,
.timer = nv41_timer_new, .timer = nv41_timer_new,
.top = gk104_top_new, .top = gk104_top_new,
.volt = gk104_volt_new, .volt = gk104_volt_new,
...@@ -1849,7 +1850,7 @@ nvf1_chipset = { ...@@ -1849,7 +1850,7 @@ nvf1_chipset = {
.bus = gf100_bus_new, .bus = gf100_bus_new,
.clk = gk104_clk_new, .clk = gk104_clk_new,
.devinit = gf100_devinit_new, .devinit = gf100_devinit_new,
.fb = gk104_fb_new, .fb = gk110_fb_new,
.fuse = gf100_fuse_new, .fuse = gf100_fuse_new,
.gpio = gk104_gpio_new, .gpio = gk104_gpio_new,
.i2c = gk104_i2c_new, .i2c = gk104_i2c_new,
...@@ -1862,7 +1863,7 @@ nvf1_chipset = { ...@@ -1862,7 +1863,7 @@ nvf1_chipset = {
.mxm = nv50_mxm_new, .mxm = nv50_mxm_new,
.pci = gk104_pci_new, .pci = gk104_pci_new,
.pmu = gk110_pmu_new, .pmu = gk110_pmu_new,
.therm = gf119_therm_new, .therm = gk104_therm_new,
.timer = nv41_timer_new, .timer = nv41_timer_new,
.top = gk104_top_new, .top = gk104_top_new,
.volt = gk104_volt_new, .volt = gk104_volt_new,
...@@ -1887,7 +1888,7 @@ nv106_chipset = { ...@@ -1887,7 +1888,7 @@ nv106_chipset = {
.bus = gf100_bus_new, .bus = gf100_bus_new,
.clk = gk104_clk_new, .clk = gk104_clk_new,
.devinit = gf100_devinit_new, .devinit = gf100_devinit_new,
.fb = gk104_fb_new, .fb = gk110_fb_new,
.fuse = gf100_fuse_new, .fuse = gf100_fuse_new,
.gpio = gk104_gpio_new, .gpio = gk104_gpio_new,
.i2c = gk104_i2c_new, .i2c = gk104_i2c_new,
...@@ -1900,7 +1901,7 @@ nv106_chipset = { ...@@ -1900,7 +1901,7 @@ nv106_chipset = {
.mxm = nv50_mxm_new, .mxm = nv50_mxm_new,
.pci = gk104_pci_new, .pci = gk104_pci_new,
.pmu = gk208_pmu_new, .pmu = gk208_pmu_new,
.therm = gf119_therm_new, .therm = gk104_therm_new,
.timer = nv41_timer_new, .timer = nv41_timer_new,
.top = gk104_top_new, .top = gk104_top_new,
.volt = gk104_volt_new, .volt = gk104_volt_new,
...@@ -1925,7 +1926,7 @@ nv108_chipset = { ...@@ -1925,7 +1926,7 @@ nv108_chipset = {
.bus = gf100_bus_new, .bus = gf100_bus_new,
.clk = gk104_clk_new, .clk = gk104_clk_new,
.devinit = gf100_devinit_new, .devinit = gf100_devinit_new,
.fb = gk104_fb_new, .fb = gk110_fb_new,
.fuse = gf100_fuse_new, .fuse = gf100_fuse_new,
.gpio = gk104_gpio_new, .gpio = gk104_gpio_new,
.i2c = gk104_i2c_new, .i2c = gk104_i2c_new,
...@@ -1938,7 +1939,7 @@ nv108_chipset = { ...@@ -1938,7 +1939,7 @@ nv108_chipset = {
.mxm = nv50_mxm_new, .mxm = nv50_mxm_new,
.pci = gk104_pci_new, .pci = gk104_pci_new,
.pmu = gk208_pmu_new, .pmu = gk208_pmu_new,
.therm = gf119_therm_new, .therm = gk104_therm_new,
.timer = nv41_timer_new, .timer = nv41_timer_new,
.top = gk104_top_new, .top = gk104_top_new,
.volt = gk104_volt_new, .volt = gk104_volt_new,
...@@ -2345,6 +2346,7 @@ nv138_chipset = { ...@@ -2345,6 +2346,7 @@ nv138_chipset = {
.mc = gp100_mc_new, .mc = gp100_mc_new,
.mmu = gp100_mmu_new, .mmu = gp100_mmu_new,
.therm = gp100_therm_new, .therm = gp100_therm_new,
.secboot = gp108_secboot_new,
.pci = gp100_pci_new, .pci = gp100_pci_new,
.pmu = gp102_pmu_new, .pmu = gp102_pmu_new,
.timer = gk20a_timer_new, .timer = gk20a_timer_new,
...@@ -2356,6 +2358,10 @@ nv138_chipset = { ...@@ -2356,6 +2358,10 @@ nv138_chipset = {
.disp = gp102_disp_new, .disp = gp102_disp_new,
.dma = gf119_dma_new, .dma = gf119_dma_new,
.fifo = gp100_fifo_new, .fifo = gp100_fifo_new,
.gr = gp107_gr_new,
.nvdec = gp102_nvdec_new,
.sec2 = gp102_sec2_new,
.sw = gf100_sw_new,
}; };
static const struct nvkm_device_chip static const struct nvkm_device_chip
...@@ -2508,6 +2514,7 @@ nvkm_device_fini(struct nvkm_device *device, bool suspend) ...@@ -2508,6 +2514,7 @@ nvkm_device_fini(struct nvkm_device *device, bool suspend)
} }
} }
nvkm_therm_clkgate_fini(device->therm, suspend);
if (device->func->fini) if (device->func->fini)
device->func->fini(device, suspend); device->func->fini(device, suspend);
...@@ -2597,6 +2604,7 @@ nvkm_device_init(struct nvkm_device *device) ...@@ -2597,6 +2604,7 @@ nvkm_device_init(struct nvkm_device *device)
} }
nvkm_acpi_init(device); nvkm_acpi_init(device);
nvkm_therm_clkgate_enable(device->therm);
time = ktime_to_us(ktime_get()) - time; time = ktime_to_us(ktime_get()) - time;
nvdev_trace(device, "init completed in %lldus\n", time); nvdev_trace(device, "init completed in %lldus\n", time);
......
...@@ -137,6 +137,7 @@ struct gf100_gr_func { ...@@ -137,6 +137,7 @@ struct gf100_gr_func {
int (*rops)(struct gf100_gr *); int (*rops)(struct gf100_gr *);
int ppc_nr; int ppc_nr;
const struct gf100_grctx_func *grctx; const struct gf100_grctx_func *grctx;
const struct nvkm_therm_clkgate_pack *clkgate_pack;
struct nvkm_sclass sclass[]; struct nvkm_sclass sclass[];
}; };
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
* Authors: Ben Skeggs <bskeggs@redhat.com> * Authors: Ben Skeggs <bskeggs@redhat.com>
*/ */
#include "gf100.h" #include "gf100.h"
#include "gk104.h"
#include "ctxgf100.h" #include "ctxgf100.h"
#include <nvif/class.h> #include <nvif/class.h>
...@@ -173,6 +174,208 @@ gk104_gr_pack_mmio[] = { ...@@ -173,6 +174,208 @@ gk104_gr_pack_mmio[] = {
{} {}
}; };
const struct nvkm_therm_clkgate_init
gk104_clkgate_blcg_init_main_0[] = {
{ 0x4041f0, 1, 0x00004046 },
{ 0x409890, 1, 0x00000045 },
{ 0x4098b0, 1, 0x0000007f },
{}
};
const struct nvkm_therm_clkgate_init
gk104_clkgate_blcg_init_rstr2d_0[] = {
{ 0x4078c0, 1, 0x00000042 },
{}
};
const struct nvkm_therm_clkgate_init
gk104_clkgate_blcg_init_unk_0[] = {
{ 0x406000, 1, 0x00004044 },
{ 0x405860, 1, 0x00004042 },
{ 0x40590c, 1, 0x00004042 },
{}
};
const struct nvkm_therm_clkgate_init
gk104_clkgate_blcg_init_gcc_0[] = {
{ 0x408040, 1, 0x00004044 },
{}
};
const struct nvkm_therm_clkgate_init
gk104_clkgate_blcg_init_sked_0[] = {
{ 0x407000, 1, 0x00004044 },
{}
};
const struct nvkm_therm_clkgate_init
gk104_clkgate_blcg_init_unk_1[] = {
{ 0x405bf0, 1, 0x00004044 },
{}
};
const struct nvkm_therm_clkgate_init
gk104_clkgate_blcg_init_gpc_ctxctl_0[] = {
{ 0x41a890, 1, 0x00000042 },
{ 0x41a8b0, 1, 0x0000007f },
{}
};
const struct nvkm_therm_clkgate_init
gk104_clkgate_blcg_init_gpc_unk_0[] = {
{ 0x418500, 1, 0x00004042 },
{ 0x418608, 1, 0x00004042 },
{ 0x418688, 1, 0x00004042 },
{ 0x418718, 1, 0x00000042 },
{}
};
const struct nvkm_therm_clkgate_init
gk104_clkgate_blcg_init_gpc_esetup_0[] = {
{ 0x418828, 1, 0x00000044 },
{}
};
const struct nvkm_therm_clkgate_init
gk104_clkgate_blcg_init_gpc_tpbus_0[] = {
{ 0x418bbc, 1, 0x00004042 },
{}
};
const struct nvkm_therm_clkgate_init
gk104_clkgate_blcg_init_gpc_zcull_0[] = {
{ 0x418970, 1, 0x00004042 },
{}
};
const struct nvkm_therm_clkgate_init
gk104_clkgate_blcg_init_gpc_tpconf_0[] = {
{ 0x418c70, 1, 0x00004042 },
{}
};
const struct nvkm_therm_clkgate_init
gk104_clkgate_blcg_init_gpc_unk_1[] = {
{ 0x418cf0, 1, 0x00004042 },
{ 0x418d70, 1, 0x00004042 },
{ 0x418f0c, 1, 0x00004042 },
{ 0x418e0c, 1, 0x00004042 },
{}
};
const struct nvkm_therm_clkgate_init
gk104_clkgate_blcg_init_gpc_gcc_0[] = {
{ 0x419020, 1, 0x00004042 },
{ 0x419038, 1, 0x00000042 },
{}
};
const struct nvkm_therm_clkgate_init
gk104_clkgate_blcg_init_gpc_ffb_0[] = {
{ 0x418898, 1, 0x00000042 },
{}
};
const struct nvkm_therm_clkgate_init
gk104_clkgate_blcg_init_gpc_tex_0[] = {
{ 0x419a40, 9, 0x00004042 },
{ 0x419acc, 1, 0x00004047 },
{}
};
const struct nvkm_therm_clkgate_init
gk104_clkgate_blcg_init_gpc_poly_0[] = {
{ 0x419868, 1, 0x00000042 },
{}
};
const struct nvkm_therm_clkgate_init
gk104_clkgate_blcg_init_gpc_l1c_0[] = {
{ 0x419ccc, 3, 0x00000042 },
{}
};
const struct nvkm_therm_clkgate_init
gk104_clkgate_blcg_init_gpc_unk_2[] = {
{ 0x419c70, 1, 0x00004045 },
{}
};
const struct nvkm_therm_clkgate_init
gk104_clkgate_blcg_init_gpc_mp_0[] = {
{ 0x419fd0, 1, 0x00004043 },
{ 0x419fd8, 1, 0x00004049 },
{ 0x419fe0, 2, 0x00004042 },
{ 0x419ff0, 1, 0x00004046 },
{ 0x419ff8, 1, 0x00004042 },
{}
};
const struct nvkm_therm_clkgate_init
gk104_clkgate_blcg_init_gpc_ppc_0[] = {
{ 0x41be28, 1, 0x00000042 },
{ 0x41bfe8, 1, 0x00004042 },
{ 0x41bed0, 1, 0x00004042 },
{}
};
const struct nvkm_therm_clkgate_init
gk104_clkgate_blcg_init_rop_zrop_0[] = {
{ 0x408810, 2, 0x00004042 },
{}
};
const struct nvkm_therm_clkgate_init
gk104_clkgate_blcg_init_rop_0[] = {
{ 0x408a80, 6, 0x00004042 },
{}
};
const struct nvkm_therm_clkgate_init
gk104_clkgate_blcg_init_rop_crop_0[] = {
{ 0x4089a8, 1, 0x00004042 },
{ 0x4089b0, 1, 0x00000042 },
{ 0x4089b8, 1, 0x00004042 },
{}
};
const struct nvkm_therm_clkgate_init
gk104_clkgate_blcg_init_pxbar_0[] = {
{ 0x13c820, 1, 0x0001007f },
{ 0x13cbe0, 1, 0x00000042 },
{}
};
static const struct nvkm_therm_clkgate_pack
gk104_clkgate_pack[] = {
{ gk104_clkgate_blcg_init_main_0 },
{ gk104_clkgate_blcg_init_rstr2d_0 },
{ gk104_clkgate_blcg_init_unk_0 },
{ gk104_clkgate_blcg_init_gcc_0 },
{ gk104_clkgate_blcg_init_sked_0 },
{ gk104_clkgate_blcg_init_unk_1 },
{ gk104_clkgate_blcg_init_gpc_ctxctl_0 },
{ gk104_clkgate_blcg_init_gpc_unk_0 },
{ gk104_clkgate_blcg_init_gpc_esetup_0 },
{ gk104_clkgate_blcg_init_gpc_tpbus_0 },
{ gk104_clkgate_blcg_init_gpc_zcull_0 },
{ gk104_clkgate_blcg_init_gpc_tpconf_0 },
{ gk104_clkgate_blcg_init_gpc_unk_1 },
{ gk104_clkgate_blcg_init_gpc_gcc_0 },
{ gk104_clkgate_blcg_init_gpc_ffb_0 },
{ gk104_clkgate_blcg_init_gpc_tex_0 },
{ gk104_clkgate_blcg_init_gpc_poly_0 },
{ gk104_clkgate_blcg_init_gpc_l1c_0 },
{ gk104_clkgate_blcg_init_gpc_unk_2 },
{ gk104_clkgate_blcg_init_gpc_mp_0 },
{ gk104_clkgate_blcg_init_gpc_ppc_0 },
{ gk104_clkgate_blcg_init_rop_zrop_0 },
{ gk104_clkgate_blcg_init_rop_0 },
{ gk104_clkgate_blcg_init_rop_crop_0 },
{ gk104_clkgate_blcg_init_pxbar_0 },
{}
};
/******************************************************************************* /*******************************************************************************
* PGRAPH engine/subdev functions * PGRAPH engine/subdev functions
******************************************************************************/ ******************************************************************************/
...@@ -214,6 +417,9 @@ gk104_gr_init(struct gf100_gr *gr) ...@@ -214,6 +417,9 @@ gk104_gr_init(struct gf100_gr *gr)
gr->func->init_gpc_mmu(gr); gr->func->init_gpc_mmu(gr);
gf100_gr_mmio(gr, gr->func->mmio); gf100_gr_mmio(gr, gr->func->mmio);
if (gr->func->clkgate_pack)
nvkm_therm_clkgate_init(gr->base.engine.subdev.device->therm,
gr->func->clkgate_pack);
nvkm_wr32(device, GPC_UNIT(0, 0x3018), 0x00000001); nvkm_wr32(device, GPC_UNIT(0, 0x3018), 0x00000001);
...@@ -338,6 +544,7 @@ gk104_gr = { ...@@ -338,6 +544,7 @@ gk104_gr = {
.rops = gf100_gr_rops, .rops = gf100_gr_rops,
.ppc_nr = 1, .ppc_nr = 1,
.grctx = &gk104_grctx, .grctx = &gk104_grctx,
.clkgate_pack = gk104_clkgate_pack,
.sclass = { .sclass = {
{ -1, -1, FERMI_TWOD_A }, { -1, -1, FERMI_TWOD_A },
{ -1, -1, KEPLER_INLINE_TO_MEMORY_A }, { -1, -1, KEPLER_INLINE_TO_MEMORY_A },
......
/*
* Copyright 2018 Red Hat Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: Lyude Paul <lyude@redhat.com>
*/
#ifndef __GK104_GR_H__
#define __GK104_GR_H__
#include <subdev/therm.h>
extern const struct nvkm_therm_clkgate_init gk104_clkgate_blcg_init_main_0[];
extern const struct nvkm_therm_clkgate_init gk104_clkgate_blcg_init_rstr2d_0[];
extern const struct nvkm_therm_clkgate_init gk104_clkgate_blcg_init_unk_0[];
extern const struct nvkm_therm_clkgate_init gk104_clkgate_blcg_init_gcc_0[];
extern const struct nvkm_therm_clkgate_init gk104_clkgate_blcg_init_sked_0[];
extern const struct nvkm_therm_clkgate_init gk104_clkgate_blcg_init_unk_1[];
extern const struct nvkm_therm_clkgate_init gk104_clkgate_blcg_init_gpc_ctxctl_0[];
extern const struct nvkm_therm_clkgate_init gk104_clkgate_blcg_init_gpc_unk_0[];
extern const struct nvkm_therm_clkgate_init gk104_clkgate_blcg_init_gpc_esetup_0[];
extern const struct nvkm_therm_clkgate_init gk104_clkgate_blcg_init_gpc_tpbus_0[];
extern const struct nvkm_therm_clkgate_init gk104_clkgate_blcg_init_gpc_zcull_0[];
extern const struct nvkm_therm_clkgate_init gk104_clkgate_blcg_init_gpc_tpconf_0[];
extern const struct nvkm_therm_clkgate_init gk104_clkgate_blcg_init_gpc_unk_1[];
extern const struct nvkm_therm_clkgate_init gk104_clkgate_blcg_init_gpc_gcc_0[];
extern const struct nvkm_therm_clkgate_init gk104_clkgate_blcg_init_gpc_ffb_0[];
extern const struct nvkm_therm_clkgate_init gk104_clkgate_blcg_init_gpc_tex_0[];
extern const struct nvkm_therm_clkgate_init gk104_clkgate_blcg_init_gpc_poly_0[];
extern const struct nvkm_therm_clkgate_init gk104_clkgate_blcg_init_gpc_l1c_0[];
extern const struct nvkm_therm_clkgate_init gk104_clkgate_blcg_init_gpc_unk_2[];
extern const struct nvkm_therm_clkgate_init gk104_clkgate_blcg_init_gpc_mp_0[];
extern const struct nvkm_therm_clkgate_init gk104_clkgate_blcg_init_gpc_ppc_0[];
extern const struct nvkm_therm_clkgate_init gk104_clkgate_blcg_init_rop_zrop_0[];
extern const struct nvkm_therm_clkgate_init gk104_clkgate_blcg_init_rop_0[];
extern const struct nvkm_therm_clkgate_init gk104_clkgate_blcg_init_rop_crop_0[];
extern const struct nvkm_therm_clkgate_init gk104_clkgate_blcg_init_pxbar_0[];
#endif
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
* Authors: Ben Skeggs <bskeggs@redhat.com> * Authors: Ben Skeggs <bskeggs@redhat.com>
*/ */
#include "gf100.h" #include "gf100.h"
#include "gk104.h"
#include "ctxgf100.h" #include "ctxgf100.h"
#include <subdev/timer.h> #include <subdev/timer.h>
...@@ -156,6 +157,159 @@ gk110_gr_pack_mmio[] = { ...@@ -156,6 +157,159 @@ gk110_gr_pack_mmio[] = {
{} {}
}; };
static const struct nvkm_therm_clkgate_init
gk110_clkgate_blcg_init_sked_0[] = {
{ 0x407000, 1, 0x00004041 },
{}
};
static const struct nvkm_therm_clkgate_init
gk110_clkgate_blcg_init_gpc_gcc_0[] = {
{ 0x419020, 1, 0x00000042 },
{ 0x419038, 1, 0x00000042 },
{}
};
static const struct nvkm_therm_clkgate_init
gk110_clkgate_blcg_init_gpc_l1c_0[] = {
{ 0x419cd4, 2, 0x00004042 },
{}
};
static const struct nvkm_therm_clkgate_init
gk110_clkgate_blcg_init_gpc_mp_0[] = {
{ 0x419fd0, 1, 0x00004043 },
{ 0x419fd8, 1, 0x00004049 },
{ 0x419fe0, 2, 0x00004042 },
{ 0x419ff0, 1, 0x00000046 },
{ 0x419ff8, 1, 0x00004042 },
{ 0x419f90, 1, 0x00004042 },
{}
};
static const struct nvkm_therm_clkgate_init
gk110_clkgate_slcg_init_main_0[] = {
{ 0x4041f4, 1, 0x00000000 },
{ 0x409894, 1, 0x00000000 },
{}
};
static const struct nvkm_therm_clkgate_init
gk110_clkgate_slcg_init_unk_0[] = {
{ 0x406004, 1, 0x00000000 },
{}
};
static const struct nvkm_therm_clkgate_init
gk110_clkgate_slcg_init_sked_0[] = {
{ 0x407004, 1, 0x00000000 },
{}
};
static const struct nvkm_therm_clkgate_init
gk110_clkgate_slcg_init_gpc_ctxctl_0[] = {
{ 0x41a894, 1, 0x00000000 },
{}
};
static const struct nvkm_therm_clkgate_init
gk110_clkgate_slcg_init_gpc_unk_0[] = {
{ 0x418504, 1, 0x00000000 },
{ 0x41860c, 1, 0x00000000 },
{ 0x41868c, 1, 0x00000000 },
{}
};
static const struct nvkm_therm_clkgate_init
gk110_clkgate_slcg_init_gpc_esetup_0[] = {
{ 0x41882c, 1, 0x00000000 },
{}
};
static const struct nvkm_therm_clkgate_init
gk110_clkgate_slcg_init_gpc_zcull_0[] = {
{ 0x418974, 1, 0x00000000 },
{}
};
static const struct nvkm_therm_clkgate_init
gk110_clkgate_slcg_init_gpc_l1c_0[] = {
{ 0x419cd8, 2, 0x00000000 },
{}
};
static const struct nvkm_therm_clkgate_init
gk110_clkgate_slcg_init_gpc_unk_1[] = {
{ 0x419c74, 1, 0x00000000 },
{}
};
static const struct nvkm_therm_clkgate_init
gk110_clkgate_slcg_init_gpc_mp_0[] = {
{ 0x419fd4, 1, 0x00004a4a },
{ 0x419fdc, 1, 0x00000014 },
{ 0x419fe4, 1, 0x00000000 },
{ 0x419ff4, 1, 0x00001724 },
{}
};
static const struct nvkm_therm_clkgate_init
gk110_clkgate_slcg_init_gpc_ppc_0[] = {
{ 0x41be2c, 1, 0x00000000 },
{}
};
static const struct nvkm_therm_clkgate_init
gk110_clkgate_slcg_init_pcounter_0[] = {
{ 0x1be018, 1, 0x000001ff },
{ 0x1bc018, 1, 0x000001ff },
{ 0x1b8018, 1, 0x000001ff },
{ 0x1b4124, 1, 0x00000000 },
{}
};
static const struct nvkm_therm_clkgate_pack
gk110_clkgate_pack[] = {
{ gk104_clkgate_blcg_init_main_0 },
{ gk104_clkgate_blcg_init_rstr2d_0 },
{ gk104_clkgate_blcg_init_unk_0 },
{ gk104_clkgate_blcg_init_gcc_0 },
{ gk110_clkgate_blcg_init_sked_0 },
{ gk104_clkgate_blcg_init_unk_1 },
{ gk104_clkgate_blcg_init_gpc_ctxctl_0 },
{ gk104_clkgate_blcg_init_gpc_unk_0 },
{ gk104_clkgate_blcg_init_gpc_esetup_0 },
{ gk104_clkgate_blcg_init_gpc_tpbus_0 },
{ gk104_clkgate_blcg_init_gpc_zcull_0 },
{ gk104_clkgate_blcg_init_gpc_tpconf_0 },
{ gk104_clkgate_blcg_init_gpc_unk_1 },
{ gk110_clkgate_blcg_init_gpc_gcc_0 },
{ gk104_clkgate_blcg_init_gpc_ffb_0 },
{ gk104_clkgate_blcg_init_gpc_tex_0 },
{ gk104_clkgate_blcg_init_gpc_poly_0 },
{ gk110_clkgate_blcg_init_gpc_l1c_0 },
{ gk104_clkgate_blcg_init_gpc_unk_2 },
{ gk110_clkgate_blcg_init_gpc_mp_0 },
{ gk104_clkgate_blcg_init_gpc_ppc_0 },
{ gk104_clkgate_blcg_init_rop_zrop_0 },
{ gk104_clkgate_blcg_init_rop_0 },
{ gk104_clkgate_blcg_init_rop_crop_0 },
{ gk104_clkgate_blcg_init_pxbar_0 },
{ gk110_clkgate_slcg_init_main_0 },
{ gk110_clkgate_slcg_init_unk_0 },
{ gk110_clkgate_slcg_init_sked_0 },
{ gk110_clkgate_slcg_init_gpc_ctxctl_0 },
{ gk110_clkgate_slcg_init_gpc_unk_0 },
{ gk110_clkgate_slcg_init_gpc_esetup_0 },
{ gk110_clkgate_slcg_init_gpc_zcull_0 },
{ gk110_clkgate_slcg_init_gpc_l1c_0 },
{ gk110_clkgate_slcg_init_gpc_unk_1 },
{ gk110_clkgate_slcg_init_gpc_mp_0 },
{ gk110_clkgate_slcg_init_gpc_ppc_0 },
{ gk110_clkgate_slcg_init_pcounter_0 },
{}
};
/******************************************************************************* /*******************************************************************************
* PGRAPH engine/subdev functions * PGRAPH engine/subdev functions
******************************************************************************/ ******************************************************************************/
...@@ -192,6 +346,7 @@ gk110_gr = { ...@@ -192,6 +346,7 @@ gk110_gr = {
.rops = gf100_gr_rops, .rops = gf100_gr_rops,
.ppc_nr = 2, .ppc_nr = 2,
.grctx = &gk110_grctx, .grctx = &gk110_grctx,
.clkgate_pack = gk110_clkgate_pack,
.sclass = { .sclass = {
{ -1, -1, FERMI_TWOD_A }, { -1, -1, FERMI_TWOD_A },
{ -1, -1, KEPLER_INLINE_TO_MEMORY_B }, { -1, -1, KEPLER_INLINE_TO_MEMORY_B },
......
...@@ -462,7 +462,7 @@ nvkm_perfmon_mthd_query_domain(struct nvkm_perfmon *perfmon, ...@@ -462,7 +462,7 @@ nvkm_perfmon_mthd_query_domain(struct nvkm_perfmon *perfmon,
args->v0.id = di; args->v0.id = di;
args->v0.signal_nr = nvkm_perfdom_count_perfsig(dom); args->v0.signal_nr = nvkm_perfdom_count_perfsig(dom);
strncpy(args->v0.name, dom->name, sizeof(args->v0.name)); strncpy(args->v0.name, dom->name, sizeof(args->v0.name) - 1);
/* Currently only global counters (PCOUNTER) are implemented /* Currently only global counters (PCOUNTER) are implemented
* but this will be different for local counters (MP). */ * but this will be different for local counters (MP). */
...@@ -514,7 +514,7 @@ nvkm_perfmon_mthd_query_signal(struct nvkm_perfmon *perfmon, ...@@ -514,7 +514,7 @@ nvkm_perfmon_mthd_query_signal(struct nvkm_perfmon *perfmon,
"/%s/%02x", dom->name, si); "/%s/%02x", dom->name, si);
} else { } else {
strncpy(args->v0.name, sig->name, strncpy(args->v0.name, sig->name,
sizeof(args->v0.name)); sizeof(args->v0.name) - 1);
} }
args->v0.signal = si; args->v0.signal = si;
...@@ -572,7 +572,7 @@ nvkm_perfmon_mthd_query_source(struct nvkm_perfmon *perfmon, ...@@ -572,7 +572,7 @@ nvkm_perfmon_mthd_query_source(struct nvkm_perfmon *perfmon,
args->v0.source = sig->source[si]; args->v0.source = sig->source[si];
args->v0.mask = src->mask; args->v0.mask = src->mask;
strncpy(args->v0.name, src->name, sizeof(args->v0.name)); strncpy(args->v0.name, src->name, sizeof(args->v0.name) - 1);
} }
if (++si < source_nr) { if (++si < source_nr) {
......
...@@ -505,6 +505,7 @@ nvkm_msgqueue_new(u32 version, struct nvkm_falcon *falcon, ...@@ -505,6 +505,7 @@ nvkm_msgqueue_new(u32 version, struct nvkm_falcon *falcon,
ret = msgqueue_0137bca5_new(falcon, sb, queue); ret = msgqueue_0137bca5_new(falcon, sb, queue);
break; break;
case 0x0148cdec: case 0x0148cdec:
case 0x015ccf3e:
ret = msgqueue_0148cdec_new(falcon, sb, queue); ret = msgqueue_0148cdec_new(falcon, sb, queue);
break; break;
default: default:
......
...@@ -110,6 +110,7 @@ read_pll(struct gt215_clk *clk, int idx, u32 pll) ...@@ -110,6 +110,7 @@ read_pll(struct gt215_clk *clk, int idx, u32 pll)
struct nvkm_device *device = clk->base.subdev.device; struct nvkm_device *device = clk->base.subdev.device;
u32 ctrl = nvkm_rd32(device, pll + 0); u32 ctrl = nvkm_rd32(device, pll + 0);
u32 sclk = 0, P = 1, N = 1, M = 1; u32 sclk = 0, P = 1, N = 1, M = 1;
u32 MP;
if (!(ctrl & 0x00000008)) { if (!(ctrl & 0x00000008)) {
if (ctrl & 0x00000001) { if (ctrl & 0x00000001) {
...@@ -130,10 +131,12 @@ read_pll(struct gt215_clk *clk, int idx, u32 pll) ...@@ -130,10 +131,12 @@ read_pll(struct gt215_clk *clk, int idx, u32 pll)
sclk = read_clk(clk, 0x10 + idx, false); sclk = read_clk(clk, 0x10 + idx, false);
} }
if (M * P) MP = M * P;
return sclk * N / (M * P);
return 0; if (!MP)
return 0;
return sclk * N / MP;
} }
static int static int
......
...@@ -22,6 +22,7 @@ nvkm-y += nvkm/subdev/fb/mcp89.o ...@@ -22,6 +22,7 @@ nvkm-y += nvkm/subdev/fb/mcp89.o
nvkm-y += nvkm/subdev/fb/gf100.o nvkm-y += nvkm/subdev/fb/gf100.o
nvkm-y += nvkm/subdev/fb/gf108.o nvkm-y += nvkm/subdev/fb/gf108.o
nvkm-y += nvkm/subdev/fb/gk104.o nvkm-y += nvkm/subdev/fb/gk104.o
nvkm-y += nvkm/subdev/fb/gk110.o
nvkm-y += nvkm/subdev/fb/gk20a.o nvkm-y += nvkm/subdev/fb/gk20a.o
nvkm-y += nvkm/subdev/fb/gm107.o nvkm-y += nvkm/subdev/fb/gm107.o
nvkm-y += nvkm/subdev/fb/gm200.o nvkm-y += nvkm/subdev/fb/gm200.o
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <core/memory.h> #include <core/memory.h>
#include <core/option.h> #include <core/option.h>
#include <subdev/therm.h>
void void
gf100_fb_intr(struct nvkm_fb *base) gf100_fb_intr(struct nvkm_fb *base)
...@@ -92,6 +93,11 @@ gf100_fb_init(struct nvkm_fb *base) ...@@ -92,6 +93,11 @@ gf100_fb_init(struct nvkm_fb *base)
if (fb->r100c10_page) if (fb->r100c10_page)
nvkm_wr32(device, 0x100c10, fb->r100c10 >> 8); nvkm_wr32(device, 0x100c10, fb->r100c10 >> 8);
if (base->func->clkgate_pack) {
nvkm_therm_clkgate_init(device->therm,
base->func->clkgate_pack);
}
} }
void * void *
......
...@@ -20,10 +20,56 @@ ...@@ -20,10 +20,56 @@
* OTHER DEALINGS IN THE SOFTWARE. * OTHER DEALINGS IN THE SOFTWARE.
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
* Lyude Paul
*/ */
#include "gk104.h"
#include "gf100.h" #include "gf100.h"
#include "ram.h" #include "ram.h"
/*
*******************************************************************************
* PGRAPH registers for clockgating
*******************************************************************************
*/
const struct nvkm_therm_clkgate_init
gk104_fb_clkgate_blcg_init_unk_0[] = {
{ 0x100d10, 1, 0x0000c244 },
{ 0x100d30, 1, 0x0000c242 },
{ 0x100d3c, 1, 0x00000242 },
{ 0x100d48, 1, 0x00000242 },
{ 0x100d1c, 1, 0x00000042 },
{}
};
const struct nvkm_therm_clkgate_init
gk104_fb_clkgate_blcg_init_vm_0[] = {
{ 0x100c98, 1, 0x00000242 },
{}
};
const struct nvkm_therm_clkgate_init
gk104_fb_clkgate_blcg_init_main_0[] = {
{ 0x10f000, 1, 0x00000042 },
{ 0x17e030, 1, 0x00000044 },
{ 0x17e040, 1, 0x00000044 },
{}
};
const struct nvkm_therm_clkgate_init
gk104_fb_clkgate_blcg_init_bcast_0[] = {
{ 0x17ea60, 4, 0x00000044 },
{}
};
static const struct nvkm_therm_clkgate_pack
gk104_fb_clkgate_pack[] = {
{ gk104_fb_clkgate_blcg_init_unk_0 },
{ gk104_fb_clkgate_blcg_init_vm_0 },
{ gk104_fb_clkgate_blcg_init_main_0 },
{ gk104_fb_clkgate_blcg_init_bcast_0 },
{}
};
static const struct nvkm_fb_func static const struct nvkm_fb_func
gk104_fb = { gk104_fb = {
.dtor = gf100_fb_dtor, .dtor = gf100_fb_dtor,
...@@ -33,6 +79,7 @@ gk104_fb = { ...@@ -33,6 +79,7 @@ gk104_fb = {
.intr = gf100_fb_intr, .intr = gf100_fb_intr,
.ram_new = gk104_ram_new, .ram_new = gk104_ram_new,
.default_bigpage = 17, .default_bigpage = 17,
.clkgate_pack = gk104_fb_clkgate_pack,
}; };
int int
......
/*
* Copyright 2018 Red Hat Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: Lyude Paul
*/
#ifndef __GK104_FB_H__
#define __GK104_FB_H__
#include <subdev/therm.h>
extern const struct nvkm_therm_clkgate_init gk104_fb_clkgate_blcg_init_unk_0[];
extern const struct nvkm_therm_clkgate_init gk104_fb_clkgate_blcg_init_vm_0[];
extern const struct nvkm_therm_clkgate_init gk104_fb_clkgate_blcg_init_main_0[];
extern const struct nvkm_therm_clkgate_init gk104_fb_clkgate_blcg_init_bcast_0[];
#endif
/*
* Copyright 2017 Red Hat Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: Lyude Paul
*/
#include "gf100.h"
#include "gk104.h"
#include "ram.h"
#include <subdev/therm.h>
#include <subdev/fb.h>
/*
*******************************************************************************
* PGRAPH registers for clockgating
*******************************************************************************
*/
static const struct nvkm_therm_clkgate_init
gk110_fb_clkgate_blcg_init_unk_0[] = {
{ 0x100d10, 1, 0x0000c242 },
{ 0x100d30, 1, 0x0000c242 },
{ 0x100d3c, 1, 0x00000242 },
{ 0x100d48, 1, 0x0000c242 },
{ 0x100d1c, 1, 0x00000042 },
{}
};
static const struct nvkm_therm_clkgate_pack
gk110_fb_clkgate_pack[] = {
{ gk110_fb_clkgate_blcg_init_unk_0 },
{ gk104_fb_clkgate_blcg_init_vm_0 },
{ gk104_fb_clkgate_blcg_init_main_0 },
{ gk104_fb_clkgate_blcg_init_bcast_0 },
{}
};
static const struct nvkm_fb_func
gk110_fb = {
.dtor = gf100_fb_dtor,
.oneinit = gf100_fb_oneinit,
.init = gf100_fb_init,
.init_page = gf100_fb_init_page,
.intr = gf100_fb_intr,
.ram_new = gk104_ram_new,
.default_bigpage = 17,
.clkgate_pack = gk110_fb_clkgate_pack,
};
int
gk110_fb_new(struct nvkm_device *device, int index, struct nvkm_fb **pfb)
{
return gf100_fb_new_(&gk110_fb, device, index, pfb);
}
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#define __NVKM_FB_PRIV_H__ #define __NVKM_FB_PRIV_H__
#define nvkm_fb(p) container_of((p), struct nvkm_fb, subdev) #define nvkm_fb(p) container_of((p), struct nvkm_fb, subdev)
#include <subdev/fb.h> #include <subdev/fb.h>
#include <subdev/therm.h>
struct nvkm_bios; struct nvkm_bios;
struct nvkm_fb_func { struct nvkm_fb_func {
...@@ -27,6 +28,7 @@ struct nvkm_fb_func { ...@@ -27,6 +28,7 @@ struct nvkm_fb_func {
int (*ram_new)(struct nvkm_fb *, struct nvkm_ram **); int (*ram_new)(struct nvkm_fb *, struct nvkm_ram **);
u8 default_bigpage; u8 default_bigpage;
const struct nvkm_therm_clkgate_pack *clkgate_pack;
}; };
void nvkm_fb_ctor(const struct nvkm_fb_func *, struct nvkm_device *device, void nvkm_fb_ctor(const struct nvkm_fb_func *, struct nvkm_device *device,
......
...@@ -106,7 +106,8 @@ nvkm_uvmm_mthd_map(struct nvkm_uvmm *uvmm, void *argv, u32 argc) ...@@ -106,7 +106,8 @@ nvkm_uvmm_mthd_map(struct nvkm_uvmm *uvmm, void *argv, u32 argc)
} else } else
return ret; return ret;
if (IS_ERR((memory = nvkm_umem_search(client, handle)))) { memory = nvkm_umem_search(client, handle);
if (IS_ERR(memory)) {
VMM_DEBUG(vmm, "memory %016llx %ld\n", handle, PTR_ERR(memory)); VMM_DEBUG(vmm, "memory %016llx %ld\n", handle, PTR_ERR(memory));
return PTR_ERR(memory); return PTR_ERR(memory);
} }
......
...@@ -642,7 +642,7 @@ nvkm_vmm_ptes_sparse(struct nvkm_vmm *vmm, u64 addr, u64 size, bool ref) ...@@ -642,7 +642,7 @@ nvkm_vmm_ptes_sparse(struct nvkm_vmm *vmm, u64 addr, u64 size, bool ref)
else else
block = (size >> page[i].shift) << page[i].shift; block = (size >> page[i].shift) << page[i].shift;
} else { } else {
block = (size >> page[i].shift) << page[i].shift;; block = (size >> page[i].shift) << page[i].shift;
} }
/* Perform operation. */ /* Perform operation. */
......
...@@ -47,8 +47,8 @@ static uint32_t gf100_pmu_data[] = { ...@@ -47,8 +47,8 @@ static uint32_t gf100_pmu_data[] = {
0x00000000, 0x00000000,
0x00000000, 0x00000000,
0x584d454d, 0x584d454d,
0x00000756, 0x00000754,
0x00000748, 0x00000746,
0x00000000, 0x00000000,
0x00000000, 0x00000000,
0x00000000, 0x00000000,
...@@ -69,8 +69,8 @@ static uint32_t gf100_pmu_data[] = { ...@@ -69,8 +69,8 @@ static uint32_t gf100_pmu_data[] = {
0x00000000, 0x00000000,
0x00000000, 0x00000000,
0x46524550, 0x46524550,
0x0000075a,
0x00000758, 0x00000758,
0x00000756,
0x00000000, 0x00000000,
0x00000000, 0x00000000,
0x00000000, 0x00000000,
...@@ -91,8 +91,8 @@ static uint32_t gf100_pmu_data[] = { ...@@ -91,8 +91,8 @@ static uint32_t gf100_pmu_data[] = {
0x00000000, 0x00000000,
0x00000000, 0x00000000,
0x5f433249, 0x5f433249,
0x00000b8a, 0x00000b88,
0x00000a2d, 0x00000a2b,
0x00000000, 0x00000000,
0x00000000, 0x00000000,
0x00000000, 0x00000000,
...@@ -113,8 +113,8 @@ static uint32_t gf100_pmu_data[] = { ...@@ -113,8 +113,8 @@ static uint32_t gf100_pmu_data[] = {
0x00000000, 0x00000000,
0x00000000, 0x00000000,
0x54534554, 0x54534554,
0x00000bb3, 0x00000bb1,
0x00000b8c, 0x00000b8a,
0x00000000, 0x00000000,
0x00000000, 0x00000000,
0x00000000, 0x00000000,
...@@ -135,8 +135,8 @@ static uint32_t gf100_pmu_data[] = { ...@@ -135,8 +135,8 @@ static uint32_t gf100_pmu_data[] = {
0x00000000, 0x00000000,
0x00000000, 0x00000000,
0x454c4449, 0x454c4449,
0x00000bbf,
0x00000bbd, 0x00000bbd,
0x00000bbb,
0x00000000, 0x00000000,
0x00000000, 0x00000000,
0x00000000, 0x00000000,
...@@ -237,19 +237,19 @@ static uint32_t gf100_pmu_data[] = { ...@@ -237,19 +237,19 @@ static uint32_t gf100_pmu_data[] = {
0x000005d3, 0x000005d3,
0x00000003, 0x00000003,
0x00000002, 0x00000002,
0x0000069d, 0x0000069b,
0x00040004, 0x00040004,
0x00000000, 0x00000000,
0x000006b9, 0x000006b7,
0x00010005, 0x00010005,
0x00000000, 0x00000000,
0x000006d6, 0x000006d4,
0x00010006, 0x00010006,
0x00000000, 0x00000000,
0x0000065b, 0x0000065b,
0x00000007, 0x00000007,
0x00000000, 0x00000000,
0x000006e1, 0x000006df,
/* 0x03c4: memx_func_tail */ /* 0x03c4: memx_func_tail */
/* 0x03c4: memx_ts_start */ /* 0x03c4: memx_ts_start */
0x00000000, 0x00000000,
...@@ -1373,432 +1373,432 @@ static uint32_t gf100_pmu_code[] = { ...@@ -1373,432 +1373,432 @@ static uint32_t gf100_pmu_code[] = {
/* 0x065b: memx_func_wait_vblank */ /* 0x065b: memx_func_wait_vblank */
0x9800f840, 0x9800f840,
0x66b00016, 0x66b00016,
0x130bf400, 0x120bf400,
0xf40166b0, 0xf40166b0,
0x0ef4060b, 0x0ef4060b,
/* 0x066d: memx_func_wait_vblank_head1 */ /* 0x066d: memx_func_wait_vblank_head1 */
0x2077f12e, 0x2077f02c,
0x070ef400, /* 0x0673: memx_func_wait_vblank_head0 */
/* 0x0674: memx_func_wait_vblank_head0 */ 0xf0060ef4,
0x000877f1, /* 0x0676: memx_func_wait_vblank_0 */
/* 0x0678: memx_func_wait_vblank_0 */ 0x67f10877,
0x07c467f1, 0x64b607c4,
0xcf0664b6, 0x0066cf06,
0x67fd0066, 0xf40467fd,
0xf31bf404, /* 0x0686: memx_func_wait_vblank_1 */
/* 0x0688: memx_func_wait_vblank_1 */ 0x67f1f31b,
0x07c467f1, 0x64b607c4,
0xcf0664b6, 0x0066cf06,
0x67fd0066, 0xf40467fd,
0xf30bf404, /* 0x0696: memx_func_wait_vblank_fini */
/* 0x0698: memx_func_wait_vblank_fini */ 0x10b6f30b,
0xf80410b6, /* 0x069b: memx_func_wr32 */
/* 0x069d: memx_func_wr32 */ 0x9800f804,
0x00169800, 0x15980016,
0xb6011598, 0x0810b601,
0x60f90810, 0x50f960f9,
0xd0fc50f9, 0xe0fcd0fc,
0x21f4e0fc, 0xb64021f4,
0x0242b640, 0x1bf40242,
0xf8e91bf4, /* 0x06b7: memx_func_wait */
/* 0x06b9: memx_func_wait */ 0xf000f8e9,
0x2c87f000, 0x84b62c87,
0xcf0684b6, 0x0088cf06,
0x1e980088, 0x98001e98,
0x011d9800, 0x1c98011d,
0x98021c98, 0x031b9802,
0x10b6031b, 0xf41010b6,
0xa321f410, 0x00f8a321,
/* 0x06d6: memx_func_delay */ /* 0x06d4: memx_func_delay */
0x1e9800f8, 0xb6001e98,
0x0410b600, 0x21f40410,
0xf87e21f4, /* 0x06df: memx_func_train */
/* 0x06e1: memx_func_train */ 0xf800f87e,
/* 0x06e3: memx_exec */ /* 0x06e1: memx_exec */
0xf900f800, 0xf9e0f900,
0xb9d0f9e0, 0x02c1b9d0,
0xb2b902c1, /* 0x06eb: memx_exec_next */
/* 0x06ed: memx_exec_next */ 0x9802b2b9,
0x00139802, 0x10b60013,
0xe70410b6, 0xf034e704,
0xe701f034, 0xe033e701,
0xb601e033, 0x0132b601,
0x30f00132, 0x980c30f0,
0xde35980c, 0x55f9de35,
0x12b855f9, 0xf40612b8,
0xe41ef406, 0x0b98e41e,
0x98f10b98, 0xf20c98f1,
0xcbbbf20c, 0xf102cbbb,
0xc4b7f102, 0xb607c4b7,
0x06b4b607, 0xbbcf06b4,
0xfc00bbcf, 0xfcd0fc00,
0xf5e0fcd0, 0x3621f5e0,
0xf8033621, /* 0x0727: memx_info */
/* 0x0729: memx_info */ 0x7000f803,
0x01c67000, 0x0bf401c6,
/* 0x072f: memx_info_data */ /* 0x072d: memx_info_data */
0xf10e0bf4, 0xccc7f10e,
0xf103ccc7, 0x00b7f103,
0xf40800b7, 0x0b0ef408,
/* 0x073a: memx_info_train */ /* 0x0738: memx_info_train */
0xc7f10b0e, 0x0bccc7f1,
0xb7f10bcc, 0x0100b7f1,
/* 0x0742: memx_info_send */ /* 0x0740: memx_info_send */
0x21f50100, 0x033621f5,
0x00f80336, /* 0x0746: memx_recv */
/* 0x0748: memx_recv */ 0xd6b000f8,
0xf401d6b0, 0x980bf401,
0xd6b0980b, 0xf400d6b0,
0xd80bf400, 0x00f8d80b,
/* 0x0756: memx_init */ /* 0x0754: memx_init */
0x00f800f8, /* 0x0756: perf_recv */
/* 0x0758: perf_recv */
/* 0x075a: perf_init */
0x00f800f8, 0x00f800f8,
/* 0x075c: i2c_drive_scl */ /* 0x0758: perf_init */
0xf40036b0, /* 0x075a: i2c_drive_scl */
0x07f1110b,
0x04b607e0,
0x0001d006,
0x00f804bd,
/* 0x0770: i2c_drive_scl_lo */
0x07e407f1,
0xd00604b6,
0x04bd0001,
/* 0x077e: i2c_drive_sda */
0x36b000f8, 0x36b000f8,
0x110bf400, 0x110bf400,
0x07e007f1, 0x07e007f1,
0xd00604b6, 0xd00604b6,
0x04bd0002, 0x04bd0001,
/* 0x0792: i2c_drive_sda_lo */ /* 0x076e: i2c_drive_scl_lo */
0x07f100f8, 0x07f100f8,
0x04b607e4, 0x04b607e4,
0x0001d006,
0x00f804bd,
/* 0x077c: i2c_drive_sda */
0xf40036b0,
0x07f1110b,
0x04b607e0,
0x0002d006, 0x0002d006,
0x00f804bd, 0x00f804bd,
/* 0x07a0: i2c_sense_scl */ /* 0x0790: i2c_drive_sda_lo */
0xf10132f4, 0x07e407f1,
0xb607c437, 0xd00604b6,
0x33cf0634, 0x04bd0002,
0x0431fd00, /* 0x079e: i2c_sense_scl */
0xf4060bf4, 0x32f400f8,
/* 0x07b6: i2c_sense_scl_done */ 0xc437f101,
0x00f80131, 0x0634b607,
/* 0x07b8: i2c_sense_sda */ 0xfd0033cf,
0xf10132f4, 0x0bf40431,
0xb607c437, 0x0131f406,
0x33cf0634, /* 0x07b4: i2c_sense_scl_done */
0x0432fd00, /* 0x07b6: i2c_sense_sda */
0xf4060bf4, 0x32f400f8,
/* 0x07ce: i2c_sense_sda_done */ 0xc437f101,
0x00f80131, 0x0634b607,
/* 0x07d0: i2c_raise_scl */ 0xfd0033cf,
0x47f140f9, 0x0bf40432,
0x37f00898, 0x0131f406,
0x5c21f501, /* 0x07cc: i2c_sense_sda_done */
/* 0x07dd: i2c_raise_scl_wait */ /* 0x07ce: i2c_raise_scl */
0xe8e7f107, 0x40f900f8,
0x7e21f403, 0x089847f1,
0x07a021f5, 0xf50137f0,
0xb60901f4, /* 0x07db: i2c_raise_scl_wait */
0x1bf40142, 0xf1075a21,
/* 0x07f1: i2c_raise_scl_done */ 0xf403e8e7,
0xf840fcef, 0x21f57e21,
/* 0x07f5: i2c_start */ 0x01f4079e,
0xa021f500, 0x0142b609,
0x0d11f407, /* 0x07ef: i2c_raise_scl_done */
0x07b821f5, 0xfcef1bf4,
0xf40611f4, /* 0x07f3: i2c_start */
/* 0x0806: i2c_start_rep */ 0xf500f840,
0x37f0300e, 0xf4079e21,
0x5c21f500, 0x21f50d11,
0x0137f007, 0x11f407b6,
0x077e21f5, 0x300ef406,
0xb60076bb, /* 0x0804: i2c_start_rep */
0x50f90465, 0xf50037f0,
0xbb046594, 0xf0075a21,
0x50bd0256, 0x21f50137,
0xfc0475fd, 0x76bb077c,
0xd021f550, 0x0465b600,
0x0464b607, 0x659450f9,
/* 0x0833: i2c_start_send */ 0x0256bb04,
0xf01f11f4, 0x75fd50bd,
0xf550fc04,
0xb607ce21,
0x11f40464,
/* 0x0831: i2c_start_send */
0x0037f01f,
0x077c21f5,
0x1388e7f1,
0xf07e21f4,
0x21f50037, 0x21f50037,
0xe7f1077e, 0xe7f1075a,
0x21f41388, 0x21f41388,
0x0037f07e, /* 0x084d: i2c_start_out */
0x075c21f5, /* 0x084f: i2c_stop */
0x1388e7f1, 0xf000f87e,
/* 0x084f: i2c_start_out */ 0x21f50037,
0xf87e21f4, 0x37f0075a,
/* 0x0851: i2c_stop */ 0x7c21f500,
0x0037f000, 0xe8e7f107,
0x075c21f5, 0x7e21f403,
0xf50037f0,
0xf1077e21,
0xf403e8e7,
0x37f07e21,
0x5c21f501,
0x88e7f107,
0x7e21f413,
0xf50137f0, 0xf50137f0,
0xf1077e21, 0xf1075a21,
0xf41388e7, 0xf41388e7,
0x00f87e21, 0x37f07e21,
/* 0x0884: i2c_bitw */ 0x7c21f501,
0x077e21f5,
0x03e8e7f1,
0xbb7e21f4,
0x65b60076,
0x9450f904,
0x56bb0465,
0xfd50bd02,
0x50fc0475,
0x07d021f5,
0xf40464b6,
0xe7f11811,
0x21f41388,
0x0037f07e,
0x075c21f5,
0x1388e7f1,
/* 0x08c3: i2c_bitw_out */
0xf87e21f4,
/* 0x08c5: i2c_bitr */
0x0137f000,
0x077e21f5,
0x03e8e7f1,
0xbb7e21f4,
0x65b60076,
0x9450f904,
0x56bb0465,
0xfd50bd02,
0x50fc0475,
0x07d021f5,
0xf40464b6,
0x21f51b11,
0x37f007b8,
0x5c21f500,
0x88e7f107, 0x88e7f107,
0x7e21f413, 0x7e21f413,
0xf4013cf0, /* 0x0882: i2c_bitw */
/* 0x090a: i2c_bitr_done */ 0x21f500f8,
0x00f80131, 0xe7f1077c,
/* 0x090c: i2c_get_byte */ 0x21f403e8,
0xf00057f0, 0x0076bb7e,
/* 0x0912: i2c_get_byte_next */
0x54b60847,
0x0076bb01,
0xf90465b6, 0xf90465b6,
0x04659450, 0x04659450,
0xbd0256bb, 0xbd0256bb,
0x0475fd50, 0x0475fd50,
0x21f550fc, 0x21f550fc,
0x64b608c5, 0x64b607ce,
0x2b11f404, 0x1811f404,
0xb60553fd, 0x1388e7f1,
0x1bf40142, 0xf07e21f4,
0x0137f0d8, 0x21f50037,
0xb60076bb, 0xe7f1075a,
0x50f90465, 0x21f41388,
0xbb046594, /* 0x08c1: i2c_bitw_out */
0x50bd0256, /* 0x08c3: i2c_bitr */
0xfc0475fd, 0xf000f87e,
0x8421f550, 0x21f50137,
0x0464b608, 0xe7f1077c,
/* 0x095c: i2c_get_byte_done */ 0x21f403e8,
/* 0x095e: i2c_put_byte */ 0x0076bb7e,
0x47f000f8, 0xf90465b6,
/* 0x0961: i2c_put_byte_next */ 0x04659450,
0x0142b608, 0xbd0256bb,
0xbb3854ff, 0x0475fd50,
0x21f550fc,
0x64b607ce,
0x1b11f404,
0x07b621f5,
0xf50037f0,
0xf1075a21,
0xf41388e7,
0x3cf07e21,
0x0131f401,
/* 0x0908: i2c_bitr_done */
/* 0x090a: i2c_get_byte */
0x57f000f8,
0x0847f000,
/* 0x0910: i2c_get_byte_next */
0xbb0154b6,
0x65b60076, 0x65b60076,
0x9450f904, 0x9450f904,
0x56bb0465, 0x56bb0465,
0xfd50bd02, 0xfd50bd02,
0x50fc0475, 0x50fc0475,
0x088421f5, 0x08c321f5,
0xf40464b6, 0xf40464b6,
0x46b03411, 0x53fd2b11,
0xd81bf400, 0x0142b605,
0xb60076bb, 0xf0d81bf4,
0x50f90465, 0x76bb0137,
0xbb046594, 0x0465b600,
0x50bd0256, 0x659450f9,
0xfc0475fd, 0x0256bb04,
0xc521f550, 0x75fd50bd,
0x0464b608, 0xf550fc04,
0xbb0f11f4, 0xb6088221,
0x36b00076, /* 0x095a: i2c_get_byte_done */
0x061bf401, 0x00f80464,
/* 0x09b7: i2c_put_byte_done */ /* 0x095c: i2c_put_byte */
0xf80132f4, /* 0x095f: i2c_put_byte_next */
/* 0x09b9: i2c_addr */ 0xb60847f0,
0x0076bb00, 0x54ff0142,
0x0076bb38,
0xf90465b6, 0xf90465b6,
0x04659450, 0x04659450,
0xbd0256bb, 0xbd0256bb,
0x0475fd50, 0x0475fd50,
0x21f550fc, 0x21f550fc,
0x64b607f5, 0x64b60882,
0x2911f404, 0x3411f404,
0x012ec3e7, 0xf40046b0,
0xfd0134b6, 0x76bbd81b,
0x76bb0553,
0x0465b600, 0x0465b600,
0x659450f9, 0x659450f9,
0x0256bb04, 0x0256bb04,
0x75fd50bd, 0x75fd50bd,
0xf550fc04, 0xf550fc04,
0xb6095e21, 0xb608c321,
/* 0x09fe: i2c_addr_done */ 0x11f40464,
0x00f80464, 0x0076bb0f,
/* 0x0a00: i2c_acquire_addr */ 0xf40136b0,
0xb6f8cec7, 0x32f4061b,
0xe0b702e4, /* 0x09b5: i2c_put_byte_done */
0xee980d1c, /* 0x09b7: i2c_addr */
/* 0x0a0f: i2c_acquire */ 0xbb00f801,
0xf500f800,
0xf40a0021,
0xd9f00421,
0x4021f403,
/* 0x0a1e: i2c_release */
0x21f500f8,
0x21f40a00,
0x03daf004,
0xf84021f4,
/* 0x0a2d: i2c_recv */
0x0132f400,
0xb6f8c1c7,
0x16b00214,
0x3a1ff528,
0xf413a001,
0x0032980c,
0x0ccc13a0,
0xf4003198,
0xd0f90231,
0xd0f9e0f9,
0x000067f1,
0x100063f1,
0xbb016792,
0x65b60076, 0x65b60076,
0x9450f904, 0x9450f904,
0x56bb0465, 0x56bb0465,
0xfd50bd02, 0xfd50bd02,
0x50fc0475, 0x50fc0475,
0x0a0f21f5, 0x07f321f5,
0xfc0464b6, 0xf40464b6,
0x00d6b0d0, 0xc3e72911,
0x00b31bf5, 0x34b6012e,
0xbb0057f0, 0x0553fd01,
0x65b60076, 0xb60076bb,
0x9450f904, 0x50f90465,
0x56bb0465, 0xbb046594,
0xfd50bd02, 0x50bd0256,
0x50fc0475, 0xfc0475fd,
0x09b921f5, 0x5c21f550,
0xf50464b6, 0x0464b609,
0xc700d011, /* 0x09fc: i2c_addr_done */
0x76bbe0c5, /* 0x09fe: i2c_acquire_addr */
0x0465b600, 0xcec700f8,
0x659450f9, 0x02e4b6f8,
0x0256bb04, 0x0d1ce0b7,
0x75fd50bd, 0xf800ee98,
0xf550fc04, /* 0x0a0d: i2c_acquire */
0xb6095e21, 0xfe21f500,
0x11f50464, 0x0421f409,
0x57f000ad, 0xf403d9f0,
0x00f84021,
/* 0x0a1c: i2c_release */
0x09fe21f5,
0xf00421f4,
0x21f403da,
/* 0x0a2b: i2c_recv */
0xf400f840,
0xc1c70132,
0x0214b6f8,
0xf52816b0,
0xa0013a1f,
0x980cf413,
0x13a00032,
0x31980ccc,
0x0231f400,
0xe0f9d0f9,
0x67f1d0f9,
0x63f10000,
0x67921000,
0x0076bb01, 0x0076bb01,
0xf90465b6, 0xf90465b6,
0x04659450, 0x04659450,
0xbd0256bb, 0xbd0256bb,
0x0475fd50, 0x0475fd50,
0x21f550fc, 0x21f550fc,
0x64b609b9, 0x64b60a0d,
0x8a11f504, 0xb0d0fc04,
0x1bf500d6,
0x57f000b3,
0x0076bb00, 0x0076bb00,
0xf90465b6, 0xf90465b6,
0x04659450, 0x04659450,
0xbd0256bb, 0xbd0256bb,
0x0475fd50, 0x0475fd50,
0x21f550fc, 0x21f550fc,
0x64b6090c, 0x64b609b7,
0x6a11f404, 0xd011f504,
0xbbe05bcb, 0xe0c5c700,
0xb60076bb,
0x50f90465,
0xbb046594,
0x50bd0256,
0xfc0475fd,
0x5c21f550,
0x0464b609,
0x00ad11f5,
0xbb0157f0,
0x65b60076, 0x65b60076,
0x9450f904, 0x9450f904,
0x56bb0465, 0x56bb0465,
0xfd50bd02, 0xfd50bd02,
0x50fc0475, 0x50fc0475,
0x085121f5, 0x09b721f5,
0xb90464b6, 0xf50464b6,
0x74bd025b, 0xbb008a11,
/* 0x0b33: i2c_recv_not_rd08 */ 0x65b60076,
0xb0430ef4, 0x9450f904,
0x1bf401d6, 0x56bb0465,
0x0057f03d, 0xfd50bd02,
0x09b921f5, 0x50fc0475,
0xc73311f4, 0x090a21f5,
0x21f5e0c5, 0xf40464b6,
0x11f4095e, 0x5bcb6a11,
0x0057f029, 0x0076bbe0,
0x09b921f5, 0xf90465b6,
0xc71f11f4, 0x04659450,
0x21f5e0b5, 0xbd0256bb,
0x11f4095e, 0x0475fd50,
0x5121f515, 0x21f550fc,
0xc774bd08, 0x64b6084f,
0x1bf408c5, 0x025bb904,
0x0232f409, 0x0ef474bd,
/* 0x0b73: i2c_recv_not_wr08 */ /* 0x0b31: i2c_recv_not_rd08 */
/* 0x0b73: i2c_recv_done */ 0x01d6b043,
0xc7030ef4, 0xf03d1bf4,
0x21f5f8ce, 0x21f50057,
0xe0fc0a1e, 0x11f409b7,
0x12f4d0fc, 0xe0c5c733,
0x027cb90a, 0x095c21f5,
0x033621f5, 0xf02911f4,
/* 0x0b88: i2c_recv_exit */ 0x21f50057,
/* 0x0b8a: i2c_init */ 0x11f409b7,
0x00f800f8, 0xe0b5c71f,
/* 0x0b8c: test_recv */ 0x095c21f5,
0x05d817f1, 0xf51511f4,
0xbd084f21,
0x08c5c774,
0xf4091bf4,
0x0ef40232,
/* 0x0b71: i2c_recv_not_wr08 */
/* 0x0b71: i2c_recv_done */
0xf8cec703,
0x0a1c21f5,
0xd0fce0fc,
0xb90a12f4,
0x21f5027c,
/* 0x0b86: i2c_recv_exit */
0x00f80336,
/* 0x0b88: i2c_init */
/* 0x0b8a: test_recv */
0x17f100f8,
0x14b605d8,
0x0011cf06,
0xf10110b6,
0xb605d807,
0x01d00604,
0xf104bd00,
0xf1d900e7,
0xf5134fe3,
0xf8025621,
/* 0x0bb1: test_init */
0x00e7f100,
0x5621f508,
/* 0x0bbb: idle_recv */
0xf800f802,
/* 0x0bbd: idle */
0x0031f400,
0x05d417f1,
0xcf0614b6, 0xcf0614b6,
0x10b60011, 0x10b60011,
0xd807f101, 0xd407f101,
0x0604b605, 0x0604b605,
0xbd0001d0, 0xbd0001d0,
0x00e7f104, /* 0x0bd9: idle_loop */
0x4fe3f1d9, 0x5817f004,
0x5621f513, /* 0x0bdf: idle_proc */
/* 0x0bb3: test_init */ /* 0x0bdf: idle_proc_exec */
0xf100f802, 0xf90232f4,
0xf50800e7, 0x021eb910,
0xf8025621, 0x033f21f5,
/* 0x0bbd: idle_recv */ 0x11f410fc,
/* 0x0bbf: idle */ 0x0231f409,
0xf400f800, /* 0x0bf3: idle_proc_next */
0x17f10031, 0xb6ef0ef4,
0x14b605d4, 0x1fb85810,
0x0011cf06, 0xe61bf406,
0xf10110b6, 0xf4dd02f4,
0xb605d407, 0x0ef40028,
0x01d00604, 0x000000bb,
/* 0x0bdb: idle_loop */
0xf004bd00,
0x32f45817,
/* 0x0be1: idle_proc */
/* 0x0be1: idle_proc_exec */
0xb910f902,
0x21f5021e,
0x10fc033f,
0xf40911f4,
0x0ef40231,
/* 0x0bf5: idle_proc_next */
0x5810b6ef,
0xf4061fb8,
0x02f4e61b,
0x0028f4dd,
0x00bb0ef4,
0x00000000, 0x00000000,
0x00000000, 0x00000000,
0x00000000, 0x00000000,
......
...@@ -47,8 +47,8 @@ static uint32_t gk208_pmu_data[] = { ...@@ -47,8 +47,8 @@ static uint32_t gk208_pmu_data[] = {
0x00000000, 0x00000000,
0x00000000, 0x00000000,
0x584d454d, 0x584d454d,
0x000005f3, 0x000005ee,
0x000005e5, 0x000005e0,
0x00000000, 0x00000000,
0x00000000, 0x00000000,
0x00000000, 0x00000000,
...@@ -69,8 +69,8 @@ static uint32_t gk208_pmu_data[] = { ...@@ -69,8 +69,8 @@ static uint32_t gk208_pmu_data[] = {
0x00000000, 0x00000000,
0x00000000, 0x00000000,
0x46524550, 0x46524550,
0x000005f7, 0x000005f2,
0x000005f5, 0x000005f0,
0x00000000, 0x00000000,
0x00000000, 0x00000000,
0x00000000, 0x00000000,
...@@ -91,8 +91,8 @@ static uint32_t gk208_pmu_data[] = { ...@@ -91,8 +91,8 @@ static uint32_t gk208_pmu_data[] = {
0x00000000, 0x00000000,
0x00000000, 0x00000000,
0x5f433249, 0x5f433249,
0x000009f8, 0x000009f3,
0x000008a2, 0x0000089d,
0x00000000, 0x00000000,
0x00000000, 0x00000000,
0x00000000, 0x00000000,
...@@ -113,8 +113,8 @@ static uint32_t gk208_pmu_data[] = { ...@@ -113,8 +113,8 @@ static uint32_t gk208_pmu_data[] = {
0x00000000, 0x00000000,
0x00000000, 0x00000000,
0x54534554, 0x54534554,
0x00000a16, 0x00000a11,
0x000009fa, 0x000009f5,
0x00000000, 0x00000000,
0x00000000, 0x00000000,
0x00000000, 0x00000000,
...@@ -135,8 +135,8 @@ static uint32_t gk208_pmu_data[] = { ...@@ -135,8 +135,8 @@ static uint32_t gk208_pmu_data[] = {
0x00000000, 0x00000000,
0x00000000, 0x00000000,
0x454c4449, 0x454c4449,
0x00000a21, 0x00000a1c,
0x00000a1f, 0x00000a1a,
0x00000000, 0x00000000,
0x00000000, 0x00000000,
0x00000000, 0x00000000,
...@@ -234,22 +234,22 @@ static uint32_t gk208_pmu_data[] = { ...@@ -234,22 +234,22 @@ static uint32_t gk208_pmu_data[] = {
/* 0x037c: memx_func_next */ /* 0x037c: memx_func_next */
0x00000002, 0x00000002,
0x00000000, 0x00000000,
0x000004cf, 0x000004cc,
0x00000003, 0x00000003,
0x00000002, 0x00000002,
0x00000546, 0x00000541,
0x00040004, 0x00040004,
0x00000000, 0x00000000,
0x00000563, 0x0000055e,
0x00010005, 0x00010005,
0x00000000, 0x00000000,
0x0000057d, 0x00000578,
0x00010006, 0x00010006,
0x00000000, 0x00000000,
0x00000541, 0x0000053c,
0x00000007, 0x00000007,
0x00000000, 0x00000000,
0x00000589, 0x00000584,
/* 0x03c4: memx_func_tail */ /* 0x03c4: memx_func_tail */
/* 0x03c4: memx_ts_start */ /* 0x03c4: memx_ts_start */
0x00000000, 0x00000000,
...@@ -1239,454 +1239,454 @@ static uint32_t gk208_pmu_code[] = { ...@@ -1239,454 +1239,454 @@ static uint32_t gk208_pmu_code[] = {
0x0001f604, 0x0001f604,
0x00f804bd, 0x00f804bd,
/* 0x045c: memx_func_enter */ /* 0x045c: memx_func_enter */
0x162067f1, 0x47162046,
0xf55d77f1, 0x6eb2f55d,
0x047e6eb2, 0x0000047e,
0xd8b20000, 0x87fdd8b2,
0xf90487fd, 0xf960f904,
0xfc80f960, 0xfcd0fc80,
0x7ee0fcd0, 0x002d7ee0,
0x0700002d, 0xb2fe0700,
0x7e6eb2fe, 0x00047e6e,
0xfdd8b200,
0x60f90487,
0xd0fc80f9,
0x2d7ee0fc,
0xf0460000,
0x7e6eb226,
0xb2000004, 0xb2000004,
0x0487fdd8, 0x0487fdd8,
0x80f960f9, 0x80f960f9,
0xe0fcd0fc, 0xe0fcd0fc,
0x00002d7e, 0x00002d7e,
0x26f067f1, 0xe0400406,
0x047e6eb2, 0x0006f607,
0xd8b20000, /* 0x04b6: memx_func_enter_wait */
0xf90487fd, 0xc04604bd,
0xfc80f960, 0x0066cf07,
0x7ee0fcd0, 0xf40464f0,
0x0600002d, 0x2c06f70b,
0x07e04004, 0xb50066cf,
0xbd0006f6, 0x00f8f106,
/* 0x04b9: memx_func_enter_wait */ /* 0x04cc: memx_func_leave */
0x07c04604, 0x66cf2c06,
0xf00066cf, 0xf206b500,
0x0bf40464, 0xe4400406,
0xcf2c06f7, 0x0006f607,
0x06b50066, /* 0x04de: memx_func_leave_wait */
/* 0x04cf: memx_func_leave */ 0xc04604bd,
0x0600f8f1, 0x0066cf07,
0x0066cf2c, 0xf40464f0,
0x06f206b5, 0xf046f71b,
0x07e44004,
0xbd0006f6,
/* 0x04e1: memx_func_leave_wait */
0x07c04604,
0xf00066cf,
0x1bf40464,
0xf067f1f7,
0xb2010726, 0xb2010726,
0x00047e6e, 0x00047e6e,
0xfdd8b200, 0xfdd8b200,
0x60f90587, 0x60f90587,
0xd0fc80f9, 0xd0fc80f9,
0x2d7ee0fc, 0x2d7ee0fc,
0x67f10000, 0x20460000,
0x6eb21620, 0x7e6eb216,
0x0000047e, 0xb2000004,
0x87fdd8b2, 0x0587fdd8,
0xf960f905, 0x80f960f9,
0xfcd0fc80, 0xe0fcd0fc,
0x002d7ee0, 0x00002d7e,
0x0aa24700, 0xb20aa247,
0x047e6eb2, 0x00047e6e,
0xd8b20000, 0xfdd8b200,
0xf90587fd, 0x60f90587,
0xfc80f960, 0xd0fc80f9,
0x7ee0fcd0, 0x2d7ee0fc,
0xf800002d, 0x00f80000,
/* 0x0541: memx_func_wait_vblank */ /* 0x053c: memx_func_wait_vblank */
0xf80410b6,
/* 0x0541: memx_func_wr32 */
0x00169800,
0xb6011598,
0x60f90810,
0xd0fc50f9,
0x2d7ee0fc,
0x42b60000,
0xe81bf402,
/* 0x055e: memx_func_wait */
0x2c0800f8,
0x980088cf,
0x1d98001e,
0x021c9801,
0xb6031b98,
0x747e1010,
0x00f80000,
/* 0x0578: memx_func_delay */
0xb6001e98,
0x587e0410,
0x00f80000,
/* 0x0584: memx_func_train */
/* 0x0586: memx_exec */
0xe0f900f8,
0xc1b2d0f9,
/* 0x058e: memx_exec_next */
0x1398b2b2,
0x0410b600, 0x0410b600,
/* 0x0546: memx_func_wr32 */ 0x01f034e7,
0x169800f8, 0x01e033e7,
0x01159800, 0xf00132b6,
0xf90810b6, 0x35980c30,
0xfc50f960, 0xa655f9de,
0xe51ef412,
0x98f10b98,
0xcbbbf20c,
0x07c44b02,
0xfc00bbcf,
0x7ee0fcd0, 0x7ee0fcd0,
0xb600002d,
0x1bf40242,
/* 0x0563: memx_func_wait */
0x0800f8e8,
0x0088cf2c,
0x98001e98,
0x1c98011d,
0x031b9802,
0x7e1010b6,
0xf8000074,
/* 0x057d: memx_func_delay */
0x001e9800,
0x7e0410b6,
0xf8000058,
/* 0x0589: memx_func_train */
/* 0x058b: memx_exec */
0xf900f800,
0xb2d0f9e0,
/* 0x0593: memx_exec_next */
0x98b2b2c1,
0x10b60013,
0xf034e704,
0xe033e701,
0x0132b601,
0x980c30f0,
0x55f9de35,
0x1ef412a6,
0xf10b98e5,
0xbbf20c98,
0xc44b02cb,
0x00bbcf07,
0xe0fcd0fc,
0x00029f7e,
/* 0x05ca: memx_info */
0xc67000f8,
0x0c0bf401,
/* 0x05d0: memx_info_data */
0x4b03cc4c,
0x0ef40800,
/* 0x05d9: memx_info_train */
0x0bcc4c09,
/* 0x05df: memx_info_send */
0x7e01004b,
0xf800029f, 0xf800029f,
/* 0x05e5: memx_recv */ /* 0x05c5: memx_info */
0x01d6b000, 0x01c67000,
0xb0a30bf4, /* 0x05cb: memx_info_data */
0x0bf400d6, 0x4c0c0bf4,
/* 0x05f3: memx_init */ 0x004b03cc,
0xf800f8dc, 0x090ef408,
/* 0x05f5: perf_recv */ /* 0x05d4: memx_info_train */
/* 0x05f7: perf_init */ 0x4b0bcc4c,
0xf800f800, /* 0x05da: memx_info_send */
/* 0x05f9: i2c_drive_scl */ 0x9f7e0100,
0x0036b000, 0x00f80002,
0x400d0bf4, /* 0x05e0: memx_recv */
0x01f607e0, 0xf401d6b0,
0xf804bd00, 0xd6b0a30b,
/* 0x0609: i2c_drive_scl_lo */ 0xdc0bf400,
0x07e44000, /* 0x05ee: memx_init */
0xbd0001f6, 0x00f800f8,
/* 0x0613: i2c_drive_sda */ /* 0x05f0: perf_recv */
0xb000f804, /* 0x05f2: perf_init */
0x0bf40036, 0x00f800f8,
0x07e0400d, /* 0x05f4: i2c_drive_scl */
0xbd0002f6, 0xf40036b0,
/* 0x0623: i2c_drive_sda_lo */ 0xe0400d0b,
0x4000f804, 0x0001f607,
0x02f607e4, 0x00f804bd,
0xf804bd00, /* 0x0604: i2c_drive_scl_lo */
/* 0x062d: i2c_sense_scl */ 0xf607e440,
0x0132f400, 0x04bd0001,
0xcf07c443, /* 0x060e: i2c_drive_sda */
0x31fd0033, 0x36b000f8,
0x060bf404, 0x0d0bf400,
/* 0x063f: i2c_sense_scl_done */ 0xf607e040,
0xf80131f4, 0x04bd0002,
/* 0x0641: i2c_sense_sda */ /* 0x061e: i2c_drive_sda_lo */
0x0132f400, 0xe44000f8,
0xcf07c443, 0x0002f607,
0x32fd0033, 0x00f804bd,
0x060bf404, /* 0x0628: i2c_sense_scl */
/* 0x0653: i2c_sense_sda_done */ 0x430132f4,
0xf80131f4, 0x33cf07c4,
/* 0x0655: i2c_raise_scl */ 0x0431fd00,
0x4440f900, 0xf4060bf4,
0x01030898, /* 0x063a: i2c_sense_scl_done */
0x0005f97e, 0x00f80131,
/* 0x0660: i2c_raise_scl_wait */ /* 0x063c: i2c_sense_sda */
0x7e03e84e, 0x430132f4,
0x7e000058, 0x33cf07c4,
0xf400062d, 0x0432fd00,
0x42b60901, 0xf4060bf4,
0xef1bf401, /* 0x064e: i2c_sense_sda_done */
/* 0x0674: i2c_raise_scl_done */ 0x00f80131,
0x00f840fc, /* 0x0650: i2c_raise_scl */
/* 0x0678: i2c_start */ 0x984440f9,
0x00062d7e, 0x7e010308,
0x7e0d11f4, /* 0x065b: i2c_raise_scl_wait */
0xf4000641, 0x4e0005f4,
0x0ef40611, 0x587e03e8,
/* 0x0689: i2c_start_rep */ 0x287e0000,
0x7e00032e, 0x01f40006,
0x030005f9, 0x0142b609,
0x06137e01, /* 0x066f: i2c_raise_scl_done */
0xfcef1bf4,
/* 0x0673: i2c_start */
0x7e00f840,
0xf4000628,
0x3c7e0d11,
0x11f40006,
0x2e0ef406,
/* 0x0684: i2c_start_rep */
0xf47e0003,
0x01030005,
0x00060e7e,
0xb60076bb,
0x50f90465,
0xbb046594,
0x50bd0256,
0xfc0475fd,
0x06507e50,
0x0464b600,
/* 0x06af: i2c_start_send */
0x031d11f4,
0x060e7e00,
0x13884e00,
0x0000587e,
0xf47e0003,
0x884e0005,
0x00587e13,
/* 0x06c9: i2c_start_out */
/* 0x06cb: i2c_stop */
0x0300f800,
0x05f47e00,
0x7e000300,
0x4e00060e,
0x587e03e8,
0x01030000,
0x0005f47e,
0x7e13884e,
0x03000058,
0x060e7e01,
0x13884e00,
0x0000587e,
/* 0x06fa: i2c_bitw */
0x0e7e00f8,
0xe84e0006,
0x00587e03,
0x0076bb00, 0x0076bb00,
0xf90465b6, 0xf90465b6,
0x04659450, 0x04659450,
0xbd0256bb, 0xbd0256bb,
0x0475fd50, 0x0475fd50,
0x557e50fc, 0x507e50fc,
0x64b60006, 0x64b60006,
0x1d11f404, 0x1711f404,
/* 0x06b4: i2c_start_send */ 0x7e13884e,
0x137e0003,
0x884e0006,
0x00587e13,
0x7e000300,
0x4e0005f9,
0x587e1388,
/* 0x06ce: i2c_start_out */
0x00f80000,
/* 0x06d0: i2c_stop */
0xf97e0003,
0x00030005,
0x0006137e,
0x7e03e84e,
0x03000058, 0x03000058,
0x05f97e01, 0x05f47e00,
0x13884e00, 0x13884e00,
0x0000587e, 0x0000587e,
0x137e0103, /* 0x0738: i2c_bitw_out */
0x884e0006, /* 0x073a: i2c_bitr */
0x00587e13, 0x010300f8,
/* 0x06ff: i2c_bitw */ 0x00060e7e,
0x7e00f800, 0x7e03e84e,
0x4e000613, 0xbb000058,
0x587e03e8, 0x65b60076,
0x76bb0000, 0x9450f904,
0x56bb0465,
0xfd50bd02,
0x50fc0475,
0x0006507e,
0xf40464b6,
0x3c7e1a11,
0x00030006,
0x0005f47e,
0x7e13884e,
0xf0000058,
0x31f4013c,
/* 0x077d: i2c_bitr_done */
/* 0x077f: i2c_get_byte */
0x0500f801,
/* 0x0783: i2c_get_byte_next */
0xb6080400,
0x76bb0154,
0x0465b600, 0x0465b600,
0x659450f9, 0x659450f9,
0x0256bb04, 0x0256bb04,
0x75fd50bd, 0x75fd50bd,
0x7e50fc04, 0x7e50fc04,
0xb6000655, 0xb600073a,
0x11f40464, 0x11f40464,
0x13884e17, 0x0553fd2a,
0x0000587e, 0xf40142b6,
0xf97e0003, 0x0103d81b,
0x884e0005,
0x00587e13,
/* 0x073d: i2c_bitw_out */
/* 0x073f: i2c_bitr */
0x0300f800,
0x06137e01,
0x03e84e00,
0x0000587e,
0xb60076bb, 0xb60076bb,
0x50f90465, 0x50f90465,
0xbb046594, 0xbb046594,
0x50bd0256, 0x50bd0256,
0xfc0475fd, 0xfc0475fd,
0x06557e50, 0x06fa7e50,
0x0464b600, 0x0464b600,
0x7e1a11f4, /* 0x07cc: i2c_get_byte_done */
0x03000641, /* 0x07ce: i2c_put_byte */
0x05f97e00, 0x080400f8,
0x13884e00, /* 0x07d0: i2c_put_byte_next */
0x0000587e, 0xff0142b6,
0xf4013cf0, 0x76bb3854,
/* 0x0782: i2c_bitr_done */ 0x0465b600,
0x00f80131, 0x659450f9,
/* 0x0784: i2c_get_byte */ 0x0256bb04,
0x08040005, 0x75fd50bd,
/* 0x0788: i2c_get_byte_next */ 0x7e50fc04,
0xbb0154b6, 0xb60006fa,
0x65b60076, 0x11f40464,
0x9450f904, 0x0046b034,
0x56bb0465, 0xbbd81bf4,
0xfd50bd02,
0x50fc0475,
0x00073f7e,
0xf40464b6,
0x53fd2a11,
0x0142b605,
0x03d81bf4,
0x0076bb01,
0xf90465b6,
0x04659450,
0xbd0256bb,
0x0475fd50,
0xff7e50fc,
0x64b60006,
/* 0x07d1: i2c_get_byte_done */
/* 0x07d3: i2c_put_byte */
0x0400f804,
/* 0x07d5: i2c_put_byte_next */
0x0142b608,
0xbb3854ff,
0x65b60076, 0x65b60076,
0x9450f904, 0x9450f904,
0x56bb0465, 0x56bb0465,
0xfd50bd02, 0xfd50bd02,
0x50fc0475, 0x50fc0475,
0x0006ff7e, 0x00073a7e,
0xf40464b6, 0xf40464b6,
0x46b03411, 0x76bb0f11,
0xd81bf400, 0x0136b000,
0xf4061bf4,
/* 0x0826: i2c_put_byte_done */
0x00f80132,
/* 0x0828: i2c_addr */
0xb60076bb, 0xb60076bb,
0x50f90465, 0x50f90465,
0xbb046594, 0xbb046594,
0x50bd0256, 0x50bd0256,
0xfc0475fd, 0xfc0475fd,
0x073f7e50, 0x06737e50,
0x0464b600, 0x0464b600,
0xbb0f11f4, 0xe72911f4,
0x36b00076, 0xb6012ec3,
0x061bf401, 0x53fd0134,
/* 0x082b: i2c_put_byte_done */ 0x0076bb05,
0xf80132f4,
/* 0x082d: i2c_addr */
0x0076bb00,
0xf90465b6, 0xf90465b6,
0x04659450, 0x04659450,
0xbd0256bb, 0xbd0256bb,
0x0475fd50, 0x0475fd50,
0x787e50fc, 0xce7e50fc,
0x64b60006, 0x64b60007,
0x2911f404, /* 0x086d: i2c_addr_done */
0x012ec3e7, /* 0x086f: i2c_acquire_addr */
0xfd0134b6, 0xc700f804,
0x76bb0553, 0xe4b6f8ce,
0x0465b600, 0x14e0b705,
0x659450f9, /* 0x087b: i2c_acquire */
0x0256bb04, 0x7e00f8d0,
0x75fd50bd, 0x7e00086f,
0x7e50fc04, 0xf0000004,
0xb60007d3, 0x2d7e03d9,
/* 0x0872: i2c_addr_done */ 0x00f80000,
0x00f80464, /* 0x088c: i2c_release */
/* 0x0874: i2c_acquire_addr */ 0x00086f7e,
0xb6f8cec7,
0xe0b705e4,
0x00f8d014,
/* 0x0880: i2c_acquire */
0x0008747e,
0x0000047e, 0x0000047e,
0x7e03d9f0, 0x7e03daf0,
0xf800002d, 0xf800002d,
/* 0x0891: i2c_release */ /* 0x089d: i2c_recv */
0x08747e00, 0x0132f400,
0x00047e00, 0xb6f8c1c7,
0x03daf000, 0x16b00214,
0x00002d7e, 0x341ff528,
/* 0x08a2: i2c_recv */ 0xf413b801,
0x32f400f8, 0x3298000c,
0xf8c1c701, 0xcc13b800,
0xb00214b6, 0x3198000c,
0x1ff52816, 0x0231f400,
0x13b80134, 0xe0f9d0f9,
0x98000cf4, 0x00d6d0f9,
0x13b80032, 0x92100000,
0x98000ccc, 0x76bb0167,
0x31f40031,
0xf9d0f902,
0xd6d0f9e0,
0x10000000,
0xbb016792,
0x65b60076,
0x9450f904,
0x56bb0465,
0xfd50bd02,
0x50fc0475,
0x0008807e,
0xfc0464b6,
0x00d6b0d0,
0x00b01bf5,
0x76bb0005,
0x0465b600, 0x0465b600,
0x659450f9, 0x659450f9,
0x0256bb04, 0x0256bb04,
0x75fd50bd, 0x75fd50bd,
0x7e50fc04, 0x7e50fc04,
0xb600082d, 0xb600087b,
0x11f50464, 0xd0fc0464,
0xc5c700cc, 0xf500d6b0,
0x0076bbe0, 0x0500b01b,
0xf90465b6, 0x0076bb00,
0x04659450,
0xbd0256bb,
0x0475fd50,
0xd37e50fc,
0x64b60007,
0xa911f504,
0xbb010500,
0x65b60076,
0x9450f904,
0x56bb0465,
0xfd50bd02,
0x50fc0475,
0x00082d7e,
0xf50464b6,
0xbb008711,
0x65b60076,
0x9450f904,
0x56bb0465,
0xfd50bd02,
0x50fc0475,
0x0007847e,
0xf40464b6,
0x5bcb6711,
0x0076bbe0,
0xf90465b6, 0xf90465b6,
0x04659450, 0x04659450,
0xbd0256bb, 0xbd0256bb,
0x0475fd50, 0x0475fd50,
0xd07e50fc, 0x287e50fc,
0x64b60006, 0x64b60008,
0xbd5bb204, 0xcc11f504,
0x410ef474, 0xe0c5c700,
/* 0x09a4: i2c_recv_not_rd08 */ 0xb60076bb,
0xf401d6b0, 0x50f90465,
0x00053b1b, 0xbb046594,
0x00082d7e, 0x50bd0256,
0xc73211f4, 0xfc0475fd,
0xd37ee0c5, 0x07ce7e50,
0x11f40007, 0x0464b600,
0x7e000528, 0x00a911f5,
0xf400082d, 0x76bb0105,
0xb5c71f11, 0x0465b600,
0x07d37ee0, 0x659450f9,
0x1511f400, 0x0256bb04,
0x0006d07e, 0x75fd50bd,
0xc5c774bd, 0x7e50fc04,
0x091bf408, 0xb6000828,
0xf40232f4, 0x11f50464,
/* 0x09e2: i2c_recv_not_wr08 */ 0x76bb0087,
/* 0x09e2: i2c_recv_done */ 0x0465b600,
0xcec7030e, 0x659450f9,
0x08917ef8, 0x0256bb04,
0xfce0fc00, 0x75fd50bd,
0x0912f4d0, 0x7e50fc04,
0x9f7e7cb2, 0xb600077f,
/* 0x09f6: i2c_recv_exit */ 0x11f40464,
0x00f80002, 0xe05bcb67,
/* 0x09f8: i2c_init */ 0xb60076bb,
/* 0x09fa: test_recv */ 0x50f90465,
0x584100f8, 0xbb046594,
0x0011cf04, 0x50bd0256,
0x400110b6, 0xfc0475fd,
0x01f60458, 0x06cb7e50,
0xde04bd00, 0x0464b600,
0x134fd900, 0x74bd5bb2,
0x0001de7e, /* 0x099f: i2c_recv_not_rd08 */
/* 0x0a16: test_init */ 0xb0410ef4,
0x004e00f8, 0x1bf401d6,
0x01de7e08, 0x7e00053b,
/* 0x0a1f: idle_recv */ 0xf4000828,
0xc5c73211,
0x07ce7ee0,
0x2811f400,
0x287e0005,
0x11f40008,
0xe0b5c71f,
0x0007ce7e,
0x7e1511f4,
0xbd0006cb,
0x08c5c774,
0xf4091bf4,
0x0ef40232,
/* 0x09dd: i2c_recv_not_wr08 */
/* 0x09dd: i2c_recv_done */
0xf8cec703,
0x00088c7e,
0xd0fce0fc,
0xb20912f4,
0x029f7e7c,
/* 0x09f1: i2c_recv_exit */
/* 0x09f3: i2c_init */
0xf800f800, 0xf800f800,
/* 0x0a21: idle */ /* 0x09f5: test_recv */
0x0031f400, 0x04584100,
0xcf045441, 0xb60011cf,
0x10b60011, 0x58400110,
0x04544001, 0x0001f604,
0xbd0001f6, 0x00de04bd,
/* 0x0a35: idle_loop */ 0x7e134fd9,
0xf4580104, 0xf80001de,
/* 0x0a3a: idle_proc */ /* 0x0a11: test_init */
/* 0x0a3a: idle_proc_exec */ 0x08004e00,
0x10f90232, 0x0001de7e,
0xa87e1eb2, /* 0x0a1a: idle_recv */
0x10fc0002, 0x00f800f8,
0xf40911f4, /* 0x0a1c: idle */
0x0ef40231, 0x410031f4,
/* 0x0a4d: idle_proc_next */ 0x11cf0454,
0x5810b6f0, 0x0110b600,
0x1bf41fa6, 0xf6045440,
0xe002f4e8, 0x04bd0001,
0xf40028f4, /* 0x0a30: idle_loop */
0x0000c60e, 0x32f45801,
/* 0x0a35: idle_proc */
/* 0x0a35: idle_proc_exec */
0xb210f902,
0x02a87e1e,
0xf410fc00,
0x31f40911,
0xf00ef402,
/* 0x0a48: idle_proc_next */
0xa65810b6,
0xe81bf41f,
0xf4e002f4,
0x0ef40028,
0x000000c6,
0x00000000,
0x00000000, 0x00000000,
0x00000000, 0x00000000,
0x00000000, 0x00000000,
......
...@@ -47,8 +47,8 @@ static uint32_t gt215_pmu_data[] = { ...@@ -47,8 +47,8 @@ static uint32_t gt215_pmu_data[] = {
0x00000000, 0x00000000,
0x00000000, 0x00000000,
0x584d454d, 0x584d454d,
0x0000083a, 0x00000833,
0x0000082c, 0x00000825,
0x00000000, 0x00000000,
0x00000000, 0x00000000,
0x00000000, 0x00000000,
...@@ -69,8 +69,8 @@ static uint32_t gt215_pmu_data[] = { ...@@ -69,8 +69,8 @@ static uint32_t gt215_pmu_data[] = {
0x00000000, 0x00000000,
0x00000000, 0x00000000,
0x46524550, 0x46524550,
0x0000083e, 0x00000837,
0x0000083c, 0x00000835,
0x00000000, 0x00000000,
0x00000000, 0x00000000,
0x00000000, 0x00000000,
...@@ -91,8 +91,8 @@ static uint32_t gt215_pmu_data[] = { ...@@ -91,8 +91,8 @@ static uint32_t gt215_pmu_data[] = {
0x00000000, 0x00000000,
0x00000000, 0x00000000,
0x5f433249, 0x5f433249,
0x00000c6e, 0x00000c67,
0x00000b11, 0x00000b0a,
0x00000000, 0x00000000,
0x00000000, 0x00000000,
0x00000000, 0x00000000,
...@@ -113,8 +113,8 @@ static uint32_t gt215_pmu_data[] = { ...@@ -113,8 +113,8 @@ static uint32_t gt215_pmu_data[] = {
0x00000000, 0x00000000,
0x00000000, 0x00000000,
0x54534554, 0x54534554,
0x00000c97, 0x00000c90,
0x00000c70, 0x00000c69,
0x00000000, 0x00000000,
0x00000000, 0x00000000,
0x00000000, 0x00000000,
...@@ -135,8 +135,8 @@ static uint32_t gt215_pmu_data[] = { ...@@ -135,8 +135,8 @@ static uint32_t gt215_pmu_data[] = {
0x00000000, 0x00000000,
0x00000000, 0x00000000,
0x454c4449, 0x454c4449,
0x00000ca3, 0x00000c9c,
0x00000ca1, 0x00000c9a,
0x00000000, 0x00000000,
0x00000000, 0x00000000,
0x00000000, 0x00000000,
...@@ -234,22 +234,22 @@ static uint32_t gt215_pmu_data[] = { ...@@ -234,22 +234,22 @@ static uint32_t gt215_pmu_data[] = {
/* 0x037c: memx_func_next */ /* 0x037c: memx_func_next */
0x00000002, 0x00000002,
0x00000000, 0x00000000,
0x000005a0, 0x0000059f,
0x00000003, 0x00000003,
0x00000002, 0x00000002,
0x00000632, 0x0000062f,
0x00040004, 0x00040004,
0x00000000, 0x00000000,
0x0000064e, 0x0000064b,
0x00010005, 0x00010005,
0x00000000, 0x00000000,
0x0000066b, 0x00000668,
0x00010006, 0x00010006,
0x00000000, 0x00000000,
0x000005f0, 0x000005ef,
0x00000007, 0x00000007,
0x00000000, 0x00000000,
0x00000676, 0x00000673,
/* 0x03c4: memx_func_tail */ /* 0x03c4: memx_func_tail */
/* 0x03c4: memx_ts_start */ /* 0x03c4: memx_ts_start */
0x00000000, 0x00000000,
...@@ -1305,560 +1305,560 @@ static uint32_t gt215_pmu_code[] = { ...@@ -1305,560 +1305,560 @@ static uint32_t gt215_pmu_code[] = {
0x67f102d7, 0x67f102d7,
0x63f1fffc, 0x63f1fffc,
0x76fdffff, 0x76fdffff,
0x0267f104, 0x0267f004,
0x0576fd00, 0xf90576fd,
0x70f980f9, 0xfc70f980,
0xe0fcd0fc, 0xf4e0fcd0,
0xf04021f4, 0x67f04021,
0xe007f104,
0x0604b607,
0xbd0006d0,
/* 0x0581: memx_func_enter_wait */
0xc067f104,
0x0664b607,
0xf00066cf,
0x0bf40464,
0x2c67f0f3,
0xcf0664b6,
0x06800066,
/* 0x059f: memx_func_leave */
0xf000f8f1,
0x64b62c67,
0x0066cf06,
0xf0f20680,
0x07f10467, 0x07f10467,
0x04b607e0, 0x04b607e4,
0x0006d006, 0x0006d006,
/* 0x0582: memx_func_enter_wait */ /* 0x05ba: memx_func_leave_wait */
0x67f104bd, 0x67f104bd,
0x64b607c0, 0x64b607c0,
0x0066cf06, 0x0066cf06,
0xf40464f0, 0xf40464f0,
0x67f0f30b, 0x87f1f31b,
0x0664b62c, 0x8eb91610,
0x800066cf, 0x0421f402,
0x00f8f106, 0xf102d7b9,
/* 0x05a0: memx_func_leave */ 0xf1ffcc67,
0xb62c67f0, 0xfdffff63,
0x66cf0664, 0x80f90476,
0xf2068000, 0xd0fc70f9,
0xf10467f0, 0x21f4e0fc,
0xb607e407, /* 0x05ef: memx_func_wait_vblank */
0x06d00604, 0x9800f840,
/* 0x05bb: memx_func_leave_wait */ 0x66b00016,
0xf104bd00, 0x120bf400,
0xb607c067, 0xf40166b0,
0x66cf0664, 0x0ef4060b,
0x0464f000, /* 0x0601: memx_func_wait_vblank_head1 */
0xf1f31bf4, 0x2077f02c,
0xb9161087, /* 0x0607: memx_func_wait_vblank_head0 */
0x21f4028e, 0xf0060ef4,
0x02d7b904, /* 0x060a: memx_func_wait_vblank_0 */
0xffcc67f1, 0x67f10877,
0xffff63f1, 0x64b607c4,
0xf90476fd, 0x0066cf06,
0xfc70f980, 0xf40467fd,
0xf4e0fcd0, /* 0x061a: memx_func_wait_vblank_1 */
0x00f84021, 0x67f1f31b,
/* 0x05f0: memx_func_wait_vblank */ 0x64b607c4,
0xb0001698, 0x0066cf06,
0x0bf40066, 0xf40467fd,
0x0166b013, /* 0x062a: memx_func_wait_vblank_fini */
0xf4060bf4, 0x10b6f30b,
/* 0x0602: memx_func_wait_vblank_head1 */ /* 0x062f: memx_func_wr32 */
0x77f12e0e, 0x9800f804,
0x0ef40020, 0x15980016,
/* 0x0609: memx_func_wait_vblank_head0 */ 0x0810b601,
0x0877f107, 0x50f960f9,
/* 0x060d: memx_func_wait_vblank_0 */
0xc467f100,
0x0664b607,
0xfd0066cf,
0x1bf40467,
/* 0x061d: memx_func_wait_vblank_1 */
0xc467f1f3,
0x0664b607,
0xfd0066cf,
0x0bf40467,
/* 0x062d: memx_func_wait_vblank_fini */
0x0410b6f3,
/* 0x0632: memx_func_wr32 */
0x169800f8,
0x01159800,
0xf90810b6,
0xfc50f960,
0xf4e0fcd0,
0x42b64021,
0xe91bf402,
/* 0x064e: memx_func_wait */
0x87f000f8,
0x0684b62c,
0x980088cf,
0x1d98001e,
0x021c9801,
0xb6031b98,
0x21f41010,
/* 0x066b: memx_func_delay */
0x9800f8a3,
0x10b6001e,
0x7e21f404,
/* 0x0676: memx_func_train */
0x57f100f8,
0x77f10003,
0x97f10000,
0x93f00000,
0x029eb970,
0xb90421f4,
0xe7f102d8,
0x21f42710,
/* 0x0695: memx_func_train_loop_outer */
0x0158e07e,
0x0083f101,
0xe097f102,
0x1193f011,
0x80f990f9,
0xe0fcd0fc, 0xe0fcd0fc,
0xf94021f4, 0xb64021f4,
0x0067f150, 0x1bf40242,
/* 0x06b5: memx_func_train_loop_inner */ /* 0x064b: memx_func_wait */
0x1187f100, 0xf000f8e9,
0x9068ff11, 0x84b62c87,
0xfd109894, 0x0088cf06,
0x97f10589, 0x98001e98,
0x93f00720, 0x1c98011d,
0xf990f910, 0x031b9802,
0xfcd0fc80, 0xf41010b6,
0x4021f4e0, 0x00f8a321,
0x008097f1, /* 0x0668: memx_func_delay */
0xb91093f0, 0xb6001e98,
0x21f4029e, 0x21f40410,
0x02d8b904, /* 0x0673: memx_func_train */
0xf92088c5, 0xf000f87e,
0x77f00357,
0x0097f100,
0x7093f000,
0xf4029eb9,
0xd8b90421,
0x10e7f102,
0x7e21f427,
/* 0x0690: memx_func_train_loop_outer */
0x010158e0,
0x020083f1,
0x11e097f1,
0xf91193f0,
0xfc80f990,
0xf4e0fcd0,
0x50f94021,
/* 0x06af: memx_func_train_loop_inner */
0xf10067f0,
0xff111187,
0x98949068,
0x0589fd10,
0x072097f1,
0xf91093f0,
0xfc80f990, 0xfc80f990,
0xf4e0fcd0, 0xf4e0fcd0,
0x97f14021, 0x97f14021,
0x93f0053c, 0x93f00080,
0x0287f110, 0x029eb910,
0x0083f130, 0xb90421f4,
0xf990f980, 0x88c502d8,
0xf990f920,
0xfcd0fc80, 0xfcd0fc80,
0x4021f4e0, 0x4021f4e0,
0x0560e7f1, 0x053c97f1,
0xf110e3f0, 0xf11093f0,
0xf10000d7, 0xf1300287,
0x908000d3, 0xf9800083,
0xb7f100dc, 0xfc80f990,
0xb3f08480,
0xa321f41e,
0x000057f1,
0xffff97f1,
0x830093f1,
/* 0x0734: memx_func_train_loop_4x */
0x0080a7f1,
0xb910a3f0,
0x21f402ae,
0x02d8b904,
0xffdfb7f1,
0xffffb3f1,
0xf9048bfd,
0xfc80f9a0,
0xf4e0fcd0, 0xf4e0fcd0,
0xa7f14021, 0xe7f14021,
0xa3f0053c, 0xe3f00560,
0x0287f110, 0x00d7f110,
0x0083f130, 0x00d3f100,
0xf9a0f980, 0x00dc9080,
0xfcd0fc80, 0x8480b7f1,
0x4021f4e0, 0xf41eb3f0,
0x0560e7f1, 0x57f0a321,
0xf110e3f0, 0xff97f100,
0xf10000d7, 0x0093f1ff,
0xb98000d3, /* 0x072d: memx_func_train_loop_4x */
0xb7f102dc, 0x80a7f183,
0xb3f02710, 0x10a3f000,
0xa321f400, 0xf402aeb9,
0xf402eeb9, 0xd8b90421,
0xddb90421, 0xdfb7f102,
0x949dff02, 0xffb3f1ff,
0x048bfdff,
0x80f9a0f9,
0xe0fcd0fc,
0xf14021f4,
0xf0053ca7,
0x87f110a3,
0x83f13002,
0xa0f98000,
0xd0fc80f9,
0x21f4e0fc,
0x60e7f140,
0x10e3f005,
0x0000d7f1,
0x8000d3f1,
0xf102dcb9,
0xf02710b7,
0x21f400b3,
0x02eeb9a3,
0xb90421f4,
0x9dff02dd,
0x0150b694,
0xf4045670,
0x7aa0921e,
0xa9800bcc,
0x0160b600,
0x700470b6,
0x1ef51066,
0x50fcff01,
0x700150b6, 0x700150b6,
0x1ef40456, 0x1ef50756,
0xcc7aa092, 0x00f8fed6,
0x00a9800b, /* 0x07c0: memx_exec */
0xb60160b6, 0xd0f9e0f9,
0x66700470, 0xb902c1b9,
0x001ef510, /* 0x07ca: memx_exec_next */
0xb650fcff, 0x139802b2,
0x56700150, 0x0410b600,
0xd41ef507, 0x01f034e7,
/* 0x07c7: memx_exec */ 0x01e033e7,
0xf900f8fe, 0xf00132b6,
0xb9d0f9e0, 0x35980c30,
0xb2b902c1, 0xb855f9de,
/* 0x07d1: memx_exec_next */ 0x1ef40612,
0x00139802, 0xf10b98e4,
0xe70410b6, 0xbbf20c98,
0xe701f034, 0xb7f102cb,
0xb601e033, 0xb4b607c4,
0x30f00132, 0x00bbcf06,
0xde35980c, 0xe0fcd0fc,
0x12b855f9, 0x033621f5,
0xe41ef406, /* 0x0806: memx_info */
0x98f10b98, 0xc67000f8,
0xcbbbf20c, 0x0e0bf401,
0xc4b7f102, /* 0x080c: memx_info_data */
0x06b4b607, 0x03ccc7f1,
0xfc00bbcf, 0x0800b7f1,
0xf5e0fcd0, /* 0x0817: memx_info_train */
0xf10b0ef4,
0xf10bccc7,
/* 0x081f: memx_info_send */
0xf50100b7,
0xf8033621, 0xf8033621,
/* 0x080d: memx_info */ /* 0x0825: memx_recv */
0x01c67000, 0x01d6b000,
/* 0x0813: memx_info_data */ 0xb0980bf4,
0xf10e0bf4, 0x0bf400d6,
0xf103ccc7, /* 0x0833: memx_init */
0xf40800b7, 0xf800f8d8,
/* 0x081e: memx_info_train */ /* 0x0835: perf_recv */
0xc7f10b0e, /* 0x0837: perf_init */
0xb7f10bcc, 0xf800f800,
/* 0x0826: memx_info_send */ /* 0x0839: i2c_drive_scl */
0x21f50100, 0x0036b000,
0x00f80336, 0xf1110bf4,
/* 0x082c: memx_recv */ 0xb607e007,
0xf401d6b0, 0x01d00604,
0xd6b0980b, 0xf804bd00,
0xd80bf400, /* 0x084d: i2c_drive_scl_lo */
/* 0x083a: memx_init */ 0xe407f100,
0x00f800f8, 0x0604b607,
/* 0x083c: perf_recv */ 0xbd0001d0,
/* 0x083e: perf_init */ /* 0x085b: i2c_drive_sda */
0x00f800f8, 0xb000f804,
/* 0x0840: i2c_drive_scl */ 0x0bf40036,
0xf40036b0, 0xe007f111,
0x07f1110b, 0x0604b607,
0x04b607e0, 0xbd0002d0,
0x0001d006, /* 0x086f: i2c_drive_sda_lo */
0x00f804bd, 0xf100f804,
/* 0x0854: i2c_drive_scl_lo */ 0xb607e407,
0x07e407f1, 0x02d00604,
0xd00604b6, 0xf804bd00,
0x04bd0001, /* 0x087d: i2c_sense_scl */
/* 0x0862: i2c_drive_sda */ 0x0132f400,
0x36b000f8, 0x07c437f1,
0x110bf400, 0xcf0634b6,
0x07e007f1, 0x31fd0033,
0xd00604b6, 0x060bf404,
0x04bd0002, /* 0x0893: i2c_sense_scl_done */
/* 0x0876: i2c_drive_sda_lo */ 0xf80131f4,
0x07f100f8, /* 0x0895: i2c_sense_sda */
0x04b607e4, 0x0132f400,
0x0002d006, 0x07c437f1,
0x00f804bd, 0xcf0634b6,
/* 0x0884: i2c_sense_scl */ 0x32fd0033,
0xf10132f4, 0x060bf404,
0xb607c437, /* 0x08ab: i2c_sense_sda_done */
0x33cf0634, 0xf80131f4,
0x0431fd00, /* 0x08ad: i2c_raise_scl */
0xf4060bf4, 0xf140f900,
/* 0x089a: i2c_sense_scl_done */ 0xf0089847,
0x00f80131, 0x21f50137,
/* 0x089c: i2c_sense_sda */ /* 0x08ba: i2c_raise_scl_wait */
0xf10132f4, 0xe7f10839,
0xb607c437, 0x21f403e8,
0x33cf0634, 0x7d21f57e,
0x0432fd00, 0x0901f408,
0xf4060bf4, 0xf40142b6,
/* 0x08b2: i2c_sense_sda_done */ /* 0x08ce: i2c_raise_scl_done */
0x00f80131, 0x40fcef1b,
/* 0x08b4: i2c_raise_scl */ /* 0x08d2: i2c_start */
0x47f140f9, 0x21f500f8,
0x37f00898, 0x11f4087d,
0x4021f501, 0x9521f50d,
/* 0x08c1: i2c_raise_scl_wait */ 0x0611f408,
/* 0x08e3: i2c_start_rep */
0xf0300ef4,
0x21f50037,
0x37f00839,
0x5b21f501,
0x0076bb08,
0xf90465b6,
0x04659450,
0xbd0256bb,
0x0475fd50,
0x21f550fc,
0x64b608ad,
0x1f11f404,
/* 0x0910: i2c_start_send */
0xf50037f0,
0xf1085b21,
0xf41388e7,
0x37f07e21,
0x3921f500,
0x88e7f108,
0x7e21f413,
/* 0x092c: i2c_start_out */
/* 0x092e: i2c_stop */
0x37f000f8,
0x3921f500,
0x0037f008,
0x085b21f5,
0x03e8e7f1,
0xf07e21f4,
0x21f50137,
0xe7f10839,
0x21f41388,
0x0137f07e,
0x085b21f5,
0x1388e7f1,
0xf87e21f4,
/* 0x0961: i2c_bitw */
0x5b21f500,
0xe8e7f108, 0xe8e7f108,
0x7e21f403, 0x7e21f403,
0x088421f5,
0xb60901f4,
0x1bf40142,
/* 0x08d5: i2c_raise_scl_done */
0xf840fcef,
/* 0x08d9: i2c_start */
0x8421f500,
0x0d11f408,
0x089c21f5,
0xf40611f4,
/* 0x08ea: i2c_start_rep */
0x37f0300e,
0x4021f500,
0x0137f008,
0x086221f5,
0xb60076bb, 0xb60076bb,
0x50f90465, 0x50f90465,
0xbb046594, 0xbb046594,
0x50bd0256, 0x50bd0256,
0xfc0475fd, 0xfc0475fd,
0xb421f550, 0xad21f550,
0x0464b608, 0x0464b608,
/* 0x0917: i2c_start_send */ 0xf11811f4,
0xf01f11f4, 0xf41388e7,
0x21f50037,
0xe7f10862,
0x21f41388,
0x0037f07e,
0x084021f5,
0x1388e7f1,
/* 0x0933: i2c_start_out */
0xf87e21f4,
/* 0x0935: i2c_stop */
0x0037f000,
0x084021f5,
0xf50037f0,
0xf1086221,
0xf403e8e7,
0x37f07e21, 0x37f07e21,
0x4021f501, 0x3921f500,
0x88e7f108, 0x88e7f108,
0x7e21f413, 0x7e21f413,
0xf50137f0, /* 0x09a0: i2c_bitw_out */
0xf1086221, /* 0x09a2: i2c_bitr */
0xf41388e7, 0x37f000f8,
0x00f87e21, 0x5b21f501,
/* 0x0968: i2c_bitw */ 0xe8e7f108,
0x086221f5, 0x7e21f403,
0x03e8e7f1, 0xb60076bb,
0xbb7e21f4, 0x50f90465,
0x65b60076, 0xbb046594,
0x9450f904, 0x50bd0256,
0x56bb0465, 0xfc0475fd,
0xfd50bd02, 0xad21f550,
0x50fc0475, 0x0464b608,
0x08b421f5, 0xf51b11f4,
0xf40464b6, 0xf0089521,
0xe7f11811, 0x21f50037,
0xe7f10839,
0x21f41388, 0x21f41388,
0x0037f07e, 0x013cf07e,
0x084021f5, /* 0x09e7: i2c_bitr_done */
0x1388e7f1, 0xf80131f4,
/* 0x09a7: i2c_bitw_out */ /* 0x09e9: i2c_get_byte */
0xf87e21f4, 0x0057f000,
/* 0x09a9: i2c_bitr */ /* 0x09ef: i2c_get_byte_next */
0x0137f000, 0xb60847f0,
0x086221f5, 0x76bb0154,
0x03e8e7f1, 0x0465b600,
0xbb7e21f4, 0x659450f9,
0x65b60076, 0x0256bb04,
0x9450f904, 0x75fd50bd,
0x56bb0465, 0xf550fc04,
0xfd50bd02, 0xb609a221,
0x50fc0475, 0x11f40464,
0x08b421f5, 0x0553fd2b,
0xf40464b6, 0xf40142b6,
0x21f51b11, 0x37f0d81b,
0x37f0089c,
0x4021f500,
0x88e7f108,
0x7e21f413,
0xf4013cf0,
/* 0x09ee: i2c_bitr_done */
0x00f80131,
/* 0x09f0: i2c_get_byte */
0xf00057f0,
/* 0x09f6: i2c_get_byte_next */
0x54b60847,
0x0076bb01, 0x0076bb01,
0xf90465b6, 0xf90465b6,
0x04659450, 0x04659450,
0xbd0256bb, 0xbd0256bb,
0x0475fd50, 0x0475fd50,
0x21f550fc, 0x21f550fc,
0x64b609a9, 0x64b60961,
0x2b11f404, /* 0x0a39: i2c_get_byte_done */
0xb60553fd, /* 0x0a3b: i2c_put_byte */
0x1bf40142, 0xf000f804,
0x0137f0d8, /* 0x0a3e: i2c_put_byte_next */
0xb60076bb, 0x42b60847,
0x50f90465, 0x3854ff01,
0xbb046594,
0x50bd0256,
0xfc0475fd,
0x6821f550,
0x0464b609,
/* 0x0a40: i2c_get_byte_done */
/* 0x0a42: i2c_put_byte */
0x47f000f8,
/* 0x0a45: i2c_put_byte_next */
0x0142b608,
0xbb3854ff,
0x65b60076,
0x9450f904,
0x56bb0465,
0xfd50bd02,
0x50fc0475,
0x096821f5,
0xf40464b6,
0x46b03411,
0xd81bf400,
0xb60076bb, 0xb60076bb,
0x50f90465, 0x50f90465,
0xbb046594, 0xbb046594,
0x50bd0256, 0x50bd0256,
0xfc0475fd, 0xfc0475fd,
0xa921f550, 0x6121f550,
0x0464b609, 0x0464b609,
0xbb0f11f4, 0xb03411f4,
0x36b00076, 0x1bf40046,
0x061bf401, 0x0076bbd8,
/* 0x0a9b: i2c_put_byte_done */
0xf80132f4,
/* 0x0a9d: i2c_addr */
0x0076bb00,
0xf90465b6, 0xf90465b6,
0x04659450, 0x04659450,
0xbd0256bb, 0xbd0256bb,
0x0475fd50, 0x0475fd50,
0x21f550fc, 0x21f550fc,
0x64b608d9, 0x64b609a2,
0x2911f404, 0x0f11f404,
0x012ec3e7, 0xb00076bb,
0xfd0134b6, 0x1bf40136,
0x76bb0553, 0x0132f406,
/* 0x0a94: i2c_put_byte_done */
/* 0x0a96: i2c_addr */
0x76bb00f8,
0x0465b600, 0x0465b600,
0x659450f9, 0x659450f9,
0x0256bb04, 0x0256bb04,
0x75fd50bd, 0x75fd50bd,
0xf550fc04, 0xf550fc04,
0xb60a4221, 0xb608d221,
/* 0x0ae2: i2c_addr_done */ 0x11f40464,
0x00f80464, 0x2ec3e729,
/* 0x0ae4: i2c_acquire_addr */ 0x0134b601,
0xb6f8cec7, 0xbb0553fd,
0xe0b702e4,
0xee980d1c,
/* 0x0af3: i2c_acquire */
0xf500f800,
0xf40ae421,
0xd9f00421,
0x4021f403,
/* 0x0b02: i2c_release */
0x21f500f8,
0x21f40ae4,
0x03daf004,
0xf84021f4,
/* 0x0b11: i2c_recv */
0x0132f400,
0xb6f8c1c7,
0x16b00214,
0x3a1ff528,
0xf413a001,
0x0032980c,
0x0ccc13a0,
0xf4003198,
0xd0f90231,
0xd0f9e0f9,
0x000067f1,
0x100063f1,
0xbb016792,
0x65b60076, 0x65b60076,
0x9450f904, 0x9450f904,
0x56bb0465, 0x56bb0465,
0xfd50bd02, 0xfd50bd02,
0x50fc0475, 0x50fc0475,
0x0af321f5, 0x0a3b21f5,
0xfc0464b6, /* 0x0adb: i2c_addr_done */
0x00d6b0d0, 0xf80464b6,
0x00b31bf5, /* 0x0add: i2c_acquire_addr */
0xbb0057f0, 0xf8cec700,
0xb702e4b6,
0x980d1ce0,
0x00f800ee,
/* 0x0aec: i2c_acquire */
0x0add21f5,
0xf00421f4,
0x21f403d9,
/* 0x0afb: i2c_release */
0xf500f840,
0xf40add21,
0xdaf00421,
0x4021f403,
/* 0x0b0a: i2c_recv */
0x32f400f8,
0xf8c1c701,
0xb00214b6,
0x1ff52816,
0x13a0013a,
0x32980cf4,
0xcc13a000,
0x0031980c,
0xf90231f4,
0xf9e0f9d0,
0x0067f1d0,
0x0063f100,
0x01679210,
0xb60076bb,
0x50f90465,
0xbb046594,
0x50bd0256,
0xfc0475fd,
0xec21f550,
0x0464b60a,
0xd6b0d0fc,
0xb31bf500,
0x0057f000,
0xb60076bb,
0x50f90465,
0xbb046594,
0x50bd0256,
0xfc0475fd,
0x9621f550,
0x0464b60a,
0x00d011f5,
0xbbe0c5c7,
0x65b60076, 0x65b60076,
0x9450f904, 0x9450f904,
0x56bb0465, 0x56bb0465,
0xfd50bd02, 0xfd50bd02,
0x50fc0475, 0x50fc0475,
0x0a9d21f5, 0x0a3b21f5,
0xf50464b6, 0xf50464b6,
0xc700d011, 0xf000ad11,
0x76bbe0c5, 0x76bb0157,
0x0465b600, 0x0465b600,
0x659450f9, 0x659450f9,
0x0256bb04, 0x0256bb04,
0x75fd50bd, 0x75fd50bd,
0xf550fc04, 0xf550fc04,
0xb60a4221, 0xb60a9621,
0x11f50464, 0x11f50464,
0x57f000ad, 0x76bb008a,
0x0076bb01, 0x0465b600,
0xf90465b6, 0x659450f9,
0x04659450, 0x0256bb04,
0xbd0256bb, 0x75fd50bd,
0x0475fd50, 0xf550fc04,
0x21f550fc, 0xb609e921,
0x64b60a9d, 0x11f40464,
0x8a11f504, 0xe05bcb6a,
0x0076bb00, 0xb60076bb,
0xf90465b6, 0x50f90465,
0x04659450, 0xbb046594,
0xbd0256bb, 0x50bd0256,
0x0475fd50, 0xfc0475fd,
0x21f550fc, 0x2e21f550,
0x64b609f0, 0x0464b609,
0x6a11f404, 0xbd025bb9,
0xbbe05bcb, 0x430ef474,
0x65b60076, /* 0x0c10: i2c_recv_not_rd08 */
0x9450f904, 0xf401d6b0,
0x56bb0465, 0x57f03d1b,
0xfd50bd02, 0x9621f500,
0x50fc0475, 0x3311f40a,
0x093521f5, 0xf5e0c5c7,
0xb90464b6, 0xf40a3b21,
0x74bd025b, 0x57f02911,
/* 0x0c17: i2c_recv_not_rd08 */ 0x9621f500,
0xb0430ef4, 0x1f11f40a,
0x1bf401d6, 0xf5e0b5c7,
0x0057f03d, 0xf40a3b21,
0x0a9d21f5, 0x21f51511,
0xc73311f4, 0x74bd092e,
0x21f5e0c5, 0xf408c5c7,
0x11f40a42, 0x32f4091b,
0x0057f029, 0x030ef402,
0x0a9d21f5, /* 0x0c50: i2c_recv_not_wr08 */
0xc71f11f4, /* 0x0c50: i2c_recv_done */
0x21f5e0b5, 0xf5f8cec7,
0x11f40a42, 0xfc0afb21,
0x3521f515, 0xf4d0fce0,
0xc774bd09, 0x7cb90a12,
0x1bf408c5, 0x3621f502,
0x0232f409, /* 0x0c65: i2c_recv_exit */
/* 0x0c57: i2c_recv_not_wr08 */ /* 0x0c67: i2c_init */
/* 0x0c57: i2c_recv_done */ 0xf800f803,
0xc7030ef4, /* 0x0c69: test_recv */
0x21f5f8ce, 0xd817f100,
0xe0fc0b02, 0x0614b605,
0x12f4d0fc, 0xb60011cf,
0x027cb90a, 0x07f10110,
0x033621f5, 0x04b605d8,
/* 0x0c6c: i2c_recv_exit */ 0x0001d006,
/* 0x0c6e: i2c_init */ 0xe7f104bd,
0xe3f1d900,
0x21f5134f,
0x00f80256,
/* 0x0c90: test_init */
0x0800e7f1,
0x025621f5,
/* 0x0c9a: idle_recv */
0x00f800f8, 0x00f800f8,
/* 0x0c70: test_recv */ /* 0x0c9c: idle */
0x05d817f1, 0xf10031f4,
0xcf0614b6, 0xb605d417,
0x10b60011, 0x11cf0614,
0xd807f101, 0x0110b600,
0x0604b605, 0x05d407f1,
0xbd0001d0, 0xd00604b6,
0x00e7f104, 0x04bd0001,
0x4fe3f1d9, /* 0x0cb8: idle_loop */
0x5621f513, 0xf45817f0,
/* 0x0c97: test_init */ /* 0x0cbe: idle_proc */
0xf100f802, /* 0x0cbe: idle_proc_exec */
0xf50800e7, 0x10f90232,
0xf8025621, 0xf5021eb9,
/* 0x0ca1: idle_recv */ 0xfc033f21,
/* 0x0ca3: idle */ 0x0911f410,
0xf400f800, 0xf40231f4,
0x17f10031, /* 0x0cd2: idle_proc_next */
0x14b605d4, 0x10b6ef0e,
0x0011cf06, 0x061fb858,
0xf10110b6, 0xf4e61bf4,
0xb605d407, 0x28f4dd02,
0x01d00604, 0xbb0ef400,
/* 0x0cbf: idle_loop */ 0x00000000,
0xf004bd00, 0x00000000,
0x32f45817,
/* 0x0cc5: idle_proc */
/* 0x0cc5: idle_proc_exec */
0xb910f902,
0x21f5021e,
0x10fc033f,
0xf40911f4,
0x0ef40231,
/* 0x0cd9: idle_proc_next */
0x5810b6ef,
0xf4061fb8,
0x02f4e61b,
0x0028f4dd,
0x00bb0ef4,
0x00000000, 0x00000000,
0x00000000, 0x00000000,
0x00000000, 0x00000000,
......
...@@ -82,15 +82,15 @@ memx_train_tail: ...@@ -82,15 +82,15 @@ memx_train_tail:
// $r0 - zero // $r0 - zero
memx_func_enter: memx_func_enter:
#if NVKM_PPWR_CHIPSET == GT215 #if NVKM_PPWR_CHIPSET == GT215
movw $r8 0x1610 mov $r8 0x1610
nv_rd32($r7, $r8) nv_rd32($r7, $r8)
imm32($r6, 0xfffffffc) imm32($r6, 0xfffffffc)
and $r7 $r6 and $r7 $r6
movw $r6 0x2 mov $r6 0x2
or $r7 $r6 or $r7 $r6
nv_wr32($r8, $r7) nv_wr32($r8, $r7)
#else #else
movw $r6 0x001620 mov $r6 0x001620
imm32($r7, ~0x00000aa2); imm32($r7, ~0x00000aa2);
nv_rd32($r8, $r6) nv_rd32($r8, $r6)
and $r8 $r7 and $r8 $r7
...@@ -101,7 +101,7 @@ memx_func_enter: ...@@ -101,7 +101,7 @@ memx_func_enter:
and $r8 $r7 and $r8 $r7
nv_wr32($r6, $r8) nv_wr32($r6, $r8)
movw $r6 0x0026f0 mov $r6 0x0026f0
nv_rd32($r8, $r6) nv_rd32($r8, $r6)
and $r8 $r7 and $r8 $r7
nv_wr32($r6, $r8) nv_wr32($r6, $r8)
...@@ -136,19 +136,19 @@ memx_func_leave: ...@@ -136,19 +136,19 @@ memx_func_leave:
bra nz #memx_func_leave_wait bra nz #memx_func_leave_wait
#if NVKM_PPWR_CHIPSET == GT215 #if NVKM_PPWR_CHIPSET == GT215
movw $r8 0x1610 mov $r8 0x1610
nv_rd32($r7, $r8) nv_rd32($r7, $r8)
imm32($r6, 0xffffffcc) imm32($r6, 0xffffffcc)
and $r7 $r6 and $r7 $r6
nv_wr32($r8, $r7) nv_wr32($r8, $r7)
#else #else
movw $r6 0x0026f0 mov $r6 0x0026f0
imm32($r7, 0x00000001) imm32($r7, 0x00000001)
nv_rd32($r8, $r6) nv_rd32($r8, $r6)
or $r8 $r7 or $r8 $r7
nv_wr32($r6, $r8) nv_wr32($r6, $r8)
movw $r6 0x001620 mov $r6 0x001620
nv_rd32($r8, $r6) nv_rd32($r8, $r6)
or $r8 $r7 or $r8 $r7
nv_wr32($r6, $r8) nv_wr32($r6, $r8)
...@@ -177,11 +177,11 @@ memx_func_wait_vblank: ...@@ -177,11 +177,11 @@ memx_func_wait_vblank:
bra #memx_func_wait_vblank_fini bra #memx_func_wait_vblank_fini
memx_func_wait_vblank_head1: memx_func_wait_vblank_head1:
movw $r7 0x20 mov $r7 0x20
bra #memx_func_wait_vblank_0 bra #memx_func_wait_vblank_0
memx_func_wait_vblank_head0: memx_func_wait_vblank_head0:
movw $r7 0x8 mov $r7 0x8
memx_func_wait_vblank_0: memx_func_wait_vblank_0:
nv_iord($r6, NV_PPWR_INPUT) nv_iord($r6, NV_PPWR_INPUT)
...@@ -273,13 +273,13 @@ memx_func_train: ...@@ -273,13 +273,13 @@ memx_func_train:
// $r5 - outer loop counter // $r5 - outer loop counter
// $r6 - inner loop counter // $r6 - inner loop counter
// $r7 - entry counter (#memx_train_head + $r7) // $r7 - entry counter (#memx_train_head + $r7)
movw $r5 0x3 mov $r5 0x3
movw $r7 0x0 mov $r7 0x0
// Read random memory to wake up... things // Read random memory to wake up... things
imm32($r9, 0x700000) imm32($r9, 0x700000)
nv_rd32($r8,$r9) nv_rd32($r8,$r9)
movw $r14 0x2710 mov $r14 0x2710
call(nsec) call(nsec)
memx_func_train_loop_outer: memx_func_train_loop_outer:
...@@ -289,9 +289,9 @@ memx_func_train: ...@@ -289,9 +289,9 @@ memx_func_train:
nv_wr32($r9, $r8) nv_wr32($r9, $r8)
push $r5 push $r5
movw $r6 0x0 mov $r6 0x0
memx_func_train_loop_inner: memx_func_train_loop_inner:
movw $r8 0x1111 mov $r8 0x1111
mulu $r9 $r6 $r8 mulu $r9 $r6 $r8
shl b32 $r8 $r9 0x10 shl b32 $r8 $r9 0x10
or $r8 $r9 or $r8 $r9
...@@ -315,7 +315,7 @@ memx_func_train: ...@@ -315,7 +315,7 @@ memx_func_train:
// $r5 - inner inner loop counter // $r5 - inner inner loop counter
// $r9 - result // $r9 - result
movw $r5 0 mov $r5 0
imm32($r9, 0x8300ffff) imm32($r9, 0x8300ffff)
memx_func_train_loop_4x: memx_func_train_loop_4x:
imm32($r10, 0x100080) imm32($r10, 0x100080)
......
...@@ -7,8 +7,10 @@ nvkm-y += nvkm/subdev/secboot/acr_r352.o ...@@ -7,8 +7,10 @@ nvkm-y += nvkm/subdev/secboot/acr_r352.o
nvkm-y += nvkm/subdev/secboot/acr_r361.o nvkm-y += nvkm/subdev/secboot/acr_r361.o
nvkm-y += nvkm/subdev/secboot/acr_r364.o nvkm-y += nvkm/subdev/secboot/acr_r364.o
nvkm-y += nvkm/subdev/secboot/acr_r367.o nvkm-y += nvkm/subdev/secboot/acr_r367.o
nvkm-y += nvkm/subdev/secboot/acr_r370.o
nvkm-y += nvkm/subdev/secboot/acr_r375.o nvkm-y += nvkm/subdev/secboot/acr_r375.o
nvkm-y += nvkm/subdev/secboot/gm200.o nvkm-y += nvkm/subdev/secboot/gm200.o
nvkm-y += nvkm/subdev/secboot/gm20b.o nvkm-y += nvkm/subdev/secboot/gm20b.o
nvkm-y += nvkm/subdev/secboot/gp102.o nvkm-y += nvkm/subdev/secboot/gp102.o
nvkm-y += nvkm/subdev/secboot/gp108.o
nvkm-y += nvkm/subdev/secboot/gp10b.o nvkm-y += nvkm/subdev/secboot/gp10b.o
...@@ -64,6 +64,7 @@ struct nvkm_acr *acr_r352_new(unsigned long); ...@@ -64,6 +64,7 @@ struct nvkm_acr *acr_r352_new(unsigned long);
struct nvkm_acr *acr_r361_new(unsigned long); struct nvkm_acr *acr_r361_new(unsigned long);
struct nvkm_acr *acr_r364_new(unsigned long); struct nvkm_acr *acr_r364_new(unsigned long);
struct nvkm_acr *acr_r367_new(enum nvkm_secboot_falcon, unsigned long); struct nvkm_acr *acr_r367_new(enum nvkm_secboot_falcon, unsigned long);
struct nvkm_acr *acr_r370_new(enum nvkm_secboot_falcon, unsigned long);
struct nvkm_acr *acr_r375_new(enum nvkm_secboot_falcon, unsigned long); struct nvkm_acr *acr_r375_new(enum nvkm_secboot_falcon, unsigned long);
#endif #endif
/*
* Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#include "acr_r370.h"
#include "acr_r367.h"
#include <core/msgqueue.h>
#include <engine/falcon.h>
#include <engine/sec2.h>
static void
acr_r370_generate_flcn_bl_desc(const struct nvkm_acr *acr,
const struct ls_ucode_img *img, u64 wpr_addr,
void *_desc)
{
struct acr_r370_flcn_bl_desc *desc = _desc;
const struct ls_ucode_img_desc *pdesc = &img->ucode_desc;
u64 base, addr_code, addr_data;
base = wpr_addr + img->ucode_off + pdesc->app_start_offset;
addr_code = base + pdesc->app_resident_code_offset;
addr_data = base + pdesc->app_resident_data_offset;
desc->ctx_dma = FALCON_DMAIDX_UCODE;
desc->code_dma_base = u64_to_flcn64(addr_code);
desc->non_sec_code_off = pdesc->app_resident_code_offset;
desc->non_sec_code_size = pdesc->app_resident_code_size;
desc->code_entry_point = pdesc->app_imem_entry;
desc->data_dma_base = u64_to_flcn64(addr_data);
desc->data_size = pdesc->app_resident_data_size;
}
const struct acr_r352_ls_func
acr_r370_ls_fecs_func = {
.load = acr_ls_ucode_load_fecs,
.generate_bl_desc = acr_r370_generate_flcn_bl_desc,
.bl_desc_size = sizeof(struct acr_r370_flcn_bl_desc),
};
const struct acr_r352_ls_func
acr_r370_ls_gpccs_func = {
.load = acr_ls_ucode_load_gpccs,
.generate_bl_desc = acr_r370_generate_flcn_bl_desc,
.bl_desc_size = sizeof(struct acr_r370_flcn_bl_desc),
/* GPCCS will be loaded using PRI */
.lhdr_flags = LSF_FLAG_FORCE_PRIV_LOAD,
};
static void
acr_r370_generate_sec2_bl_desc(const struct nvkm_acr *acr,
const struct ls_ucode_img *img, u64 wpr_addr,
void *_desc)
{
const struct ls_ucode_img_desc *pdesc = &img->ucode_desc;
const struct nvkm_sec2 *sec = acr->subdev->device->sec2;
struct acr_r370_flcn_bl_desc *desc = _desc;
u64 base, addr_code, addr_data;
u32 addr_args;
base = wpr_addr + img->ucode_off + pdesc->app_start_offset;
/* For some reason we should not add app_resident_code_offset here */
addr_code = base;
addr_data = base + pdesc->app_resident_data_offset;
addr_args = sec->falcon->data.limit;
addr_args -= NVKM_MSGQUEUE_CMDLINE_SIZE;
desc->ctx_dma = FALCON_SEC2_DMAIDX_UCODE;
desc->code_dma_base = u64_to_flcn64(addr_code);
desc->non_sec_code_off = pdesc->app_resident_code_offset;
desc->non_sec_code_size = pdesc->app_resident_code_size;
desc->code_entry_point = pdesc->app_imem_entry;
desc->data_dma_base = u64_to_flcn64(addr_data);
desc->data_size = pdesc->app_resident_data_size;
desc->argc = 1;
/* args are stored at the beginning of EMEM */
desc->argv = 0x01000000;
}
const struct acr_r352_ls_func
acr_r370_ls_sec2_func = {
.load = acr_ls_ucode_load_sec2,
.generate_bl_desc = acr_r370_generate_sec2_bl_desc,
.bl_desc_size = sizeof(struct acr_r370_flcn_bl_desc),
.post_run = acr_ls_sec2_post_run,
};
void
acr_r370_generate_hs_bl_desc(const struct hsf_load_header *hdr, void *_bl_desc,
u64 offset)
{
struct acr_r370_flcn_bl_desc *bl_desc = _bl_desc;
bl_desc->ctx_dma = FALCON_DMAIDX_VIRT;
bl_desc->non_sec_code_off = hdr->non_sec_code_off;
bl_desc->non_sec_code_size = hdr->non_sec_code_size;
bl_desc->sec_code_off = hsf_load_header_app_off(hdr, 0);
bl_desc->sec_code_size = hsf_load_header_app_size(hdr, 0);
bl_desc->code_entry_point = 0;
bl_desc->code_dma_base = u64_to_flcn64(offset);
bl_desc->data_dma_base = u64_to_flcn64(offset + hdr->data_dma_base);
bl_desc->data_size = hdr->data_size;
}
const struct acr_r352_func
acr_r370_func = {
.fixup_hs_desc = acr_r367_fixup_hs_desc,
.generate_hs_bl_desc = acr_r370_generate_hs_bl_desc,
.hs_bl_desc_size = sizeof(struct acr_r370_flcn_bl_desc),
.shadow_blob = true,
.ls_ucode_img_load = acr_r367_ls_ucode_img_load,
.ls_fill_headers = acr_r367_ls_fill_headers,
.ls_write_wpr = acr_r367_ls_write_wpr,
.ls_func = {
[NVKM_SECBOOT_FALCON_SEC2] = &acr_r370_ls_sec2_func,
[NVKM_SECBOOT_FALCON_FECS] = &acr_r370_ls_fecs_func,
[NVKM_SECBOOT_FALCON_GPCCS] = &acr_r370_ls_gpccs_func,
},
};
struct nvkm_acr *
acr_r370_new(enum nvkm_secboot_falcon boot_falcon,
unsigned long managed_falcons)
{
return acr_r352_new_(&acr_r370_func, boot_falcon, managed_falcons);
}
/*
* Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#ifndef __NVKM_SECBOOT_ACR_R370_H__
#define __NVKM_SECBOOT_ACR_R370_H__
#include "priv.h"
struct hsf_load_header;
/* Same as acr_r361_flcn_bl_desc, plus argc/argv */
struct acr_r370_flcn_bl_desc {
u32 reserved[4];
u32 signature[4];
u32 ctx_dma;
struct flcn_u64 code_dma_base;
u32 non_sec_code_off;
u32 non_sec_code_size;
u32 sec_code_off;
u32 sec_code_size;
u32 code_entry_point;
struct flcn_u64 data_dma_base;
u32 data_size;
u32 argc;
u32 argv;
};
void acr_r370_generate_hs_bl_desc(const struct hsf_load_header *, void *, u64);
extern const struct acr_r352_ls_func acr_r370_ls_fecs_func;
extern const struct acr_r352_ls_func acr_r370_ls_gpccs_func;
#endif
...@@ -20,90 +20,12 @@ ...@@ -20,90 +20,12 @@
* DEALINGS IN THE SOFTWARE. * DEALINGS IN THE SOFTWARE.
*/ */
#include "acr_r370.h"
#include "acr_r367.h" #include "acr_r367.h"
#include <engine/falcon.h>
#include <core/msgqueue.h> #include <core/msgqueue.h>
#include <subdev/pmu.h> #include <subdev/pmu.h>
/*
* r375 ACR: similar to r367, but with a unified bootloader descriptor
* structure for GR and PMU falcons.
*/
/* Same as acr_r361_flcn_bl_desc, plus argc/argv */
struct acr_r375_flcn_bl_desc {
u32 reserved[4];
u32 signature[4];
u32 ctx_dma;
struct flcn_u64 code_dma_base;
u32 non_sec_code_off;
u32 non_sec_code_size;
u32 sec_code_off;
u32 sec_code_size;
u32 code_entry_point;
struct flcn_u64 data_dma_base;
u32 data_size;
u32 argc;
u32 argv;
};
static void
acr_r375_generate_flcn_bl_desc(const struct nvkm_acr *acr,
const struct ls_ucode_img *img, u64 wpr_addr,
void *_desc)
{
struct acr_r375_flcn_bl_desc *desc = _desc;
const struct ls_ucode_img_desc *pdesc = &img->ucode_desc;
u64 base, addr_code, addr_data;
base = wpr_addr + img->ucode_off + pdesc->app_start_offset;
addr_code = base + pdesc->app_resident_code_offset;
addr_data = base + pdesc->app_resident_data_offset;
desc->ctx_dma = FALCON_DMAIDX_UCODE;
desc->code_dma_base = u64_to_flcn64(addr_code);
desc->non_sec_code_off = pdesc->app_resident_code_offset;
desc->non_sec_code_size = pdesc->app_resident_code_size;
desc->code_entry_point = pdesc->app_imem_entry;
desc->data_dma_base = u64_to_flcn64(addr_data);
desc->data_size = pdesc->app_resident_data_size;
}
static void
acr_r375_generate_hs_bl_desc(const struct hsf_load_header *hdr, void *_bl_desc,
u64 offset)
{
struct acr_r375_flcn_bl_desc *bl_desc = _bl_desc;
bl_desc->ctx_dma = FALCON_DMAIDX_VIRT;
bl_desc->non_sec_code_off = hdr->non_sec_code_off;
bl_desc->non_sec_code_size = hdr->non_sec_code_size;
bl_desc->sec_code_off = hsf_load_header_app_off(hdr, 0);
bl_desc->sec_code_size = hsf_load_header_app_size(hdr, 0);
bl_desc->code_entry_point = 0;
bl_desc->code_dma_base = u64_to_flcn64(offset);
bl_desc->data_dma_base = u64_to_flcn64(offset + hdr->data_dma_base);
bl_desc->data_size = hdr->data_size;
}
const struct acr_r352_ls_func
acr_r375_ls_fecs_func = {
.load = acr_ls_ucode_load_fecs,
.generate_bl_desc = acr_r375_generate_flcn_bl_desc,
.bl_desc_size = sizeof(struct acr_r375_flcn_bl_desc),
};
const struct acr_r352_ls_func
acr_r375_ls_gpccs_func = {
.load = acr_ls_ucode_load_gpccs,
.generate_bl_desc = acr_r375_generate_flcn_bl_desc,
.bl_desc_size = sizeof(struct acr_r375_flcn_bl_desc),
/* GPCCS will be loaded using PRI */
.lhdr_flags = LSF_FLAG_FORCE_PRIV_LOAD,
};
static void static void
acr_r375_generate_pmu_bl_desc(const struct nvkm_acr *acr, acr_r375_generate_pmu_bl_desc(const struct nvkm_acr *acr,
const struct ls_ucode_img *img, u64 wpr_addr, const struct ls_ucode_img *img, u64 wpr_addr,
...@@ -111,7 +33,7 @@ acr_r375_generate_pmu_bl_desc(const struct nvkm_acr *acr, ...@@ -111,7 +33,7 @@ acr_r375_generate_pmu_bl_desc(const struct nvkm_acr *acr,
{ {
const struct ls_ucode_img_desc *pdesc = &img->ucode_desc; const struct ls_ucode_img_desc *pdesc = &img->ucode_desc;
const struct nvkm_pmu *pmu = acr->subdev->device->pmu; const struct nvkm_pmu *pmu = acr->subdev->device->pmu;
struct acr_r375_flcn_bl_desc *desc = _desc; struct acr_r370_flcn_bl_desc *desc = _desc;
u64 base, addr_code, addr_data; u64 base, addr_code, addr_data;
u32 addr_args; u32 addr_args;
...@@ -136,23 +58,22 @@ const struct acr_r352_ls_func ...@@ -136,23 +58,22 @@ const struct acr_r352_ls_func
acr_r375_ls_pmu_func = { acr_r375_ls_pmu_func = {
.load = acr_ls_ucode_load_pmu, .load = acr_ls_ucode_load_pmu,
.generate_bl_desc = acr_r375_generate_pmu_bl_desc, .generate_bl_desc = acr_r375_generate_pmu_bl_desc,
.bl_desc_size = sizeof(struct acr_r375_flcn_bl_desc), .bl_desc_size = sizeof(struct acr_r370_flcn_bl_desc),
.post_run = acr_ls_pmu_post_run, .post_run = acr_ls_pmu_post_run,
}; };
const struct acr_r352_func const struct acr_r352_func
acr_r375_func = { acr_r375_func = {
.fixup_hs_desc = acr_r367_fixup_hs_desc, .fixup_hs_desc = acr_r367_fixup_hs_desc,
.generate_hs_bl_desc = acr_r375_generate_hs_bl_desc, .generate_hs_bl_desc = acr_r370_generate_hs_bl_desc,
.hs_bl_desc_size = sizeof(struct acr_r375_flcn_bl_desc), .hs_bl_desc_size = sizeof(struct acr_r370_flcn_bl_desc),
.shadow_blob = true, .shadow_blob = true,
.ls_ucode_img_load = acr_r367_ls_ucode_img_load, .ls_ucode_img_load = acr_r367_ls_ucode_img_load,
.ls_fill_headers = acr_r367_ls_fill_headers, .ls_fill_headers = acr_r367_ls_fill_headers,
.ls_write_wpr = acr_r367_ls_write_wpr, .ls_write_wpr = acr_r367_ls_write_wpr,
.ls_func = { .ls_func = {
[NVKM_SECBOOT_FALCON_FECS] = &acr_r375_ls_fecs_func, [NVKM_SECBOOT_FALCON_FECS] = &acr_r370_ls_fecs_func,
[NVKM_SECBOOT_FALCON_GPCCS] = &acr_r375_ls_gpccs_func, [NVKM_SECBOOT_FALCON_GPCCS] = &acr_r370_ls_gpccs_func,
[NVKM_SECBOOT_FALCON_PMU] = &acr_r375_ls_pmu_func, [NVKM_SECBOOT_FALCON_PMU] = &acr_r375_ls_pmu_func,
}, },
}; };
......
...@@ -133,7 +133,7 @@ gp102_secboot_run_blob(struct nvkm_secboot *sb, struct nvkm_gpuobj *blob, ...@@ -133,7 +133,7 @@ gp102_secboot_run_blob(struct nvkm_secboot *sb, struct nvkm_gpuobj *blob,
return gm200_secboot_run_blob(sb, blob, falcon); return gm200_secboot_run_blob(sb, blob, falcon);
} }
static const struct nvkm_secboot_func const struct nvkm_secboot_func
gp102_secboot = { gp102_secboot = {
.dtor = gm200_secboot_dtor, .dtor = gm200_secboot_dtor,
.oneinit = gm200_secboot_oneinit, .oneinit = gm200_secboot_oneinit,
......
/*
* Copyright 2017 Red Hat Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
#include "gm200.h"
#include "acr.h"
int
gp108_secboot_new(struct nvkm_device *device, int index,
struct nvkm_secboot **psb)
{
struct gm200_secboot *gsb;
struct nvkm_acr *acr;
acr = acr_r370_new(NVKM_SECBOOT_FALCON_SEC2,
BIT(NVKM_SECBOOT_FALCON_FECS) |
BIT(NVKM_SECBOOT_FALCON_GPCCS) |
BIT(NVKM_SECBOOT_FALCON_SEC2));
if (IS_ERR(acr))
return PTR_ERR(acr);
if (!(gsb = kzalloc(sizeof(*gsb), GFP_KERNEL))) {
acr->func->dtor(acr);
return -ENOMEM;
}
*psb = &gsb->base;
return nvkm_secboot_ctor(&gp102_secboot, acr, device, index, &gsb->base);
}
MODULE_FIRMWARE("nvidia/gp108/acr/bl.bin");
MODULE_FIRMWARE("nvidia/gp108/acr/unload_bl.bin");
MODULE_FIRMWARE("nvidia/gp108/acr/ucode_load.bin");
MODULE_FIRMWARE("nvidia/gp108/acr/ucode_unload.bin");
MODULE_FIRMWARE("nvidia/gp108/gr/fecs_bl.bin");
MODULE_FIRMWARE("nvidia/gp108/gr/fecs_inst.bin");
MODULE_FIRMWARE("nvidia/gp108/gr/fecs_data.bin");
MODULE_FIRMWARE("nvidia/gp108/gr/fecs_sig.bin");
MODULE_FIRMWARE("nvidia/gp108/gr/gpccs_bl.bin");
MODULE_FIRMWARE("nvidia/gp108/gr/gpccs_inst.bin");
MODULE_FIRMWARE("nvidia/gp108/gr/gpccs_data.bin");
MODULE_FIRMWARE("nvidia/gp108/gr/gpccs_sig.bin");
MODULE_FIRMWARE("nvidia/gp108/gr/sw_ctx.bin");
MODULE_FIRMWARE("nvidia/gp108/gr/sw_nonctx.bin");
MODULE_FIRMWARE("nvidia/gp108/gr/sw_bundle_init.bin");
MODULE_FIRMWARE("nvidia/gp108/gr/sw_method_init.bin");
MODULE_FIRMWARE("nvidia/gp108/nvdec/scrubber.bin");
MODULE_FIRMWARE("nvidia/gp108/sec2/desc.bin");
MODULE_FIRMWARE("nvidia/gp108/sec2/image.bin");
MODULE_FIRMWARE("nvidia/gp108/sec2/sig.bin");
...@@ -40,6 +40,8 @@ int nvkm_secboot_ctor(const struct nvkm_secboot_func *, struct nvkm_acr *, ...@@ -40,6 +40,8 @@ int nvkm_secboot_ctor(const struct nvkm_secboot_func *, struct nvkm_acr *,
int nvkm_secboot_falcon_reset(struct nvkm_secboot *); int nvkm_secboot_falcon_reset(struct nvkm_secboot *);
int nvkm_secboot_falcon_run(struct nvkm_secboot *); int nvkm_secboot_falcon_run(struct nvkm_secboot *);
extern const struct nvkm_secboot_func gp102_secboot;
struct flcn_u64 { struct flcn_u64 {
u32 lo; u32 lo;
u32 hi; u32 hi;
......
...@@ -9,7 +9,9 @@ nvkm-y += nvkm/subdev/therm/nv40.o ...@@ -9,7 +9,9 @@ nvkm-y += nvkm/subdev/therm/nv40.o
nvkm-y += nvkm/subdev/therm/nv50.o nvkm-y += nvkm/subdev/therm/nv50.o
nvkm-y += nvkm/subdev/therm/g84.o nvkm-y += nvkm/subdev/therm/g84.o
nvkm-y += nvkm/subdev/therm/gt215.o nvkm-y += nvkm/subdev/therm/gt215.o
nvkm-y += nvkm/subdev/therm/gf100.o
nvkm-y += nvkm/subdev/therm/gf119.o nvkm-y += nvkm/subdev/therm/gf119.o
nvkm-y += nvkm/subdev/therm/gk104.o
nvkm-y += nvkm/subdev/therm/gm107.o nvkm-y += nvkm/subdev/therm/gm107.o
nvkm-y += nvkm/subdev/therm/gm200.o nvkm-y += nvkm/subdev/therm/gm200.o
nvkm-y += nvkm/subdev/therm/gp100.o nvkm-y += nvkm/subdev/therm/gp100.o
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
* *
* Authors: Martin Peres * Authors: Martin Peres
*/ */
#include <nvkm/core/option.h>
#include "priv.h" #include "priv.h"
int int
...@@ -297,6 +298,38 @@ nvkm_therm_attr_set(struct nvkm_therm *therm, ...@@ -297,6 +298,38 @@ nvkm_therm_attr_set(struct nvkm_therm *therm,
return -EINVAL; return -EINVAL;
} }
void
nvkm_therm_clkgate_enable(struct nvkm_therm *therm)
{
if (!therm->func->clkgate_enable || !therm->clkgating_enabled)
return;
nvkm_debug(&therm->subdev,
"Enabling clockgating\n");
therm->func->clkgate_enable(therm);
}
void
nvkm_therm_clkgate_fini(struct nvkm_therm *therm, bool suspend)
{
if (!therm->func->clkgate_fini || !therm->clkgating_enabled)
return;
nvkm_debug(&therm->subdev,
"Preparing clockgating for %s\n",
suspend ? "suspend" : "fini");
therm->func->clkgate_fini(therm, suspend);
}
static void
nvkm_therm_clkgate_oneinit(struct nvkm_therm *therm)
{
if (!therm->func->clkgate_enable || !therm->clkgating_enabled)
return;
nvkm_info(&therm->subdev, "Clockgating enabled\n");
}
static void static void
nvkm_therm_intr(struct nvkm_subdev *subdev) nvkm_therm_intr(struct nvkm_subdev *subdev)
{ {
...@@ -333,6 +366,7 @@ nvkm_therm_oneinit(struct nvkm_subdev *subdev) ...@@ -333,6 +366,7 @@ nvkm_therm_oneinit(struct nvkm_subdev *subdev)
nvkm_therm_fan_ctor(therm); nvkm_therm_fan_ctor(therm);
nvkm_therm_fan_mode(therm, NVKM_THERM_CTRL_AUTO); nvkm_therm_fan_mode(therm, NVKM_THERM_CTRL_AUTO);
nvkm_therm_sensor_preinit(therm); nvkm_therm_sensor_preinit(therm);
nvkm_therm_clkgate_oneinit(therm);
return 0; return 0;
} }
...@@ -357,6 +391,16 @@ nvkm_therm_init(struct nvkm_subdev *subdev) ...@@ -357,6 +391,16 @@ nvkm_therm_init(struct nvkm_subdev *subdev)
return 0; return 0;
} }
void
nvkm_therm_clkgate_init(struct nvkm_therm *therm,
const struct nvkm_therm_clkgate_pack *p)
{
if (!therm->func->clkgate_init || !therm->clkgating_enabled)
return;
therm->func->clkgate_init(therm, p);
}
static void * static void *
nvkm_therm_dtor(struct nvkm_subdev *subdev) nvkm_therm_dtor(struct nvkm_subdev *subdev)
{ {
...@@ -374,15 +418,10 @@ nvkm_therm = { ...@@ -374,15 +418,10 @@ nvkm_therm = {
.intr = nvkm_therm_intr, .intr = nvkm_therm_intr,
}; };
int void
nvkm_therm_new_(const struct nvkm_therm_func *func, struct nvkm_device *device, nvkm_therm_ctor(struct nvkm_therm *therm, struct nvkm_device *device,
int index, struct nvkm_therm **ptherm) int index, const struct nvkm_therm_func *func)
{ {
struct nvkm_therm *therm;
if (!(therm = *ptherm = kzalloc(sizeof(*therm), GFP_KERNEL)))
return -ENOMEM;
nvkm_subdev_ctor(&nvkm_therm, device, index, &therm->subdev); nvkm_subdev_ctor(&nvkm_therm, device, index, &therm->subdev);
therm->func = func; therm->func = func;
...@@ -395,5 +434,20 @@ nvkm_therm_new_(const struct nvkm_therm_func *func, struct nvkm_device *device, ...@@ -395,5 +434,20 @@ nvkm_therm_new_(const struct nvkm_therm_func *func, struct nvkm_device *device,
therm->attr_get = nvkm_therm_attr_get; therm->attr_get = nvkm_therm_attr_get;
therm->attr_set = nvkm_therm_attr_set; therm->attr_set = nvkm_therm_attr_set;
therm->mode = therm->suspend = -1; /* undefined */ therm->mode = therm->suspend = -1; /* undefined */
therm->clkgating_enabled = nvkm_boolopt(device->cfgopt,
"NvPmEnableGating", false);
}
int
nvkm_therm_new_(const struct nvkm_therm_func *func, struct nvkm_device *device,
int index, struct nvkm_therm **ptherm)
{
struct nvkm_therm *therm;
if (!(therm = *ptherm = kzalloc(sizeof(*therm), GFP_KERNEL)))
return -ENOMEM;
nvkm_therm_ctor(therm, device, index, func);
return 0; return 0;
} }
/*
* Copyright 2018 Red Hat Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: Lyude Paul
*/
#include <core/device.h>
#include "priv.h"
#define pack_for_each_init(init, pack, head) \
for (pack = head; pack && pack->init; pack++) \
for (init = pack->init; init && init->count; init++)
void
gf100_clkgate_init(struct nvkm_therm *therm,
const struct nvkm_therm_clkgate_pack *p)
{
struct nvkm_device *device = therm->subdev.device;
const struct nvkm_therm_clkgate_pack *pack;
const struct nvkm_therm_clkgate_init *init;
u32 next, addr;
pack_for_each_init(init, pack, p) {
next = init->addr + init->count * 8;
addr = init->addr;
nvkm_trace(&therm->subdev, "{ 0x%06x, %d, 0x%08x }\n",
init->addr, init->count, init->data);
while (addr < next) {
nvkm_trace(&therm->subdev, "\t0x%06x = 0x%08x\n",
addr, init->data);
nvkm_wr32(device, addr, init->data);
addr += 8;
}
}
}
/*
* TODO: Fermi clockgating isn't understood fully yet, so we don't specify any
* clockgate functions to use
*/
/*
* Copyright 2018 Red Hat Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: Lyude Paul
*/
#ifndef __GF100_THERM_H__
#define __GF100_THERM_H__
#include <core/device.h>
struct gf100_idle_filter {
u32 fecs;
u32 hubmmu;
};
#endif
...@@ -49,7 +49,7 @@ pwm_info(struct nvkm_therm *therm, int line) ...@@ -49,7 +49,7 @@ pwm_info(struct nvkm_therm *therm, int line)
return -ENODEV; return -ENODEV;
} }
static int int
gf119_fan_pwm_ctrl(struct nvkm_therm *therm, int line, bool enable) gf119_fan_pwm_ctrl(struct nvkm_therm *therm, int line, bool enable)
{ {
struct nvkm_device *device = therm->subdev.device; struct nvkm_device *device = therm->subdev.device;
...@@ -63,7 +63,7 @@ gf119_fan_pwm_ctrl(struct nvkm_therm *therm, int line, bool enable) ...@@ -63,7 +63,7 @@ gf119_fan_pwm_ctrl(struct nvkm_therm *therm, int line, bool enable)
return 0; return 0;
} }
static int int
gf119_fan_pwm_get(struct nvkm_therm *therm, int line, u32 *divs, u32 *duty) gf119_fan_pwm_get(struct nvkm_therm *therm, int line, u32 *divs, u32 *duty)
{ {
struct nvkm_device *device = therm->subdev.device; struct nvkm_device *device = therm->subdev.device;
...@@ -85,7 +85,7 @@ gf119_fan_pwm_get(struct nvkm_therm *therm, int line, u32 *divs, u32 *duty) ...@@ -85,7 +85,7 @@ gf119_fan_pwm_get(struct nvkm_therm *therm, int line, u32 *divs, u32 *duty)
return -EINVAL; return -EINVAL;
} }
static int int
gf119_fan_pwm_set(struct nvkm_therm *therm, int line, u32 divs, u32 duty) gf119_fan_pwm_set(struct nvkm_therm *therm, int line, u32 divs, u32 duty)
{ {
struct nvkm_device *device = therm->subdev.device; struct nvkm_device *device = therm->subdev.device;
...@@ -102,7 +102,7 @@ gf119_fan_pwm_set(struct nvkm_therm *therm, int line, u32 divs, u32 duty) ...@@ -102,7 +102,7 @@ gf119_fan_pwm_set(struct nvkm_therm *therm, int line, u32 divs, u32 duty)
return 0; return 0;
} }
static int int
gf119_fan_pwm_clock(struct nvkm_therm *therm, int line) gf119_fan_pwm_clock(struct nvkm_therm *therm, int line)
{ {
struct nvkm_device *device = therm->subdev.device; struct nvkm_device *device = therm->subdev.device;
......
/*
* Copyright 2018 Red Hat Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: Lyude Paul
*/
#include <core/device.h>
#include "priv.h"
#include "gk104.h"
void
gk104_clkgate_enable(struct nvkm_therm *base)
{
struct gk104_therm *therm = gk104_therm(base);
struct nvkm_device *dev = therm->base.subdev.device;
const struct gk104_clkgate_engine_info *order = therm->clkgate_order;
int i;
/* Program ENG_MANT, ENG_FILTER */
for (i = 0; order[i].engine != NVKM_SUBDEV_NR; i++) {
if (!nvkm_device_subdev(dev, order[i].engine))
continue;
nvkm_mask(dev, 0x20200 + order[i].offset, 0xff00, 0x4500);
}
/* magic */
nvkm_wr32(dev, 0x020288, therm->idle_filter->fecs);
nvkm_wr32(dev, 0x02028c, therm->idle_filter->hubmmu);
/* Enable clockgating (ENG_CLK = RUN->AUTO) */
for (i = 0; order[i].engine != NVKM_SUBDEV_NR; i++) {
if (!nvkm_device_subdev(dev, order[i].engine))
continue;
nvkm_mask(dev, 0x20200 + order[i].offset, 0x00ff, 0x0045);
}
}
void
gk104_clkgate_fini(struct nvkm_therm *base, bool suspend)
{
struct gk104_therm *therm = gk104_therm(base);
struct nvkm_device *dev = therm->base.subdev.device;
const struct gk104_clkgate_engine_info *order = therm->clkgate_order;
int i;
/* ENG_CLK = AUTO->RUN, ENG_PWR = RUN->AUTO */
for (i = 0; order[i].engine != NVKM_SUBDEV_NR; i++) {
if (!nvkm_device_subdev(dev, order[i].engine))
continue;
nvkm_mask(dev, 0x20200 + order[i].offset, 0xff, 0x54);
}
}
const struct gk104_clkgate_engine_info gk104_clkgate_engine_info[] = {
{ NVKM_ENGINE_GR, 0x00 },
{ NVKM_ENGINE_MSPDEC, 0x04 },
{ NVKM_ENGINE_MSPPP, 0x08 },
{ NVKM_ENGINE_MSVLD, 0x0c },
{ NVKM_ENGINE_CE0, 0x10 },
{ NVKM_ENGINE_CE1, 0x14 },
{ NVKM_ENGINE_MSENC, 0x18 },
{ NVKM_ENGINE_CE2, 0x1c },
{ NVKM_SUBDEV_NR, 0 },
};
const struct gf100_idle_filter gk104_idle_filter = {
.fecs = 0x00001000,
.hubmmu = 0x00001000,
};
static const struct nvkm_therm_func
gk104_therm_func = {
.init = gf119_therm_init,
.fini = g84_therm_fini,
.pwm_ctrl = gf119_fan_pwm_ctrl,
.pwm_get = gf119_fan_pwm_get,
.pwm_set = gf119_fan_pwm_set,
.pwm_clock = gf119_fan_pwm_clock,
.temp_get = g84_temp_get,
.fan_sense = gt215_therm_fan_sense,
.program_alarms = nvkm_therm_program_alarms_polling,
.clkgate_init = gf100_clkgate_init,
.clkgate_enable = gk104_clkgate_enable,
.clkgate_fini = gk104_clkgate_fini,
};
static int
gk104_therm_new_(const struct nvkm_therm_func *func,
struct nvkm_device *device,
int index,
const struct gk104_clkgate_engine_info *clkgate_order,
const struct gf100_idle_filter *idle_filter,
struct nvkm_therm **ptherm)
{
struct gk104_therm *therm = kzalloc(sizeof(*therm), GFP_KERNEL);
if (!therm)
return -ENOMEM;
nvkm_therm_ctor(&therm->base, device, index, func);
*ptherm = &therm->base;
therm->clkgate_order = clkgate_order;
therm->idle_filter = idle_filter;
return 0;
}
int
gk104_therm_new(struct nvkm_device *device,
int index, struct nvkm_therm **ptherm)
{
return gk104_therm_new_(&gk104_therm_func, device, index,
gk104_clkgate_engine_info, &gk104_idle_filter,
ptherm);
}
/*
* Copyright 2018 Red Hat Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: Lyude Paul
*/
#ifndef __GK104_THERM_H__
#define __GK104_THERM_H__
#define gk104_therm(p) (container_of((p), struct gk104_therm, base))
#include <subdev/therm.h>
#include "priv.h"
#include "gf100.h"
struct gk104_clkgate_engine_info {
enum nvkm_devidx engine;
u8 offset;
};
struct gk104_therm {
struct nvkm_therm base;
const struct gk104_clkgate_engine_info *clkgate_order;
const struct gf100_idle_filter *idle_filter;
};
extern const struct gk104_clkgate_engine_info gk104_clkgate_engine_info[];
extern const struct gf100_idle_filter gk104_idle_filter;
#endif
...@@ -36,7 +36,7 @@ gt215_therm_fan_sense(struct nvkm_therm *therm) ...@@ -36,7 +36,7 @@ gt215_therm_fan_sense(struct nvkm_therm *therm)
return -ENODEV; return -ENODEV;
} }
static void void
gt215_therm_init(struct nvkm_therm *therm) gt215_therm_init(struct nvkm_therm *therm)
{ {
struct nvkm_device *device = therm->subdev.device; struct nvkm_device *device = therm->subdev.device;
......
...@@ -32,6 +32,8 @@ ...@@ -32,6 +32,8 @@
int nvkm_therm_new_(const struct nvkm_therm_func *, struct nvkm_device *, int nvkm_therm_new_(const struct nvkm_therm_func *, struct nvkm_device *,
int index, struct nvkm_therm **); int index, struct nvkm_therm **);
void nvkm_therm_ctor(struct nvkm_therm *therm, struct nvkm_device *device,
int index, const struct nvkm_therm_func *func);
struct nvkm_fan { struct nvkm_fan {
struct nvkm_therm *parent; struct nvkm_therm *parent;
...@@ -66,8 +68,6 @@ int nvkm_therm_fan_set(struct nvkm_therm *, bool now, int percent); ...@@ -66,8 +68,6 @@ int nvkm_therm_fan_set(struct nvkm_therm *, bool now, int percent);
int nvkm_therm_fan_user_get(struct nvkm_therm *); int nvkm_therm_fan_user_get(struct nvkm_therm *);
int nvkm_therm_fan_user_set(struct nvkm_therm *, int percent); int nvkm_therm_fan_user_set(struct nvkm_therm *, int percent);
int nvkm_therm_preinit(struct nvkm_therm *);
int nvkm_therm_sensor_init(struct nvkm_therm *); int nvkm_therm_sensor_init(struct nvkm_therm *);
int nvkm_therm_sensor_fini(struct nvkm_therm *, bool suspend); int nvkm_therm_sensor_fini(struct nvkm_therm *, bool suspend);
void nvkm_therm_sensor_preinit(struct nvkm_therm *); void nvkm_therm_sensor_preinit(struct nvkm_therm *);
...@@ -96,6 +96,11 @@ struct nvkm_therm_func { ...@@ -96,6 +96,11 @@ struct nvkm_therm_func {
int (*fan_sense)(struct nvkm_therm *); int (*fan_sense)(struct nvkm_therm *);
void (*program_alarms)(struct nvkm_therm *); void (*program_alarms)(struct nvkm_therm *);
void (*clkgate_init)(struct nvkm_therm *,
const struct nvkm_therm_clkgate_pack *);
void (*clkgate_enable)(struct nvkm_therm *);
void (*clkgate_fini)(struct nvkm_therm *, bool);
}; };
void nv40_therm_intr(struct nvkm_therm *); void nv40_therm_intr(struct nvkm_therm *);
...@@ -111,9 +116,21 @@ void g84_therm_fini(struct nvkm_therm *); ...@@ -111,9 +116,21 @@ void g84_therm_fini(struct nvkm_therm *);
int gt215_therm_fan_sense(struct nvkm_therm *); int gt215_therm_fan_sense(struct nvkm_therm *);
void gf100_clkgate_init(struct nvkm_therm *,
const struct nvkm_therm_clkgate_pack *);
void g84_therm_init(struct nvkm_therm *); void g84_therm_init(struct nvkm_therm *);
int gf119_fan_pwm_ctrl(struct nvkm_therm *, int, bool);
int gf119_fan_pwm_get(struct nvkm_therm *, int, u32 *, u32 *);
int gf119_fan_pwm_set(struct nvkm_therm *, int, u32, u32);
int gf119_fan_pwm_clock(struct nvkm_therm *, int);
void gf119_therm_init(struct nvkm_therm *); void gf119_therm_init(struct nvkm_therm *);
void gk104_therm_init(struct nvkm_therm *);
void gk104_clkgate_enable(struct nvkm_therm *);
void gk104_clkgate_fini(struct nvkm_therm *, bool);
int nvkm_fanpwm_create(struct nvkm_therm *, struct dcb_gpio_func *); int nvkm_fanpwm_create(struct nvkm_therm *, struct dcb_gpio_func *);
int nvkm_fantog_create(struct nvkm_therm *, struct dcb_gpio_func *); int nvkm_fantog_create(struct nvkm_therm *, struct dcb_gpio_func *);
int nvkm_fannil_create(struct nvkm_therm *); int nvkm_fannil_create(struct nvkm_therm *);
......
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