[rtems commit] powerpc/mpc55xx: BSP variant changes for MPC5643L

Sebastian Huber sebh at rtems.org
Tue Jun 5 15:42:00 UTC 2012


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue May 22 17:21:28 2012 +0200

powerpc/mpc55xx: BSP variant changes for MPC5643L

---

 c/src/lib/libbsp/powerpc/mpc55xxevb/Makefile.am    |    3 +-
 c/src/lib/libbsp/powerpc/mpc55xxevb/configure.ac   |   41 ++++++++-----------
 .../libbsp/powerpc/mpc55xxevb/include/bspopts.h.in |    5 +--
 .../custom/{xkt564levb.cfg => mpc5643l_dpu.cfg}    |    2 +-
 .../custom/{xkt564levb.cfg => mpc5643l_evb.cfg}    |    0
 c/src/lib/libbsp/powerpc/mpc55xxevb/preinstall.am  |   12 ++++--
 .../powerpc/mpc55xxevb/startup/get-system-clock.c  |    6 +-
 .../mpc55xxevb/startup/linkcmds.mpc5643l_dpu       |    1 +
 .../{linkcmds.xkt564levb => linkcmds.mpc5643l_evb} |   12 +++---
 .../mpc55xxevb/startup/start-config-clock.c        |   14 ++++++-
 10 files changed, 51 insertions(+), 45 deletions(-)

diff --git a/c/src/lib/libbsp/powerpc/mpc55xxevb/Makefile.am b/c/src/lib/libbsp/powerpc/mpc55xxevb/Makefile.am
index 24b0797..606e9b7 100644
--- a/c/src/lib/libbsp/powerpc/mpc55xxevb/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/mpc55xxevb/Makefile.am
@@ -25,9 +25,10 @@ dist_project_lib_DATA += startup/linkcmds.mpc55xx
 dist_project_lib_DATA += startup/linkcmds.gwlcfm
 dist_project_lib_DATA += startup/linkcmds.mpc5566evb
 dist_project_lib_DATA += startup/linkcmds.mpc5566evb_spe
+dist_project_lib_DATA += startup/linkcmds.mpc5643l_evb
+dist_project_lib_DATA += startup/linkcmds.mpc5643l_dpu
 dist_project_lib_DATA += startup/linkcmds.mpc5674fevb
 dist_project_lib_DATA += startup/linkcmds.mpc5674fevb_spe
-dist_project_lib_DATA += startup/linkcmds.xkt564levb
 dist_project_lib_DATA += startup/linkcmds.phycore_mpc5554
 
 noinst_LIBRARIES += libbsp.a
diff --git a/c/src/lib/libbsp/powerpc/mpc55xxevb/configure.ac b/c/src/lib/libbsp/powerpc/mpc55xxevb/configure.ac
index 6bc0eb4..cd7c066 100644
--- a/c/src/lib/libbsp/powerpc/mpc55xxevb/configure.ac
+++ b/c/src/lib/libbsp/powerpc/mpc55xxevb/configure.ac
@@ -24,21 +24,17 @@ RTEMS_CHECK_NETWORKING
 AM_CONDITIONAL(HAS_NETWORKING,test "$HAS_NETWORKING" = "yes")
 
 RTEMS_BSPOPTS_SET_DATA_CACHE_ENABLED([gwlcfm],[])
-RTEMS_BSPOPTS_SET_DATA_CACHE_ENABLED([xkt564levb],[])
-RTEMS_BSPOPTS_SET_DATA_CACHE_ENABLED([mpc5566evb*],[1])
-RTEMS_BSPOPTS_SET_DATA_CACHE_ENABLED([mpc5674fevb*],[1])
+RTEMS_BSPOPTS_SET_DATA_CACHE_ENABLED([mpc5643l*],[])
 RTEMS_BSPOPTS_SET_DATA_CACHE_ENABLED([*],[1])
 RTEMS_BSPOPTS_HELP_DATA_CACHE_ENABLED
 
 RTEMS_BSPOPTS_SET_INSTRUCTION_CACHE_ENABLED([gwlcfm],[])
-RTEMS_BSPOPTS_SET_INSTRUCTION_CACHE_ENABLED([mpc5566evb*],[1])
-RTEMS_BSPOPTS_SET_INSTRUCTION_CACHE_ENABLED([mpc5674fevb*],[1])
 RTEMS_BSPOPTS_SET_INSTRUCTION_CACHE_ENABLED([*],[1])
 RTEMS_BSPOPTS_HELP_INSTRUCTION_CACHE_ENABLED
 
-RTEMS_BSPOPTS_SET([BSP_INTERRUPT_HANDLER_TABLE_SIZE],[mpc5674fevb*],[255])
-RTEMS_BSPOPTS_SET([BSP_INTERRUPT_HANDLER_TABLE_SIZE],[xkt564levb*],[127])
-RTEMS_BSPOPTS_SET([BSP_INTERRUPT_HANDLER_TABLE_SIZE],[mpc5566evb*],[127])
+RTEMS_BSPOPTS_SET([BSP_INTERRUPT_HANDLER_TABLE_SIZE],[mpc5643l*],[127])
+RTEMS_BSPOPTS_SET([BSP_INTERRUPT_HANDLER_TABLE_SIZE],[mpc5566*],[127])
+RTEMS_BSPOPTS_SET([BSP_INTERRUPT_HANDLER_TABLE_SIZE],[mpc5674f*],[255])
 RTEMS_BSPOPTS_SET([BSP_INTERRUPT_HANDLER_TABLE_SIZE],[*],[63])
 RTEMS_BSPOPTS_HELP([BSP_INTERRUPT_HANDLER_TABLE_SIZE],
 [defines the maximum number of interrupt handlers])
@@ -51,11 +47,11 @@ RTEMS_BSPOPTS_SET([MPC55XX_ESCI_USE_INTERRUPTS],[*],[1])
 RTEMS_BSPOPTS_HELP([MPC55XX_ESCI_USE_INTERRUPTS],
 [define to zero or one to disable or enable interrupts for the eSCI devices])
 
-RTEMS_BSPOPTS_SET([MPC55XX_FMPLL_REF_CLOCK],[gwlcfm],[40000000])
-RTEMS_BSPOPTS_SET([MPC55XX_FMPLL_REF_CLOCK],[xkt564levb*],[40000000])
-RTEMS_BSPOPTS_SET([MPC55XX_FMPLL_REF_CLOCK],[mpc5674fevb*],[40000000])
-RTEMS_BSPOPTS_SET([MPC55XX_FMPLL_REF_CLOCK],[*]     ,[8000000])
-RTEMS_BSPOPTS_HELP([MPC55XX_FMPLL_REF_CLOCK],
+RTEMS_BSPOPTS_SET([MPC55XX_REFERENCE_CLOCK],[gwlcfm],[40000000])
+RTEMS_BSPOPTS_SET([MPC55XX_REFERENCE_CLOCK],[mpc5643l_evb*],[40000000])
+RTEMS_BSPOPTS_SET([MPC55XX_REFERENCE_CLOCK],[mpc5674fevb*],[40000000])
+RTEMS_BSPOPTS_SET([MPC55XX_REFERENCE_CLOCK],[*],[8000000])
+RTEMS_BSPOPTS_HELP([MPC55XX_REFERENCE_CLOCK],
 [Must be defined to be the external reference clock (in Hz) 
  for clock generation])
 
@@ -77,8 +73,8 @@ 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_EMIOS_PRESCALER],[xkt564levb*],[])
 RTEMS_BSPOPTS_SET([MPC55XX_EMIOS_PRESCALER],[gwlcfm],[66])
+RTEMS_BSPOPTS_SET([MPC55XX_EMIOS_PRESCALER],[mpc5643l*],[])
 RTEMS_BSPOPTS_SET([MPC55XX_EMIOS_PRESCALER],[*]     ,[1])
 RTEMS_BSPOPTS_HELP([MPC55XX_EMIOS_PRESCALER],
 [Must be defined to set the EMIOS prescaler])
@@ -99,22 +95,22 @@ RTEMS_BSPOPTS_SET([SMSC9218I_EDMA_TX_CHANNEL],[*],[48])
 RTEMS_BSPOPTS_HELP([SMSC9218I_EDMA_TX_CHANNEL],
 [transmit eDMA channel for SMSC9218I network interface])
 
+RTEMS_BSPOPTS_SET([MPC55XX_CLOCK_EMIOS_CHANNEL],[mpc5643l*],[])
 RTEMS_BSPOPTS_SET([MPC55XX_CLOCK_EMIOS_CHANNEL],[mpc5674fevb*],[31])
-RTEMS_BSPOPTS_SET([MPC55XX_CLOCK_EMIOS_CHANNEL],[xkt564levb*],[])
 RTEMS_BSPOPTS_SET([MPC55XX_CLOCK_EMIOS_CHANNEL],[*],[23])
 RTEMS_BSPOPTS_HELP([MPC55XX_CLOCK_EMIOS_CHANNEL],
 [selects the eMIOS channel for the RTEMS system tick (the default is the last channel)])
 
-RTEMS_BSPOPTS_SET([MPC55XX_CLOCK_PIT_CHANNEL],[xkt564levb*],[3])
+RTEMS_BSPOPTS_SET([MPC55XX_CLOCK_PIT_CHANNEL],[mpc5643l*],[3])
 RTEMS_BSPOPTS_SET([MPC55XX_CLOCK_PIT_CHANNEL],[*],[])
 RTEMS_BSPOPTS_HELP([MPC55XX_CLOCK_PIT_CHANNEL],
 [selects the PIT channel for the RTEMS system tick (the default is the last channel)])
 
-RTEMS_BSPOPTS_SET([MPC55XX_CHIP_TYPE],[mpc5674fevb*],[5674])
-RTEMS_BSPOPTS_SET([MPC55XX_CHIP_TYPE],[xkt564levb*],[5643])
-RTEMS_BSPOPTS_SET([MPC55XX_CHIP_TYPE],[mpc5566evb*],[5566])
-RTEMS_BSPOPTS_SET([MPC55XX_CHIP_TYPE],[gwlcfm]    ,[5516])
-RTEMS_BSPOPTS_SET([MPC55XX_CHIP_TYPE],[*]         ,[5554])
+RTEMS_BSPOPTS_SET([MPC55XX_CHIP_TYPE],[gwlcfm],[5516])
+RTEMS_BSPOPTS_SET([MPC55XX_CHIP_TYPE],[mpc5566*],[5566])
+RTEMS_BSPOPTS_SET([MPC55XX_CHIP_TYPE],[mpc5643l*],[5643])
+RTEMS_BSPOPTS_SET([MPC55XX_CHIP_TYPE],[mpc5674f*],[5674])
+RTEMS_BSPOPTS_SET([MPC55XX_CHIP_TYPE],[*],[5554])
 RTEMS_BSPOPTS_HELP([MPC55XX_CHIP_TYPE],
 [specifies the chip type in use (e.g. 5554 for MPC5554)])
 
@@ -129,9 +125,6 @@ RTEMS_BSPOPTS_HELP([MPC55XX_BOOTFLAGS],
 RTEMS_BSPOPTS_SET([MPC55XX_BOARD_MPC5674FEVB],[mpc5674fevb*],[1])
 RTEMS_BSPOPTS_HELP([MPC55XX_BOARD_MPC5674FEVB],[if defined, use custom settings for MPC5674FEVB board])
 
-RTEMS_BSPOPTS_SET([MPC55XX_BOARD_XKT564LEVB],[xkt564levb*],[1])
-RTEMS_BSPOPTS_HELP([MPC55XX_BOARD_XKT564LEVB],[if defined, use custom settings for XKT564LEVB board])
-
 RTEMS_BSPOPTS_SET([MPC55XX_BOARD_MPC5566EVB],[mpc5566evb*],[1])
 RTEMS_BSPOPTS_HELP([MPC55XX_BOARD_MPC5566EVB],[if defined, use custom settings for MPC5566EVB board])
 
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 5049d2e..958b5d3 100644
--- a/c/src/lib/libbsp/powerpc/mpc55xxevb/include/bspopts.h.in
+++ b/c/src/lib/libbsp/powerpc/mpc55xxevb/include/bspopts.h.in
@@ -36,9 +36,6 @@
 /* if defined, use custom settings for phyCORE MPC5554 board */
 #undef MPC55XX_BOARD_PHYCORE_MPC5554
 
-/* if defined, use custom settings for XKT564LEVB board */
-#undef MPC55XX_BOARD_XKT564LEVB
-
 /* if defined, builds in bootflags above the RCHW for setup in a debugger to
    avoid startup MMU setup */
 #undef MPC55XX_BOOTFLAGS
@@ -78,7 +75,7 @@
 
 /* Must be defined to be the external reference clock (in Hz) for clock
    generation */
-#undef MPC55XX_FMPLL_REF_CLOCK
+#undef MPC55XX_REFERENCE_CLOCK
 
 /* 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/make/custom/xkt564levb.cfg b/c/src/lib/libbsp/powerpc/mpc55xxevb/make/custom/mpc5643l_dpu.cfg
similarity index 57%
copy from c/src/lib/libbsp/powerpc/mpc55xxevb/make/custom/xkt564levb.cfg
copy to c/src/lib/libbsp/powerpc/mpc55xxevb/make/custom/mpc5643l_dpu.cfg
index eb9c0db..67fe396 100644
--- a/c/src/lib/libbsp/powerpc/mpc55xxevb/make/custom/xkt564levb.cfg
+++ b/c/src/lib/libbsp/powerpc/mpc55xxevb/make/custom/mpc5643l_dpu.cfg
@@ -4,7 +4,7 @@
 #
 # @ingroup mpc55xx_config
 #
-# @brief Configuration file for XKT564LEVB evaluation board.
+# @brief Configuration file for MPC5643L Data Processing Unit board.
 #
 
 include $(RTEMS_ROOT)/make/custom/mpc55xx.inc
diff --git a/c/src/lib/libbsp/powerpc/mpc55xxevb/make/custom/xkt564levb.cfg b/c/src/lib/libbsp/powerpc/mpc55xxevb/make/custom/mpc5643l_evb.cfg
similarity index 100%
rename from c/src/lib/libbsp/powerpc/mpc55xxevb/make/custom/xkt564levb.cfg
rename to c/src/lib/libbsp/powerpc/mpc55xxevb/make/custom/mpc5643l_evb.cfg
diff --git a/c/src/lib/libbsp/powerpc/mpc55xxevb/preinstall.am b/c/src/lib/libbsp/powerpc/mpc55xxevb/preinstall.am
index 4848b18..8ec4b8e 100644
--- a/c/src/lib/libbsp/powerpc/mpc55xxevb/preinstall.am
+++ b/c/src/lib/libbsp/powerpc/mpc55xxevb/preinstall.am
@@ -73,6 +73,14 @@ $(PROJECT_LIB)/linkcmds.mpc5566evb_spe: startup/linkcmds.mpc5566evb_spe $(PROJEC
 	$(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.mpc5566evb_spe
 PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds.mpc5566evb_spe
 
+$(PROJECT_LIB)/linkcmds.mpc5643l_evb: startup/linkcmds.mpc5643l_evb $(PROJECT_LIB)/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.mpc5643l_evb
+PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds.mpc5643l_evb
+
+$(PROJECT_LIB)/linkcmds.mpc5643l_dpu: startup/linkcmds.mpc5643l_dpu $(PROJECT_LIB)/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.mpc5643l_dpu
+PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds.mpc5643l_dpu
+
 $(PROJECT_LIB)/linkcmds.mpc5674fevb: startup/linkcmds.mpc5674fevb $(PROJECT_LIB)/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.mpc5674fevb
 PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds.mpc5674fevb
@@ -81,10 +89,6 @@ $(PROJECT_LIB)/linkcmds.mpc5674fevb_spe: startup/linkcmds.mpc5674fevb_spe $(PROJ
 	$(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.mpc5674fevb_spe
 PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds.mpc5674fevb_spe
 
-$(PROJECT_LIB)/linkcmds.xkt564levb: startup/linkcmds.xkt564levb $(PROJECT_LIB)/$(dirstamp)
-	$(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.xkt564levb
-PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds.xkt564levb
-
 $(PROJECT_LIB)/linkcmds.phycore_mpc5554: startup/linkcmds.phycore_mpc5554 $(PROJECT_LIB)/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.phycore_mpc5554
 PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds.phycore_mpc5554
diff --git a/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/get-system-clock.c b/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/get-system-clock.c
index 5e0c608..bd4c769 100644
--- a/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/get-system-clock.c
+++ b/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/get-system-clock.c
@@ -31,7 +31,7 @@ uint32_t mpc55xx_get_system_clock(void)
   #ifdef MPC55XX_HAS_FMPLL
     volatile struct FMPLL_tag *fmpll = &FMPLL;
     union FMPLL_SYNSR_tag synsr = { .R = fmpll->SYNSR.R };
-    uint32_t reference_clock = MPC55XX_FMPLL_REF_CLOCK;
+    uint32_t reference_clock = MPC55XX_REFERENCE_CLOCK;
     bool pll_clock_mode = synsr.B.MODE != 0;
     bool crystal_or_external_reference_mode = synsr.B.PLLSEL != 0;
 
@@ -54,7 +54,7 @@ uint32_t mpc55xx_get_system_clock(void)
   #ifdef MPC55XX_HAS_FMPLL_ENHANCED
     volatile struct FMPLL_tag *fmpll = &FMPLL;
     union FMPLL_ESYNCR1_tag esyncr1 = { .R = fmpll->ESYNCR1.R };
-    uint32_t reference_clock = MPC55XX_FMPLL_REF_CLOCK;
+    uint32_t reference_clock = MPC55XX_REFERENCE_CLOCK;
     bool normal_mode = (esyncr1.B.CLKCFG & 0x4U) != 0;
 
     if (normal_mode) {
@@ -73,7 +73,7 @@ uint32_t mpc55xx_get_system_clock(void)
   #ifdef MPC55XX_HAS_MODE_CONTROL
     /* FIXME: Assumes normal mode and external oscillator */
     PLLD_CR_32B_tag cr = { . R = CGM.FMPLL [0].CR.R };
-    uint32_t xosc = MPC55XX_FMPLL_REF_CLOCK;
+    uint32_t xosc = MPC55XX_REFERENCE_CLOCK;
     uint32_t ldf = cr.B.NDIV;
     uint32_t idf = cr.B.IDF + 1;
     uint32_t odf = 2U << cr.B.ODF;
diff --git a/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/linkcmds.mpc5643l_dpu b/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/linkcmds.mpc5643l_dpu
new file mode 100644
index 0000000..2f7d807
--- /dev/null
+++ b/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/linkcmds.mpc5643l_dpu
@@ -0,0 +1 @@
+INCLUDE linkcmds.mpc5643l_evb
diff --git a/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/linkcmds.xkt564levb b/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/linkcmds.mpc5643l_evb
similarity index 77%
rename from c/src/lib/libbsp/powerpc/mpc55xxevb/startup/linkcmds.xkt564levb
rename to c/src/lib/libbsp/powerpc/mpc55xxevb/startup/linkcmds.mpc5643l_evb
index 98cc0bc..d0203be 100644
--- a/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/linkcmds.xkt564levb
+++ b/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/linkcmds.mpc5643l_evb
@@ -1,6 +1,6 @@
 MEMORY {
 	ROM : ORIGIN = 0x0, LENGTH = 1M
-	RAM_0 : ORIGIN = 0x40000000, LENGTH = 64K
+	RAM : ORIGIN = 0x40000000, LENGTH = 64K
 	RAM_1 : ORIGIN = 0x50000000, LENGTH = 64K
 	RAM_EXT : ORIGIN = 0x0, LENGTH = 0
 	NOCACHE : ORIGIN = 0x0, LENGTH = 0
@@ -12,18 +12,18 @@ bsp_ram_1_size = LENGTH (RAM_1);
 bsp_ram_1_end = bsp_ram_1_start + bsp_ram_1_size;
 
 REGION_ALIAS ("REGION_START", ROM);
-REGION_ALIAS ("REGION_FAST_TEXT", RAM_0);
+REGION_ALIAS ("REGION_FAST_TEXT", RAM);
 REGION_ALIAS ("REGION_FAST_TEXT_LOAD", ROM);
 REGION_ALIAS ("REGION_TEXT", ROM);
 REGION_ALIAS ("REGION_TEXT_LOAD", ROM);
 REGION_ALIAS ("REGION_RODATA", ROM);
 REGION_ALIAS ("REGION_RODATA_LOAD", ROM);
-REGION_ALIAS ("REGION_FAST_DATA", RAM_0);
+REGION_ALIAS ("REGION_FAST_DATA", RAM);
 REGION_ALIAS ("REGION_FAST_DATA_LOAD", ROM);
-REGION_ALIAS ("REGION_DATA", RAM_0);
+REGION_ALIAS ("REGION_DATA", RAM);
 REGION_ALIAS ("REGION_DATA_LOAD", ROM);
-REGION_ALIAS ("REGION_BSS", RAM_0);
-REGION_ALIAS ("REGION_RWEXTRA", RAM_0);
+REGION_ALIAS ("REGION_BSS", RAM);
+REGION_ALIAS ("REGION_RWEXTRA", RAM);
 REGION_ALIAS ("REGION_WORK", RAM_1);
 REGION_ALIAS ("REGION_STACK", RAM_1);
 REGION_ALIAS ("REGION_NOCACHE", NOCACHE);
diff --git a/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/start-config-clock.c b/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/start-config-clock.c
index 0b0d568..af24319 100644
--- a/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/start-config-clock.c
+++ b/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/start-config-clock.c
@@ -47,7 +47,7 @@ BSP_START_TEXT_SECTION const mpc55xx_clock_config
   #ifdef MPC55XX_HAS_FMPLL_ENHANCED
     #define EPREDIV_VAL (MPC55XX_FMPLL_PREDIV-1)
     #define EMFD_VAL    (MPC55XX_FMPLL_MFD-16)
-    #define VCO_CLK_REF (MPC55XX_FMPLL_REF_CLOCK/(EPREDIV_VAL+1))
+    #define VCO_CLK_REF (MPC55XX_REFERENCE_CLOCK/(EPREDIV_VAL+1))
     #define VCO_CLK_OUT (VCO_CLK_REF*(EMFD_VAL+16))
     #define ERFD_VAL    ((VCO_CLK_OUT/MPC55XX_FMPLL_CLK_OUT)-1)
 
@@ -90,7 +90,13 @@ BSP_START_TEXT_SECTION const mpc55xx_clock_config
     .fmpll = {
       {
         .cr = {
-          .B = { .IDF = 3, .ODF = 1, .NDIV = 48, .I_LOCK = 1, .PLL_ON = 1 }
+          #if MPC55XX_REFERENCE_CLOCK == 8000000
+            .B = { .IDF = 0, .ODF = 1, .NDIV = 60, .I_LOCK = 1, .PLL_ON = 1 }
+          #elif MPC55XX_REFERENCE_CLOCK == 40000000
+            .B = { .IDF = 3, .ODF = 1, .NDIV = 48, .I_LOCK = 1, .PLL_ON = 1 }
+          #else
+            #error "unexpected reference clock"
+          #endif
         }
       },
       {
@@ -103,6 +109,10 @@ BSP_START_TEXT_SECTION const mpc55xx_clock_config
       .B = { .SELDIV = 2, .SELCTL = 2 }
     },
     .auxclk = {
+      [0] = {
+        .AC_SC = { .B = { .SELCTL = 4 } },
+        .AC_DC0_3 = { .B = { .DE0 = 1, .DIV0 = 0 } }
+      },
       [1] = {
         .AC_SC = { .B = { .SELCTL = 4 } },
         .AC_DC0_3 = { .B = { .DE0 = 1, .DIV0 = 11 } }




More information about the vc mailing list