From c8d483c64ab07f3f73eeecd7c0a536167df6ca23 Mon Sep 17 00:00:00 2001 From: Jonathan Swinney Date: Tue, 18 Apr 2017 21:03:39 -0500 Subject: [PATCH] sdk: update fpga_pci_write_burst to support >= 16GiB writes --- sdk/userspace/fpga_libs/fpga_pci/fpga_pci.c | 8 ++++---- sdk/userspace/include/fpga_pci.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sdk/userspace/fpga_libs/fpga_pci/fpga_pci.c b/sdk/userspace/fpga_libs/fpga_pci/fpga_pci.c index 41c68949e..f965e3d6e 100644 --- a/sdk/userspace/fpga_libs/fpga_pci/fpga_pci.c +++ b/sdk/userspace/fpga_libs/fpga_pci/fpga_pci.c @@ -71,7 +71,7 @@ fpga_pci_bar_set_mem_base_size(pci_bar_handle_t handle, void *mem_base, size_t m } static inline void * -fpga_pci_bar_get_mem_at_offset(pci_bar_handle_t handle, uint64_t offset, uint32_t xaction_size) +fpga_pci_bar_get_mem_at_offset(pci_bar_handle_t handle, uint64_t offset, uint64_t xaction_size) { log_debug("handle=%d", handle); @@ -380,13 +380,13 @@ fpga_pci_peek64(pci_bar_handle_t handle, uint64_t offset, uint64_t *value) { return FPGA_ERR_FAIL; } -int fpga_pci_write_burst(pci_bar_handle_t handle, uint64_t offset, uint32_t* datap, uint32_t dword_len) { - uint32_t i; +int fpga_pci_write_burst(pci_bar_handle_t handle, uint64_t offset, uint32_t* datap, uint64_t dword_len) { + uint64_t i; log_debug("handle=%d, offset=0x%" PRIx64, handle, offset); /** get the pointer to the beginning of the range */ uint32_t *reg_ptr = (uint32_t *)fpga_pci_bar_get_mem_at_offset(handle, - offset,sizeof(uint32_t)*dword_len); + offset, sizeof(uint32_t)*dword_len); fail_on(!reg_ptr, err, "fpga_plat_get_mem_at_offset failed"); /** memcpy */ diff --git a/sdk/userspace/include/fpga_pci.h b/sdk/userspace/include/fpga_pci.h index f0b1923b8..b36b3260e 100644 --- a/sdk/userspace/include/fpga_pci.h +++ b/sdk/userspace/include/fpga_pci.h @@ -124,7 +124,7 @@ int fpga_pci_poke64(pci_bar_handle_t handle, uint64_t offset, uint64_t value); * @returns 0 on success, non-zero on error */ int fpga_pci_write_burst(pci_bar_handle_t handle, uint64_t offset, - uint32_t* datap, uint32_t dword_len); + uint32_t* datap, uint64_t dword_len); /** * Read a value from a register.