[rtems commit] bsps/powerpc: Use default bsp_pretasking_hook()

Sebastian Huber sebh at rtems.org
Thu Dec 10 07:33:50 UTC 2015


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Dec  9 11:43:49 2015 +0100

bsps/powerpc: Use default bsp_pretasking_hook()

Update #2408.

---

 c/src/lib/libbsp/powerpc/Makefile.am                    |  2 +-
 c/src/lib/libbsp/powerpc/beatnik/Makefile.am            |  4 ++--
 c/src/lib/libbsp/powerpc/motorola_powerpc/Makefile.am   |  4 ++--
 c/src/lib/libbsp/powerpc/mvme3100/Makefile.am           |  3 ++-
 c/src/lib/libbsp/powerpc/mvme3100/include/bsp.h         |  1 +
 c/src/lib/libbsp/powerpc/mvme3100/startup/bspstart.c    |  7 -------
 c/src/lib/libbsp/powerpc/mvme5500/Makefile.am           |  4 ++--
 c/src/lib/libbsp/powerpc/mvme5500/startup/bspstart.c    |  6 +++---
 .../startup/{pretaskinghook.c => bsppredriverhook.c}    | 17 +++++++++++------
 9 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/c/src/lib/libbsp/powerpc/Makefile.am b/c/src/lib/libbsp/powerpc/Makefile.am
index 03a7b31..a2795f2 100644
--- a/c/src/lib/libbsp/powerpc/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/Makefile.am
@@ -58,7 +58,7 @@ EXTRA_DIST += shared/start/start.S shared/start/rtems_crti.S \
 ## shared/startup
 EXTRA_DIST += shared/startup/bspstart.c shared/startup/pgtbl_setup.c \
     shared/startup/pgtbl_activate.c shared/startup/linkcmds \
-	shared/startup/zerobss.c shared/startup/pretaskinghook.c
+	shared/startup/zerobss.c shared/startup/bsppredriverhook.c
 
 ## shared/tod
 EXTRA_DIST += shared/tod/todcfg.c
diff --git a/c/src/lib/libbsp/powerpc/beatnik/Makefile.am b/c/src/lib/libbsp/powerpc/beatnik/Makefile.am
index 24351ed..ec557f5 100644
--- a/c/src/lib/libbsp/powerpc/beatnik/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/beatnik/Makefile.am
@@ -61,13 +61,13 @@ libbsp_a_SOURCES += startup/bspstart.c \
     ../../powerpc/shared/startup/panic.c \
     ../../powerpc/shared/startup/bspgetworkarea.c \
     ../../powerpc/shared/startup/probeMemEnd.c \
-    ../../powerpc/shared/startup/pretaskinghook.c \
+    ../../powerpc/shared/startup/bsppredriverhook.c \
     ../../powerpc/shared/startup/zerobss.c \
     ../../powerpc/shared/startup/pgtbl_setup.c \
     ../../powerpc/shared/startup/pgtbl_activate.c \
     ../../powerpc/shared/startup/sbrk.c ../../shared/bootcard.c \
     startup/bspclean.c ../../shared/bsplibc.c ../../shared/bsppost.c \
-    ../../shared/bsppredriverhook.c \
+    ../../shared/bsppretaskinghook.c \
     ../../shared/gnatinstallhandler.c
 
 include_bsp_HEADERS += ../shared/motorola/vpd.h
diff --git a/c/src/lib/libbsp/powerpc/motorola_powerpc/Makefile.am b/c/src/lib/libbsp/powerpc/motorola_powerpc/Makefile.am
index 5e18b7e..a925d08 100644
--- a/c/src/lib/libbsp/powerpc/motorola_powerpc/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/motorola_powerpc/Makefile.am
@@ -43,8 +43,8 @@ libbsp_a_SOURCES =
 libbsp_a_SOURCES += ../../powerpc/shared/startup/bspstart.c \
  	../../powerpc/shared/startup/bspgetworkarea.c \
  	../../powerpc/shared/showbats.c \
- 	../../powerpc/shared/startup/pretaskinghook.c \
-        ../../shared/bsppredriverhook.c \
+    ../../powerpc/shared/startup/bsppredriverhook.c \
+        ../../shared/bsppretaskinghook.c \
  	../../powerpc/shared/startup/zerobss.c \
     ../../powerpc/shared/startup/pgtbl_setup.c \
     ../../powerpc/shared/startup/pgtbl_activate.c \
diff --git a/c/src/lib/libbsp/powerpc/mvme3100/Makefile.am b/c/src/lib/libbsp/powerpc/mvme3100/Makefile.am
index 22e793e..9c39e01 100644
--- a/c/src/lib/libbsp/powerpc/mvme3100/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/mvme3100/Makefile.am
@@ -51,10 +51,11 @@ libbsp_a_SOURCES =
 # startup
 libbsp_a_SOURCES += startup/bspstart.c \
     startup/misc.c ../../powerpc/shared/startup/bspgetworkarea.c \
-    ../../powerpc/shared/startup/pretaskinghook.c \
+    ../../powerpc/shared/startup/bsppredriverhook.c \
     ../../powerpc/shared/startup/zerobss.c \
     ../../powerpc/shared/startup/sbrk.c ../../shared/bootcard.c \
     ../../shared/bspclean.c ../../shared/bsplibc.c ../../shared/bsppost.c \
+    ../../shared/bsppretaskinghook.c \
     ../../shared/gnatinstallhandler.c
 # tod
 libbsp_a_SOURCES += ../../shared/tod.c tod/todcfg.c
diff --git a/c/src/lib/libbsp/powerpc/mvme3100/include/bsp.h b/c/src/lib/libbsp/powerpc/mvme3100/include/bsp.h
index a6a6976..9ef360c 100644
--- a/c/src/lib/libbsp/powerpc/mvme3100/include/bsp.h
+++ b/c/src/lib/libbsp/powerpc/mvme3100/include/bsp.h
@@ -178,6 +178,7 @@ extern "C" {
  *
  */
 int BSP_i2c_initialize(void);
+#define BSP_PREDRIVER_I2C_INIT
 
 /* System Control Register */
 #define BSP_MVME3100_SYS_CR				((volatile uint8_t *)0xe2000001)
diff --git a/c/src/lib/libbsp/powerpc/mvme3100/startup/bspstart.c b/c/src/lib/libbsp/powerpc/mvme3100/startup/bspstart.c
index d384f55..6ab2864 100644
--- a/c/src/lib/libbsp/powerpc/mvme3100/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/mvme3100/startup/bspstart.c
@@ -201,13 +201,6 @@ BSP_calc_freqs( void )
   printk("CPU Clock Freq:                    %10u Hz\n", BSP_processor_frequency);
 }
 
-void
-bsp_predriver_hook(void)
-{
-  /* Some drivers (RTC) may need i2c */
-  BSP_i2c_initialize();
-}
-
 /*
  *  bsp_start
  *
diff --git a/c/src/lib/libbsp/powerpc/mvme5500/Makefile.am b/c/src/lib/libbsp/powerpc/mvme5500/Makefile.am
index 805a1f9..3e64af1 100644
--- a/c/src/lib/libbsp/powerpc/mvme5500/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/mvme5500/Makefile.am
@@ -29,11 +29,11 @@ EXTRA_DIST = startup/bootpstuff.c
 # startup
 libbsp_a_SOURCES += startup/bspstart.c \
     ../../powerpc/shared/startup/pgtbl_setup.c startup/pgtbl_activate.c \
-    ../../powerpc/shared/startup/pretaskinghook.c \
+    ../../powerpc/shared/startup/bsppredriverhook.c \
     ../../powerpc/shared/startup/zerobss.c \
     ../../powerpc/shared/startup/bspgetworkarea.c \
     ../../powerpc/shared/startup/sbrk.c ../../shared/bootcard.c \
-    ../../shared/bsppredriverhook.c startup/bspclean.c \
+    ../../shared/bsppretaskinghook.c startup/bspclean.c \
     ../../shared/bsplibc.c ../../shared/bsppost.c \
     ../../shared/gnatinstallhandler.c startup/bspreset.c \
     ../../powerpc/shared/startup/probeMemEnd.c
diff --git a/c/src/lib/libbsp/powerpc/mvme5500/startup/bspstart.c b/c/src/lib/libbsp/powerpc/mvme5500/startup/bspstart.c
index e921b71..c37de68 100644
--- a/c/src/lib/libbsp/powerpc/mvme5500/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/mvme5500/startup/bspstart.c
@@ -144,14 +144,14 @@ void _BSP_Fatal_error(unsigned int v)
  *
  * 0..RTEMS..__rtems_end | INIT_STACK | IRQ_STACK | ...... | workspace | TOP
  *
- * and later calls our pretasking_hook() which ends up initializing
+ * and later calls our bsp_predriver_hook() which ends up initializing
  * libc which in turn initializes the heap
  *
  * 0..RTEMS..__rtems_end | INIT_STACK | IRQ_STACK | heap | workspace | TOP
  *
  * The idea here is to first move the commandline to the future 'heap' area
- * from where it will be picked up by our pretasking_hook().
- * pretasking_hook() then moves it either to INIT_STACK or the workspace
+ * from where it will be picked up by our bsp_predriver_hook().
+ * bsp_predriver_hook() then moves it either to INIT_STACK or the workspace
  * area using proper allocation, initializes libc and finally moves
  * the data to the environment / malloced areas...
  */
diff --git a/c/src/lib/libbsp/powerpc/shared/startup/pretaskinghook.c b/c/src/lib/libbsp/powerpc/shared/startup/bsppredriverhook.c
similarity index 78%
rename from c/src/lib/libbsp/powerpc/shared/startup/pretaskinghook.c
rename to c/src/lib/libbsp/powerpc/shared/startup/bsppredriverhook.c
index dbdf80e..fc3916e 100644
--- a/c/src/lib/libbsp/powerpc/shared/startup/pretaskinghook.c
+++ b/c/src/lib/libbsp/powerpc/shared/startup/bsppredriverhook.c
@@ -1,6 +1,6 @@
 /*
- *  bsp_pretasking_hook().
- *  Initializes the heap, libc and VME.
+ *  bsp_predriver_hook().
+ *  Optionally initializes I2C and VME.
  */
 
 /*
@@ -28,10 +28,10 @@
 #endif
 
 /*
- *  bsp_pretasking_hook
+ *  bsp_predriver_hook
  *
  *  Description:
- *      BSP pretasking hook.  Called just before drivers are initialized.
+ *      BSP predriver hook.  Called just before drivers are initialized.
  *
  *  NOTES:
  *      Must not use libc (to do io) from here, since drivers are
@@ -39,8 +39,13 @@
  *
  */
 
-void bsp_pretasking_hook(void)
+void bsp_predriver_hook(void)
 {
+#ifdef BSP_PREDRIVER_I2C_INIT
+  /* Some drivers (RTC) may need i2c */
+  BSP_i2c_initialize();
+#endif
+
   /* Note that VME support may be omitted also by
    * providing a no-op  BSP_vme_config routine
    */
@@ -60,6 +65,6 @@ void bsp_pretasking_hook(void)
 #endif
 
 #ifdef SHOW_MORE_INIT_SETTINGS
-  printk("Leaving bsp_pretasking_hook\n");
+  printk("Leaving bsp_predriver_hook\n");
 #endif
 }




More information about the vc mailing list