aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/dvb/get_dvb_firmware
diff options
context:
space:
mode:
authorMarco Gittler <g.marco@freenet.de>2007-07-04 18:18:34 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-07-18 13:24:41 -0400
commit59800555f79a52394c3c29e19e448b4635daf14c (patch)
treea6540f53684f2939bc89b26f2d72770a09d5c53e /Documentation/dvb/get_dvb_firmware
parentb31c33bd8b339e426138dd267ec969291f802a0d (diff)
V4L/DVB (5829): Firmware extract and loading for opera dvb-usb update
Better way of creating and loading the firmware used. Update for get_dvb_firmware script to extract the files for opera usb-box Help file for creating the firmware added Signed-off-by: Marco Gittler <g.marco@freenet.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'Documentation/dvb/get_dvb_firmware')
-rw-r--r--Documentation/dvb/get_dvb_firmware61
1 files changed, 60 insertions, 1 deletions
diff --git a/Documentation/dvb/get_dvb_firmware b/Documentation/dvb/get_dvb_firmware
index e32f79e05c85..b4d306ae9234 100644
--- a/Documentation/dvb/get_dvb_firmware
+++ b/Documentation/dvb/get_dvb_firmware
@@ -24,7 +24,8 @@ use IO::Handle;
24@components = ( "sp8870", "sp887x", "tda10045", "tda10046", 24@components = ( "sp8870", "sp887x", "tda10045", "tda10046",
25 "tda10046lifeview", "av7110", "dec2000t", "dec2540t", 25 "tda10046lifeview", "av7110", "dec2000t", "dec2540t",
26 "dec3000s", "vp7041", "dibusb", "nxt2002", "nxt2004", 26 "dec3000s", "vp7041", "dibusb", "nxt2002", "nxt2004",
27 "or51211", "or51132_qam", "or51132_vsb", "bluebird"); 27 "or51211", "or51132_qam", "or51132_vsb", "bluebird",
28 "opera1");
28 29
29# Check args 30# Check args
30syntax() if (scalar(@ARGV) != 1); 31syntax() if (scalar(@ARGV) != 1);
@@ -210,6 +211,45 @@ sub dec3000s {
210 211
211 $outfile; 212 $outfile;
212} 213}
214sub opera1{
215 my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 0);
216
217 checkstandard();
218 my $fwfile1="dvb-usb-opera1-fpga-01.fw";
219 my $fwfile2="dvb-usb-opera-01.fw";
220 extract("2830SCap2.sys", 0x62e8, 55024, "$tmpdir/opera1-fpga.fw");
221 extract("2830SLoad2.sys",0x3178,0x3685-0x3178,"$tmpdir/fw1part1");
222 extract("2830SLoad2.sys",0x0980,0x3150-0x0980,"$tmpdir/fw1part2");
223 delzero("$tmpdir/fw1part1","$tmpdir/fw1part1-1");
224 delzero("$tmpdir/fw1part2","$tmpdir/fw1part2-1");
225 verify("$tmpdir/fw1part1-1","5e0909858fdf0b5b09ad48b9fe622e70");
226 verify("$tmpdir/fw1part2-1","d6e146f321427e931df2c6fcadac37a1");
227 verify("$tmpdir/opera1-fpga.fw","0f8133f5e9051f5f3c1928f7e5a1b07d");
228
229 my $RES1="\x01\x92\x7f\x00\x01\x00";
230 my $RES0="\x01\x92\x7f\x00\x00\x00";
231 my $DAT1="\x01\x00\xe6\x00\x01\x00";
232 my $DAT0="\x01\x00\xe6\x00\x00\x00";
233 open FW,">$tmpdir/opera.fw";
234 print FW "$RES1";
235 print FW "$DAT1";
236 print FW "$RES1";
237 print FW "$DAT1";
238 appendfile(FW,"$tmpdir/fw1part1-1");
239 print FW "$RES0";
240 print FW "$DAT0";
241 print FW "$RES1";
242 print FW "$DAT1";
243 appendfile(FW,"$tmpdir/fw1part2-1");
244 print FW "$RES1";
245 print FW "$DAT1";
246 print FW "$RES0";
247 print FW "$DAT0";
248 copy ("$tmpdir/opera1-fpga.fw",$fwfile1);
249 copy ("$tmpdir/opera.fw",$fwfile2);
250
251 $fwfile1.",".$fwfile2;
252}
213 253
214sub vp7041 { 254sub vp7041 {
215 my $sourcefile = "2.422.zip"; 255 my $sourcefile = "2.422.zip";
@@ -440,6 +480,25 @@ sub appendfile {
440 close(INFILE); 480 close(INFILE);
441} 481}
442 482
483sub delzero{
484 my ($infile,$outfile) =@_;
485
486 open INFILE,"<$infile";
487 open OUTFILE,">$outfile";
488 while (1){
489 $rcount=sysread(INFILE,$buf,22);
490 $len=ord(substr($buf,0,1));
491 print OUTFILE substr($buf,0,1);
492 print OUTFILE substr($buf,2,$len+3);
493 last if ($rcount<1);
494 printf OUTFILE "%c",0;
495#print $len." ".length($buf)."\n";
496
497 }
498 close(INFILE);
499 close(OUTFILE);
500}
501
443sub syntax() { 502sub syntax() {
444 print STDERR "syntax: get_dvb_firmware <component>\n"; 503 print STDERR "syntax: get_dvb_firmware <component>\n";
445 print STDERR "Supported components:\n"; 504 print STDERR "Supported components:\n";