[rtems commit] bsp/qoriq: Do not touch MMU config for SMP start

Sebastian Huber sebh at rtems.org
Thu Mar 3 08:12:34 UTC 2016


Module:    rtems
Branch:    master
Commit:    73de9393e305e466028b60bcee84a7731043bf13
Changeset: http://git.rtems.org/rtems/commit/?id=73de9393e305e466028b60bcee84a7731043bf13

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Mar  2 13:32:44 2016 +0100

bsp/qoriq: Do not touch MMU config for SMP start

Assume that the boot page is visible in the currently unused heap area.

---

 c/src/lib/libbsp/powerpc/qoriq/startup/bspsmp.c    | 42 ++--------------------
 .../powerpc/qoriq/startup/linkcmds.qoriq_p1020rdb  |  2 +-
 2 files changed, 4 insertions(+), 40 deletions(-)

diff --git a/c/src/lib/libbsp/powerpc/qoriq/startup/bspsmp.c b/c/src/lib/libbsp/powerpc/qoriq/startup/bspsmp.c
index 119d3f0..e84058a 100644
--- a/c/src/lib/libbsp/powerpc/qoriq/startup/bspsmp.c
+++ b/c/src/lib/libbsp/powerpc/qoriq/startup/bspsmp.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013-2015 embedded brains GmbH.  All rights reserved.
+ * Copyright (c) 2013, 2016 embedded brains GmbH.  All rights reserved.
  *
  *  embedded brains GmbH
  *  Dornierstr. 4
@@ -147,12 +147,9 @@ static void bsp_inter_processor_interrupt(void *arg)
 static uboot_spin_table *spin_table_addr[QORIQ_CPU_COUNT / QORIQ_THREAD_COUNT];
 #endif
 
-static uint32_t discover_processors(uint32_t *boot_begin, uint32_t *boot_last)
+static uint32_t discover_processors(void)
 {
 #if defined(HAS_UBOOT)
-  *boot_begin = BOOT_BEGIN;
-  *boot_last = BOOT_LAST;
-
   return QORIQ_CPU_COUNT;
 #elif defined(U_BOOT_USE_FDT)
   const void *fdt = bsp_fdt_get();
@@ -185,9 +182,6 @@ static uint32_t discover_processors(uint32_t *boot_begin, uint32_t *boot_last)
     node = fdt_next_subnode(fdt, node);
   }
 
-  *boot_begin = begin;
-  *boot_last = last;
-
   return cpu * QORIQ_THREAD_COUNT;
 #endif
 }
@@ -197,24 +191,7 @@ uint32_t _CPU_SMP_Initialize(void)
   uint32_t cpu_count = 1;
 
   if (rtems_configuration_get_maximum_processors() > 0) {
-    qoriq_mmu_context mmu_context;
-    uint32_t boot_begin;
-    uint32_t boot_last;
-
-    cpu_count = discover_processors(&boot_begin, &boot_last);
-
-    qoriq_mmu_context_init(&mmu_context);
-    qoriq_mmu_add(
-      &mmu_context,
-      boot_begin,
-      boot_last,
-      0,
-      0,
-      FSL_EIS_MAS3_SR | FSL_EIS_MAS3_SW,
-      0
-    );
-    qoriq_mmu_partition(&mmu_context, TLB_COUNT);
-    qoriq_mmu_write_to_tlb1(&mmu_context, TLB_BEGIN);
+    cpu_count = discover_processors();
   }
 
   start_thread_if_necessary(0);
@@ -269,21 +246,8 @@ bool _CPU_SMP_Start_processor(uint32_t cpu_index)
 #endif
 }
 
-static void mmu_config_undo(void)
-{
-  int i;
-
-  for (i = TLB_BEGIN; i < TLB_END; ++i) {
-    qoriq_tlb1_invalidate(i);
-  }
-}
-
 void _CPU_SMP_Finalize_initialization(uint32_t cpu_count)
 {
-  if (rtems_configuration_get_maximum_processors() > 0) {
-    mmu_config_undo();
-  }
-
   if (cpu_count > 1) {
     rtems_status_code sc;
 
diff --git a/c/src/lib/libbsp/powerpc/qoriq/startup/linkcmds.qoriq_p1020rdb b/c/src/lib/libbsp/powerpc/qoriq/startup/linkcmds.qoriq_p1020rdb
index 7360843..9d1fed2 100644
--- a/c/src/lib/libbsp/powerpc/qoriq/startup/linkcmds.qoriq_p1020rdb
+++ b/c/src/lib/libbsp/powerpc/qoriq/startup/linkcmds.qoriq_p1020rdb
@@ -6,7 +6,7 @@
 
 MEMORY {
 	LOW : ORIGIN = 0x4000, LENGTH = 16M - 16k
-	HIGH : ORIGIN = 0x1000000, LENGTH = 32M
+	HIGH : ORIGIN = 0x1000000, LENGTH = 512M - 16M
 	EMPTY : ORIGIN = 0x0, LENGTH = 0
 }
 



More information about the vc mailing list