summaryrefslogtreecommitdiff
path: root/src/radeon_reg.h
blob: 62f80b6b461b5b118d09735992179217f3875b3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
 * Copyright 2010 Jerome Glisse <glisse@freedesktop.org>
 *
 * 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
 * on the rights to use, copy, modify, merge, publish, distribute, sub
 * license, 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 (including the next
 * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL
 * THE AUTHOR(S) AND/OR THEIR SUPPLIERS 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:
 *      Jerome Glisse
 */
#ifndef RADEON_REG_H
#define RADEON_REG_H

#include <stdio.h>
#include <stdint.h>

#include "radeon.h"

typedef u32 (*radeon_rreg_t)(struct radeon *radeon, u32 offset);
typedef void (*radeon_wreg_t)(struct radeon *radeon, u32 offset, u32 value);

struct reg_block {
	unsigned	id;
	char		name[128];
};

struct reg {
	unsigned	offset;
	unsigned	block_id;
	char		name[128];
	radeon_rreg_t	rreg;
	radeon_wreg_t	wreg;
};

/* R100 */
u32 r100_MMIO_rreg(struct radeon *radeon, u32 offset);
void r100_MMIO_wreg(struct radeon *radeon, u32 offset, u32 value);
u32 r100_CLK_rreg(struct radeon *radeon, u32 offset);
void r100_CLK_wreg(struct radeon *radeon, u32 offset, u32 value);
extern struct reg_block r100_block[];
extern struct reg r100_reg[];
extern unsigned r100_nblock;
extern unsigned r100_nreg;

/* RS600 */
u32 rs600_MMIO_rreg(struct radeon *radeon, u32 offset);
void rs600_MMIO_wreg(struct radeon *radeon, u32 offset, u32 value);
u32 rs600_MC_rreg(struct radeon *radeon, u32 offset);
void rs600_MC_wreg(struct radeon *radeon, u32 offset, u32 value);
extern struct reg_block rs600_block[];
extern struct reg rs600_reg[];
extern unsigned rs600_nblock;
extern unsigned rs600_nreg;

#endif