linux/drivers/gpu/drm/radeon/rv770_smc.h

/*
 * 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.
 *
 */
#ifndef __RV770_SMC_H__
#define __RV770_SMC_H__

#include "ppsmc.h"

#pragma pack(push, 1)

#define RV770_SMC_TABLE_ADDRESS

#define RV770_SMC_PERFORMANCE_LEVELS_PER_SWSTATE

struct RV770_SMC_SCLK_VALUE {};

RV770_SMC_SCLK_VALUE;

struct RV770_SMC_MCLK_VALUE {};

RV770_SMC_MCLK_VALUE;


struct RV730_SMC_MCLK_VALUE {};

RV730_SMC_MCLK_VALUE;

struct RV770_SMC_VOLTAGE_VALUE {};

RV770_SMC_VOLTAGE_VALUE;

RV7XX_SMC_MCLK_VALUE;

LPRV7XX_SMC_MCLK_VALUE;

struct RV770_SMC_HW_PERFORMANCE_LEVEL {};

#define SMC_STROBE_RATIO
#define SMC_STROBE_ENABLE

#define SMC_MC_EDC_RD_FLAG
#define SMC_MC_EDC_WR_FLAG
#define SMC_MC_RTT_ENABLE
#define SMC_MC_STUTTER_EN

RV770_SMC_HW_PERFORMANCE_LEVEL;

struct RV770_SMC_SWSTATE {};

RV770_SMC_SWSTATE;

#define RV770_SMC_VOLTAGEMASK_VDDC
#define RV770_SMC_VOLTAGEMASK_MVDD
#define RV770_SMC_VOLTAGEMASK_VDDCI
#define RV770_SMC_VOLTAGEMASK_MAX

struct RV770_SMC_VOLTAGEMASKTABLE {};

RV770_SMC_VOLTAGEMASKTABLE;

#define MAX_NO_VREG_STEPS

struct RV770_SMC_STATETABLE {};

RV770_SMC_STATETABLE;

#define PPSMC_STATEFLAG_AUTO_PULSE_SKIP

#pragma pack(pop)

#define RV770_SMC_SOFT_REGISTERS_START

#define RV770_SMC_SOFT_REGISTER_mclk_chg_timeout
#define RV770_SMC_SOFT_REGISTER_baby_step_timer
#define RV770_SMC_SOFT_REGISTER_delay_bbias
#define RV770_SMC_SOFT_REGISTER_delay_vreg
#define RV770_SMC_SOFT_REGISTER_delay_acpi
#define RV770_SMC_SOFT_REGISTER_seq_index
#define RV770_SMC_SOFT_REGISTER_mvdd_chg_time
#define RV770_SMC_SOFT_REGISTER_mclk_switch_lim
#define RV770_SMC_SOFT_REGISTER_mc_block_delay
#define RV770_SMC_SOFT_REGISTER_uvd_enabled
#define RV770_SMC_SOFT_REGISTER_is_asic_lombok

int rv770_copy_bytes_to_smc(struct radeon_device *rdev,
			    u16 smc_start_address, const u8 *src,
			    u16 byte_count, u16 limit);
void rv770_start_smc(struct radeon_device *rdev);
void rv770_reset_smc(struct radeon_device *rdev);
void rv770_stop_smc_clock(struct radeon_device *rdev);
void rv770_start_smc_clock(struct radeon_device *rdev);
bool rv770_is_smc_running(struct radeon_device *rdev);
PPSMC_Result rv770_send_msg_to_smc(struct radeon_device *rdev, PPSMC_Msg msg);
PPSMC_Result rv770_wait_for_smc_inactive(struct radeon_device *rdev);
int rv770_read_smc_sram_dword(struct radeon_device *rdev,
			      u16 smc_address, u32 *value, u16 limit);
int rv770_write_smc_sram_dword(struct radeon_device *rdev,
			       u16 smc_address, u32 value, u16 limit);
int rv770_load_smc_ucode(struct radeon_device *rdev,
			 u16 limit);

#endif