This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

XIO2213B "failed to read phy reg"

Other Parts Discussed in Thread: XIO2213B, XIO2221, XIO2213A

I have a XIO2213B that gives me hassle.

Working with linux the device is properly detected (same with windows 7), and drivers are loaded. lspci -v gives me:

04:00.0 PCI bridge: Texas Instruments XIO2213A/B/XIO2221 PCI Express to PCI Bridge [Cheetah Express] (rev 01) (prog-if 00 [Normal decode])
Flags: bus master, fast devsel, latency 0
Bus: primary=04, secondary=05, subordinate=05, sec-latency=32
Memory behind bridge: f7c00000-f7cfffff
Capabilities: <access denied>
Kernel modules: shpchp

05:00.0 FireWire (IEEE 1394): Texas Instruments XIO2213A/B/XIO2221 IEEE-1394b OHCI Controller [Cheetah Express] (rev 01) (prog-if 10 [OHCI])
Flags: 66MHz, medium devsel, IRQ 19
Memory at f7c04000 (32-bit, non-prefetchable) [size=2K]
Memory at f7c00000 (32-bit, non-prefetchable) [size=16K]
Capabilities: <access denied>
Kernel modules: firewire-ohci

The device cannot be used, though. In the syslog I find:

Aug 28 10:24:19 hw-linux-pc kernel: [ 3.299884] firewire_ohci 0000:05:00.0: failed to read phy reg
Aug 28 10:24:19 hw-linux-pc kernel: [ 3.299923] firewire_ohci: probe of 0000:05:00.0 failed with error -16

I can reproduce this messages by reloading the firewire_ohci driver with

modprobe –r firewire_ohci
modprobe firewire_ohci

I have a test point connected to PCLK. I can see a brief output on PCLK for about 850 ms on startup, or when I reload the driver.

All voltages look good, and the 98.304 MHz clock is also ok.

Basically my design followed the reference schematic with the exception that I use the internal regulator and all port are 1394a. 

I'm running out of ideas...

 

 

 

 

 

 

  • Hello,

    What is the Linux version?

    Can you share your schematic?

    Are you getting a yellow bang on windows? What error code?

    Regards.

  • Hello Elias,
    I emailed the schemtics directly
    I use a Ubuntu Linux with version “3.5.0-30-generic”. We also tried a 3.10.9 kernel, and did a quick check with a Knoppix 7.0.5 live CD.

    The Windows 7 problem code is “0000000A”.

    The 3.10.9 kernel makes a dump_stack(), maybe the output is helpful:
    Aug 30 12:10:23 ubuntu13 kernel: [ 1733.020012] firewire_ohci 0000:07:00.0: failed to read phy reg 2
    Aug 30 12:10:23 ubuntu13 kernel: [ 1733.020018] CPU: 3 PID: 2365 Comm: modprobe Not tainted 3.10.9 #1
    Aug 30 12:10:23 ubuntu13 kernel: [ 1733.020020] Hardware name: System manufacturer System Product Name/P5KPL-SE, BIOS 0404 09/18/2008
    Aug 30 12:10:23 ubuntu13 kernel: [ 1733.020023] ffff88007a8ee000 ffff880079025aa8 ffffffff8169e032 ffff880079025ad0
    Aug 30 12:10:23 ubuntu13 kernel: [ 1733.020027] ffffffffa004bdc1 ffff88007a8ee000 ffffffffa024a920 0000000000000016
    Aug 30 12:10:23 ubuntu13 kernel: [ 1733.020031] ffff880079025b00 ffffffffa005045d ffff88007a8ee000 ffff88007a8ee6b8
    Aug 30 12:10:23 ubuntu13 kernel: [ 1733.020035] Call Trace:
    Aug 30 12:10:23 ubuntu13 kernel: [ 1733.020043] [<ffffffff8169e032>] dump_stack+0x19/0x1b
    Aug 30 12:10:23 ubuntu13 kernel: [ 1733.020048] [<ffffffffa004bdc1>] read_phy_reg+0x81/0xb0 [firewire_ohci]
    Aug 30 12:10:23 ubuntu13 kernel: [ 1733.020053] [<ffffffffa005045d>] ohci_enable+0x39d/0x580 [firewire_ohci]
    Aug 30 12:10:23 ubuntu13 kernel: [ 1733.020060] [<ffffffffa023fb4c>] fw_card_add+0x4c/0xa0 [firewire_core]
    Aug 30 12:10:23 ubuntu13 kernel: [ 1733.020065] [<ffffffffa0050e0a>] pci_probe+0x64a/0x760 [firewire_ohci]
    Aug 30 12:10:23 ubuntu13 kernel: [ 1733.020069] [<ffffffff811f49ac>] ? __sysfs_add_one+0x6c/0x110
    Aug 30 12:10:23 ubuntu13 kernel: [ 1733.020074] [<ffffffff8136348b>] local_pci_probe+0x4b/0x80
    Aug 30 12:10:23 ubuntu13 kernel: [ 1733.020077] [<ffffffff813637b1>] pci_device_probe+0x111/0x120
    Aug 30 12:10:23 ubuntu13 kernel: [ 1733.020082] [<ffffffff8142fa67>] driver_probe_device+0x77/0x240
    Aug 30 12:10:23 ubuntu13 kernel: [ 1733.020085] [<ffffffff8142fcdb>] __driver_attach+0xab/0xb0
    Aug 30 12:10:23 ubuntu13 kernel: [ 1733.020089] [<ffffffff8142fc30>] ? driver_probe_device+0x240/0x240
    Aug 30 12:10:23 ubuntu13 kernel: [ 1733.020092] [<ffffffff8142dc9d>] bus_for_each_dev+0x5d/0xa0
    Aug 30 12:10:23 ubuntu13 kernel: [ 1733.020095] [<ffffffff8142f54e>] driver_attach+0x1e/0x20
    Aug 30 12:10:23 ubuntu13 kernel: [ 1733.020098] [<ffffffff8142f0be>] bus_add_driver+0xfe/0x250
    Aug 30 12:10:23 ubuntu13 kernel: [ 1733.020101] [<ffffffff81430377>] driver_register+0x77/0x170
    Aug 30 12:10:23 ubuntu13 kernel: [ 1733.020105] [<ffffffff81362510>] __pci_register_driver+0x60/0x70
    Aug 30 12:10:23 ubuntu13 kernel: [ 1733.020111] [<ffffffffa0000000>] ? 0xffffffff9fffffff
    Aug 30 12:10:23 ubuntu13 kernel: [ 1733.020115] [<ffffffffa000001e>] fw_ohci_pci_driver_init+0x1e/0x1000 [firewire_ohci]
    Aug 30 12:10:23 ubuntu13 kernel: [ 1733.020120] [<ffffffff81000312>] do_one_initcall+0x112/0x170
    Aug 30 12:10:23 ubuntu13 kernel: [ 1733.020124] [<ffffffff810aa9e1>] load_module+0x1ee1/0x25f0
    Aug 30 12:10:23 ubuntu13 kernel: [ 1733.020128] [<ffffffff810a67a0>] ? unset_module_init_ro_nx+0x80/0x80
    Aug 30 12:10:23 ubuntu13 kernel: [ 1733.020132] [<ffffffff810ab1b5>] SyS_init_module+0xc5/0xf0
    Aug 30 12:10:23 ubuntu13 kernel: [ 1733.020136] [<ffffffff816acc46>] system_call_fastpath+0x1a/0x1f
    Aug 30 12:10:23 ubuntu13 kernel: [ 1733.020192] firewire_ohci: probe of 0000:07:00.0 failed with error -16
  • failed to read phy reg 2

    This is the very first PHY access after enabling LPS.

    I can see a brief output on PCLK for about 850 ms on startup, or when I reload the driver.

    At this point in the initialization process, the interrupt handler, which wouch detect regAccessFail (missing SCLK), is not yet enabled. (But I don't know if this is an SCLK problem.)

    The dump_stack() was added after some LPS enabling problems with LSI controllers, but it doesn't tell us anything new in this case.

    Other XIO2213B cards work fine with Linux (all versions), and your mention of the problem code implies that Windows doesn't work either, so this appears to be a problem with your hardware.

  • Clemens Ladisch said:
    This is the very first PHY access after enabling LPS.

    We figured out the same by looking at the firewire_ohci sources.

    Clemens Ladisch said:
    Other XIO2213B cards work fine with Linux (all versions), and your mention of the problem code implies that Windows doesn't work either, so this appears to be a problem with your hardware.

    I agree. But I'm not able to put my finger on it.

     

     

     

  • Tried five boards now, all showing above error, so I would rule out a bad solder joint or something like that.

  • I had BMODE pulled down. When I pull it up, communication to the PHY is working. I was under the misconception that I have to pull it down because I only have 1394a port. I wasn't aware that the BMODE pin controls only the PHY-link.

    But I still have problems. When I connect a firewire harddisk it isn't mounted. Windows 7 gives me a yellow bang on the harddisk, with error code 0x10 (IIRC). Linux gives following syslog messages:

    Sep 4 15:24:01 hw-linux-pc kernel: [ 44.832894] firewire_core 0000:07:00.0: rediscovered device fw0
    Sep 4 15:24:07 hw-linux-pc kernel: [ 51.253817] firewire_core 0000:07:00.0: phy config: new root=ffc1, gap_count=5
    Sep 4 15:24:08 hw-linux-pc kernel: [ 51.842119] firewire_core 0000:07:00.0: created device fw1: GUID 0001db9200188188, S400
    Sep 4 15:24:08 hw-linux-pc kernel: [ 51.858038] scsi4 : SBP-2 IEEE-1394
    Sep 4 15:24:08 hw-linux-pc kernel: [ 52.075498] firewire_sbp2 fw1.0: error status: 2:255
    Sep 4 15:24:08 hw-linux-pc kernel: [ 52.291512] firewire_sbp2 fw1.0: logged in to LUN 0000 (1 retries)
    Sep 4 15:24:29 hw-linux-pc kernel: [ 72.889732] firewire_sbp2 fw1.0: sbp2_scsi_abort
    Sep 4 15:24:35 hw-linux-pc dbus[766]: [system] Activating service name='com.ubuntu.SystemService' (using servicehelper)
    Sep 4 15:24:35 hw-linux-pc dbus[766]: [system] Successfully activated service 'com.ubuntu.SystemService'
    Sep 4 15:24:39 hw-linux-pc kernel: [ 82.890054] firewire_sbp2 fw1.0: sbp2_scsi_abort
    Sep 4 15:24:39 hw-linux-pc kernel: [ 82.890110] scsi 4:0:0:0: Device offlined - not ready after error recovery
    Sep 4 15:24:39 hw-linux-pc kernel: [ 83.467316] firewire_sbp2 fw1.0: error status: 2:255

    When I reload the firewire_ohci driver with modprobe I get

    Sep 4 15:25:09 hw-linux-pc kernel: [ 113.423033] firewire_ohci 0000:07:00.0: added OHCI v1.10 device as card 1, 8 IR + 8 IT contexts, quirks 0x2
    Sep 4 15:25:10 hw-linux-pc kernel: [ 113.923059] firewire_core 0000:07:00.0: created device fw0: GUID 0000000000000000, S800
    Sep 4 15:25:10 hw-linux-pc kernel: [ 113.923070] firewire_core 0000:07:00.0: phy config: new root=ffc1, gap_count=5
    Sep 4 15:25:10 hw-linux-pc kernel: [ 113.923106] firewire_core 0000:07:00.0: unsolicited response (source ffc0, tlabel 1b)
    Sep 4 15:25:13 hw-linux-pc kernel: [ 116.932155] scsi5 : SBP-2 IEEE-1394
    Sep 4 15:25:13 hw-linux-pc kernel: [ 116.932211] firewire_core 0000:07:00.0: created device fw1: GUID 0001db9200188188, S400
    Sep 4 15:25:13 hw-linux-pc kernel: [ 117.149474] firewire_sbp2 fw1.0: error status: 2:255
    Sep 4 15:25:13 hw-linux-pc kernel: [ 117.365463] firewire_sbp2 fw1.0: logged in to LUN 0000 (1 retries)
    Sep 4 15:25:34 hw-linux-pc kernel: [ 137.915722] firewire_sbp2 fw1.0: sbp2_scsi_abort
    Sep 4 15:25:44 hw-linux-pc kernel: [ 147.916021] firewire_sbp2 fw1.0: sbp2_scsi_abort
    Sep 4 15:25:44 hw-linux-pc kernel: [ 147.916081] scsi 5:0:0:0: Device offlined - not ready after error recovery
    Sep 4 15:25:44 hw-linux-pc kernel: [ 147.934559] firewire_sbp2 fw1.0: error status: 2:255

    I was once able to mount the harddisk with a driver reload, but i couldn't reproduce it.

  • firewire_core 0000:07:00.0: created device fw0: GUID 0000000000000000, S800

    You are not supposed to steal an OUI from Xerox.  ;-)

    firewire_sbp2 fw1.0: error status: 2:255
    firewire_sbp2 fw1.0: logged in to LUN 0000 (1 retries)
    firewire_sbp2 fw1.0: sbp2_scsi_abort
    firewire_sbp2 fw1.0: sbp2_scsi_abort
    scsi 5:0:0:0: Device offlined - not ready after error recovery

    In theory, your card works fine, because otherwise the PC would not have been able to detect the HD as a SCSI HD.

    Try reloading the firewire-sbp2 module with the workarounds=0x17 parameter, and ask on the linux1394-user mailing list.

    Do you have any other IEEE-1394 device you could test with? (Such as another PC with one of these cards …)

  • Clemens Ladisch said:

    In theory, your card works fine, because otherwise the PC would not have been able to detect the HD as a SCSI HD.

    Ah, well...

    Clemens Ladisch said:

    firewire_core 0000:07:00.0: created device fw0: GUID 0000000000000000, S800

    You are not supposed to steal an OUI from Xerox.  ;-)

    [/quote]

    Well, that shouldn't happen. It should not detect the device as S800. It should be all S400.

    Clemens Ladisch said:
    Try reloading the firewire-sbp2 module with the workarounds=0x17 parameter

    Did that, had instant success, and wasn't able to reproduce it :(.

    Every once in a while, I can see (and access) the harddisk. If I do a power cycle, it is gone. No success with windows, either. The harddisk looks good on a laptop which has a firewire port.

    Clemens Ladisch said:
    Do you have any other IEEE-1394 device you could test with? (Such as another PC with one of these cards …)

    I'm going to try some network connections with firewire_net. Maybe that brings some insight.

     

    Elias, are you in any form still monitoring this case?

     

  • It should not detect the device as S800. It should be all S400.

    That value is read from the controller's bus options register.
    (Both link and PHY are S800, only the ports all happen to be S400.)

  • Clemens, thanks a lot, you are really helping me out.

    I just tried do build a network with two PC with my card installed. I built the interfaces with ifconfig and tried a ping. I didn't work. ifconfig gives me:

    firewire0 Link encap:UNSPEC Hardware Adresse 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
    inet Adresse:192.168.1.1 Bcast:192.168.1.255 Maske:255.255.255.0
    inet6-Adresse: fe80::200:0:0:0/64 Gültigkeitsbereich:Verbindung
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metrik:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:41 errors:0 dropped:0 overruns:0 carrier:0
    Kollisionen:0 Sendewarteschlangenlänge:20
    RX-Bytes:0 (0.0 B) TX-Bytes:8633 (8.6 KB)

    What made me wonder is that the hardware address is all 0. Then I thought of

    Clemens Ladisch said:

    firewire_core 0000:07:00.0: created device fw0: GUID 0000000000000000, S800

    You are not supposed to steal an OUI from Xerox.  ;-)

    [/quote]

    where I wondered about the all zero GUID. 

    I do not have a PROM installed, because I expected the GUID to be set up by the BIOS (as the datasheet says), which didn't happen. The GUIDhi and GUIDlo registers are 0x00000000. When I set them manually, the hardware adress ifconfig gives me gets the values of the GUID registers. If I ping the interface I set up manually, it works now. The hard disk also seems to work now.

    Is having the ROM installed mandatory, just for the GUID?

  • I do not have a PROM installed, because I expected the GUID to be set up by the BIOS (as the datasheet says), which didn't happen.

    The BIOS can set up the GUID (by writing it to the TI-specific registers) only if

    • it knows that the controller is a TI chip; and
    • it knows that there is no EEPROM; and
    • it has some unique GUID value.

    This can happen only for controllers soldered to the motherboard (where having the GUID in the BIOS EEPROM saves the separate EEPROM for the controller).

    Is having the ROM installed mandatory, just for the GUID?

    When the datasheet says "if no EEPROM is detected, then the GUID is loaded by the BIOS", it does not describe the behaviour of the XIO2213B or of every BIOS out there; it describes the behaviour of a system designed and manufactured by you not to violate annex J of IEEE-1394, which says:

    the value returned shall be the EUI-64 assigned by the manufacturer. In particular, the EUI-64 so returned shall not be alterable by software.

    In other words: If there is no BIOS (or other software in an embedded system) that initializes the GUID, then there must be an EEPROM.

    (There are quite a few FireWire add-on card manufacturers out there that are too cheap to buy an OUI or a PCI vendor ID, but even those are careful to provide some random but non-zero junk as GUID.)

  • Ok. That was clear enough, so that even I get it. I feel a bit stupid now.

    Thanks, Clemens.

    Does anyone know if a default PROM file exists, or even some sort of programming tool, such as seems to be available for the TUSB devices?

  • Ronald,

    I will email you the tools to program the eeprom.

    Regards.

  • Just for the records:

    * "7856341278563412", which is the GUID in the ROM-template that I got with the programming tool seems to be a non-working GUID.

    * Serial EEPROM address 0x35, which is described as "Reserved — no bits loaded" in the XIO2213B datasheet actually must get a value (the ROM-template sets it to 0xB0). Datasheets of older devices describe this byte as "Max_Rec" in the  Bus Options Register. When I set this byte to 0x00 (as the  XIO2213B datasheet suggests), firewire connections time out:

    Sep 12 10:22:13 hw-linux-pc kernel: [ 408.407538] firewire_sbp2 fw1.0: ORB reply timed out, rcode 0x11
    Sep 12 10:22:13 hw-linux-pc kernel: [ 408.407542] firewire_sbp2 fw1.0: failed to login to LUN 0000

    Otherwise its working like a charm now.