Skip to content

Commit

Permalink
Add initial support for Matrix Vision mvSMR board based on MPC5200B.
Browse files Browse the repository at this point in the history
Signed-off-by: Andre Schwarz <[email protected]>
  • Loading branch information
Andre Schwarz authored and wdenx committed Apr 9, 2010
1 parent 9acd4f0 commit 1f2463d
Show file tree
Hide file tree
Showing 14 changed files with 1,088 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,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/MVBC_P)
D: Support for Matrix Vision boards (MVBLM7/MVBC_P/MVSMR)

N: Robert Schwebel
E: [email protected]
Expand Down
1 change: 1 addition & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ Andre Schwarz <[email protected]>

mvbc_p MPC5200
mvblm7 MPC8343
mvsmr MPC5200

Jon Smirl <[email protected]>

Expand Down
1 change: 1 addition & 0 deletions MAKEALL
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ LIST_5xxx=" \
motionpro \
munices \
MVBC_P \
MVSMR \
o2dnt \
pcm030 \
pf5200 \
Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,11 @@ MVBC_P_config: unconfig
{ echo "#define CONFIG_MVBC_P" >>$(obj)include/config.h; }
@$(MKCONFIG) -n $@ -a MVBC_P ppc mpc5xxx mvbc_p matrix_vision

MVSMR_config: unconfig
@mkdir -p $(obj)include
@mkdir -p $(obj)board/matrix_vision/mvsmr
@$(MKCONFIG) $(@:_config=) ppc mpc5xxx mvsmr matrix_vision

o2dnt_config: unconfig
@$(MKCONFIG) o2dnt ppc mpc5xxx o2dnt

Expand Down
51 changes: 51 additions & 0 deletions board/matrix_vision/mvsmr/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#
# (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)
@mkimage -T script -C none -n mvSMR_Script -d bootscript bootscript.img

clean:
rm -f $(SOBJS) $(OBJS)

distclean: clean
rm -f $(LIB) core *.bak $(obj).depend

#########################################################################

include $(SRCTREE)/rules.mk

sinclude $(obj).depend
42 changes: 42 additions & 0 deletions board/matrix_vision/mvsmr/bootscript
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
echo
echo "==== running autoscript ===="
echo
setenv boot24 'bootm ${kernel_boot} ${mv_initrd_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 addcons boot24
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}'
if test ${servicemode} != yes;
then
echo "=== forced flash mode ==="
run set_static_ip set_static_nm set_static_gw set_ip bootfromflash
fi
if test ${autoscript_boot} != no;
then
if test ${netboot} = yes;
then
bootp
if test $? = 0;
then
echo "=== bootp succeeded -> netboot ==="
run set_ip bootfromnet addcons boot24
else
echo "=== netboot failed ==="
fi
fi
echo "=== bootfromflash ==="
run set_static_ip set_static_nm set_static_gw set_ip bootfromflash
else
echo "=== boot stopped with autoscript_boot no ==="
fi
31 changes: 31 additions & 0 deletions board/matrix_vision/mvsmr/config.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#
# (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
LDSCRIPT := $(SRCTREE)/board/matrix_vision/mvsmr/u-boot.lds
129 changes: 129 additions & 0 deletions board/matrix_vision/mvsmr/fpga.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
/*
* (C) Copyright 2002
* Rich Ireland, Enterasys Networks, [email protected].
* Keith Outwater, [email protected].
*
* (C) Copyright 2010
* 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 <spartan3.h>
#include <command.h>
#include <asm/io.h>
#include "fpga.h"
#include "mvsmr.h"

Xilinx_Spartan3_Slave_Serial_fns fpga_fns = {
fpga_pre_config_fn,
fpga_pgm_fn,
fpga_clk_fn,
fpga_init_fn,
fpga_done_fn,
fpga_wr_fn,
0
};

Xilinx_desc spartan3 = {
Xilinx_Spartan2,
slave_serial,
XILINX_XC3S200_SIZE,
(void *) &fpga_fns,
0,
};

DECLARE_GLOBAL_DATA_PTR;

int mvsmr_init_fpga(void)
{
fpga_init();
fpga_add(fpga_xilinx, &spartan3);

return 1;
}

int fpga_init_fn(int cookie)
{
struct mpc5xxx_gpio *gpio = (struct mpc5xxx_gpio *)MPC5XXX_GPIO;

if (in_be32(&gpio->simple_ival) & FPGA_CONFIG)
return 0;

return 1;
}

int fpga_done_fn(int cookie)
{
struct mpc5xxx_gpio *gpio = (struct mpc5xxx_gpio *)MPC5XXX_GPIO;
int result = 0;

udelay(10);
if (in_be32(&gpio->simple_ival) & FPGA_DONE)
result = 1;

return result;
}

int fpga_pgm_fn(int assert, int flush, int cookie)
{
struct mpc5xxx_gpio *gpio = (struct mpc5xxx_gpio *)MPC5XXX_GPIO;

if (!assert)
setbits_8(&gpio->sint_dvo, FPGA_STATUS);
else
clrbits_8(&gpio->sint_dvo, FPGA_STATUS);

return assert;
}

int fpga_clk_fn(int assert_clk, int flush, int cookie)
{
struct mpc5xxx_gpio *gpio = (struct mpc5xxx_gpio *)MPC5XXX_GPIO;

if (assert_clk)
setbits_be32(&gpio->simple_dvo, FPGA_CCLK);
else
clrbits_be32(&gpio->simple_dvo, FPGA_CCLK);

return assert_clk;
}

int fpga_wr_fn(int assert_write, int flush, int cookie)
{
struct mpc5xxx_gpio *gpio = (struct mpc5xxx_gpio *)MPC5XXX_GPIO;

if (assert_write)
setbits_be32(&gpio->simple_dvo, FPGA_DIN);
else
clrbits_be32(&gpio->simple_dvo, FPGA_DIN);

return assert_write;
}

int fpga_pre_config_fn(int cookie)
{
struct mpc5xxx_gpio *gpio = (struct mpc5xxx_gpio *)MPC5XXX_GPIO;

setbits_8(&gpio->sint_dvo, FPGA_STATUS);

return 0;
}
32 changes: 32 additions & 0 deletions board/matrix_vision/mvsmr/fpga.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* (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
*
*/

extern int mvsmr_init_fpga(void);

extern int fpga_pgm_fn(int assert_pgm, int flush, int cookie);
extern int fpga_init_fn(int cookie);
extern int fpga_clk_fn(int assert_clk, int flush, int cookie);
extern int fpga_wr_fn(int assert_write, int flush, int cookie);
extern int fpga_done_fn(int cookie);
extern int fpga_pre_config_fn(int cookie);
Loading

0 comments on commit 1f2463d

Please sign in to comment.