From: Matthias Schwarzott <zzam@gentoo.org>
To: Antti Palosaari <crope@iki.fi>,
m.chehab@samsung.com, linux-media@vger.kernel.org
Subject: Re: [PATCH 1/8] get_dvb_firmware: Add firmware extractor for si2165
Date: Wed, 23 Jul 2014 21:03:14 +0200 [thread overview]
Message-ID: <53D006F2.10300@gentoo.org> (raw)
In-Reply-To: <53CF7E6D.20406@iki.fi>
On 23.07.2014 11:20, Antti Palosaari wrote:
> Moikka Matthias
>
Moikka Antti,
> On 07/22/2014 11:12 PM, Matthias Schwarzott wrote:
>> +
>> + my $CRC="\x0A\xCC";
>> + my $BLOCKS_MAIN="\x27";
>> + open FW,">$fwfile";
>> + print FW "\x01\x00"; # just a version id for the driver itself
>> + print FW "\x9A"; # fw version
>> + print FW "\x00"; # padding
>> + print FW "$BLOCKS_MAIN"; # number of blocks of main part
>> + print FW "\x00"; # padding
>> + print FW "$CRC"; # 16bit crc value of main part
>> + appendfile(FW,"$tmpdir/fw1");
>
> I have to say I little bit dislike that kind of own headers. There is no
> way to read firmware version from binary itself (very often there is)?
> Whats is benefit of telling how many blocks there is? Isn't it possible
> to detect somehow by examining firmware image itself runtime?
>
> Anyhow, you are the author of that driver and even I don't personally
> like those, I think it is up to your decision as a author.
>
I thought a bit about the need for the header.
And yes, some fields I can get rid of.
firmware version:
I guess that the exact version number is not really needed - it is just
written to a seperate register - and later only read to check if
firmware was already downloaded (but for documentation it might be
interesting). I have no clue where it could be in the raw block - it
looks like it is writing to just some memory addresses.
But for the pure process it would also work to write a random number !=
0x00.
For $BLOCKS_MAIN:
The firmware is downloaded like this:
* write 1 block
* reset crc logic
* write $BLOCKS_MAIN
* read out crc and compare against $CRC in header
* write last 5 blocks
so the number of blocks in $BLOCKS_MAIN could be checked by iterating
over all blocks counting them and then substracting 6.
The crc value:
It protects the content of the file until it is in the demod - so
calculating it on my own would only check if the data is correctly
transferred from the driver into the chip.
But for this I needed to know the algorithm and which data is
checksummed exactly.
Are the different algorithms for CRC values that give 16 bit of output?
Matthias
next prev parent reply other threads:[~2014-07-23 19:03 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-22 20:12 [PATCH 0/8] add si2165 demod driver Matthias Schwarzott
2014-07-22 20:12 ` [PATCH 1/8] get_dvb_firmware: Add firmware extractor for si2165 Matthias Schwarzott
2014-07-23 9:20 ` Antti Palosaari
2014-07-23 19:03 ` Matthias Schwarzott [this message]
2014-07-23 20:10 ` Antonio Ospite
2014-07-29 5:37 ` Matthias Schwarzott
2014-07-29 8:53 ` Antonio Ospite
2014-07-29 11:34 ` Antti Palosaari
2014-07-29 19:22 ` Matthias Schwarzott
2014-07-29 19:45 ` Antti Palosaari
2014-07-30 18:50 ` Matthias Schwarzott
2014-07-30 19:29 ` Antti Palosaari
2014-07-22 20:12 ` [PATCH 2/8] si2165: Add demod driver for DVB-T only Matthias Schwarzott
2014-07-22 20:12 ` [PATCH 3/8] cx23885: Add si2165 support for HVR-5500 Matthias Schwarzott
2014-07-22 20:12 ` [PATCH 4/8] cx231xx: prepare for i2c_client attachment Matthias Schwarzott
2014-07-22 20:12 ` [PATCH 5/8] cx231xx: Add digital support for [2040:b130] Hauppauge WinTV 930C-HD (model 1113xx) Matthias Schwarzott
2014-07-22 20:12 ` [PATCH 6/8] cx231xx: Add digital support for [2040:b131] Hauppauge WinTV 930C-HD (model 1114xx) Matthias Schwarzott
2014-07-26 19:27 ` Mauro Carvalho Chehab
2014-07-27 9:32 ` Matthias Schwarzott
2014-07-27 13:44 ` Mauro Carvalho Chehab
2014-07-27 14:32 ` Mauro Carvalho Chehab
2014-07-27 14:59 ` Mauro Carvalho Chehab
2014-07-27 19:42 ` Mauro Carvalho Chehab
2014-07-29 5:39 ` Matthias Schwarzott
2014-07-22 20:12 ` [PATCH 7/8] cx231xx: Add [2013:0259] PCTV QuatroStick 521e Matthias Schwarzott
2014-07-22 20:12 ` [PATCH 8/8] cx231xx: Add [2013:025e] PCTV QuatroStick 522e Matthias Schwarzott
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53D006F2.10300@gentoo.org \
--to=zzam@gentoo.org \
--cc=crope@iki.fi \
--cc=linux-media@vger.kernel.org \
--cc=m.chehab@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.