summaryrefslogtreecommitdiff
path: root/cesar
diff options
context:
space:
mode:
authorJean-Philippe SAVE2012-10-19 14:05:08 +0200
committerJean-Philippe SAVE2012-10-19 16:06:31 +0200
commit031cbd2b327daff7ada4dfd7b719482a66c8c1dc (patch)
treeef564fbadb9d0f2d875ff35a089ee0cd62ac8d38 /cesar
parent2509bd5b6092da5f34e8f67960cacf8220f8f7bb (diff)
{cesar, cleo}/ipmbox: adapt init after moving DATA on RAM, closes #3441
- Change queues initialisation: now, all queues head and tail pointers are respectively set by plcdrv at the begining and end of there areas. Cesar just have, for all queues, to set the tail pointer at head pointer. - Unitary tests have also been updating.
Diffstat (limited to 'cesar')
-rw-r--r--cesar/hal/ipmbox/src/ipmbox.c9
-rw-r--r--cesar/hal/ipmbox/test/src/ipmbox.c19
2 files changed, 13 insertions, 15 deletions
diff --git a/cesar/hal/ipmbox/src/ipmbox.c b/cesar/hal/ipmbox/src/ipmbox.c
index b1a3b28197..046bdd458b 100644
--- a/cesar/hal/ipmbox/src/ipmbox.c
+++ b/cesar/hal/ipmbox/src/ipmbox.c
@@ -292,13 +292,8 @@ ipmbox_init (void)
+ ctx->queue[i][j].size;
}
}
- /* Reset the tail pointers for DATA queue. */
- ctx->queue[IPMBOX_QUEUE_DATA][IPMBOX_A2L].ptr->head =
- ctx->queue[IPMBOX_QUEUE_DATA][IPMBOX_A2L].ptr->tail;
- ctx->queue[IPMBOX_QUEUE_DATA][IPMBOX_L2A].ptr->tail =
- ctx->queue[IPMBOX_QUEUE_DATA][IPMBOX_L2A].ptr->head;
- /* Reset others queues. */
- for (i = IPMBOX_QUEUE_MBX; i < IPMBOX_QUEUE_DATA; i++)
+ /* Reset the tail pointer for queues. */
+ for (i = IPMBOX_QUEUE_MBX; i < IPMBOX_QUEUE_TYPE_NB; i++)
for (j = IPMBOX_A2L; j < IPMBOX_QUEUE_DIRECTION_NB; j++)
ctx->queue[i][j].ptr->tail = ctx->queue[i][j].ptr->head;
/* Stop all mailbox interrupts. */
diff --git a/cesar/hal/ipmbox/test/src/ipmbox.c b/cesar/hal/ipmbox/test/src/ipmbox.c
index d9ed882751..3c42a20bea 100644
--- a/cesar/hal/ipmbox/test/src/ipmbox.c
+++ b/cesar/hal/ipmbox/test/src/ipmbox.c
@@ -39,11 +39,11 @@ bool empty_buf_cb_called;
+ IPMBOX_PROTOCOL_QUEUE_SIZE_L2A_MBX \
+ IPMBOX_PROTOCOL_QUEUE_SIZE_L2A_DATA \
+ IPMBOX_PROTOCOL_QUEUE_SIZE_A2L_EMPTY_BUF \
- + 8)
+ + 12)
/* Shared memory offsets. */
#define SHMEM_PTR_ZONE 0
-#define SHMEM_A2L_MBX_QUEUE_BASE (SHMEM_PTR_ZONE + 8)
+#define SHMEM_A2L_MBX_QUEUE_BASE (SHMEM_PTR_ZONE + 12)
#define SHMEM_L2A_MBX_QUEUE_BASE (SHMEM_A2L_MBX_QUEUE_BASE \
+ IPMBOX_PROTOCOL_QUEUE_SIZE_A2L_MBX)
#define SHMEM_A2L_EMPTY_BUF_QUEUE_BASE (SHMEM_L2A_MBX_QUEUE_BASE \
@@ -100,8 +100,7 @@ ipmbox_t *
ipmbox_test_init (void)
{
/* Init fake regs. */
- regs.a2l_tail = (u32) &shared_mem[SHMEM_A2L_DATA_QUEUE_BASE
- + qsize[IPMBOX_QUEUE_DATA][IPMBOX_A2L] - 1];
+ regs.a2l_tail = (u32) INVALID_PTR;
regs.a2l_head = (u32) INVALID_PTR;
regs.l2a_head = (u32) &shared_mem[SHMEM_L2A_DATA_QUEUE_BASE];
regs.l2a_tail = (u32) INVALID_PTR;
@@ -115,6 +114,8 @@ ipmbox_test_init (void)
SHMEM_L2A_MBX_QUEUE_BASE,
SHMEM_A2L_EMPTY_BUF_QUEUE_BASE,
SHMEM_L2A_EMPTY_BUF_QUEUE_BASE,
+ SHMEM_A2L_DATA_QUEUE_BASE,
+ SHMEM_L2A_DATA_QUEUE_BASE,
};
ipmbox_queue_ptr_t *queue =
(ipmbox_queue_ptr_t*) &shared_mem[SHMEM_PTR_ZONE];
@@ -150,10 +151,6 @@ ipmbox_init_test_case (test_t t)
{
test_fail_unless (ctx->regs == IPMBOX_REG_BASE_ADDR);
/* Check mapping of queues' pointers. */
- test_fail_unless (ctx->queue[IPMBOX_QUEUE_DATA][IPMBOX_A2L].ptr
- == (ipmbox_queue_ptr_t*) &ctx->regs->a2l_tail);
- test_fail_unless (ctx->queue[IPMBOX_QUEUE_DATA][IPMBOX_L2A].ptr
- == (ipmbox_queue_ptr_t*) &ctx->regs->l2a_tail);
test_fail_unless (
ctx->queue[IPMBOX_QUEUE_MBX][IPMBOX_A2L].ptr
== (ipmbox_queue_ptr_t*) &shared_mem[SHMEM_PTR_ZONE]);
@@ -166,6 +163,12 @@ ipmbox_init_test_case (test_t t)
test_fail_unless (
ctx->queue[IPMBOX_QUEUE_EMPTY_BUF][IPMBOX_L2A].ptr
== (ipmbox_queue_ptr_t*) &shared_mem[SHMEM_PTR_ZONE + 6]);
+ test_fail_unless (
+ ctx->queue[IPMBOX_QUEUE_DATA][IPMBOX_A2L].ptr
+ == (ipmbox_queue_ptr_t*) &shared_mem[SHMEM_PTR_ZONE + 8]);
+ test_fail_unless (
+ ctx->queue[IPMBOX_QUEUE_DATA][IPMBOX_L2A].ptr
+ == (ipmbox_queue_ptr_t*) &shared_mem[SHMEM_PTR_ZONE + 10]);
u32 shmem_queue_base [][IPMBOX_QUEUE_DIRECTION_NB] = {
{SHMEM_A2L_MBX_QUEUE_BASE, SHMEM_L2A_MBX_QUEUE_BASE},