[PATCH 4/5] bsps/powerpc: Use default bsp_pretasking_hook()
Sebastian Huber
sebastian.huber at embedded-brains.de
Wed Dec 9 15:14:13 UTC 2015
Update #2408.
---
c/src/lib/libbsp/powerpc/Makefile.am | 2 +-
c/src/lib/libbsp/powerpc/beatnik/Makefile.am | 4 +-
.../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 +
.../lib/libbsp/powerpc/mvme3100/startup/bspstart.c | 7 ---
c/src/lib/libbsp/powerpc/mvme5500/Makefile.am | 4 +-
.../lib/libbsp/powerpc/mvme5500/startup/bspstart.c | 6 +-
.../powerpc/shared/startup/bsppredriverhook.c | 70 ++++++++++++++++++++++
.../libbsp/powerpc/shared/startup/pretaskinghook.c | 65 --------------------
10 files changed, 83 insertions(+), 83 deletions(-)
create mode 100644 c/src/lib/libbsp/powerpc/shared/startup/bsppredriverhook.c
delete mode 100644 c/src/lib/libbsp/powerpc/shared/startup/pretaskinghook.c
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/bsppredriverhook.c b/c/src/lib/libbsp/powerpc/shared/startup/bsppredriverhook.c
new file mode 100644
index 0000000..fc3916e
--- /dev/null
+++ b/c/src/lib/libbsp/powerpc/shared/startup/bsppredriverhook.c
@@ -0,0 +1,70 @@
+/*
+ * bsp_predriver_hook().
+ * Optionally initializes I2C and VME.
+ */
+
+/*
+ * COPYRIGHT (c) 1989-2014.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ *
+ * Modified to support the MCP750.
+ * Modifications Copyright (C) 1999 Eric Valette. valette at crf.canon.fr
+ */
+
+#include <string.h>
+
+#include <bsp.h>
+#include <bsp/bootcard.h>
+#ifndef BSP_HAS_NO_VME
+#include <bsp/VME.h>
+#endif
+
+#ifdef SHOW_MORE_INIT_SETTINGS
+#include <rtems/bspIo.h>
+#endif
+
+/*
+ * bsp_predriver_hook
+ *
+ * Description:
+ * BSP predriver hook. Called just before drivers are initialized.
+ *
+ * NOTES:
+ * Must not use libc (to do io) from here, since drivers are
+ * not yet initialized.
+ *
+ */
+
+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
+ */
+#ifndef BSP_HAS_NO_VME
+ /*
+ * Initialize VME bridge - needs working PCI
+ * and IRQ subsystems...
+ *
+ * NOTE: vmeUniverse driver now uses shared interrupts.
+ * this requires malloc/free which are not available
+ * from bspstart()...
+ */
+#ifdef SHOW_MORE_INIT_SETTINGS
+ printk("Going to initialize VME bridge\n");
+#endif
+ BSP_vme_config();
+#endif
+
+#ifdef SHOW_MORE_INIT_SETTINGS
+ printk("Leaving bsp_predriver_hook\n");
+#endif
+}
diff --git a/c/src/lib/libbsp/powerpc/shared/startup/pretaskinghook.c b/c/src/lib/libbsp/powerpc/shared/startup/pretaskinghook.c
deleted file mode 100644
index dbdf80e..0000000
--- a/c/src/lib/libbsp/powerpc/shared/startup/pretaskinghook.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * bsp_pretasking_hook().
- * Initializes the heap, libc and VME.
- */
-
-/*
- * COPYRIGHT (c) 1989-2014.
- * On-Line Applications Research Corporation (OAR).
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
- *
- * Modified to support the MCP750.
- * Modifications Copyright (C) 1999 Eric Valette. valette at crf.canon.fr
- */
-
-#include <string.h>
-
-#include <bsp.h>
-#include <bsp/bootcard.h>
-#ifndef BSP_HAS_NO_VME
-#include <bsp/VME.h>
-#endif
-
-#ifdef SHOW_MORE_INIT_SETTINGS
-#include <rtems/bspIo.h>
-#endif
-
-/*
- * bsp_pretasking_hook
- *
- * Description:
- * BSP pretasking hook. Called just before drivers are initialized.
- *
- * NOTES:
- * Must not use libc (to do io) from here, since drivers are
- * not yet initialized.
- *
- */
-
-void bsp_pretasking_hook(void)
-{
- /* Note that VME support may be omitted also by
- * providing a no-op BSP_vme_config routine
- */
-#ifndef BSP_HAS_NO_VME
- /*
- * Initialize VME bridge - needs working PCI
- * and IRQ subsystems...
- *
- * NOTE: vmeUniverse driver now uses shared interrupts.
- * this requires malloc/free which are not available
- * from bspstart()...
- */
-#ifdef SHOW_MORE_INIT_SETTINGS
- printk("Going to initialize VME bridge\n");
-#endif
- BSP_vme_config();
-#endif
-
-#ifdef SHOW_MORE_INIT_SETTINGS
- printk("Leaving bsp_pretasking_hook\n");
-#endif
-}
--
1.8.4.5
More information about the devel
mailing list