drivers/gpu/drm/radeon/cypress_dpm.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/radeon/cypress_dpm.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/radeon/cypress_dpm.c- Extension
.c- Size
- 60786 bytes
- Lines
- 2169
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/pci.hatom.hcypress_dpm.hevergreen.hevergreend.hr600_dpm.hrv770.hradeon.hradeon_asic.h
Detected Declarations
function filesfunction cypress_enable_dynamic_pcie_gen2function cypress_enter_ulp_statefunction cypress_gfx_clock_gating_enablefunction cypress_mg_clock_gating_enablefunction cypress_enable_spread_spectrumfunction cypress_start_dpmfunction cypress_enable_sclk_controlfunction cypress_enable_mclk_controlfunction cypress_notify_smc_display_changefunction cypress_program_response_timesfunction cypress_pcie_performance_requestfunction cypress_advertise_gen2_capabilityfunction cypress_get_maximum_link_speedfunction cypress_notify_link_speed_change_after_state_changefunction cypress_notify_link_speed_change_before_state_changefunction cypress_populate_voltage_valuefunction cypress_get_strobe_mode_settingsfunction cypress_map_clkf_to_ibiasfunction cypress_populate_mclk_valuefunction cypress_get_mclk_frequency_ratiofunction cypress_populate_mvdd_valuefunction cypress_convert_power_level_to_smcfunction cypress_convert_power_state_to_smcfunction cypress_convert_mc_registersfunction cypress_convert_mc_reg_table_entry_to_smcfunction cypress_convert_mc_reg_table_to_smcfunction cypress_upload_sw_statefunction cypress_upload_mc_reg_tablefunction cypress_calculate_burst_timefunction cypress_program_memory_timing_parametersfunction cypress_populate_mc_reg_addressesfunction cypress_set_mc_reg_address_tablefunction cypress_retrieve_ac_timing_for_one_entryfunction cypress_retrieve_ac_timing_for_all_rangesfunction cypress_initialize_mc_reg_tablefunction cypress_wait_for_mc_sequencerfunction cypress_force_mc_use_s1function cypress_copy_ac_timing_from_s1_to_s0function cypress_force_mc_use_s0function cypress_populate_initial_mvdd_valuefunction cypress_populate_smc_initial_statefunction cypress_populate_smc_acpi_statefunction cypress_trim_voltage_table_to_fit_state_tablefunction cypress_construct_voltage_tablesfunction cypress_populate_smc_voltage_tablefunction cypress_populate_smc_voltage_tablesfunction cypress_get_mclk_split_point
Annotated Snippet
if (!pi->boot_in_gen2) {
bif = RREG32(CG_BIF_REQ_AND_RSP) & ~CG_CLIENT_REQ_MASK;
bif |= CG_CLIENT_REQ(0xd);
WREG32(CG_BIF_REQ_AND_RSP, bif);
tmp &= ~LC_HW_VOLTAGE_IF_CONTROL_MASK;
tmp |= LC_HW_VOLTAGE_IF_CONTROL(1);
tmp |= LC_GEN2_EN_STRAP;
tmp |= LC_CLR_FAILED_SPD_CHANGE_CNT;
WREG32_PCIE_PORT(PCIE_LC_SPEED_CNTL, tmp);
udelay(10);
tmp &= ~LC_CLR_FAILED_SPD_CHANGE_CNT;
WREG32_PCIE_PORT(PCIE_LC_SPEED_CNTL, tmp);
}
}
} else {
if (!pi->boot_in_gen2) {
tmp &= ~LC_HW_VOLTAGE_IF_CONTROL_MASK;
tmp &= ~LC_GEN2_EN_STRAP;
}
if ((tmp & LC_OTHER_SIDE_EVER_SENT_GEN2) ||
(tmp & LC_OTHER_SIDE_SUPPORTS_GEN2))
WREG32_PCIE_PORT(PCIE_LC_SPEED_CNTL, tmp);
}
}
static void cypress_enable_dynamic_pcie_gen2(struct radeon_device *rdev,
bool enable)
{
cypress_enable_bif_dynamic_pcie_gen2(rdev, enable);
if (enable)
WREG32_P(GENERAL_PWRMGT, ENABLE_GEN2PCIE, ~ENABLE_GEN2PCIE);
else
WREG32_P(GENERAL_PWRMGT, 0, ~ENABLE_GEN2PCIE);
}
#if 0
static int cypress_enter_ulp_state(struct radeon_device *rdev)
{
struct rv7xx_power_info *pi = rv770_get_pi(rdev);
if (pi->gfx_clock_gating) {
WREG32_P(SCLK_PWRMGT_CNTL, 0, ~DYN_GFX_CLK_OFF_EN);
WREG32_P(SCLK_PWRMGT_CNTL, GFX_CLK_FORCE_ON, ~GFX_CLK_FORCE_ON);
WREG32_P(SCLK_PWRMGT_CNTL, 0, ~GFX_CLK_FORCE_ON);
RREG32(GB_ADDR_CONFIG);
}
WREG32_P(SMC_MSG, HOST_SMC_MSG(PPSMC_MSG_SwitchToMinimumPower),
~HOST_SMC_MSG_MASK);
udelay(7000);
return 0;
}
#endif
static void cypress_gfx_clock_gating_enable(struct radeon_device *rdev,
bool enable)
{
struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
if (enable) {
if (eg_pi->light_sleep) {
WREG32(GRBM_GFX_INDEX, 0xC0000000);
WREG32_CG(CG_CGLS_TILE_0, 0xFFFFFFFF);
WREG32_CG(CG_CGLS_TILE_1, 0xFFFFFFFF);
WREG32_CG(CG_CGLS_TILE_2, 0xFFFFFFFF);
WREG32_CG(CG_CGLS_TILE_3, 0xFFFFFFFF);
WREG32_CG(CG_CGLS_TILE_4, 0xFFFFFFFF);
WREG32_CG(CG_CGLS_TILE_5, 0xFFFFFFFF);
WREG32_CG(CG_CGLS_TILE_6, 0xFFFFFFFF);
WREG32_CG(CG_CGLS_TILE_7, 0xFFFFFFFF);
WREG32_CG(CG_CGLS_TILE_8, 0xFFFFFFFF);
WREG32_CG(CG_CGLS_TILE_9, 0xFFFFFFFF);
WREG32_CG(CG_CGLS_TILE_10, 0xFFFFFFFF);
WREG32_CG(CG_CGLS_TILE_11, 0xFFFFFFFF);
WREG32_P(SCLK_PWRMGT_CNTL, DYN_LIGHT_SLEEP_EN, ~DYN_LIGHT_SLEEP_EN);
}
WREG32_P(SCLK_PWRMGT_CNTL, DYN_GFX_CLK_OFF_EN, ~DYN_GFX_CLK_OFF_EN);
} else {
WREG32_P(SCLK_PWRMGT_CNTL, 0, ~DYN_GFX_CLK_OFF_EN);
WREG32_P(SCLK_PWRMGT_CNTL, GFX_CLK_FORCE_ON, ~GFX_CLK_FORCE_ON);
WREG32_P(SCLK_PWRMGT_CNTL, 0, ~GFX_CLK_FORCE_ON);
RREG32(GB_ADDR_CONFIG);
Annotation
- Immediate include surface: `linux/pci.h`, `atom.h`, `cypress_dpm.h`, `evergreen.h`, `evergreend.h`, `r600_dpm.h`, `rv770.h`, `radeon.h`.
- Detected declarations: `function files`, `function cypress_enable_dynamic_pcie_gen2`, `function cypress_enter_ulp_state`, `function cypress_gfx_clock_gating_enable`, `function cypress_mg_clock_gating_enable`, `function cypress_enable_spread_spectrum`, `function cypress_start_dpm`, `function cypress_enable_sclk_control`, `function cypress_enable_mclk_control`, `function cypress_notify_smc_display_change`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.