Re: [patch 0/5] Hotplug firmware loader for Keyspan usb-serial driver

From: Jan Harkes
Date: Tue Apr 05 2005 - 16:40:22 EST


On Tue, Apr 05, 2005 at 10:45:30PM +0200, Kay Sievers wrote:
> On Tue, 2005-04-05 at 15:38 -0400, Jan Harkes wrote:
> > Here is another stab at making the keyspan firmware easily loadable with
> > hotplug. Differences from the previous version,
> >
> > - keep the IHEX parser into a separate module.
> > - added a fw-y and fw-m install targets to kbuild which will install a
> > driver's firmware files in /lib/modules/`uname -r`/firmware.
> >
> > 01 - Add lib/ihex_parser.ko.
>
> Oh, I just see now that it's a EZ-USB device. Did you try adapting the
> driver to use fxload(8)? to load the firmware. I have a USB-Modem that
> works perfect with loading ez-firmware that way.

Never heard of fxload before. I just tried it by moving the firmware
directory out of the way so that hotplug wouldn't try to initialize the
device behind my back.

# fxload -v -t fx -D /proc/bus/usb/002/011 -I keyspan-usa19qi.fw
microcontroller type: fx
single stage: load on-chip memory
open RAM hexfile image keyspan-usa19qi.fw
stop CPU
write on-chip, addr 0x0033 len 3 (0x0003)
write on-chip, addr 0x001a len 4 (0x0004)
write on-chip, addr 0x0003 len 23 (0x0017)
write on-chip, addr 0x0023 len 3 (0x0003)
write on-chip, addr 0x0046 len 192 (0x00c0)
write on-chip, addr 0x0043 len 3 (0x0003)
write on-chip, addr 0x0000 len 3 (0x0003)
write on-chip, addr 0x0026 len 12 (0x000c)
write on-chip, addr 0x0106 len 960 (0x03c0)
write on-chip, addr 0x04c6 len 960 (0x03c0)
write on-chip, addr 0x0886 len 960 (0x03c0)
write on-chip, addr 0x0c46 len 905 (0x0389)
... WROTE: 4028 bytes, 12 segments, avg 335
reset CPU

# dmesg | tail
keyspan 2-1:1.0: device disconnected
usb 2-1: new full speed USB device using uhci_hcd and address 11
keyspan 2-1:1.0: Keyspan - (without firmware) converter detected
usb 2-1: Required firmware image (keyspan-usa19qi.fw) unavailable.
>>> fxload was used at this point
usb 2-1: USB disconnect, address 11
keyspan 2-1:1.0: device disconnected
usb 2-1: new full speed USB device using uhci_hcd and address 12
usb 2-1: configuration #1 chosen from 2 choices
keyspan 2-1:1.0: Keyspan 1 port adapter converter detected
usb 2-1: Keyspan 1 port adapter converter now attached to ttyUSB0

Looks like it works, so I guess the pre-numeration stuff in the driver
is really not necessary. We just need a bunch of hotplug rules to load
the correct firmware whenever an uninitialized device is plugged in and
some way to distribute the firmware images.

Jan

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/