Commit graph

3,146 commits

Author SHA1 Message Date
Rey Tucker
b48ff5661c python v1.1.1 python_v1.1.1 2018-12-21 16:40:44 -05:00
Rey Tucker
3cd3afae86 host: python: update definitions for libbladeRF v2.2.0 2018-12-21 16:39:13 -05:00
Rey Tucker
5de4edac6c host: python: bladerf-tool: don't print gain mode if tx channel 2018-12-21 16:38:50 -05:00
Rey Tucker
8f021ab65b matlab v1.0.3 matlab_v1.0.3 2018-12-21 16:30:57 -05:00
Rey Tucker
00926587d8 host: matlab: update definitions for flash image handling functions
Updates bladerf_alloc_image, bladerf_alloc_cal_image,
and bladerf_image_write function definitions for libbladeRF v2.2.0
2018-12-21 16:30:36 -05:00
Rey Tucker
22e5748a08 bladeRF-cli v1.7.1 bladeRF-cli_v1.7.1 2018-12-21 16:24:46 -05:00
Rey Tucker
57b6abdc35 libbladeRF v2.2.0 libbladeRF_v2.2.0 2018-12-21 16:12:50 -05:00
Rey Tucker
d1a9c8e12a host: libbladeRF_test: fixup test_gain on bladerf2
Works around a minor bug in fpga v0.10.2 where the frequency
post-init is not valid, which makes bladerf_enable_module fail
until a frequency change is done.

Also only enable RX channels, not TX channels.

Also don't try to change gain modes on TX channels.
2018-12-21 15:18:47 -05:00
Rey Tucker
d09761f2e4 host: libbladeRF: include inttypes.h in libbladeRF.h
This is where PRI{i,u,x}{32,64} are defined, which we use
in #defines further down. So, including inttypes.h is sort
of necessary.
2018-12-21 15:12:16 -05:00
Rey Tucker
9f235ddbe3 hdl: nios: devices_rfic: remove unnecessary shift
The need of this shift was an artifact of a previous bug, since
fixed.
2018-12-21 15:10:43 -05:00
Rey Tucker
3eb52ea834 fpga_common: ad936x.h: remove unused struct member
This is not present in ad9361_api.h, removing to avoid conflicts...
2018-12-21 15:09:08 -05:00
Rey Tucker
1e06cfe0b3 hdl: nios: libbladeRF_nios_compat: avoid redef of PRIx64 macros 2018-12-21 15:07:46 -05:00
Rey Tucker
9a0310d556 host: libbladeRF: minor doxygen fixes 2018-12-21 12:49:56 -05:00
Rey Tucker
825d986b4e host: libbladeRF: add bladerf_get_fpga_bytes() call
This adds a bladerf_get_fpga_bytes() function, which returns the
expected length of the FPGA image.

This is a dynamic replacement for BLADERF_FLASH_BYTE_LEN_FPGA,
which has been removed.

In particular, this is used in spi_flash_write_fpga_bitstream() and
spi_flash_erase_fpga() to determine the number of blocks to erase
during FPGA flashing operations.

This fixes an issue where xA9 boards were not being adequately
erased before writing.
2018-12-21 01:28:17 -08:00
Rey Tucker
d51872f385 host: bladeRF-cli: static const for FPGA region size in flash_*
Fixing this up "the right way" is out-of-scope for this PR, but
this will do to permit removal of BLADERF_FLASH_BYTE_LEN_FPGA.
2018-12-21 01:28:17 -08:00
Robert Ghilduta
296d7a6400 thirdparty: adi: define ALTERA_PLATFORM
libad936x needs ALTERA_PLATFORM even on the host side
2018-12-21 01:28:17 -08:00
Brian Glod
5081471c5b host: libbladeRF: Remove BLADERF_FLASH_EB_SIZE and BLADERF_FLASH_TO_EB(bytes)
Macros no longer needed/used.
2018-12-21 01:28:17 -08:00
Brian Glod
55bbfb1537 host: Remove BLADERF_FLASH_EB_FPGA and BLADERF_FLASH_EB_LEN_FPGA
Macros no longer needed:
- Switched to using byte-unit functions.
- Perform any byte->EB calculations internally based on device's flash
  architecture.
2018-12-21 01:28:17 -08:00
Brian Glod
b45a08d3d0 host: Remove BLADERF_FLASH_EB_CAL and BLADERF_FLASH_EB_LEN_CAL
Macros no longer needed once switching to byte-unit functions.
2018-12-21 01:28:17 -08:00
Brian Glod
44534c0799 host: Remove BLADERF_FLASH_EB_FIRMWARE and BLADERF_FLASH_EB_LEN_FIRMWARE
Replaced these macros with appropriate calculations using
BLADERF_FLASH_ADDR_FIRMWARE and the page size held in the device's flash
architecture structure. Page size may change depending on the flash
used.
2018-12-21 01:28:17 -08:00
Brian Glod
4cf375137f host: libbladeRF: Remove BLADERF_FLASH_PAGE_SIZE
Macro no longer used.
2018-12-21 01:28:17 -08:00
Brian Glod
d9293a85ab host: libbladeRF: Remove BLADERF_FLASH_TO_PAGES(bytes)
Macro no longer used.
2018-12-21 01:28:17 -08:00
Brian Glod
ae9f8440a1 host: libbladeRF: Remove BLADERF_FLASH_PAGE_FPGA
Replaced this macro with an appropriate calculation using the
BLADERF_FLASH_ADDR_FPGA macro and the page size held in the device's
flash architecture structure. Page size may change depending on the
flash used.
2018-12-21 01:28:17 -08:00
Brian Glod
4316bf6368 host: libbladeRF: Remove BLADERF_FLASH_PAGE_LEN_CAL
Macro is not used anywhere.
2018-12-21 01:28:17 -08:00
Brian Glod
9516216a25 host: libbladeRF: Remove BLADERF_FLASH_PAGE_CAL
Macro is not used anywhere.
2018-12-21 01:28:17 -08:00
Brian Glod
eb94ece146 host: libbladeRF: Remove BLADERF_FLASH_PAGE_LEN_FIRMWARE
Macro is not used anywhere.
2018-12-21 01:28:17 -08:00
Brian Glod
4caed4e280 host: libbladeRF: Remove BLADERF_FLASH_PAGE_FIRMWARE
Replaced the BLADERF_FLASH_PAGE_FIRMWARE macro with the appropriate
calculation using the page size held in the device's flash architecture
structure.
2018-12-21 01:28:17 -08:00
Brian Glod
048678df98 host: libbladeRF: API changes, BLADERF_FLASH_EB_SIZE usage
API change:
  - bladerf_image_write(): new parameter: bladeRF device handle
      Change is inspired by the pending removal of BLADERF_FLASH_EB_SIZE
      macro. This macro really shouldn't be exposed to the world, nor
      should it be constant as it may change depending on the flash
      used on the board.

API new function:
  - bladerf_erase_flash_bytes(): new function
      Similar to the existing bladerf_erase_flash() function, but
      handles the conversion from bytes to flash erase block pages
      internally. This function is recommended for new designs because
      the erase block size may change depending on the board. This
      function also checks for proper alignment along erase block
      boundaries.

General changes:
  Although the macro still exists (for now), all uses of
  BLADERF_FLASH_EB_SIZE have been replaced with equivalent
  dev->flash_arch->ebsize_bytes because the value may change depending
  on the flash used on the board.
2018-12-21 01:28:17 -08:00
Brian Glod
9292b6ebe9 host: Replace BLADERF_FLASH_PAGE_SIZE and BLADERF_FLASH_TO_PAGES()
The BLADERF_FLASH_PAGE_SIZE macro was replaced with a similar value from
the from the device's flash architecture
structure (e.g. dev->flash_arch->psize_bytes).

The BLADERF_FLASH_TO_PAGES() macro was replaced by using the new(er) API
functions bladerf_{read,write}_flash_bytes(). The conversion from bytes
to pages occurs in those functions, removing the need for the
macro. Going forward, the *_bytes() functions should be preferred
because the flash architecture may change.
2018-12-21 01:28:17 -08:00
Brian Glod
b0c1f750ea host: libbladeRF: API new bladerf_{read,write}_flash_bytes()
New API functions:
  - bladerf_read_flash_bytes()
      This function is nearly identical to the existing
      bladerf_read_flash() function, but takes the address and length in
      units of bytes instead of flash pages. The function performs the
      necessary conversions from bytes to pages internally based on the
      specific flash architecture in use.
  - bladerf_write_flash_bytes()
      Same as above, for writes.

New code is advised to use these byte-unit functions instead of the
older page-unit functions because the page size may not be guaranteed to
be 256 bytes in future bladeRF platforms.
2018-12-21 01:28:17 -08:00
Brian Glod
fdc1f341f3 host: libbladeRF: Remove BLADERF_FLASH_TOTAL_SIZE
Macro definition no longer used.
2018-12-21 01:28:17 -08:00
Brian Glod
907994587d host: libbladeRF: Replace BLADERF_FLASH_NUM_EBS
The BLADERF_FLASH_NUM_EBS macro was replaced with data from the device's
flash architecture structure (e.g. dev->flash_arch->num_ebs).

Functions with new parameters include:

- spi_flash.c: check_eb_access() - bladeRF device handle
2018-12-21 01:28:17 -08:00
Brian Glod
bc06d86ea3 host: libbladeRF: Replace BLADERF_FLASH_NUM_PAGES
The BLADERF_FLASH_NUM_PAGES macro was replaced with data from the
device's flash architecture structure (e.g. dev->flash_arch->num_pages).

Functions with new parameters include:
  - spi_flash.c: check_page_access() - bladeRF device handle
2018-12-21 01:28:17 -08:00
Brian Glod
03edb51ee4 host: libbladeRF API changes, BLADERF_FLASH_TOTAL_SIZE usage
API changes:
  - bladerf_alloc_image(): new parameter - bladeRF device handle
  - bladerf_alloc_cal_image(): new parameter - bladeRF device handle

General changes:
  Although the macro still exists (for now), all uses of the
  BLADERF_FLASH_TOTAL_SIZE macro have been replaced with equivalent
  dev->flash_arch->tsize_bytes because the value may change depending on
  teh flash used on the board.

  During this process, some function prototypes were modified so the
  device handle could be passed in, thus allowing flash architecture
  data to be extracted.

    - calibration.c: dc_cal_tbl_image_load()
    - image.c: is_valid_addr_len()
2018-12-21 01:28:17 -08:00
Robert Ghilduta
99087acb6e firmware_common: add shared flash routines 2018-12-21 01:28:17 -08:00
Robert Ghilduta
d0f84f3fc5 flash: remove duplicate shared flash functionality 2018-12-21 01:28:17 -08:00
Robert Ghilduta
0e94a0aedb libbladeRF: board state should be initialized before rfic can be used 2018-12-21 01:28:17 -08:00
Rey Tucker
95d8af6c0a host: bladeRF-cli: remove vestigial printfs in open_device 2018-12-21 01:28:17 -08:00
Rey Tucker
6bdec2e32b host: libbladeRF: check for null rfic ptr in bladerf2_close
Fixes segfault after flashing FPGA image
2018-12-21 01:28:17 -08:00
Rey Tucker
cdc05b150b host: libbladeRF: show percentage when doing flash ops
Calculate and display the progress percentage when performing
flash erase/read/write operations.
2018-12-21 01:28:17 -08:00
Rey Tucker
9e9d9126a7 host: bladerf2: formatting fix on prev commit
committed and pushed before running clang-format, oops
2018-12-21 01:28:17 -08:00
Rey Tucker
aefd8d3d3c host: bladerf2: move FPGA-tuning bug check ahead of env check
Permit overriding the fallback to host-based tuning by setting
the env variable.
2018-12-21 01:28:17 -08:00
Rey Tucker
74e3049306 hdl: update CHANGELOG 2018-12-21 01:28:17 -08:00
Rey Tucker
2227d110ab Bump FPGA to v0.10.2 fpga_v0.10.2
host: bladerf2: Disable FPGA tuning mode if using pre-v0.10.2
FPGA.
2018-12-17 20:36:16 -05:00
Rey Tucker
1f692be845 hdl: nios: add -DNUAND_MODIFICATIONS
bladeRF_nios needs NUAND_MODIFICATIONS to pick up local mods in
libad936x header files.
2018-12-17 20:28:07 -05:00
Rey Tucker
ddb0998a18 hdl: nios: adi: add -fshort-enums when building libad936x
libad936x needs -fshort-enums as well, so that structs line up
properly.

I believe this is mostly cosmetic in practice, as libad936x
manages its own memory, but it does cause some distress when
debugging.
2018-12-17 20:28:07 -05:00
Rey Tucker
1e45367785 thirdparty: adi: define ALTERA_PLATFORM for headless platform
libad936x needs ALTERA_PLATFORM because, apparently, memcpy
doesn't work properly on the Nios. This resulted in TX sample
rates being half of the expected value.
2018-12-17 20:28:07 -05:00
Rey Tucker
8fa6c84856 fpga_common: ad936x.h: sync with adi's structs 2018-12-17 20:28:07 -05:00
Rey Tucker
ac9b49226b hdl: nios/devices_rfic: fix TX gain ctrl, handle init fails better
fix validity bitmask for gain setting

 - This caused attempts to get/set TX gain to fail

improve init failure detection

 - Also check pdata for a null value, as this is a canary for a
   mismatch in struct alignments between libad936x and bladeRF_nios.

 - On failure, de-init and free and such.
2018-12-17 20:28:07 -05:00
Rey Tucker
9e5915993b hdl: ip/adi/no_OS: fix patch ordering
This was fixed for the Host CMakeFiles.txt, but did not get fixed
on the Nios side of things.

Fixes:

	-- libad936x: Applying patch: 0001-0bba46e-nuand-modifications.patch
	-- libad936x: Applying patch: 0006-0bba46e-compilefix.patch
	CMake Error at CMakeLists.txt:192 (message):
	  Failed to apply 0006-0bba46e-compilefix.patch: error: patch failed:
	  ad9361.c:40

	  error: ad9361.c: patch does not apply

	-- Configuring incomplete, errors occurred!
2018-12-12 18:44:51 -05:00