mirror of
git://nv-tegra.nvidia.com/linux-hwpm.git
synced 2025-12-22 09:12:05 +03:00
Add mode E user data test for these IPS: - NVTHERM - IPMU JIRA MSST-831 Change-Id: Id8911fa9bbed47f1c5d1e82b075e60134e05ad2c Signed-off-by: Besar Wicaksono <bwicaksono@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/3361434 Reviewed-by: Vasuki Shankar <vasukis@nvidia.com> GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com> Reviewed-by: Yifei Wan <ywan@nvidia.com>
120 lines
3.4 KiB
C++
120 lines
3.4 KiB
C++
/* SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
* SPDX-License-Identifier: GPL-2.0-only
|
|
*
|
|
* 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.
|
|
*
|
|
*/
|
|
|
|
#ifndef T410_TEST_H
|
|
#define T410_TEST_H
|
|
|
|
#include "nv_soc_hwpm_test.h"
|
|
|
|
#include <vector>
|
|
#include <cstdint>
|
|
|
|
#define T410_MAX_SOCKETS 2
|
|
|
|
class T410Tests : public NvSocHwpmTests
|
|
{
|
|
public:
|
|
T410Tests();
|
|
~T410Tests() override;
|
|
|
|
protected:
|
|
struct PmaConfigurationParams {
|
|
PmaConfigurationParams()
|
|
{
|
|
enable_streaming = false;
|
|
pulse_interval = 0;
|
|
enable_pma_record = false;
|
|
keep_latest = false;
|
|
}
|
|
|
|
bool enable_streaming;
|
|
uint32_t pulse_interval;
|
|
bool enable_pma_record;
|
|
bool keep_latest;
|
|
};
|
|
|
|
struct PmmConfigurationParams {
|
|
enum Mode {
|
|
MODE_B,
|
|
MODE_C,
|
|
MODE_E,
|
|
MODE_E_USERDATA
|
|
};
|
|
|
|
PmmConfigurationParams()
|
|
{
|
|
mode = MODE_B;
|
|
perfmon_idx = 0;
|
|
perfmon_base = 0;
|
|
enable_local_triggering = false;
|
|
enable_overflow_priming = false;
|
|
collect_one = false;
|
|
}
|
|
|
|
std::vector<uint32_t> expected_sig_val;
|
|
|
|
Mode mode;
|
|
uint32_t perfmon_idx;
|
|
uint64_t perfmon_base;
|
|
|
|
bool enable_local_triggering;
|
|
bool enable_overflow_priming;
|
|
bool collect_one;
|
|
};
|
|
|
|
void SetUp(void) override;
|
|
void TearDown(void) override;
|
|
|
|
void GetDevices(void);
|
|
|
|
void TestRegopsRead(nv_soc_hwpm_session session,
|
|
uint64_t pma_record_buffer_pma_va,
|
|
size_t record_buffer_size);
|
|
void TestRegopsWrite(nv_soc_hwpm_session session);
|
|
|
|
void RegOpWrite32(
|
|
nv_soc_hwpm_session session, uint64_t address, uint32_t value, uint32_t mask);
|
|
void RegOpRead32(
|
|
nv_soc_hwpm_session session, uint64_t address, uint32_t *value);
|
|
|
|
void SetupPma(nv_soc_hwpm_session session, const PmaConfigurationParams ¶ms);
|
|
void EnablePmaStreaming(nv_soc_hwpm_session session, const PmaConfigurationParams ¶ms);
|
|
void SetupPmm(nv_soc_hwpm_session session, const PmmConfigurationParams ¶ms);
|
|
void SetupWatchbusPma(nv_soc_hwpm_session session, const PmmConfigurationParams ¶ms);
|
|
void SetupWatchbusNvtherm(nv_soc_hwpm_session session, const PmmConfigurationParams ¶ms);
|
|
void SetupWatchbusCsnMbn(nv_soc_hwpm_session session, const PmmConfigurationParams ¶ms);
|
|
void SetupWatchbusIpmu(nv_soc_hwpm_session session, const PmmConfigurationParams ¶ms);
|
|
void TeardownPma(nv_soc_hwpm_session session);
|
|
void TeardownPmm(nv_soc_hwpm_session session, const PmmConfigurationParams ¶ms);
|
|
void TeardownPerfmux(nv_soc_hwpm_session session);
|
|
void IssuePmaTrigger(
|
|
nv_soc_hwpm_session session,
|
|
bool halt_before_trigger = false,
|
|
bool halt_after_trigger = false,
|
|
uint32_t delay_after_trigger = 0);
|
|
void HarvestCounters(
|
|
nv_soc_hwpm_session session,
|
|
const PmmConfigurationParams ¶ms,
|
|
const uint32_t sig_val[4]);
|
|
|
|
void InitPmmParams(nv_soc_hwpm_resource resource, PmmConfigurationParams ¶ms);
|
|
void ModeBTest(nv_soc_hwpm_resource resource);
|
|
void ModeETest(nv_soc_hwpm_resource resource);
|
|
void ModeETestUserData(nv_soc_hwpm_resource resource);
|
|
|
|
nv_soc_hwpm_device t410_dev[T410_MAX_SOCKETS];
|
|
uint32_t t410_dev_count;
|
|
};
|
|
|
|
#endif // T410_TEST_H
|