linux/drivers/gpu/drm/amd/amdgpu/atom.h

/*
 * Copyright 2008 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.
 *
 * Author: Stanislaw Skowronek
 */

#ifndef ATOM_H
#define ATOM_H

#include <linux/types.h>

struct drm_device;

#define ATOM_BIOS_MAGIC
#define ATOM_ATI_MAGIC_PTR
#define ATOM_ATI_MAGIC
#define ATOM_ROM_TABLE_PTR

#define ATOM_ROM_MAGIC
#define ATOM_ROM_MAGIC_PTR

#define ATOM_ROM_MSG_PTR
#define ATOM_ROM_CMD_PTR
#define ATOM_ROM_DATA_PTR

#define ATOM_CMD_INIT
#define ATOM_CMD_SETSCLK
#define ATOM_CMD_SETMCLK
#define ATOM_CMD_SETPCLK
#define ATOM_CMD_SPDFANCNTL

#define ATOM_DATA_FWI_PTR
#define ATOM_DATA_IIO_PTR

#define ATOM_FWI_DEFSCLK_PTR
#define ATOM_FWI_DEFMCLK_PTR
#define ATOM_FWI_MAXSCLK_PTR
#define ATOM_FWI_MAXMCLK_PTR

#define ATOM_CT_SIZE_PTR
#define ATOM_CT_WS_PTR
#define ATOM_CT_PS_PTR
#define ATOM_CT_PS_MASK
#define ATOM_CT_CODE_PTR

#define ATOM_OP_CNT
#define ATOM_OP_EOT

#define ATOM_CASE_MAGIC
#define ATOM_CASE_END

#define ATOM_ARG_REG
#define ATOM_ARG_PS
#define ATOM_ARG_WS
#define ATOM_ARG_FB
#define ATOM_ARG_ID
#define ATOM_ARG_IMM
#define ATOM_ARG_PLL
#define ATOM_ARG_MC

#define ATOM_SRC_DWORD
#define ATOM_SRC_WORD0
#define ATOM_SRC_WORD8
#define ATOM_SRC_WORD16
#define ATOM_SRC_BYTE0
#define ATOM_SRC_BYTE8
#define ATOM_SRC_BYTE16
#define ATOM_SRC_BYTE24

#define ATOM_WS_QUOTIENT
#define ATOM_WS_REMAINDER
#define ATOM_WS_DATAPTR
#define ATOM_WS_SHIFT
#define ATOM_WS_OR_MASK
#define ATOM_WS_AND_MASK
#define ATOM_WS_FB_WINDOW
#define ATOM_WS_ATTRIBUTES
#define ATOM_WS_REGPTR

#define ATOM_IIO_NOP
#define ATOM_IIO_START
#define ATOM_IIO_READ
#define ATOM_IIO_WRITE
#define ATOM_IIO_CLEAR
#define ATOM_IIO_SET
#define ATOM_IIO_MOVE_INDEX
#define ATOM_IIO_MOVE_ATTR
#define ATOM_IIO_MOVE_DATA
#define ATOM_IIO_END

#define ATOM_IO_MM
#define ATOM_IO_PCI
#define ATOM_IO_SYSIO
#define ATOM_IO_IIO

#define STRLEN_NORMAL
#define STRLEN_LONG
#define STRLEN_VERYLONG

struct card_info {};

struct atom_context {};

extern int amdgpu_atom_debug;

struct atom_context *amdgpu_atom_parse(struct card_info *card, void *bios);
int amdgpu_atom_execute_table(struct atom_context *ctx, int index, uint32_t *params, int params_size);
int amdgpu_atom_asic_init(struct atom_context *ctx);
void amdgpu_atom_destroy(struct atom_context *ctx);
bool amdgpu_atom_parse_data_header(struct atom_context *ctx, int index, uint16_t *size,
			    uint8_t *frev, uint8_t *crev, uint16_t *data_start);
bool amdgpu_atom_parse_cmd_header(struct atom_context *ctx, int index,
			   uint8_t *frev, uint8_t *crev);
#include "atom-types.h"
#include "atombios.h"
#include "ObjectID.h"

#endif