Difference between revisions of "ULi M920x firmware"

From LinuxTVWiki
Jump to navigation Jump to search
(New page: You can get it either with usbsnoop or snoopypro under Windows. See http://www.linuxtv.org/pipermail/linux-dvb/2006-November/014682.html if you want to use usbmon with vmware player. Firm...)
 
m (Added category: Chipsets, Drivers)
 
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
  +
You can obtain an [[ULi M920x|M920x]] [[firmware]] in a two step process by, first, running your device natively under Windows and using either [[usbsnoop]] or [[usbsnoop|SnoopyPro]], or, alternatively, under Linux using a combination of [[usbmon]] and vmware player running a Windows client (described further in [http://www.linuxtv.org/pipermail/linux-dvb/2006-November/014682.html this thread]). The second step involves parsing the actual firmware code out of the data captured in the first step of the process (this is necessary regardless of which of the particular methods listed above was used).
You can get it either with usbsnoop or snoopypro under Windows.
 
See http://www.linuxtv.org/pipermail/linux-dvb/2006-November/014682.html if you want to use usbmon with vmware player.
 
   
  +
==Introduction==
Firmware will be sent as soon as you plug in the device, so you should
 
  +
Under a Windows environment, as soon as you plug your [[ULi M920x|M920x]] based device into an USB port, the M920x [[firmware]] will be sent, so you should not be trying to have any other program be starting at the same time in the background. In addition, during Windows driver installation, those device's that shipped with a remote controller might have setup a background process, called Uremote.exe (or similar). If you find such an installed program running, please shut it down so that it doesn't cause traffic in the logs.
not start any programs. Sticks with remote controller might have
 
program called Uremote.exe (or similar) running. If you do, please shut
 
it down so that it doesn't cause traffic in logs.
 
   
m920x firmware consists of a number of 64 byte long usb control
+
[[ULi M920x|M920x]] firmware consists of a number of 64 byte long USB control messages. After these control messages you will see another control message with request, value, index of M9206_CORE(0x22), 0x01, M9206_FW_GO(0xff69), respectively.
messages. After these control messages you will see another control
 
message with request, value, index of M9206_CORE(0x22), 0x01,
 
M9206_FW_GO(0xff69), respectively.
 
   
  +
After the USB device receives this message, it will disconnect itself from the bus and appear again with (possibly) different idVendor and idProduct. These new ids are known as warm ids. At very least you will see your device having new endpoints that will be used to transmit data.
After usb device receives this message,
 
it will disconnect itself from the bus and appear again with
 
(possibly) different idVendor and idProduct. These new ids are known
 
as warm ids. At very least you will see your device having new endpoints
 
that will be used to transmit data.
 
   
It's important to have Usbsnoop or Snoopypro installed and logging
+
It's important to have Usbsnoop or Snoopypro installed and logging before you plug in the device. It might take several attempts to get a dump of the initial bus traffic where this firmware is visible.
before you plug in the device. It might take several attempts to get a
 
dump where this firmware is visible.
 
   
After acquiring a log with firmware, you will
+
After acquiring a log with firmware, you will need to process it with various tools.
need to process it with various tools.
 
   
  +
== usbsnoop ==
   
  +
First with parser.pl and then with [[ULi M920x parse|M920x parse]]
Usbsnoop
 
First with parser.pl and then with m920x_parse
 
 
(arguments -i us -m fw)
 
(arguments -i us -m fw)
   
  +
== SnoopyPro ==
Usbmon
 
m920x_parse (arguments -i um -m fw)
 
   
  +
[[ULi M920x sp firmware|M920x sp firmware]] can only read data in this format:
Snoopypro
 
m920x_sp_firmware can only read data in this format:
 
 
http://www.roback.cc/projects/iRiver/howto/snoopypro/wordpad_saved.png
 
http://www.roback.cc/projects/iRiver/howto/snoopypro/wordpad_saved.png
  +
  +
== usbmon ==
  +
  +
Recompile your kernel with CONFIG_USB_DEVICEFS, CONFIG_USB_MON and CONFIG_DEBUG_FS selected in your kernel config. Then patch linux/drivers/usb/mon/mon_text.c with http://www.rasterburn.org/~aet/m920x/usbmon_ext.diff. Finally make sure that CONFIG_USB_EHCI_HCD is set to m and not y. After rebooting your new kernel, install vmware player and get everything ready on that front. See http://software.newsforge.com/article.pl?sid=06/05/16/1940214 for more details on this.
  +
  +
You will probably need these: (look up with google if interested)
  +
<pre><nowiki>
  +
# remove usb 2.0 support. vmware might freak out your computer otherwise
  +
rmmod ehci_hcd
  +
mount -t debugfs none_debugs /sys/kernel/debug
  +
modprobe usbmon
  +
mount -t usbfs none /proc/bus/usb
  +
# needed by vmware
  +
chmod -R a+rw /proc/bus/usb (needed by vmware. security!!)
  +
</nowiki></pre>
  +
  +
You need to replug your device after removing ehci_hcd module so your device sees the change. Look at /proc/bus/usb/devices to find in which bus you device is in.
  +
cat /sys/kernel/debug/usbmon/<b>n</b>t to a file (n is the bus number).
  +
Finally pass this file to [[ULi M920x parse|M920x parse]] (arguments -i um -m fw)
  +
  +
== Useful scripts ==
  +
* [[ULi M920x parse]]
  +
* [[ULi M920x sp firmware]]
  +
* [[Usbmon2usbsnoop]]
  +
[[Category:Chipsets]]
  +
[[Category:Drivers]]

Latest revision as of 19:31, 4 May 2009

You can obtain an M920x firmware in a two step process by, first, running your device natively under Windows and using either usbsnoop or SnoopyPro, or, alternatively, under Linux using a combination of usbmon and vmware player running a Windows client (described further in this thread). The second step involves parsing the actual firmware code out of the data captured in the first step of the process (this is necessary regardless of which of the particular methods listed above was used).

Introduction

Under a Windows environment, as soon as you plug your M920x based device into an USB port, the M920x firmware will be sent, so you should not be trying to have any other program be starting at the same time in the background. In addition, during Windows driver installation, those device's that shipped with a remote controller might have setup a background process, called Uremote.exe (or similar). If you find such an installed program running, please shut it down so that it doesn't cause traffic in the logs.

M920x firmware consists of a number of 64 byte long USB control messages. After these control messages you will see another control message with request, value, index of M9206_CORE(0x22), 0x01, M9206_FW_GO(0xff69), respectively.

After the USB device receives this message, it will disconnect itself from the bus and appear again with (possibly) different idVendor and idProduct. These new ids are known as warm ids. At very least you will see your device having new endpoints that will be used to transmit data.

It's important to have Usbsnoop or Snoopypro installed and logging before you plug in the device. It might take several attempts to get a dump of the initial bus traffic where this firmware is visible.

After acquiring a log with firmware, you will need to process it with various tools.

usbsnoop

First with parser.pl and then with M920x parse (arguments -i us -m fw)

SnoopyPro

M920x sp firmware can only read data in this format: http://www.roback.cc/projects/iRiver/howto/snoopypro/wordpad_saved.png

usbmon

Recompile your kernel with CONFIG_USB_DEVICEFS, CONFIG_USB_MON and CONFIG_DEBUG_FS selected in your kernel config. Then patch linux/drivers/usb/mon/mon_text.c with http://www.rasterburn.org/~aet/m920x/usbmon_ext.diff. Finally make sure that CONFIG_USB_EHCI_HCD is set to m and not y. After rebooting your new kernel, install vmware player and get everything ready on that front. See http://software.newsforge.com/article.pl?sid=06/05/16/1940214 for more details on this.

You will probably need these: (look up with google if interested)

# remove usb 2.0 support. vmware might freak out your computer otherwise
rmmod ehci_hcd
mount -t debugfs none_debugs /sys/kernel/debug
modprobe usbmon
mount -t usbfs none /proc/bus/usb
# needed by vmware
chmod -R a+rw /proc/bus/usb (needed by vmware. security!!)

You need to replug your device after removing ehci_hcd module so your device sees the change. Look at /proc/bus/usb/devices to find in which bus you device is in. cat /sys/kernel/debug/usbmon/nt to a file (n is the bus number). Finally pass this file to M920x parse (arguments -i um -m fw)

Useful scripts