Skip to contentSkip to conversation

Coldfire: M5271: Allow board header file to specify clock multiplier

PATCH New Richard Retanubun 1 participant 2 messages Jan 23, 2009 – Feb 4, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 4/7 Coldfire: M5271: Allow board header file to specify clock multiplier

M5271 dynamic clock multiplier. It is currently fixed at 100MHz.

Allow the board header file to set their own multiplier and divider. Added the #define for the multiplier and divider to the cpu header file.

---
  cpu/mcf52x2/cpu_init.c   |    7 +++++-
  include/asm-m68k/m5271.h |   53 ++++++++++++++++++++++++++++++++++++++++++++-
  2 files changed, 57 insertions(+), 3 deletions(-)
cpu/mcf52x2/cpu_init.c +6 -1
index 66f9164..02f37ae 100644
@@ -181,9 +181,14 @@ void cpu_init_f(void)
  	/* FlexBus Chipselect */
  	init_fbcs();
 
+#ifdef CONFIG_SYS_MCF_SYNCR
+	/* Set clockspeed according to board header file */
+	mbar_writeLong(MCF_FMPLL_SYNCR, CONFIG_SYS_MCF_SYNCR);
+#else
  	/* Set clockspeed to 100MHz */
-	mbar_writeShort(MCF_FMPLL_SYNCR,
+	mbar_writeLong(MCF_FMPLL_SYNCR,
  			MCF_FMPLL_SYNCR_MFD(0) | MCF_FMPLL_SYNCR_RFD(0));
+#endif
  	while (!mbar_readByte(MCF_FMPLL_SYNSR) & MCF_FMPLL_SYNSR_LOCK) ;
  }
 
include/asm-m68k/m5271.h +51 -2

76 lines not on this page · raw message

Signature · 1 line
1.5.6.5
#1 lore raw

PATCH 4/7 Coldfire: M5271: Allow board header file to specify clock multiplier

M5271 dynamic clock multiplier. It is currently fixed at 100MHz.

Allow the board header file to set their own multiplier and divider. Added the #define for the multiplier and divider to the cpu header file.

---
  cpu/mcf52x2/cpu_init.c   |    7 +++++-
  include/asm-m68k/m5271.h |   53 ++++++++++++++++++++++++++++++++++++++++++++-
  2 files changed, 57 insertions(+), 3 deletions(-)
cpu/mcf52x2/cpu_init.c +6 -1
index 66f9164..02f37ae 100644
@@ -181,9 +181,14 @@ void cpu_init_f(void)
  	/* FlexBus Chipselect */
  	init_fbcs();
 
+#ifdef CONFIG_SYS_MCF_SYNCR
+	/* Set clockspeed according to board header file */
+	mbar_writeLong(MCF_FMPLL_SYNCR, CONFIG_SYS_MCF_SYNCR);
+#else
  	/* Set clockspeed to 100MHz */
-	mbar_writeShort(MCF_FMPLL_SYNCR,
+	mbar_writeLong(MCF_FMPLL_SYNCR,
  			MCF_FMPLL_SYNCR_MFD(0) | MCF_FMPLL_SYNCR_RFD(0));
+#endif
  	while (!mbar_readByte(MCF_FMPLL_SYNSR) & MCF_FMPLL_SYNSR_LOCK) ;
  }
 
include/asm-m68k/m5271.h +51 -2

76 lines not on this page · raw message

Signature · 1 line
1.5.6.5