1c39f472eSBen Skeggs /*
2c39f472eSBen Skeggs * Copyright 2012 Red Hat Inc.
3c39f472eSBen Skeggs *
4c39f472eSBen Skeggs * Permission is hereby granted, free of charge, to any person obtaining a
5c39f472eSBen Skeggs * copy of this software and associated documentation files (the "Software"),
6c39f472eSBen Skeggs * to deal in the Software without restriction, including without limitation
7c39f472eSBen Skeggs * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8c39f472eSBen Skeggs * and/or sell copies of the Software, and to permit persons to whom the
9c39f472eSBen Skeggs * Software is furnished to do so, subject to the following conditions:
10c39f472eSBen Skeggs *
11c39f472eSBen Skeggs * The above copyright notice and this permission notice shall be included in
12c39f472eSBen Skeggs * all copies or substantial portions of the Software.
13c39f472eSBen Skeggs *
14c39f472eSBen Skeggs * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15c39f472eSBen Skeggs * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16c39f472eSBen Skeggs * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17c39f472eSBen Skeggs * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18c39f472eSBen Skeggs * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19c39f472eSBen Skeggs * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20c39f472eSBen Skeggs * OTHER DEALINGS IN THE SOFTWARE.
21c39f472eSBen Skeggs *
22c39f472eSBen Skeggs * Authors: Ben Skeggs
23c39f472eSBen Skeggs */
2454dcadd5SBen Skeggs #include "priv.h"
25c39f472eSBen Skeggs
2654dcadd5SBen Skeggs void
nv44_mc_init(struct nvkm_mc * mc)2754dcadd5SBen Skeggs nv44_mc_init(struct nvkm_mc *mc)
28c39f472eSBen Skeggs {
2925e3a463SBen Skeggs struct nvkm_device *device = mc->subdev.device;
3025e3a463SBen Skeggs u32 tmp = nvkm_rd32(device, 0x10020c);
31c39f472eSBen Skeggs
3225e3a463SBen Skeggs nvkm_wr32(device, 0x000200, 0xffffffff); /* everything enabled */
33c39f472eSBen Skeggs
3425e3a463SBen Skeggs nvkm_wr32(device, 0x001700, tmp);
3525e3a463SBen Skeggs nvkm_wr32(device, 0x001704, 0);
3625e3a463SBen Skeggs nvkm_wr32(device, 0x001708, 0);
3725e3a463SBen Skeggs nvkm_wr32(device, 0x00170c, tmp);
38c39f472eSBen Skeggs }
39c39f472eSBen Skeggs
4054dcadd5SBen Skeggs static const struct nvkm_mc_func
4154dcadd5SBen Skeggs nv44_mc = {
42c39f472eSBen Skeggs .init = nv44_mc_init,
43fe76fe49SBen Skeggs .intr = &nv04_mc_intr,
44fe76fe49SBen Skeggs .intrs = nv17_mc_intrs,
45*ebb195dbSBen Skeggs .device = &nv04_mc_device,
4679360b7dSBen Skeggs .reset = nv17_mc_reset,
4754dcadd5SBen Skeggs };
4854dcadd5SBen Skeggs
4954dcadd5SBen Skeggs int
nv44_mc_new(struct nvkm_device * device,enum nvkm_subdev_type type,int inst,struct nvkm_mc ** pmc)501fc2fddfSBen Skeggs nv44_mc_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_mc **pmc)
5154dcadd5SBen Skeggs {
521fc2fddfSBen Skeggs return nvkm_mc_new_(&nv44_mc, device, type, inst, pmc);
5354dcadd5SBen Skeggs }
54