summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2017-04-03 10:05:51 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-04-03 14:07:58 +0200
commitf6e793a2cae956fabbb0e2db2ef9727176d1fc3a (patch)
tree5fe3fe4203cb2756d6795e691116363828d5df10
parent2ba996fa8931260bffc9514d26f48b4f52171705 (diff)
downloadrtems-f6e793a2cae956fabbb0e2db2ef9727176d1fc3a.tar.bz2
bsp/qoriq: Adjust MMU config only once
-rw-r--r--c/src/lib/libbsp/powerpc/qoriq/include/mmu.h2
-rw-r--r--c/src/lib/libbsp/powerpc/qoriq/start/start.S6
-rw-r--r--c/src/lib/libbsp/powerpc/qoriq/startup/mmu-config.c7
3 files changed, 10 insertions, 5 deletions
diff --git a/c/src/lib/libbsp/powerpc/qoriq/include/mmu.h b/c/src/lib/libbsp/powerpc/qoriq/include/mmu.h
index f08cc43384..2583bec761 100644
--- a/c/src/lib/libbsp/powerpc/qoriq/include/mmu.h
+++ b/c/src/lib/libbsp/powerpc/qoriq/include/mmu.h
@@ -78,7 +78,7 @@ void qoriq_mmu_write_to_tlb1(qoriq_mmu_context *self, int first_tlb);
void qoriq_mmu_change_perm(uint32_t test, uint32_t set, uint32_t clear);
-void qoriq_mmu_config(int first_tlb, int scratch_tlb);
+void qoriq_mmu_config(bool boot_processor, int first_tlb, int scratch_tlb);
void qoriq_tlb1_write(
int esel,
diff --git a/c/src/lib/libbsp/powerpc/qoriq/start/start.S b/c/src/lib/libbsp/powerpc/qoriq/start/start.S
index 6f6771d672..481b664bc4 100644
--- a/c/src/lib/libbsp/powerpc/qoriq/start/start.S
+++ b/c/src/lib/libbsp/powerpc/qoriq/start/start.S
@@ -120,6 +120,7 @@ _start:
bdnz .Lnull_area_setup_loop
.Lnull_area_setup_done:
+ li r3, 1
bl .Linitmmu
/* Clear SBSS */
@@ -232,8 +233,8 @@ _start:
mflr SAVED_LINK_REGISTER
/* Configure MMU */
- li r3, FIRST_TLB
- li r4, SCRATCH_TLB
+ li r4, FIRST_TLB
+ li r5, SCRATCH_TLB
bl qoriq_mmu_config
mtmsr INITIAL_MSR
isync
@@ -320,6 +321,7 @@ _start_secondary_processor:
mr START_STACK, r3
bl .Linitmore
+ li r3, 0
bl .Linitmmu
b bsp_start_on_secondary_processor
#endif /* RTEMS_SMP */
diff --git a/c/src/lib/libbsp/powerpc/qoriq/startup/mmu-config.c b/c/src/lib/libbsp/powerpc/qoriq/startup/mmu-config.c
index 3f385aa999..3e572302ab 100644
--- a/c/src/lib/libbsp/powerpc/qoriq/startup/mmu-config.c
+++ b/c/src/lib/libbsp/powerpc/qoriq/startup/mmu-config.c
@@ -191,12 +191,15 @@ static void TEXT config_fdt_adjust(void)
}
}
-void TEXT qoriq_mmu_config(int first_tlb, int scratch_tlb)
+void TEXT qoriq_mmu_config(bool boot_processor, int first_tlb, int scratch_tlb)
{
qoriq_mmu_context context;
int i = 0;
- config_fdt_adjust();
+ if (boot_processor) {
+ config_fdt_adjust();
+ }
+
qoriq_mmu_context_init(&context);
for (i = 0; i < QORIQ_TLB1_ENTRY_COUNT; ++i) {