/* * Copyright 2011 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Authors: Alex Deucher
*/
if (!(rst & RST_REG) && !(clk & CK_DISABLE)) returntrue;
returnfalse;
}
PPSMC_Result amdgpu_si_send_msg_to_smc(struct amdgpu_device *adev,
PPSMC_Msg msg)
{
u32 tmp; int i; int usec_timeout;
/* SMC seems to process some messages exceptionally slowly. */ switch (msg) { case PPSMC_MSG_NoForcedLevel: case PPSMC_MSG_SetEnabledLevels: case PPSMC_MSG_SetForcedLevels: case PPSMC_MSG_DisableULV: case PPSMC_MSG_SwitchToSwState:
usec_timeout = 1000000; /* 1 sec */ break; default:
usec_timeout = 200000; /* 200 ms */ break;
}
if (!amdgpu_si_is_smc_running(adev)) return PPSMC_Result_Failed;
WREG32(mmSMC_MESSAGE_0, msg);
for (i = 0; i < usec_timeout; i++) {
tmp = RREG32(mmSMC_RESP_0); if (tmp != 0) break;
udelay(1);
}
tmp = RREG32(mmSMC_RESP_0); if (tmp == 0) {
drm_warn(adev_to_drm(adev), "%s timeout on message: %x (SMC_SCRATCH0: %x)\n",
__func__, msg, RREG32(mmSMC_SCRATCH0));
}
return (PPSMC_Result)tmp;
}
PPSMC_Result amdgpu_si_wait_for_smc_inactive(struct amdgpu_device *adev)
{
u32 tmp; int i;
if (!amdgpu_si_is_smc_running(adev)) return PPSMC_Result_OK;
for (i = 0; i < adev->usec_timeout; i++) {
tmp = RREG32_SMC(SMC_SYSCON_CLOCK_CNTL_0); if ((tmp & CKEN) == 0) break;
udelay(1);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.