summaryrefslogtreecommitdiff
path: root/cleopatre/devkit/plcdrv/src/ipmbox.c
diff options
context:
space:
mode:
Diffstat (limited to 'cleopatre/devkit/plcdrv/src/ipmbox.c')
-rw-r--r--cleopatre/devkit/plcdrv/src/ipmbox.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/cleopatre/devkit/plcdrv/src/ipmbox.c b/cleopatre/devkit/plcdrv/src/ipmbox.c
index 567ce3e4a8..f2cf7786a2 100644
--- a/cleopatre/devkit/plcdrv/src/ipmbox.c
+++ b/cleopatre/devkit/plcdrv/src/ipmbox.c
@@ -205,10 +205,6 @@ ipmbox_init (ipmbox_ctx_t *ctx, struct net_device *dev,
/* Map registers. */
ctx->regs = (ipmbox_registers_t *) dev->base_addr;
- ctx->queue[IPMBOX_QUEUE_DATA][IPMBOX_A2L].ptr
- = (ipmbox_queue_ptr_t *) &ctx->regs->a2l_tail;
- ctx->queue[IPMBOX_QUEUE_DATA][IPMBOX_L2A].ptr
- = (ipmbox_queue_ptr_t *) &ctx->regs->l2a_tail;
/* Mask all interrupts. */
ctx->regs->l2a_it_mask = IPMBOX_L2A_IT | IPMBOX_L2A_IT_ACK
@@ -228,7 +224,7 @@ ipmbox_init (ipmbox_ctx_t *ctx, struct net_device *dev,
for (j = 0; j < IPMBOX_QUEUE_DIRECTION_NB; j++)
ctx->shared_mem_size += ctx->queue[i][j].size * sizeof (uint32_t);
ctx->shared_mem_size += sizeof (ipmbox_queue_ptr_t)
- * (IPMBOX_QUEUE_TYPE_NB - 1) * IPMBOX_QUEUE_DIRECTION_NB;
+ * IPMBOX_QUEUE_TYPE_NB * IPMBOX_QUEUE_DIRECTION_NB;
/* Allocate shared memory. */
ctx->shared_mem_virt_base_ptr = dma_alloc_coherent
@@ -244,7 +240,7 @@ ipmbox_init (ipmbox_ctx_t *ctx, struct net_device *dev,
/* Map queues pointers (but not for data, already done in register). */
shared_mem_base_ptr = ctx->shared_mem_virt_base_ptr;
- for (i = 0; i < IPMBOX_QUEUE_DATA; i++)
+ for (i = 0; i < IPMBOX_QUEUE_TYPE_NB; i++)
{
for (j = 0; j < IPMBOX_QUEUE_DIRECTION_NB; j++)
{
@@ -286,6 +282,9 @@ ipmbox_init (ipmbox_ctx_t *ctx, struct net_device *dev,
for (j = 0; j < IPMBOX_QUEUE_DIRECTION_NB; j++)
init_struct->queue_size[i][j] = ctx->queue[i][j].size;
+ /* Use L2A head register to pass init info structure address to Cesar. */
+ ctx->regs->l2a_head = ctx->queue[IPMBOX_QUEUE_DATA][IPMBOX_L2A].ptr->head;
+
/* Initialise lock. */
spin_lock_init (&ctx->a2l_mbx_queue_lock);