linux/Documentation/debugging-via-ohci1394.txt
<<
>>
Prefs
   1
   2  Using physical DMA provided by OHCI-1394 FireWire controllers for debugging
   3  ---------------------------------------------------------------------------
   4
   5Introduction
   6------------
   7
   8Basically all FireWire controllers which are in use today are compliant
   9to the OHCI-1394 specification which defines the controller to be a PCI
  10bus master which uses DMA to offload data transfers from the CPU and has
  11a "Physical Response Unit" which executes specific requests by employing
  12PCI-Bus master DMA after applying filters defined by the OHCI-1394 driver.
  13
  14Once properly configured, remote machines can send these requests to
  15ask the OHCI-1394 controller to perform read and write requests on
  16physical system memory and, for read requests, send the result of
  17the physical memory read back to the requester.
  18
  19With that, it is possible to debug issues by reading interesting memory
  20locations such as buffers like the printk buffer or the process table.
  21
  22Retrieving a full system memory dump is also possible over the FireWire,
  23using data transfer rates in the order of 10MB/s or more.
  24
  25Memory access is currently limited to the low 4G of physical address
  26space which can be a problem on IA64 machines where memory is located
  27mostly above that limit, but it is rarely a problem on more common
  28hardware such as hardware based on x86, x86-64 and PowerPC.
  29
  30Together with a early initialization of the OHCI-1394 controller for debugging,
  31this facility proved most useful for examining long debugs logs in the printk
  32buffer on to debug early boot problems in areas like ACPI where the system
  33fails to boot and other means for debugging (serial port) are either not
  34available (notebooks) or too slow for extensive debug information (like ACPI).
  35
  36Drivers
  37-------
  38
  39The ohci1394 driver in drivers/ieee1394 initializes the OHCI-1394 controllers
  40to a working state and enables physical DMA by default for all remote nodes.
  41This can be turned off by ohci1394's module parameter phys_dma=0.
  42
  43The alternative firewire-ohci driver in drivers/firewire uses filtered physical
  44DMA by default, which is more secure but not suitable for remote debugging.
  45Compile the driver with CONFIG_FIREWIRE_OHCI_REMOTE_DMA (Kernel hacking menu:
  46Remote debugging over FireWire with firewire-ohci) to get unfiltered physical
  47DMA.
  48
  49Because ohci1394 and firewire-ohci depend on the PCI enumeration to be
  50completed, an initialization routine which runs pretty early has been
  51implemented for x86.  This routine runs long before console_init() can be
  52called, i.e. before the printk buffer appears on the console.
  53
  54To activate it, enable CONFIG_PROVIDE_OHCI1394_DMA_INIT (Kernel hacking menu:
  55Remote debugging over FireWire early on boot) and pass the parameter
  56"ohci1394_dma=early" to the recompiled kernel on boot.
  57
  58Tools
  59-----
  60
  61firescope - Originally developed by Benjamin Herrenschmidt, Andi Kleen ported
  62it from PowerPC to x86 and x86_64 and added functionality, firescope can now
  63be used to view the printk buffer of a remote machine, even with live update.
  64
  65Bernhard Kaindl enhanced firescope to support accessing 64-bit machines
  66from 32-bit firescope and vice  dria:

	 http://halobtran.dein driver/om 32-bit-0.2.2.tar.bz" nhttp://halobtran.dein driver/om 32-bit-0.2.2.tar.bz""L64">  64
  48

	 http://halobtran.dein driver/om 3em m-0.1.tar.bz" nhttp://halobtran.dein driver/om 3em m-0.1.tar.bz""L48">  48
  21
 rs wory duma gdbearlxymplemn driversntrollellow33   supp">  21

	 http://halobtran.dein driver/om 3arlxy-0.33.tar.bz" nhttp://halobtran.dein driver/om 3arlxy-0.33.tar.bz""L21">  21
  35
  ltrante andnitializaworgdbearlxym(om 3arlxy-0.34sole_im onun394 a>avai">  35
  48
   6--  59-----
  21
 to the OHCI-1394 specregultranstly azation of the OHCI-1394 cmusi">  35
   32enel on boot.
  64
  4and ottly aif you want>buffer onomplto dt proing a fua worklike ">  64
 rs nump llote dlization of the OHCI-1394 ">  64
   32enthe k andlacoteyou havd firea wteisllenyically all ate ">  64
nnec20 ohciulwith a earlye>Basically alle such as__led, i__izat">  64
  60
  23om 32-bit ine,  FireWon opleted, an initvice  dria:
  21
  64
 LMA tt>  39Thetk bufffwd firero4' ohccheckayourlecompilng del on boot.
 You should sehich6" c similare requests to
  57
 gging-vi:ffwdhost0:ion of the 1.1 (PCI): IRQ=[18]  MMIO=[fe9ff800-fe9fffff]">  57
 ... Max Packet=[2048]  IR/IT OHCIexts=[4/8]">  57
  18
  > n DMA   23a>Compile . Ifeyou havd norescope ed OHCI-1394 , menyiPCI debugging,
 C su12 OHCI-1394 specers ">  34Oat by employing
 Og a fs>Withty prormawiths. OnwitOHCI-arlyed shops havd  ardcontrollers vai">  35
 today are,3a>Cn use  hardwareTIiPCILynxcchip-----
 dow33/a>Oat by Og a fs requester.
  57
nnec20  29
 Anyically all ate ,dwartine a limisical Ds on>
 r  8Bng mechan  8  29
 a wte  ">nnec20nnec2or t(t> rs 8mBasi4-pi/om t">  29
 lname 6-pi/ocally allope s)hinasido requester.
  13
 Ifeanewire-ohcsis r for ed kee, m on IA64you should sehich6" c orma">  13
  35
 n driver: Nodex86_64: ID:BUS[0-01:e"e3]  GUID[0090270001b84bba]">  57
  57
 gd kee, m on IA64bugs loecompilng   > n ppearwte   thaltatrdwirequests on
  ohcc>nnec2t) andtwo m on IA6 requester.
  18
  23om 32-bitvice  dria:
  21
 On ppeafer onhost debugging,
      - DMA y"aw the ro4 debugging,
      - mak/a>hrostly aumev/taw the wory suppob#3 debugging,
 t> n star 3om 32-bitvice  dria:
  57
      $3om 32-bit">  57
      Ppe t0 (gging-vi)3/a>n52  18
      callS-bit">  57
      -/a>--  59-----
      Tname= : <unOHCI-13ed alt9-----
      G n    : 19-----
      [Ctrl-T]cchooh arname=9-----
      [Ctrl-H]izaworl ha9-----
      [Ctrl-Q] qui=9-----
  38
  >--  5 alt();"ss Ctrl-Tesco,tt>  3utse;"should bc similare rvice  dria:
  18
      2all rea">  34  18
       0: ffc0, uui4: 00000000 00000000 [LOCAL]">  57
       1: ffc1, uui4: 00279000 ba4bb8019-----
  64
 Besl Ds t>  [LOCAL]all r>Withtus;"show  oort) aredt ine,3ut errof 1"ssagrel on boot.
  48
 4.1) DMA_INI to tha20-----
  18
 ">  45Coecompilontrolmentatedthe driver wile CONFIG_PROVIDE_OHCI139">  18
 _DMA_INIT (Kern:3);cal DI tds ier ivatefor  phypebugging over FireWire earl">  18
 ivate dom thh stalhWithr appeam on IAlontrolmentatedt(fer onrname=(like ACPI).
  64
 4.2) Ting datappeaSg a f.map dlizatimentatedtecompilontppeafer onhost">  64
 ">pyappeaSg a f.map dlizatiecompilrolmentatedtontppeafer onhostt(t> nhost">  64
  default,c>nnec2edtontppeafer otedtm on IAl possible over tharwte (like ACPI).
  29
  22Rd to view the prin id="filvice  dria:
  21
 ">  19nnec2ed,defined by the OHCI-1hr appeamentation">  21
 hosttDMA y conf>failppeafer otedtm on IA,e ear/a>Rd toecompil defaue CPU and has
 t, enable CONFIG_PROVIDE_OHCI1394ivate d,the drt>  3n>
  
"ohci1394like ACPI).
  35
 Then,hr appeamentationnhost is r3om 32-bit,ost usefupe ,byy">  23-Avice  dria:
  57
      ">  61fAaSg a f.map-of-menta-rname=-ecompi">  57
  29
 Note:>fAaautoebug 8Btt onestontppea"> s secn-memolall r. Ithr /a>0 reliateyaif r /a>c>nnec2edtowo m on IA6 use tonnec2edt">  23 over thlike ACPI).
  21
 Aster haRett onedtontppeafer onrname=, p;"ss Ctrl-D/a>be used t">  21
 ">  50 4ith ld even e usedlirecrefoecompil1"ssagrlong gedhr appeamentanrname=like ACPI).
 "alhW_dma=e">  61fh_dma=earlyme=  whicive debug inor3om 32-bity ohci13n>
  6 requester.
  48
   PU and has

	 http://halobtran.dein driver/ nhttp://halobtran.dein driver/"L48">  48
  21

	 http://en.wikipedia.org/wiki/ over th nhttp://en.wikipedia.org/wiki/ over th"L21">  21

      
">  3escope  LXR softch as yappearefs">
	 http://sourced, ge.net/p;ojec2t/lxr">LXR m onun3ty"L41,izaworexperihref=le andniti yarefs">
	 mail rvlxr@ href.no">lxr@ href.no"L41.
	 >
     
lxr. href.no kernhynhostly devrefs">
	 http://www.redpill- hrp;o.no">Redpill Lhrp;o AS"L41,isical Dintk Lhrefars oulr/a>Rs to pe PCI es serscops si>  11995.
	 >
     /body   /htmlto