Commit 3fed3ea9 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/gr/gm204: initial init+ctx code

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 990b4547
...@@ -92,6 +92,7 @@ ...@@ -92,6 +92,7 @@
#define KEPLER_C 0x0000a297 #define KEPLER_C 0x0000a297
#define MAXWELL_A 0x0000b097 #define MAXWELL_A 0x0000b097
#define MAXWELL_B 0x0000b197
#define FERMI_COMPUTE_A 0x000090c0 #define FERMI_COMPUTE_A 0x000090c0
#define FERMI_COMPUTE_B 0x000091c0 #define FERMI_COMPUTE_B 0x000091c0
...@@ -100,6 +101,7 @@ ...@@ -100,6 +101,7 @@
#define KEPLER_COMPUTE_B 0x0000a1c0 #define KEPLER_COMPUTE_B 0x0000a1c0
#define MAXWELL_COMPUTE_A 0x0000b0c0 #define MAXWELL_COMPUTE_A 0x0000b0c0
#define MAXWELL_COMPUTE_B 0x0000b1c0
/******************************************************************************* /*******************************************************************************
......
...@@ -72,6 +72,7 @@ extern struct nvkm_oclass *gk110_gr_oclass; ...@@ -72,6 +72,7 @@ extern struct nvkm_oclass *gk110_gr_oclass;
extern struct nvkm_oclass *gk110b_gr_oclass; extern struct nvkm_oclass *gk110b_gr_oclass;
extern struct nvkm_oclass *gk208_gr_oclass; extern struct nvkm_oclass *gk208_gr_oclass;
extern struct nvkm_oclass *gm107_gr_oclass; extern struct nvkm_oclass *gm107_gr_oclass;
extern struct nvkm_oclass *gm204_gr_oclass;
#include <core/enum.h> #include <core/enum.h>
......
...@@ -129,9 +129,7 @@ gm100_identify(struct nvkm_device *device) ...@@ -129,9 +129,7 @@ gm100_identify(struct nvkm_device *device)
device->oclass[NVDEV_ENGINE_DMAOBJ ] = gf110_dmaeng_oclass; device->oclass[NVDEV_ENGINE_DMAOBJ ] = gf110_dmaeng_oclass;
device->oclass[NVDEV_ENGINE_FIFO ] = gm204_fifo_oclass; device->oclass[NVDEV_ENGINE_FIFO ] = gm204_fifo_oclass;
device->oclass[NVDEV_ENGINE_SW ] = gf100_sw_oclass; device->oclass[NVDEV_ENGINE_SW ] = gf100_sw_oclass;
#if 0 device->oclass[NVDEV_ENGINE_GR ] = gm204_gr_oclass;
device->oclass[NVDEV_ENGINE_GR ] = gm107_gr_oclass;
#endif
device->oclass[NVDEV_ENGINE_DISP ] = gm204_disp_oclass; device->oclass[NVDEV_ENGINE_DISP ] = gm204_disp_oclass;
device->oclass[NVDEV_ENGINE_CE0 ] = &gm204_ce0_oclass; device->oclass[NVDEV_ENGINE_CE0 ] = &gm204_ce0_oclass;
device->oclass[NVDEV_ENGINE_CE1 ] = &gm204_ce1_oclass; device->oclass[NVDEV_ENGINE_CE1 ] = &gm204_ce1_oclass;
......
...@@ -12,6 +12,7 @@ nvkm-y += nvkm/engine/gr/ctxgk110.o ...@@ -12,6 +12,7 @@ nvkm-y += nvkm/engine/gr/ctxgk110.o
nvkm-y += nvkm/engine/gr/ctxgk110b.o nvkm-y += nvkm/engine/gr/ctxgk110b.o
nvkm-y += nvkm/engine/gr/ctxgk208.o nvkm-y += nvkm/engine/gr/ctxgk208.o
nvkm-y += nvkm/engine/gr/ctxgm107.o nvkm-y += nvkm/engine/gr/ctxgm107.o
nvkm-y += nvkm/engine/gr/ctxgm204.o
nvkm-y += nvkm/engine/gr/nv04.o nvkm-y += nvkm/engine/gr/nv04.o
nvkm-y += nvkm/engine/gr/nv10.o nvkm-y += nvkm/engine/gr/nv10.o
nvkm-y += nvkm/engine/gr/nv20.o nvkm-y += nvkm/engine/gr/nv20.o
...@@ -34,3 +35,4 @@ nvkm-y += nvkm/engine/gr/gk110.o ...@@ -34,3 +35,4 @@ nvkm-y += nvkm/engine/gr/gk110.o
nvkm-y += nvkm/engine/gr/gk110b.o nvkm-y += nvkm/engine/gr/gk110b.o
nvkm-y += nvkm/engine/gr/gk208.o nvkm-y += nvkm/engine/gr/gk208.o
nvkm-y += nvkm/engine/gr/gm107.o nvkm-y += nvkm/engine/gr/gm107.o
nvkm-y += nvkm/engine/gr/gm204.o
...@@ -90,10 +90,17 @@ void gk104_grctx_generate_unkn(struct gf100_gr_priv *); ...@@ -90,10 +90,17 @@ void gk104_grctx_generate_unkn(struct gf100_gr_priv *);
void gk104_grctx_generate_r418bb8(struct gf100_gr_priv *); void gk104_grctx_generate_r418bb8(struct gf100_gr_priv *);
void gk104_grctx_generate_rop_active_fbps(struct gf100_gr_priv *); void gk104_grctx_generate_rop_active_fbps(struct gf100_gr_priv *);
extern struct nvkm_oclass *gk110_grctx_oclass; extern struct nvkm_oclass *gk110_grctx_oclass;
extern struct nvkm_oclass *gk110b_grctx_oclass; extern struct nvkm_oclass *gk110b_grctx_oclass;
extern struct nvkm_oclass *gk208_grctx_oclass; extern struct nvkm_oclass *gk208_grctx_oclass;
extern struct nvkm_oclass *gm107_grctx_oclass; extern struct nvkm_oclass *gm107_grctx_oclass;
void gm107_grctx_generate_bundle(struct gf100_grctx *);
void gm107_grctx_generate_pagepool(struct gf100_grctx *);
void gm107_grctx_generate_attrib(struct gf100_grctx *);
extern struct nvkm_oclass *gm204_grctx_oclass;
/* context init value lists */ /* context init value lists */
...@@ -197,4 +204,7 @@ extern const struct gf100_gr_init gk208_grctx_init_rstr2d_0[]; ...@@ -197,4 +204,7 @@ extern const struct gf100_gr_init gk208_grctx_init_rstr2d_0[];
extern const struct gf100_gr_init gk208_grctx_init_prop_0[]; extern const struct gf100_gr_init gk208_grctx_init_prop_0[];
extern const struct gf100_gr_init gk208_grctx_init_crstr_0[]; extern const struct gf100_gr_init gk208_grctx_init_crstr_0[];
extern const struct gf100_gr_init gm107_grctx_init_gpc_unk_0[];
extern const struct gf100_gr_init gm107_grctx_init_wwdx_0[];
#endif #endif
...@@ -699,7 +699,7 @@ gm107_grctx_pack_hub[] = { ...@@ -699,7 +699,7 @@ gm107_grctx_pack_hub[] = {
{} {}
}; };
static const struct gf100_gr_init const struct gf100_gr_init
gm107_grctx_init_gpc_unk_0[] = { gm107_grctx_init_gpc_unk_0[] = {
{ 0x418380, 1, 0x04, 0x00000056 }, { 0x418380, 1, 0x04, 0x00000056 },
{} {}
...@@ -834,7 +834,7 @@ gm107_grctx_init_cbm_0[] = { ...@@ -834,7 +834,7 @@ gm107_grctx_init_cbm_0[] = {
{} {}
}; };
static const struct gf100_gr_init const struct gf100_gr_init
gm107_grctx_init_wwdx_0[] = { gm107_grctx_init_wwdx_0[] = {
{ 0x41bf00, 1, 0x04, 0x0a418820 }, { 0x41bf00, 1, 0x04, 0x0a418820 },
{ 0x41bf04, 1, 0x04, 0x062080e6 }, { 0x41bf04, 1, 0x04, 0x062080e6 },
...@@ -860,7 +860,7 @@ gm107_grctx_pack_ppc[] = { ...@@ -860,7 +860,7 @@ gm107_grctx_pack_ppc[] = {
* PGRAPH context implementation * PGRAPH context implementation
******************************************************************************/ ******************************************************************************/
static void void
gm107_grctx_generate_bundle(struct gf100_grctx *info) gm107_grctx_generate_bundle(struct gf100_grctx *info)
{ {
const struct gf100_grctx_oclass *impl = gf100_grctx_impl(info->priv); const struct gf100_grctx_oclass *impl = gf100_grctx_impl(info->priv);
...@@ -877,7 +877,7 @@ gm107_grctx_generate_bundle(struct gf100_grctx *info) ...@@ -877,7 +877,7 @@ gm107_grctx_generate_bundle(struct gf100_grctx *info)
mmio_wr32(info, 0x4064c8, (state_limit << 16) | token_limit); mmio_wr32(info, 0x4064c8, (state_limit << 16) | token_limit);
} }
static void void
gm107_grctx_generate_pagepool(struct gf100_grctx *info) gm107_grctx_generate_pagepool(struct gf100_grctx *info)
{ {
const struct gf100_grctx_oclass *impl = gf100_grctx_impl(info->priv); const struct gf100_grctx_oclass *impl = gf100_grctx_impl(info->priv);
...@@ -892,7 +892,7 @@ gm107_grctx_generate_pagepool(struct gf100_grctx *info) ...@@ -892,7 +892,7 @@ gm107_grctx_generate_pagepool(struct gf100_grctx *info)
mmio_wr32(info, 0x418e30, 0x80000000); /* guess at it being related */ mmio_wr32(info, 0x418e30, 0x80000000); /* guess at it being related */
} }
static void void
gm107_grctx_generate_attrib(struct gf100_grctx *info) gm107_grctx_generate_attrib(struct gf100_grctx *info)
{ {
struct gf100_gr_priv *priv = info->priv; struct gf100_gr_priv *priv = info->priv;
......
This diff is collapsed.
...@@ -247,4 +247,16 @@ extern const struct gf100_gr_init gk110_gr_init_tex_0[]; ...@@ -247,4 +247,16 @@ extern const struct gf100_gr_init gk110_gr_init_tex_0[];
extern const struct gf100_gr_init gk110_gr_init_sm_0[]; extern const struct gf100_gr_init gk110_gr_init_sm_0[];
extern const struct gf100_gr_init gk208_gr_init_gpc_unk_0[]; extern const struct gf100_gr_init gk208_gr_init_gpc_unk_0[];
extern const struct gf100_gr_init gm107_gr_init_scc_0[];
extern const struct gf100_gr_init gm107_gr_init_prop_0[];
extern const struct gf100_gr_init gm107_gr_init_setup_1[];
extern const struct gf100_gr_init gm107_gr_init_zcull_0[];
extern const struct gf100_gr_init gm107_gr_init_gpc_unk_1[];
extern const struct gf100_gr_init gm107_gr_init_tex_0[];
extern const struct gf100_gr_init gm107_gr_init_l1c_0[];
extern const struct gf100_gr_init gm107_gr_init_wwdx_0[];
extern const struct gf100_gr_init gm107_gr_init_cbm_0[];
void gm107_gr_init_bios(struct gf100_gr_priv *);
#endif #endif
...@@ -71,7 +71,7 @@ gm107_gr_init_ds_0[] = { ...@@ -71,7 +71,7 @@ gm107_gr_init_ds_0[] = {
{} {}
}; };
static const struct gf100_gr_init const struct gf100_gr_init
gm107_gr_init_scc_0[] = { gm107_gr_init_scc_0[] = {
{ 0x40803c, 1, 0x04, 0x00000010 }, { 0x40803c, 1, 0x04, 0x00000010 },
{} {}
...@@ -85,14 +85,14 @@ gm107_gr_init_sked_0[] = { ...@@ -85,14 +85,14 @@ gm107_gr_init_sked_0[] = {
{} {}
}; };
static const struct gf100_gr_init const struct gf100_gr_init
gm107_gr_init_prop_0[] = { gm107_gr_init_prop_0[] = {
{ 0x418408, 1, 0x04, 0x00000000 }, { 0x418408, 1, 0x04, 0x00000000 },
{ 0x4184a0, 1, 0x04, 0x00000000 }, { 0x4184a0, 1, 0x04, 0x00000000 },
{} {}
}; };
static const struct gf100_gr_init const struct gf100_gr_init
gm107_gr_init_setup_1[] = { gm107_gr_init_setup_1[] = {
{ 0x4188c8, 2, 0x04, 0x00000000 }, { 0x4188c8, 2, 0x04, 0x00000000 },
{ 0x4188d0, 1, 0x04, 0x00010000 }, { 0x4188d0, 1, 0x04, 0x00010000 },
...@@ -100,7 +100,7 @@ gm107_gr_init_setup_1[] = { ...@@ -100,7 +100,7 @@ gm107_gr_init_setup_1[] = {
{} {}
}; };
static const struct gf100_gr_init const struct gf100_gr_init
gm107_gr_init_zcull_0[] = { gm107_gr_init_zcull_0[] = {
{ 0x418910, 1, 0x04, 0x00010001 }, { 0x418910, 1, 0x04, 0x00010001 },
{ 0x418914, 1, 0x04, 0x00000301 }, { 0x418914, 1, 0x04, 0x00000301 },
...@@ -111,7 +111,7 @@ gm107_gr_init_zcull_0[] = { ...@@ -111,7 +111,7 @@ gm107_gr_init_zcull_0[] = {
{} {}
}; };
static const struct gf100_gr_init const struct gf100_gr_init
gm107_gr_init_gpc_unk_1[] = { gm107_gr_init_gpc_unk_1[] = {
{ 0x418d00, 1, 0x04, 0x00000000 }, { 0x418d00, 1, 0x04, 0x00000000 },
{ 0x418f00, 1, 0x04, 0x00000400 }, { 0x418f00, 1, 0x04, 0x00000400 },
...@@ -134,7 +134,7 @@ gm107_gr_init_tpccs_0[] = { ...@@ -134,7 +134,7 @@ gm107_gr_init_tpccs_0[] = {
{} {}
}; };
static const struct gf100_gr_init const struct gf100_gr_init
gm107_gr_init_tex_0[] = { gm107_gr_init_tex_0[] = {
{ 0x419ab0, 1, 0x04, 0x00000000 }, { 0x419ab0, 1, 0x04, 0x00000000 },
{ 0x419ab8, 1, 0x04, 0x000000e7 }, { 0x419ab8, 1, 0x04, 0x000000e7 },
...@@ -160,7 +160,7 @@ gm107_gr_init_pe_0[] = { ...@@ -160,7 +160,7 @@ gm107_gr_init_pe_0[] = {
{} {}
}; };
static const struct gf100_gr_init const struct gf100_gr_init
gm107_gr_init_l1c_0[] = { gm107_gr_init_l1c_0[] = {
{ 0x419c98, 1, 0x04, 0x00000000 }, { 0x419c98, 1, 0x04, 0x00000000 },
{ 0x419cc0, 2, 0x04, 0x00000000 }, { 0x419cc0, 2, 0x04, 0x00000000 },
...@@ -206,14 +206,14 @@ gm107_gr_init_pes_0[] = { ...@@ -206,14 +206,14 @@ gm107_gr_init_pes_0[] = {
{} {}
}; };
static const struct gf100_gr_init const struct gf100_gr_init
gm107_gr_init_wwdx_0[] = { gm107_gr_init_wwdx_0[] = {
{ 0x41bfd4, 1, 0x04, 0x00800000 }, { 0x41bfd4, 1, 0x04, 0x00800000 },
{ 0x41bfdc, 1, 0x04, 0x00000000 }, { 0x41bfdc, 1, 0x04, 0x00000000 },
{} {}
}; };
static const struct gf100_gr_init const struct gf100_gr_init
gm107_gr_init_cbm_0[] = { gm107_gr_init_cbm_0[] = {
{ 0x41becc, 1, 0x04, 0x00000000 }, { 0x41becc, 1, 0x04, 0x00000000 },
{} {}
...@@ -291,7 +291,7 @@ gm107_gr_pack_mmio[] = { ...@@ -291,7 +291,7 @@ gm107_gr_pack_mmio[] = {
* PGRAPH engine/subdev functions * PGRAPH engine/subdev functions
******************************************************************************/ ******************************************************************************/
static void void
gm107_gr_init_bios(struct gf100_gr_priv *priv) gm107_gr_init_bios(struct gf100_gr_priv *priv)
{ {
static const struct { static const struct {
......
This diff is collapsed.
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