mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-04 12:52:15 +00:00
Add support for extended descriptor format to Altera mSGDMA driver.
The format to use depends on hardware configuration (synthesis-time), so make it compile-time kernel option. Extended format allows DMA engine to operate with 64-bit memory addresses. Sponsored by: DARPA, AFRL
This commit is contained in:
parent
f45e9414cf
commit
2593e9dcb2
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=349466
sys
@ -861,6 +861,12 @@ AH_INTERRUPT_DEBUGGING opt_ah.h
|
||||
# XXX do not use this for AR9130
|
||||
AH_AR5416_INTERRUPT_MITIGATION opt_ah.h
|
||||
|
||||
# options for the Altera mSGDMA driver (altera_msgdma)
|
||||
ALTERA_MSGDMA_DESC_STD opt_altera_msgdma.h
|
||||
ALTERA_MSGDMA_DESC_EXT opt_altera_msgdma.h
|
||||
ALTERA_MSGDMA_DESC_PF_STD opt_altera_msgdma.h
|
||||
ALTERA_MSGDMA_DESC_PF_EXT opt_altera_msgdma.h
|
||||
|
||||
# options for the Broadcom BCM43xx driver (bwi)
|
||||
BWI_DEBUG opt_bwi.h
|
||||
BWI_DEBUG_VERBOSE opt_bwi.h
|
||||
|
@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include <dev/xdma/xdma.h>
|
||||
#include "xdma_if.h"
|
||||
#include "opt_altera_msgdma.h"
|
||||
|
||||
#include <dev/altera/msgdma/msgdma.h>
|
||||
|
||||
@ -470,8 +471,8 @@ msgdma_channel_submit_sg(device_t dev, struct xdma_channel *xchan,
|
||||
struct msgdma_channel *chan;
|
||||
struct msgdma_desc *desc;
|
||||
struct msgdma_softc *sc;
|
||||
uint32_t src_addr_lo;
|
||||
uint32_t dst_addr_lo;
|
||||
bus_addr_t src_addr_lo;
|
||||
bus_addr_t dst_addr_lo;
|
||||
uint32_t len;
|
||||
uint32_t tmp;
|
||||
int i;
|
||||
@ -481,14 +482,18 @@ msgdma_channel_submit_sg(device_t dev, struct xdma_channel *xchan,
|
||||
chan = (struct msgdma_channel *)xchan->chan;
|
||||
|
||||
for (i = 0; i < sg_n; i++) {
|
||||
src_addr_lo = (uint32_t)sg[i].src_addr;
|
||||
dst_addr_lo = (uint32_t)sg[i].dst_addr;
|
||||
src_addr_lo = sg[i].src_addr;
|
||||
dst_addr_lo = sg[i].dst_addr;
|
||||
len = (uint32_t)sg[i].len;
|
||||
|
||||
dprintf("%s: src %x dst %x len %d\n", __func__,
|
||||
src_addr_lo, dst_addr_lo, len);
|
||||
|
||||
desc = chan->descs[chan->idx_head];
|
||||
#if defined(ALTERA_MSGDMA_DESC_EXT) || defined(ALTERA_MSGDMA_DESC_PF_EXT)
|
||||
desc->read_hi = htole32(src_addr_lo >> 32);
|
||||
desc->write_hi = htole32(dst_addr_lo >> 32);
|
||||
#endif
|
||||
desc->read_lo = htole32(src_addr_lo);
|
||||
desc->write_lo = htole32(dst_addr_lo);
|
||||
desc->length = htole32(len);
|
||||
|
@ -30,6 +30,8 @@
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#include "opt_altera_msgdma.h"
|
||||
|
||||
/* Altera mSGDMA registers. */
|
||||
#define DMA_STATUS 0x00
|
||||
#define STATUS_RESETTING (1 << 6)
|
||||
@ -75,15 +77,36 @@
|
||||
#define WRITE4_DESC(_sc, _reg, _val) \
|
||||
bus_space_write_4(_sc->bst_d, _sc->bsh_d, _reg, htole32(_val))
|
||||
|
||||
/* Prefetcher-disabled descriptor format. */
|
||||
struct msgdma_desc_nonpf {
|
||||
uint32_t src_addr;
|
||||
uint32_t dst_addr;
|
||||
#if defined(ALTERA_MSGDMA_DESC_STD)
|
||||
|
||||
/* Standard descriptor format with prefetcher disabled. */
|
||||
struct msgdma_desc {
|
||||
uint32_t read_lo;
|
||||
uint32_t write_lo;
|
||||
uint32_t length;
|
||||
uint32_t control;
|
||||
};
|
||||
|
||||
/* Prefetcher-enabled descriptor format. */
|
||||
#elif defined(ALTERA_MSGDMA_DESC_EXT)
|
||||
|
||||
/* Extended descriptor format with prefetcher disabled. */
|
||||
struct msgdma_desc {
|
||||
uint32_t read_lo;
|
||||
uint32_t write_lo;
|
||||
uint32_t length;
|
||||
uint8_t write_burst;
|
||||
uint8_t read_burst;
|
||||
uint16_t seq_num;
|
||||
uint16_t write_stride;
|
||||
uint16_t read_stride;
|
||||
uint32_t read_hi;
|
||||
uint32_t write_hi;
|
||||
uint32_t control;
|
||||
};
|
||||
|
||||
#elif defined(ALTERA_MSGDMA_DESC_PF_STD)
|
||||
|
||||
/* Standard descriptor format with prefetcher enabled. */
|
||||
struct msgdma_desc {
|
||||
uint32_t read_lo;
|
||||
uint32_t write_lo;
|
||||
@ -94,3 +117,34 @@ struct msgdma_desc {
|
||||
uint32_t reserved;
|
||||
uint32_t control;
|
||||
};
|
||||
|
||||
#elif defined(ALTERA_MSGDMA_DESC_PF_EXT)
|
||||
|
||||
/* Extended descriptor format with prefetcher enabled. */
|
||||
struct msgdma_desc {
|
||||
uint32_t read_lo;
|
||||
uint32_t write_lo;
|
||||
uint32_t length;
|
||||
uint32_t next;
|
||||
uint32_t transferred;
|
||||
uint32_t status;
|
||||
uint32_t reserved;
|
||||
uint8_t write_burst;
|
||||
uint8_t read_burst;
|
||||
uint16_t seq_num;
|
||||
uint16_t write_stride;
|
||||
uint16_t read_stride;
|
||||
uint32_t read_hi;
|
||||
uint32_t write_hi;
|
||||
uint32_t next_hi;
|
||||
uint32_t reserved1;
|
||||
uint32_t reserved2;
|
||||
uint32_t reserved3;
|
||||
uint32_t control;
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
#error "mSGDMA descriptor format (kernel option) is not set."
|
||||
|
||||
#endif
|
||||
|
@ -44,6 +44,7 @@ options DEVICE_POLLING
|
||||
#
|
||||
# DMA support
|
||||
#
|
||||
options ALTERA_MSGDMA_DESC_PF_STD
|
||||
device xdma
|
||||
device altera_softdma
|
||||
device altera_msgdma
|
||||
|
Loading…
Reference in New Issue
Block a user