From d7a9c5b73477b724243d900a69d04b7776295446 Mon Sep 17 00:00:00 2001 From: vinodg Date: Mon, 12 Aug 2024 17:16:32 +0000 Subject: [PATCH] dce: update for mods test DCE FW will run the dma test using 512 bytes of transfer between dram and tcm for 400 iterations and alu test generating 100 prime numbers for 200 iterations. DCE running above 600Mhz will take nearly 50msec for each test. Jira TDS-16211 Change-Id: I34570acd4db6b8103bd2451833b280dc8e32131a Signed-off-by: vinodg Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3192552 Reviewed-by: Mahesh Kumar GVS: buildbot_gerritrpt --- drivers/platform/tegra/dce/dce-debug.c | 33 +++++++++++++++---- .../dce/include/interface/dce-admin-cmds.h | 10 +++--- 2 files changed, 31 insertions(+), 12 deletions(-) diff --git a/drivers/platform/tegra/dce/dce-debug.c b/drivers/platform/tegra/dce/dce-debug.c index 695c6e3d..54a8d8e6 100644 --- a/drivers/platform/tegra/dce/dce-debug.c +++ b/drivers/platform/tegra/dce/dce-debug.c @@ -1,11 +1,21 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Copyright (c) 2019-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * Copyright (c) 2019-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. */ #include #include #include +#include #include #include #include @@ -309,7 +319,9 @@ static int dbg_dce_tests_external_help_fops_show(struct seq_file *s, void *data) seq_printf(s, "DCE External Test List\n" "----------------------\n" " - Test #0: MODS ALU Test\n" - " - Test #1: MODS DMA Test\n"); + " - Test #1: MODS DMA Test\n" + " Usage: echo 0 > run, will run ALU test\n"); + return 0; @@ -359,6 +371,8 @@ static ssize_t dbg_dce_tests_external_run_fops_write(struct file *file, { int ret = 0; u32 test; + u64 start_time; + u64 end_time; struct dce_ipc_message *msg = NULL; struct dce_admin_ipc_cmd *req_msg = NULL; struct dce_admin_ipc_resp *resp_msg = NULL; @@ -397,7 +411,10 @@ static ssize_t dbg_dce_tests_external_run_fops_write(struct file *file, req_msg = (struct dce_admin_ipc_cmd *)(msg->tx.data); resp_msg = (struct dce_admin_ipc_resp *) (msg->rx.data); - req_msg->args.ext_test.test = test; + req_msg->args.ext_test.test_cmd = test; + + start_time = ktime_get_real_ns(); + ret = dce_admin_send_cmd_ext_test(d, msg); if (ret) { dce_err(d, "Admin msg failed"); @@ -405,9 +422,13 @@ static ssize_t dbg_dce_tests_external_run_fops_write(struct file *file, goto exit; } - if (resp_msg->error == DCE_ERR_CORE_SUCCESS) - dce_info(d, "Test passed!"); - else if (resp_msg->error == DCE_ERR_CORE_NOT_IMPLEMENTED) + end_time = ktime_get_real_ns(); + + if (resp_msg->error == DCE_ERR_CORE_SUCCESS) { + dce_err(d, "Test passed!"); + dce_err(d, "Took %lld microsecs to finish\n", + ((end_time - start_time) / 1000)); + } else if (resp_msg->error == DCE_ERR_CORE_NOT_IMPLEMENTED) dce_err(d, "Test not implemented!"); else dce_err(d, "Test failed(%d)!", (int32_t)resp_msg->error); diff --git a/drivers/platform/tegra/dce/include/interface/dce-admin-cmds.h b/drivers/platform/tegra/dce/include/interface/dce-admin-cmds.h index 3aed6230..ae612f44 100644 --- a/drivers/platform/tegra/dce/include/interface/dce-admin-cmds.h +++ b/drivers/platform/tegra/dce/include/interface/dce-admin-cmds.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: MIT */ /* - * Copyright (c) 2018-2023 NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2018-2024 NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -96,12 +96,10 @@ struct dce_admin_echo { uint32_t data; }; -enum dce_admin_ext_test { - DCE_ADMIN_EXT_TEST_ALU = 0U, - DCE_ADMIN_EXT_TEST_DMA = 1U, -}; +#define DCE_ADMIN_EXT_TEST_ALU 0U +#define DCE_ADMIN_EXT_TEST_DMA 1U struct dce_admin_ext_test_args { - enum dce_admin_ext_test test; + uint32_t test_cmd; }; struct dce_admin_log_args {