[rtems commit] bsp/mpc55xx: Add MPC55XX_SYSTEM_CLOCK_DIVIDER

Sebastian Huber sebh at rtems.org
Wed Jul 18 07:44:02 UTC 2012


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Jul 18 09:26:13 2012 +0200

bsp/mpc55xx: Add MPC55XX_SYSTEM_CLOCK_DIVIDER

---

 c/src/lib/libbsp/powerpc/mpc55xxevb/configure.ac   |    5 +++++
 .../libbsp/powerpc/mpc55xxevb/include/bspopts.h.in |    3 +++
 .../libbsp/powerpc/mpc55xxevb/startup/bspstart.c   |    7 +------
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/c/src/lib/libbsp/powerpc/mpc55xxevb/configure.ac b/c/src/lib/libbsp/powerpc/mpc55xxevb/configure.ac
index 68b90e2..6b1926e 100644
--- a/c/src/lib/libbsp/powerpc/mpc55xxevb/configure.ac
+++ b/c/src/lib/libbsp/powerpc/mpc55xxevb/configure.ac
@@ -73,6 +73,11 @@ RTEMS_BSPOPTS_SET([MPC55XX_FMPLL_MFD],[*]     ,[12])
 RTEMS_BSPOPTS_HELP([MPC55XX_FMPLL_MFD],
 [Must be defined to be the PLL multiplication factor for clock generation])
 
+RTEMS_BSPOPTS_SET([MPC55XX_SYSTEM_CLOCK_DIVIDER],[mpc5674f*],[2])
+RTEMS_BSPOPTS_SET([MPC55XX_SYSTEM_CLOCK_DIVIDER],[*],[1])
+RTEMS_BSPOPTS_HELP([MPC55XX_SYSTEM_CLOCK_DIVIDER],
+[system clock divider])
+
 RTEMS_BSPOPTS_SET([MPC55XX_EMIOS_PRESCALER],[gwlcfm],[66])
 RTEMS_BSPOPTS_SET([MPC55XX_EMIOS_PRESCALER],[mpc5643l*],[])
 RTEMS_BSPOPTS_SET([MPC55XX_EMIOS_PRESCALER],[*]     ,[1])
diff --git a/c/src/lib/libbsp/powerpc/mpc55xxevb/include/bspopts.h.in b/c/src/lib/libbsp/powerpc/mpc55xxevb/include/bspopts.h.in
index 1be8513..25f9e3b 100644
--- a/c/src/lib/libbsp/powerpc/mpc55xxevb/include/bspopts.h.in
+++ b/c/src/lib/libbsp/powerpc/mpc55xxevb/include/bspopts.h.in
@@ -83,6 +83,9 @@
    generation */
 #undef MPC55XX_REFERENCE_CLOCK
 
+/* system clock divider */
+#undef MPC55XX_SYSTEM_CLOCK_DIVIDER
+
 /* Define to the address where bug reports for this package should be sent. */
 #undef PACKAGE_BUGREPORT
 
diff --git a/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/bspstart.c b/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/bspstart.c
index d511a43..dc1d632 100644
--- a/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/bspstart.c
@@ -95,11 +95,6 @@ void bsp_start(void)
 	rtems_status_code sc = RTEMS_SUCCESSFUL;
 	ppc_cpu_id_t myCpu;
 	ppc_cpu_revision_t myCpuRevision;
-#if defined(MPC55XX_BOARD_MPC5674FEVB)
-        unsigned system_clock_divider = 2;
-#else
-        unsigned system_clock_divider = 1;
-#endif
 
         null_pointer_protection();
 
@@ -119,7 +114,7 @@ void bsp_start(void)
 	/*
 	 * determine clock speed
 	 */
-	bsp_clock_speed = mpc55xx_get_system_clock() / system_clock_divider;
+	bsp_clock_speed = mpc55xx_get_system_clock() / MPC55XX_SYSTEM_CLOCK_DIVIDER;
 
 	/* Time reference value */
 	bsp_clicks_per_usec = bsp_clock_speed / 1000000;




More information about the vc mailing list