[U-Boot] [PATCH v7] powerpc/mpc83xx: Add 33.33MHz support for mpc8360emds

Chang-Ming.Huang at freescale.com Chang-Ming.Huang at freescale.com
Mon Nov 7 06:20:21 CET 2011


From: Jerry Huang <Chang-Ming.Huang at freescale.com>

The new MPC8360EMDS board changes the oscillator to 33.33MHz
in order to support QE 500MHz since 2008.

Signed-off-by: Jerry Huang <Chang-Ming.Huang at freescale.com>
CC: Kim Phillips <kim.phillips at freescale.com>
---
cahnges for v2:
	- fix multiline comment wrong
changes for v3:
	- change the oscillator to 33330000, not 33300000
changes for v4:
	- add the mandatory history of changes
changes for v5:
	- move the code to platform file from lib/board.c
	- add 2011 copyright
changes for v6:
	- split into two patch
	- add the CLKIN33 option for 33.33MHz oscillator
	- add the readme for CLKIN33 option
	- add CC
changes for v7:
	- shorter the config names to _33 for 33.33MHz oscillator
	- change the default to  _66 option for 66MHz oscillator
	- modify the README

 boards.cfg                    |   15 ++++++++++-----
 doc/README.mpc8360emds        |   18 +++++++++++++-----
 include/configs/MPC8360EMDS.h |   27 +++++++++++++++++++++++++++
 3 files changed, 50 insertions(+), 10 deletions(-)

diff --git a/boards.cfg b/boards.cfg
index 90dab8b..0f033ac 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -419,11 +419,16 @@ MPC8349EMDS                  powerpc     mpc83xx     mpc8349emds         freesca
 MPC8349ITX                   powerpc     mpc83xx     mpc8349itx          freescale      -           MPC8349ITX:MPC8349ITX
 MPC8349ITXGP                 powerpc     mpc83xx     mpc8349itx          freescale      -           MPC8349ITX:MPC8349ITXGP,SYS_TEXT_BASE=0xFE000000
 MPC8349ITX_LOWBOOT           powerpc     mpc83xx     mpc8349itx          freescale      -           MPC8349ITX:MPC8349ITX,SYS_TEXT_BASE=0xFE000000
-MPC8360EMDS                  powerpc     mpc83xx     mpc8360emds         freescale      -           MPC8360EMDS:
-MPC8360EMDS_ATM              powerpc     mpc83xx     mpc8360emds         freescale      -           MPC8360EMDS:PQ_MDS_PIB=1,PQ_MDS_PIB_ATM=1
-MPC8360EMDS_HOST_33          powerpc     mpc83xx     mpc8360emds         freescale      -           MPC8360EMDS:PCI,PCI_33M,PQ_MDS_PIB=1
-MPC8360EMDS_HOST_66          powerpc     mpc83xx     mpc8360emds         freescale      -           MPC8360EMDS:PCI,PCI_66M,PQ_MDS_PIB=1
-MPC8360EMDS_SLAVE            powerpc     mpc83xx     mpc8360emds         freescale      -           MPC8360EMDS:PCI,PCISLAVE
+MPC8360EMDS_66               powerpc     mpc83xx     mpc8360emds         freescale      -           MPC8360EMDS:CLKIN_66MHZ
+MPC8360EMDS_33               powerpc     mpc83xx     mpc8360emds         freescale      -           MPC8360EMDS:CLKIN_33MHZ
+MPC8360EMDS_66_ATM           powerpc     mpc83xx     mpc8360emds         freescale      -           MPC8360EMDS:CLKIN_66MHZ,PQ_MDS_PIB=1,PQ_MDS_PIB_ATM=1
+MPC8360EMDS_33_ATM           powerpc     mpc83xx     mpc8360emds         freescale      -           MPC8360EMDS:CLKIN_33MHZ,PQ_MDS_PIB=1,PQ_MDS_PIB_ATM=1
+MPC8360EMDS_66_HOST_33       powerpc     mpc83xx     mpc8360emds         freescale      -           MPC8360EMDS:CLKIN_66MHZ,PCI,PCI_33M,PQ_MDS_PIB=1
+MPC8360EMDS_33_HOST_33       powerpc     mpc83xx     mpc8360emds         freescale      -           MPC8360EMDS:CLKIN_33MHZ,PCI,PCI_33M,PQ_MDS_PIB=1
+MPC8360EMDS_66_HOST_66       powerpc     mpc83xx     mpc8360emds         freescale      -           MPC8360EMDS:CLKIN_66MHZ,PCI,PCI_66M,PQ_MDS_PIB=1
+MPC8360EMDS_33_HOST_66       powerpc     mpc83xx     mpc8360emds         freescale      -           MPC8360EMDS:CLKIN_33MHZ,PCI,PCI_66M,PQ_MDS_PIB=1
+MPC8360EMDS_66_SLAVE         powerpc     mpc83xx     mpc8360emds         freescale      -           MPC8360EMDS:CLKIN_66MHZ,PCI,PCISLAVE
+MPC8360EMDS_33_SLAVE         powerpc     mpc83xx     mpc8360emds         freescale      -           MPC8360EMDS:CLKIN_33MHZ,PCI,PCISLAVE
 MPC8360ERDK                  powerpc     mpc83xx     mpc8360erdk         freescale      -           MPC8360ERDK
 MPC8360ERDK_33               powerpc     mpc83xx     mpc8360erdk         freescale      -           MPC8360ERDK:CLKIN_33MHZ
 MPC8360ERDK_66               powerpc     mpc83xx     mpc8360erdk         freescale      -           MPC8360ERDK
diff --git a/doc/README.mpc8360emds b/doc/README.mpc8360emds
index d65a2a4..b20c9f6 100644
--- a/doc/README.mpc8360emds
+++ b/doc/README.mpc8360emds
@@ -87,28 +87,36 @@ Freescale MPC8360EMDS Board
 
 4. Compilation
 
+	MPC8360EMDS shipped with 33.33MHz or 66MHz oscillator(check U41 chip).
+
 	Assuming you're using BASH shell:
 
 		export CROSS_COMPILE=your-cross-compile-prefix
 		cd u-boot
 		make distclean
-		make MPC8360EMDS_config
+		make MPC8360EMDS_XX_config
 		make
 
-	MPC8360 support PCI in host and slave mode.
+	MPC8360EMDS support ATM, PCI in host and slave mode.
+
+	To make u-boot support ATM :
+	1) Make MPC8360EMDS_XX_ATM_config
 
 	To make u-boot support PCI host 66M :
 	1) DIP SW support PCI mode as described in Section 1.1.
-	2) Make MPC8360EMDS_HOST_66_config
+	2) Make MPC8360EMDS_XX_HOST_66_config
 
 	To make u-boot support PCI host 33M :
 	1) DIP SW setting is similar as Section 1.1, except for SW3[4] is 1
-	2) Make MPC8360EMDS_HOST_33_config
+	2) Make MPC8360EMDS_XX_HOST_33_config
 
 	To make u-boot support PCI slave 66M :
 	1) DIP SW setting is similar as Section 1.1, except for SW9[3] is 1
-	2) Make MPC8360EMDS_SLAVE_config
+	2) Make MPC8360EMDS_XX_SLAVE_config
 
+	(where XX is:
+	   33 - 33.33MHz oscillator
+	   66 - 66MHz oscillator)
 
 5. Downloading and Flashing Images
 
diff --git a/include/configs/MPC8360EMDS.h b/include/configs/MPC8360EMDS.h
index cfba894..3221023 100644
--- a/include/configs/MPC8360EMDS.h
+++ b/include/configs/MPC8360EMDS.h
@@ -39,6 +39,18 @@
 /*
  * System Clock Setup
  */
+#ifdef CONFIG_CLKIN_33MHZ
+#ifdef CONFIG_PCISLAVE
+#define CONFIG_83XX_PCICLK	33330000 /* in HZ */
+#else
+#define CONFIG_83XX_CLKIN	33330000 /* in Hz */
+#endif
+
+#ifndef CONFIG_SYS_CLK_FREQ
+#define CONFIG_SYS_CLK_FREQ	33330000
+#endif
+
+#elif defined(CONFIG_CLKIN_66MHZ)
 #ifdef CONFIG_PCISLAVE
 #define CONFIG_83XX_PCICLK	66000000 /* in HZ */
 #else
@@ -48,10 +60,24 @@
 #ifndef CONFIG_SYS_CLK_FREQ
 #define CONFIG_SYS_CLK_FREQ	66000000
 #endif
+#else
+#error Unknown oscillator frequency.
+#endif
 
 /*
  * Hardware Reset Configuration Word
  */
+#ifdef CONFIG_CLKIN_33MHZ
+#define CONFIG_SYS_HRCW_LOW (\
+	HRCWL_LCL_BUS_TO_SCB_CLK_1X1 |\
+	HRCWL_DDR_TO_SCB_CLK_1X1 |\
+	HRCWL_CSB_TO_CLKIN_8X1 |\
+	HRCWL_VCO_1X2 |\
+	HRCWL_CE_PLL_VCO_DIV_4 |\
+	HRCWL_CE_PLL_DIV_1X1 |\
+	HRCWL_CE_TO_PLL_1X15 |\
+	HRCWL_CORE_TO_CSB_2X1)
+#elif defined(CONFIG_CLKIN_66MHZ)
 #define CONFIG_SYS_HRCW_LOW (\
 	HRCWL_LCL_BUS_TO_SCB_CLK_1X1 |\
 	HRCWL_DDR_TO_SCB_CLK_1X1 |\
@@ -61,6 +87,7 @@
 	HRCWL_CE_PLL_DIV_1X1 |\
 	HRCWL_CE_TO_PLL_1X6 |\
 	HRCWL_CORE_TO_CSB_2X1)
+#endif
 
 #ifdef CONFIG_PCISLAVE
 #define CONFIG_SYS_HRCW_HIGH (\
-- 
1.6.4




More information about the U-Boot mailing list