bitmain-asic-drv.c
bitmain-asic.h
fpga.c
fpga.h
sha2.c
sha2.h
spi.c
spi.h
Makefile
Yes, there's an FPGA (An Altera Cyclone 4 specifically, i took some photos and uploaded them here, but they got blatantly ignored). However, Altera Cyclones get programmed with VHDL or Verilog source, not ".c" files, so what you see there is just some verification code from the CGMiner side of things. If/when Bitmain releases their S5 cgminer sources, we can get some more hints about how the communication is done, and would probably get more info about its functionality.
As it stands, i'm pretty much convinced that the FPGA contoller board does at least these things:
- Enumerate the SPI chain (i've connected 4 hashing boards to one controller successfully).
- Communicate via Chained SPI with all the BM1384 chips, at most 120 in total.
- Provide A0-A1-A2 for each hashing board. This corresponds to each BM1384 address pins configuration and would also work for the temp sensor.
- Use I2C to read temps from the onboard sensor.
- Interrupt the beagle bone as nonces come from the SPI chain, as there's no interrupt channel set for this kind of bus, and it would probably needs to busy poll the BM1384s.