From 642cc7416ebcf0d1e7b813a1cc67d48d58004297 Mon Sep 17 00:00:00 2001 From: Lakshmanan M Date: Mon, 23 May 2016 12:26:46 +0530 Subject: gpu: nvgpu: Add device_info_data support Added device_info_data parsing support for pascal GPU series. This is required to identify the (Logical CE) NV_PTOP_DEVICE_INFO_TYPE_ENUM_LCE instance id. (example - CE0, CE1, CE2, CE3, ...) JIRA DNVGPU-26 Change-Id: I35c42cb1d544729e4099db1528c690dd2be025f4 Signed-off-by: Lakshmanan M Reviewed-on: http://git-master/r/1151605 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Ken Adams --- drivers/gpu/nvgpu/gp10b/fifo_gp10b.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/gp10b/fifo_gp10b.c') diff --git a/drivers/gpu/nvgpu/gp10b/fifo_gp10b.c b/drivers/gpu/nvgpu/gp10b/fifo_gp10b.c index 45de221e..89b5527d 100644 --- a/drivers/gpu/nvgpu/gp10b/fifo_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/fifo_gp10b.c @@ -182,7 +182,8 @@ static int gp10b_fifo_resetup_ramfc(struct channel_gk20a *c) return 0; } -static int gp10b_fifo_engine_enum_from_type(struct gk20a *g, u32 engine_type) +static int gp10b_fifo_engine_enum_from_type(struct gk20a *g, u32 engine_type, + u32 *inst_id) { int ret = ENGINE_INVAL_GK20A; @@ -197,6 +198,28 @@ static int gp10b_fifo_engine_enum_from_type(struct gk20a *g, u32 engine_type) return ret; } +void gp10b_device_info_data_parse(struct gk20a *g, u32 table_entry, + u32 *inst_id, u32 *pri_base, u32 *fault_id) +{ + if (top_device_info_data_type_v(table_entry) == + top_device_info_data_type_enum2_v()) { + if (inst_id) + *inst_id = top_device_info_data_inst_id_v(table_entry); + if (pri_base) { + *pri_base = + (top_device_info_data_pri_base_v(table_entry) + << top_device_info_data_pri_base_align_v()); + } + if (fault_id && (top_device_info_data_fault_id_v(table_entry) == + top_device_info_data_fault_id_valid_v())) { + *fault_id = + top_device_info_data_fault_id_enum_v(table_entry); + } + } else + gk20a_err(g->dev, "unknown device_info_data %d", + top_device_info_data_type_v(table_entry)); +} + void gp10b_init_fifo(struct gpu_ops *gops) { gm20b_init_fifo(gops); @@ -204,4 +227,5 @@ void gp10b_init_fifo(struct gpu_ops *gops) gops->fifo.get_pbdma_signature = gp10b_fifo_get_pbdma_signature; gops->fifo.resetup_ramfc = gp10b_fifo_resetup_ramfc; gops->fifo.engine_enum_from_type = gp10b_fifo_engine_enum_from_type; + gops->fifo.device_info_data_parse = gp10b_device_info_data_parse; } -- cgit v1.2.2