aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Bellows <greg.bellows@linaro.org>2014-09-02 16:25:58 -0500
committerGreg Bellows <greg.bellows@linaro.org>2014-09-02 16:25:58 -0500
commit948cebb32d26551c099329c42db3a4720a97e23d (patch)
treed4d72f6e6181b3c5d8828be57719d3a237800c7e
parent37bbc2c304382196d588cdd8ac4b27c303fa2c4f (diff)
Add mapping entry for page table memory
- Added page table memory mapping to initialization so the page tables can be filled in during runtime. - Fixed locality of tztest_*_count variables. Signed-off-by: Greg Bellows <greg.bellows@linaro.org>
-rw-r--r--arm/tztest.c5
-rw-r--r--arm/tztest_nonsecure_svc.c7
-rw-r--r--arm/tztest_secure_svc.c8
3 files changed, 12 insertions, 8 deletions
diff --git a/arm/tztest.c b/arm/tztest.c
index 25be725..945181b 100644
--- a/arm/tztest.c
+++ b/arm/tztest.c
@@ -1,5 +1,10 @@
#include "tztest.h"
+extern volatile int _tztest_fail_count;
+extern volatile int _tztest_test_count;
+volatile int *tztest_fail_count = &_tztest_fail_count;
+volatile int *tztest_test_count = &_tztest_test_count;
+
/* Make the below globals volatile as found that the compiler uses the
* register value ratherh than the memory value making it look like the writes
* actually happened.
diff --git a/arm/tztest_nonsecure_svc.c b/arm/tztest_nonsecure_svc.c
index 5400df7..1edba41 100644
--- a/arm/tztest_nonsecure_svc.c
+++ b/arm/tztest_nonsecure_svc.c
@@ -12,13 +12,9 @@ extern uint32_t _nsecdata_size;
extern uint32_t _nsecstack_size;
extern uint32_t _shared_memory_heap_base;
extern uint32_t _common_memory_heap_base;
-extern volatile int _tztest_test_count;
-extern volatile int _tztest_fail_count;
extern volatile int _tztest_exception;
extern volatile int _tztest_exception_status;
extern volatile int _tztest_exception_addr;
-volatile int *tztest_test_count = &_tztest_test_count;
-volatile int *tztest_fail_count = &_tztest_fail_count;
volatile int *tztest_exception = &_tztest_exception;
volatile int *tztest_exception_addr = &_tztest_exception_addr;
volatile int *tztest_exception_status = &_tztest_exception_status;
@@ -137,6 +133,9 @@ void tztest_nonsecure_pagetable_init()
.type = PAGE, .len = nsecstack_size,
.attr = SHARED | NOTGLOBAL | WBA_CACHED | P1_R | P1_W | P0_R | P0_W |
NONSECURE },
+ {.va = (uint32_t)nsec_l1_page_table, .pa = (uint32_t)nsec_l1_page_table,
+ .type = SECTION, .len = 16*1024*1024,
+ .attr = SHARED | NOTGLOBAL | WBA_CACHED | P1_R | P1_W },
};
pagetable_init(nsec_l1_page_table);
diff --git a/arm/tztest_secure_svc.c b/arm/tztest_secure_svc.c
index 6722f3e..51fd80b 100644
--- a/arm/tztest_secure_svc.c
+++ b/arm/tztest_secure_svc.c
@@ -22,10 +22,6 @@ extern uint32_t _common_memory_heap_base;
extern volatile int _tztest_exception;
extern volatile int _tztest_exception_addr;
extern volatile int _tztest_exception_status;
-extern volatile int _tztest_test_count;
-extern volatile int _tztest_fail_count;
-volatile int *tztest_test_count = &_tztest_test_count;
-volatile int *tztest_fail_count = &_tztest_fail_count;
volatile int *tztest_exception = &_tztest_exception;
volatile int *tztest_exception_addr = &_tztest_exception_addr;
volatile int *tztest_exception_status = &_tztest_exception_status;
@@ -158,6 +154,7 @@ void tztest_secure_svc_loop(int initial_op, int initial_data)
DEBUG_MSG("Returned from secure SVC dispatch\n");
break;
}
+ op = SMC_YIELD;
__smc(op, data);
DEBUG_MSG("Handling smc op 0x%x\n", op);
}
@@ -177,6 +174,9 @@ void tztest_secure_pagetable_init()
{.va = (uint32_t)secstack_start, .pa = (uint32_t)secstack_start,
.type = PAGE, .len = secstack_size,
.attr = SHARED | NOTGLOBAL | WBA_CACHED | P1_R | P1_W | P0_R | P0_W },
+ {.va = (uint32_t)sec_l1_page_table, .pa = (uint32_t)sec_l1_page_table,
+ .type = SECTION, .len = 16*1024*1024,
+ .attr = SHARED | NOTGLOBAL | WBA_CACHED | P1_R | P1_W },
};
pagetable_init(sec_l1_page_table);