summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-02-06 11:38:29 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-02-06 15:35:55 +0100
commit4b53f1918bf8099ef53a5733b3996311137c6014 (patch)
treed9b1bc8b759a6661ff321005684a81b86f70ac39
parentbsp/mpc55xx: Merge RSM6 variants into one (diff)
downloadrtems-4b53f1918bf8099ef53a5733b3996311137c6014.tar.bz2
bsp/mpc55xx: Add MPC55XX_ENABLE_START_PROLOGUE
-rw-r--r--c/src/lib/libbsp/powerpc/mpc55xxevb/Makefile.am1
-rw-r--r--c/src/lib/libbsp/powerpc/mpc55xxevb/configure.ac3
-rw-r--r--c/src/lib/libbsp/powerpc/mpc55xxevb/include/mpc55xx-config.h15
-rw-r--r--c/src/lib/libbsp/powerpc/mpc55xxevb/startup/start-prologue.c28
-rw-r--r--c/src/lib/libbsp/powerpc/mpc55xxevb/startup/start.S4
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 682c2950f3..d98d0f6b59 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 154cd2503d..04d41fec4b 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 9db918a118..2868b93b53 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 0000000000..5e68d2dc37
--- /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@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 e8ae3c0db4..8d32f37ac3 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 */