[rtems commit] bsp/mpc5200: Add and use enable_bat_4_to_7()

Sebastian Huber sebh at rtems.org
Tue Apr 23 07:54:58 UTC 2013


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Apr 17 15:57:20 2013 +0200

bsp/mpc5200: Add and use enable_bat_4_to_7()

---

 c/src/lib/libbsp/powerpc/gen5200/startup/cpuinit.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/c/src/lib/libbsp/powerpc/gen5200/startup/cpuinit.c b/c/src/lib/libbsp/powerpc/gen5200/startup/cpuinit.c
index 13f98b8..6a1a810 100644
--- a/c/src/lib/libbsp/powerpc/gen5200/startup/cpuinit.c
+++ b/c/src/lib/libbsp/powerpc/gen5200/startup/cpuinit.c
@@ -112,11 +112,16 @@ static void calc_dbat_regvals(
   bat_ptr->batl.pp   = flg_bpp;
 }
 
+static inline enable_bat_4_to_7(void)
+{
+  PPC_SET_SPECIAL_PURPOSE_REGISTER_BITS(HID2, BSP_BBIT32(13));
+}
+
 static void cpu_init_bsp(void)
 {
-#if defined (MPC5200_BOARD_BRS5L)
   BAT dbat;
 
+#if defined(MPC5200_BOARD_BRS5L)
   calc_dbat_regvals(
     &dbat,
     (uint32_t) bsp_ram_start,
@@ -165,7 +170,6 @@ static void cpu_init_bsp(void)
   );
   SET_DBAT(3,dbat.batu,dbat.batl);
 #elif defined (HAS_UBOOT)
-  BAT dbat;
   uint32_t start = 0;
 
   /*
@@ -252,8 +256,7 @@ static void cpu_init_bsp(void)
 #endif
 
 #if defined(MPC5200_BOARD_DP2)
-  /* Enable BAT4-7 */
-  PPC_SET_SPECIAL_PURPOSE_REGISTER_BITS(HID2, BSP_BBIT32(13));
+  enable_bat_4_to_7();
 
   /* FPGA */
   calc_dbat_regvals(
@@ -268,8 +271,7 @@ static void cpu_init_bsp(void)
   );
   SET_DBAT(4, dbat.batu, dbat.batl);
 #elif defined(MPC5200_BOARD_PM520_ZE30)
-  /* Enable BAT4-7 */
-  PPC_SET_SPECIAL_PURPOSE_REGISTER_BITS(HID2, BSP_BBIT32(13));
+  enable_bat_4_to_7();
 
   /* External CC770 CAN controller available in version 2 */
   calc_dbat_regvals(




More information about the vc mailing list