change mvBL-M7 default env and move to vendor subdir
authorAndre Schwarz <andre.schwarz@matrix-vision.de>
Wed, 20 Aug 2008 09:11:52 +0000 (11:11 +0200)
committerKim Phillips <kim.phillips@freescale.com>
Mon, 25 Aug 2008 22:11:20 +0000 (17:11 -0500)
fix mvBL-M7 config and move to matrix_vision subdir

Signed-off-by: Andre Schwarz <andre.schwarz@matrix-vision.de>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
18 files changed:
Makefile
board/matrix_vision/mvblm7/Makefile [new file with mode: 0644]
board/matrix_vision/mvblm7/config.mk [new file with mode: 0644]
board/matrix_vision/mvblm7/fpga.c [new file with mode: 0644]
board/matrix_vision/mvblm7/fpga.h [new file with mode: 0644]
board/matrix_vision/mvblm7/mvblm7.c [new file with mode: 0644]
board/matrix_vision/mvblm7/mvblm7.h [new file with mode: 0644]
board/matrix_vision/mvblm7/mvblm7_autoscript [new file with mode: 0644]
board/matrix_vision/mvblm7/pci.c [new file with mode: 0644]
board/mvblm7/Makefile [deleted file]
board/mvblm7/config.mk [deleted file]
board/mvblm7/fpga.c [deleted file]
board/mvblm7/fpga.h [deleted file]
board/mvblm7/mvblm7.c [deleted file]
board/mvblm7/mvblm7.h [deleted file]
board/mvblm7/mvblm7_autoscript [deleted file]
board/mvblm7/pci.c [deleted file]
include/configs/MVBLM7.h

index c30ef57583e576351bd9a0e18365ab6559875fa8..66d91046a358d42aea0968fc0ad5d14c8763ca23 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2180,7 +2180,7 @@ MPC837XERDB_config:       unconfig
        @$(MKCONFIG) -a MPC837XERDB ppc mpc83xx mpc837xerdb freescale
 
 MVBLM7_config: unconfig
-       @$(MKCONFIG) $(@:_config=) ppc mpc83xx mvblm7
+       @$(MKCONFIG) $(@:_config=) ppc mpc83xx mvblm7 matrix_vision
 
 sbc8349_config:                unconfig
        @$(MKCONFIG) $(@:_config=) ppc mpc83xx sbc8349
diff --git a/board/matrix_vision/mvblm7/Makefile b/board/matrix_vision/mvblm7/Makefile
new file mode 100644 (file)
index 0000000..cfbecfb
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# Copyright (C) Freescale Semiconductor, Inc. 2006. All rights reserved.
+#
+# 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 pci.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 $(obj).depend
+
+#########################################################################
+
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/board/matrix_vision/mvblm7/config.mk b/board/matrix_vision/mvblm7/config.mk
new file mode 100644 (file)
index 0000000..1d85f4f
--- /dev/null
@@ -0,0 +1,25 @@
+#
+# Copyright (C) Freescale Semiconductor, Inc. 2006. All rights reserved.
+#
+# 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 $(OBJTREE)/board/$(BOARDDIR)/config.tmp
+
+TEXT_BASE  = 0xFFF00000
diff --git a/board/matrix_vision/mvblm7/fpga.c b/board/matrix_vision/mvblm7/fpga.c
new file mode 100644 (file)
index 0000000..a60af01
--- /dev/null
@@ -0,0 +1,188 @@
+/*
+ * (C) Copyright 2002
+ * Rich Ireland, Enterasys Networks, rireland@enterasys.com.
+ * Keith Outwater, keith_outwater@mvis.com.
+ *
+ * (C) Copyright 2008
+ * Andre Schwarz, Matrix Vision GmbH, andre.schwarz@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 "mvblm7.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_EP2C20_SIZE,
+       (void *) &altera_fns,
+       NULL,
+       0
+};
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int mvblm7_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)
+{
+       volatile immap_t *im = (volatile immap_t *)CFG_IMMR;
+       volatile gpio83xx_t *gpio = (volatile gpio83xx_t *)&im->gpio[0];
+       u32 dvo = gpio->dat;
+
+       fpga_debug("SET config : %s\n", assert ? "low" : "high");
+       if (assert)
+               dvo |= FPGA_CONFIG;
+       else
+               dvo &= ~FPGA_CONFIG;
+
+       if (flush)
+               gpio->dat = dvo;
+
+       return assert;
+}
+
+int fpga_done_fn(int cookie)
+{
+       volatile immap_t *im = (volatile immap_t *)CFG_IMMR;
+       volatile gpio83xx_t *gpio = (volatile gpio83xx_t *)&im->gpio[0];
+       int result = 0;
+
+       udelay(10);
+       fpga_debug("CONF_DONE check ... ");
+       if (gpio->dat & FPGA_CONF_DONE)  {
+               fpga_debug("high\n");
+               result = 1;
+       } else
+               fpga_debug("low\n");
+
+       return result;
+}
+
+int fpga_status_fn(int cookie)
+{
+       volatile immap_t *im = (volatile immap_t *)CFG_IMMR;
+       volatile gpio83xx_t *gpio = (volatile gpio83xx_t *)&im->gpio[0];
+       int result = 0;
+
+       fpga_debug("STATUS check ... ");
+       if (gpio->dat & 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)
+{
+       volatile immap_t *im = (volatile immap_t *)CFG_IMMR;
+       volatile gpio83xx_t *gpio = (volatile gpio83xx_t *)&im->gpio[0];
+       u32 dvo = gpio->dat;
+
+       fpga_debug("CLOCK %s\n", assert_clk ? "high" : "low");
+       if (assert_clk)
+               dvo |= FPGA_CCLK;
+       else
+               dvo &= ~FPGA_CCLK;
+
+       if (flush)
+               gpio->dat = dvo;
+
+       return assert_clk;
+}
+
+static inline int _write_fpga(u8 val, int dump)
+{
+       volatile immap_t *im = (volatile immap_t *)CFG_IMMR;
+       volatile gpio83xx_t *gpio = (volatile gpio83xx_t *)&im->gpio[0];
+       int i;
+       u32 dvo = gpio->dat;
+
+       if (dump)
+               fpga_debug("  %02x -> ", val);
+       for (i = 0; i < 8; i++) {
+               dvo &= ~FPGA_CCLK;
+               gpio->dat = dvo;
+               dvo &= ~FPGA_DIN;
+               if (dump)
+                       fpga_debug("%d ", val&1);
+               if (val & 1)
+                       dvo |= FPGA_DIN;
+               gpio->dat = dvo;
+               dvo |= FPGA_CCLK;
+               gpio->dat = dvo;
+               val >>= 1;
+       }
+       if (dump)
+               fpga_debug("\n");
+
+       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], 0);
+       fpga_debug("\n");
+
+       return FPGA_SUCCESS;
+}
diff --git a/board/matrix_vision/mvblm7/fpga.h b/board/matrix_vision/mvblm7/fpga.h
new file mode 100644 (file)
index 0000000..19277eb
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * (C) Copyright 2002
+ * Rich Ireland, Enterasys Networks, rireland@enterasys.com.
+ * Keith Outwater, keith_outwater@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 mvblm7_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/mvblm7/mvblm7.c b/board/matrix_vision/mvblm7/mvblm7.c
new file mode 100644 (file)
index 0000000..b07f913
--- /dev/null
@@ -0,0 +1,157 @@
+/*
+ * Copyright (C) Freescale Semiconductor, Inc. 2006. All rights reserved.
+ *
+ * (C) Copyright 2008
+ * Andre Schwarz, Matrix Vision GmbH, andre.schwarz@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 <ioports.h>
+#include <mpc83xx.h>
+#include <asm/mpc8349_pci.h>
+#include <pci.h>
+#include <spi.h>
+#include <asm/mmu.h>
+#if defined(CONFIG_OF_LIBFDT)
+#include <libfdt.h>
+#endif
+
+#include "mvblm7.h"
+
+int fixed_sdram(void)
+{
+       volatile immap_t *im = (immap_t *)CFG_IMMR;
+       u32 msize = 0;
+       u32 ddr_size;
+       u32 ddr_size_log2;
+
+       msize = CFG_DDR_SIZE;
+       for (ddr_size = msize << 20, ddr_size_log2 = 0;
+            (ddr_size > 1);
+            ddr_size = ddr_size >> 1, ddr_size_log2++) {
+               if (ddr_size & 1)
+                       return -1;
+       }
+       im->sysconf.ddrlaw[0].bar = ((CFG_DDR_SDRAM_BASE>>12) & 0xfffff);
+       im->sysconf.ddrlaw[0].ar = LAWAR_EN | ((ddr_size_log2 - 1) &
+               LAWAR_SIZE);
+
+       im->ddr.csbnds[0].csbnds = CFG_DDR_CS0_BNDS;
+       im->ddr.cs_config[0] = CFG_DDR_CS0_CONFIG;
+       im->ddr.timing_cfg_0 = CFG_DDR_TIMING_0;
+       im->ddr.timing_cfg_1 = CFG_DDR_TIMING_1;
+       im->ddr.timing_cfg_2 = CFG_DDR_TIMING_2;
+       im->ddr.timing_cfg_3 = CFG_DDR_TIMING_3;
+       im->ddr.sdram_cfg = CFG_DDR_SDRAM_CFG;
+       im->ddr.sdram_cfg2 = CFG_DDR_SDRAM_CFG2;
+       im->ddr.sdram_mode = CFG_DDR_MODE;
+       im->ddr.sdram_interval = CFG_DDR_INTERVAL;
+       im->ddr.sdram_clk_cntl = CFG_DDR_CLK_CNTL;
+
+       udelay(300);
+
+       im->ddr.sdram_cfg |= SDRAM_CFG_MEM_EN;
+
+       return CFG_DDR_SIZE;
+}
+
+phys_size_t initdram(int board_type)
+{
+       volatile immap_t *im = (immap_t *) CFG_IMMR;
+       u32 msize = 0;
+
+       if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32) im)
+               return -1;
+
+       im->sysconf.ddrlaw[0].bar = CFG_DDR_BASE & LAWBAR_BAR;
+       msize = fixed_sdram();
+
+       /* return total bus RAM size(bytes) */
+       return msize * 1024 * 1024;
+}
+
+int checkboard(void)
+{
+       puts("Board: Matrix Vision mvBlueLYNX-M7\n");
+
+       return 0;
+}
+
+u8 *dhcp_vendorex_prep(u8 *e)
+{
+       char *ptr;
+
+       /* DHCP vendor-class-identifier = 60 */
+       ptr = getenv("dhcp_vendor-class-identifier");
+       if (ptr) {
+               *e++ = 60;
+               *e++ = strlen(ptr);
+               while (*ptr)
+                       *e++ = *ptr++;
+       }
+       /* DHCP_CLIENT_IDENTIFIER = 61 */
+       ptr = getenv("dhcp_client_id");
+       if (ptr) {
+               *e++ = 61;
+               *e++ = strlen(ptr);
+               while (*ptr)
+                       *e++ = *ptr++;
+       }
+
+       return e;
+}
+
+u8 *dhcp_vendorex_proc(u8 *popt)
+{
+       return NULL;
+}
+
+#ifdef CONFIG_HARD_SPI
+int spi_cs_is_valid(unsigned int bus, unsigned int cs)
+{
+       return bus == 0 && cs == 0;
+}
+
+void spi_cs_activate(struct spi_slave *slave)
+{
+       volatile gpio83xx_t *iopd = &((immap_t *)CFG_IMMR)->gpio[0];
+
+       iopd->dat &= ~MVBLM7_MMC_CS;
+}
+
+void spi_cs_deactivate(struct spi_slave *slave)
+{
+       volatile gpio83xx_t *iopd = &((immap_t *)CFG_IMMR)->gpio[0];
+
+       iopd->dat |= ~MVBLM7_MMC_CS;
+}
+#endif
+
+#if defined(CONFIG_OF_BOARD_SETUP)
+void ft_board_setup(void *blob, bd_t *bd)
+{
+       ft_cpu_setup(blob, bd);
+#ifdef CONFIG_PCI
+       ft_pci_setup(blob, bd);
+#endif
+}
+
+#endif
diff --git a/board/matrix_vision/mvblm7/mvblm7.h b/board/matrix_vision/mvblm7/mvblm7.h
new file mode 100644 (file)
index 0000000..03e9f41
--- /dev/null
@@ -0,0 +1,21 @@
+#ifndef __MVBC_H__
+#define __MVBC_H__
+
+#define MV_GPIO
+
+#define FPGA_CONFIG     0x80000000
+#define FPGA_CCLK       0x40000000
+#define FPGA_DIN        0x20000000
+#define FPGA_STATUS     0x10000000
+#define FPGA_CONF_DONE  0x08000000
+#define MMC_CS         0x04000000
+
+#define WD_WDI          0x00400000
+#define WD_TS           0x00200000
+#define MAN_RST         0x00100000
+
+#define MV_GPIO_DAT    (WD_TS)
+#define MV_GPIO_OUT    (FPGA_CONFIG|FPGA_DIN|FPGA_CCLK|WD_TS|WD_WDI|MMC_CS)
+#define MV_GPIO_ODE    (FPGA_CONFIG|MAN_RST)
+
+#endif
diff --git a/board/matrix_vision/mvblm7/mvblm7_autoscript b/board/matrix_vision/mvblm7/mvblm7_autoscript
new file mode 100644 (file)
index 0000000..6f9357f
--- /dev/null
@@ -0,0 +1,43 @@
+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 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=ttyS\${console_nr},\${baudrate}N8
+else
+setenv addcons setenv bootargs \${bootargs} console=tty0
+fi
+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 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/board/matrix_vision/mvblm7/pci.c b/board/matrix_vision/mvblm7/pci.c
new file mode 100644 (file)
index 0000000..ef34a6b
--- /dev/null
@@ -0,0 +1,133 @@
+/*
+ * Copyright (C) Freescale Semiconductor, Inc. 2006. All rights reserved.
+ *
+ * (C) Copyright 2008
+ * Andre Schwarz, Matrix Vision GmbH, andre.schwarz@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>
+#if defined(CONFIG_OF_LIBFDT)
+#include <libfdt.h>
+#endif
+#include <pci.h>
+#include <mpc83xx.h>
+#include <fpga.h>
+#include "mvblm7.h"
+#include "fpga.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int mvblm7_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);
+}
+
+static struct pci_region pci_regions[] = {
+       {
+               bus_start: CFG_PCI1_MEM_BASE,
+               phys_start: CFG_PCI1_MEM_PHYS,
+               size: CFG_PCI1_MEM_SIZE,
+               flags: PCI_REGION_MEM | PCI_REGION_PREFETCH
+       },
+       {
+               bus_start: CFG_PCI1_MMIO_BASE,
+               phys_start: CFG_PCI1_MMIO_PHYS,
+               size: CFG_PCI1_MMIO_SIZE,
+               flags: PCI_REGION_MEM
+       },
+       {
+               bus_start: CFG_PCI1_IO_BASE,
+               phys_start: CFG_PCI1_IO_PHYS,
+               size: CFG_PCI1_IO_SIZE,
+               flags: PCI_REGION_IO
+       }
+};
+
+void pci_init_board(void)
+{
+       char *s;
+       int i;
+       int warmboot;
+       int load_fpga;
+       volatile immap_t *immr;
+       volatile pcictrl83xx_t *pci_ctrl;
+       volatile gpio83xx_t *gpio;
+       volatile clk83xx_t *clk;
+       volatile law83xx_t *pci_law;
+       struct pci_region *reg[] = { pci_regions };
+
+       load_fpga = 1;
+       immr = (immap_t *) CFG_IMMR;
+       clk = (clk83xx_t *) &immr->clk;
+       pci_ctrl = immr->pci_ctrl;
+       pci_law = immr->sysconf.pcilaw;
+       gpio  = (volatile gpio83xx_t *)&immr->gpio[0];
+
+       s = getenv("skip_fpga");
+       if (s) {
+               printf("found 'skip_fpga' -> FPGA _not_ loaded !\n");
+               load_fpga = 0;
+       }
+
+       gpio->dat = MV_GPIO_DAT;
+       gpio->odr = MV_GPIO_ODE;
+       if (load_fpga)
+               gpio->dir = MV_GPIO_OUT;
+       else
+               gpio->dir = MV_GPIO_OUT & ~(FPGA_DIN|FPGA_CCLK);
+
+       printf("SICRH / SICRL : 0x%08x / 0x%08x\n", immr->sysconf.sicrh,
+               immr->sysconf.sicrl);
+
+       mvblm7_init_fpga();
+       if (load_fpga)
+               mvblm7_load_fpga();
+
+       /* Enable PCI_CLK_OUTPUTs 0 and 1 with 1:1 clocking */
+       clk->occr = 0xc0000000;
+
+       pci_ctrl[0].gcr = 0;
+       udelay(2000);
+       pci_ctrl[0].gcr = 1;
+
+       for (i = 0; i < 1000; ++i)
+               udelay(1000);
+
+       pci_law[0].bar = CFG_PCI1_MEM_PHYS & LAWBAR_BAR;
+       pci_law[0].ar = LBLAWAR_EN | LBLAWAR_1GB;
+
+       pci_law[1].bar = CFG_PCI1_IO_PHYS & LAWBAR_BAR;
+       pci_law[1].ar = LBLAWAR_EN | LBLAWAR_1MB;
+
+       warmboot = gd->bd->bi_bootflags & BOOTFLAG_WARM;
+
+       mpc83xx_pci_init(1, reg, warmboot);
+}
diff --git a/board/mvblm7/Makefile b/board/mvblm7/Makefile
deleted file mode 100644 (file)
index cfbecfb..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# Copyright (C) Freescale Semiconductor, Inc. 2006. All rights reserved.
-#
-# 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 pci.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 $(obj).depend
-
-#########################################################################
-
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
diff --git a/board/mvblm7/config.mk b/board/mvblm7/config.mk
deleted file mode 100644 (file)
index 1d85f4f..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# Copyright (C) Freescale Semiconductor, Inc. 2006. All rights reserved.
-#
-# 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 $(OBJTREE)/board/$(BOARDDIR)/config.tmp
-
-TEXT_BASE  = 0xFFF00000
diff --git a/board/mvblm7/fpga.c b/board/mvblm7/fpga.c
deleted file mode 100644 (file)
index a60af01..0000000
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * (C) Copyright 2002
- * Rich Ireland, Enterasys Networks, rireland@enterasys.com.
- * Keith Outwater, keith_outwater@mvis.com.
- *
- * (C) Copyright 2008
- * Andre Schwarz, Matrix Vision GmbH, andre.schwarz@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 "mvblm7.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_EP2C20_SIZE,
-       (void *) &altera_fns,
-       NULL,
-       0
-};
-
-DECLARE_GLOBAL_DATA_PTR;
-
-int mvblm7_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)
-{
-       volatile immap_t *im = (volatile immap_t *)CFG_IMMR;
-       volatile gpio83xx_t *gpio = (volatile gpio83xx_t *)&im->gpio[0];
-       u32 dvo = gpio->dat;
-
-       fpga_debug("SET config : %s\n", assert ? "low" : "high");
-       if (assert)
-               dvo |= FPGA_CONFIG;
-       else
-               dvo &= ~FPGA_CONFIG;
-
-       if (flush)
-               gpio->dat = dvo;
-
-       return assert;
-}
-
-int fpga_done_fn(int cookie)
-{
-       volatile immap_t *im = (volatile immap_t *)CFG_IMMR;
-       volatile gpio83xx_t *gpio = (volatile gpio83xx_t *)&im->gpio[0];
-       int result = 0;
-
-       udelay(10);
-       fpga_debug("CONF_DONE check ... ");
-       if (gpio->dat & FPGA_CONF_DONE)  {
-               fpga_debug("high\n");
-               result = 1;
-       } else
-               fpga_debug("low\n");
-
-       return result;
-}
-
-int fpga_status_fn(int cookie)
-{
-       volatile immap_t *im = (volatile immap_t *)CFG_IMMR;
-       volatile gpio83xx_t *gpio = (volatile gpio83xx_t *)&im->gpio[0];
-       int result = 0;
-
-       fpga_debug("STATUS check ... ");
-       if (gpio->dat & 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)
-{
-       volatile immap_t *im = (volatile immap_t *)CFG_IMMR;
-       volatile gpio83xx_t *gpio = (volatile gpio83xx_t *)&im->gpio[0];
-       u32 dvo = gpio->dat;
-
-       fpga_debug("CLOCK %s\n", assert_clk ? "high" : "low");
-       if (assert_clk)
-               dvo |= FPGA_CCLK;
-       else
-               dvo &= ~FPGA_CCLK;
-
-       if (flush)
-               gpio->dat = dvo;
-
-       return assert_clk;
-}
-
-static inline int _write_fpga(u8 val, int dump)
-{
-       volatile immap_t *im = (volatile immap_t *)CFG_IMMR;
-       volatile gpio83xx_t *gpio = (volatile gpio83xx_t *)&im->gpio[0];
-       int i;
-       u32 dvo = gpio->dat;
-
-       if (dump)
-               fpga_debug("  %02x -> ", val);
-       for (i = 0; i < 8; i++) {
-               dvo &= ~FPGA_CCLK;
-               gpio->dat = dvo;
-               dvo &= ~FPGA_DIN;
-               if (dump)
-                       fpga_debug("%d ", val&1);
-               if (val & 1)
-                       dvo |= FPGA_DIN;
-               gpio->dat = dvo;
-               dvo |= FPGA_CCLK;
-               gpio->dat = dvo;
-               val >>= 1;
-       }
-       if (dump)
-               fpga_debug("\n");
-
-       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], 0);
-       fpga_debug("\n");
-
-       return FPGA_SUCCESS;
-}
diff --git a/board/mvblm7/fpga.h b/board/mvblm7/fpga.h
deleted file mode 100644 (file)
index 19277eb..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * (C) Copyright 2002
- * Rich Ireland, Enterasys Networks, rireland@enterasys.com.
- * Keith Outwater, keith_outwater@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 mvblm7_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/mvblm7/mvblm7.c b/board/mvblm7/mvblm7.c
deleted file mode 100644 (file)
index b07f913..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * Copyright (C) Freescale Semiconductor, Inc. 2006. All rights reserved.
- *
- * (C) Copyright 2008
- * Andre Schwarz, Matrix Vision GmbH, andre.schwarz@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 <ioports.h>
-#include <mpc83xx.h>
-#include <asm/mpc8349_pci.h>
-#include <pci.h>
-#include <spi.h>
-#include <asm/mmu.h>
-#if defined(CONFIG_OF_LIBFDT)
-#include <libfdt.h>
-#endif
-
-#include "mvblm7.h"
-
-int fixed_sdram(void)
-{
-       volatile immap_t *im = (immap_t *)CFG_IMMR;
-       u32 msize = 0;
-       u32 ddr_size;
-       u32 ddr_size_log2;
-
-       msize = CFG_DDR_SIZE;
-       for (ddr_size = msize << 20, ddr_size_log2 = 0;
-            (ddr_size > 1);
-            ddr_size = ddr_size >> 1, ddr_size_log2++) {
-               if (ddr_size & 1)
-                       return -1;
-       }
-       im->sysconf.ddrlaw[0].bar = ((CFG_DDR_SDRAM_BASE>>12) & 0xfffff);
-       im->sysconf.ddrlaw[0].ar = LAWAR_EN | ((ddr_size_log2 - 1) &
-               LAWAR_SIZE);
-
-       im->ddr.csbnds[0].csbnds = CFG_DDR_CS0_BNDS;
-       im->ddr.cs_config[0] = CFG_DDR_CS0_CONFIG;
-       im->ddr.timing_cfg_0 = CFG_DDR_TIMING_0;
-       im->ddr.timing_cfg_1 = CFG_DDR_TIMING_1;
-       im->ddr.timing_cfg_2 = CFG_DDR_TIMING_2;
-       im->ddr.timing_cfg_3 = CFG_DDR_TIMING_3;
-       im->ddr.sdram_cfg = CFG_DDR_SDRAM_CFG;
-       im->ddr.sdram_cfg2 = CFG_DDR_SDRAM_CFG2;
-       im->ddr.sdram_mode = CFG_DDR_MODE;
-       im->ddr.sdram_interval = CFG_DDR_INTERVAL;
-       im->ddr.sdram_clk_cntl = CFG_DDR_CLK_CNTL;
-
-       udelay(300);
-
-       im->ddr.sdram_cfg |= SDRAM_CFG_MEM_EN;
-
-       return CFG_DDR_SIZE;
-}
-
-phys_size_t initdram(int board_type)
-{
-       volatile immap_t *im = (immap_t *) CFG_IMMR;
-       u32 msize = 0;
-
-       if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32) im)
-               return -1;
-
-       im->sysconf.ddrlaw[0].bar = CFG_DDR_BASE & LAWBAR_BAR;
-       msize = fixed_sdram();
-
-       /* return total bus RAM size(bytes) */
-       return msize * 1024 * 1024;
-}
-
-int checkboard(void)
-{
-       puts("Board: Matrix Vision mvBlueLYNX-M7\n");
-
-       return 0;
-}
-
-u8 *dhcp_vendorex_prep(u8 *e)
-{
-       char *ptr;
-
-       /* DHCP vendor-class-identifier = 60 */
-       ptr = getenv("dhcp_vendor-class-identifier");
-       if (ptr) {
-               *e++ = 60;
-               *e++ = strlen(ptr);
-               while (*ptr)
-                       *e++ = *ptr++;
-       }
-       /* DHCP_CLIENT_IDENTIFIER = 61 */
-       ptr = getenv("dhcp_client_id");
-       if (ptr) {
-               *e++ = 61;
-               *e++ = strlen(ptr);
-               while (*ptr)
-                       *e++ = *ptr++;
-       }
-
-       return e;
-}
-
-u8 *dhcp_vendorex_proc(u8 *popt)
-{
-       return NULL;
-}
-
-#ifdef CONFIG_HARD_SPI
-int spi_cs_is_valid(unsigned int bus, unsigned int cs)
-{
-       return bus == 0 && cs == 0;
-}
-
-void spi_cs_activate(struct spi_slave *slave)
-{
-       volatile gpio83xx_t *iopd = &((immap_t *)CFG_IMMR)->gpio[0];
-
-       iopd->dat &= ~MVBLM7_MMC_CS;
-}
-
-void spi_cs_deactivate(struct spi_slave *slave)
-{
-       volatile gpio83xx_t *iopd = &((immap_t *)CFG_IMMR)->gpio[0];
-
-       iopd->dat |= ~MVBLM7_MMC_CS;
-}
-#endif
-
-#if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
-{
-       ft_cpu_setup(blob, bd);
-#ifdef CONFIG_PCI
-       ft_pci_setup(blob, bd);
-#endif
-}
-
-#endif
diff --git a/board/mvblm7/mvblm7.h b/board/mvblm7/mvblm7.h
deleted file mode 100644 (file)
index 03e9f41..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#ifndef __MVBC_H__
-#define __MVBC_H__
-
-#define MV_GPIO
-
-#define FPGA_CONFIG     0x80000000
-#define FPGA_CCLK       0x40000000
-#define FPGA_DIN        0x20000000
-#define FPGA_STATUS     0x10000000
-#define FPGA_CONF_DONE  0x08000000
-#define MMC_CS         0x04000000
-
-#define WD_WDI          0x00400000
-#define WD_TS           0x00200000
-#define MAN_RST         0x00100000
-
-#define MV_GPIO_DAT    (WD_TS)
-#define MV_GPIO_OUT    (FPGA_CONFIG|FPGA_DIN|FPGA_CCLK|WD_TS|WD_WDI|MMC_CS)
-#define MV_GPIO_ODE    (FPGA_CONFIG|MAN_RST)
-
-#endif
diff --git a/board/mvblm7/mvblm7_autoscript b/board/mvblm7/mvblm7_autoscript
deleted file mode 100644 (file)
index ec6e34e..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-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 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
-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 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/board/mvblm7/pci.c b/board/mvblm7/pci.c
deleted file mode 100644 (file)
index ef34a6b..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright (C) Freescale Semiconductor, Inc. 2006. All rights reserved.
- *
- * (C) Copyright 2008
- * Andre Schwarz, Matrix Vision GmbH, andre.schwarz@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>
-#if defined(CONFIG_OF_LIBFDT)
-#include <libfdt.h>
-#endif
-#include <pci.h>
-#include <mpc83xx.h>
-#include <fpga.h>
-#include "mvblm7.h"
-#include "fpga.h"
-
-DECLARE_GLOBAL_DATA_PTR;
-
-int mvblm7_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);
-}
-
-static struct pci_region pci_regions[] = {
-       {
-               bus_start: CFG_PCI1_MEM_BASE,
-               phys_start: CFG_PCI1_MEM_PHYS,
-               size: CFG_PCI1_MEM_SIZE,
-               flags: PCI_REGION_MEM | PCI_REGION_PREFETCH
-       },
-       {
-               bus_start: CFG_PCI1_MMIO_BASE,
-               phys_start: CFG_PCI1_MMIO_PHYS,
-               size: CFG_PCI1_MMIO_SIZE,
-               flags: PCI_REGION_MEM
-       },
-       {
-               bus_start: CFG_PCI1_IO_BASE,
-               phys_start: CFG_PCI1_IO_PHYS,
-               size: CFG_PCI1_IO_SIZE,
-               flags: PCI_REGION_IO
-       }
-};
-
-void pci_init_board(void)
-{
-       char *s;
-       int i;
-       int warmboot;
-       int load_fpga;
-       volatile immap_t *immr;
-       volatile pcictrl83xx_t *pci_ctrl;
-       volatile gpio83xx_t *gpio;
-       volatile clk83xx_t *clk;
-       volatile law83xx_t *pci_law;
-       struct pci_region *reg[] = { pci_regions };
-
-       load_fpga = 1;
-       immr = (immap_t *) CFG_IMMR;
-       clk = (clk83xx_t *) &immr->clk;
-       pci_ctrl = immr->pci_ctrl;
-       pci_law = immr->sysconf.pcilaw;
-       gpio  = (volatile gpio83xx_t *)&immr->gpio[0];
-
-       s = getenv("skip_fpga");
-       if (s) {
-               printf("found 'skip_fpga' -> FPGA _not_ loaded !\n");
-               load_fpga = 0;
-       }
-
-       gpio->dat = MV_GPIO_DAT;
-       gpio->odr = MV_GPIO_ODE;
-       if (load_fpga)
-               gpio->dir = MV_GPIO_OUT;
-       else
-               gpio->dir = MV_GPIO_OUT & ~(FPGA_DIN|FPGA_CCLK);
-
-       printf("SICRH / SICRL : 0x%08x / 0x%08x\n", immr->sysconf.sicrh,
-               immr->sysconf.sicrl);
-
-       mvblm7_init_fpga();
-       if (load_fpga)
-               mvblm7_load_fpga();
-
-       /* Enable PCI_CLK_OUTPUTs 0 and 1 with 1:1 clocking */
-       clk->occr = 0xc0000000;
-
-       pci_ctrl[0].gcr = 0;
-       udelay(2000);
-       pci_ctrl[0].gcr = 1;
-
-       for (i = 0; i < 1000; ++i)
-               udelay(1000);
-
-       pci_law[0].bar = CFG_PCI1_MEM_PHYS & LAWBAR_BAR;
-       pci_law[0].ar = LBLAWAR_EN | LBLAWAR_1GB;
-
-       pci_law[1].bar = CFG_PCI1_IO_PHYS & LAWBAR_BAR;
-       pci_law[1].ar = LBLAWAR_EN | LBLAWAR_1MB;
-
-       warmboot = gd->bd->bi_bootflags & BOOTFLAG_WARM;
-
-       mpc83xx_pci_init(1, reg, warmboot);
-}
index 0dce9b46d629aadda845eea2587d192c6b4a2620..849350fd8a4fcd74723cc324bf50fe185a88df5d 100644 (file)
 #define CONFIG_ZERO_BOOTDELAY_CHECK
 #define CONFIG_RESET_TO_RETRY          1000
 
-#define MV_CI                  "mvBL-M7"
-#define MV_VCI                 "mvBL-M7"
-#define MV_FPGA_DATA           "0xfff80000"
-#define MV_FPGA_SIZE           "0x76ca2"
-#define MV_KERNEL_ADDR         "0xff810000"
-#define MV_INITRD_ADDR         "0xffc00000"
-#define MV_AUTOSCR_ADDR                "0xff804000"
-#define MV_AUTOSCR_ADDR2       "0xff806000"
-#define MV_DTB_ADDR            "0xff808000"
-#define MV_INITRD_LENGTH       "0x00300000"
+#define MV_CI                  mvBL-M7
+#define MV_VCI                 mvBL-M7
+#define MV_FPGA_DATA           0xfff80000
+#define MV_FPGA_SIZE           0x00076ca2
+#define MV_KERNEL_ADDR         0xff810000
+#define MV_INITRD_ADDR         0xffb00000
+#define MV_AUTOSCR_ADDR                0xff804000
+#define MV_AUTOSCR_ADDR2       0xff806000
+#define MV_DTB_ADDR            0xff808000
+#define MV_INITRD_LENGTH       0x00400000
 
 #define CONFIG_SHOW_BOOT_PROGRESS 1
 
-#define MV_KERNEL_ADDR_RAM     "0x00100000"
-#define MV_DTB_ADDR_RAM                "0x00600000"
-#define MV_INITRD_ADDR_RAM     "0x01000000"
+#define MV_KERNEL_ADDR_RAM     0x00100000
+#define MV_DTB_ADDR_RAM                0x00600000
+#define MV_INITRD_ADDR_RAM     0x01000000
 
 #define CONFIG_BOOTCOMMAND     "if imi ${autoscr_addr}; \
                                        then autoscr ${autoscr_addr};  \
 
 #define CONFIG_EXTRA_ENV_SETTINGS                              \
        "console_nr=0\0"                                        \
+       "baudrate=" MK_STR(CONFIG_BAUDRATE) "\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"                            \
+       "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_version=" U_BOOT_VERSION "\0"                       \
-       "dhcp_client_id=" MV_CI "\0"                            \
-       "dhcp_vendor-class-identifier=" MV_VCI "\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"                         \
        "gevss_debug=0\0"                                       \
        "watchdog=0\0"                                          \
        "usb_dr_mode=host\0"                                    \
+       "sensor_cnt=2\0"                                        \
        ""
 
 #define CONFIG_FPGA_COUNT      1