-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The MVBC_P is a MPC5200B based camera system with Intel Gigabit ethernet controller (using e1000) and custom Altera Cyclone-II FPGA on PCI. Signed-off-by: Andre Schwarz <[email protected]> Signed-off-by: Grant Likely <[email protected]>
- Loading branch information
Showing
14 changed files
with
1,132 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -426,7 +426,7 @@ D: FADS823 configuration, MPC823 video support, I2C, wireless keyboard, lots mor | |
|
||
N: Andre Schwarz | ||
E: [email protected] | ||
D: Support for Matrix Vision boards (MVBLM7) | ||
D: Support for Matrix Vision boards (MVBLM7/MVBC_P) | ||
|
||
N: Robert Schwebel | ||
E: [email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -372,6 +372,7 @@ Peter De Schrijver <[email protected]> | |
|
||
Andre Schwarz <[email protected]> | ||
|
||
mvbc_p MPC5200 | ||
mvblm7 MPC8343 | ||
|
||
Timur Tabi <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,7 @@ LIST_5xxx=" \ | |
mecp5200 \ | ||
motionpro \ | ||
munices \ | ||
MVBC_P \ | ||
o2dnt \ | ||
pf5200 \ | ||
PM520 \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# | ||
# (C) Copyright 2003 | ||
# Wolfgang Denk, DENX Software Engineering, [email protected]. | ||
# | ||
# (C) Copyright 2004-2008 | ||
# Matrix-Vision GmbH, [email protected] | ||
# | ||
# 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 $(obj).depend | ||
|
||
######################################################################### | ||
|
||
include $(SRCTREE)/rules.mk | ||
|
||
sinclude $(obj).depend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# | ||
# (C) Copyright 2003 | ||
# Wolfgang Denk, DENX Software Engineering, [email protected]. | ||
# | ||
# 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 | ||
|
||
ifndef TEXT_BASE | ||
TEXT_BASE = 0xFF800000 | ||
endif | ||
|
||
PLATFORM_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE) -I$(TOPDIR)/board |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,177 @@ | ||
/* | ||
* (C) Copyright 2002 | ||
* Rich Ireland, Enterasys Networks, [email protected]. | ||
* Keith Outwater, [email protected]. | ||
* | ||
* (C) Copyright 2008 | ||
* Andre Schwarz, Matrix Vision GmbH, [email protected] | ||
* | ||
* 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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* (C) Copyright 2002 | ||
* Rich Ireland, Enterasys Networks, [email protected]. | ||
* Keith Outwater, [email protected]. | ||
* | ||
* 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); |
Oops, something went wrong.