diff options
author | Dave Airlie <airlied@redhat.com> | 2009-11-20 13:54:38 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-11-20 13:55:20 +1000 |
commit | e83ba2a6ee759ac1b3959a23c95959b0060c624e (patch) | |
tree | 55069e10614bf4b9413e616782ff09d6fa3a191e | |
parent | 8aee6532d0652062ea228dac8190a7311a998eae (diff) |
radeontool: add clk regs to avivotool
-rw-r--r-- | avivotool.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/avivotool.c b/avivotool.c index 6439481..d94e836 100644 --- a/avivotool.c +++ b/avivotool.c @@ -129,6 +129,20 @@ static unsigned int radeon_get_indexed(unsigned long index_offset, return radeon_get(data_offset, name); } +static unsigned int radeon_get_clk(unsigned long offset, const char *name) +{ + return radeon_get_indexed(RADEON_CLOCK_CNTL_INDEX, + RADEON_CLOCK_CNTL_DATA, + offset, name); +} + +static void radeon_set_clk(unsigned long offset, const char *name, + unsigned int value) +{ + return radeon_set_indexed(RADEON_CLOCK_CNTL_INDEX, RADEON_CLOCK_CNTL_DATA, + offset | RADEON_PLL_WR_EN, name, value); +} + static unsigned int radeon_get_mc(unsigned long offset, const char *name) { return radeon_get_indexed(AVIVO_MC_INDEX, AVIVO_MC_DATA, @@ -1053,6 +1067,14 @@ void radeon_cmd_regs(const char *type) for (i = 0x5000; i < 0x7ff8; i += 4) SHOW_UNKNOWN_REG(i); + /* dump a bunch of the MC regs */ +#define SHOW_UNK_MC_REG(r) printf("%02x\t%08x\n", r, radeon_get_indexed(AVIVO_MC_INDEX, AVIVO_MC_DATA, (r | 0x007f0000), #r)) + for (i = 0; i < 0x92; i++) + SHOW_UNK_MC_REG(i); + +#define SHOW_UNK_CLK_REG(r) printf("%02x\t%08x\n", r, radeon_get_indexed(RADEON_CLOCK_CNTL_INDEX, RADEON_CLOCK_CNTL_DATA, (r), #r)) + for (i = 0; i < 0x20; i++) + SHOW_UNK_CLK_REG(i); return; } @@ -1439,6 +1461,11 @@ void radeon_reg_match(const char *pattern) value = radeon_get_mc(address, pattern); printf("%s\t0x%08x (%d)\n", pattern, value, value); } + else if (pattern[0] == 'C' && pattern[1] == 'L' && pattern[2] == ':') { + address = strtol(&(pattern[3]), NULL, 16); + value = radeon_get_clk(address, pattern); + printf("%s\t0x%08x (%d)\n", pattern, value, value); + } else if (pattern[0] == 'R' && pattern[1] == 'S' && pattern[2] == ':') { address = strtol(&(pattern[3]), NULL, 16); value = rs690_get_mc(address, pattern); @@ -1489,6 +1516,10 @@ void radeon_reg_set(const char *inname, unsigned int value) address = strtol(&(inname[3]), NULL, 16); set_reg(inname, "MC: ", address, value, radeon_get_mc, radeon_set_mc); } + else if (inname[0] == 'C' && inname[1] == 'L' && inname[2] == ':') { + address = strtol(&(inname[3]), NULL, 16); + set_reg(inname, "CL: ", address, value, radeon_get_clk, radeon_set_clk); + } else if (inname[0] == 'P' && inname[1] == 'C' && inname[2] == ':') { address = strtol(&(inname[3]), NULL, 16); set_reg(inname, "PCIE: ", address, value, radeon_get_pcie, radeon_set_pcie); |