1d7e5fcd2SBen Skeggs /*
2d7e5fcd2SBen Skeggs * Copyright 2012 Red Hat Inc.
3d7e5fcd2SBen Skeggs *
4d7e5fcd2SBen Skeggs * Permission is hereby granted, free of charge, to any person obtaining a
5d7e5fcd2SBen Skeggs * copy of this software and associated documentation files (the "Software"),
6d7e5fcd2SBen Skeggs * to deal in the Software without restriction, including without limitation
7d7e5fcd2SBen Skeggs * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8d7e5fcd2SBen Skeggs * and/or sell copies of the Software, and to permit persons to whom the
9d7e5fcd2SBen Skeggs * Software is furnished to do so, subject to the following conditions:
10d7e5fcd2SBen Skeggs *
11d7e5fcd2SBen Skeggs * The above copyright notice and this permission notice shall be included in
12d7e5fcd2SBen Skeggs * all copies or substantial portions of the Software.
13d7e5fcd2SBen Skeggs *
14d7e5fcd2SBen Skeggs * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15d7e5fcd2SBen Skeggs * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16d7e5fcd2SBen Skeggs * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17d7e5fcd2SBen Skeggs * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18d7e5fcd2SBen Skeggs * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19d7e5fcd2SBen Skeggs * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20d7e5fcd2SBen Skeggs * OTHER DEALINGS IN THE SOFTWARE.
21d7e5fcd2SBen Skeggs *
22d7e5fcd2SBen Skeggs * Authors: Ben Skeggs
23d7e5fcd2SBen Skeggs */
2454dcadd5SBen Skeggs #include "priv.h"
25d7e5fcd2SBen Skeggs
26a6bb38e9SBen Skeggs static const struct nvkm_mc_map
27a6bb38e9SBen Skeggs gf100_mc_reset[] = {
2868f3f702SBen Skeggs { 0x00020000, NVKM_ENGINE_MSPDEC },
29a6bb38e9SBen Skeggs { 0x00008000, NVKM_ENGINE_MSVLD },
30c653ab83SBen Skeggs { 0x00002000, NVKM_SUBDEV_PMU, 0, true },
31a6bb38e9SBen Skeggs { 0x00001000, NVKM_ENGINE_GR },
32a6bb38e9SBen Skeggs { 0x00000100, NVKM_ENGINE_FIFO },
33c653ab83SBen Skeggs { 0x00000080, NVKM_ENGINE_CE, 1 },
34c653ab83SBen Skeggs { 0x00000040, NVKM_ENGINE_CE, 0 },
35a6bb38e9SBen Skeggs { 0x00000002, NVKM_ENGINE_MSPPP },
36a6bb38e9SBen Skeggs {}
37a6bb38e9SBen Skeggs };
38a6bb38e9SBen Skeggs
39fe76fe49SBen Skeggs static const struct nvkm_intr_data
40fe76fe49SBen Skeggs gf100_mc_intrs[] = {
41fe76fe49SBen Skeggs { NVKM_ENGINE_DISP , 0, 0, 0x04000000, true },
42fe76fe49SBen Skeggs { NVKM_ENGINE_MSPDEC , 0, 0, 0x00020000, true },
43fe76fe49SBen Skeggs { NVKM_ENGINE_MSVLD , 0, 0, 0x00008000, true },
44*9aa3faceSBen Skeggs { NVKM_ENGINE_GR , 0, 0, 0x00001000 },
452fc71a05SBen Skeggs { NVKM_ENGINE_FIFO , 0, 0, 0x00000100 },
46fe76fe49SBen Skeggs { NVKM_ENGINE_CE , 1, 0, 0x00000040, true },
47fe76fe49SBen Skeggs { NVKM_ENGINE_CE , 0, 0, 0x00000020, true },
48fe76fe49SBen Skeggs { NVKM_ENGINE_MSPPP , 0, 0, 0x00000001, true },
49fe76fe49SBen Skeggs { NVKM_SUBDEV_PRIVRING, 0, 0, 0x40000000, true },
50fe76fe49SBen Skeggs { NVKM_SUBDEV_BUS , 0, 0, 0x10000000, true },
51fe76fe49SBen Skeggs { NVKM_SUBDEV_FB , 0, 0, 0x08002000, true },
52fe76fe49SBen Skeggs { NVKM_SUBDEV_LTC , 0, 0, 0x02000000, true },
53fe76fe49SBen Skeggs { NVKM_SUBDEV_PMU , 0, 0, 0x01000000, true },
54fe76fe49SBen Skeggs { NVKM_SUBDEV_GPIO , 0, 0, 0x00200000, true },
55fe76fe49SBen Skeggs { NVKM_SUBDEV_I2C , 0, 0, 0x00200000, true },
56fe76fe49SBen Skeggs { NVKM_SUBDEV_TIMER , 0, 0, 0x00100000, true },
57fe76fe49SBen Skeggs { NVKM_SUBDEV_THERM , 0, 0, 0x00040000, true },
58d7e5fcd2SBen Skeggs {},
59d7e5fcd2SBen Skeggs };
60d7e5fcd2SBen Skeggs
61ae0a5b2dSBen Skeggs void
gf100_mc_unk260(struct nvkm_mc * mc,u32 data)622ca0ddbcSBen Skeggs gf100_mc_unk260(struct nvkm_mc *mc, u32 data)
63d7e5fcd2SBen Skeggs {
6425e3a463SBen Skeggs nvkm_wr32(mc->subdev.device, 0x000260, data);
65d7e5fcd2SBen Skeggs }
66d7e5fcd2SBen Skeggs
6754dcadd5SBen Skeggs static const struct nvkm_mc_func
6854dcadd5SBen Skeggs gf100_mc = {
69d7e5fcd2SBen Skeggs .init = nv50_mc_init,
70fe76fe49SBen Skeggs .intr = >215_mc_intr,
71fe76fe49SBen Skeggs .intrs = gf100_mc_intrs,
72fe76fe49SBen Skeggs .intr_nonstall = true,
73a6bb38e9SBen Skeggs .reset = gf100_mc_reset,
74ebb195dbSBen Skeggs .device = &nv04_mc_device,
75d7e5fcd2SBen Skeggs .unk260 = gf100_mc_unk260,
7654dcadd5SBen Skeggs };
7754dcadd5SBen Skeggs
7854dcadd5SBen Skeggs int
gf100_mc_new(struct nvkm_device * device,enum nvkm_subdev_type type,int inst,struct nvkm_mc ** pmc)791fc2fddfSBen Skeggs gf100_mc_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_mc **pmc)
8054dcadd5SBen Skeggs {
811fc2fddfSBen Skeggs return nvkm_mc_new_(&gf100_mc, device, type, inst, pmc);
8254dcadd5SBen Skeggs }
83