Commit graph

37 commits

Author SHA1 Message Date
Brian Padalino
da47b0fec4 kernel: Changing USB VID/PID to OpenMoko instead of Cypress. 2013-07-06 14:03:45 -07:00
Brian Padalino
b7994f399d cli: peek/poke an print/set combined into single files.
Also added top level .gitignore file.
2013-07-06 04:50:38 -07:00
Brian Padalino
ef2a542136 cli: Adding extra functionality.
lib: Added device path to bladerf structure to know where fd is pointing.
2013-07-06 04:50:37 -07:00
Jon Szymaniak
ccfd96a040 cli: Fixed handling of empty line, and misc. cleanup
Interactive console's argc wasn't being checked, resulting in
a bogus "Unexpected command:" and often segfaults.

In other news, I failed to note in the previus changeset that at
least half the cli changes were authored by Brian Padalino...so
doing that here - ec54e4e409
2013-06-17 01:53:16 -04:00
Jon Szymaniak
ec54e4e409 cli: Added FX3/ FPGA loading support and filled in misc. cmd stubs.
The CLI now supports flashing the FX3 and loading the FPGA from the
command line and through the interactive console.

To flash the firmware from the command line:
  ./bin/bladerf -b -f ./path/to/img -d /dev/bladerf1

To load the firmware from the command line:
  ./bin/bladerf -b -l ./path/to/rbf -d /dev/bladerf1

To flash/load interactively either run with -d /dev/bladerf1, or
use the open command to attach to a device:
  bladeRF> open /dev/bladerf1

To flash the firmware interactively:
  bladeRF> load fx3 ./path/to/img

To load the FPGA interactively:
  bladeRF> load fpga ./path/to/rbf

Note that a power-on-reset is currently required in between
flashing firmware and loading the FPGA.

Various commands have been stubbed out for the time being. A TODO
list has been created to keep track of desired functionality.

The simple_load and upgrade_firmware programs have been removed,
as they are no longer needed.
2013-06-17 00:12:19 -04:00
Robert Ghilduta
9b80370f0c libbladeRF: fixup RX function 2013-06-16 18:17:50 -07:00
Jon Szymaniak
eecc0d2799 libbladeRF: Implemented firmware flashing, touched up FPGA loading.
Credit where credit is due -- All the code here is basically
copy/paste from Robert's earlier test code, with some added error
checks and debug output.

The firmware loading now checks the write return value and
performs partial writes as needed.

Items that need to be revisited are the sanity checks on file
sizes. In the future I plan to implement a "bladeRF Image" format
that will wrap size and a hash around a firmware/bitstream. These
checks will probably go into that code.
2013-06-16 18:17:49 -07:00
Jon Szymaniak
75a277cc99 kernel: Removed urb print from driver 2013-06-16 18:17:48 -07:00
Jon Szymaniak
45f8316207 kernel: Fixed issue where write() returns 0 when programming FPGA 2013-06-16 18:17:47 -07:00
Jon Szymaniak
265755de0b libbladeRF: Header file cleanup, added bladerf_strerror
Misc cleanup. Added reference to RETCODES in doxygen @return's.
2013-06-16 18:17:46 -07:00
Brian Padalino
d8ae03cabe bladerf: Adding documentation and liblms calls. 2013-06-16 18:17:44 -07:00
Brian Padalino
c10b7a7b83 Adding some new getters/setters. 2013-06-16 18:17:43 -07:00
Brian Padalino
4997c38d3d libbladeRF: Added setters/getters
Added some extra setters/getters for center frequency and gain.
2013-06-16 18:17:42 -07:00
Robert Ghilduta
f8e78fba46 libbladeRF: driver: add host software support for GPIO over UART bridge 2013-06-09 23:03:28 -07:00
Robert Ghilduta
3843d1909e libbladeRF: add FPGA programming support 2013-06-09 23:03:27 -07:00
Robert Ghilduta
5c41729ac3 libbladeRF: add support for LMS6002D
This commit introduces LMS library support for controlling the LimeMicro
LMS6002D transceiver. The LMS library functions were originally developed by
bpadalino.
2013-06-04 20:22:59 -07:00
Robert Ghilduta
b49d9fe7d2 cli: make the cli app be conditionally compiled to be interactive 2013-06-09 22:58:35 -07:00
jon
2f9dc744a2 cli: Initial skeleton of CLI program 2013-06-09 22:58:34 -07:00
jon
c2e3c54422 apps: Added hooks to build without 'make install'-ing libbladeRF 2013-06-09 22:58:33 -07:00
jon
7f22b26f7d libbladeRF/apps: Moving cli build to apps/
This is the first commit in a set of upcoming changes that will
move functionality from simple_load and upgrade_firmware into the
libbladeRF library and provide access to these routines through a
bladeRF cli.

Don't merge from jon-dev until I get this straightened out, or
you'll be left with something possibly unusable...
2013-06-09 22:58:32 -07:00
jon
aad9e99bfb libbladeRF: 'make install' now prints what it's executing to install 2013-06-09 22:58:31 -07:00
Robert Ghilduta
e467bdf85a libbladeRF: add Si5338 support
This commit introduces support for controlling the on-board programmable PLL and
clock distribution Si5338 chip.
2013-06-04 20:42:06 -07:00
jon
cbad06a5a1 libbladeRF: More lib renaming & fixes for tempoarary (un)install targets 2013-06-09 22:58:18 -07:00
jon
7ccd37aa7d libbladeRF: header and lib renamed to libbladeRF. Minor fixes added.
Fixed bladerf_get_device_list return value for condition where no
devices are attached. (Now returns 0, previously returned -1).

Also added a missing catch of a malloc failure and now return appropriate
error value.
2013-06-09 22:58:17 -07:00
jon
5a7b8a253d libbladeRF: Makefile now creates and installs libbladerf.pc 2013-06-09 22:58:06 -07:00
jon
2807d5d3fe libbladeRF: Added header inclusion guards and cplusplus check. Fixed 'make uninstall' 2013-06-09 22:58:05 -07:00
jon
95c2c3db70 libbladeRF: Added stubs for fetching FPGA version info. 2013-06-09 22:58:05 -07:00
jon
ca35519b34 libbladeRF: Added calls to fetch some device info, and did a bit of cleanup. 2013-06-09 22:58:04 -07:00
jon
52a3d834ea libbladeRF: Removed duplicate bladerf_flash_firmware() from header and erroneous #include 2013-06-09 22:58:03 -07:00
jon
bffd52e1f5 libbladeRF: Implemented bladerf_get_device_list(). Removed missing logo from Doxygen
With these changes, the cli can be used to probe for attached bladeRF
devices on the system, assuming the user has r/w on the /dev/bladeRF
nodes.
2013-06-09 22:58:02 -07:00
jon
9773679fd2 libbladeRF: Added cli program to build for testing and debugging 2013-06-09 22:58:01 -07:00
jon
709d2d0fdc libbladeRF: Changed default include path to include ../../common
This will make things slightly less of a pain in the butt for the
time being. Someone remind me to fix this later.
2013-06-09 22:58:00 -07:00
jon
ff772abcf4 libbladeRF: Move bladerf_stats to public header, added fn to obtain these. 2013-06-09 22:57:59 -07:00
jon
99f12fadd3 libbladerRF: [Non-functional] Added stubs for libbladerf.
Jon's TODO items in the following commits will include:
 - Implementing the init/deinit functions
 - Implementing the device info and programming functions
 - Integrating ../app items into this lib
 - Adding libbladerf support to gr-osmosdr
2013-06-09 22:57:58 -07:00
Robert Ghilduta
552d779567 linux driver: add support for writing to the LMS, Si5388, and the VCTCXO
This commit adds the ioctls necessary to configure the LMS, Si5338, and VCTCXO.
The FX3's second endpoint is configured to receive and transmit things over
UART. At the other end of the UART is the Nios II core in the FPGA. The Nios
core simply parses the read or write operation and sends it to the appropriate
device.

NB: At least a 16byte URB has to be sent to the FX3 for it to send data on UART
due to a minimum buffer count enforced by the GPIF's DMA controller.

The UART packet format is as follows:
   Byte 0) "Magic" byte is 'N'

   Byte 1) Indicates the direction and intended device of each subsequent
           operation. Count is number of struct uart_cmd data structures that
           will be transferred.
   //  | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |$
   //  |  dir  |  dev  |     cnt       |$

   Byte 2..N) The following byte pairs are struct uart_cmd, which consist of
           addresses and values;
   struct uart_cmd {$
       unsigned char addr;$
       unsigned char data;$
   };$

As an example, if you are looking to write 0xC0 to register 0x30 on the Si5338,
the UART packet you would have to send would have to look like this:
   Byte 0) 'N'
   Byte 1) UART_PKT_MODE_DIR_WRITE | UART_PKT_DEV_SI5338 | 0x01;$
   Byte 2) 0x30$
   Byte 3) 0xC0$

Before sending this packet to the second endpoint, the packet would have to be
zero padded to the nearest 16 byte boundary.
2013-06-02 23:57:36 -07:00
Robert Ghilduta
10040ef56c linux driver: add RX and TX buffering
This commit adds RX and TX functionality for the bladeRF. The driver uses a ring
buffer of URBs that are allocated when the driver probe()s each bladeRF. At the
moment the driver allocates 1024 4KB URB buffers for RX and TX, meaning that
each bladeRF requires at least 8MB of RAM. The total number of allocated URBs
(NUM_DATA_URB) can be lowered when operating at USB 2.0, but the number should
be a power of 2 for the ring buffer to work.

Test read/write speeds of 320MB/s were observed with this driver on an Intel xHCI.
2013-06-02 23:57:35 -07:00
Nuand
ce7d8a7ab2 FSK bridge example
This should include everything needed to build the FSK bridge example from scratch.

1) Open existing hdl/quartus/bladerf.qsf project in Quartus
        a) Generate the Nios core
                i) Tools -> QSys -> File -> Open -> navigate to ./hdl/fpga/ip/altera/nios_system/nios_system.qsys
                ii) After opening qsys file, go to Generation tab, click the "Generate" button
        b) Compile the embedded Nios image
                i) Tools -> Nios II Software Build Tools for Eclipse
                        I)   File -> Import -> General -> Existing Projects into Workspace -> Next
                                -> Browse to checkout root directory -> check both lms_spi_controller and lms_spi_controller_bsp
                                -> Finish
                        II)  right click lms_spi_controller_bsp -> NIOS II -> Generate BSP
                        III) right click lms_spi_controller -> Build
                        IV)  right click lms_spi_controller -> Make Targets -> Build... -> select mem_init_generate -> Build
        c) Synthesize FPGA image
                i) Processing -> Start Compilation

2) Compile driver and user mode applications
        a) cd linux/kernel ; make ; inmod bladeRF.ko
        b) cd ../apps; make
        c) To program the fpga execute ./simple_load c4images/blink.rbf
                i) Load bladerf.rbf from the quartus output_files directory

3) Use bladeRF's UART as an FSK bridge!

NB. The firmware upgrade utility does work, only use it on valid .img files.
2013-02-18 20:11:39 -08:00