bcm-specs

[Specification

This checks to make sure that the DMA engine is initialized properly and that packets can travel through the device. It will only work in DMA mode, not PIO.

/!\ Note, I'm not sure if the uCode has to be uploaded first, but I'd suspect that you would have to

  1. The LoopbackTest can only be run if the device isn't available for network usage, bring it down if it's up (Note, this turns off the PowerControl crystal, see DeviceDown)

  2. Perform an ("80211CoreReset") on all cores (Note, the device should be down by now)
  3. Turn the PowerControl crystal back on

  4. If we're in DMA mode, initialize the DMA TX channel and the DMA RX channel. If we're in PIO mode, write 0x100 (Direct FIFO RX mode) to the first DMA recieve channel control word.
  5. Enable FIFO Loopback mode by setting bit 0x4 in the first DMA transmit channel control word. (For both PIO and DMA)
  6. Create a packet to send with the data below
  7. Acknowledge outstanding IRQs in the General Purpose IRQ Reason register (MMIO offset 0x120) and the first DMA Channel IRQ Reason register (MMIO offset 0x20)

  8. Send the packet
    1. For DMA, lock the DMA workaround semaphore and if it's not 0, return, otherwise, we set the PowerSavingControlBits bit 26 and compute bit 25, then send the packet as is

    2. For PIO, we just write out the packet as is
  9. Loop 100 times or until the saved first DMA Channel IRQ Reason register has any of bits 0xFD00 set
    1. Delay 10 uSec
    2. Get the first DMA Channel IRQ Reason register and perform the PIO Interrupt Workaround if needed
    3. Save the possibly patched DMA Channel IRQ Reason register value for checking in the loop
    4. Loop 500 times or until we recieve a packet
      1. Check the queues for a recieved packet
      2. Delay 10 uSec
    5. If we recieved a packet
      1. Compare the 0x20 bytes of data in the packet sent with the data in the packet recieved (Note that because of the RX Header in the recieved packet, you must start your comparison at offset 0x1E for PIO mode or offset 0x1A for DMA mode), the test is a success if the packets match
  10. If we're in DMA mode, reset and reclaim the DMA TX channels and descriptors
  11. Turn back off the PowerControl crystal and then bring up the device again if it was up before (see DeviceUp)

Packet Data

This is given in 32 bit chunks for convenience. I don't think the data is significant, it just looks like it's testing different bit combinations.

0x00000000, 0xFFFFFFFF, 0x55555555, 0xAAAAAAAA, 0x33333333, 0xCCCCCCCC, 0x66666666, 0x99999999


Exported/Archived from the wiki to HTML on 2016-10-27