Dobrica Pavlinušić's random unstructured stuff
Mojo: Revision 9

dmesg

[  894.003473] usb 1-3.1: new full-speed USB device number 5 using xhci_hcd
[  894.022883] usb 1-3.1: New USB device found, idVendor=03eb, idProduct=2144
[  894.022888] usb 1-3.1: New USB device strings: Mfr=1, Product=2, SerialNumber=220
[  894.022891] usb 1-3.1: Product: Mojo V2
[  894.022893] usb 1-3.1: Manufacturer: Emb Micro
[  894.022896] usb 1-3.1: SerialNumber: 84134353230351B0D1B0
[  894.023034] usb 1-3.1: ep 0x82 - rounding interval to 1024 microframes, ep desc says 2040 microframes
[  894.039841] cdc_acm 1-3.1:1.0: ttyACM0: USB ACM device
[  894.040196] usbcore: registered new interface driver cdc_acm
[  894.040200] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters

mojo-loader

http://embeddedmicro.com/tutorials/the-mojo/installing-mojo-loader

remove RXTXcomm from distribution and use one from packages

dpavlin@blue:/blue-zfs/FPGA/Mojo/mojo-loader-1.1.2/lib$ rm RXTXcomm.jar 
dpavlin@blue:/blue-zfs/FPGA/Mojo/mojo-loader-1.1.2/lib$ rm librxtxSerial.so
dpavlin@blue:/blue-zfs/FPGA/Mojo/mojo-loader-1.1.2/lib$ ln -s /usr/share/java/RXTXcomm.jar 
dpavlin@blue:/blue-zfs/FPGA/Mojo/mojo-loader-1.1.2/lib$ ln -s /usr/lib/jni/librxtxSerial.so

alternative implementation: https://github.com/mogorman/mojo.py

Bitcoin mining

https://github.com/kramble/DE0-Nano-BitCoin-Miner/tree/master/Mojo_LX9

http://embeddedmicro.com/forum/viewtopic.php?f=3&t=68&sid=8510da058a2db897f380609cfcee4044&start=10#p300

dpavlin@blue:/blue-zfs/FPGA/Mojo$ git clone https://github.com/kramble/DE0-Nano-BitCoin-Miner.git
Cloning into 'DE0-Nano-BitCoin-Miner'...
remote: Counting objects: 227, done.
remote: Compressing objects: 100% (167/167), done.
remote: Total 227 (delta 74), reused 208 (delta 56)
Receiving objects: 100% (227/227), 659.22 KiB | 174.00 KiB/s, done.
Resolving deltas: 100% (74/74), done.

upload bitstream

dpavlin@blue:/blue-zfs/FPGA/Mojo/DE0-Nano-BitCoin-Miner/Mojo_LX9/MiningSoftware$ ../../../mojo.py/mojo.py -v -d /dev/ttyACM1 -i ../Bitstream/mojo_top_hashers6_100MHz_icarus.bin 
Rebooting Mojo
Mojo is ready to recieve bitstream
Mojo acknowledged size of bitstream. Writing bitstream
Mojo has been flashed
Verifying Mojo
First Byte was valid getting flash size.
Flash and local bitstream match file size.
Flash and local bitstream are a match.
Mojo has been loaded bitsream

dpavlin@blue:/blue-zfs/FPGA/Mojo/DE0-Nano-BitCoin-Miner/Mojo_LX9$ python miner_icarus.py 
Miner started on Tue Jul 16 23:26:17 2013
Sending data to FPGA

...

Share found on Tue Jun 25 23:37:11 2013 nonce 0074fd13
Upstream result: True
[15 accepted, 0 failed, 5.25 +/- 1.35 Mhash/s]