Chris: Sorry for sending this directly to you as well as the list, but the ML appears to be "laggy" to me. I sometimes don't see responses for hours or days, then they come in out of order.

You all probably have your own version of this, but...

It takes (on stdin) the i2c dump from a session, and outputs:
The sequence of writes / reads, in a human-readable form (Anything it doesn't understand, it passes through)
All of the cx25840 registers final states, which were modified during that session.


This is better than the "raw" output, since it (hopefully) understands the auto-increment writes, which can hide some interesting changes.

Please note - It *only* dumps changed registers. If something doesn't get changed, there is no easy way for me to get the 'default' value. I also don't parse reads to add these to the register map. If anyone cares, they can implement this.

The "best" way to use it is probably using the i2c dumps I provided to Chris, like this:

cat boot.log startwintv2k.log ch2wintv2k.log |trans.pl

Is it possible to put these logs on the ivtv site, or are there legal issues with logs generated this way?

Any bugs, please feedback - I know I haven't got it perfect, but it's good enough that it's better than raw.

Cheers,

Allan.
use strict;
my $deltatime;
my $deltatimeunits;
my $unit;
my $operation="unknown";
my $addresshigh;
my $addresslow;
my $address;
my $data;
my $handled=0;
my $remaining;
my @remaining;
my %cx25840registers;
while (<>) {
   
   $handled=0;
   if ($operation eq "Read") {
      if (/^\W*([\d.]*)([um]S): ([\dABCDEF]*) r (.*)/) {
         ($remaining,undef)=split("  ",$4);
         printf "Read unit 0x%x address 0x%x - Result 
$remaining\n",$unit,$address;
         $handled=1;
      }
      $operation="unknown";
   }
   if (/^\W*([\d.]*)([um]S): ([\dABCDEF]*) ([Wr]) (.*)/ and $handled==0) {
      $deltatime=$1;
      $deltatimeunits=$2;
      $unit=hex($3);
      $operation=$4;
      if (defined $5) {
         ($remaining,undef)=split("  ",$5);
         @remaining=split(" ",$remaining);
         if ($operation eq "W" and @remaining==2) {
            ($addresshigh,$addresslow)[EMAIL PROTECTED];
            $address=(hex($addresshigh)<<8)+hex($addresslow);
            $operation="Read";
            $handled=1;
         } elsif ($operation eq "W" and @remaining==3) {
            ($addresshigh,$addresslow,$data)[EMAIL PROTECTED];
            $address=(hex($addresshigh)<<8)+hex($addresslow);
            $data=hex($data);
            printf "Write unit 0x%x address 0x%x - Value 
0x%x\n",$unit,$address,$data;
            if ($unit==hex("0x44")) {
               $cx25840registers{$address}=$data;
            }
            $handled=1;
         } elsif ($operation eq "W" and @remaining >3) {
            ($addresshigh,$addresslow,@remaining)[EMAIL PROTECTED];
            $address=(hex($addresshigh)<<8)+hex($addresslow);
            if ($address!=hex("0x802")) {
               foreach $data (@remaining) {
                  $data=hex($data);
                  printf "Write unit (combined) 0x%x address 0x%x - Value 
0x%x\n",$unit,$address,$data;
                  $cx25840registers{$address}=$data;
                  $address++;
               }
            } else {
               print "<audio firmware upload>\n"
            }
            $handled=1;
         }
      }
   }
   if ($handled==0) {
      print $_;
   } else {
     # print "HANDLED: $_\n";
   }
}; 
foreach $address (sort {$a <=> $b} (keys (%cx25840registers))) {
   printf "Address: 0x%x Value: 0x%02x 
%08b\n",$address,$cx25840registers{$address},$cx25840registers{$address};
}

Reply via email to