diff --git a/drivers/gpu/nvgpu/libnvgpu-drv_safe.export b/drivers/gpu/nvgpu/libnvgpu-drv_safe.export index 860ad0829..b20205e44 100644 --- a/drivers/gpu/nvgpu/libnvgpu-drv_safe.export +++ b/drivers/gpu/nvgpu/libnvgpu-drv_safe.export @@ -390,6 +390,7 @@ nvgpu_engine_status_is_ctxsw_load nvgpu_engine_status_is_ctxsw_save nvgpu_engine_status_is_ctxsw_switch nvgpu_engine_status_is_ctxsw_valid +nvgpu_falcon_get_id nvgpu_falcon_hs_ucode_load_bootstrap nvgpu_falcon_copy_to_dmem nvgpu_falcon_copy_to_imem diff --git a/userspace/required_tests.json b/userspace/required_tests.json index 32c79fa8f..4a62489e8 100644 --- a/userspace/required_tests.json +++ b/userspace/required_tests.json @@ -563,6 +563,12 @@ "unit": "falcon", "test_level": 0 }, + { + "test": "test_falcon_get_id", + "case": "falcon_get_id", + "unit": "falcon", + "test_level": 0 + }, { "test": "test_falcon_halt", "case": "falcon_halt", diff --git a/userspace/units/falcon/falcon_tests/falcon.c b/userspace/units/falcon/falcon_tests/falcon.c index 1175887af..2da42ee3a 100644 --- a/userspace/units/falcon/falcon_tests/falcon.c +++ b/userspace/units/falcon/falcon_tests/falcon.c @@ -414,6 +414,16 @@ int test_falcon_sw_init_free(struct unit_module *m, struct gk20a *g, return UNIT_SUCCESS; } +int test_falcon_get_id(struct unit_module *m, struct gk20a *g, + void *__args) +{ + if (nvgpu_falcon_get_id(gpccs_flcn) == FALCON_ID_GPCCS) { + return UNIT_SUCCESS; + } else { + return UNIT_FAIL; + } +} + static void flcn_mem_scrub_pass(void *data) { struct nvgpu_falcon *flcn = (struct nvgpu_falcon *) data; @@ -1383,6 +1393,7 @@ int test_falcon_irq(struct unit_module *m, struct gk20a *g, void *__args) struct unit_module_test falcon_tests[] = { UNIT_TEST(falcon_sw_init_free, test_falcon_sw_init_free, NULL, 0), + UNIT_TEST(falcon_get_id, test_falcon_get_id, NULL, 0), UNIT_TEST(falcon_reset, test_falcon_reset, NULL, 0), UNIT_TEST(falcon_mem_scrub, test_falcon_mem_scrub, NULL, 0), UNIT_TEST(falcon_idle, test_falcon_idle, NULL, 0), diff --git a/userspace/units/falcon/falcon_tests/nvgpu-falcon.h b/userspace/units/falcon/falcon_tests/nvgpu-falcon.h index 06a872218..ce4bd80b9 100644 --- a/userspace/units/falcon/falcon_tests/nvgpu-falcon.h +++ b/userspace/units/falcon/falcon_tests/nvgpu-falcon.h @@ -67,6 +67,28 @@ struct unit_module; int test_falcon_sw_init_free(struct unit_module *m, struct gk20a *g, void *__args); +/** + * Test specification for: test_falcon_get_id + * + * Description: The falcon unit shall be able to return the falcon ID + * for the falcon. + * + * Test Type: Feature + * + * Targets: nvgpu_falcon_get_id + * + * Input: None. + * + * Steps: + * - Invoke nvgpu_falcon_get_id with the gpccs falcon struct. + * - Verify that return falcon ID is #FALCON_ID_GPCCS. + * + * Output: Returns PASS if the steps above were executed successfully. FAIL + * otherwise. + */ +int test_falcon_get_id(struct unit_module *m, struct gk20a *g, + void *__args); + /** * Test specification for: test_falcon_reset *