aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2010-10-03 02:52:36 (GMT)
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-10-03 02:52:36 (GMT)
commita1f0bde47d0f0e7c95e2a4dea908277556da162e (patch)
tree14b30307f111f62af6053c23b4a82dabbdde2dcd
parentc2c011b50f9a228a5388c228da37745f5d149d3f (diff)
contrib/saa7134: adds a parser for saa7134 logs
Adds a parser to get saa7134 logs generated by PCI traffic patches, at contrib/pci_traffic, like: 1286074716 slow_bar_writel: slow_bar_writel addr=0x0000000000000104 val=0x00009090 1286074716 slow_bar_writel: slow_bar_writel addr=0x0000000000000108 val=0x44804098 1286074716 slow_bar_writel: slow_bar_writel addr=0x000000000000010c val=0x2a810040 1286074716 slow_bar_writel: slow_bar_writel addr=0x0000000000000110 val=0x00000006 Converting them into something more easy to read, like: saa_writel(SAA7134_ANALOG_IN_CTRL3, 0x9090); saa_writel(SAA7134_SYNC_CTRL, 0x44804098); saa_writel(SAA7134_DEC_CHROMA_SATURATION, 0x2a810040); saa_writel(SAA7134_CHROMA_CTRL2, 0x0006); Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rwxr-xr-xcontrib/saa7134/parse_saa7134.pl153
1 files changed, 153 insertions, 0 deletions
diff --git a/contrib/saa7134/parse_saa7134.pl b/contrib/saa7134/parse_saa7134.pl
new file mode 100755
index 0000000..a4695a0
--- /dev/null
+++ b/contrib/saa7134/parse_saa7134.pl
@@ -0,0 +1,153 @@
+#!/usr/bin/perl
+
+# Copyright (C) 2008 Mauro Carvalho Chehab <mchehab@redhat.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+
+use strict;
+
+my %reg_map = (
+ 0x101 => "SAA7134_INCR_DELAY",
+ 0x102 => "SAA7134_ANALOG_IN_CTRL1",
+ 0x103 => "SAA7134_ANALOG_IN_CTRL2",
+ 0x104 => "SAA7134_ANALOG_IN_CTRL3",
+ 0x105 => "SAA7134_ANALOG_IN_CTRL4",
+ 0x106 => "SAA7134_HSYNC_START",
+ 0x107 => "SAA7134_HSYNC_STOP",
+ 0x108 => "SAA7134_SYNC_CTRL",
+ 0x109 => "SAA7134_LUMA_CTRL",
+ 0x10a => "SAA7134_DEC_LUMA_BRIGHT",
+ 0x10b => "SAA7134_DEC_LUMA_CONTRAST",
+ 0x10c => "SAA7134_DEC_CHROMA_SATURATION",
+ 0x10d => "SAA7134_DEC_CHROMA_HUE",
+ 0x10e => "SAA7134_CHROMA_CTRL1",
+ 0x10f => "SAA7134_CHROMA_GAIN",
+ 0x110 => "SAA7134_CHROMA_CTRL2",
+ 0x111 => "SAA7134_MODE_DELAY_CTRL",
+ 0x114 => "SAA7134_ANALOG_ADC",
+ 0x115 => "SAA7134_VGATE_START",
+ 0x116 => "SAA7134_VGATE_STOP",
+ 0x117 => "SAA7134_MISC_VGATE_MSB",
+ 0x118 => "SAA7134_RAW_DATA_GAIN",
+ 0x119 => "SAA7134_RAW_DATA_OFFSET",
+ 0x11e => "SAA7134_STATUS_VIDEO1",
+ 0x11f => "SAA7134_STATUS_VIDEO2",
+ 0x300 => "SAA7134_OFMT_VIDEO_A",
+ 0x301 => "SAA7134_OFMT_DATA_A",
+ 0x302 => "SAA7134_OFMT_VIDEO_B",
+ 0x303 => "SAA7134_OFMT_DATA_B",
+ 0x304 => "SAA7134_ALPHA_NOCLIP",
+ 0x305 => "SAA7134_ALPHA_CLIP",
+ 0x308 => "SAA7134_UV_PIXEL",
+ 0x309 => "SAA7134_CLIP_RED",
+ 0x30a => "SAA7134_CLIP_GREEN",
+ 0x30b => "SAA7134_CLIP_BLUE",
+ 0x180 => "SAA7134_I2C_ATTR_STATUS",
+ 0x181 => "SAA7134_I2C_DATA",
+ 0x182 => "SAA7134_I2C_CLOCK_SELECT",
+ 0x183 => "SAA7134_I2C_TIMER",
+ 0x140 => "SAA7134_NICAM_ADD_DATA1",
+ 0x141 => "SAA7134_NICAM_ADD_DATA2",
+ 0x142 => "SAA7134_NICAM_STATUS",
+ 0x143 => "SAA7134_AUDIO_STATUS",
+ 0x144 => "SAA7134_NICAM_ERROR_COUNT",
+ 0x145 => "SAA7134_IDENT_SIF",
+ 0x146 => "SAA7134_LEVEL_READOUT1",
+ 0x147 => "SAA7134_LEVEL_READOUT2",
+ 0x148 => "SAA7134_NICAM_ERROR_LOW",
+ 0x149 => "SAA7134_NICAM_ERROR_HIGH",
+ 0x14a => "SAA7134_DCXO_IDENT_CTRL",
+ 0x14b => "SAA7134_DEMODULATOR",
+ 0x14c => "SAA7134_AGC_GAIN_SELECT",
+ 0x150 => "SAA7134_CARRIER1_FREQ0",
+ 0x151 => "SAA7134_CARRIER1_FREQ1",
+ 0x152 => "SAA7134_CARRIER1_FREQ2",
+ 0x154 => "SAA7134_CARRIER2_FREQ0",
+ 0x155 => "SAA7134_CARRIER2_FREQ1",
+ 0x156 => "SAA7134_CARRIER2_FREQ2",
+ 0x158 => "SAA7134_NUM_SAMPLES0",
+ 0x159 => "SAA7134_NUM_SAMPLES1",
+ 0x15a => "SAA7134_NUM_SAMPLES2",
+ 0x15b => "SAA7134_AUDIO_FORMAT_CTRL",
+ 0x160 => "SAA7134_MONITOR_SELECT",
+ 0x161 => "SAA7134_FM_DEEMPHASIS",
+ 0x162 => "SAA7134_FM_DEMATRIX",
+ 0x163 => "SAA7134_CHANNEL1_LEVEL",
+ 0x164 => "SAA7134_CHANNEL2_LEVEL",
+ 0x165 => "SAA7134_NICAM_CONFIG",
+ 0x166 => "SAA7134_NICAM_LEVEL_ADJUST",
+ 0x167 => "SAA7134_STEREO_DAC_OUTPUT_SELECT",
+ 0x168 => "SAA7134_I2S_OUTPUT_FORMAT",
+ 0x169 => "SAA7134_I2S_OUTPUT_SELECT",
+ 0x16a => "SAA7134_I2S_OUTPUT_LEVEL",
+ 0x16b => "SAA7134_DSP_OUTPUT_SELECT",
+ 0x16c => "SAA7134_AUDIO_MUTE_CTRL",
+ 0x16d => "SAA7134_SIF_SAMPLE_FREQ",
+ 0x16e => "SAA7134_ANALOG_IO_SELECT",
+ 0x170 => "SAA7134_AUDIO_CLOCK0",
+ 0x171 => "SAA7134_AUDIO_CLOCK1",
+ 0x172 => "SAA7134_AUDIO_CLOCK2",
+ 0x173 => "SAA7134_AUDIO_PLL_CTRL",
+ 0x174 => "SAA7134_AUDIO_CLOCKS_PER_FIELD0",
+ 0x175 => "SAA7134_AUDIO_CLOCKS_PER_FIELD1",
+ 0x176 => "SAA7134_AUDIO_CLOCKS_PER_FIELD2",
+ 0x190 => "SAA7134_VIDEO_PORT_CTRL0",
+ 0x191 => "SAA7134_VIDEO_PORT_CTRL1",
+ 0x192 => "SAA7134_VIDEO_PORT_CTRL2",
+ 0x193 => "SAA7134_VIDEO_PORT_CTRL3",
+ 0x194 => "SAA7134_VIDEO_PORT_CTRL4",
+ 0x195 => "SAA7134_VIDEO_PORT_CTRL5",
+ 0x196 => "SAA7134_VIDEO_PORT_CTRL6",
+ 0x197 => "SAA7134_VIDEO_PORT_CTRL7",
+ 0x198 => "SAA7134_VIDEO_PORT_CTRL8",
+ 0x1a0 => "SAA7134_TS_PARALLEL",
+ 0x1a1 => "SAA7134_TS_PARALLEL_SERIAL",
+ 0x1a2 => "SAA7134_TS_SERIAL0",
+ 0x1a3 => "SAA7134_TS_SERIAL1",
+ 0x1a4 => "SAA7134_TS_DMA0",
+ 0x1a5 => "SAA7134_TS_DMA1",
+ 0x1a6 => "SAA7134_TS_DMA2",
+ 0x1B0 => "SAA7134_GPIO_GPMODE0",
+ 0x1B1 => "SAA7134_GPIO_GPMODE1",
+ 0x1B2 => "SAA7134_GPIO_GPMODE2",
+ 0x1B3 => "SAA7134_GPIO_GPMODE3",
+ 0x1B4 => "SAA7134_GPIO_GPSTATUS0",
+ 0x1B5 => "SAA7134_GPIO_GPSTATUS1",
+ 0x1B6 => "SAA7134_GPIO_GPSTATUS2",
+ 0x1B7 => "SAA7134_GPIO_GPSTATUS3",
+ 0x1c0 => "SAA7134_I2S_AUDIO_OUTPUT",
+ 0x1d0 => "SAA7134_SPECIAL_MODE",
+ 0x1d1 => "SAA7134_PRODUCTION_TEST_MODE",
+ 0x580 => "SAA7135_DSP_RWSTATE",
+ 0x586 => "SAA7135_DSP_RWCLEAR",
+ 0x591 => "SAA7133_I2S_AUDIO_CONTROL",
+);
+
+while (<>) {
+ # 1286074716 slow_bar_read.: slow_bar_readl addr=0x0000000000000180 val=0x00008182
+ if (m/^(\d+)\s+slow_bar_(read|write)(.).*addr=([^\s]+)\s+val=([^\s]+)/) {
+ my $time = $1;
+ my $optype = $2;
+ my $op = "$2$3";
+ my $reg = hex($4);
+ my $val = hex($5);
+ if (defined($reg_map{$reg})) {
+ $reg = $reg_map{$reg};
+ } else {
+ $reg = sprintf("0x%04x", $reg);
+ }
+ if ($optype eq "read") {
+ printf ("reg = saa_%s(%s); /* read 0x%04x */\n", $op, $reg, $val);
+ } else {
+ printf ("saa_%s(%s, 0x%04x);\n", $op, $reg, $val);
+ }
+ }
+}

Privacy Policy