Skip to contentSkip to conversation

mpc83xx: Add the support of MPC837xEMDS board

PATCH New Dave Liu 1 participant 1 message Sep 18, 2007 Kbuild

lore
Share & tools
lore

Dave Liu

author
#0 lore raw

PATCH 3/6 mpc83xx: Add the support of MPC837xEMDS board

The MPC837xEMDS board support:
* DDR2 400MHz hardcoded and SPD init
* Local bus NOR Flash
* I2C, UART, MII and RTC
* eTSEC RGMII
* PCI host

---
 Makefile                                  |   10 +
 board/freescale/mpc837xemds/Makefile      |   50 +++
 board/freescale/mpc837xemds/config.mk     |   28 ++
 board/freescale/mpc837xemds/mpc837xemds.c |  144 +++++++
 board/freescale/mpc837xemds/pci.c         |   65 +++
 cpu/mpc83xx/cpu_init.c                    |    6 +-
 cpu/mpc83xx/spd_sdram.c                   |    7 +-
 drivers/tsec.c                            |   10 +
 include/configs/MPC837XEMDS.h             |  605 +++++++++++++++++++++++++++++
 9 files changed, 922 insertions(+), 3 deletions(-)
 create mode 100644 board/freescale/mpc837xemds/Makefile
 create mode 100644 board/freescale/mpc837xemds/config.mk
 create mode 100644 board/freescale/mpc837xemds/mpc837xemds.c
 create mode 100644 board/freescale/mpc837xemds/pci.c
 create mode 100644 include/configs/MPC837XEMDS.h
Makefile +10 -0
index 85885b1..f33302f 100644
@@ -1829,6 +1829,16 @@ MPC8360EMDS_SLAVE_config:	unconfig
 	fi ;
 	@$(MKCONFIG) -a MPC8360EMDS ppc mpc83xx mpc8360emds freescale
 
+MPC837XEMDS_config \
+MPC837XEMDS_HOST_config:	unconfig
+	@mkdir -p $(obj)include
+	@echo "" >$(obj)include/config.h ; \
+	if [ "$(findstring _HOST_,$@)" ] ; then \
+		echo -n "... PCI HOST " ; \
+		echo "#define CONFIG_PCI" >>$(obj)include/config.h ; \
+	fi ;
+	@$(MKCONFIG) -a MPC837XEMDS ppc mpc83xx mpc837xemds freescale
+
 sbc8349_config:		unconfig
 	@$(MKCONFIG) $(@:_config=) ppc mpc83xx sbc8349
 
board/freescale/mpc837xemds/Makefile new file +50 -0

50 lines not on this page · raw message

board/freescale/mpc837xemds/config.mk new file +28 -0
new file mode 100644
index 0000000..63c5fc3
@@ -0,0 +1,28 @@
+#
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+#
+# MPC837xEMDS
+#
+
+TEXT_BASE = 0xFE000000
board/freescale/mpc837xemds/mpc837xemds.c new file +144 -0

144 lines not on this page · raw message

board/freescale/mpc837xemds/pci.c new file +65 -0

65 lines not on this page · raw message

cpu/mpc83xx/cpu_init.c +5 -1
index 7224979..2b92be0 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004-2006 Freescale Semiconductor, Inc.
+ * Copyright (C) 2004-2007 Freescale Semiconductor, Inc.
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -155,6 +155,10 @@ void cpu_init_f (volatile immap_t * im)
 #ifdef CFG_DDRCDR
 	im->sysconf.ddrcdr = CFG_DDRCDR;
 #endif
+	/* Output buffer impedance register */
+#ifdef CFG_OBIR
+	im->sysconf.obir = CFG_OBIR;
+#endif
 
 #ifdef CONFIG_QE
 	/* Config QE ioports */
cpu/mpc83xx/spd_sdram.c +5 -2
index ee2d038..29dd470 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2006 Freescale Semiconductor, Inc.
+ * (C) Copyright 2006-2007 Freescale Semiconductor, Inc.
  *
  * (C) Copyright 2006
  * Wolfgang Denk, DENX Software Engineering, wd at denx.de.
@@ -198,6 +198,7 @@ long int spd_sdram()
 	if(spd.mem_type == SPD_MEMTYPE_DDR2) {
 		immap->sysconf.ddrcdr = CFG_DDRCDR_VALUE;
 	}
+	udelay(50000);
 #endif
 
 	/*
@@ -576,7 +577,7 @@ long int spd_sdram()
 		if (effective_data_rate == 266 || effective_data_rate == 333) {
 			cpo = 0x7;		/* READ_LAT + 5/4 */
 		} else if (effective_data_rate == 400) {
-			cpo = 0x9;		/* READ_LAT + 7/4 */
+			cpo = 0x7;		/* READ_LAT + 5/4 */
 		} else {
 			/* Automatic calibration */
 			cpo = 0x1f;
@@ -705,9 +706,11 @@ long int spd_sdram()
 	 * SDRAM Cfg 2
 	 */
 	odt_cfg = 0;
+#ifndef CONFIG_NEVER_ASSERT_ODT_TO_CPU
 	if (odt_rd_cfg | odt_wr_cfg) {
 		odt_cfg = 0x2;		/* ODT to IOs during reads */
 	}
+#endif
 	if (spd.mem_type == SPD_MEMTYPE_DDR2) {
 		ddr->sdram_cfg2 = (0
 			    | (0 << 26)	/* True DQS */
drivers/tsec.c +10 -0
index 4ff3339..8426857 100644
@@ -671,6 +671,15 @@ uint mii_cis8204_setmode(uint mii_reg, struct tsec_private * priv)
 		return MIIM_CIS8204_EPHYCON_INIT;
 }
 
+uint mii_m88e1111s_setmode(uint mii_reg, struct tsec_private *priv)
+{
+	uint mii_data = read_phy_reg(priv, mii_reg);
+
+	if (priv->flags & TSEC_REDUCED)
+		mii_data = (mii_data & 0xfff0) | 0x000b;
+	return mii_data;
+}
+
 /* Initialized required registers to appropriate values, zeroing
  * those we don't care about (unless zero is bad, in which case,
  * choose a more appropriate value)
@@ -1030,6 +1039,7 @@ struct phy_info phy_info_M88E1111S = {
 	(struct phy_cmd[]){	/* config */
 			   /* Reset and configure the PHY */
 			   {MIIM_CONTROL, MIIM_CONTROL_RESET, NULL},
+			   {0x1b, 0x848f, &mii_m88e1111s_setmode},
 			   {0x14, 0x0cd2, NULL}, /* Delay RGMII TX and RX */
 			   {MIIM_GBIT_CONTROL, MIIM_GBIT_CONTROL_INIT, NULL},
 			   {MIIM_ANAR, MIIM_ANAR_INIT, NULL},
include/configs/MPC837XEMDS.h new file +605 -0

605 lines not on this page · raw message

Signature · 1 line
1.5.1