U-Boot
Threads by month
- ----- 2025 -----
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2000 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
July 2008
- 208 participants
- 579 discussions
modified to check for SH7785 PCIC Device ID.
Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro(a)renesas.com>
---
drivers/pci/pci_sh7780.c | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/drivers/pci/pci_sh7780.c b/drivers/pci/pci_sh7780.c
index 2d04b4f..d059507 100644
--- a/drivers/pci/pci_sh7780.c
+++ b/drivers/pci/pci_sh7780.c
@@ -31,6 +31,7 @@
#define SH7780_VENDOR_ID 0x1912
#define SH7780_DEVICE_ID 0x0002
+#define SH7785_DEVICE_ID 0x0007
#define SH7780_PCICR_PREFIX 0xA5000000
#define SH7780_PCICR_PFCS 0x00000800
#define SH7780_PCICR_FTO 0x00000400
@@ -71,9 +72,18 @@ int pci_sh7780_init(struct pci_controller *hose)
{
p4_out(0x01, SH7780_PCIECR);
- if (p4_inw(SH7780_PCIVID) != SH7780_VENDOR_ID
- && p4_inw(SH7780_PCIDID) != SH7780_DEVICE_ID){
- printf("PCI: Unknown PCI host bridge.\n");
+ if (p4_inw(SH7780_PCIVID) != SH7780_VENDOR_ID) {
+ printf("PCI: Unknown PCI host bridge. VID=%x\n",
+ p4_inw(SH7780_PCIVID));
+ return;
+ }
+ switch (p4_inw(SH7780_PCIDID)) {
+ case SH7780_DEVICE_ID:
+ case SH7785_DEVICE_ID:
+ break;
+ default:
+ printf("PCI: Unknown PCI host bridge. DID=%x\n",
+ p4_inw(SH7780_PCIDID));
return;
}
printf("PCI: SH7780 PCI host bridge found.\n");
1
0
Sascha(?) and/or others,
I seem to recall that those working on the either
the next U-Boot V2 or the next version of the FDT
image structure were planning on using the binary
include mechanism of the DTC.
Several days ago I added the Binary Include patch
to DTC and tagged a candidate release. Could you
verify that this version satisfies your needs and
works for you?
Thanks,
jdl
3
5
The MVBC_P is a MPC5200B based camera system with Intel Gigabit ethernet
controller (using e1000) and custom Altera Cyclone-II FPGA on PCI.
Please see doc/README.mvbc_p for details.
Signed-off-by: Andre Schwarz <andre.schwarz(a)matrix-vision.de>
---
Grant,
please find attached v3 with further mods :
- change all pointer ops to in_* out_*
- move GPIO bit defines into mpc5xxx.h
- move board to company subdir
Common usage of the fpga.c (Kim's proposal) will be patched separately along with an mvBL-M7 board movement to company subdir.
Please let me know if there's still somehting that needs fixing.
regards,
Andre
MATRIX VISION GmbH, Talstraße 16, DE-71570 Oppenweiler - Registergericht: Amtsgericht Stuttgart, HRB 271090
Geschäftsführer: Gerhard Thullner, Werner Armingeon, Uwe Furtner
CREDITS | 2 +-
MAINTAINERS | 1 +
MAKEALL | 1 +
Makefile | 8 +
board/matrix_vision/mvbc_p/Makefile | 50 ++++
board/matrix_vision/mvbc_p/config.mk | 30 +++
board/matrix_vision/mvbc_p/fpga.c | 177 ++++++++++++++
board/matrix_vision/mvbc_p/fpga.h | 34 +++
board/matrix_vision/mvbc_p/mvbc_p.c | 325 ++++++++++++++++++++++++++
board/matrix_vision/mvbc_p/mvbc_p.h | 43 ++++
board/matrix_vision/mvbc_p/mvbc_p_autoscript | 44 ++++
doc/README.mvbc_p | 74 ++++++
include/configs/MVBC_P.h | 316 +++++++++++++++++++++++++
include/mpc5xxx.h | 29 +++
14 files changed, 1133 insertions(+), 1 deletions(-)
diff --git a/CREDITS b/CREDITS
index aa57682..b1c10fd 100644
--- a/CREDITS
+++ b/CREDITS
@@ -426,7 +426,7 @@ D: FADS823 configuration, MPC823 video support, I2C, wireless keyboard, lots mor
N: Andre Schwarz
E: andre.schwarz(a)matrix-vision.de
-D: Support for Matrix Vision boards (MVBLM7)
+D: Support for Matrix Vision boards (MVBLM7/MVBC_P)
N: Robert Schwebel
E: r.schwebel(a)pengutronix.de
diff --git a/MAINTAINERS b/MAINTAINERS
index a3d70b1..9af5730 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -373,6 +373,7 @@ Peter De Schrijver <p2(a)mind.be>
Andre Schwarz <andre.schwarz(a)matrix-vision.de>
+ mvbc_p MPC5200
mvblm7 MPC8343
Timur Tabi <timur(a)freescale.com>
diff --git a/MAKEALL b/MAKEALL
index 9f80b3d..75261c1 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -48,6 +48,7 @@ LIST_5xxx=" \
mecp5200 \
motionpro \
munices \
+ MVBC_P \
o2dnt \
pf5200 \
PM520 \
diff --git a/Makefile b/Makefile
index ac3f98f..e1d2f7a 100644
--- a/Makefile
+++ b/Makefile
@@ -743,6 +743,14 @@ uc101_config: unconfig
motionpro_config: unconfig
@$(MKCONFIG) motionpro ppc mpc5xxx motionpro
+MVBC_P_config: unconfig
+ @mkdir -p $(obj)include
+ @mkdir -p $(obj)board/mvbc_p
+ @ >$(obj)include/config.h
+ @[ -z "$(findstring MVBC_P,$@)" ] || \
+ { echo "#define CONFIG_MVBC_P" >>$(obj)include/config.h; \
+ }
+ @$(MKCONFIG) -n $@ -a MVBC_P ppc mpc5xxx mvbc_p matrix_vision
#########################################################################
## MPC512x Systems
diff --git a/board/matrix_vision/mvbc_p/Makefile b/board/matrix_vision/mvbc_p/Makefile
new file mode 100644
index 0000000..7ae34cf
--- /dev/null
+++ b/board/matrix_vision/mvbc_p/Makefile
@@ -0,0 +1,50 @@
+#
+# (C) Copyright 2003
+# Wolfgang Denk, DENX Software Engineering, wd(a)denx.de.
+#
+# (C) Copyright 2004-2008
+# Matrix-Vision GmbH, info(a)matrix-vision.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
+#
+
+include $(TOPDIR)/config.mk
+
+LIB = $(obj)lib$(BOARD).a
+
+COBJS := $(BOARD).o fpga.o
+
+SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS := $(addprefix $(obj),$(COBJS))
+SOBJS := $(addprefix $(obj),$(SOBJS))
+
+$(LIB): $(obj).depend $(OBJS)
+ $(AR) $(ARFLAGS) $@ $(OBJS)
+
+clean:
+ rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+ rm -f $(LIB) core *.bak .depend
+
+#########################################################################
+
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
diff --git a/board/matrix_vision/mvbc_p/config.mk b/board/matrix_vision/mvbc_p/config.mk
new file mode 100644
index 0000000..1c2a13e
--- /dev/null
+++ b/board/matrix_vision/mvbc_p/config.mk
@@ -0,0 +1,30 @@
+#
+# (C) Copyright 2003
+# Wolfgang Denk, DENX Software Engineering, wd(a)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
+#
+
+sinclude $(TOPDIR)/board/$(BOARDDIR)/config.tmp
+
+ifndef TEXT_BASE
+TEXT_BASE = 0xFF800000
+endif
+
+PLATFORM_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE) -I$(TOPDIR)/board
diff --git a/board/matrix_vision/mvbc_p/fpga.c b/board/matrix_vision/mvbc_p/fpga.c
new file mode 100644
index 0000000..356af1a
--- /dev/null
+++ b/board/matrix_vision/mvbc_p/fpga.c
@@ -0,0 +1,177 @@
+/*
+ * (C) Copyright 2002
+ * Rich Ireland, Enterasys Networks, rireland(a)enterasys.com.
+ * Keith Outwater, keith_outwater(a)mvis.com.
+ *
+ * (C) Copyright 2008
+ * Andre Schwarz, Matrix Vision GmbH, andre.schwarz(a)matrix-vision.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
+ *
+ */
+
+#include <common.h>
+#include <ACEX1K.h>
+#include <command.h>
+#include "fpga.h"
+#include "mvbc_p.h"
+
+#ifdef FPGA_DEBUG
+#define fpga_debug(fmt, args...) printf("%s: "fmt, __func__, ##args)
+#else
+#define fpga_debug(fmt, args...)
+#endif
+
+Altera_CYC2_Passive_Serial_fns altera_fns = {
+ fpga_null_fn,
+ fpga_config_fn,
+ fpga_status_fn,
+ fpga_done_fn,
+ fpga_wr_fn,
+ fpga_null_fn,
+ fpga_null_fn,
+ 0
+};
+
+Altera_desc cyclone2 = {
+ Altera_CYC2,
+ passive_serial,
+ Altera_EP2C8_SIZE,
+ (void *) &altera_fns,
+ NULL,
+ 0
+};
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int mvbc_p_init_fpga(void)
+{
+ fpga_debug("Initialize FPGA interface (reloc 0x%.8lx)\n",
+ gd->reloc_off);
+ fpga_init(gd->reloc_off);
+ fpga_add(fpga_altera, &cyclone2);
+ fpga_config_fn(0, 1, 0);
+ udelay(60);
+
+ return 1;
+}
+
+int fpga_null_fn(int cookie)
+{
+ return 0;
+}
+
+int fpga_config_fn(int assert, int flush, int cookie)
+{
+ struct mpc5xxx_gpio *gpio = (struct mpc5xxx_gpio*)MPC5XXX_GPIO;
+ u32 dvo = gpio->simple_dvo;
+
+ fpga_debug("SET config : %s\n", assert ? "low" : "high");
+ if (assert)
+ dvo |= FPGA_CONFIG;
+ else
+ dvo &= ~FPGA_CONFIG;
+
+ if (flush)
+ gpio->simple_dvo = dvo;
+
+ return assert;
+}
+
+int fpga_done_fn(int cookie)
+{
+ struct mpc5xxx_gpio *gpio = (struct mpc5xxx_gpio*)MPC5XXX_GPIO;
+ int result = 0;
+
+ udelay(10);
+ fpga_debug("CONF_DONE check ... ");
+ if (gpio->simple_ival & FPGA_CONF_DONE) {
+ fpga_debug("high\n");
+ result = 1;
+ } else
+ fpga_debug("low\n");
+
+ return result;
+}
+
+int fpga_status_fn(int cookie)
+{
+ struct mpc5xxx_gpio *gpio = (struct mpc5xxx_gpio*)MPC5XXX_GPIO;
+ int result = 0;
+
+ fpga_debug("STATUS check ... ");
+ if (gpio->sint_ival & FPGA_STATUS) {
+ fpga_debug("high\n");
+ result = 1;
+ } else
+ fpga_debug("low\n");
+
+ return result;
+}
+
+int fpga_clk_fn(int assert_clk, int flush, int cookie)
+{
+ struct mpc5xxx_gpio *gpio = (struct mpc5xxx_gpio*)MPC5XXX_GPIO;
+ u32 dvo = gpio->simple_dvo;
+
+ fpga_debug("CLOCK %s\n", assert_clk ? "high" : "low");
+ if (assert_clk)
+ dvo |= FPGA_CCLK;
+ else
+ dvo &= ~FPGA_CCLK;
+
+ if (flush)
+ gpio->simple_dvo = dvo;
+
+ return assert_clk;
+}
+
+static inline int _write_fpga(u8 val)
+{
+ int i;
+ struct mpc5xxx_gpio *gpio = (struct mpc5xxx_gpio*)MPC5XXX_GPIO;
+ u32 dvo = gpio->simple_dvo;
+
+ for (i=0; i<8; i++) {
+ dvo &= ~FPGA_CCLK;
+ gpio->simple_dvo = dvo;
+ dvo &= ~FPGA_DIN;
+ if (val & 1)
+ dvo |= FPGA_DIN;
+ gpio->simple_dvo = dvo;
+ dvo |= FPGA_CCLK;
+ gpio->simple_dvo = dvo;
+ val >>= 1;
+ }
+
+ return 0;
+}
+
+int fpga_wr_fn(void *buf, size_t len, int flush, int cookie)
+{
+ unsigned char *data = (unsigned char *) buf;
+ int i;
+
+ fpga_debug("fpga_wr: buf %p / size %d\n", buf, len);
+ for (i = 0; i < len; i++)
+ _write_fpga(data[i]);
+ fpga_debug("\n");
+
+ return FPGA_SUCCESS;
+}
diff --git a/board/matrix_vision/mvbc_p/fpga.h b/board/matrix_vision/mvbc_p/fpga.h
new file mode 100644
index 0000000..3723073
--- /dev/null
+++ b/board/matrix_vision/mvbc_p/fpga.h
@@ -0,0 +1,34 @@
+/*
+ * (C) Copyright 2002
+ * Rich Ireland, Enterasys Networks, rireland(a)enterasys.com.
+ * Keith Outwater, keith_outwater(a)mvis.com.
+ *
+ * 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
+ *
+ */
+
+extern int mvbc_p_init_fpga(void);
+
+extern int fpga_pgm_fn(int assert_pgm, int flush, int cookie);
+extern int fpga_status_fn(int cookie);
+extern int fpga_config_fn(int assert, int flush, int cookie);
+extern int fpga_done_fn(int cookie);
+extern int fpga_clk_fn(int assert_clk, int flush, int cookie);
+extern int fpga_wr_fn(void *buf, size_t len, int flush, int cookie);
+extern int fpga_null_fn(int cookie);
diff --git a/board/matrix_vision/mvbc_p/mvbc_p.c b/board/matrix_vision/mvbc_p/mvbc_p.c
new file mode 100644
index 0000000..b61e84e
--- /dev/null
+++ b/board/matrix_vision/mvbc_p/mvbc_p.c
@@ -0,0 +1,325 @@
+/*
+ * (C) Copyright 2003
+ * Wolfgang Denk, DENX Software Engineering, wd(a)denx.de.
+ *
+ * (C) Copyright 2004
+ * Mark Jonas, Freescale Semiconductor, mark.jonas(a)motorola.com.
+ *
+ * (C) Copyright 2005-2007
+ * Andre Schwarz, Matrix Vision GmbH, andre.schwarz(a)matrix-vision.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
+ */
+
+#include <common.h>
+#include <mpc5xxx.h>
+#include <malloc.h>
+#include <pci.h>
+#include <i2c.h>
+#include <environment.h>
+#include <fdt_support.h>
+#include <asm/io.h>
+#include "fpga.h"
+#include "mvbc_p.h"
+
+#define SDRAM_MODE 0x00CD0000
+#define SDRAM_CONTROL 0x504F0000
+#define SDRAM_CONFIG1 0xD2322800
+#define SDRAM_CONFIG2 0x8AD70000
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static void sdram_start (int hi_addr)
+{
+ long hi_bit = hi_addr ? 0x01000000 : 0;
+
+ /* unlock mode register */
+ out_be32((u32*)MPC5XXX_SDRAM_CTRL, SDRAM_CONTROL | 0x80000000 | hi_bit);
+
+ /* precharge all banks */
+ out_be32((u32*)MPC5XXX_SDRAM_CTRL, SDRAM_CONTROL | 0x80000002 | hi_bit);
+
+ /* precharge all banks */
+ out_be32((u32*)MPC5XXX_SDRAM_CTRL, SDRAM_CONTROL | 0x80000002 | hi_bit);
+
+ /* auto refresh */
+ out_be32((u32*)MPC5XXX_SDRAM_CTRL, SDRAM_CONTROL | 0x80000004 | hi_bit);
+
+ /* set mode register */
+ out_be32((u32*)MPC5XXX_SDRAM_MODE, SDRAM_MODE);
+
+ /* normal operation */
+ out_be32((u32*)MPC5XXX_SDRAM_CTRL, SDRAM_CONTROL | hi_bit);
+}
+
+phys_addr_t initdram (int board_type)
+{
+ ulong dramsize = 0;
+ ulong test1,
+ test2;
+
+ /* setup SDRAM chip selects */
+ out_be32((u32*)MPC5XXX_SDRAM_CS0CFG, 0x0000001e);
+
+ /* setup config registers */
+ out_be32((u32*)MPC5XXX_SDRAM_CONFIG1, SDRAM_CONFIG1);
+ out_be32((u32*)MPC5XXX_SDRAM_CONFIG2, SDRAM_CONFIG2);
+
+ /* find RAM size using SDRAM CS0 only */
+ sdram_start(0);
+ test1 = get_ram_size((long *)CFG_SDRAM_BASE, 0x80000000);
+ sdram_start(1);
+ test2 = get_ram_size((long *)CFG_SDRAM_BASE, 0x80000000);
+ if (test1 > test2) {
+ sdram_start(0);
+ dramsize = test1;
+ } else
+ dramsize = test2;
+
+ if (dramsize < (1 << 20))
+ dramsize = 0;
+
+ if (dramsize > 0)
+ out_be32((u32*)MPC5XXX_SDRAM_CS0CFG, 0x13 +
+ __builtin_ffs(dramsize >> 20) - 1);
+ else
+ out_be32((u32*)MPC5XXX_SDRAM_CS0CFG, 0);
+
+ return dramsize;
+}
+
+void mvbc_init_gpio(void)
+{
+ struct mpc5xxx_gpio *gpio = (struct mpc5xxx_gpio*)MPC5XXX_GPIO;
+
+ printf("Ports : 0x%08x\n", gpio->port_config);
+ printf("PORCFG: 0x%08x\n", *(vu_long*)MPC5XXX_CDM_PORCFG);
+
+ out_be32(&gpio->simple_ddr, SIMPLE_DDR);
+ out_be32(&gpio->simple_dvo, SIMPLE_DVO);
+ out_be32(&gpio->simple_ode, SIMPLE_ODE);
+ out_be32(&gpio->simple_gpioe, SIMPLE_GPIOEN);
+
+ out_be32((u32*)&gpio->sint_ode, SINT_ODE);
+ out_be32((u32*)&gpio->sint_ddr, SINT_DDR);
+ out_be32((u32*)&gpio->sint_dvo, SINT_DVO);
+ out_be32((u32*)&gpio->sint_inten, SINT_INTEN);
+ out_be32((u32*)&gpio->sint_itype, SINT_ITYPE);
+ out_be32((u32*)&gpio->sint_gpioe, SINT_GPIOEN);
+
+ out_8((u8*)MPC5XXX_WU_GPIO_ODE, WKUP_ODE);
+ out_8((u8*)MPC5XXX_WU_GPIO_DIR, WKUP_DIR);
+ out_8((u8*)MPC5XXX_WU_GPIO_DATA_O, WKUP_DO);
+ out_8((u8*)MPC5XXX_WU_GPIO_ENABLE, WKUP_EN);
+
+ printf("simple_gpioe: 0x%08x\n", gpio->simple_gpioe);
+ printf("sint_gpioe : 0x%08x\n", gpio->sint_gpioe);
+}
+
+void reset_environment(void)
+{
+ char *s, sernr[64];
+
+ printf("\n*** RESET ENVIRONMENT ***\n");
+ memset(sernr, 0, sizeof(sernr));
+ s = getenv("serial#");
+ if (s) {
+ printf("found serial# : %s\n", s);
+ strncpy(sernr, s, 64);
+ }
+ gd->env_valid = 0;
+ env_relocate();
+ if (s)
+ setenv("serial#", sernr);
+}
+
+int misc_init_r(void)
+{
+ char *s = getenv("reset_env");
+
+ if (!s) {
+ if (in_8((u8*)MPC5XXX_WU_GPIO_DATA_I) & MPC5XXX_GPIO_WKUP_6)
+ return 0;
+ udelay(50000);
+ if (in_8((u8*)MPC5XXX_WU_GPIO_DATA_I) & MPC5XXX_GPIO_WKUP_6)
+ return 0;
+ udelay(50000);
+ if (in_8((u8*)MPC5XXX_WU_GPIO_DATA_I) & MPC5XXX_GPIO_WKUP_6)
+ return 0;
+ }
+ printf(" === FACTORY RESET ===\n");
+ reset_environment();
+ saveenv();
+
+ return -1;
+}
+
+int checkboard(void)
+{
+ mvbc_init_gpio();
+ printf("Board: Matrix Vision mvBlueCOUGAR-P\n");
+
+ return 0;
+}
+
+void flash_preinit(void)
+{
+ /*
+ * Now, when we are in RAM, enable flash write
+ * access for detection process.
+ * Note that CS_BOOT cannot be cleared when
+ * executing in flash.
+ */
+ clrbits_be32((u32*)MPC5XXX_BOOTCS_CFG, 0x1);
+}
+
+void flash_afterinit(ulong size)
+{
+ out_be32((u32*)MPC5XXX_BOOTCS_START, START_REG(CFG_BOOTCS_START |
+ size));
+ out_be32((u32*)MPC5XXX_CS0_START, START_REG(CFG_BOOTCS_START |
+ size));
+ out_be32((u32*)MPC5XXX_BOOTCS_STOP, STOP_REG(CFG_BOOTCS_START | size,
+ size));
+ out_be32((u32*)MPC5XXX_CS0_STOP, STOP_REG(CFG_BOOTCS_START | size,
+ size));
+}
+
+void pci_mvbc_fixup_irq(struct pci_controller *hose, pci_dev_t dev)
+{
+ unsigned char line = 0xff;
+ u32 base;
+
+ if (PCI_BUS(dev) == 0) {
+ switch (PCI_DEV (dev)) {
+ case 0xa: /* FPGA */
+ line = 3;
+ pci_hose_read_config_dword(hose, dev, PCI_BASE_ADDRESS_0, &base);
+ printf("found FPA - enable arbitration\n");
+ writel(0x03, (u32*)(base + 0x80c0));
+ writel(0xf0, (u32*)(base + 0x8080));
+ break;
+ case 0xb: /* LAN */
+ line = 2;
+ break;
+ case 0x1a:
+ break;
+ default:
+ printf ("***pci_scan: illegal dev = 0x%08x\n", PCI_DEV (dev));
+ break;
+ }
+ pci_hose_write_config_byte(hose, dev, PCI_INTERRUPT_LINE, line);
+ }
+}
+
+struct pci_controller hose = {
+ fixup_irq:pci_mvbc_fixup_irq
+};
+
+int mvbc_p_load_fpga(void)
+{
+ size_t data_size = 0;
+ void *fpga_data = NULL;
+ char *datastr = getenv("fpgadata");
+ char *sizestr = getenv("fpgadatasize");
+
+ if (datastr)
+ fpga_data = (void *)simple_strtoul(datastr, NULL, 16);
+ if (sizestr)
+ data_size = (size_t)simple_strtoul(sizestr, NULL, 16);
+
+ return fpga_load(0, fpga_data, data_size);
+}
+
+extern void pci_mpc5xxx_init(struct pci_controller *);
+
+void pci_init_board(void)
+{
+ char *s;
+ int load_fpga = 1;
+
+ mvbc_p_init_fpga();
+ s = getenv("skip_fpga");
+ if (s) {
+ printf("found 'skip_fpga' -> FPGA _not_ loaded !\n");
+ load_fpga = 0;
+ }
+ if (load_fpga) {
+ printf("loading FPGA ... ");
+ mvbc_p_load_fpga();
+ printf("done\n");
+ }
+ pci_mpc5xxx_init(&hose);
+}
+
+u8 *dhcp_vendorex_prep(u8 *e)
+{
+ char *ptr;
+
+ /* DHCP vendor-class-identifier = 60 */
+ if ((ptr = getenv("dhcp_vendor-class-identifier"))) {
+ *e++ = 60;
+ *e++ = strlen(ptr);
+ while (*ptr)
+ *e++ = *ptr++;
+ }
+ /* DHCP_CLIENT_IDENTIFIER = 61 */
+ if ((ptr = getenv("dhcp_client_id"))) {
+ *e++ = 61;
+ *e++ = strlen(ptr);
+ while (*ptr)
+ *e++ = *ptr++;
+ }
+
+ return e;
+}
+
+u8 *dhcp_vendorex_proc (u8 *popt)
+{
+ return NULL;
+}
+
+void show_boot_progress(int val)
+{
+ struct mpc5xxx_gpio *gpio = (struct mpc5xxx_gpio*)MPC5XXX_GPIO;
+
+ switch(val) {
+ case 0: /* FPGA ok */
+ setbits_be32(&gpio->simple_dvo, 0x80);
+ break;
+ case 1:
+ setbits_be32(&gpio->simple_dvo, 0x40);
+ break;
+ case 12:
+ setbits_be32(&gpio->simple_dvo, 0x20);
+ break;
+ case 15:
+ setbits_be32(&gpio->simple_dvo, 0x10);
+ break;
+ default:
+ break;
+ }
+
+}
+
+void ft_board_setup(void *blob, bd_t *bd)
+{
+ ft_cpu_setup(blob, bd);
+ fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
+}
diff --git a/board/matrix_vision/mvbc_p/mvbc_p.h b/board/matrix_vision/mvbc_p/mvbc_p.h
new file mode 100644
index 0000000..3330798
--- /dev/null
+++ b/board/matrix_vision/mvbc_p/mvbc_p.h
@@ -0,0 +1,43 @@
+#ifndef __MVBC_H__
+#define __MVBC_H__
+
+#define LED_G0 MPC5XXX_GPIO_SIMPLE_PSC2_0
+#define LED_G1 MPC5XXX_GPIO_SIMPLE_PSC2_1
+#define LED_Y MPC5XXX_GPIO_SIMPLE_PSC2_2
+#define LED_R MPC5XXX_GPIO_SIMPLE_PSC2_3
+#define ARB_X_EN MPC5XXX_GPIO_WKUP_PSC2_4
+
+#define FPGA_DIN MPC5XXX_GPIO_SIMPLE_PSC3_0
+#define FPGA_CCLK MPC5XXX_GPIO_SIMPLE_PSC3_1
+#define FPGA_CONF_DONE MPC5XXX_GPIO_SIMPLE_PSC3_2
+#define FPGA_CONFIG MPC5XXX_GPIO_SIMPLE_PSC3_3
+#define FPGA_STATUS MPC5XXX_GPIO_SINT_PSC3_4
+
+#define MAN_RST MPC5XXX_GPIO_WKUP_PSC6_0
+#define WD_TS MPC5XXX_GPIO_WKUP_PSC6_1
+#define WD_WDI MPC5XXX_GPIO_SIMPLE_PSC6_2
+#define COP_PRESENT MPC5XXX_GPIO_SIMPLE_PSC6_3
+#define FACT_RST MPC5XXX_GPIO_WKUP_6
+#define FLASH_RBY MPC5XXX_GPIO_WKUP_7
+
+#define SIMPLE_DDR (LED_G0 | LED_G1 | LED_Y | LED_R | \
+ FPGA_DIN | FPGA_CCLK | FPGA_CONFIG | WD_WDI)
+#define SIMPLE_DVO (FPGA_CONFIG)
+#define SIMPLE_ODE (FPGA_CONFIG)
+#define SIMPLE_GPIOEN (LED_G0 | LED_G1 | LED_Y | LED_R | \
+ FPGA_DIN | FPGA_CCLK | FPGA_CONF_DONE | FPGA_CONFIG |\
+ WD_WDI | COP_PRESENT)
+
+#define SINT_ODE 0
+#define SINT_DDR 0
+#define SINT_DVO 0
+#define SINT_INTEN 0
+#define SINT_ITYPE 0
+#define SINT_GPIOEN (FPGA_STATUS)
+
+#define WKUP_ODE (MAN_RST)
+#define WKUP_DIR (ARB_X_EN|MAN_RST|WD_TS)
+#define WKUP_DO (ARB_X_EN|MAN_RST|WD_TS)
+#define WKUP_EN (ARB_X_EN|MAN_RST|WD_TS|FACT_RST|FLASH_RBY)
+
+#endif
diff --git a/board/matrix_vision/mvbc_p/mvbc_p_autoscript b/board/matrix_vision/mvbc_p/mvbc_p_autoscript
new file mode 100644
index 0000000..5cee6c5
--- /dev/null
+++ b/board/matrix_vision/mvbc_p/mvbc_p_autoscript
@@ -0,0 +1,44 @@
+echo
+echo "==== running autoscript ===="
+echo
+setenv bootdtb bootm \${kernel_boot} \${mv_initrd_addr_ram} \${mv_dtb_addr_ram}
+setenv ramkernel setenv kernel_boot \${loadaddr}
+setenv flashkernel setenv kernel_boot \${mv_kernel_addr}
+setenv cpird cp \${mv_initrd_addr} \${mv_initrd_addr_ram} \${mv_initrd_length}
+setenv bootfromflash run flashkernel cpird ramparam addcons e1000para bootdtb
+setenv getdtb tftp \${mv_dtb_addr_ram} \${dtb_name}
+setenv cpdtb cp \${mv_dtb_addr} \${mv_dtb_addr_ram} 0x2000
+setenv rundtb fdt addr \${mv_dtb_addr_ram}\;fdt boardsetup
+setenv bootfromnet tftp \${mv_initrd_addr_ram} \${initrd_name}\;run ramkernel
+if test ${console} = yes;
+then
+setenv addcons setenv bootargs \${bootargs} console=ttyPSC\${console_nr},\${baudrate}N8
+else
+setenv addcons setenv bootargs \${bootargs} console=tty0
+fi
+setenv e1000para setenv bootargs \${bootargs} e1000.TxDescriptors=1500 e1000.SmartPowerDownEnable=1
+setenv set_static_ip setenv ipaddr \${static_ipaddr}
+setenv set_static_nm setenv netmask \${static_netmask}
+setenv set_static_gw setenv gatewayip \${static_gateway}
+setenv set_ip setenv ip \${ipaddr}::\${gatewayip}:\${netmask}
+setenv ramparam setenv bootargs root=/dev/ram0 ro rootfstype=squashfs
+if test ${autoscr_boot} != no;
+then
+ if test ${netboot} = yes;
+ then
+ bootp
+ if test $? = 0;
+ then
+ echo "=== bootp succeeded -> netboot ==="
+ run set_ip
+ run getdtb rundtb bootfromnet ramparam addcons e1000para bootdtb
+ else
+ echo "=== netboot failed ==="
+ fi
+ fi
+ run set_static_ip set_static_nm set_static_gw set_ip
+ echo "=== bootfromflash ==="
+ run cpdtb rundtb bootfromflash
+else
+ echo "=== boot stopped with autoscr_boot no ==="
+fi
diff --git a/doc/README.mvbc_p b/doc/README.mvbc_p
new file mode 100644
index 0000000..d32e57f
--- /dev/null
+++ b/doc/README.mvbc_p
@@ -0,0 +1,74 @@
+Matrix Vision mvBlueCOUGAR-P (mvBC-P)
+-------------------------------------
+
+1. Board Description
+
+ The mvBC-P is a 70x40x40mm multi board gigabit ethernet network camera
+ with main focus on GigEVision protocol in combination with local image
+ preprocessing.
+
+ Power Supply is either VDC 48V or Pover over Ethernet (PoE).
+
+2 System Components
+
+2.1 CPU
+ Freescale MPC5200B CPU running at 400MHz core and 133MHz XLB/IPB.
+ 64MB SDRAM @ 133MHz.
+ 8 MByte Nor Flash on local bus.
+ 1 serial ports. Console running on ttyS0 @ 115200 8N1.
+
+2.2 PCI
+ PCI clock fixed at 66MHz. Arbitration inside FPGA.
+ Intel GD82541ER network MAC/PHY and FPGA connected.
+
+2.3 FPGA
+ Altera Cyclone-II EP2C8 with PCI DMA engine.
+ Connects to Matrix Vision specific CCD/CMOS sensor interface.
+ Utilizes 64MB Nand Flash.
+
+2.3.1 I/O @ FPGA
+ 2 Outputs : photo coupler
+ 2 Inputs : photo coupler
+
+2.4 I2C
+ LM75 @ 0x90 for temperature monitoring.
+ EEPROM @ 0xA0 for vendor specifics.
+ image sensor interface (slave adresses depend on sensor)
+
+3 Flash layout.
+
+ reset vector is 0x00000100, i.e. "LOWBOOT".
+
+ FF800000 u-boot
+ FF840000 u-boot script image
+ FF850000 redundant u-boot script image
+ FF860000 FPGA raw bit file
+ FF8A0000 tbd.
+ FF900000 root FS
+ FFC00000 kernel
+ FFFC0000 device tree blob
+ FFFD0000 redundant device tree blob
+ FFFE0000 environment
+ FFFF0000 redundant environment
+
+ mtd partitions are propagated to linux kernel via device tree blob.
+
+4 Booting
+
+ On startup the bootscript @ FF840000 is executed. This script can be
+ exchanged easily. Default boot mode is "boot from flash", i.e. system
+ works stand-alone.
+
+ This behaviour depends on some environment variables :
+
+ "netboot" : yes ->try dhcp/bootp and boot from network.
+ A "dhcp_client_id" and "dhcp_vendor-class-identifier" can be used for
+ DHCP server configuration, e.g. to provide different images to
+ different devices.
+
+ During netboot the system tries to get 3 image files:
+ 1. Kernel - name + data is given during BOOTP.
+ 2. Initrd - name is stored in "initrd_name"
+ 3. device tree blob - name is stored in "dtb_name"
+ Fallback files are the flash versions.
+
diff --git a/include/configs/MVBC_P.h b/include/configs/MVBC_P.h
new file mode 100644
index 0000000..04580b7
--- /dev/null
+++ b/include/configs/MVBC_P.h
@@ -0,0 +1,316 @@
+/*
+ * (C) Copyright 2003-2004
+ * Wolfgang Denk, DENX Software Engineering, wd(a)denx.de.
+ *
+ * (C) Copyright 2004-2008
+ * Matrix-Vision GmbH, andre.schwarz(a)matrix-vision.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
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#include <version.h>
+
+#define CONFIG_MPC5xxx 1
+#define CONFIG_MPC5200 1
+
+#define CFG_MPC5XXX_CLKIN 33000000
+
+#define BOOTFLAG_COLD 0x01
+#define BOOTFLAG_WARM 0x02
+
+#define CONFIG_MISC_INIT_R 1
+
+#define CFG_CACHELINE_SIZE 32
+#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#define CFG_CACHELINE_SHIFT 5
+#endif
+
+#define CONFIG_PSC_CONSOLE 1
+#define CONFIG_BAUDRATE 115200
+#define CFG_BAUDRATE_TABLE {9600, 19200, 38400, 57600, 115200, 230400}
+
+#define CONFIG_PCI 1
+#define CONFIG_PCI_PNP 1
+#undef CONFIG_PCI_SCAN_SHOW
+#define CONFIG_PCIAUTO_SKIP_HOST_BRIDGE 1
+
+#define CONFIG_PCI_MEM_BUS 0x40000000
+#define CONFIG_PCI_MEM_PHYS CONFIG_PCI_MEM_BUS
+#define CONFIG_PCI_MEM_SIZE 0x10000000
+
+#define CONFIG_PCI_IO_BUS 0x50000000
+#define CONFIG_PCI_IO_PHYS CONFIG_PCI_IO_BUS
+#define CONFIG_PCI_IO_SIZE 0x01000000
+
+#define CFG_XLB_PIPELINING 1
+#define CONFIG_HIGH_BATS 1
+
+#define MV_CI mvBlueCOUGAR-P
+#define MV_VCI mvBlueCOUGAR-P
+#define MV_FPGA_DATA 0xff860000
+#define MV_FPGA_SIZE 0x0003c886
+#define MV_KERNEL_ADDR 0xffc00000
+#define MV_INITRD_ADDR 0xff900000
+#define MV_INITRD_LENGTH 0x00300000
+#define MV_SCRATCH_ADDR 0x00000000
+#define MV_SCRATCH_LENGTH MV_INITRD_LENGTH
+#define MV_AUTOSCR_ADDR 0xff840000
+#define MV_AUTOSCR_ADDR2 0xff850000
+#define MV_DTB_ADDR 0xfffc0000
+
+#define CONFIG_SHOW_BOOT_PROGRESS 1
+
+#define MV_KERNEL_ADDR_RAM 0x00100000
+#define MV_DTB_ADDR_RAM 0x00600000
+#define MV_INITRD_ADDR_RAM 0x01000000
+
+/* pass open firmware flat tree */
+#define CONFIG_OF_LIBFDT 1
+#define CONFIG_OF_BOARD_SETUP 1
+
+#define OF_CPU "PowerPC,5200@0"
+#define OF_SOC "soc5200@f0000000"
+#define OF_TBCLK (bd->bi_busfreq / 4)
+#define MV_DTB_NAME mvbc-p.dtb
+#define CONFIG_OF_STDOUT_VIA_ALIAS 1
+
+/*
+ * Supported commands
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_CACHE
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_SDRAM
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_FPGA
+
+#undef CONFIG_WATCHDOG
+
+#define CONFIG_BOOTP_VENDOREX
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_DNS
+#define CONFIG_BOOTP_DNS2
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_NTPSERVER
+#define CONFIG_BOOTP_RANDOM_DELAY
+#define CONFIG_BOOTP_SEND_HOSTNAME
+
+/*
+ * Autoboot
+ */
+#define CONFIG_BOOTDELAY 2
+#define CONFIG_AUTOBOOT_KEYED
+#define CONFIG_AUTOBOOT_STOP_STR "s"
+#define CONFIG_ZERO_BOOTDELAY_CHECK
+#define CONFIG_RESET_TO_RETRY 1000
+
+#define CONFIG_BOOTCOMMAND "if imi ${autoscr_addr}; \
+ then autoscr ${autoscr_addr}; \
+ else autoscr ${autoscr_addr2}; \
+ fi;"
+
+#define CONFIG_BOOTARGS "root=/dev/ram ro rootfstype=squashfs"
+#define CONFIG_ENV_OVERWRITE
+
+#define XMK_STR(x) #x
+#define MK_STR(x) XMK_STR(x)
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+ "console_nr=0\0" \
+ "console=yes\0" \
+ "stdin=serial\0" \
+ "stdout=serial\0" \
+ "stderr=serial\0" \
+ "fpga=0\0" \
+ "fpgadata=" MK_STR(MV_FPGA_DATA) "\0" \
+ "fpgadatasize=" MK_STR(MV_FPGA_SIZE) "\0" \
+ "autoscr_addr=" MK_STR(MV_AUTOSCR_ADDR) "\0" \
+ "autoscr_addr2=" MK_STR(MV_AUTOSCR_ADDR2) "\0" \
+ "mv_kernel_addr=" MK_STR(MV_KERNEL_ADDR) "\0" \
+ "mv_kernel_addr_ram=" MK_STR(MV_KERNEL_ADDR_RAM) "\0" \
+ "mv_initrd_addr=" MK_STR(MV_INITRD_ADDR) "\0" \
+ "mv_initrd_addr_ram=" MK_STR(MV_INITRD_ADDR_RAM) "\0" \
+ "mv_initrd_length=" MK_STR(MV_INITRD_LENGTH) "\0" \
+ "mv_dtb_addr=" MK_STR(MV_DTB_ADDR) "\0" \
+ "mv_dtb_addr_ram=" MK_STR(MV_DTB_ADDR_RAM) "\0" \
+ "dtb_name=" MK_STR(MV_DTB_NAME) "\0" \
+ "mv_scratch_addr=" MK_STR(MV_SCRATCH_ADDR) "\0" \
+ "mv_scratch_length=" MK_STR(MV_SCRATCH_LENGTH) "\0" \
+ "mv_version=" U_BOOT_VERSION "\0" \
+ "dhcp_client_id=" MK_STR(MV_CI) "\0" \
+ "dhcp_vendor-class-identifier=" MK_STR(MV_VCI) "\0" \
+ "netretry=no\0" \
+ "use_static_ipaddr=no\0" \
+ "static_ipaddr=192.168.90.10\0" \
+ "static_netmask=255.255.255.0\0" \
+ "static_gateway=0.0.0.0\0" \
+ "initrd_name=uInitrd.mvbc-p-rfs\0" \
+ "zcip=no\0" \
+ "netboot=yes\0" \
+ "mvtest=Ff\0" \
+ "tried_bootfromflash=no\0" \
+ "tried_bootfromnet=no\0" \
+ "use_dhcp=yes\0" \
+ "gev_start=yes\0" \
+ "mvbcdma_debug=0\0" \
+ "mvbcia_debug=0\0" \
+ "propdev_debug=0\0" \
+ "gevss_debug=0\0" \
+ "watchdog=1\0" \
+ ""
+
+#undef XMK_STR
+#undef MK_STR
+
+/*
+ * IPB Bus clocking configuration.
+ */
+#define CFG_IPBCLK_EQUALS_XLBCLK
+#define CFG_PCICLK_EQUALS_IPBCLK_DIV2
+
+/*
+ * Flash configuration
+ */
+#undef CONFIG_FLASH_16BIT
+#define CFG_FLASH_CFI
+#define CFG_FLASH_CFI_DRIVER
+#define CFG_FLASH_CFI_AMD_RESET 1
+#define CFG_FLASH_EMPTY_INFO
+
+#define CFG_FLASH_ERASE_TOUT 50000
+#define CFG_FLASH_WRITE_TOUT 1000
+
+#define CFG_MAX_FLASH_BANKS 1
+#define CFG_MAX_FLASH_SECT 256
+
+#define CFG_LOWBOOT
+#define CFG_FLASH_BASE TEXT_BASE
+#define CFG_FLASH_SIZE 0x00800000
+
+/*
+ * Environment settings
+ */
+#define CFG_ENV_IS_IN_FLASH
+#undef CFG_FLASH_PROTECTION
+
+#define CFG_ENV_ADDR 0xFFFE0000
+#define CFG_ENV_SIZE 0x10000
+#define CFG_ENV_SECT_SIZE 0x10000
+#define CFG_ENV_ADDR_REDUND (CFG_ENV_ADDR+CFG_ENV_SIZE)
+#define CFG_ENV_SIZE_REDUND CFG_ENV_SIZE
+
+/*
+ * Memory map
+ */
+#define CFG_MBAR 0xF0000000
+#define CFG_SDRAM_BASE 0x00000000
+#define CFG_DEFAULT_MBAR 0x80000000
+
+#define CFG_INIT_RAM_ADDR MPC5XXX_SRAM
+#define CFG_INIT_RAM_END MPC5XXX_SRAM_SIZE
+
+#define CFG_GBL_DATA_SIZE 128
+#define CFG_GBL_DATA_OFFSET (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
+#define CFG_INIT_SP_OFFSET CFG_GBL_DATA_OFFSET
+
+#define CFG_MONITOR_BASE TEXT_BASE
+#if (CFG_MONITOR_BASE < CFG_FLASH_BASE)
+#define CFG_RAMBOOT 1
+#endif
+
+/* CFG_MONITOR_LEN must be a multiple of CFG_ENV_SECT_SIZE */
+#define CFG_MONITOR_LEN (512 << 10)
+#define CFG_MALLOC_LEN (512 << 10)
+#define CFG_BOOTMAPSZ (8 << 20)
+
+/*
+ * Ethernet configuration
+ */
+#define CONFIG_NET_MULTI
+#define CONFIG_NET_RETRY_COUNT 5
+
+#define CONFIG_E1000
+#define CONFIG_E1000_FALLBACK_MAC 0xb6b445ebfbc0
+#undef CONFIG_MPC5xxx_FEC
+#undef CONFIG_PHY_ADDR
+#define CONFIG_NETDEV eth0
+
+/*
+ * Miscellaneous configurable options
+ */
+#define CFG_HUSH_PARSER
+#define CONFIG_CMDLINE_EDITING
+#define CFG_PROMPT_HUSH_PS2 "> "
+#undef CFG_LONGHELP
+#define CFG_PROMPT "=> "
+#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#define CFG_CBSIZE 1024
+#else
+#define CFG_CBSIZE 256
+#endif
+#define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16)
+#define CFG_MAXARGS 16
+#define CFG_BARGSIZE CFG_CBSIZE
+
+#define CFG_MEMTEST_START 0x00800000
+#define CFG_MEMTEST_END 0x02f00000
+
+#define CFG_HZ 1000
+
+/* default load address */
+#define CFG_LOAD_ADDR 0x02000000
+/* default location for tftp and bootm */
+#define CONFIG_LOADADDR 0x00200000
+
+/*
+ * Various low-level settings
+ */
+#define CFG_GPS_PORT_CONFIG 0x20000004
+
+#define CFG_HID0_INIT (HID0_ICE | HID0_ICFI)
+#define CFG_HID0_FINAL HID0_ICE
+
+#define CFG_BOOTCS_START CFG_FLASH_BASE
+#define CFG_BOOTCS_SIZE CFG_FLASH_SIZE
+#define CFG_BOOTCS_CFG 0x00047800
+#define CFG_CS0_START CFG_FLASH_BASE
+#define CFG_CS0_SIZE CFG_FLASH_SIZE
+
+#define CFG_CS_BURST 0x000000f0
+#define CFG_CS_DEADCYCLE 0x33333303
+
+#define CFG_RESET_ADDRESS 0x00000100
+
+#undef FPGA_DEBUG
+#undef CFG_FPGA_PROG_FEEDBACK
+#define CONFIG_FPGA CFG_ALTERA_CYCLON2
+#define CONFIG_FPGA_ALTERA 1
+#define CONFIG_FPGA_CYCLON2 1
+#define CONFIG_FPGA_COUNT 1
+
+#endif
diff --git a/include/mpc5xxx.h b/include/mpc5xxx.h
index a4581a3..5d11ef0 100644
--- a/include/mpc5xxx.h
+++ b/include/mpc5xxx.h
@@ -198,6 +198,35 @@
#define GPIO_PSC3_9 0x04000000UL
#define GPIO_PSC1_4 0x01000000UL
+#define MPC5XXX_GPIO_SIMPLE_PSC6_3 0x20000000UL
+#define MPC5XXX_GPIO_SIMPLE_PSC6_2 0x10000000UL
+#define MPC5XXX_GPIO_SIMPLE_PSC3_7 0x00002000UL
+#define MPC5XXX_GPIO_SIMPLE_PSC3_6 0x00001000UL
+#define MPC5XXX_GPIO_SIMPLE_PSC3_3 0x00000800UL
+#define MPC5XXX_GPIO_SIMPLE_PSC3_2 0x00000400UL
+#define MPC5XXX_GPIO_SIMPLE_PSC3_1 0x00000200UL
+#define MPC5XXX_GPIO_SIMPLE_PSC3_0 0x00000100UL
+#define MPC5XXX_GPIO_SIMPLE_PSC2_3 0x00000080UL
+#define MPC5XXX_GPIO_SIMPLE_PSC2_2 0x00000040UL
+#define MPC5XXX_GPIO_SIMPLE_PSC2_1 0x00000020UL
+#define MPC5XXX_GPIO_SIMPLE_PSC2_0 0x00000010UL
+#define MPC5XXX_GPIO_SIMPLE_PSC1_3 0x00000008UL
+#define MPC5XXX_GPIO_SIMPLE_PSC1_2 0x00000004UL
+#define MPC5XXX_GPIO_SIMPLE_PSC1_1 0x00000002UL
+#define MPC5XXX_GPIO_SIMPLE_PSC1_0 0x00000001UL
+
+#define MPC5XXX_GPIO_SINT_PSC3_5 0x02
+#define MPC5XXX_GPIO_SINT_PSC3_4 0x01
+
+#define MPC5XXX_GPIO_WKUP_7 0x80
+#define MPC5XXX_GPIO_WKUP_6 0x40
+#define MPC5XXX_GPIO_WKUP_PSC6_1 0x20
+#define MPC5XXX_GPIO_WKUP_PSC6_0 0x10
+#define MPC5XXX_GPIO_WKUP_ETH17 0x08
+#define MPC5XXX_GPIO_WKUP_PSC3_9 0x04
+#define MPC5XXX_GPIO_WKUP_PSC2_4 0x02
+#define MPC5XXX_GPIO_WKUP_PSC1_4 0x01
+
/* PCI registers */
#define MPC5XXX_PCI_CMD (MPC5XXX_PCI + 0x04)
#define MPC5XXX_PCI_CFG (MPC5XXX_PCI + 0x0c)
2
1
1
0
The MVBC_P is a MPC5200B based camera system with Intel Gigabit ethernet
controller (using e1000) and custom Altera Cyclone-II FPGA on PCI.
Please see doc/README.mvbc_p for details.
Signed-off-by: Andre Schwarz <andre.schwarz(a)matrix-vision.de>
---
Grant,
I've modified the patch to meet the requested changes on the list from Kim and Wolfgang.
- Add MK_STR define inside header and use it for environment
- get rid of sync instruction by using out_* accessors
- get rid of various ifdefs since they are not used anyway
- get rid of unused function hw_watchdog_reset()
Hope this helps in applying this patch.
regards,
Andre
MATRIX VISION GmbH, Talstraße 16, DE-71570 Oppenweiler - Registergericht: Amtsgericht Stuttgart, HRB 271090
Geschäftsführer: Gerhard Thullner, Werner Armingeon, Uwe Furtner
CREDITS | 2 +-
MAINTAINERS | 1 +
MAKEALL | 1 +
Makefile | 8 +
board/mvbc_p/Makefile | 50 ++++++
board/mvbc_p/config.mk | 30 ++++
board/mvbc_p/fpga.c | 177 +++++++++++++++++++++
board/mvbc_p/fpga.h | 34 ++++
board/mvbc_p/mvbc_p.c | 333 ++++++++++++++++++++++++++++++++++++++++
board/mvbc_p/mvbc_p.h | 72 +++++++++
board/mvbc_p/mvbc_p_autoscript | 44 ++++++
doc/README.mvbc_p | 74 +++++++++
include/configs/MVBC_P.h | 316 ++++++++++++++++++++++++++++++++++++++
13 files changed, 1141 insertions(+), 1 deletions(-)
diff --git a/CREDITS b/CREDITS
index aa57682..b1c10fd 100644
--- a/CREDITS
+++ b/CREDITS
@@ -426,7 +426,7 @@ D: FADS823 configuration, MPC823 video support, I2C, wireless keyboard, lots mor
N: Andre Schwarz
E: andre.schwarz(a)matrix-vision.de
-D: Support for Matrix Vision boards (MVBLM7)
+D: Support for Matrix Vision boards (MVBLM7/MVBC_P)
N: Robert Schwebel
E: r.schwebel(a)pengutronix.de
diff --git a/MAINTAINERS b/MAINTAINERS
index a3d70b1..9af5730 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -373,6 +373,7 @@ Peter De Schrijver <p2(a)mind.be>
Andre Schwarz <andre.schwarz(a)matrix-vision.de>
+ mvbc_p MPC5200
mvblm7 MPC8343
Timur Tabi <timur(a)freescale.com>
diff --git a/MAKEALL b/MAKEALL
index 9f80b3d..75261c1 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -48,6 +48,7 @@ LIST_5xxx=" \
mecp5200 \
motionpro \
munices \
+ MVBC_P \
o2dnt \
pf5200 \
PM520 \
diff --git a/Makefile b/Makefile
index ac3f98f..c8bc307 100644
--- a/Makefile
+++ b/Makefile
@@ -743,6 +743,14 @@ uc101_config: unconfig
motionpro_config: unconfig
@$(MKCONFIG) motionpro ppc mpc5xxx motionpro
+MVBC_P_config: unconfig
+ @mkdir -p $(obj)include
+ @mkdir -p $(obj)board/mvbc_p
+ @ >$(obj)include/config.h
+ @[ -z "$(findstring MVBC_P,$@)" ] || \
+ { echo "#define CONFIG_MVBC_P" >>$(obj)include/config.h; \
+ }
+ @$(MKCONFIG) -n $@ -a MVBC_P ppc mpc5xxx mvbc_p
#########################################################################
## MPC512x Systems
diff --git a/board/mvbc_p/Makefile b/board/mvbc_p/Makefile
new file mode 100644
index 0000000..7ae34cf
--- /dev/null
+++ b/board/mvbc_p/Makefile
@@ -0,0 +1,50 @@
+#
+# (C) Copyright 2003
+# Wolfgang Denk, DENX Software Engineering, wd(a)denx.de.
+#
+# (C) Copyright 2004-2008
+# Matrix-Vision GmbH, info(a)matrix-vision.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
+#
+
+include $(TOPDIR)/config.mk
+
+LIB = $(obj)lib$(BOARD).a
+
+COBJS := $(BOARD).o fpga.o
+
+SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS := $(addprefix $(obj),$(COBJS))
+SOBJS := $(addprefix $(obj),$(SOBJS))
+
+$(LIB): $(obj).depend $(OBJS)
+ $(AR) $(ARFLAGS) $@ $(OBJS)
+
+clean:
+ rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+ rm -f $(LIB) core *.bak .depend
+
+#########################################################################
+
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
diff --git a/board/mvbc_p/config.mk b/board/mvbc_p/config.mk
new file mode 100644
index 0000000..1c2a13e
--- /dev/null
+++ b/board/mvbc_p/config.mk
@@ -0,0 +1,30 @@
+#
+# (C) Copyright 2003
+# Wolfgang Denk, DENX Software Engineering, wd(a)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
+#
+
+sinclude $(TOPDIR)/board/$(BOARDDIR)/config.tmp
+
+ifndef TEXT_BASE
+TEXT_BASE = 0xFF800000
+endif
+
+PLATFORM_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE) -I$(TOPDIR)/board
diff --git a/board/mvbc_p/fpga.c b/board/mvbc_p/fpga.c
new file mode 100644
index 0000000..356af1a
--- /dev/null
+++ b/board/mvbc_p/fpga.c
@@ -0,0 +1,177 @@
+/*
+ * (C) Copyright 2002
+ * Rich Ireland, Enterasys Networks, rireland(a)enterasys.com.
+ * Keith Outwater, keith_outwater(a)mvis.com.
+ *
+ * (C) Copyright 2008
+ * Andre Schwarz, Matrix Vision GmbH, andre.schwarz(a)matrix-vision.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
+ *
+ */
+
+#include <common.h>
+#include <ACEX1K.h>
+#include <command.h>
+#include "fpga.h"
+#include "mvbc_p.h"
+
+#ifdef FPGA_DEBUG
+#define fpga_debug(fmt, args...) printf("%s: "fmt, __func__, ##args)
+#else
+#define fpga_debug(fmt, args...)
+#endif
+
+Altera_CYC2_Passive_Serial_fns altera_fns = {
+ fpga_null_fn,
+ fpga_config_fn,
+ fpga_status_fn,
+ fpga_done_fn,
+ fpga_wr_fn,
+ fpga_null_fn,
+ fpga_null_fn,
+ 0
+};
+
+Altera_desc cyclone2 = {
+ Altera_CYC2,
+ passive_serial,
+ Altera_EP2C8_SIZE,
+ (void *) &altera_fns,
+ NULL,
+ 0
+};
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int mvbc_p_init_fpga(void)
+{
+ fpga_debug("Initialize FPGA interface (reloc 0x%.8lx)\n",
+ gd->reloc_off);
+ fpga_init(gd->reloc_off);
+ fpga_add(fpga_altera, &cyclone2);
+ fpga_config_fn(0, 1, 0);
+ udelay(60);
+
+ return 1;
+}
+
+int fpga_null_fn(int cookie)
+{
+ return 0;
+}
+
+int fpga_config_fn(int assert, int flush, int cookie)
+{
+ struct mpc5xxx_gpio *gpio = (struct mpc5xxx_gpio*)MPC5XXX_GPIO;
+ u32 dvo = gpio->simple_dvo;
+
+ fpga_debug("SET config : %s\n", assert ? "low" : "high");
+ if (assert)
+ dvo |= FPGA_CONFIG;
+ else
+ dvo &= ~FPGA_CONFIG;
+
+ if (flush)
+ gpio->simple_dvo = dvo;
+
+ return assert;
+}
+
+int fpga_done_fn(int cookie)
+{
+ struct mpc5xxx_gpio *gpio = (struct mpc5xxx_gpio*)MPC5XXX_GPIO;
+ int result = 0;
+
+ udelay(10);
+ fpga_debug("CONF_DONE check ... ");
+ if (gpio->simple_ival & FPGA_CONF_DONE) {
+ fpga_debug("high\n");
+ result = 1;
+ } else
+ fpga_debug("low\n");
+
+ return result;
+}
+
+int fpga_status_fn(int cookie)
+{
+ struct mpc5xxx_gpio *gpio = (struct mpc5xxx_gpio*)MPC5XXX_GPIO;
+ int result = 0;
+
+ fpga_debug("STATUS check ... ");
+ if (gpio->sint_ival & FPGA_STATUS) {
+ fpga_debug("high\n");
+ result = 1;
+ } else
+ fpga_debug("low\n");
+
+ return result;
+}
+
+int fpga_clk_fn(int assert_clk, int flush, int cookie)
+{
+ struct mpc5xxx_gpio *gpio = (struct mpc5xxx_gpio*)MPC5XXX_GPIO;
+ u32 dvo = gpio->simple_dvo;
+
+ fpga_debug("CLOCK %s\n", assert_clk ? "high" : "low");
+ if (assert_clk)
+ dvo |= FPGA_CCLK;
+ else
+ dvo &= ~FPGA_CCLK;
+
+ if (flush)
+ gpio->simple_dvo = dvo;
+
+ return assert_clk;
+}
+
+static inline int _write_fpga(u8 val)
+{
+ int i;
+ struct mpc5xxx_gpio *gpio = (struct mpc5xxx_gpio*)MPC5XXX_GPIO;
+ u32 dvo = gpio->simple_dvo;
+
+ for (i=0; i<8; i++) {
+ dvo &= ~FPGA_CCLK;
+ gpio->simple_dvo = dvo;
+ dvo &= ~FPGA_DIN;
+ if (val & 1)
+ dvo |= FPGA_DIN;
+ gpio->simple_dvo = dvo;
+ dvo |= FPGA_CCLK;
+ gpio->simple_dvo = dvo;
+ val >>= 1;
+ }
+
+ return 0;
+}
+
+int fpga_wr_fn(void *buf, size_t len, int flush, int cookie)
+{
+ unsigned char *data = (unsigned char *) buf;
+ int i;
+
+ fpga_debug("fpga_wr: buf %p / size %d\n", buf, len);
+ for (i = 0; i < len; i++)
+ _write_fpga(data[i]);
+ fpga_debug("\n");
+
+ return FPGA_SUCCESS;
+}
diff --git a/board/mvbc_p/fpga.h b/board/mvbc_p/fpga.h
new file mode 100644
index 0000000..3723073
--- /dev/null
+++ b/board/mvbc_p/fpga.h
@@ -0,0 +1,34 @@
+/*
+ * (C) Copyright 2002
+ * Rich Ireland, Enterasys Networks, rireland(a)enterasys.com.
+ * Keith Outwater, keith_outwater(a)mvis.com.
+ *
+ * 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
+ *
+ */
+
+extern int mvbc_p_init_fpga(void);
+
+extern int fpga_pgm_fn(int assert_pgm, int flush, int cookie);
+extern int fpga_status_fn(int cookie);
+extern int fpga_config_fn(int assert, int flush, int cookie);
+extern int fpga_done_fn(int cookie);
+extern int fpga_clk_fn(int assert_clk, int flush, int cookie);
+extern int fpga_wr_fn(void *buf, size_t len, int flush, int cookie);
+extern int fpga_null_fn(int cookie);
diff --git a/board/mvbc_p/mvbc_p.c b/board/mvbc_p/mvbc_p.c
new file mode 100644
index 0000000..3c57b4a
--- /dev/null
+++ b/board/mvbc_p/mvbc_p.c
@@ -0,0 +1,333 @@
+/*
+ * (C) Copyright 2003
+ * Wolfgang Denk, DENX Software Engineering, wd(a)denx.de.
+ *
+ * (C) Copyright 2004
+ * Mark Jonas, Freescale Semiconductor, mark.jonas(a)motorola.com.
+ *
+ * (C) Copyright 2005-2007
+ * Andre Schwarz, Matrix Vision GmbH, andre.schwarz(a)matrix-vision.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
+ */
+
+#include <common.h>
+#include <mpc5xxx.h>
+#include <malloc.h>
+#include <pci.h>
+#include <i2c.h>
+#include <environment.h>
+#include <fdt_support.h>
+#include <asm/io.h>
+#include "fpga.h"
+#include "mvbc_p.h"
+
+#define SDRAM_MODE 0x00CD0000
+#define SDRAM_CONTROL 0x504F0000
+#define SDRAM_CONFIG1 0xD2322800
+#define SDRAM_CONFIG2 0x8AD70000
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static void sdram_start (int hi_addr)
+{
+ long hi_bit = hi_addr ? 0x01000000 : 0;
+
+ /* unlock mode register */
+ *(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000000 | hi_bit;
+ __asm__ volatile ("sync");
+
+ /* precharge all banks */
+ *(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000002 | hi_bit;
+ __asm__ volatile ("sync");
+
+ /* precharge all banks */
+ *(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000002 | hi_bit;
+ __asm__ volatile ("sync");
+
+ /* auto refresh */
+ *(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000004 | hi_bit;
+ __asm__ volatile ("sync");
+
+ /* set mode register */
+ *(vu_long *)MPC5XXX_SDRAM_MODE = SDRAM_MODE;
+ __asm__ volatile ("sync");
+
+ /* normal operation */
+ *(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | hi_bit;
+ __asm__ volatile ("sync");
+}
+
+phys_addr_t initdram (int board_type)
+{
+ ulong dramsize = 0;
+ ulong test1,
+ test2;
+
+ /* setup SDRAM chip selects */
+ *(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0x0000001e;
+ __asm__ volatile ("sync");
+
+ /* setup config registers */
+ *(vu_long *)MPC5XXX_SDRAM_CONFIG1 = SDRAM_CONFIG1;
+ *(vu_long *)MPC5XXX_SDRAM_CONFIG2 = SDRAM_CONFIG2;
+ __asm__ volatile ("sync");
+
+ /* find RAM size using SDRAM CS0 only */
+ sdram_start(0);
+ test1 = get_ram_size((long *)CFG_SDRAM_BASE, 0x80000000);
+ sdram_start(1);
+ test2 = get_ram_size((long *)CFG_SDRAM_BASE, 0x80000000);
+ if (test1 > test2) {
+ sdram_start(0);
+ dramsize = test1;
+ } else
+ dramsize = test2;
+
+ if (dramsize < (1 << 20))
+ dramsize = 0;
+
+ /* set SDRAM CS0 size according to the amount of RAM found */
+ if (dramsize > 0) {
+ *(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0x13 +
+ __builtin_ffs(dramsize >> 20) - 1;
+ } else {
+ *(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0;
+ }
+ return dramsize;
+}
+
+void mvbc_init_gpio(void)
+{
+ struct mpc5xxx_gpio *gpio = (struct mpc5xxx_gpio*)MPC5XXX_GPIO;
+
+ printf("Ports : 0x%08x\n", gpio->port_config);
+ printf("PORCFG: 0x%08x\n", *(vu_long*)MPC5XXX_CDM_PORCFG);
+
+ out_be32(&gpio->simple_ddr, SIMPLE_DDR);
+ out_be32(&gpio->simple_dvo, SIMPLE_DVO);
+ out_be32(&gpio->simple_ode, SIMPLE_ODE);
+ out_be32(&gpio->simple_gpioe, SIMPLE_GPIOEN);
+
+ out_be32(&gpio->sint_ode, SINT_ODE);
+ out_be32(&gpio->sint_ddr, SINT_DDR);
+ out_be32(&gpio->sint_dvo, SINT_DVO);
+ out_be32(&gpio->sint_inten, SINT_INTEN);
+ out_be32(&gpio->sint_itype, SINT_ITYPE);
+ out_be32(&gpio->sint_gpioe, SINT_GPIOEN);
+
+ out_8((unsigned char *)MPC5XXX_WU_GPIO_ODE, WKUP_ODE);
+ out_8((unsigned char *)MPC5XXX_WU_GPIO_DIR, WKUP_DIR);
+ out_8((unsigned char *)MPC5XXX_WU_GPIO_DATA_O, WKUP_DO);
+ out_8((unsigned char *)MPC5XXX_WU_GPIO_ENABLE, WKUP_EN);
+
+ printf("simple_gpioe: 0x%08x\n", gpio->simple_gpioe);
+ printf("sint_gpioe : 0x%08x\n", gpio->sint_gpioe);
+}
+
+void reset_environment(void)
+{
+ char *s, sernr[64];
+
+ printf("\n*** RESET ENVIRONMENT ***\n");
+ memset(sernr, 0, sizeof(sernr));
+ s = getenv("serial#");
+ if (s) {
+ printf("found serial# : %s\n", s);
+ strncpy(sernr, s, 64);
+ }
+ gd->env_valid = 0;
+ env_relocate();
+ if (s)
+ setenv("serial#", sernr);
+}
+
+int misc_init_r(void)
+{
+ char *s = getenv("reset_env");
+
+ if (!s) {
+ if ((*(vu_char *)MPC5XXX_WU_GPIO_DATA_I) & WKUP_6)
+ return 0;
+ udelay(50000);
+ if ((*(vu_char *)MPC5XXX_WU_GPIO_DATA_I) & WKUP_6)
+ return 0;
+ udelay(50000);
+ if ((*(vu_char *)MPC5XXX_WU_GPIO_DATA_I) & WKUP_6)
+ return 0;
+ }
+ printf(" === FACTORY RESET ===\n");
+ reset_environment();
+ saveenv();
+
+ return -1;
+}
+
+int checkboard(void)
+{
+ mvbc_init_gpio();
+ printf("Board: Matrix Vision mvBlueCOUGAR-P\n");
+
+ return 0;
+}
+
+void flash_preinit(void)
+{
+ /*
+ * Now, when we are in RAM, enable flash write
+ * access for detection process.
+ * Note that CS_BOOT cannot be cleared when
+ * executing in flash.
+ */
+ *(vu_long *)MPC5XXX_BOOTCS_CFG &= ~0x1; /* clear RO */
+}
+
+void flash_afterinit(ulong size)
+{
+ if (size == 0x800000) {
+ *(vu_long *)MPC5XXX_BOOTCS_START = *(vu_long *)MPC5XXX_CS0_START =
+ START_REG(CFG_BOOTCS_START | size);
+ *(vu_long *)MPC5XXX_BOOTCS_STOP = *(vu_long *)MPC5XXX_CS0_STOP =
+ STOP_REG(CFG_BOOTCS_START | size, size);
+ }
+}
+
+void pci_mvbc_fixup_irq(struct pci_controller *hose, pci_dev_t dev)
+{
+ unsigned char line = 0xff;
+ u32 base;
+
+ if (PCI_BUS(dev) == 0) {
+ switch (PCI_DEV (dev)) {
+ case 0xa: /* FPGA */
+ line = 3;
+ pci_hose_read_config_dword(hose, dev, PCI_BASE_ADDRESS_0, &base);
+ printf("found FPA - enable arbitration\n");
+ *(volatile u32*)(base + 0x80c0) = cpu_to_le32(3);
+ printf("set FPGA arbiter control : 0x%08x\n", *(volatile u32*)(base + 0x80c0));
+ *(volatile u32*)(base + 0x8080) = cpu_to_le32(0xf0);
+ break;
+ case 0xb: /* LAN */
+ line = 2;
+ break;
+ case 0x1a:
+ break;
+ default:
+ printf ("***pci_scan: illegal dev = 0x%08x\n", PCI_DEV (dev));
+ break;
+ }
+ pci_hose_write_config_byte(hose, dev, PCI_INTERRUPT_LINE, line);
+ }
+}
+
+struct pci_controller hose = {
+ fixup_irq:pci_mvbc_fixup_irq
+};
+
+int mvbc_p_load_fpga(void)
+{
+ size_t data_size = 0;
+ void *fpga_data = NULL;
+ char *datastr = getenv("fpgadata");
+ char *sizestr = getenv("fpgadatasize");
+
+ if (datastr)
+ fpga_data = (void *)simple_strtoul(datastr, NULL, 16);
+ if (sizestr)
+ data_size = (size_t)simple_strtoul(sizestr, NULL, 16);
+
+ return fpga_load(0, fpga_data, data_size);
+}
+
+extern void pci_mpc5xxx_init(struct pci_controller *);
+
+void pci_init_board(void)
+{
+ char *s;
+ int load_fpga = 1;
+
+ mvbc_p_init_fpga();
+ s = getenv("skip_fpga");
+ if (s) {
+ printf("found 'skip_fpga' -> FPGA _not_ loaded !\n");
+ load_fpga = 0;
+ }
+ if (load_fpga) {
+ printf("loading FPGA ... ");
+ mvbc_p_load_fpga();
+ printf("done\n");
+ }
+ pci_mpc5xxx_init(&hose);
+}
+
+u8 *dhcp_vendorex_prep(u8 *e)
+{
+ char *ptr;
+
+ /* DHCP vendor-class-identifier = 60 */
+ if ((ptr = getenv("dhcp_vendor-class-identifier"))) {
+ *e++ = 60;
+ *e++ = strlen(ptr);
+ while (*ptr)
+ *e++ = *ptr++;
+ }
+ /* DHCP_CLIENT_IDENTIFIER = 61 */
+ if ((ptr = getenv("dhcp_client_id"))) {
+ *e++ = 61;
+ *e++ = strlen(ptr);
+ while (*ptr)
+ *e++ = *ptr++;
+ }
+
+ return e;
+}
+
+u8 *dhcp_vendorex_proc (u8 *popt)
+{
+ return NULL;
+}
+
+void show_boot_progress(int val)
+{
+ struct mpc5xxx_gpio *gpio = (struct mpc5xxx_gpio*)MPC5XXX_GPIO;
+
+ switch(val) {
+ case 0: /* FPGA ok */
+ gpio->simple_dvo |= 0x80;
+ break;
+ case 1:
+ gpio->simple_dvo |= 0x40;
+ break;
+ case 12:
+ gpio->simple_dvo |= 0x20;
+ break;
+ case 15:
+ gpio->simple_dvo |= 0x10;
+ break;
+ default:
+ break;
+ }
+
+}
+
+void ft_board_setup(void *blob, bd_t *bd)
+{
+ ft_cpu_setup(blob, bd);
+ fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
+}
diff --git a/board/mvbc_p/mvbc_p.h b/board/mvbc_p/mvbc_p.h
new file mode 100644
index 0000000..9b153e8
--- /dev/null
+++ b/board/mvbc_p/mvbc_p.h
@@ -0,0 +1,72 @@
+#ifndef __MVBC_H__
+#define __MVBC_H__
+
+#define SIMPLE_PSC6_3 0x20000000
+#define SIMPLE_PSC6_2 0x10000000
+#define SIMPLE_PSC3_7 0x00002000
+#define SIMPLE_PSC3_6 0x00001000
+#define SIMPLE_PSC3_3 0x00000800
+#define SIMPLE_PSC3_2 0x00000400
+#define SIMPLE_PSC3_1 0x00000200
+#define SIMPLE_PSC3_0 0x00000100
+#define SIMPLE_PSC2_3 0x00000080
+#define SIMPLE_PSC2_2 0x00000040
+#define SIMPLE_PSC2_1 0x00000020
+#define SIMPLE_PSC2_0 0x00000010
+#define SIMPLE_PSC1_3 0x00000008
+#define SIMPLE_PSC1_2 0x00000004
+#define SIMPLE_PSC1_1 0x00000002
+#define SIMPLE_PSC1_0 0x00000001
+
+#define SINT_PSC3_5 0x02
+#define SINT_PSC3_4 0x01
+
+#define WKUP_7 0x80
+#define WKUP_6 0x40
+#define WKUP_PSC6_1 0x20
+#define WKUP_PSC6_0 0x10
+#define WKUP_ETH17 0x08
+#define WKUP_PSC3_9 0x04
+#define WKUP_PSC2_4 0x02
+#define WKUP_PSC1_4 0x01
+
+#define LED_G0 SIMPLE_PSC2_0
+#define LED_G1 SIMPLE_PSC2_1
+#define LED_Y SIMPLE_PSC2_2
+#define LED_R SIMPLE_PSC2_3
+#define ARB_X_EN WKUP_PSC2_4
+
+#define FPGA_DIN SIMPLE_PSC3_0
+#define FPGA_CCLK SIMPLE_PSC3_1
+#define FPGA_CONF_DONE SIMPLE_PSC3_2
+#define FPGA_CONFIG SIMPLE_PSC3_3
+#define FPGA_STATUS SINT_PSC3_4
+
+#define MAN_RST WKUP_PSC6_0
+#define WD_TS WKUP_PSC6_1
+#define WD_WDI SIMPLE_PSC6_2
+#define COP_PRESENT SIMPLE_PSC6_3
+#define FACT_RST WKUP_6
+#define FLASH_RBY WKUP_7
+
+#define SIMPLE_DDR (LED_G0 | LED_G1 | LED_Y | LED_R | \
+ FPGA_DIN | FPGA_CCLK | FPGA_CONFIG | WD_WDI)
+#define SIMPLE_DVO (FPGA_CONFIG)
+#define SIMPLE_ODE (FPGA_CONFIG)
+#define SIMPLE_GPIOEN (LED_G0 | LED_G1 | LED_Y | LED_R | \
+ FPGA_DIN | FPGA_CCLK | FPGA_CONF_DONE | FPGA_CONFIG |\
+ WD_WDI | COP_PRESENT)
+
+#define SINT_ODE 0
+#define SINT_DDR 0
+#define SINT_DVO 0
+#define SINT_INTEN 0
+#define SINT_ITYPE 0
+#define SINT_GPIOEN (FPGA_STATUS)
+
+#define WKUP_ODE (MAN_RST)
+#define WKUP_DIR (ARB_X_EN|MAN_RST|WD_TS)
+#define WKUP_DO (ARB_X_EN|MAN_RST|WD_TS)
+#define WKUP_EN (ARB_X_EN|MAN_RST|WD_TS|FACT_RST|FLASH_RBY)
+
+#endif
diff --git a/board/mvbc_p/mvbc_p_autoscript b/board/mvbc_p/mvbc_p_autoscript
new file mode 100644
index 0000000..5cee6c5
--- /dev/null
+++ b/board/mvbc_p/mvbc_p_autoscript
@@ -0,0 +1,44 @@
+echo
+echo "==== running autoscript ===="
+echo
+setenv bootdtb bootm \${kernel_boot} \${mv_initrd_addr_ram} \${mv_dtb_addr_ram}
+setenv ramkernel setenv kernel_boot \${loadaddr}
+setenv flashkernel setenv kernel_boot \${mv_kernel_addr}
+setenv cpird cp \${mv_initrd_addr} \${mv_initrd_addr_ram} \${mv_initrd_length}
+setenv bootfromflash run flashkernel cpird ramparam addcons e1000para bootdtb
+setenv getdtb tftp \${mv_dtb_addr_ram} \${dtb_name}
+setenv cpdtb cp \${mv_dtb_addr} \${mv_dtb_addr_ram} 0x2000
+setenv rundtb fdt addr \${mv_dtb_addr_ram}\;fdt boardsetup
+setenv bootfromnet tftp \${mv_initrd_addr_ram} \${initrd_name}\;run ramkernel
+if test ${console} = yes;
+then
+setenv addcons setenv bootargs \${bootargs} console=ttyPSC\${console_nr},\${baudrate}N8
+else
+setenv addcons setenv bootargs \${bootargs} console=tty0
+fi
+setenv e1000para setenv bootargs \${bootargs} e1000.TxDescriptors=1500 e1000.SmartPowerDownEnable=1
+setenv set_static_ip setenv ipaddr \${static_ipaddr}
+setenv set_static_nm setenv netmask \${static_netmask}
+setenv set_static_gw setenv gatewayip \${static_gateway}
+setenv set_ip setenv ip \${ipaddr}::\${gatewayip}:\${netmask}
+setenv ramparam setenv bootargs root=/dev/ram0 ro rootfstype=squashfs
+if test ${autoscr_boot} != no;
+then
+ if test ${netboot} = yes;
+ then
+ bootp
+ if test $? = 0;
+ then
+ echo "=== bootp succeeded -> netboot ==="
+ run set_ip
+ run getdtb rundtb bootfromnet ramparam addcons e1000para bootdtb
+ else
+ echo "=== netboot failed ==="
+ fi
+ fi
+ run set_static_ip set_static_nm set_static_gw set_ip
+ echo "=== bootfromflash ==="
+ run cpdtb rundtb bootfromflash
+else
+ echo "=== boot stopped with autoscr_boot no ==="
+fi
diff --git a/doc/README.mvbc_p b/doc/README.mvbc_p
new file mode 100644
index 0000000..d32e57f
--- /dev/null
+++ b/doc/README.mvbc_p
@@ -0,0 +1,74 @@
+Matrix Vision mvBlueCOUGAR-P (mvBC-P)
+-------------------------------------
+
+1. Board Description
+
+ The mvBC-P is a 70x40x40mm multi board gigabit ethernet network camera
+ with main focus on GigEVision protocol in combination with local image
+ preprocessing.
+
+ Power Supply is either VDC 48V or Pover over Ethernet (PoE).
+
+2 System Components
+
+2.1 CPU
+ Freescale MPC5200B CPU running at 400MHz core and 133MHz XLB/IPB.
+ 64MB SDRAM @ 133MHz.
+ 8 MByte Nor Flash on local bus.
+ 1 serial ports. Console running on ttyS0 @ 115200 8N1.
+
+2.2 PCI
+ PCI clock fixed at 66MHz. Arbitration inside FPGA.
+ Intel GD82541ER network MAC/PHY and FPGA connected.
+
+2.3 FPGA
+ Altera Cyclone-II EP2C8 with PCI DMA engine.
+ Connects to Matrix Vision specific CCD/CMOS sensor interface.
+ Utilizes 64MB Nand Flash.
+
+2.3.1 I/O @ FPGA
+ 2 Outputs : photo coupler
+ 2 Inputs : photo coupler
+
+2.4 I2C
+ LM75 @ 0x90 for temperature monitoring.
+ EEPROM @ 0xA0 for vendor specifics.
+ image sensor interface (slave adresses depend on sensor)
+
+3 Flash layout.
+
+ reset vector is 0x00000100, i.e. "LOWBOOT".
+
+ FF800000 u-boot
+ FF840000 u-boot script image
+ FF850000 redundant u-boot script image
+ FF860000 FPGA raw bit file
+ FF8A0000 tbd.
+ FF900000 root FS
+ FFC00000 kernel
+ FFFC0000 device tree blob
+ FFFD0000 redundant device tree blob
+ FFFE0000 environment
+ FFFF0000 redundant environment
+
+ mtd partitions are propagated to linux kernel via device tree blob.
+
+4 Booting
+
+ On startup the bootscript @ FF840000 is executed. This script can be
+ exchanged easily. Default boot mode is "boot from flash", i.e. system
+ works stand-alone.
+
+ This behaviour depends on some environment variables :
+
+ "netboot" : yes ->try dhcp/bootp and boot from network.
+ A "dhcp_client_id" and "dhcp_vendor-class-identifier" can be used for
+ DHCP server configuration, e.g. to provide different images to
+ different devices.
+
+ During netboot the system tries to get 3 image files:
+ 1. Kernel - name + data is given during BOOTP.
+ 2. Initrd - name is stored in "initrd_name"
+ 3. device tree blob - name is stored in "dtb_name"
+ Fallback files are the flash versions.
+
diff --git a/include/configs/MVBC_P.h b/include/configs/MVBC_P.h
new file mode 100644
index 0000000..04580b7
--- /dev/null
+++ b/include/configs/MVBC_P.h
@@ -0,0 +1,316 @@
+/*
+ * (C) Copyright 2003-2004
+ * Wolfgang Denk, DENX Software Engineering, wd(a)denx.de.
+ *
+ * (C) Copyright 2004-2008
+ * Matrix-Vision GmbH, andre.schwarz(a)matrix-vision.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
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#include <version.h>
+
+#define CONFIG_MPC5xxx 1
+#define CONFIG_MPC5200 1
+
+#define CFG_MPC5XXX_CLKIN 33000000
+
+#define BOOTFLAG_COLD 0x01
+#define BOOTFLAG_WARM 0x02
+
+#define CONFIG_MISC_INIT_R 1
+
+#define CFG_CACHELINE_SIZE 32
+#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#define CFG_CACHELINE_SHIFT 5
+#endif
+
+#define CONFIG_PSC_CONSOLE 1
+#define CONFIG_BAUDRATE 115200
+#define CFG_BAUDRATE_TABLE {9600, 19200, 38400, 57600, 115200, 230400}
+
+#define CONFIG_PCI 1
+#define CONFIG_PCI_PNP 1
+#undef CONFIG_PCI_SCAN_SHOW
+#define CONFIG_PCIAUTO_SKIP_HOST_BRIDGE 1
+
+#define CONFIG_PCI_MEM_BUS 0x40000000
+#define CONFIG_PCI_MEM_PHYS CONFIG_PCI_MEM_BUS
+#define CONFIG_PCI_MEM_SIZE 0x10000000
+
+#define CONFIG_PCI_IO_BUS 0x50000000
+#define CONFIG_PCI_IO_PHYS CONFIG_PCI_IO_BUS
+#define CONFIG_PCI_IO_SIZE 0x01000000
+
+#define CFG_XLB_PIPELINING 1
+#define CONFIG_HIGH_BATS 1
+
+#define MV_CI mvBlueCOUGAR-P
+#define MV_VCI mvBlueCOUGAR-P
+#define MV_FPGA_DATA 0xff860000
+#define MV_FPGA_SIZE 0x0003c886
+#define MV_KERNEL_ADDR 0xffc00000
+#define MV_INITRD_ADDR 0xff900000
+#define MV_INITRD_LENGTH 0x00300000
+#define MV_SCRATCH_ADDR 0x00000000
+#define MV_SCRATCH_LENGTH MV_INITRD_LENGTH
+#define MV_AUTOSCR_ADDR 0xff840000
+#define MV_AUTOSCR_ADDR2 0xff850000
+#define MV_DTB_ADDR 0xfffc0000
+
+#define CONFIG_SHOW_BOOT_PROGRESS 1
+
+#define MV_KERNEL_ADDR_RAM 0x00100000
+#define MV_DTB_ADDR_RAM 0x00600000
+#define MV_INITRD_ADDR_RAM 0x01000000
+
+/* pass open firmware flat tree */
+#define CONFIG_OF_LIBFDT 1
+#define CONFIG_OF_BOARD_SETUP 1
+
+#define OF_CPU "PowerPC,5200@0"
+#define OF_SOC "soc5200@f0000000"
+#define OF_TBCLK (bd->bi_busfreq / 4)
+#define MV_DTB_NAME mvbc-p.dtb
+#define CONFIG_OF_STDOUT_VIA_ALIAS 1
+
+/*
+ * Supported commands
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_CACHE
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_SDRAM
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_FPGA
+
+#undef CONFIG_WATCHDOG
+
+#define CONFIG_BOOTP_VENDOREX
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_DNS
+#define CONFIG_BOOTP_DNS2
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_NTPSERVER
+#define CONFIG_BOOTP_RANDOM_DELAY
+#define CONFIG_BOOTP_SEND_HOSTNAME
+
+/*
+ * Autoboot
+ */
+#define CONFIG_BOOTDELAY 2
+#define CONFIG_AUTOBOOT_KEYED
+#define CONFIG_AUTOBOOT_STOP_STR "s"
+#define CONFIG_ZERO_BOOTDELAY_CHECK
+#define CONFIG_RESET_TO_RETRY 1000
+
+#define CONFIG_BOOTCOMMAND "if imi ${autoscr_addr}; \
+ then autoscr ${autoscr_addr}; \
+ else autoscr ${autoscr_addr2}; \
+ fi;"
+
+#define CONFIG_BOOTARGS "root=/dev/ram ro rootfstype=squashfs"
+#define CONFIG_ENV_OVERWRITE
+
+#define XMK_STR(x) #x
+#define MK_STR(x) XMK_STR(x)
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+ "console_nr=0\0" \
+ "console=yes\0" \
+ "stdin=serial\0" \
+ "stdout=serial\0" \
+ "stderr=serial\0" \
+ "fpga=0\0" \
+ "fpgadata=" MK_STR(MV_FPGA_DATA) "\0" \
+ "fpgadatasize=" MK_STR(MV_FPGA_SIZE) "\0" \
+ "autoscr_addr=" MK_STR(MV_AUTOSCR_ADDR) "\0" \
+ "autoscr_addr2=" MK_STR(MV_AUTOSCR_ADDR2) "\0" \
+ "mv_kernel_addr=" MK_STR(MV_KERNEL_ADDR) "\0" \
+ "mv_kernel_addr_ram=" MK_STR(MV_KERNEL_ADDR_RAM) "\0" \
+ "mv_initrd_addr=" MK_STR(MV_INITRD_ADDR) "\0" \
+ "mv_initrd_addr_ram=" MK_STR(MV_INITRD_ADDR_RAM) "\0" \
+ "mv_initrd_length=" MK_STR(MV_INITRD_LENGTH) "\0" \
+ "mv_dtb_addr=" MK_STR(MV_DTB_ADDR) "\0" \
+ "mv_dtb_addr_ram=" MK_STR(MV_DTB_ADDR_RAM) "\0" \
+ "dtb_name=" MK_STR(MV_DTB_NAME) "\0" \
+ "mv_scratch_addr=" MK_STR(MV_SCRATCH_ADDR) "\0" \
+ "mv_scratch_length=" MK_STR(MV_SCRATCH_LENGTH) "\0" \
+ "mv_version=" U_BOOT_VERSION "\0" \
+ "dhcp_client_id=" MK_STR(MV_CI) "\0" \
+ "dhcp_vendor-class-identifier=" MK_STR(MV_VCI) "\0" \
+ "netretry=no\0" \
+ "use_static_ipaddr=no\0" \
+ "static_ipaddr=192.168.90.10\0" \
+ "static_netmask=255.255.255.0\0" \
+ "static_gateway=0.0.0.0\0" \
+ "initrd_name=uInitrd.mvbc-p-rfs\0" \
+ "zcip=no\0" \
+ "netboot=yes\0" \
+ "mvtest=Ff\0" \
+ "tried_bootfromflash=no\0" \
+ "tried_bootfromnet=no\0" \
+ "use_dhcp=yes\0" \
+ "gev_start=yes\0" \
+ "mvbcdma_debug=0\0" \
+ "mvbcia_debug=0\0" \
+ "propdev_debug=0\0" \
+ "gevss_debug=0\0" \
+ "watchdog=1\0" \
+ ""
+
+#undef XMK_STR
+#undef MK_STR
+
+/*
+ * IPB Bus clocking configuration.
+ */
+#define CFG_IPBCLK_EQUALS_XLBCLK
+#define CFG_PCICLK_EQUALS_IPBCLK_DIV2
+
+/*
+ * Flash configuration
+ */
+#undef CONFIG_FLASH_16BIT
+#define CFG_FLASH_CFI
+#define CFG_FLASH_CFI_DRIVER
+#define CFG_FLASH_CFI_AMD_RESET 1
+#define CFG_FLASH_EMPTY_INFO
+
+#define CFG_FLASH_ERASE_TOUT 50000
+#define CFG_FLASH_WRITE_TOUT 1000
+
+#define CFG_MAX_FLASH_BANKS 1
+#define CFG_MAX_FLASH_SECT 256
+
+#define CFG_LOWBOOT
+#define CFG_FLASH_BASE TEXT_BASE
+#define CFG_FLASH_SIZE 0x00800000
+
+/*
+ * Environment settings
+ */
+#define CFG_ENV_IS_IN_FLASH
+#undef CFG_FLASH_PROTECTION
+
+#define CFG_ENV_ADDR 0xFFFE0000
+#define CFG_ENV_SIZE 0x10000
+#define CFG_ENV_SECT_SIZE 0x10000
+#define CFG_ENV_ADDR_REDUND (CFG_ENV_ADDR+CFG_ENV_SIZE)
+#define CFG_ENV_SIZE_REDUND CFG_ENV_SIZE
+
+/*
+ * Memory map
+ */
+#define CFG_MBAR 0xF0000000
+#define CFG_SDRAM_BASE 0x00000000
+#define CFG_DEFAULT_MBAR 0x80000000
+
+#define CFG_INIT_RAM_ADDR MPC5XXX_SRAM
+#define CFG_INIT_RAM_END MPC5XXX_SRAM_SIZE
+
+#define CFG_GBL_DATA_SIZE 128
+#define CFG_GBL_DATA_OFFSET (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
+#define CFG_INIT_SP_OFFSET CFG_GBL_DATA_OFFSET
+
+#define CFG_MONITOR_BASE TEXT_BASE
+#if (CFG_MONITOR_BASE < CFG_FLASH_BASE)
+#define CFG_RAMBOOT 1
+#endif
+
+/* CFG_MONITOR_LEN must be a multiple of CFG_ENV_SECT_SIZE */
+#define CFG_MONITOR_LEN (512 << 10)
+#define CFG_MALLOC_LEN (512 << 10)
+#define CFG_BOOTMAPSZ (8 << 20)
+
+/*
+ * Ethernet configuration
+ */
+#define CONFIG_NET_MULTI
+#define CONFIG_NET_RETRY_COUNT 5
+
+#define CONFIG_E1000
+#define CONFIG_E1000_FALLBACK_MAC 0xb6b445ebfbc0
+#undef CONFIG_MPC5xxx_FEC
+#undef CONFIG_PHY_ADDR
+#define CONFIG_NETDEV eth0
+
+/*
+ * Miscellaneous configurable options
+ */
+#define CFG_HUSH_PARSER
+#define CONFIG_CMDLINE_EDITING
+#define CFG_PROMPT_HUSH_PS2 "> "
+#undef CFG_LONGHELP
+#define CFG_PROMPT "=> "
+#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#define CFG_CBSIZE 1024
+#else
+#define CFG_CBSIZE 256
+#endif
+#define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16)
+#define CFG_MAXARGS 16
+#define CFG_BARGSIZE CFG_CBSIZE
+
+#define CFG_MEMTEST_START 0x00800000
+#define CFG_MEMTEST_END 0x02f00000
+
+#define CFG_HZ 1000
+
+/* default load address */
+#define CFG_LOAD_ADDR 0x02000000
+/* default location for tftp and bootm */
+#define CONFIG_LOADADDR 0x00200000
+
+/*
+ * Various low-level settings
+ */
+#define CFG_GPS_PORT_CONFIG 0x20000004
+
+#define CFG_HID0_INIT (HID0_ICE | HID0_ICFI)
+#define CFG_HID0_FINAL HID0_ICE
+
+#define CFG_BOOTCS_START CFG_FLASH_BASE
+#define CFG_BOOTCS_SIZE CFG_FLASH_SIZE
+#define CFG_BOOTCS_CFG 0x00047800
+#define CFG_CS0_START CFG_FLASH_BASE
+#define CFG_CS0_SIZE CFG_FLASH_SIZE
+
+#define CFG_CS_BURST 0x000000f0
+#define CFG_CS_DEADCYCLE 0x33333303
+
+#define CFG_RESET_ADDRESS 0x00000100
+
+#undef FPGA_DEBUG
+#undef CFG_FPGA_PROG_FEEDBACK
+#define CONFIG_FPGA CFG_ALTERA_CYCLON2
+#define CONFIG_FPGA_ALTERA 1
+#define CONFIG_FPGA_CYCLON2 1
+#define CONFIG_FPGA_COUNT 1
+
+#endif
4
4
The MVBC_P is a MPC5200B based camera system with Intel Gigabit ethernet
controller (using e1000) and custom Altera Cyclone-II FPGA on PCI.
Please see doc/README.mvbc_p for details.
Signed-off-by: Andre Schwarz <andre.schwarz(a)matrix-vision.de>
---
MATRIX VISION GmbH, Talstraße 16, DE-71570 Oppenweiler - Registergericht: Amtsgericht Stuttgart, HRB 271090
Geschäftsführer: Gerhard Thullner, Werner Armingeon, Uwe Furtner
CREDITS | 2 +-
MAINTAINERS | 1 +
MAKEALL | 1 +
Makefile | 8 +
board/mvbc_p/Makefile | 50 ++++++
board/mvbc_p/config.mk | 30 ++++
board/mvbc_p/fpga.c | 177 ++++++++++++++++++++
board/mvbc_p/fpga.h | 34 ++++
board/mvbc_p/mvbc_p.c | 345 ++++++++++++++++++++++++++++++++++++++++
board/mvbc_p/mvbc_p.h | 72 +++++++++
board/mvbc_p/mvbc_p_autoscript | 44 +++++
doc/README.mvbc_p | 74 +++++++++
include/configs/MVBC_P.h | 310 ++++++++++++++++++++++++++++++++++++
13 files changed, 1147 insertions(+), 1 deletions(-)
diff --git a/CREDITS b/CREDITS
index aa57682..b1c10fd 100644
--- a/CREDITS
+++ b/CREDITS
@@ -426,7 +426,7 @@ D: FADS823 configuration, MPC823 video support, I2C, wireless keyboard, lots mor
N: Andre Schwarz
E: andre.schwarz(a)matrix-vision.de
-D: Support for Matrix Vision boards (MVBLM7)
+D: Support for Matrix Vision boards (MVBLM7/MVBC_P)
N: Robert Schwebel
E: r.schwebel(a)pengutronix.de
diff --git a/MAINTAINERS b/MAINTAINERS
index a3d70b1..9af5730 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -373,6 +373,7 @@ Peter De Schrijver <p2(a)mind.be>
Andre Schwarz <andre.schwarz(a)matrix-vision.de>
+ mvbc_p MPC5200
mvblm7 MPC8343
Timur Tabi <timur(a)freescale.com>
diff --git a/MAKEALL b/MAKEALL
index 32caab7..ca9202b 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -48,6 +48,7 @@ LIST_5xxx=" \
mecp5200 \
motionpro \
munices \
+ MVBC_P \
o2dnt \
pf5200 \
PM520 \
diff --git a/Makefile b/Makefile
index 8bfc891..c6d0eda 100644
--- a/Makefile
+++ b/Makefile
@@ -743,6 +743,14 @@ uc101_config: unconfig
motionpro_config: unconfig
@$(MKCONFIG) motionpro ppc mpc5xxx motionpro
+MVBC_P_config: unconfig
+ @mkdir -p $(obj)include
+ @mkdir -p $(obj)board/mvbc_p
+ @ >$(obj)include/config.h
+ @[ -z "$(findstring MVBC_P,$@)" ] || \
+ { echo "#define CONFIG_MVBC_P" >>$(obj)include/config.h; \
+ }
+ @$(MKCONFIG) -n $@ -a MVBC_P ppc mpc5xxx mvbc_p
#########################################################################
## MPC512x Systems
diff --git a/board/mvbc_p/Makefile b/board/mvbc_p/Makefile
new file mode 100644
index 0000000..d4344dd
--- /dev/null
+++ b/board/mvbc_p/Makefile
@@ -0,0 +1,50 @@
+#
+# (C) Copyright 2003
+# Wolfgang Denk, DENX Software Engineering, wd(a)denx.de.
+#
+# (C) Copyright 2004-2006
+# Matrix-Vision GmbH, info(a)matrix-vision.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
+#
+
+include $(TOPDIR)/config.mk
+
+LIB = $(obj)lib$(BOARD).a
+
+COBJS := $(BOARD).o fpga.o
+
+SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS := $(addprefix $(obj),$(COBJS))
+SOBJS := $(addprefix $(obj),$(SOBJS))
+
+$(LIB): $(obj).depend $(OBJS)
+ $(AR) $(ARFLAGS) $@ $(OBJS)
+
+clean:
+ rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+ rm -f $(LIB) core *.bak .depend
+
+#########################################################################
+
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
diff --git a/board/mvbc_p/config.mk b/board/mvbc_p/config.mk
new file mode 100644
index 0000000..1c2a13e
--- /dev/null
+++ b/board/mvbc_p/config.mk
@@ -0,0 +1,30 @@
+#
+# (C) Copyright 2003
+# Wolfgang Denk, DENX Software Engineering, wd(a)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
+#
+
+sinclude $(TOPDIR)/board/$(BOARDDIR)/config.tmp
+
+ifndef TEXT_BASE
+TEXT_BASE = 0xFF800000
+endif
+
+PLATFORM_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE) -I$(TOPDIR)/board
diff --git a/board/mvbc_p/fpga.c b/board/mvbc_p/fpga.c
new file mode 100644
index 0000000..356af1a
--- /dev/null
+++ b/board/mvbc_p/fpga.c
@@ -0,0 +1,177 @@
+/*
+ * (C) Copyright 2002
+ * Rich Ireland, Enterasys Networks, rireland(a)enterasys.com.
+ * Keith Outwater, keith_outwater(a)mvis.com.
+ *
+ * (C) Copyright 2008
+ * Andre Schwarz, Matrix Vision GmbH, andre.schwarz(a)matrix-vision.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
+ *
+ */
+
+#include <common.h>
+#include <ACEX1K.h>
+#include <command.h>
+#include "fpga.h"
+#include "mvbc_p.h"
+
+#ifdef FPGA_DEBUG
+#define fpga_debug(fmt, args...) printf("%s: "fmt, __func__, ##args)
+#else
+#define fpga_debug(fmt, args...)
+#endif
+
+Altera_CYC2_Passive_Serial_fns altera_fns = {
+ fpga_null_fn,
+ fpga_config_fn,
+ fpga_status_fn,
+ fpga_done_fn,
+ fpga_wr_fn,
+ fpga_null_fn,
+ fpga_null_fn,
+ 0
+};
+
+Altera_desc cyclone2 = {
+ Altera_CYC2,
+ passive_serial,
+ Altera_EP2C8_SIZE,
+ (void *) &altera_fns,
+ NULL,
+ 0
+};
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int mvbc_p_init_fpga(void)
+{
+ fpga_debug("Initialize FPGA interface (reloc 0x%.8lx)\n",
+ gd->reloc_off);
+ fpga_init(gd->reloc_off);
+ fpga_add(fpga_altera, &cyclone2);
+ fpga_config_fn(0, 1, 0);
+ udelay(60);
+
+ return 1;
+}
+
+int fpga_null_fn(int cookie)
+{
+ return 0;
+}
+
+int fpga_config_fn(int assert, int flush, int cookie)
+{
+ struct mpc5xxx_gpio *gpio = (struct mpc5xxx_gpio*)MPC5XXX_GPIO;
+ u32 dvo = gpio->simple_dvo;
+
+ fpga_debug("SET config : %s\n", assert ? "low" : "high");
+ if (assert)
+ dvo |= FPGA_CONFIG;
+ else
+ dvo &= ~FPGA_CONFIG;
+
+ if (flush)
+ gpio->simple_dvo = dvo;
+
+ return assert;
+}
+
+int fpga_done_fn(int cookie)
+{
+ struct mpc5xxx_gpio *gpio = (struct mpc5xxx_gpio*)MPC5XXX_GPIO;
+ int result = 0;
+
+ udelay(10);
+ fpga_debug("CONF_DONE check ... ");
+ if (gpio->simple_ival & FPGA_CONF_DONE) {
+ fpga_debug("high\n");
+ result = 1;
+ } else
+ fpga_debug("low\n");
+
+ return result;
+}
+
+int fpga_status_fn(int cookie)
+{
+ struct mpc5xxx_gpio *gpio = (struct mpc5xxx_gpio*)MPC5XXX_GPIO;
+ int result = 0;
+
+ fpga_debug("STATUS check ... ");
+ if (gpio->sint_ival & FPGA_STATUS) {
+ fpga_debug("high\n");
+ result = 1;
+ } else
+ fpga_debug("low\n");
+
+ return result;
+}
+
+int fpga_clk_fn(int assert_clk, int flush, int cookie)
+{
+ struct mpc5xxx_gpio *gpio = (struct mpc5xxx_gpio*)MPC5XXX_GPIO;
+ u32 dvo = gpio->simple_dvo;
+
+ fpga_debug("CLOCK %s\n", assert_clk ? "high" : "low");
+ if (assert_clk)
+ dvo |= FPGA_CCLK;
+ else
+ dvo &= ~FPGA_CCLK;
+
+ if (flush)
+ gpio->simple_dvo = dvo;
+
+ return assert_clk;
+}
+
+static inline int _write_fpga(u8 val)
+{
+ int i;
+ struct mpc5xxx_gpio *gpio = (struct mpc5xxx_gpio*)MPC5XXX_GPIO;
+ u32 dvo = gpio->simple_dvo;
+
+ for (i=0; i<8; i++) {
+ dvo &= ~FPGA_CCLK;
+ gpio->simple_dvo = dvo;
+ dvo &= ~FPGA_DIN;
+ if (val & 1)
+ dvo |= FPGA_DIN;
+ gpio->simple_dvo = dvo;
+ dvo |= FPGA_CCLK;
+ gpio->simple_dvo = dvo;
+ val >>= 1;
+ }
+
+ return 0;
+}
+
+int fpga_wr_fn(void *buf, size_t len, int flush, int cookie)
+{
+ unsigned char *data = (unsigned char *) buf;
+ int i;
+
+ fpga_debug("fpga_wr: buf %p / size %d\n", buf, len);
+ for (i = 0; i < len; i++)
+ _write_fpga(data[i]);
+ fpga_debug("\n");
+
+ return FPGA_SUCCESS;
+}
diff --git a/board/mvbc_p/fpga.h b/board/mvbc_p/fpga.h
new file mode 100644
index 0000000..3723073
--- /dev/null
+++ b/board/mvbc_p/fpga.h
@@ -0,0 +1,34 @@
+/*
+ * (C) Copyright 2002
+ * Rich Ireland, Enterasys Networks, rireland(a)enterasys.com.
+ * Keith Outwater, keith_outwater(a)mvis.com.
+ *
+ * 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
+ *
+ */
+
+extern int mvbc_p_init_fpga(void);
+
+extern int fpga_pgm_fn(int assert_pgm, int flush, int cookie);
+extern int fpga_status_fn(int cookie);
+extern int fpga_config_fn(int assert, int flush, int cookie);
+extern int fpga_done_fn(int cookie);
+extern int fpga_clk_fn(int assert_clk, int flush, int cookie);
+extern int fpga_wr_fn(void *buf, size_t len, int flush, int cookie);
+extern int fpga_null_fn(int cookie);
diff --git a/board/mvbc_p/mvbc_p.c b/board/mvbc_p/mvbc_p.c
new file mode 100644
index 0000000..dc12109
--- /dev/null
+++ b/board/mvbc_p/mvbc_p.c
@@ -0,0 +1,345 @@
+/*
+ * (C) Copyright 2003
+ * Wolfgang Denk, DENX Software Engineering, wd(a)denx.de.
+ *
+ * (C) Copyright 2004
+ * Mark Jonas, Freescale Semiconductor, mark.jonas(a)motorola.com.
+ *
+ * (C) Copyright 2005-2007
+ * Andre Schwarz, Matrix Vision GmbH, andre.schwarz(a)matrix-vision.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
+ */
+
+#include <common.h>
+#include <mpc5xxx.h>
+#include <malloc.h>
+#include <pci.h>
+#include <i2c.h>
+#include <environment.h>
+#ifdef CONFIG_OF_LIBFDT
+#include <fdt_support.h>
+#endif
+#include "fpga.h"
+#include "mvbc_p.h"
+
+#define SDRAM_MODE 0x00CD0000
+#define SDRAM_CONTROL 0x504F0000
+#define SDRAM_CONFIG1 0xD2322800
+#define SDRAM_CONFIG2 0x8AD70000
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#ifndef CFG_RAMBOOT
+static void sdram_start (int hi_addr)
+{
+ long hi_bit = hi_addr ? 0x01000000 : 0;
+
+ /* unlock mode register */
+ *(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000000 | hi_bit;
+ __asm__ volatile ("sync");
+
+ /* precharge all banks */
+ *(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000002 | hi_bit;
+ __asm__ volatile ("sync");
+
+ /* precharge all banks */
+ *(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000002 | hi_bit;
+ __asm__ volatile ("sync");
+
+ /* auto refresh */
+ *(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000004 | hi_bit;
+ __asm__ volatile ("sync");
+
+ /* set mode register */
+ *(vu_long *)MPC5XXX_SDRAM_MODE = SDRAM_MODE;
+ __asm__ volatile ("sync");
+
+ /* normal operation */
+ *(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | hi_bit;
+ __asm__ volatile ("sync");
+}
+#endif
+
+phys_addr_t initdram (int board_type)
+{
+ ulong dramsize = 0;
+ ulong test1,
+ test2;
+
+ /* setup SDRAM chip selects */
+ *(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0x0000001e;
+ __asm__ volatile ("sync");
+
+ /* setup config registers */
+ *(vu_long *)MPC5XXX_SDRAM_CONFIG1 = SDRAM_CONFIG1;
+ *(vu_long *)MPC5XXX_SDRAM_CONFIG2 = SDRAM_CONFIG2;
+ __asm__ volatile ("sync");
+
+ /* find RAM size using SDRAM CS0 only */
+ sdram_start(0);
+ test1 = get_ram_size((long *)CFG_SDRAM_BASE, 0x80000000);
+ sdram_start(1);
+ test2 = get_ram_size((long *)CFG_SDRAM_BASE, 0x80000000);
+ if (test1 > test2) {
+ sdram_start(0);
+ dramsize = test1;
+ } else
+ dramsize = test2;
+
+ if (dramsize < (1 << 20))
+ dramsize = 0;
+
+ /* set SDRAM CS0 size according to the amount of RAM found */
+ if (dramsize > 0) {
+ *(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0x13 +
+ __builtin_ffs(dramsize >> 20) - 1;
+ } else {
+ *(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0;
+ }
+ return dramsize;
+}
+
+void mvbc_init_gpio(void)
+{
+ struct mpc5xxx_gpio *gpio = (struct mpc5xxx_gpio*)MPC5XXX_GPIO;
+
+ printf("Ports : 0x%08x\n", gpio->port_config);
+ printf("PORCFG: 0x%08x\n", *(vu_long*)MPC5XXX_CDM_PORCFG);
+
+ gpio->simple_ddr = SIMPLE_DDR;
+ gpio->simple_dvo = SIMPLE_DVO;
+ gpio->simple_ode = SIMPLE_ODE;
+ gpio->simple_gpioe = SIMPLE_GPIOEN;
+
+ gpio->sint_ode = SINT_ODE;
+ gpio->sint_ddr = SINT_DDR;
+ gpio->sint_dvo = SINT_DVO;
+ gpio->sint_inten = SINT_INTEN;
+ gpio->sint_itype = SINT_ITYPE;
+ gpio->sint_gpioe = SINT_GPIOEN;
+
+ *(vu_char *)MPC5XXX_WU_GPIO_ODE = WKUP_ODE;
+ *(vu_char *)MPC5XXX_WU_GPIO_DIR = WKUP_DIR;
+ *(vu_char *)MPC5XXX_WU_GPIO_DATA_O = WKUP_DO | ARB_X_EN;
+ *(vu_char *)MPC5XXX_WU_GPIO_ENABLE = WKUP_EN;
+
+ printf("simple_gpioe: 0x%08x\n", gpio->simple_gpioe);
+ printf("sint_gpioe : 0x%08x\n", gpio->sint_gpioe);
+ __asm__ volatile ("sync");
+}
+
+void hw_watchdog_reset(void)
+{
+ *(u8*) (0xff000005) = 0;
+ asm ("sync");
+}
+
+void reset_environment(void)
+{
+ char *s, sernr[64];
+
+ printf("\n*** RESET ENVIRONMENT ***\n");
+ memset(sernr, 0, sizeof(sernr));
+ s = getenv("serial#");
+ if (s) {
+ printf("found serial# : %s\n", s);
+ strncpy(sernr, s, 64);
+ }
+ gd->env_valid = 0;
+ env_relocate();
+ if (s)
+ setenv("serial#", sernr);
+}
+
+int misc_init_r(void)
+{
+ char *s = getenv("reset_env");
+
+ if (!s) {
+ if ((*(vu_char *)MPC5XXX_WU_GPIO_DATA_I) & WKUP_6)
+ return 0;
+ udelay(50000);
+ if ((*(vu_char *)MPC5XXX_WU_GPIO_DATA_I) & WKUP_6)
+ return 0;
+ udelay(50000);
+ if ((*(vu_char *)MPC5XXX_WU_GPIO_DATA_I) & WKUP_6)
+ return 0;
+ }
+ printf(" === FACTORY RESET ===\n");
+ reset_environment();
+ saveenv();
+
+ return -1;
+}
+
+int checkboard(void)
+{
+ mvbc_init_gpio();
+ printf("Board: Matrix Vision mvBlueCOUGAR-P\n");
+
+ return 0;
+}
+
+void flash_preinit(void)
+{
+ /*
+ * Now, when we are in RAM, enable flash write
+ * access for detection process.
+ * Note that CS_BOOT cannot be cleared when
+ * executing in flash.
+ */
+ *(vu_long *)MPC5XXX_BOOTCS_CFG &= ~0x1; /* clear RO */
+}
+
+void flash_afterinit(ulong size)
+{
+ if (size == 0x800000) {
+ *(vu_long *)MPC5XXX_BOOTCS_START = *(vu_long *)MPC5XXX_CS0_START =
+ START_REG(CFG_BOOTCS_START | size);
+ *(vu_long *)MPC5XXX_BOOTCS_STOP = *(vu_long *)MPC5XXX_CS0_STOP =
+ STOP_REG(CFG_BOOTCS_START | size, size);
+ }
+}
+
+void pci_mvbc_fixup_irq(struct pci_controller *hose, pci_dev_t dev)
+{
+ unsigned char line = 0xff;
+ u32 base;
+
+ if (PCI_BUS(dev) == 0) {
+ switch (PCI_DEV (dev)) {
+ case 0xa: /* FPGA */
+ line = 3;
+ pci_hose_read_config_dword(hose, dev, PCI_BASE_ADDRESS_0, &base);
+ printf("found FPA - enable arbitration\n");
+ *(volatile u32*)(base + 0x80c0) = cpu_to_le32(3);
+ printf("set FPGA arbiter control : 0x%08x\n", *(volatile u32*)(base + 0x80c0));
+ *(volatile u32*)(base + 0x8080) = cpu_to_le32(0xf0);
+ break;
+ case 0xb: /* LAN */
+ line = 2;
+ break;
+ case 0x1a:
+ break;
+ default:
+ printf ("***pci_scan: illegal dev = 0x%08x\n", PCI_DEV (dev));
+ break;
+ }
+ pci_hose_write_config_byte(hose, dev, PCI_INTERRUPT_LINE, line);
+ }
+}
+
+struct pci_controller hose = {
+ fixup_irq:pci_mvbc_fixup_irq
+};
+
+int mvbc_p_load_fpga(void)
+{
+ size_t data_size = 0;
+ void *fpga_data = NULL;
+ char *datastr = getenv("fpgadata");
+ char *sizestr = getenv("fpgadatasize");
+
+ if (datastr)
+ fpga_data = (void *)simple_strtoul(datastr, NULL, 16);
+ if (sizestr)
+ data_size = (size_t)simple_strtoul(sizestr, NULL, 16);
+
+ return fpga_load(0, fpga_data, data_size);
+}
+
+extern void pci_mpc5xxx_init(struct pci_controller *);
+
+void pci_init_board(void)
+{
+ char *s;
+ int load_fpga = 1;
+
+ mvbc_p_init_fpga();
+ s = getenv("skip_fpga");
+ if (s) {
+ printf("found 'skip_fpga' -> FPGA _not_ loaded !\n");
+ load_fpga = 0;
+ }
+ if (load_fpga) {
+ printf("loading FPGA ... ");
+ mvbc_p_load_fpga();
+ printf("done\n");
+ }
+ pci_mpc5xxx_init(&hose);
+}
+
+u8 *dhcp_vendorex_prep(u8 *e)
+{
+ char *ptr;
+
+ /* DHCP vendor-class-identifier = 60 */
+ if ((ptr = getenv("dhcp_vendor-class-identifier"))) {
+ *e++ = 60;
+ *e++ = strlen(ptr);
+ while (*ptr)
+ *e++ = *ptr++;
+ }
+ /* DHCP_CLIENT_IDENTIFIER = 61 */
+ if ((ptr = getenv("dhcp_client_id"))) {
+ *e++ = 61;
+ *e++ = strlen(ptr);
+ while (*ptr)
+ *e++ = *ptr++;
+ }
+
+ return e;
+}
+
+u8 *dhcp_vendorex_proc (u8 *popt)
+{
+ return NULL;
+}
+
+void show_boot_progress(int val)
+{
+ struct mpc5xxx_gpio *gpio = (struct mpc5xxx_gpio*)MPC5XXX_GPIO;
+
+ switch(val) {
+ case 0: /* FPGA ok */
+ gpio->simple_dvo |= 0x80;
+ break;
+ case 1:
+ gpio->simple_dvo |= 0x40;
+ break;
+ case 12:
+ gpio->simple_dvo |= 0x20;
+ break;
+ case 15:
+ gpio->simple_dvo |= 0x10;
+ break;
+ default:
+ break;
+ }
+
+}
+
+#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
+void ft_board_setup(void *blob, bd_t *bd)
+{
+ ft_cpu_setup(blob, bd);
+ fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
+}
+#endif
diff --git a/board/mvbc_p/mvbc_p.h b/board/mvbc_p/mvbc_p.h
new file mode 100644
index 0000000..3dc40d7
--- /dev/null
+++ b/board/mvbc_p/mvbc_p.h
@@ -0,0 +1,72 @@
+#ifndef __MVBC_H__
+#define __MVBC_H__
+
+#define SIMPLE_PSC6_3 0x20000000
+#define SIMPLE_PSC6_2 0x10000000
+#define SIMPLE_PSC3_7 0x00002000
+#define SIMPLE_PSC3_6 0x00001000
+#define SIMPLE_PSC3_3 0x00000800
+#define SIMPLE_PSC3_2 0x00000400
+#define SIMPLE_PSC3_1 0x00000200
+#define SIMPLE_PSC3_0 0x00000100
+#define SIMPLE_PSC2_3 0x00000080
+#define SIMPLE_PSC2_2 0x00000040
+#define SIMPLE_PSC2_1 0x00000020
+#define SIMPLE_PSC2_0 0x00000010
+#define SIMPLE_PSC1_3 0x00000008
+#define SIMPLE_PSC1_2 0x00000004
+#define SIMPLE_PSC1_1 0x00000002
+#define SIMPLE_PSC1_0 0x00000001
+
+#define SINT_PSC3_5 0x02
+#define SINT_PSC3_4 0x01
+
+#define WKUP_7 0x80
+#define WKUP_6 0x40
+#define WKUP_PSC6_1 0x20
+#define WKUP_PSC6_0 0x10
+#define WKUP_ETH17 0x08
+#define WKUP_PSC3_9 0x04
+#define WKUP_PSC2_4 0x02
+#define WKUP_PSC1_4 0x01
+
+#define LED_G0 SIMPLE_PSC2_0
+#define LED_G1 SIMPLE_PSC2_1
+#define LED_Y SIMPLE_PSC2_2
+#define LED_R SIMPLE_PSC2_3
+#define ARB_X_EN WKUP_PSC2_4
+
+#define FPGA_DIN SIMPLE_PSC3_0
+#define FPGA_CCLK SIMPLE_PSC3_1
+#define FPGA_CONF_DONE SIMPLE_PSC3_2
+#define FPGA_CONFIG SIMPLE_PSC3_3
+#define FPGA_STATUS SINT_PSC3_4
+
+#define MAN_RST WKUP_PSC6_0
+#define WD_TS WKUP_PSC6_1
+#define WD_WDI SIMPLE_PSC6_2
+#define COP_PRESENT SIMPLE_PSC6_3
+#define FACT_RST WKUP_6
+#define FLASH_RBY WKUP_7
+
+#define SIMPLE_DDR (LED_G0 | LED_G1 | LED_Y | LED_R | \
+ FPGA_DIN | FPGA_CCLK | FPGA_CONFIG | WD_WDI)
+#define SIMPLE_DVO (FPGA_CONFIG)
+#define SIMPLE_ODE (FPGA_CONFIG)
+#define SIMPLE_GPIOEN (LED_G0 | LED_G1 | LED_Y | LED_R | \
+ FPGA_DIN | FPGA_CCLK | FPGA_CONF_DONE | FPGA_CONFIG |\
+ WD_WDI | COP_PRESENT)
+
+#define SINT_ODE 0
+#define SINT_DDR 0
+#define SINT_DVO 0
+#define SINT_INTEN 0
+#define SINT_ITYPE 0
+#define SINT_GPIOEN (FPGA_STATUS)
+
+#define WKUP_ODE (MAN_RST)
+#define WKUP_DIR (ARB_X_EN|MAN_RST|WD_TS)
+#define WKUP_DO (MAN_RST|WD_TS)
+#define WKUP_EN (ARB_X_EN|MAN_RST|WD_TS|FACT_RST|FLASH_RBY)
+
+#endif
diff --git a/board/mvbc_p/mvbc_p_autoscript b/board/mvbc_p/mvbc_p_autoscript
new file mode 100644
index 0000000..5cee6c5
--- /dev/null
+++ b/board/mvbc_p/mvbc_p_autoscript
@@ -0,0 +1,44 @@
+echo
+echo "==== running autoscript ===="
+echo
+setenv bootdtb bootm \${kernel_boot} \${mv_initrd_addr_ram} \${mv_dtb_addr_ram}
+setenv ramkernel setenv kernel_boot \${loadaddr}
+setenv flashkernel setenv kernel_boot \${mv_kernel_addr}
+setenv cpird cp \${mv_initrd_addr} \${mv_initrd_addr_ram} \${mv_initrd_length}
+setenv bootfromflash run flashkernel cpird ramparam addcons e1000para bootdtb
+setenv getdtb tftp \${mv_dtb_addr_ram} \${dtb_name}
+setenv cpdtb cp \${mv_dtb_addr} \${mv_dtb_addr_ram} 0x2000
+setenv rundtb fdt addr \${mv_dtb_addr_ram}\;fdt boardsetup
+setenv bootfromnet tftp \${mv_initrd_addr_ram} \${initrd_name}\;run ramkernel
+if test ${console} = yes;
+then
+setenv addcons setenv bootargs \${bootargs} console=ttyPSC\${console_nr},\${baudrate}N8
+else
+setenv addcons setenv bootargs \${bootargs} console=tty0
+fi
+setenv e1000para setenv bootargs \${bootargs} e1000.TxDescriptors=1500 e1000.SmartPowerDownEnable=1
+setenv set_static_ip setenv ipaddr \${static_ipaddr}
+setenv set_static_nm setenv netmask \${static_netmask}
+setenv set_static_gw setenv gatewayip \${static_gateway}
+setenv set_ip setenv ip \${ipaddr}::\${gatewayip}:\${netmask}
+setenv ramparam setenv bootargs root=/dev/ram0 ro rootfstype=squashfs
+if test ${autoscr_boot} != no;
+then
+ if test ${netboot} = yes;
+ then
+ bootp
+ if test $? = 0;
+ then
+ echo "=== bootp succeeded -> netboot ==="
+ run set_ip
+ run getdtb rundtb bootfromnet ramparam addcons e1000para bootdtb
+ else
+ echo "=== netboot failed ==="
+ fi
+ fi
+ run set_static_ip set_static_nm set_static_gw set_ip
+ echo "=== bootfromflash ==="
+ run cpdtb rundtb bootfromflash
+else
+ echo "=== boot stopped with autoscr_boot no ==="
+fi
diff --git a/doc/README.mvbc_p b/doc/README.mvbc_p
new file mode 100644
index 0000000..d32e57f
--- /dev/null
+++ b/doc/README.mvbc_p
@@ -0,0 +1,74 @@
+Matrix Vision mvBlueCOUGAR-P (mvBC-P)
+-------------------------------------
+
+1. Board Description
+
+ The mvBC-P is a 70x40x40mm multi board gigabit ethernet network camera
+ with main focus on GigEVision protocol in combination with local image
+ preprocessing.
+
+ Power Supply is either VDC 48V or Pover over Ethernet (PoE).
+
+2 System Components
+
+2.1 CPU
+ Freescale MPC5200B CPU running at 400MHz core and 133MHz XLB/IPB.
+ 64MB SDRAM @ 133MHz.
+ 8 MByte Nor Flash on local bus.
+ 1 serial ports. Console running on ttyS0 @ 115200 8N1.
+
+2.2 PCI
+ PCI clock fixed at 66MHz. Arbitration inside FPGA.
+ Intel GD82541ER network MAC/PHY and FPGA connected.
+
+2.3 FPGA
+ Altera Cyclone-II EP2C8 with PCI DMA engine.
+ Connects to Matrix Vision specific CCD/CMOS sensor interface.
+ Utilizes 64MB Nand Flash.
+
+2.3.1 I/O @ FPGA
+ 2 Outputs : photo coupler
+ 2 Inputs : photo coupler
+
+2.4 I2C
+ LM75 @ 0x90 for temperature monitoring.
+ EEPROM @ 0xA0 for vendor specifics.
+ image sensor interface (slave adresses depend on sensor)
+
+3 Flash layout.
+
+ reset vector is 0x00000100, i.e. "LOWBOOT".
+
+ FF800000 u-boot
+ FF840000 u-boot script image
+ FF850000 redundant u-boot script image
+ FF860000 FPGA raw bit file
+ FF8A0000 tbd.
+ FF900000 root FS
+ FFC00000 kernel
+ FFFC0000 device tree blob
+ FFFD0000 redundant device tree blob
+ FFFE0000 environment
+ FFFF0000 redundant environment
+
+ mtd partitions are propagated to linux kernel via device tree blob.
+
+4 Booting
+
+ On startup the bootscript @ FF840000 is executed. This script can be
+ exchanged easily. Default boot mode is "boot from flash", i.e. system
+ works stand-alone.
+
+ This behaviour depends on some environment variables :
+
+ "netboot" : yes ->try dhcp/bootp and boot from network.
+ A "dhcp_client_id" and "dhcp_vendor-class-identifier" can be used for
+ DHCP server configuration, e.g. to provide different images to
+ different devices.
+
+ During netboot the system tries to get 3 image files:
+ 1. Kernel - name + data is given during BOOTP.
+ 2. Initrd - name is stored in "initrd_name"
+ 3. device tree blob - name is stored in "dtb_name"
+ Fallback files are the flash versions.
+
diff --git a/include/configs/MVBC_P.h b/include/configs/MVBC_P.h
new file mode 100644
index 0000000..286383a
--- /dev/null
+++ b/include/configs/MVBC_P.h
@@ -0,0 +1,310 @@
+/*
+ * (C) Copyright 2003-2004
+ * Wolfgang Denk, DENX Software Engineering, wd(a)denx.de.
+ *
+ * (C) Copyright 2004-2008
+ * Matrix-Vision GmbH, andre.schwarz(a)matrix-vision.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
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#include <version.h>
+
+#define CONFIG_MPC5xxx 1
+#define CONFIG_MPC5200 1
+
+#define CFG_MPC5XXX_CLKIN 33000000
+
+#define BOOTFLAG_COLD 0x01
+#define BOOTFLAG_WARM 0x02
+
+#define CONFIG_MISC_INIT_R 1
+
+#define CFG_CACHELINE_SIZE 32
+#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#define CFG_CACHELINE_SHIFT 5
+#endif
+
+#define CONFIG_PSC_CONSOLE 1
+#define CONFIG_BAUDRATE 115200
+#define CFG_BAUDRATE_TABLE {9600, 19200, 38400, 57600, 115200, 230400}
+
+#define CONFIG_PCI 1
+#define CONFIG_PCI_PNP 1
+#undef CONFIG_PCI_SCAN_SHOW
+#define CONFIG_PCIAUTO_SKIP_HOST_BRIDGE 1
+
+#define CONFIG_PCI_MEM_BUS 0x40000000
+#define CONFIG_PCI_MEM_PHYS CONFIG_PCI_MEM_BUS
+#define CONFIG_PCI_MEM_SIZE 0x10000000
+
+#define CONFIG_PCI_IO_BUS 0x50000000
+#define CONFIG_PCI_IO_PHYS CONFIG_PCI_IO_BUS
+#define CONFIG_PCI_IO_SIZE 0x01000000
+
+#define CFG_XLB_PIPELINING 1
+#define CONFIG_HIGH_BATS 1
+
+#define MV_CI "mvBlueCOUGAR-P"
+#define MV_VCI "mvBlueCOUGAR-P"
+#define MV_FPGA_DATA "0xff860000"
+#define MV_FPGA_SIZE "0x3c886"
+#define MV_KERNEL_ADDR "0xffc00000"
+#define MV_INITRD_ADDR "0xff900000"
+#define MV_INITRD_LENGTH "0x00300000"
+#define MV_SCRATCH_ADDR "0x00000000"
+#define MV_SCRATCH_LENGTH MV_INITRD_LENGTH
+#define MV_AUTOSCR_ADDR "0xff840000"
+#define MV_AUTOSCR_ADDR2 "0xff850000"
+#define MV_DTB_ADDR "0xfffc0000"
+
+#define CONFIG_SHOW_BOOT_PROGRESS 1
+
+#define MV_KERNEL_ADDR_RAM "0x00100000"
+#define MV_DTB_ADDR_RAM "0x00600000"
+#define MV_INITRD_ADDR_RAM "0x01000000"
+
+/* pass open firmware flat tree */
+#define CONFIG_OF_LIBFDT 1
+#define CONFIG_OF_BOARD_SETUP 1
+
+#define OF_CPU "PowerPC,5200@0"
+#define OF_SOC "soc5200@f0000000"
+#define OF_TBCLK (bd->bi_busfreq / 4)
+#define MV_DTB_NAME "mvbc-p.dtb"
+#define CONFIG_OF_STDOUT_VIA_ALIAS 1
+
+/*
+ * Supported commands
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_CACHE
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_SDRAM
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_FPGA
+
+#undef CONFIG_WATCHDOG
+
+#define CONFIG_BOOTP_VENDOREX
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_DNS
+#define CONFIG_BOOTP_DNS2
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_NTPSERVER
+#define CONFIG_BOOTP_RANDOM_DELAY
+#define CONFIG_BOOTP_SEND_HOSTNAME
+
+/*
+ * Autoboot
+ */
+#define CONFIG_BOOTDELAY 2
+#define CONFIG_AUTOBOOT_KEYED
+#define CONFIG_AUTOBOOT_STOP_STR "s"
+#define CONFIG_ZERO_BOOTDELAY_CHECK
+#define CONFIG_RESET_TO_RETRY 1000
+
+#define CONFIG_BOOTCOMMAND "if imi ${autoscr_addr}; \
+ then autoscr ${autoscr_addr}; \
+ else autoscr ${autoscr_addr2}; \
+ fi;"
+
+#define CONFIG_BOOTARGS "root=/dev/ram ro rootfstype=squashfs"
+#define CONFIG_ENV_OVERWRITE
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+ "console_nr=0\0" \
+ "console=yes\0" \
+ "stdin=serial\0" \
+ "stdout=serial\0" \
+ "stderr=serial\0" \
+ "fpga=0\0" \
+ "fpgadata=" MV_FPGA_DATA "\0" \
+ "fpgadatasize=" MV_FPGA_SIZE "\0" \
+ "autoscr_addr=" MV_AUTOSCR_ADDR "\0" \
+ "autoscr_addr2=" MV_AUTOSCR_ADDR2 "\0" \
+ "mv_kernel_addr=" MV_KERNEL_ADDR "\0" \
+ "mv_kernel_addr_ram=" MV_KERNEL_ADDR_RAM "\0" \
+ "mv_initrd_addr=" MV_INITRD_ADDR "\0" \
+ "mv_initrd_addr_ram=" MV_INITRD_ADDR_RAM "\0" \
+ "mv_initrd_length=" MV_INITRD_LENGTH "\0" \
+ "mv_dtb_addr=" MV_DTB_ADDR "\0" \
+ "mv_dtb_addr_ram=" MV_DTB_ADDR_RAM "\0" \
+ "dtb_name=" MV_DTB_NAME "\0" \
+ "mv_scratch_addr=" MV_SCRATCH_ADDR "\0" \
+ "mv_scratch_length=" MV_SCRATCH_LENGTH "\0" \
+ "mv_version=" U_BOOT_VERSION "\0" \
+ "dhcp_client_id=" MV_CI "\0" \
+ "dhcp_vendor-class-identifier=" MV_VCI "\0" \
+ "netretry=no\0" \
+ "use_static_ipaddr=no\0" \
+ "static_ipaddr=192.168.90.10\0" \
+ "static_netmask=255.255.255.0\0" \
+ "static_gateway=0.0.0.0\0" \
+ "initrd_name=uInitrd.mvbc-p-rfs\0" \
+ "zcip=no\0" \
+ "netboot=yes\0" \
+ "mvtest=Ff\0" \
+ "tried_bootfromflash=no\0" \
+ "tried_bootfromnet=no\0" \
+ "use_dhcp=yes\0" \
+ "gev_start=yes\0" \
+ "mvbcdma_debug=0\0" \
+ "mvbcia_debug=0\0" \
+ "propdev_debug=0\0" \
+ "gevss_debug=0\0" \
+ "watchdog=1\0" \
+ ""
+
+/*
+ * IPB Bus clocking configuration.
+ */
+#define CFG_IPBCLK_EQUALS_XLBCLK
+#define CFG_PCICLK_EQUALS_IPBCLK_DIV2
+
+/*
+ * Flash configuration
+ */
+#undef CONFIG_FLASH_16BIT
+#define CFG_FLASH_CFI
+#define CFG_FLASH_CFI_DRIVER
+#define CFG_FLASH_CFI_AMD_RESET 1
+#define CFG_FLASH_EMPTY_INFO
+
+#define CFG_FLASH_ERASE_TOUT 50000
+#define CFG_FLASH_WRITE_TOUT 1000
+
+#define CFG_MAX_FLASH_BANKS 1
+#define CFG_MAX_FLASH_SECT 256
+
+#define CFG_LOWBOOT
+#define CFG_FLASH_BASE TEXT_BASE
+#define CFG_FLASH_SIZE 0x00800000
+
+/*
+ * Environment settings
+ */
+#define CFG_ENV_IS_IN_FLASH
+#undef CFG_FLASH_PROTECTION
+
+#define CFG_ENV_ADDR 0xFFFE0000
+#define CFG_ENV_SIZE 0x10000
+#define CFG_ENV_SECT_SIZE 0x10000
+#define CFG_ENV_ADDR_REDUND (CFG_ENV_ADDR+CFG_ENV_SIZE)
+#define CFG_ENV_SIZE_REDUND CFG_ENV_SIZE
+
+/*
+ * Memory map
+ */
+#define CFG_MBAR 0xF0000000
+#define CFG_SDRAM_BASE 0x00000000
+#define CFG_DEFAULT_MBAR 0x80000000
+
+#define CFG_INIT_RAM_ADDR MPC5XXX_SRAM
+#define CFG_INIT_RAM_END MPC5XXX_SRAM_SIZE
+
+#define CFG_GBL_DATA_SIZE 128
+#define CFG_GBL_DATA_OFFSET (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
+#define CFG_INIT_SP_OFFSET CFG_GBL_DATA_OFFSET
+
+#define CFG_MONITOR_BASE TEXT_BASE
+#if (CFG_MONITOR_BASE < CFG_FLASH_BASE)
+#define CFG_RAMBOOT 1
+#endif
+
+/* CFG_MONITOR_LEN must be a multiple of CFG_ENV_SECT_SIZE */
+#define CFG_MONITOR_LEN (512 << 10)
+#define CFG_MALLOC_LEN (512 << 10)
+#define CFG_BOOTMAPSZ (8 << 20)
+
+/*
+ * Ethernet configuration
+ */
+#define CONFIG_NET_MULTI
+#define CONFIG_NET_RETRY_COUNT 5
+
+#define CONFIG_E1000
+#define CONFIG_E1000_FALLBACK_MAC 0xb6b445ebfbc0
+#undef CONFIG_MPC5xxx_FEC
+#undef CONFIG_PHY_ADDR
+#define CONFIG_NETDEV eth0
+
+/*
+ * Miscellaneous configurable options
+ */
+#define CFG_HUSH_PARSER
+#define CONFIG_CMDLINE_EDITING
+#define CFG_PROMPT_HUSH_PS2 "> "
+#undef CFG_LONGHELP
+#define CFG_PROMPT "=> "
+#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#define CFG_CBSIZE 1024
+#else
+#define CFG_CBSIZE 256
+#endif
+#define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16)
+#define CFG_MAXARGS 16
+#define CFG_BARGSIZE CFG_CBSIZE
+
+#define CFG_MEMTEST_START 0x00800000
+#define CFG_MEMTEST_END 0x02f00000
+
+#define CFG_HZ 1000
+
+/* default load address */
+#define CFG_LOAD_ADDR 0x02000000
+/* default location for tftp and bootm */
+#define CONFIG_LOADADDR 0x00200000
+
+/*
+ * Various low-level settings
+ */
+#define CFG_GPS_PORT_CONFIG 0x20000004
+
+#define CFG_HID0_INIT (HID0_ICE | HID0_ICFI)
+#define CFG_HID0_FINAL HID0_ICE
+
+#define CFG_BOOTCS_START CFG_FLASH_BASE
+#define CFG_BOOTCS_SIZE CFG_FLASH_SIZE
+#define CFG_BOOTCS_CFG 0x00047800
+#define CFG_CS0_START CFG_FLASH_BASE
+#define CFG_CS0_SIZE CFG_FLASH_SIZE
+
+#define CFG_CS_BURST 0x000000f0
+#define CFG_CS_DEADCYCLE 0x33333303
+
+#define CFG_RESET_ADDRESS 0x00000100
+
+#undef FPGA_DEBUG
+#undef CFG_FPGA_PROG_FEEDBACK
+#define CONFIG_FPGA CFG_ALTERA_CYCLON2
+#define CONFIG_FPGA_ALTERA 1
+#define CONFIG_FPGA_CYCLON2 1
+#define CONFIG_FPGA_COUNT 1
+
+#endif
4
7

08 Jul '08
These two patches move the default initialization of Coldfire FEC controllers
to cpu_eth_init() in the CPU directories.
I don't have a Coldfire cross compiler set up nor do I have any hardware, so
I'm looking for volunteers to do the following:
1. Run 'MAKEALL coldfire' to check for compile-time errors
2. Try the code out on real hardware
I'm pushing these patches to a 'testing' branch on the net repo. Please clone
it as follows:
$ git clone git://git.denx.de/u-boot-net.git
$ cd u-boot-net
$ git checkout testing
thanks!
Ben
2
8
Hi,
We are using the u-boot application to boot up from a NAND flash on a STB board with a linux kernel image. The entire process seems to be going in a loop with the foll message:
"Loading boot sector - OK "
Please let us know how what the problem could be.
Regards,
Shilpa
________________________________
This e-mail message may contain proprietary, confidential or legally privileged information for the sole use of the person or entity to whom this message was originally addressed. Any review, e-transmission dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you have received this e-mail in error kindly delete this e-mail from your records. If it appears that this mail has been forwarded to you without proper authority, please notify us immediately at netadmin(a)patni.com and delete this mail.
2
1
Hi Ben and others,
do you have any plan to start with PHY libs?
I saw to tsec driver - there are some phy description.
I would like to use phy description for one eth driver which I do.
Thanks,
Michal
3
3

[U-Boot-Users] [PATCH 04/10 v3] [ARM] TQMA31: add new board with i.MX31 processor
by Jens Gehrlein 08 Jul '08
by Jens Gehrlein 08 Jul '08
08 Jul '08
Signed-off-by: Jens Gehrlein <sew_s(a)tqs.de>
---
Fixed the following issues (compared to v1):
a) Myself: added NFS mount option "rw" to default environment
b) Magnus: added prefix $(obj) in front of .depend in Makefile.
Thank you for catching that.
c) Jean-Christophe: used $(BOARD) in Makefile,
fixed whitespace, tabs, special character,
patched mach-types.h
d) Heiko: removed defines for default netmask, ipaddr, serverip
MAINTAINERS | 4
MAKEALL | 1
Makefile | 3
board/tqc/tqma31/Makefile | 48 ++++
board/tqc/tqma31/config.mk | 2
board/tqc/tqma31/lowlevel_init.S | 375 +++++++++++++++++++++++++++++++++
board/tqc/tqma31/tqma31.c | 89 ++++++++
board/tqc/tqma31/u-boot.lds | 72 ++++++
include/asm-arm/arch-mx31/mx31-regs.h | 42 ++++
include/asm-arm/mach-types.h | 13 +
include/configs/TQMA31.h | 266 +++++++++++++++++++++++
11 files changed, 915 insertions(+), 0 deletions(-)
create mode 100644 board/tqc/tqma31/Makefile
create mode 100644 board/tqc/tqma31/config.mk
create mode 100644 board/tqc/tqma31/lowlevel_init.S
create mode 100644 board/tqc/tqma31/tqma31.c
create mode 100644 board/tqc/tqma31/u-boot.lds
create mode 100644 include/configs/TQMA31.h
diff --git a/MAINTAINERS b/MAINTAINERS
index a3d70b1..dff1757 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -591,6 +591,10 @@ Michael Schwingen <michael(a)schwingen.org>
actux3 xscale
actux4 xscale
+Jens Gehrlein <sew_s(a)tqs.de>
+
+ TQMA31 i.MX31
+
#########################################################################
# x86 Systems: #
# #
diff --git a/MAKEALL b/MAKEALL
index 32caab7..4e442c5 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -524,6 +524,7 @@ LIST_ARM11=" \
imx31_litekit \
imx31_phycore \
mx31ads \
+ TQMA31 \
"
#########################################################################
diff --git a/Makefile b/Makefile
index 8bfc891..e3ade25 100644
--- a/Makefile
+++ b/Makefile
@@ -2664,6 +2664,9 @@ imx31_phycore_config : unconfig
mx31ads_config : unconfig
@$(MKCONFIG) $(@:_config=) arm arm1136 mx31ads NULL mx31
+TQMA31_config : unconfig
+ @$(MKCONFIG) $(@:_config=) arm arm1136 tqma31 tqc mx31
+
#========================================================================
# i386
#========================================================================
diff --git a/board/tqc/tqma31/Makefile b/board/tqc/tqma31/Makefile
new file mode 100644
index 0000000..a2a9eb3
--- /dev/null
+++ b/board/tqc/tqma31/Makefile
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2008, Guennadi Liakhovetski <lg(a)denx.de>
+# Copyright (C) 2008, Jens Gehrlein <sew_s(a)tqs.de>
+#
+# 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
+#
+
+include $(TOPDIR)/config.mk
+
+LIB = $(obj)lib$(BOARD).a
+
+COBJS := $(BOARD).o
+SOBJS := lowlevel_init.o
+
+SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS := $(addprefix $(obj),$(COBJS))
+SOBJS := $(addprefix $(obj),$(SOBJS))
+
+$(LIB): $(obj).depend $(OBJS) $(SOBJS)
+ $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
+
+clean:
+ rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+ rm -f $(LIB) core *.bak $(obj).depend
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/board/tqc/tqma31/config.mk b/board/tqc/tqma31/config.mk
new file mode 100644
index 0000000..19df69e
--- /dev/null
+++ b/board/tqc/tqma31/config.mk
@@ -0,0 +1,2 @@
+TEXT_BASE = 0x8ff00000
+
diff --git a/board/tqc/tqma31/lowlevel_init.S b/board/tqc/tqma31/lowlevel_init.S
new file mode 100644
index 0000000..7e0a80e
--- /dev/null
+++ b/board/tqc/tqma31/lowlevel_init.S
@@ -0,0 +1,375 @@
+/*
+ * Copyright (C) 2008, Guennadi Liakhovetski <lg(a)denx.de>
+ * Copyright (C) 2008, Jens Gehrlein <sew_s(a)tqs.de>
+ *
+ * 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
+ */
+
+#include <asm/arch/mx31-regs.h>
+#include <config.h>
+
+.macro REG reg, val
+ ldr r2, =\reg
+ ldr r3, =\val
+ str r3, [r2]
+.endm
+
+.macro REG8 reg, val
+ ldr r2, =\reg
+ ldr r3, =\val
+ strb r3, [r2]
+.endm
+
+.macro DELAY loops
+ ldr r2, =\loops
+1:
+ subs r2, r2, #1
+ nop
+ bcs 1b
+.endm
+
+
+/*
+ * AIPS setup - Only setup MPROTx registers.
+ * The PACR default values are good.
+ */
+.macro init_aips
+
+ /* Setup the Peripheral Port Remap register inside the core */
+ ldr r0, =0x40000015 /* start from AIPS 2GB region */
+ mcr p15, 0, r0, c15, c2, 4
+
+ /*
+ * Set all MPROTx to be non-bufferable, trusted for R/W,
+ * not forced to user-mode.
+ */
+ ldr r0, =0x43F00000
+ ldr r1, =0x77777777
+ str r1, [r0, #0x00]
+ str r1, [r0, #0x04]
+ ldr r0, =0x53F00000
+ str r1, [r0, #0x00]
+ str r1, [r0, #0x04]
+
+ /*
+ * Clear the on and off peripheral modules Supervisor Protect bit
+ * for SDMA to access them. Did not change the AIPS control registers
+ * (offset 0x20) access type
+ */
+ ldr r0, =0x43F00000
+ ldr r1, =0x0
+ str r1, [r0, #0x40]
+ str r1, [r0, #0x44]
+ str r1, [r0, #0x48]
+ str r1, [r0, #0x4C]
+ ldr r1, [r0, #0x50]
+ and r1, r1, #0x00FFFFFF
+ str r1, [r0, #0x50]
+
+ ldr r0, =0x53F00000
+ ldr r1, =0x0
+ str r1, [r0, #0x40]
+ str r1, [r0, #0x44]
+ str r1, [r0, #0x48]
+ str r1, [r0, #0x4C]
+ ldr r1, [r0, #0x50]
+ and r1, r1, #0x00FFFFFF
+ str r1, [r0, #0x50]
+.endm /* init_aips */
+
+
+/* RedBoot: MAX (Multi-Layer AHB Crossbar Switch) setup */
+.macro init_max
+ ldr r0, =0x43F04000
+ /* MPR - priority is M4 > M2 > M3 > M5 > M0 > M1 */
+ ldr r1, =0x00302154
+ str r1, [r0, #0x000] /* for S0 */
+ str r1, [r0, #0x100] /* for S1 */
+ str r1, [r0, #0x200] /* for S2 */
+ str r1, [r0, #0x300] /* for S3 */
+ str r1, [r0, #0x400] /* for S4 */
+ /* SGPCR - always park on last master */
+ ldr r1, =0x10
+ str r1, [r0, #0x010] /* for S0 */
+ str r1, [r0, #0x110] /* for S1 */
+ str r1, [r0, #0x210] /* for S2 */
+ str r1, [r0, #0x310] /* for S3 */
+ str r1, [r0, #0x410] /* for S4 */
+ /* MGPCR - restore default values */
+ ldr r1, =0x0
+ str r1, [r0, #0x800] /* for M0 */
+ str r1, [r0, #0x900] /* for M1 */
+ str r1, [r0, #0xA00] /* for M2 */
+ str r1, [r0, #0xB00] /* for M3 */
+ str r1, [r0, #0xC00] /* for M4 */
+ str r1, [r0, #0xD00] /* for M5 */
+.endm /* init_max */
+
+
+/* RedBoot: M3IF setup */
+.macro init_m3if
+ /* Configure M3IF registers */
+ ldr r1, =0xB8003000
+ /*
+ * M3IF Control Register (M3IFCTL)
+ * MRRP[0] = L2CC0 not on priority list (0 << 0) = 0x00000000
+ * MRRP[1] = L2CC1 not on priority list (0 << 0) = 0x00000000
+ * MRRP[2] = MBX not on priority list (0 << 0) = 0x00000000
+ * MRRP[3] = MAX1 not on priority list (0 << 0) = 0x00000000
+ * MRRP[4] = SDMA not on priority list (0 << 0) = 0x00000000
+ * MRRP[5] = MPEG4 not on priority list (0 << 0) = 0x00000000
+ * MRRP[6] = IPU1 on priority list (1 << 6) = 0x00000040
+ * MRRP[7] = IPU2 not on priority list (0 << 0) = 0x00000000
+ * ------------
+ * 0x00000040
+ */
+ ldr r0, =0x00000040
+ str r0, [r1] /* M3IF control reg */
+.endm /* init_m3if */
+
+
+/* RedBoot: To support 133MHz DDR */
+.macro init_drive_strength
+ /*
+ * Disable maximum drive strength SDRAM/DDR lines by clearing DSE1 bits
+ * in SW_PAD_CTL registers
+ */
+
+ /* SDCLK */
+ ldr r1, =0x43FAC200
+ ldr r0, [r1, #0x6C]
+ bic r0, r0, #(1 << 12)
+ str r0, [r1, #0x6C]
+
+ /* CAS */
+ ldr r0, [r1, #0x70]
+ bic r0, r0, #(1 << 22)
+ str r0, [r1, #0x70]
+
+ /* RAS */
+ ldr r0, [r1, #0x74]
+ bic r0, r0, #(1 << 2)
+ str r0, [r1, #0x74]
+
+ /* CS2 (CSD0) */
+ ldr r0, [r1, #0x7C]
+ bic r0, r0, #(1 << 22)
+ str r0, [r1, #0x7C]
+
+ /* DQM3 */
+ ldr r0, [r1, #0x84]
+ bic r0, r0, #(1 << 22)
+ str r0, [r1, #0x84]
+
+ /* DQM2, DQM1, DQM0, SD31-SD0, A25-A0, MA10 (0x288..0x2DC) */
+ ldr r2, =22 /* (0x2E0 - 0x288) / 4 = 22 */
+pad_loop:
+ ldr r0, [r1, #0x88]
+ bic r0, r0, #(1 << 22)
+ bic r0, r0, #(1 << 12)
+ bic r0, r0, #(1 << 2)
+ str r0, [r1, #0x88]
+ add r1, r1, #4
+ subs r2, r2, #0x1
+ bne pad_loop
+.endm /* init_drive_strength */
+
+
+/* initialize PLL */
+.macro init_pll
+ /*
+ * Switch on Display Interface because of the change of the clock
+ * divider. According to the description of PDR0[HSP_PODF] in the
+ * processor reference manual the CCM waits for an ackn. of the IPU.
+ */
+ REG IPU_CONF, IPU_CONF_DI_EN
+
+ /* Clock Control Module: */
+ REG CCM_CCMR, 0x074B0BF5 /* Use CKIH, MCU PLL off */
+ DELAY 0x40000
+ REG CCM_CCMR, 0x074B0BF5 | CCMR_MPE /* MCU PLL on */
+ REG CCM_CCMR, (0x074B0BF5 | CCMR_MPE) & ~CCMR_MDS /* Switch to MCU PLL */
+
+#if defined CONFIG_MX31_CPU_399_MHZ
+ /* Platform clocks */
+ REG CCM_PDR0, PDR0_CSI_PODF(0x1ff) /* camera sensor interface */ \
+ | PDR0_PER_PODF(6-1) /* periph. if derived from USB clock */ \
+ | PDR0_HSP_PODF(3-1) /* IPU 133 MHz */ \
+ | PDR0_NFC_PODF(7-1) /* NAND FC 19 MHz */ \
+ | PDR0_IPG_PODF(2-1) /* peripherals 66.5 MHz */ \
+ | PDR0_MAX_PODF(3-1) /* AHB 133 MHz */ \
+ | PDR0_MCU_PODF(1-1) /* core 399 MHz */
+ /* MCU PLL */
+ REG CCM_MPCTL, PLL_PD(1-1) | PLL_MFD(52-1) | PLL_MFI(7) | PLL_MFN(35)
+#elif defined CONFIG_MX31_CPU_532_MHZ
+ /* Platform clocks */
+ REG CCM_PDR0, PDR0_CSI_PODF(0x1ff) /* camera sensor interface */ \
+ | PDR0_PER_PODF(8-1) /* periph. if derived from USB clock */ \
+ | PDR0_HSP_PODF(4-1) /* IPU 133 MHz */ \
+ | PDR0_NFC_PODF(7-1) /* NAND FC 19 MHz */ \
+ | PDR0_IPG_PODF(2-1) /* peripherals 66.5 MHz */ \
+ | PDR0_MAX_PODF(4-1) /* AHB 133 MHz */ \
+ | PDR0_MCU_PODF(1-1) /* core 532 MHz */
+ /* MCU PLL */
+ REG CCM_MPCTL, PLL_PD(1-1) | PLL_MFD(52-1) | PLL_MFI(10) | PLL_MFN(12)
+#else
+#error Please define CPU core frequency (CONFIG_CPU_399_MHZ or CONFIG_CPU_532_MHZ)!
+#endif /* CONFIG_CPU_xxx_MHZ */
+
+ /* Serial PLL. Default: 1, 4, 12, 1 */
+ REG CCM_SPCTL, PLL_PD(2-1) | PLL_MFD(5-1) | PLL_MFI(12) | PLL_MFN(1)
+.endm /* init_pll */
+
+
+/* setup SDRAM on CSD0 */
+.macro init_sdram
+ /*
+ * Enhanced SDRAM Miscellaneous Register
+ * Latency Hiding Enable
+ * LPDDR delay line measure unit is enabled
+ * LPDDR Delay Line is not reset
+ * Enable Mobile DDR SDRAM operation
+ * Soft Reset is disabled
+ */
+ REG ESDMISC, 0x00000004
+
+ /*
+ * Enhanced SDRAM Configuration Register 0
+ * tXP 4 clock delay before new COMMAND issued to LPDDR
+ * tWTR tLPDDR WRITE to READ Command Delay = 2 clock
+ * tRP SDRAM Row Precharge Delay = 3 clock
+ * tMRD SDRAM Load Mode Register to ACTIVE Command = 3 clock
+ * tWR SDRAM WRITE to PRECHARGE Command = 3 clock
+ * tRAS SDRAM ACTIVE to PRECHARGE Command = 6 clock
+ * tRRD ACTIVE Bank A to ACTIVE Bank B Command = 2 clock
+ * tCAS CAS Latency = 3 clock
+ * tRCD SDRAM Row to Column Delay = 3 clock
+ * tRC SDRAM Row Cycle Delay = 13 clocks
+ */
+ REG ESDCFG0, 0x006ac73c
+
+ /*
+ * Enhanced SDRAM Control Register 0
+ * Enhanced SDRAM Controller Enable = 1
+ * SDRAM Controller Operating Mode = 001 Precharge Command
+ * Supervisor Protect = 0 User mode accesses are allowed to this
+ * chip select region
+ * ROW Row Address Width. = 011 14 Row Addresses
+ * COL Column Address Width = 01 9 Col Addresses
+ * DSIZ SDRAM Memory Data Width = 00 00 16-bit memory width
+ * aligned to D[31:16]
+ * SREFR SDRAM Refresh Rate = 000 Refresh Disabled
+ * (bit field reset value)
+ * PWDT Power Down = 00 Disabled (bit field reset value) Run Mode
+ * FP Full Page = 0 0 Burst Length of the external memory device
+ * is not set to Full Page
+ * BL Burst Length = 0
+ * PRCT Precharge Timer 000000 Disabled (Bit field reset value)
+ */
+ REG ESDCTL0, 0x92200000
+ REG 0x80000f00, 0x12344321
+
+
+ /*
+ * Enhanced SDRAM Control Register 0
+ * Enhanced SDRAM Controller Enable = 1
+ * SDRAM Controller Operating Mode = 010 Auto-Refresh Command
+ * Supervisor Protect = 0 User mode accesses are allowed to this
+ * chip select region
+ * ROW Row Address Width. = 011 14 Row Addresses
+ * COL Column Address Width = 01 9 Col Addresses
+ * DSIZ SDRAM Memory Data Width = 00 00 16-bit memory width
+ * aligned to D[31:16]
+ * SREFR SDRAM Refresh Rate = 000 Refresh Disabled
+ * (bit field reset value)
+ * PWDT Power Down = 00 Disabled (bit field reset value) Run Mode
+ * FP Full Page = 0 0 Burst Length of the external memory device
+ * is not set to Full Page
+ * BL Burst Length = 0
+ * PRCT Precharge Timer 000000 Disabled (Bit field reset value)
+ */
+ REG ESDCTL0, 0xa2200000
+ REG 0x80000000, 0x12344321
+ REG 0x80000000, 0x12344321
+
+ /*
+ * Enhanced SDRAM Control Register 0
+ * Enhanced SDRAM Controller Enable = 1
+ * SDRAM Controller Operating Mode = 001 Precharge Command
+ * Supervisor Protect = 0 User mode accesses are allowed to this
+ * chip select region
+ * ROW Row Address Width. = 011 14 Row Addresses
+ * COL Column Address Width = 01 9 Col Addresses
+ * DSIZ SDRAM Memory Data Width = 00 00 16-bit memory width
+ * aligned to D[31:16]
+ * SREFR SDRAM Refresh Rate = 000 Refresh Disabled
+ * (bit field reset value)
+ * PWDT Power Down = 00 Disabled (bit field reset value) Run Mode
+ * FP Full Page = 0 0 Burst Length of the external memory device
+ * is not set to Full Page.
+ * BL Burst Length = 0
+ * PRCT Precharge Timer 000000 Disabled (Bit field reset value)
+ */
+ REG ESDCTL0, 0xb2200000
+ REG8 0x80000033, 0xda
+ REG8 0x81000000, 0xff
+
+ /*
+ * Enhanced SDRAM Control Register 0
+ * Enhanced SDRAM Controller Enable = 1
+ * SDRAM Controller Operating Mode = 000 Normal Read/Write
+ * Supervisor Protect = 0 User mode accesses are allowed to this
+ * chip select region
+ * ROW Row Address Width. = 011 14 Row Addresses
+ * COL Column Address Width = 10 10 Col Addresses
+ * DSIZ SDRAM Memory Data Width = 10 32-bit memory width
+ * SREFR SDRAM Refresh Rate = 011 Refresh 7,81 microseconds
+ * PWDT Power Down = 00 Disabled (bit field reset value) Run Mode
+ * FP Full Page = 0 0 Burst Length of the external memory device
+ * is not set to Full Page
+ * BL Burst Length = 8
+ * PRCT Precharge Timer 000000 Disabled (Bit field reset value)
+ */
+ REG ESDCTL0, 0x83226080
+ REG 0x80000000, 0xDEADBEEF
+
+ /*
+ * Enhanced SDRAM Miscellaneous Register
+ * Latency Hiding Enable
+ * LPDDR delay line measure unit is enabled
+ * LPDDR Delay Line is reset
+ * Enable Mobile DDR SDRAM operation
+ * Soft Reset is disabled
+ */
+ REG ESDMISC, 0x0000000c
+.endm /* init_sdram */
+
+
+.globl lowlevel_init
+lowlevel_init:
+ init_aips
+
+ init_max
+
+ init_m3if
+
+ init_drive_strength
+
+ init_pll
+
+ init_sdram
+
+ mov pc, lr
diff --git a/board/tqc/tqma31/tqma31.c b/board/tqc/tqma31/tqma31.c
new file mode 100644
index 0000000..e0d0975
--- /dev/null
+++ b/board/tqc/tqma31/tqma31.c
@@ -0,0 +1,89 @@
+/*
+ * Copyright (C) 2008, Jens Gehrlein <sew_s(a)tqs.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
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/arch/mx31.h>
+#include <asm/arch/mx31-regs.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static void setup_chipselects (void)
+{
+ /* NOR Flash on CS0 */
+ __REG (CSCR_U(0)) = CSCR_U_CNC_3 | CSCR_U_WSC_12 | CSCR_U_EDC_4;
+ __REG (CSCR_A(0)) = CSCR_A_RWA_2 | CSCR_A_RWN_2 | CSCR_A_LBN_2_MUM0;
+ __REG (CSCR_L(0)) = CSCR_L_OEA_10 | CSCR_L_EBWA_3 | CSCR_L_EBWN_3 \
+ | CSCR_L_EBC_ONLY_WA | CSCR_L_DSZ_16_MUM0 | CSCR_L_CSEN;
+
+ /* Ethernet controller on CS4 */
+ __REG (CSCR_U(4)) = CSCR_U_CNC_1 | CSCR_U_WSC_22 | CSCR_U_EDC_4;
+ __REG (CSCR_A(4)) = CSCR_A_RWA_2 | CSCR_A_RWN_15;
+ __REG (CSCR_L(4)) = CSCR_L_OEA_2 | CSCR_L_OEN_15 | CSCR_L_CSN_15 \
+ | CSCR_L_DSZ_16_MUM0 | CSCR_L_CSEN;
+}
+
+static void setup_iomux (void)
+{
+ /* Pins for UART1 */
+ mx31_gpio_mux (MUX_RXD1__UART1_RXD_MUX);
+ mx31_gpio_mux (MUX_TXD1__UART1_TXD_MUX);
+ mx31_gpio_mux (MUX_RTS1__UART1_RTS_B);
+ mx31_gpio_mux (MUX_CTS1__UART1_CTS_B);
+}
+
+int dram_init (void)
+{
+ gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
+ gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
+
+ return 0;
+}
+
+int board_init (void)
+{
+ /* WEIM burst clock runs all the time */
+ __REG (WCR) = WCR_BCM_1;
+
+ setup_chipselects ();
+ setup_iomux ();
+
+ /* Machine type ID for ARM linux */
+ gd->bd->bi_arch_number = MACH_TYPE_TQMA31;
+
+ /* Address of boot parameters */
+ gd->bd->bi_boot_params = 0x80000100;
+
+ /*
+ * Tell other U-Boot entities: relocation done. For instance, needed
+ * to enable command line history.
+ */
+ gd->flags |= GD_FLG_RELOC;
+
+ return 0;
+}
+
+int checkboard (void)
+{
+ printf ("Board: TQMA31\n");
+ return 0;
+}
diff --git a/board/tqc/tqma31/u-boot.lds b/board/tqc/tqma31/u-boot.lds
new file mode 100644
index 0000000..6b1c06a
--- /dev/null
+++ b/board/tqc/tqma31/u-boot.lds
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2008, Jens Gehrlein <sew_s(a)tqs.de>
+ *
+ * January 2004 - Changed to support H4 device
+ * Copyright (c) 2004 Texas Instruments
+ *
+ * (C) Copyright 2002
+ * Gary Jennejohn, DENX Software Engineering, <gj(a)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
+ */
+
+OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
+OUTPUT_ARCH(arm)
+ENTRY(_start)
+SECTIONS
+{
+ . = 0x00000000;
+
+ . = ALIGN(4);
+ .text :
+ {
+ /* WARNING - the following is hand-optimized to fit within */
+ /* the sector layout of our flash chips! XXX FIXME XXX */
+
+ cpu/arm1136/start.o (.text)
+ board/tqc/tqma31/libtqma31.a (.text)
+ lib_arm/libarm.a (.text)
+ net/libnet.a (.text)
+ drivers/mtd/libmtd.a (.text)
+
+ . = DEFINED(env_offset) ? env_offset : .;
+ common/environment.o(.text)
+
+ *(.text)
+ }
+
+ . = ALIGN(4);
+ .rodata : { *(.rodata) }
+
+ . = ALIGN(4);
+ .data : { *(.data) }
+
+ . = ALIGN(4);
+ .got : { *(.got) }
+
+ . = .;
+ __u_boot_cmd_start = .;
+ .u_boot_cmd : { *(.u_boot_cmd) }
+ __u_boot_cmd_end = .;
+
+ . = ALIGN(4);
+ __bss_start = .;
+ .bss : { *(.bss) }
+ _end = .;
+}
diff --git a/include/asm-arm/arch-mx31/mx31-regs.h b/include/asm-arm/arch-mx31/mx31-regs.h
index abe61f0..ea15108 100644
--- a/include/asm-arm/arch-mx31/mx31-regs.h
+++ b/include/asm-arm/arch-mx31/mx31-regs.h
@@ -61,11 +61,53 @@
#define PLL_MFI(x) (((x) & 0xf) << 10)
#define PLL_MFN(x) (((x) & 0x3ff) << 0)
+#define ESDCTL_BASE 0xB8001000
+#define ESDCTL0 (ESDCTL_BASE + 0x00)
+#define ESDCFG0 (ESDCTL_BASE + 0x04)
+#define ESDCTL1 (ESDCTL_BASE + 0x08)
+#define ESDCFG1 (ESDCTL_BASE + 0x0C)
+#define ESDMISC (ESDCTL_BASE + 0x10)
+#define ESDCDLY1 (ESDCTL_BASE + 0x20)
+#define ESDCDLY2 (ESDCTL_BASE + 0x24)
+#define ESDCDLY3 (ESDCTL_BASE + 0x28)
+#define ESDCDLY4 (ESDCTL_BASE + 0x2C)
+#define ESDCDLY5 (ESDCTL_BASE + 0x30)
+#define ESDCDLYL (ESDCTL_BASE + 0x34)
+
#define WEIM_BASE 0xb8002000
#define CSCR_U(x) (WEIM_BASE + (x) * 0x10)
#define CSCR_L(x) (WEIM_BASE + 4 + (x) * 0x10)
#define CSCR_A(x) (WEIM_BASE + 8 + (x) * 0x10)
+#define CSCR_U_CNC_1 0x00004000
+#define CSCR_U_CNC_3 0x0000C000
+#define CSCR_U_WSC_9 0x00000900
+#define CSCR_U_WSC_12 0x00000C00
+#define CSCR_U_WSC_22 0x00001600
+#define CSCR_U_EDC_4 0x00000004
+#define CSCR_U_EDC_13 0x0000000D
+
+#define CSCR_L_OEA_2 0x20000000
+#define CSCR_L_OEA_4 0x40000000
+#define CSCR_L_OEA_10 0xA0000000
+#define CSCR_L_OEN_15 0x0F000000
+#define CSCR_L_EBWA_3 0x00300000
+#define CSCR_L_EBWN_3 0x00030000
+#define CSCR_L_CSA_4 0x00004000
+#define CSCR_L_CSN_15 0x000000F0
+#define CSCR_L_EBC_ONLY_WA 0x00000800
+#define CSCR_L_DSZ_16_MUM0 0x00000500
+#define CSCR_L_CSEN 0x00000001
+
+#define CSCR_A_RWA_2 0x00200000
+#define CSCR_A_RWN_2 0x00020000
+#define CSCR_A_RWN_15 0x000F0000
+#define CSCR_A_LBN_2_MUM0 0x00000800
+
+#define WCR (WEIM_BASE + 0x60)
+#define WCR_BCM_1 0x00000004
+#define WCR_BCM_0 0x00000000
+
#define IOMUXC_BASE 0x43FAC000
#define IOMUXC_GPR (IOMUXC_BASE + 0x8)
#define IOMUXC_SW_MUX_CTL(x) (IOMUXC_BASE + 0xc + (x) * 4)
diff --git a/include/asm-arm/mach-types.h b/include/asm-arm/mach-types.h
index aaf2ea2..e44027a 100644
--- a/include/asm-arm/mach-types.h
+++ b/include/asm-arm/mach-types.h
@@ -1595,6 +1595,7 @@ extern unsigned int __machine_arch_type;
#define MACH_TYPE_P300 1602
#define MACH_TYPE_XDACOMET 1603
#define MACH_TYPE_DEXFLEX2 1604
+#define MACH_TYPE_TQMA31 1810
#ifdef CONFIG_ARCH_EBSA110
# ifdef machine_arch_type
@@ -20592,6 +20593,18 @@ extern unsigned int __machine_arch_type;
# define machine_is_dexflex2() (0)
#endif
+#ifdef CONFIG_MACH_TQMA31
+# ifdef machine_arch_type
+# undef machine_arch_type
+# define machine_arch_type __machine_arch_type
+# else
+# define machine_arch_type MACH_TYPE_TQMA31
+# endif
+# define machine_is_tqma31() (machine_arch_type == MACH_TYPE_TQMA31)
+#else
+# define machine_is_tqma31() (0)
+#endif
+
/*
* These have not yet been registered
*/
diff --git a/include/configs/TQMA31.h b/include/configs/TQMA31.h
new file mode 100644
index 0000000..de2e355
--- /dev/null
+++ b/include/configs/TQMA31.h
@@ -0,0 +1,266 @@
+/*
+ * Copyright (C) 2008, Jens Gehrlein <sew_s(a)tqs.de>
+ *
+ * Configuration settings for the TQMA31 board.
+ *
+ * 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
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+/*******************************************************************************
+ * CPU
+ ******************************************************************************/
+
+#include <asm/arch/mx31-regs.h>
+
+/* This is an ARM1136 core */
+#define CONFIG_ARM1136 1
+
+/* in an i.MX31 processor */
+#define CONFIG_MX31 1
+
+#define CONFIG_DISPLAY_CPUINFO
+#define CONFIG_DISPLAY_BOARDINFO
+
+/* Enable passing of ATAGs */
+#define CONFIG_CMDLINE_TAG 1
+#define CONFIG_SETUP_MEMORY_TAGS 1
+#define CONFIG_INITRD_TAG 1
+
+
+/*******************************************************************************
+ * Clocks
+ ******************************************************************************/
+
+ /* Frequency on CKIH in Hz. This is the MCU PLL input clock on TQMA31. */
+#define CONFIG_MX31_HCLK_FREQ 26000000
+
+/* Desired CPU core frequency (see PLL settings in lowlevel_init.S) */
+#define CONFIG_MX31_CPU_399_MHZ
+#undef CONFIG_MX31_CPU_532_MHZ
+
+/* Timer tick */
+#define CFG_HZ 32768
+
+/*
+ * Alternative clock input for MCU PLL.
+ * Unused on TQMA31, but must be defined to avoid compiler errors.
+ */
+#define CONFIG_MX31_CLK32 32000
+
+
+/*******************************************************************************
+ * RAM
+ ******************************************************************************/
+
+#define CONFIG_NR_DRAM_BANKS 1
+
+/*
+ * PHYS_SDRAM_1 and PHYS_SDRAM_1_SIZE are passed to the Linux kernel.
+ * The size can be overridden by the kernel boot parameter "mem=".
+ */
+#define PHYS_SDRAM_1 CSD0_BASE
+#define PHYS_SDRAM_1_SIZE (256 * 1024 * 1024)
+
+/* Default values for command mtest */
+#define CFG_MEMTEST_START PHYS_SDRAM_1
+#define CFG_MEMTEST_END (PHYS_SDRAM_1_SIZE - 0x100000)
+
+
+/*******************************************************************************
+ * NOR-Flash
+ ******************************************************************************/
+
+#define CFG_FLASH_BASE CS0_BASE
+
+/* Max number of memory banks */
+#define CFG_MAX_FLASH_BANKS 4
+
+/*
+ * Bank start addresses.
+ * 4 x 32 MiB is the maximum for user and U-Boot code. Please adapt the list
+ * as well as CFG_MAX_FLASH_BANKS to your TQM. Also consider dual die chips
+ * or single die chips, e.g. one dual die chip represents two banks.
+ */
+#define CFG_FLASH_BANKS_LIST {CFG_FLASH_BASE, \
+ CFG_FLASH_BASE + 32 * 1024 * 1024, \
+ CFG_FLASH_BASE + 64 * 1024 * 1024, \
+ CFG_FLASH_BASE + 96 * 1024 * 1024}
+
+/* Max number of sectors on one chip */
+#define CFG_MAX_FLASH_SECT 259
+
+/* Monitor at beginning of flash */
+#define CFG_MONITOR_BASE CFG_FLASH_BASE
+
+/* Reserved flash space for U-Boot image in bytes */
+#define CFG_MONITOR_LEN (128 * 1024)
+
+/* Flash memory is CFI compliant */
+#define CFG_FLASH_CFI 1
+
+/* Use drivers/cfi_flash.c */
+#define CFG_FLASH_CFI_DRIVER 1
+
+/* Use buffered writes (~10x faster) */
+#define CFG_FLASH_USE_BUFFER_WRITE 1
+
+/* Use hardware sector protection */
+#define CFG_FLASH_PROTECTION 1
+
+
+/*******************************************************************************
+ * Serial
+ ******************************************************************************/
+
+/* Configure processor internal UART */
+#define CONFIG_MX31_UART 1
+
+/* Configure UART1 */
+#define CFG_MX31_UART1 1
+
+/* Use UART1 for console */
+#define CONFIG_CONS_INDEX 1
+
+/* Default baudrate */
+#define CONFIG_BAUDRATE 115200
+
+/* Possible baudrates */
+#define CFG_BAUDRATE_TABLE {9600, 19200, 38400, 57600, 115200}
+
+
+/*******************************************************************************
+ * Ethernet
+ ******************************************************************************/
+
+#define CONFIG_DRIVER_SMC911X 1
+#define CONFIG_DRIVER_SMC911X_32_BIT 1
+#define CONFIG_DRIVER_SMC911X_BASE CS4_BASE
+
+
+/*******************************************************************************
+ * Commands
+ ******************************************************************************/
+
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_DHCP
+
+
+/*******************************************************************************
+ * Environment
+ ******************************************************************************/
+
+#define CONFIG_BOOTDELAY 4
+
+/*
+ * Default value for env. variable "loadaddr".
+ * Don't use arithmetic here, because it will be converted
+ * into a string (see common/environment.c)
+ */
+#define CONFIG_LOADADDR 0x80800000
+
+/* Default load address */
+#define CFG_LOAD_ADDR CONFIG_LOADADDR
+
+/* Allow to modify environment variables "serial#" and "ethaddr" */
+#define CONFIG_ENV_OVERWRITE
+
+#define CFG_ENV_IS_IN_FLASH 1
+#define CFG_ENV_OFFSET 0x20000
+#define CFG_ENV_ADDR (CFG_FLASH_BASE + CFG_ENV_OFFSET)
+#define CFG_ENV_SECT_SIZE 0x20000
+#define CFG_ENV_SIZE CFG_ENV_SECT_SIZE
+
+/* Address and size of redundant environment sector */
+#define CFG_ENV_OFFSET_REDUND (CFG_ENV_OFFSET + CFG_ENV_SECT_SIZE)
+#define CFG_ENV_SIZE_REDUND CFG_ENV_SECT_SIZE
+
+/*
+ * Kernel parameter "jtag=on" is Freescale-specific extension of the
+ * mx31ads BSP. Use it to enable serial console output in Linux.
+ */
+#define CONFIG_EXTRA_ENV_SETTINGS \
+ "netdev=eth0\0" \
+ "hostname=tqma31\0" \
+ "uboot_addr=0xa0000000\0" \
+ "uboot=tqma31/u-boot.bin\0" \
+ "kernel=tqma31/uImage\0" \
+ "nfsroot=/opt/eldk/arm\0" \
+ "bootargs_base=setenv bootargs " \
+ "jtag=on " \
+ "console=ttymxc0,115200\0" \
+ "bootargs_nfs=setenv bootargs ${bootargs} " \
+ "root=/dev/nfs rw " \
+ "ip=${ipaddr}:${serverip}:${gatewayip}:" \
+ "${netmask}:${hostname}:${netdev}:off " \
+ "panic=1 " \
+ "nfsroot=${serverip}:${nfsroot}\0" \
+ "bootcmd=run bootcmd_net\0" \
+ "bootcmd_net=run bootargs_base bootargs_nfs; " \
+ "tftpboot ${loadaddr} ${kernel}; bootm\0" \
+ "prg_uboot=tftpboot ${loadaddr} ${uboot}; " \
+ "protect off ${uboot_addr} 0xa001ffff; " \
+ "erase ${uboot_addr} 0xa001ffff; " \
+ "cp.b ${loadaddr} ${uboot_addr} ${filesize}; " \
+ "setenv filesize; saveenv\0"
+
+
+/*******************************************************************************
+ * JFFS2 partitions
+ ******************************************************************************/
+
+#undef CONFIG_JFFS2_CMDLINE
+#define CONFIG_JFFS2_DEV "nor0"
+
+
+/*******************************************************************************
+ * Miscellaneous
+ ******************************************************************************/
+
+/* Total available space for malloc in bytes */
+#define CFG_MALLOC_LEN (CFG_ENV_SIZE + 128 * 1024)
+
+/* Regular stack size in bytes */
+#define CONFIG_STACKSIZE (128 * 1024)
+
+/* Size in bytes reserved for initial global data */
+#define CFG_GBL_DATA_SIZE 128
+
+/* Console I/O buffer size in bytes */
+#define CFG_CBSIZE 256
+
+/* Print buffer size in bytes */
+#define CFG_PBSIZE (CFG_CBSIZE + sizeof(CFG_PROMPT) + 16)
+
+/* Max number of command arguments */
+#define CFG_MAXARGS 16
+
+/* Boot argument buffer size in bytes */
+#define CFG_BARGSIZE CFG_CBSIZE
+
+#define CFG_LONGHELP
+#define CFG_PROMPT "=> "
+
+/* Add command line history and command line edit possibility */
+#define CONFIG_CMDLINE_EDITING
+
+#define CONFIG_ARP_TIMEOUT 200UL
+
+#endif /* __CONFIG_H */
2
1