I modified load_fw_direct() [below] so that I could read back data immediately after loading it. Of the 262144 bytes loaded for v4l-cx2341x-enc.fw, 9816 come back corrupted. For v4l-cx2341x-dec.fw, 7254 bytes come back corrupted.
The corruption is very specific. It always seems to occur in the 3rd byte of the four which are loaded at once, and the value there is decreased by 2. The corrupt bytes are not necessarily evenly spaced... ie my code outputs:
ivtv0: load_fw_direct mismatch at byte 226996 + 3 (v4l-cx2341x-dec.fw)
ivtv0: wrote: 0x062e0310
ivtv0: read: 0x042e0310
ivtv0: load_fw_direct mismatch at byte 227024 + 3 (v4l-cx2341x-dec.fw)
ivtv0: wrote: 0x0600a780
ivtv0: read: 0x0400a780
ivtv0: load_fw_direct mismatch at byte 227028 + 3 (v4l-cx2341x-dec.fw)
ivtv0: wrote: 0x36000000
ivtv0: read: 0x34000000
ivtv0: load_fw_direct mismatch at byte 227032 + 3 (v4l-cx2341x-dec.fw)
ivtv0: wrote: 0xa73c030a
ivtv0: read: 0xa53c030a
The remainder of my ivtv info looks like this...
ivtv: ==================== START INIT IVTV ====================
ivtv: version 0.6.3 (development snapshot compiled on Wed 21 Jun 2006 10:41:30 PM PDT) loading
ivtv: Linux version: 2.6.16-1.2133_FC5 SMP gcc-4.1
ivtv: In case of problems please include the debug info between
ivtv: the START INIT IVTV and END INIT IVTV lines, along with
ivtv: any module options, when mailing the ivtv-users mailinglist.
ivtv0: Autodetected Hauppauge WinTV PVR-250 card (cx23415 based)
tveeprom 3-0050: Huh, no eeprom present (err=-121)?
tveeprom 3-0050: Encountered bad packet header [8a]. Corrupt or not a Hauppauge eeprom.
ivtv0: No tuner detected, default to NTSC
ivtv0: numbad (v4l-cx2341x-enc.fw): 9816 first_bad_byte: 7 last_bad_byte: 251995
ivtv0: loaded v4l-cx2341x-enc.fw firmware (262144 bytes)
ivtv0: numbad (v4l-cx2341x-dec.fw): 7254 first_bad_byte: 7 last_bad_byte: 227131
ivtv0: loaded v4l-cx2341x-dec.fw firmware (262144 bytes)
ivtv0 warning: Encoder mailbox not found
ivtv0 warning: Decoder mailbox not found
ivtv0: Error locating firmware.
ivtv0: Error -12 on initialization
ivtv: probe of 0000:00:0a.0 failed with error -12
ivtv: ==================== END INIT IVTV ====================
This card is now in a new machine, which is AMD64... It worked well in a 32 bit machine for several years.
Any idea what could be going on?
---Kevin
Source of modified function follows
===================================================
static int load_fw_direct(const char *fn, char *mem, struct ivtv *itv, long size)
{
const struct firmware *fw = NULL;
int retval = -ENOMEM;
if (request_firmware(&fw, fn, FWDEV(itv)) == 0) {
int i;
u32 *dst = (u32 *)mem;
const u32 *src = "" u32 *)fw->data;
/* Begin KMH modification */
union {u32 lint; char bytes[4];} test_wrote, test_read;
int numbad = 0;
int j;
int first_bad_byte = -1, last_bad_byte = -1;
/* End KMH modification */
if (fw->size >= size) {
retval = size;
} else {
retval = fw->size;
}
for (i = 0; i < retval; i += 4) {
writel(*src, dst);
/* Begin KMH modification */
test_wrote.lint = *src;
test_read.lint = readl(dst);
for (j=0;j<4;j++) {
if (test_wrote.bytes[j] != test_read.bytes[j]) {
numbad++;
IVTV_INFO("load_fw_direct mismatch at byte %d + %d (%s)\n",i,j,fn);
IVTV_INFO("\t\twrote: %#.8x\n",test_wrote.lint);
IVTV_INFO("\t\t read: %#.8x\n",test_read.lint);
if (first_bad_byte == -1) first_bad_byte = i+j;
last_bad_byte = i+j;
}
}
/* End KMH modification */
dst++;
src++;
}
/* Begin KMH modification */
IVTV_INFO("numbad (%s): %d\tfirst_bad_byte: %d\tlast_bad_byte: %d\n",fn,numbad,first_bad_byte,last_bad_byte);
/* End KMH modification */
release_firmware(fw);
IVTV_INFO("loaded %s firmware (%d bytes)\n", fn, retval);
} else {
IVTV_INFO("unable to open firmware %s\n", fn);
IVTV_INFO("did you put the firmware in the hotplug firmware directory?\n");
}
return retval;
}
_______________________________________________ ivtv-devel mailing list [email protected] http://ivtvdriver.org/mailman/listinfo/ivtv-devel
