linux/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c

/*
 * Copyright 2019 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: AMD
 *
 */

#include "../dmub_srv.h"
#include "dmub_dcn20.h"
#include "dmub_dcn21.h"
#include "dmub_cmd.h"
#include "dmub_dcn30.h"
#include "dmub_dcn301.h"
#include "dmub_dcn302.h"
#include "dmub_dcn303.h"
#include "dmub_dcn31.h"
#include "dmub_dcn314.h"
#include "dmub_dcn315.h"
#include "dmub_dcn316.h"
#include "dmub_dcn32.h"
#include "dmub_dcn35.h"
#include "dmub_dcn351.h"
#include "dmub_dcn401.h"
#include "os_types.h"
/*
 * Note: the DMUB service is standalone. No additional headers should be
 * added below or above this line unless they reside within the DMUB
 * folder.
 */

/* Alignment for framebuffer memory. */
#define DMUB_FB_ALIGNMENT

/* Stack size. */
#define DMUB_STACK_SIZE

/* Context size. */
#define DMUB_CONTEXT_SIZE

/* Mailbox size : Ring buffers are required for both inbox and outbox */
#define DMUB_MAILBOX_SIZE

/* Default state size if meta is absent. */
#define DMUB_FW_STATE_SIZE

/* Default tracebuffer size if meta is absent. */
#define DMUB_TRACE_BUFFER_SIZE


/* Default scratch mem size. */
#define DMUB_SCRATCH_MEM_SIZE

/* Number of windows in use. */
#define DMUB_NUM_WINDOWS
/* Base addresses. */

#define DMUB_CW0_BASE
#define DMUB_CW1_BASE
#define DMUB_CW3_BASE
#define DMUB_CW4_BASE
#define DMUB_CW5_BASE
#define DMUB_CW6_BASE

#define DMUB_REGION5_BASE
#define DMUB_REGION6_BASE

static struct dmub_srv_dcn32_regs dmub_srv_dcn32_regs;
static struct dmub_srv_dcn35_regs dmub_srv_dcn35_regs;

static inline uint32_t dmub_align(uint32_t val, uint32_t factor)
{}

void dmub_flush_buffer_mem(const struct dmub_fb *fb)
{}

static const struct dmub_fw_meta_info *
dmub_get_fw_meta_info_from_blob(const uint8_t *blob, uint32_t blob_size, uint32_t meta_offset)
{}

static const struct dmub_fw_meta_info *
dmub_get_fw_meta_info(const struct dmub_srv_region_params *params)
{}

static bool dmub_srv_hw_setup(struct dmub_srv *dmub, enum dmub_asic asic)
{}

enum dmub_status dmub_srv_create(struct dmub_srv *dmub,
				 const struct dmub_srv_create_params *params)
{}

void dmub_srv_destroy(struct dmub_srv *dmub)
{}

static uint32_t dmub_srv_calc_regions_for_memory_type(const struct dmub_srv_region_params *params,
	struct dmub_srv_region_info *out,
	const uint32_t *window_sizes,
	enum dmub_window_memory_type memory_type)
{}

enum dmub_status
	dmub_srv_calc_region_info(struct dmub_srv *dmub,
		const struct dmub_srv_region_params *params,
		struct dmub_srv_region_info *out)
{}

enum dmub_status dmub_srv_calc_mem_info(struct dmub_srv *dmub,
				       const struct dmub_srv_memory_params *params,
				       struct dmub_srv_fb_info *out)
{}

enum dmub_status dmub_srv_has_hw_support(struct dmub_srv *dmub,
					 bool *is_supported)
{}

enum dmub_status dmub_srv_is_hw_init(struct dmub_srv *dmub, bool *is_hw_init)
{}

enum dmub_status dmub_srv_hw_init(struct dmub_srv *dmub,
				  const struct dmub_srv_hw_params *params)
{}

enum dmub_status dmub_srv_sync_inbox1(struct dmub_srv *dmub)
{}

enum dmub_status dmub_srv_hw_reset(struct dmub_srv *dmub)
{}

enum dmub_status dmub_srv_cmd_queue(struct dmub_srv *dmub,
				    const union dmub_rb_cmd *cmd)
{}

enum dmub_status dmub_srv_cmd_execute(struct dmub_srv *dmub)
{}

bool dmub_srv_is_hw_pwr_up(struct dmub_srv *dmub)
{}

enum dmub_status dmub_srv_wait_for_hw_pwr_up(struct dmub_srv *dmub,
					     uint32_t timeout_us)
{}

enum dmub_status dmub_srv_wait_for_auto_load(struct dmub_srv *dmub,
					     uint32_t timeout_us)
{}

enum dmub_status dmub_srv_wait_for_idle(struct dmub_srv *dmub,
					uint32_t timeout_us)
{}

enum dmub_status
dmub_srv_send_gpint_command(struct dmub_srv *dmub,
			    enum dmub_gpint_command command_code,
			    uint16_t param, uint32_t timeout_us)
{}

enum dmub_status dmub_srv_get_gpint_response(struct dmub_srv *dmub,
					     uint32_t *response)
{}

enum dmub_status dmub_srv_get_gpint_dataout(struct dmub_srv *dmub,
					     uint32_t *dataout)
{}

enum dmub_status dmub_srv_get_fw_boot_status(struct dmub_srv *dmub,
					     union dmub_fw_boot_status *status)
{}

enum dmub_status dmub_srv_get_fw_boot_option(struct dmub_srv *dmub,
					     union dmub_fw_boot_options *option)
{}

enum dmub_status dmub_srv_set_skip_panel_power_sequence(struct dmub_srv *dmub,
					     bool skip)
{}

enum dmub_status dmub_srv_cmd_with_reply_data(struct dmub_srv *dmub,
					      union dmub_rb_cmd *cmd)
{}

static inline bool dmub_rb_out_trace_buffer_front(struct dmub_rb *rb,
				 void *entry)
{}

bool dmub_srv_get_outbox0_msg(struct dmub_srv *dmub, struct dmcub_trace_buf_entry *entry)
{}

bool dmub_srv_get_diagnostic_data(struct dmub_srv *dmub, struct dmub_diagnostic_data *diag_data)
{}

bool dmub_srv_should_detect(struct dmub_srv *dmub)
{}

enum dmub_status dmub_srv_clear_inbox0_ack(struct dmub_srv *dmub)
{}

enum dmub_status dmub_srv_wait_for_inbox0_ack(struct dmub_srv *dmub, uint32_t timeout_us)
{}

enum dmub_status dmub_srv_send_inbox0_cmd(struct dmub_srv *dmub,
		union dmub_inbox0_data_register data)
{}

void dmub_srv_subvp_save_surf_addr(struct dmub_srv *dmub, const struct dc_plane_address *addr, uint8_t subvp_index)
{}

enum dmub_status dmub_srv_send_reg_inbox0_cmd(
		struct dmub_srv *dmub,
		union dmub_rb_cmd *cmd,
		bool with_reply, uint32_t timeout_us)
{}

void dmub_srv_set_power_state(struct dmub_srv *dmub, enum dmub_srv_power_state_type dmub_srv_power_state)
{}