|
@@ -19,16 +19,14 @@
|
|
|
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
|
* OTHER DEALINGS IN THE SOFTWARE.
|
|
|
*
|
|
|
- * Authors: Ben Skeggs
|
|
|
+ * Authors: Ben Skeggs, Maarten Lankhorst, Ilia Mirkin
|
|
|
*/
|
|
|
|
|
|
-#include <core/engctx.h>
|
|
|
-#include <core/class.h>
|
|
|
-
|
|
|
+#include <engine/falcon.h>
|
|
|
#include <engine/bsp.h>
|
|
|
|
|
|
struct nv98_bsp_priv {
|
|
|
- struct nouveau_engine base;
|
|
|
+ struct nouveau_falcon base;
|
|
|
};
|
|
|
|
|
|
/*******************************************************************************
|
|
@@ -37,30 +35,48 @@ struct nv98_bsp_priv {
|
|
|
|
|
|
static struct nouveau_oclass
|
|
|
nv98_bsp_sclass[] = {
|
|
|
+ { 0x88b1, &nouveau_object_ofuncs },
|
|
|
+ { 0x85b1, &nouveau_object_ofuncs },
|
|
|
+ { 0x86b1, &nouveau_object_ofuncs },
|
|
|
{},
|
|
|
};
|
|
|
|
|
|
/*******************************************************************************
|
|
|
- * BSP context
|
|
|
+ * PBSP context
|
|
|
******************************************************************************/
|
|
|
|
|
|
static struct nouveau_oclass
|
|
|
nv98_bsp_cclass = {
|
|
|
.handle = NV_ENGCTX(BSP, 0x98),
|
|
|
.ofuncs = &(struct nouveau_ofuncs) {
|
|
|
- .ctor = _nouveau_engctx_ctor,
|
|
|
- .dtor = _nouveau_engctx_dtor,
|
|
|
- .init = _nouveau_engctx_init,
|
|
|
- .fini = _nouveau_engctx_fini,
|
|
|
- .rd32 = _nouveau_engctx_rd32,
|
|
|
- .wr32 = _nouveau_engctx_wr32,
|
|
|
+ .ctor = _nouveau_falcon_context_ctor,
|
|
|
+ .dtor = _nouveau_falcon_context_dtor,
|
|
|
+ .init = _nouveau_falcon_context_init,
|
|
|
+ .fini = _nouveau_falcon_context_fini,
|
|
|
+ .rd32 = _nouveau_falcon_context_rd32,
|
|
|
+ .wr32 = _nouveau_falcon_context_wr32,
|
|
|
},
|
|
|
};
|
|
|
|
|
|
/*******************************************************************************
|
|
|
- * BSP engine/subdev functions
|
|
|
+ * PBSP engine/subdev functions
|
|
|
******************************************************************************/
|
|
|
|
|
|
+static int
|
|
|
+nv98_bsp_init(struct nouveau_object *object)
|
|
|
+{
|
|
|
+ struct nv98_bsp_priv *priv = (void *)object;
|
|
|
+ int ret;
|
|
|
+
|
|
|
+ ret = nouveau_falcon_init(&priv->base);
|
|
|
+ if (ret)
|
|
|
+ return ret;
|
|
|
+
|
|
|
+ nv_wr32(priv, 0x084010, 0x0000ffd2);
|
|
|
+ nv_wr32(priv, 0x08401c, 0x0000fff2);
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
static int
|
|
|
nv98_bsp_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
|
|
|
struct nouveau_oclass *oclass, void *data, u32 size,
|
|
@@ -69,7 +85,7 @@ nv98_bsp_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
|
|
|
struct nv98_bsp_priv *priv;
|
|
|
int ret;
|
|
|
|
|
|
- ret = nouveau_engine_create(parent, engine, oclass, true,
|
|
|
+ ret = nouveau_falcon_create(parent, engine, oclass, 0x084000, true,
|
|
|
"PBSP", "bsp", &priv);
|
|
|
*pobject = nv_object(priv);
|
|
|
if (ret)
|
|
@@ -86,8 +102,10 @@ nv98_bsp_oclass = {
|
|
|
.handle = NV_ENGINE(BSP, 0x98),
|
|
|
.ofuncs = &(struct nouveau_ofuncs) {
|
|
|
.ctor = nv98_bsp_ctor,
|
|
|
- .dtor = _nouveau_engine_dtor,
|
|
|
- .init = _nouveau_engine_init,
|
|
|
- .fini = _nouveau_engine_fini,
|
|
|
+ .dtor = _nouveau_falcon_dtor,
|
|
|
+ .init = nv98_bsp_init,
|
|
|
+ .fini = _nouveau_falcon_fini,
|
|
|
+ .rd32 = _nouveau_falcon_rd32,
|
|
|
+ .wr32 = _nouveau_falcon_wr32,
|
|
|
},
|
|
|
};
|