[rtems commit] bsp/mpc55xx: Add MPC55XX_ENABLE_START_PROLOGUE

Sebastian Huber sebh at rtems.org
Wed Feb 6 14:31:40 UTC 2013


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Feb  6 11:38:29 2013 +0100

bsp/mpc55xx: Add MPC55XX_ENABLE_START_PROLOGUE

---

 c/src/lib/libbsp/powerpc/mpc55xxevb/Makefile.am    |    1 +
 c/src/lib/libbsp/powerpc/mpc55xxevb/configure.ac   |    3 ++
 .../powerpc/mpc55xxevb/include/mpc55xx-config.h    |   15 ++++++++++
 .../powerpc/mpc55xxevb/startup/start-prologue.c    |   28 ++++++++++++++++++++
 .../lib/libbsp/powerpc/mpc55xxevb/startup/start.S  |    4 +++
 5 files changed, 51 insertions(+), 0 deletions(-)

diff --git a/c/src/lib/libbsp/powerpc/mpc55xxevb/Makefile.am b/c/src/lib/libbsp/powerpc/mpc55xxevb/Makefile.am
index 682c295..d98d0f6 100644
--- a/c/src/lib/libbsp/powerpc/mpc55xxevb/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/mpc55xxevb/Makefile.am
@@ -86,6 +86,7 @@ libbsp_a_SOURCES += startup/start-config-ebi-cs-cal.c
 libbsp_a_SOURCES += startup/start-config-mmu.c
 libbsp_a_SOURCES += startup/start-config-mmu-early.c
 libbsp_a_SOURCES += startup/start-config-siu-pcr.c
+libbsp_a_SOURCES += startup/start-prologue.c
 libbsp_a_SOURCES += startup/start-early.c
 libbsp_a_SOURCES += startup/start-cache.S
 libbsp_a_SOURCES += startup/start-clock.c
diff --git a/c/src/lib/libbsp/powerpc/mpc55xxevb/configure.ac b/c/src/lib/libbsp/powerpc/mpc55xxevb/configure.ac
index 154cd25..04d41fe 100644
--- a/c/src/lib/libbsp/powerpc/mpc55xxevb/configure.ac
+++ b/c/src/lib/libbsp/powerpc/mpc55xxevb/configure.ac
@@ -204,6 +204,9 @@ RTEMS_BSPOPTS_SET([MPC55XX_NEEDS_LOW_LEVEL_INIT],[mpc5674f_*app],[])
 RTEMS_BSPOPTS_SET([MPC55XX_NEEDS_LOW_LEVEL_INIT],[*],[1])
 RTEMS_BSPOPTS_HELP([MPC55XX_NEEDS_LOW_LEVEL_INIT],[if defined, do low level initialization])
 
+RTEMS_BSPOPTS_SET([MPC55XX_ENABLE_START_PROLOGUE],[mpc5674f_rsm6],[1])
+RTEMS_BSPOPTS_HELP([MPC55XX_ENABLE_START_PROLOGUE],[if defined, enable start prologue])
+
 AC_CONFIG_FILES([Makefile
 include/bspopts.h])
 
diff --git a/c/src/lib/libbsp/powerpc/mpc55xxevb/include/mpc55xx-config.h b/c/src/lib/libbsp/powerpc/mpc55xxevb/include/mpc55xx-config.h
index 9db918a..2868b93 100644
--- a/c/src/lib/libbsp/powerpc/mpc55xxevb/include/mpc55xx-config.h
+++ b/c/src/lib/libbsp/powerpc/mpc55xxevb/include/mpc55xx-config.h
@@ -117,6 +117,21 @@ extern BSP_START_DATA_SECTION const mpc55xx_clock_config
     mpc55xx_start_config_ebi_cal_cs_count [];
 #endif
 
+/**
+ * @brief Start prologue.
+ *
+ * In case the BSP enabled the MPC55XX_ENABLE_START_PROLOGUE option, then this
+ * function will be called directly after the Boot Assist Module (BAM) jumped
+ * to the start entry defined by the reset configuration.
+ *
+ * This function executes in the context initialized by the BAM.  There exists
+ * no valid stack pointer and the internal RAM has an invalid ECC state.
+ *
+ * The default implementation does nothing.  The application may provide its
+ * own implementation.
+ */
+void mpc55xx_start_prologue(void);
+
 void mpc55xx_start_early(void);
 
 void mpc55xx_start_flash(void);
diff --git a/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/start-prologue.c b/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/start-prologue.c
new file mode 100644
index 0000000..5e68d2d
--- /dev/null
+++ b/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/start-prologue.c
@@ -0,0 +1,28 @@
+/**
+ * @file
+ *
+ * @ingroup mpc55xx
+ *
+ * @brief Start prologue.
+ */
+
+/*
+ * Copyright (c) 2013 embedded brains GmbH.  All rights reserved.
+ *
+ *  embedded brains GmbH
+ *  Obere Lagerstr. 30
+ *  82178 Puchheim
+ *  Germany
+ *  <rtems at embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
+
+#include <bsp/mpc55xx-config.h>
+
+BSP_START_TEXT_SECTION void mpc55xx_start_prologue(void)
+{
+  /* Do nothing */
+}
diff --git a/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/start.S b/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/start.S
index e8ae3c0..8d32f37 100644
--- a/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/start.S
+++ b/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/start.S
@@ -80,6 +80,10 @@ mpc55xx_bootflag_1:
 
 _start:
 
+#ifdef MPC55XX_ENABLE_START_PROLOGUE
+	bl	mpc55xx_start_prologue
+#endif
+
 #ifdef MPC55XX_NEEDS_LOW_LEVEL_INIT
 
 	/* Enable SPE */




More information about the vc mailing list