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
2687f313e6SBen Skeggs static const struct nvkm_mc_map
27e56f90feSBen Skeggs g98_mc_reset[] = {
28e56f90feSBen Skeggs { 0x04008000, NVKM_ENGINE_MSVLD },
29e56f90feSBen Skeggs { 0x02004000, NVKM_ENGINE_SEC },
30e56f90feSBen Skeggs { 0x01020000, NVKM_ENGINE_MSPDEC },
31e56f90feSBen Skeggs { 0x00400002, NVKM_ENGINE_MSPPP },
32e56f90feSBen Skeggs { 0x00201000, NVKM_ENGINE_GR },
3368f3f702SBen Skeggs { 0x00000100, NVKM_ENGINE_FIFO },
34e56f90feSBen Skeggs {}
35e56f90feSBen Skeggs };
36e56f90feSBen Skeggs
37fe76fe49SBen Skeggs static const struct nvkm_intr_data
38fe76fe49SBen Skeggs g98_mc_intrs[] = {
39fe76fe49SBen Skeggs { NVKM_ENGINE_DISP , 0, 0, 0x04000000, true },
40fe76fe49SBen Skeggs { NVKM_ENGINE_MSPDEC, 0, 0, 0x00020000, true },
41fe76fe49SBen Skeggs { NVKM_ENGINE_MSVLD , 0, 0, 0x00008000, true },
42fe76fe49SBen Skeggs { NVKM_ENGINE_SEC , 0, 0, 0x00004000, true },
43fe76fe49SBen Skeggs { NVKM_ENGINE_GR , 0, 0, 0x00001000, true },
44*2fc71a05SBen Skeggs { NVKM_ENGINE_FIFO , 0, 0, 0x00000100 },
45fe76fe49SBen Skeggs { NVKM_ENGINE_MSPPP , 0, 0, 0x00000001, true },
46fe76fe49SBen Skeggs { NVKM_SUBDEV_FB , 0, 0, 0x0002d101, true },
47fe76fe49SBen Skeggs { NVKM_SUBDEV_BUS , 0, 0, 0x10000000, true },
48fe76fe49SBen Skeggs { NVKM_SUBDEV_GPIO , 0, 0, 0x00200000, true },
49fe76fe49SBen Skeggs { NVKM_SUBDEV_I2C , 0, 0, 0x00200000, true },
50fe76fe49SBen Skeggs { NVKM_SUBDEV_TIMER , 0, 0, 0x00100000, true },
51d7e5fcd2SBen Skeggs {},
52d7e5fcd2SBen Skeggs };
53d7e5fcd2SBen Skeggs
5454dcadd5SBen Skeggs static const struct nvkm_mc_func
5554dcadd5SBen Skeggs g98_mc = {
56d7e5fcd2SBen Skeggs .init = nv50_mc_init,
57fe76fe49SBen Skeggs .intr = &nv04_mc_intr,
58fe76fe49SBen Skeggs .intrs = g98_mc_intrs,
59ebb195dbSBen Skeggs .device = &nv04_mc_device,
60e56f90feSBen Skeggs .reset = g98_mc_reset,
6154dcadd5SBen Skeggs };
6254dcadd5SBen Skeggs
6354dcadd5SBen Skeggs int
g98_mc_new(struct nvkm_device * device,enum nvkm_subdev_type type,int inst,struct nvkm_mc ** pmc)641fc2fddfSBen Skeggs g98_mc_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_mc **pmc)
6554dcadd5SBen Skeggs {
661fc2fddfSBen Skeggs return nvkm_mc_new_(&g98_mc, device, type, inst, pmc);
6754dcadd5SBen Skeggs }
68