mirror of
https://github.com/Stichting-MINIX-Research-Foundation/u-boot.git
synced 2025-09-11 13:08:31 -04:00
PMC405 board update
This commit is contained in:
parent
12537cc5a9
commit
4510a7b736
@ -30,7 +30,7 @@ CPLD = ../common/xilinx_jtag/lenval.o \
|
|||||||
../common/xilinx_jtag/micro.o \
|
../common/xilinx_jtag/micro.o \
|
||||||
../common/xilinx_jtag/ports.o
|
../common/xilinx_jtag/ports.o
|
||||||
|
|
||||||
OBJS = $(BOARD).o strataflash.o $(CPLD)
|
OBJS = $(BOARD).o strataflash.o ../common/misc.o $(CPLD)
|
||||||
|
|
||||||
$(LIB): $(OBJS) $(SOBJS)
|
$(LIB): $(OBJS) $(SOBJS)
|
||||||
$(AR) crv $@ $(OBJS)
|
$(AR) crv $@ $(OBJS)
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -27,6 +27,9 @@
|
|||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
|
||||||
|
|
||||||
|
extern void lxt971_no_sleep(void);
|
||||||
|
|
||||||
|
|
||||||
/* fpga configuration data - not compressed, generated by bin2c */
|
/* fpga configuration data - not compressed, generated by bin2c */
|
||||||
const unsigned char fpgadata[] =
|
const unsigned char fpgadata[] =
|
||||||
{
|
{
|
||||||
@ -62,6 +65,18 @@ int board_early_init_f (void)
|
|||||||
*/
|
*/
|
||||||
mtebc (epcr, 0xa8400000);
|
mtebc (epcr, 0xa8400000);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Setup GPIO pins (CS6+CS7 as GPIO)
|
||||||
|
*/
|
||||||
|
mtdcr(cntrl0, mfdcr(cntrl0) | 0x00300000);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Configure GPIO pins
|
||||||
|
*/
|
||||||
|
out32(GPIO0_ODR, 0x00000000); /* no open drain pins */
|
||||||
|
out32(GPIO0_TCR, CFG_FPGA_PRG | CFG_FPGA_CLK | CFG_FPGA_DATA); /* setup for output */
|
||||||
|
out32(GPIO0_OR, 0); /* outputs -> low */
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,6 +91,12 @@ int misc_init_f (void)
|
|||||||
|
|
||||||
int misc_init_r (void)
|
int misc_init_r (void)
|
||||||
{
|
{
|
||||||
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
|
/* adjust flash start and offset */
|
||||||
|
gd->bd->bi_flashstart = 0 - gd->bd->bi_flashsize;
|
||||||
|
gd->bd->bi_flashoffset = 0;
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,6 +120,11 @@ int checkboard (void)
|
|||||||
|
|
||||||
putc ('\n');
|
putc ('\n');
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Disable sleep mode in LXT971
|
||||||
|
*/
|
||||||
|
lxt971_no_sleep();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,3 +156,42 @@ int testdram (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------- */
|
/* ------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
int do_cantest(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
||||||
|
{
|
||||||
|
ulong addr;
|
||||||
|
volatile uchar *ptr;
|
||||||
|
volatile uchar val;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
addr = simple_strtol (argv[1], NULL, 16) + 0x16;
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
for (;;) {
|
||||||
|
ptr = (uchar *)addr;
|
||||||
|
for (i=0; i<8; i++) {
|
||||||
|
*ptr = i;
|
||||||
|
val = *ptr;
|
||||||
|
|
||||||
|
if (val != i) {
|
||||||
|
printf("ERROR: addr=%p write=0x%02X, read=0x%02X\n", ptr, i, val);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Abort if ctrl-c was pressed */
|
||||||
|
if (ctrlc()) {
|
||||||
|
puts("\nAbort\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
ptr++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
U_BOOT_CMD(
|
||||||
|
cantest, 3, 1, do_cantest,
|
||||||
|
"cantest - Test CAN controller",
|
||||||
|
NULL
|
||||||
|
);
|
||||||
|
@ -89,6 +89,8 @@
|
|||||||
#define FLASH_MAN_CFI 0x01000000
|
#define FLASH_MAN_CFI 0x01000000
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef union {
|
typedef union {
|
||||||
unsigned char c;
|
unsigned char c;
|
||||||
unsigned short w;
|
unsigned short w;
|
||||||
@ -111,6 +113,7 @@ flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void flash_add_byte(flash_info_t *info, cfiword_t * cword, uchar c);
|
static void flash_add_byte(flash_info_t *info, cfiword_t * cword, uchar c);
|
||||||
static void flash_make_cmd(flash_info_t * info, uchar cmd, void * cmdbuf);
|
static void flash_make_cmd(flash_info_t * info, uchar cmd, void * cmdbuf);
|
||||||
static void flash_write_cmd(flash_info_t * info, int sect, uchar offset, uchar cmd);
|
static void flash_write_cmd(flash_info_t * info, int sect, uchar offset, uchar cmd);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user