mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
- Rename dce-os-device to dce-linux-device - dce-os-device.h header is specific to OS and is only intended to be internally used within OS. Similarly all it's exposed functions are OS specific only. - Therefore instead of having a common name for all OSs for this header file, make this header internal by including linux name to it's naming convention. - Similary rename dce_os_device struct to dce_linux_device and also rename corresponding functions from this header. JIRA TDS-16126 Change-Id: I74e2deb17f49065d242bd80d50c5a849b3dfa3a1 Signed-off-by: anupamg <anupamg@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3256403 Reviewed-by: Arun Swain <arswain@nvidia.com> GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
75 lines
1.5 KiB
C
75 lines
1.5 KiB
C
// SPDX-License-Identifier: GPL-2.0-only
|
|
/*
|
|
* SPDX-FileCopyrightText: Copyright (c) 2019-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
*/
|
|
|
|
#include <dce.h>
|
|
#include <dce-os-log.h>
|
|
#include <dce-os-utils.h>
|
|
#include <dce-linux-device.h>
|
|
|
|
enum pm_controls {
|
|
FW_LOAD_HALTED,
|
|
FW_LOAD_DONE
|
|
};
|
|
|
|
/**
|
|
* dce_evp_set_reset_addr - Writes to the evp reset addr register.
|
|
*
|
|
* @d : Pointer to struct tegra_dce
|
|
* @addr : 32bit address
|
|
*
|
|
* Return : Void
|
|
*/
|
|
static inline void dce_evp_set_reset_addr(struct tegra_dce *d, u32 addr)
|
|
{
|
|
dce_os_writel(d, evp_reset_addr_r(), addr);
|
|
}
|
|
|
|
/**
|
|
* dce_pm_set_pm_ctrl - Writes to the reset control register.
|
|
*
|
|
* @d : Pointer to struct tegra_dce
|
|
* @val : Value to programmed to the register
|
|
*
|
|
* Return : Void
|
|
*/
|
|
static void dce_pm_set_pm_ctrl(struct tegra_dce *d, enum pm_controls val)
|
|
{
|
|
switch (val) {
|
|
case FW_LOAD_DONE:
|
|
dce_os_writel(d, pm_r5_ctrl_r(), pm_r5_ctrl_fwloaddone_done_f());
|
|
break;
|
|
case FW_LOAD_HALTED:
|
|
dce_os_writel(d, pm_r5_ctrl_r(), pm_r5_ctrl_fwloaddone_halted_f());
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* dce_reset_dce - Configures the pertinent registers in
|
|
* DCE cluser to reset DCE.
|
|
*
|
|
* @d : Pointer to tegra_dce struct.
|
|
*
|
|
* Return : 0 if success
|
|
*/
|
|
int dce_reset_dce(struct tegra_dce *d)
|
|
{
|
|
u32 fw_dce_addr;
|
|
|
|
if (!d->fw_data) {
|
|
dce_os_err(d, "No fw_data present");
|
|
return -1;
|
|
}
|
|
|
|
fw_dce_addr = pdata_from_dce_linux_device(d)->fw_dce_addr;
|
|
dce_evp_set_reset_addr(d, fw_dce_addr);
|
|
|
|
dce_pm_set_pm_ctrl(d, FW_LOAD_DONE);
|
|
|
|
return 0;
|
|
}
|