summaryrefslogtreecommitdiff
path: root/board/matrix_vision/mvblm7/pci.c
diff options
context:
space:
mode:
authorAndré Schwarz <andre.schwarz@matrix-vision.de>2009-08-27 14:48:35 +0200
committerWolfgang Denk <wd@denx.de>2009-08-28 00:31:23 +0200
commit28887d831b02c66ccc10d7f1379204b5a62f4543 (patch)
treec2a5d544587f0535b3de9ba742292195ae63ab7f /board/matrix_vision/mvblm7/pci.c
parent05f91a65abc3180e2896cd8ddee7a34b1d1ce6e0 (diff)
downloadu-boot-imx-28887d831b02c66ccc10d7f1379204b5a62f4543.zip
u-boot-imx-28887d831b02c66ccc10d7f1379204b5a62f4543.tar.gz
u-boot-imx-28887d831b02c66ccc10d7f1379204b5a62f4543.tar.bz2
Use common code for Matrix Vision boards
Clean up existing boards (mvBC-P/MPC5200 and mvBL-M7/MPC8343) by using common code. Signed-off-by: André Schwarz <andre.schwarz@matrix-vision.de>
Diffstat (limited to 'board/matrix_vision/mvblm7/pci.c')
-rw-r--r--board/matrix_vision/mvblm7/pci.c35
1 files changed, 5 insertions, 30 deletions
diff --git a/board/matrix_vision/mvblm7/pci.c b/board/matrix_vision/mvblm7/pci.c
index 4b74e6d..1cc524b 100644
--- a/board/matrix_vision/mvblm7/pci.c
+++ b/board/matrix_vision/mvblm7/pci.c
@@ -32,24 +32,10 @@
#include <fpga.h>
#include "mvblm7.h"
#include "fpga.h"
+#include "../common/mv_common.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: CONFIG_SYS_PCI1_MEM_BASE,
@@ -73,10 +59,8 @@ static struct pci_region pci_regions[] = {
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;
@@ -84,32 +68,23 @@ void pci_init_board(void)
volatile law83xx_t *pci_law;
struct pci_region *reg[] = { pci_regions };
- load_fpga = 1;
immr = (immap_t *) CONFIG_SYS_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);
+ gpio->dir = MV_GPIO_OUT;
printf("SICRH / SICRL : 0x%08x / 0x%08x\n", immr->sysconf.sicrh,
immr->sysconf.sicrl);
mvblm7_init_fpga();
- if (load_fpga)
- mvblm7_load_fpga();
+ mv_load_fpga();
+
+ gpio->dir = MV_GPIO_OUT & ~(FPGA_DIN|FPGA_CCLK);
/* Enable PCI_CLK_OUTPUTs 0 and 1 with 1:1 clocking */
clk->occr = 0xc0000000;