2 * Copyright 2012 Red Hat Inc.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
22 * Authors: Ben Skeggs, Ilia Mirkin
24 #include <engine/bsp.h>
25 #include <engine/xtensa.h>
27 #include <core/engctx.h>
29 /*******************************************************************************
31 ******************************************************************************/
33 static struct nvkm_oclass
35 { 0x74b0, &nvkm_object_ofuncs },
39 /*******************************************************************************
41 ******************************************************************************/
43 static struct nvkm_oclass
45 .handle = NV_ENGCTX(BSP, 0x84),
46 .ofuncs = &(struct nvkm_ofuncs) {
47 .ctor = _nvkm_xtensa_engctx_ctor,
48 .dtor = _nvkm_engctx_dtor,
49 .init = _nvkm_engctx_init,
50 .fini = _nvkm_engctx_fini,
51 .rd32 = _nvkm_engctx_rd32,
52 .wr32 = _nvkm_engctx_wr32,
56 /*******************************************************************************
57 * BSP engine/subdev functions
58 ******************************************************************************/
61 g84_bsp_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
62 struct nvkm_oclass *oclass, void *data, u32 size,
63 struct nvkm_object **pobject)
65 struct nvkm_xtensa *priv;
68 ret = nvkm_xtensa_create(parent, engine, oclass, 0x103000, true,
69 "PBSP", "bsp", &priv);
70 *pobject = nv_object(priv);
74 nv_subdev(priv)->unit = 0x04008000;
75 nv_engine(priv)->cclass = &g84_bsp_cclass;
76 nv_engine(priv)->sclass = g84_bsp_sclass;
77 priv->fifo_val = 0x1111;
78 priv->unkd28 = 0x90044;
84 .handle = NV_ENGINE(BSP, 0x84),
85 .ofuncs = &(struct nvkm_ofuncs) {
87 .dtor = _nvkm_xtensa_dtor,
88 .init = _nvkm_xtensa_init,
89 .fini = _nvkm_xtensa_fini,
90 .rd32 = _nvkm_xtensa_rd32,
91 .wr32 = _nvkm_xtensa_wr32,