From 8b1ccd8693abb63537c97b71a3eebefaeefeaf6d Mon Sep 17 00:00:00 2001 From: stroese Date: Thu, 16 Sep 2004 12:34:51 +0000 Subject: Update AR405 board. --- board/esd/ar405/Makefile | 2 +- board/esd/ar405/ar405.c | 108 +- board/esd/ar405/config.mk | 3 +- board/esd/ar405/flash.c | 95 +- board/esd/ar405/fpgadata_xl30.c | 2285 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 2389 insertions(+), 104 deletions(-) create mode 100644 board/esd/ar405/fpgadata_xl30.c (limited to 'board/esd') diff --git a/board/esd/ar405/Makefile b/board/esd/ar405/Makefile index f5bda5519a..a60495a59a 100644 --- a/board/esd/ar405/Makefile +++ b/board/esd/ar405/Makefile @@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk LIB = lib$(BOARD).a -OBJS = $(BOARD).o flash.o +OBJS = $(BOARD).o flash.o ../common/misc.o $(LIB): $(OBJS) $(SOBJS) $(AR) crv $@ $(OBJS) diff --git a/board/esd/ar405/ar405.c b/board/esd/ar405/ar405.c index 6535a19d7f..979eb3bf57 100644 --- a/board/esd/ar405/ar405.c +++ b/board/esd/ar405/ar405.c @@ -1,5 +1,5 @@ /* - * (C) Copyright 2001 + * (C) Copyright 2001-2004 * Stefan Roese, esd gmbh germany, stefan.roese@esd-electronics.com * * See file CREDITS for list of people who contributed to this @@ -28,6 +28,7 @@ /*cmd_boot.c*/ extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); +extern void lxt971_no_sleep(void); /* ------------------------------------------------------------------------- */ @@ -40,6 +41,10 @@ const unsigned char fpgadata[] = { #include "fpgadata.c" }; +const unsigned char fpgadata_xl30[] = { +#include "fpgadata_xl30.c" +}; + /* * include common fpga code (for esd boards) */ @@ -64,45 +69,52 @@ int board_early_init_f (void) /* * Boot onboard FPGA */ + /* first try 40er image */ + gd->board_type = 40; status = fpga_boot ((unsigned char *) fpgadata, sizeof (fpgadata)); if (status != 0) { - /* booting FPGA failed */ + /* try xl30er image */ + gd->board_type = 30; + status = fpga_boot ((unsigned char *) fpgadata_xl30, sizeof (fpgadata_xl30)); + if (status != 0) { + /* booting FPGA failed */ #ifndef FPGA_DEBUG - /* set up serial port with default baudrate */ - (void) get_clocks (); - gd->baudrate = CONFIG_BAUDRATE; - serial_init (); - console_init_f (); + /* set up serial port with default baudrate */ + (void) get_clocks (); + gd->baudrate = CONFIG_BAUDRATE; + serial_init (); + console_init_f (); #endif - printf ("\nFPGA: Booting failed "); - switch (status) { - case ERROR_FPGA_PRG_INIT_LOW: - printf ("(Timeout: INIT not low after asserting PROGRAM*)\n "); - break; - case ERROR_FPGA_PRG_INIT_HIGH: - printf ("(Timeout: INIT not high after deasserting PROGRAM*)\n "); - break; - case ERROR_FPGA_PRG_DONE: - printf ("(Timeout: DONE not high after programming FPGA)\n "); - break; - } - - /* display infos on fpgaimage */ - index = 15; - for (i = 0; i < 4; i++) { - len = fpgadata[index]; - printf ("FPGA: %s\n", &(fpgadata[index + 1])); - index += len + 3; - } - putc ('\n'); - /* delayed reboot */ - for (i = 20; i > 0; i--) { - printf ("Rebooting in %2d seconds \r", i); - for (index = 0; index < 1000; index++) - udelay (1000); + printf ("\nFPGA: Booting failed "); + switch (status) { + case ERROR_FPGA_PRG_INIT_LOW: + printf ("(Timeout: INIT not low after asserting PROGRAM*)\n "); + break; + case ERROR_FPGA_PRG_INIT_HIGH: + printf ("(Timeout: INIT not high after deasserting PROGRAM*)\n "); + break; + case ERROR_FPGA_PRG_DONE: + printf ("(Timeout: DONE not high after programming FPGA)\n "); + break; + } + + /* display infos on fpgaimage */ + index = 15; + for (i = 0; i < 4; i++) { + len = fpgadata[index]; + printf ("FPGA: %s\n", &(fpgadata[index + 1])); + index += len + 3; + } + putc ('\n'); + /* delayed reboot */ + for (i = 20; i > 0; i--) { + printf ("Rebooting in %2d seconds \r", i); + for (index = 0; index < 1000; index++) + udelay (1000); + } + putc ('\n'); + do_reset (NULL, 0, 0, NULL); } - putc ('\n'); - do_reset (NULL, 0, 0, NULL); } /* @@ -139,32 +151,44 @@ int board_early_init_f (void) int checkboard (void) { + DECLARE_GLOBAL_DATA_PTR; + int index; int len; unsigned char str[64]; int i = getenv_r ("serial#", str, sizeof (str)); + const unsigned char *fpga; puts ("Board: "); - if (!i || strncmp (str, "AR405", 5)) { - puts ("### No HW ID - assuming AR405\n"); - return (0); + if (i == -1) { + puts ("### No HW ID - assuming AR405"); + } else { + puts(str); } - puts (str); - puts ("\nFPGA: "); /* display infos on fpgaimage */ + if (gd->board_type == 30) { + fpga = fpgadata_xl30; + } else { + fpga = fpgadata; + } index = 15; for (i = 0; i < 4; i++) { - len = fpgadata[index]; - printf ("%s ", &(fpgadata[index + 1])); + len = fpga[index]; + printf ("%s ", &(fpga[index + 1])); index += len + 3; } putc ('\n'); + /* + * Disable sleep mode in LXT971 + */ + lxt971_no_sleep(); + return 0; } diff --git a/board/esd/ar405/config.mk b/board/esd/ar405/config.mk index b229ec0cb8..3e8baf6563 100644 --- a/board/esd/ar405/config.mk +++ b/board/esd/ar405/config.mk @@ -26,4 +26,5 @@ # #TEXT_BASE = 0xFFFE0000 -TEXT_BASE = 0xFFFD0000 +#TEXT_BASE = 0xFFFD0000 +TEXT_BASE = 0xFFFC0000 diff --git a/board/esd/ar405/flash.c b/board/esd/ar405/flash.c index a651b6f926..89af1190a8 100644 --- a/board/esd/ar405/flash.c +++ b/board/esd/ar405/flash.c @@ -33,18 +33,19 @@ /*----------------------------------------------------------------------- * Functions */ -static ulong flash_get_size (vu_long *addr, flash_info_t *info); -static void flash_get_offsets (ulong base, flash_info_t *info); +static ulong flash_get_size (vu_long * addr, flash_info_t * info); +static void flash_get_offsets (ulong base, flash_info_t * info); /*----------------------------------------------------------------------- */ unsigned long flash_init (void) { - unsigned long size_b0, size_b1; + unsigned long size_b0; int i; uint pbcr; - unsigned long base_b0, base_b1; + unsigned long base_b0; + int size_val = 0; /* Init: no FLASHes known */ for (i=0; i