1
0
mirror of https://github.com/DigitalDevices/dddvb.git synced 2023-10-10 13:37:43 +02:00

add new maps for dma and i/o

This commit is contained in:
Ralph Metzler 2016-04-20 16:27:56 +02:00
parent a4062a1582
commit de16096894
4 changed files with 149 additions and 24 deletions

View File

@ -89,7 +89,7 @@ static void ddb_set_dma_table(struct ddb *dev, struct ddb_dma *dma)
ddbwritel(dev, mem & 0xffffffff, base + i * 8);
ddbwritel(dev, mem >> 32, base + i * 8 + 4);
}
dma->bufreg = (dma->div << 16) |
dma->bufval = (dma->div << 16) |
((dma->num & 0x1f) << 11) |
((dma->size >> 7) & 0x7ff);
}
@ -116,7 +116,7 @@ static void ddb_redirect_dma(struct ddb *dev,
u32 i, base;
u64 mem;
sdma->bufreg = ddma->bufreg;
sdma->bufval = ddma->bufval;
base = DMA_BASE_ADDRESS_TABLE + sdma->nr * 0x100;
for (i = 0; i < ddma->num; i++) {
mem = ddma->pbuf[i];
@ -351,7 +351,7 @@ static void ddb_output_start(struct ddb_output *output)
ddbwritel(dev, con2, TS_OUTPUT_CONTROL2(output->nr));
}
if (output->dma) {
ddbwritel(dev, output->dma->bufreg,
ddbwritel(dev, output->dma->bufval,
DMA_BUFFER_SIZE(output->dma->nr));
ddbwritel(dev, 0, DMA_BUFFER_ACK(output->dma->nr));
ddbwritel(dev, 1, DMA_BASE_READ);
@ -421,13 +421,13 @@ static void ddb_input_start(struct ddb_input *input)
input->dma->stat = 0;
ddbwritel(dev, 0, DMA_BUFFER_CONTROL(input->dma->nr));
}
ddbwritel(dev, 0, tag | TS_INPUT_CONTROL2(input->nr));
//ddbwritel(dev, 0, tag | TS_INPUT_CONTROL2(input->nr));
ddbwritel(dev, 0, tag | TS_INPUT_CONTROL(input->nr));
ddbwritel(dev, 2, tag | TS_INPUT_CONTROL(input->nr));
ddbwritel(dev, 0, tag | TS_INPUT_CONTROL(input->nr));
if (input->dma) {
ddbwritel(dev, input->dma->bufreg,
ddbwritel(dev, input->dma->bufval,
DMA_BUFFER_SIZE(input->dma->nr));
ddbwritel(dev, 0, DMA_BUFFER_ACK(input->dma->nr));
ddbwritel(dev, 1, DMA_BASE_WRITE);

View File

@ -156,7 +156,7 @@
/* ------------------------------------------------------------------------- */
/* I2C Master Controller */
#define I2C_BASE (0x80) /* Byte offset */
/*#define I2C_BASE (0x80) */
#define I2C_COMMAND (0x00)
#define I2C_TIMING (0x04)

View File

@ -329,6 +329,36 @@ fail:
/****************************************************************************/
/****************************************************************************/
static struct ddb_regset octopus_input = {
.base = 0x200,
.num = 0x08,
.size = 0x10,
};
static struct ddb_regset octopus_output = {
.base = 0x280,
.num = 0x08,
.size = 0x10,
};
static struct ddb_regset octopus_idma_buf = {
.base = 0x2000,
.num = 0x08,
.size = 0x100,
};
static struct ddb_regset octopus_odma = {
.base = 0x380,
.num = 0x04,
.size = 0x10,
};
static struct ddb_regset octopus_odma_buf = {
.base = 0x2800,
.num = 0x04,
.size = 0x100,
};
static struct ddb_regset octopus_i2c = {
.base = 0x80,
.num = 0x04,
@ -343,18 +373,115 @@ static struct ddb_regset octopus_i2c_buf = {
/****************************************************************************/
static struct ddb_regset octopro_input = {
.base = 0x400,
.num = 0xFile Edit Options Buffers Tools C Help
.base = 0x1000,
.num = 0x04,
.size = 0x200,
};
/****************************************************************************/
static struct ddb_regset octopro_input = {
.base = 0x400,
.num = 0x14,
.size = 0x10,
};
static struct ddb_regset octopro_output = {
.base = 0x600,
.num = 0x0a,
.size = 0x10,
};
static struct ddb_regset octopro_idma = {
.base = 0x800,
.num = 0x14,
.size = 0x10,
};
static struct ddb_regset octopro_odma = {
.base = 0x1000,
.num = 0x04,
.size = 0x200,
};
/****************************************************************************/
static struct ddb_regset octopro_input = {
.base = 0x400,
.num = 0x14,
.size = 0x10,
};
static struct ddb_regset octopro_output = {
.base = 0x600,
.num = 0x0a,
.size = 0x10,
};
static struct ddb_regset octopro_idma = {
.base = 0x800,
.num = 0x14,
.size = 0x10,
};
static struct ddb_regset octopro_idma_buf = {
.base = 0x4000,
.num = 0x14,
.size = 0x100,
};
static struct ddb_regset octopro_odma = {
.base = 0xa00,
.num = 0x0a,
.size = 0x10,
};
static struct ddb_regset octopro_odma_buf = {
.base = 0x6000,
.num = 0x0a,
.size = 0x100,
};
static struct ddb_regset octopro_i2c = {
.base = 0x2000,
.num = 0x0a,
.size = 0x20,
};
static struct ddb_regset octopro_i2c_buf = {
.base = 0x2000,
.num = 0x0a,
.size = 0x200,
};
/****************************************************************************/
/****************************************************************************/
static struct ddb_regmap octopus_map = {
.i2c = &octopus_i2c,
.i2c_buf = &octopus_i2c_buf,
.idma[0] = &octopus_idma,
.idma_buf[0] = &octopus_idma_buf,
.odma = &octopus_odma,
.odma_buf = &octopus_odma_buf,
};
static struct ddb_regmap octopus_net_map = {
.i2c = &octopus_i2c,
.i2c_buf = &octopus_i2c_buf,
static struct ddb_regmap octopro_map = {
.i2c = &octopro_i2c,
.i2c_buf = &octopro_i2c_buf,
.idma[0] = &octopro_idma,
.idma_buf[0] = &octopro_idma_buf,
.odma = &octopro_odma,
.odma_buf = &octopro_odma_buf,
};
static struct ddb_regmap octopus_mod_map = {
.odma = &octopus_odma,
.odma_buf = &octopus_odma_buf,
};
@ -519,16 +646,6 @@ static struct ddb_info ddb_mod = {
.temp_num = 1,
};
static struct ddb_info ddb_octopus_net = {
.type = DDB_OCTONET,
.name = "Digital Devices OctopusNet network DVB adapter",
.regmap = &octopus_net_map,
.port_num = 10,
.i2c_mask = 0x3ff,
.ns_num = 12,
.mdio_num = 1,
};
static struct ddb_info ddb_octopro_hdin = {
.type = DDB_OCTOPRO_HDIN,
.name = "Digital Devices OctopusNet Pro HDIN",
@ -541,7 +658,7 @@ static struct ddb_info ddb_octopro_hdin = {
static struct ddb_info ddb_octopro = {
.type = DDB_OCTOPRO,
.name = "Digital Devices OctopusNet Pro",
.regmap = &octopus_map,
.regmap = &octopro_map,
.port_num = 4,
.i2c_mask = 0x0f,
.mdio_num = 1,
@ -585,7 +702,7 @@ static const struct pci_device_id ddb_id_tbl[] __devinitconst = {
DDB_ID(DDVID, 0x0201, DDVID, 0x0001, ddb_mod),
DDB_ID(DDVID, 0x0201, DDVID, 0x0002, ddb_mod),
/* testing on OctopusNet Pro */
DDB_ID(DDVID, 0x0320, PCI_ANY_ID, PCI_ANY_ID, ddb_octopus_net),
DDB_ID(DDVID, 0x0320, PCI_ANY_ID, PCI_ANY_ID, ddb_octopro),
DDB_ID(DDVID, 0x0321, PCI_ANY_ID, PCI_ANY_ID, ddb_none),
DDB_ID(DDVID, 0x0322, PCI_ANY_ID, PCI_ANY_ID, ddb_octopro),
DDB_ID(DDVID, 0x0323, PCI_ANY_ID, PCI_ANY_ID, ddb_none),

View File

@ -116,10 +116,14 @@ struct ddb_regmap {
struct ddb_ports *bc;
struct ddb_regset *i2c;
struct ddb_regset *i2c_buf;
struct ddb_regset *dma;
struct ddb_regset *dma_buf;
struct ddb_regset *idma[4];
struct ddb_regset *idma_buf[4];
struct ddb_regset *odma;
struct ddb_regset *odma_buf;
struct ddb_regset *input;
struct ddb_regset *output;
struct ddb_regset *channel;
struct ddb_regset *ci;
struct ddb_regset *pid_filter;
@ -188,12 +192,15 @@ struct ddb_port;
struct ddb_dma {
void *io;
u32 nr;
u32 regs;
u32 bufregs;
dma_addr_t pbuf[DMA_MAX_BUFS];
u8 *vbuf[DMA_MAX_BUFS];
u32 num;
u32 size;
u32 div;
u32 bufreg;
u32 bufval;
#ifdef DDB_USE_WORK
struct work_struct work;
@ -245,6 +252,7 @@ struct ddb_ci {
struct ddb_io {
struct ddb_port *port;
u32 nr;
u32 regs;
struct ddb_dma *dma;
struct ddb_io *redo;
struct ddb_io *redi;