* Add support for USB Mass Storage Devices (BBB)

(tested with USB memory sticks only)

* Avoid flicker on TRAB's VFD
This commit is contained in:
wdenk 2003-09-10 18:20:28 +00:00
parent 7152b1d0b3
commit 149dded2b1
35 changed files with 2532 additions and 57 deletions

View file

@ -1,7 +1,12 @@
======================================================================
Changes for U-Boot 0.4.7:
Changes for U-Boot 0.4.8:
======================================================================
* Add support for USB Mass Storage Devices (BBB)
(tested with USB memory sticks only)
* Avoid flicker on TRAB's VFD
* Add support for SK98xx driver
* Add PCI support for SL8245 board
@ -27,6 +32,10 @@ Changes for U-Boot 0.4.7:
* Patch by Yuli Barcohen, 7 Aug 2003:
check BCSR to detect if the board is configured in PCI mode
======================================================================
Changes for U-Boot 0.4.7:
======================================================================
* Patch by Raghu Krishnaprasad, 7 Aug 2003:
add support for Adder II MPC852T module
@ -263,7 +272,7 @@ Changes for U-Boot 0.4.1:
- PIC on LWMON board needs delay after power-on
- Add missing RSR definitions for MPC8xx
- Improve log buffer handling: guarantee clean reset after power-on
- Add support for EXBITGEN board
- Add support for EXBITGEN board (aka "genie")
- Add support for SL8245 board
* Code cleanup:

View file

@ -89,6 +89,7 @@ Wolfgang Denk <wd@denx.de>
TQM8255 MPC8255
CPU86 MPC8260
PM825 MPC8250
PM826 MPC8260
TQM8260 MPC8260

View file

@ -238,7 +238,9 @@ int board_pre_init (void)
long int initdram (int board_type)
{
#if CONFIG_ADSTYPE == CFG_PQ2FADS
vu_long *bcsr = (vu_long *)CFG_BCSR;
#endif
volatile immap_t *immap = (immap_t *) CFG_IMMR;
volatile memctl8260_t *memctl = &immap->im_memctl;
volatile uchar *ramaddr, c = 0xff;

View file

@ -105,6 +105,10 @@ int board_init ()
gpio->PGUP = 0x0;
gpio->OPENCR= 0x0;
/* suppress flicker of the VFDs */
gpio->MISCCR = 0x40;
gpio->PFCON |= (2<<12);
/* arch number of SAMSUNG-Board */
/* MACH_TYPE_SMDK2400 */
/* XXX this isn't really correct, but keep it for now */

View file

@ -38,7 +38,7 @@ struct nand_oob_config {
int eccvalid_pos; /* position of ECC valid flag inside oob -1 = inactive */
} oob_config = { {0}, 0, 0};
#undef NAND_DEBUG
#define NAND_DEBUG
#undef PSYCHO_DEBUG
/* ****************** WARNING *********************

View file

@ -2,8 +2,12 @@
* (C) Copyright 2001
* Denis Peter, MPL AG Switzerland
*
* For BBB support (C) Copyright 2003
* Gary Jennejohn, DENX Software Engineering <gj@denx.de>
*
* Most of this source has been derived from the Linux USB
* project.
* project. BBB support based on /sys/dev/usb/umass.c from
* FreeBSD.
*
* See file CREDITS for list of people who contributed to this
* project.
@ -30,6 +34,13 @@
* is only tested with a TEAC USB Floppy. Other Massstorages with CBI or CB
* transport protocoll may work as well.
*/
/*
* New Note:
* Support for USB Mass Storage Devices (BBB) has been added. It has
* only been tested with USB memory sticks.
* Nota bene: if you are using the BBB support with a little-endian
* CPU then you MUST define LITTLEENDIAN in the configuration file!
*/
#include <common.h>
@ -71,6 +82,41 @@ static ccb usb_ccb;
#define US_CBI_ADSC 0
/*
* BULK only
*/
#define US_BBB_RESET 0xff
#define US_BBB_GET_MAX_LUN 0xfe
/* Command Block Wrapper */
typedef struct {
__u32 dCBWSignature;
# define CBWSIGNATURE 0x43425355
__u32 dCBWTag;
__u32 dCBWDataTransferLength;
__u8 bCBWFlags;
# define CBWFLAGS_OUT 0x00
# define CBWFLAGS_IN 0x80
__u8 bCBWLUN;
__u8 bCDBLength;
# define CBWCDBLENGTH 16
__u8 CBWCDB[CBWCDBLENGTH];
} umass_bbb_cbw_t;
#define UMASS_BBB_CBW_SIZE 31
static __u32 CBWTag = 0;
/* Command Status Wrapper */
typedef struct {
__u32 dCSWSignature;
# define CSWSIGNATURE 0x53425355
__u32 dCSWTag;
__u32 dCSWDataResidue;
__u8 bCSWStatus;
# define CSWSTATUS_GOOD 0x0
# define CSWSTATUS_FAILED 0x1
# define CSWSTATUS_PHASE 0x2
} umass_bbb_csw_t;
#define UMASS_BBB_CSW_SIZE 13
#define USB_MAX_STOR_DEV 5
static int usb_max_devs; /* number of highest available usb device */
@ -138,6 +184,9 @@ int usb_stor_scan(int mode)
unsigned char i;
struct usb_device *dev;
/* GJ */
memset(usb_stor_buf, 0, sizeof(usb_stor_buf));
if(mode==1) {
printf("scanning bus for storage devices...\n");
}
@ -293,6 +342,51 @@ static int us_one_transfer(struct us_data *us, int pipe, char *buf, int length)
return 0;
}
static int usb_stor_BBB_reset(struct us_data *us)
{
int result;
unsigned int pipe;
/*
* Reset recovery (5.3.4 in Universal Serial Bus Mass Storage Class)
*
* For Reset Recovery the host shall issue in the following order:
* a) a Bulk-Only Mass Storage Reset
* b) a Clear Feature HALT to the Bulk-In endpoint
* c) a Clear Feature HALT to the Bulk-Out endpoint
*
* This is done in 3 steps.
*
* If the reset doesn't succeed, the device should be port reset.
*
* This comment stolen from FreeBSD's /sys/dev/usb/umass.c.
*/
USB_STOR_PRINTF("BBB_reset\n");
result = usb_control_msg(us->pusb_dev, usb_sndctrlpipe(us->pusb_dev,0),
US_BBB_RESET, USB_TYPE_CLASS | USB_RECIP_INTERFACE,
0, us->ifnum, 0, 0, USB_CNTL_TIMEOUT*5);
if((result < 0) && (us->pusb_dev->status & USB_ST_STALLED))
{
USB_STOR_PRINTF("RESET:stall\n");
return -1;
}
/* long wait for reset */
wait_ms(150);
USB_STOR_PRINTF("BBB_reset result %d: status %X reset\n",result,us->pusb_dev->status);
pipe = usb_rcvbulkpipe(us->pusb_dev, us->ep_in);
result = usb_clear_halt(us->pusb_dev, pipe);
/* long wait for reset */
wait_ms(150);
USB_STOR_PRINTF("BBB_reset result %d: status %X clearing IN endpoint\n",result,us->pusb_dev->status);
/* long wait for reset */
pipe = usb_sndbulkpipe(us->pusb_dev, us->ep_out);
result = usb_clear_halt(us->pusb_dev, pipe);
wait_ms(150);
USB_STOR_PRINTF("BBB_reset result %d: status %X clearing OUT endpoint\n",result,us->pusb_dev->status);
USB_STOR_PRINTF("BBB_reset done\n");
return 0;
}
/* FIXME: this reset function doesn't really reset the port, and it
* should. Actually it should probably do what it's doing here, and
* reset the port physically
@ -320,6 +414,52 @@ static int usb_stor_CB_reset(struct us_data *us)
return 0;
}
/*
* Set up the command for a BBB device. Note that the actual SCSI
* command is copied into cbw.CBWCDB.
*/
int usb_stor_BBB_comdat(ccb *srb, struct us_data *us)
{
int result;
int actlen;
int dir_in;
unsigned int pipe;
umass_bbb_cbw_t cbw;
dir_in = US_DIRECTION(srb->cmd[0]);
#ifdef BBB_COMDAT_TRACE
printf("dir %d lun %d cmdlen %d cmd %p datalen %d pdata %p\n", dir_in, srb->lun, srb->cmdlen, srb->cmd, srb->datalen, srb->pdata);
if (srb->cmdlen) {
for(result = 0;result < srb->cmdlen;result++)
printf("cmd[%d] %#x ", result, srb->cmd[result]);
printf("\n");
}
#endif
/* sanity checks */
if (!(srb->cmdlen <= CBWCDBLENGTH)) {
USB_STOR_PRINTF("usb_stor_BBB_comdat:cmdlen too large\n");
return -1;
}
/* always OUT to the ep */
pipe = usb_sndbulkpipe(us->pusb_dev, us->ep_out);
cbw.dCBWSignature = swap_32(CBWSIGNATURE);
cbw.dCBWTag = swap_32(CBWTag++);
cbw.dCBWDataTransferLength = swap_32(srb->datalen);
cbw.bCBWFlags = (dir_in? CBWFLAGS_IN : CBWFLAGS_OUT);
cbw.bCBWLUN = srb->lun;
cbw.bCDBLength = srb->cmdlen;
/* copy the command data into the CBW command data buffer */
/* DST SRC LEN!!! */
memcpy(cbw.CBWCDB, srb->cmd, srb->cmdlen);
result = usb_bulk_msg(us->pusb_dev, pipe, &cbw, UMASS_BBB_CBW_SIZE, &actlen, USB_CNTL_TIMEOUT*5);
if (result < 0)
USB_STOR_PRINTF("usb_stor_BBB_comdat:usb_bulk_msg error\n");
return result;
}
/* FIXME: we also need a CBI_command which sets up the completion
* interrupt, and waits for it
*/
@ -422,6 +562,134 @@ int usb_stor_CBI_get_status(ccb *srb, struct us_data *us)
#define USB_TRANSPORT_UNKNOWN_RETRY 5
#define USB_TRANSPORT_NOT_READY_RETRY 10
/* clear a stall on an endpoint - special for BBB devices */
int usb_stor_BBB_clear_endpt_stall(struct us_data *us, __u8 endpt)
{
int result;
/* ENDPOINT_HALT = 0, so set value to 0 */
result = usb_control_msg(us->pusb_dev, usb_sndctrlpipe(us->pusb_dev,0),
USB_REQ_CLEAR_FEATURE, USB_RECIP_ENDPOINT,
0, endpt, 0, 0, USB_CNTL_TIMEOUT*5);
return result;
}
int usb_stor_BBB_transport(ccb *srb, struct us_data *us)
{
int result, retry;
int dir_in;
int actlen, data_actlen;
unsigned int pipe, pipein, pipeout;
umass_bbb_csw_t csw;
#ifdef BBB_XPORT_TRACE
unsigned char *ptr;
int index;
#endif
dir_in = US_DIRECTION(srb->cmd[0]);
/* COMMAND phase */
USB_STOR_PRINTF("COMMAND phase\n");
result = usb_stor_BBB_comdat(srb, us);
if (result < 0) {
USB_STOR_PRINTF("failed to send CBW status %ld\n",
us->pusb_dev->status);
usb_stor_BBB_reset(us);
return USB_STOR_TRANSPORT_FAILED;
}
wait_ms(5);
pipein = usb_rcvbulkpipe(us->pusb_dev, us->ep_in);
pipeout = usb_sndbulkpipe(us->pusb_dev, us->ep_out);
/* DATA phase + error handling */
USB_STOR_PRINTF("DATA phase\n");
data_actlen = 0;
/* no data, go immediately to the STATUS phase */
if (srb->datalen == 0)
goto st;
if (dir_in)
pipe = pipein;
else
pipe = pipeout;
result = usb_bulk_msg(us->pusb_dev, pipe, srb->pdata, srb->datalen, &data_actlen, USB_CNTL_TIMEOUT*5);
/* special handling of STALL in DATA phase */
if((result < 0) && (us->pusb_dev->status & USB_ST_STALLED)) {
printf("DATA:stall\n");
/* clear the STALL on the endpoint */
result = usb_stor_BBB_clear_endpt_stall(us, dir_in? us->ep_in : us->ep_out);
if (result >= 0)
/* continue on to STATUS phase */
goto st;
}
if (result < 0) {
USB_STOR_PRINTF("usb_bulk_msg error status %ld\n",
us->pusb_dev->status);
usb_stor_BBB_reset(us);
return USB_STOR_TRANSPORT_FAILED;
}
#ifdef BBB_XPORT_TRACE
for (index = 0; index < data_actlen; index++)
printf("pdata[%d] %#x ", index, srb->pdata[index]);
printf("\n");
#endif
/* STATUS phase + error handling */
st:
retry = 0;
again:
USB_STOR_PRINTF("STATUS phase\n");
result = usb_bulk_msg(us->pusb_dev, pipein, &csw, UMASS_BBB_CSW_SIZE, &actlen, USB_CNTL_TIMEOUT*5);
/* special handling of STALL in STATUS phase */
if((result < 0) && (retry < 1) && (us->pusb_dev->status & USB_ST_STALLED)) {
USB_STOR_PRINTF("STATUS:stall\n");
/* clear the STALL on the endpoint */
result = usb_stor_BBB_clear_endpt_stall(us, us->ep_in);
if (result >= 0 && (retry++ < 1))
/* do a retry */
goto again;
}
if (result < 0) {
USB_STOR_PRINTF("usb_bulk_msg error status %ld\n",
us->pusb_dev->status);
usb_stor_BBB_reset(us);
return USB_STOR_TRANSPORT_FAILED;
}
#ifdef BBB_XPORT_TRACE
ptr = (unsigned char *)&csw;
for (index = 0; index < UMASS_BBB_CSW_SIZE; index++)
printf("ptr[%d] %#x ", index, ptr[index]);
printf("\n");
#endif
/* misuse pipe to get the residue */
pipe = swap_32(csw.dCSWDataResidue);
if (pipe == 0 && srb->datalen != 0 && srb->datalen - data_actlen != 0)
pipe = srb->datalen - data_actlen;
if (CSWSIGNATURE != swap_32(csw.dCSWSignature)) {
USB_STOR_PRINTF("!CSWSIGNATURE\n");
usb_stor_BBB_reset(us);
return USB_STOR_TRANSPORT_FAILED;
} else if ((CBWTag - 1) != swap_32(csw.dCSWTag)) {
USB_STOR_PRINTF("!Tag\n");
usb_stor_BBB_reset(us);
return USB_STOR_TRANSPORT_FAILED;
} else if (csw.bCSWStatus > CSWSTATUS_PHASE) {
USB_STOR_PRINTF(">PHASE\n");
usb_stor_BBB_reset(us);
return USB_STOR_TRANSPORT_FAILED;
} else if (csw.bCSWStatus == CSWSTATUS_PHASE) {
USB_STOR_PRINTF("=PHASE\n");
usb_stor_BBB_reset(us);
return USB_STOR_TRANSPORT_FAILED;
} else if (data_actlen > srb->datalen) {
USB_STOR_PRINTF("transferred %dB instead of %dB\n",
data_actlen, srb->datalen);
return USB_STOR_TRANSPORT_FAILED;
} else if (csw.bCSWStatus == CSWSTATUS_FAILED) {
USB_STOR_PRINTF("FAILED\n");
return USB_STOR_TRANSPORT_FAILED;
}
return result;
}
int usb_stor_CB_transport(ccb *srb, struct us_data *us)
{
int result,status;
@ -495,29 +763,28 @@ do_retry:
return USB_STOR_TRANSPORT_GOOD;
/* Check the auto request result */
switch(srb->sense_buf[2]) {
case 0x01: /* Recovered Error */
return USB_STOR_TRANSPORT_GOOD;
break;
case 0x02: /* Not Ready */
if(notready++ > USB_TRANSPORT_NOT_READY_RETRY) {
printf("cmd 0x%02X returned 0x%02X 0x%02X 0x%02X 0x%02X (NOT READY)\n",
srb->cmd[0],srb->sense_buf[0],srb->sense_buf[2],srb->sense_buf[12],srb->sense_buf[13]);
return USB_STOR_TRANSPORT_FAILED;
}
else {
wait_ms(100);
goto do_retry;
}
break;
default:
if(retry++ > USB_TRANSPORT_UNKNOWN_RETRY) {
printf("cmd 0x%02X returned 0x%02X 0x%02X 0x%02X 0x%02X\n",
srb->cmd[0],srb->sense_buf[0],srb->sense_buf[2],srb->sense_buf[12],srb->sense_buf[13]);
return USB_STOR_TRANSPORT_FAILED;
}
else
goto do_retry;
break;
case 0x01: /* Recovered Error */
return USB_STOR_TRANSPORT_GOOD;
break;
case 0x02: /* Not Ready */
if(notready++ > USB_TRANSPORT_NOT_READY_RETRY) {
printf("cmd 0x%02X returned 0x%02X 0x%02X 0x%02X 0x%02X (NOT READY)\n",
srb->cmd[0],srb->sense_buf[0],srb->sense_buf[2],srb->sense_buf[12],srb->sense_buf[13]);
return USB_STOR_TRANSPORT_FAILED;
} else {
wait_ms(100);
goto do_retry;
}
break;
default:
if(retry++ > USB_TRANSPORT_UNKNOWN_RETRY) {
printf("cmd 0x%02X returned 0x%02X 0x%02X 0x%02X 0x%02X\n",
srb->cmd[0],srb->sense_buf[0],srb->sense_buf[2],srb->sense_buf[12],srb->sense_buf[13]);
return USB_STOR_TRANSPORT_FAILED;
} else {
goto do_retry;
}
break;
}
return USB_STOR_TRANSPORT_FAILED;
}
@ -538,7 +805,8 @@ static int usb_inquiry(ccb *srb,struct us_data *ss)
USB_STOR_PRINTF("inquiry returns %d\n",i);
if(i==0)
break;
}while(retry--);
} while(retry--);
if(!retry) {
printf("error in inquiry\n");
return -1;
@ -567,17 +835,18 @@ static int usb_request_sense(ccb *srb,struct us_data *ss)
static int usb_test_unit_ready(ccb *srb,struct us_data *ss)
{
int retries=10;
do {
memset(&srb->cmd[0],0,12);
srb->cmd[0]=SCSI_TST_U_RDY;
srb->cmd[1]=srb->lun<<5;
srb->datalen=0;
srb->cmdlen=12;
if(ss->transport(srb,ss)==USB_STOR_TRANSPORT_GOOD)
{
if(ss->transport(srb,ss)==USB_STOR_TRANSPORT_GOOD) {
return 0;
}
} while(retries--);
return -1;
}
@ -594,7 +863,8 @@ static int usb_read_capacity(ccb *srb,struct us_data *ss)
if(ss->transport(srb,ss)==USB_STOR_TRANSPORT_GOOD) {
return 0;
}
}while(retry--);
} while(retry--);
return -1;
}
@ -654,8 +924,7 @@ unsigned long usb_stor_read(int device, unsigned long blknr, unsigned long blkcn
srb->pdata=(unsigned char *)buf_addr;
if(blks>USB_MAX_READ_BLK) {
smallblks=USB_MAX_READ_BLK;
}
else {
} else {
smallblks=(unsigned short) blks;
}
retry_it:
@ -751,6 +1020,11 @@ int usb_storage_probe(struct usb_device *dev, unsigned int ifnum,struct us_data
ss->transport = usb_stor_CB_transport;
ss->transport_reset = usb_stor_CB_reset;
break;
case US_PR_BULK:
USB_STOR_PRINTF("Bulk/Bulk/Bulk\n");
ss->transport = usb_stor_BBB_transport;
ss->transport_reset = usb_stor_BBB_reset;
break;
default:
printf("USB Starage Transport unknown / not yet implemented\n");
return 0;
@ -793,15 +1067,14 @@ int usb_storage_probe(struct usb_device *dev, unsigned int ifnum,struct us_data
return 0;
}
/* set class specific stuff */
/* We only handle certain protocols. Currently, this is
* the only one.
/* We only handle certain protocols. Currently, these are
* the only ones.
*/
if (ss->subclass != US_SC_UFI) {
if (ss->subclass != US_SC_UFI && ss->subclass != US_SC_SCSI) {
printf("Sorry, protocol %d not yet supported.\n",ss->subclass);
return 0;
}
if(ss->ep_int) /* we had found an interrupt endpoint, prepare irq pipe */
{
if(ss->ep_int) { /* we had found an interrupt endpoint, prepare irq pipe */
/* set up the IRQ pipe and handler */
ss->irqinterval = (ss->irqinterval > 0) ? ss->irqinterval : 255;
@ -865,6 +1138,19 @@ int usb_stor_get_info(struct usb_device *dev,struct us_data *ss,block_dev_desc_t
if(cap[0]>(0x200000 * 10)) /* greater than 10 GByte */
cap[0]>>=16;
#endif
#ifdef LITTLEENDIAN
cap[0] = ((unsigned long)(
(((unsigned long)(cap[0]) & (unsigned long)0x000000ffUL) << 24) |
(((unsigned long)(cap[0]) & (unsigned long)0x0000ff00UL) << 8) |
(((unsigned long)(cap[0]) & (unsigned long)0x00ff0000UL) >> 8) |
(((unsigned long)(cap[0]) & (unsigned long)0xff000000UL) >> 24) ));
cap[1] = ((unsigned long)(
(((unsigned long)(cap[1]) & (unsigned long)0x000000ffUL) << 24) |
(((unsigned long)(cap[1]) & (unsigned long)0x0000ff00UL) << 8) |
(((unsigned long)(cap[1]) & (unsigned long)0x00ff0000UL) >> 8) |
(((unsigned long)(cap[1]) & (unsigned long)0xff000000UL) >> 24) ));
#endif
/* this assumes bigendian! */
cap[0]+=1;
capacity=&cap[0];
blksz=&cap[1];
@ -881,5 +1167,5 @@ int usb_stor_get_info(struct usb_device *dev,struct us_data *ss,block_dev_desc_t
return 1;
}
#endif
#endif /* CONFIG_USB_STORAGE */
#endif /* CFG_CMD_USB */

View file

@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk
LIB = lib$(CPU).a
START = start.o
OBJS = serial.o interrupts.o cpu.o speed.o
OBJS = serial.o interrupts.o cpu.o speed.o usb_ohci.o
all: .depend $(START) $(LIB)

1553
cpu/arm920t/usb_ohci.c Normal file

File diff suppressed because it is too large Load diff

420
cpu/arm920t/usb_ohci.h Normal file
View file

@ -0,0 +1,420 @@
/*
* URB OHCI HCD (Host Controller Driver) for USB.
*
* (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at>
* (C) Copyright 2000-2001 David Brownell <dbrownell@users.sourceforge.net>
*
* usb-ohci.h
*/
static int cc_to_error[16] = {
/* mapping of the OHCI CC status to error codes */
/* No Error */ 0,
/* CRC Error */ USB_ST_CRC_ERR,
/* Bit Stuff */ USB_ST_BIT_ERR,
/* Data Togg */ USB_ST_CRC_ERR,
/* Stall */ USB_ST_STALLED,
/* DevNotResp */ -1,
/* PIDCheck */ USB_ST_BIT_ERR,
/* UnExpPID */ USB_ST_BIT_ERR,
/* DataOver */ USB_ST_BUF_ERR,
/* DataUnder */ USB_ST_BUF_ERR,
/* reservd */ -1,
/* reservd */ -1,
/* BufferOver */ USB_ST_BUF_ERR,
/* BuffUnder */ USB_ST_BUF_ERR,
/* Not Access */ -1,
/* Not Access */ -1
};
/* ED States */
#define ED_NEW 0x00
#define ED_UNLINK 0x01
#define ED_OPER 0x02
#define ED_DEL 0x04
#define ED_URB_DEL 0x08
/* usb_ohci_ed */
struct ed {
__u32 hwINFO;
__u32 hwTailP;
__u32 hwHeadP;
__u32 hwNextED;
struct ed *ed_prev;
__u8 int_period;
__u8 int_branch;
__u8 int_load;
__u8 int_interval;
__u8 state;
__u8 type;
__u16 last_iso;
struct ed *ed_rm_list;
struct usb_device *usb_dev;
__u32 unused[3];
} __attribute((aligned(16)));
typedef struct ed ed_t;
/* TD info field */
#define TD_CC 0xf0000000
#define TD_CC_GET(td_p) ((td_p >>28) & 0x0f)
#define TD_CC_SET(td_p, cc) (td_p) = ((td_p) & 0x0fffffff) | (((cc) & 0x0f) << 28)
#define TD_EC 0x0C000000
#define TD_T 0x03000000
#define TD_T_DATA0 0x02000000
#define TD_T_DATA1 0x03000000
#define TD_T_TOGGLE 0x00000000
#define TD_R 0x00040000
#define TD_DI 0x00E00000
#define TD_DI_SET(X) (((X) & 0x07)<< 21)
#define TD_DP 0x00180000
#define TD_DP_SETUP 0x00000000
#define TD_DP_IN 0x00100000
#define TD_DP_OUT 0x00080000
#define TD_ISO 0x00010000
#define TD_DEL 0x00020000
/* CC Codes */
#define TD_CC_NOERROR 0x00
#define TD_CC_CRC 0x01
#define TD_CC_BITSTUFFING 0x02
#define TD_CC_DATATOGGLEM 0x03
#define TD_CC_STALL 0x04
#define TD_DEVNOTRESP 0x05
#define TD_PIDCHECKFAIL 0x06
#define TD_UNEXPECTEDPID 0x07
#define TD_DATAOVERRUN 0x08
#define TD_DATAUNDERRUN 0x09
#define TD_BUFFEROVERRUN 0x0C
#define TD_BUFFERUNDERRUN 0x0D
#define TD_NOTACCESSED 0x0F
#define MAXPSW 1
struct td {
__u32 hwINFO;
__u32 hwCBP; /* Current Buffer Pointer */
__u32 hwNextTD; /* Next TD Pointer */
__u32 hwBE; /* Memory Buffer End Pointer */
__u16 hwPSW[MAXPSW];
__u8 unused;
__u8 index;
struct ed *ed;
struct td *next_dl_td;
struct usb_device *usb_dev;
int transfer_len;
__u32 data;
__u32 unused2[2];
} __attribute((aligned(32)));
typedef struct td td_t;
#define OHCI_ED_SKIP (1 << 14)
/*
* The HCCA (Host Controller Communications Area) is a 256 byte
* structure defined in the OHCI spec. that the host controller is
* told the base address of. It must be 256-byte aligned.
*/
#define NUM_INTS 32 /* part of the OHCI standard */
struct ohci_hcca {
__u32 int_table[NUM_INTS]; /* Interrupt ED table */
__u16 frame_no; /* current frame number */
__u16 pad1; /* set to 0 on each frame_no change */
__u32 done_head; /* info returned for an interrupt */
u8 reserved_for_hc[116];
} __attribute((aligned(256)));
/*
* Maximum number of root hub ports.
*/
#define MAX_ROOT_PORTS 15 /* maximum OHCI root hub ports */
/*
* This is the structure of the OHCI controller's memory mapped I/O
* region. This is Memory Mapped I/O. You must use the readl() and
* writel() macros defined in asm/io.h to access these!!
*/
struct ohci_regs {
/* control and status registers */
__u32 revision;
__u32 control;
__u32 cmdstatus;
__u32 intrstatus;
__u32 intrenable;
__u32 intrdisable;
/* memory pointers */
__u32 hcca;
__u32 ed_periodcurrent;
__u32 ed_controlhead;
__u32 ed_controlcurrent;
__u32 ed_bulkhead;
__u32 ed_bulkcurrent;
__u32 donehead;
/* frame counters */
__u32 fminterval;
__u32 fmremaining;
__u32 fmnumber;
__u32 periodicstart;
__u32 lsthresh;
/* Root hub ports */
struct ohci_roothub_regs {
__u32 a;
__u32 b;
__u32 status;
__u32 portstatus[MAX_ROOT_PORTS];
} roothub;
} __attribute((aligned(32)));
/* OHCI CONTROL AND STATUS REGISTER MASKS */
/*
* HcControl (control) register masks
*/
#define OHCI_CTRL_CBSR (3 << 0) /* control/bulk service ratio */
#define OHCI_CTRL_PLE (1 << 2) /* periodic list enable */
#define OHCI_CTRL_IE (1 << 3) /* isochronous enable */
#define OHCI_CTRL_CLE (1 << 4) /* control list enable */
#define OHCI_CTRL_BLE (1 << 5) /* bulk list enable */
#define OHCI_CTRL_HCFS (3 << 6) /* host controller functional state */
#define OHCI_CTRL_IR (1 << 8) /* interrupt routing */
#define OHCI_CTRL_RWC (1 << 9) /* remote wakeup connected */
#define OHCI_CTRL_RWE (1 << 10) /* remote wakeup enable */
/* pre-shifted values for HCFS */
# define OHCI_USB_RESET (0 << 6)
# define OHCI_USB_RESUME (1 << 6)
# define OHCI_USB_OPER (2 << 6)
# define OHCI_USB_SUSPEND (3 << 6)
/*
* HcCommandStatus (cmdstatus) register masks
*/
#define OHCI_HCR (1 << 0) /* host controller reset */
#define OHCI_CLF (1 << 1) /* control list filled */
#define OHCI_BLF (1 << 2) /* bulk list filled */
#define OHCI_OCR (1 << 3) /* ownership change request */
#define OHCI_SOC (3 << 16) /* scheduling overrun count */
/*
* masks used with interrupt registers:
* HcInterruptStatus (intrstatus)
* HcInterruptEnable (intrenable)
* HcInterruptDisable (intrdisable)
*/
#define OHCI_INTR_SO (1 << 0) /* scheduling overrun */
#define OHCI_INTR_WDH (1 << 1) /* writeback of done_head */
#define OHCI_INTR_SF (1 << 2) /* start frame */
#define OHCI_INTR_RD (1 << 3) /* resume detect */
#define OHCI_INTR_UE (1 << 4) /* unrecoverable error */
#define OHCI_INTR_FNO (1 << 5) /* frame number overflow */
#define OHCI_INTR_RHSC (1 << 6) /* root hub status change */
#define OHCI_INTR_OC (1 << 30) /* ownership change */
#define OHCI_INTR_MIE (1 << 31) /* master interrupt enable */
/* Virtual Root HUB */
struct virt_root_hub {
int devnum; /* Address of Root Hub endpoint */
void *dev; /* was urb */
void *int_addr;
int send;
int interval;
};
/* USB HUB CONSTANTS (not OHCI-specific; see hub.h) */
/* destination of request */
#define RH_INTERFACE 0x01
#define RH_ENDPOINT 0x02
#define RH_OTHER 0x03
#define RH_CLASS 0x20
#define RH_VENDOR 0x40
/* Requests: bRequest << 8 | bmRequestType */
#define RH_GET_STATUS 0x0080
#define RH_CLEAR_FEATURE 0x0100
#define RH_SET_FEATURE 0x0300
#define RH_SET_ADDRESS 0x0500
#define RH_GET_DESCRIPTOR 0x0680
#define RH_SET_DESCRIPTOR 0x0700
#define RH_GET_CONFIGURATION 0x0880
#define RH_SET_CONFIGURATION 0x0900
#define RH_GET_STATE 0x0280
#define RH_GET_INTERFACE 0x0A80
#define RH_SET_INTERFACE 0x0B00
#define RH_SYNC_FRAME 0x0C80
/* Our Vendor Specific Request */
#define RH_SET_EP 0x2000
/* Hub port features */
#define RH_PORT_CONNECTION 0x00
#define RH_PORT_ENABLE 0x01
#define RH_PORT_SUSPEND 0x02
#define RH_PORT_OVER_CURRENT 0x03
#define RH_PORT_RESET 0x04
#define RH_PORT_POWER 0x08
#define RH_PORT_LOW_SPEED 0x09
#define RH_C_PORT_CONNECTION 0x10
#define RH_C_PORT_ENABLE 0x11
#define RH_C_PORT_SUSPEND 0x12
#define RH_C_PORT_OVER_CURRENT 0x13
#define RH_C_PORT_RESET 0x14
/* Hub features */
#define RH_C_HUB_LOCAL_POWER 0x00
#define RH_C_HUB_OVER_CURRENT 0x01
#define RH_DEVICE_REMOTE_WAKEUP 0x00
#define RH_ENDPOINT_STALL 0x01
#define RH_ACK 0x01
#define RH_REQ_ERR -1
#define RH_NACK 0x00
/* OHCI ROOT HUB REGISTER MASKS */
/* roothub.portstatus [i] bits */
#define RH_PS_CCS 0x00000001 /* current connect status */
#define RH_PS_PES 0x00000002 /* port enable status*/
#define RH_PS_PSS 0x00000004 /* port suspend status */
#define RH_PS_POCI 0x00000008 /* port over current indicator */
#define RH_PS_PRS 0x00000010 /* port reset status */
#define RH_PS_PPS 0x00000100 /* port power status */
#define RH_PS_LSDA 0x00000200 /* low speed device attached */
#define RH_PS_CSC 0x00010000 /* connect status change */
#define RH_PS_PESC 0x00020000 /* port enable status change */
#define RH_PS_PSSC 0x00040000 /* port suspend status change */
#define RH_PS_OCIC 0x00080000 /* over current indicator change */
#define RH_PS_PRSC 0x00100000 /* port reset status change */
/* roothub.status bits */
#define RH_HS_LPS 0x00000001 /* local power status */
#define RH_HS_OCI 0x00000002 /* over current indicator */
#define RH_HS_DRWE 0x00008000 /* device remote wakeup enable */
#define RH_HS_LPSC 0x00010000 /* local power status change */
#define RH_HS_OCIC 0x00020000 /* over current indicator change */
#define RH_HS_CRWE 0x80000000 /* clear remote wakeup enable */
/* roothub.b masks */
#define RH_B_DR 0x0000ffff /* device removable flags */
#define RH_B_PPCM 0xffff0000 /* port power control mask */
/* roothub.a masks */
#define RH_A_NDP (0xff << 0) /* number of downstream ports */
#define RH_A_PSM (1 << 8) /* power switching mode */
#define RH_A_NPS (1 << 9) /* no power switching */
#define RH_A_DT (1 << 10) /* device type (mbz) */
#define RH_A_OCPM (1 << 11) /* over current protection mode */
#define RH_A_NOCP (1 << 12) /* no over current protection */
#define RH_A_POTPGT (0xff << 24) /* power on to power good time */
/* urb */
#define N_URB_TD 48
typedef struct
{
ed_t *ed;
__u16 length; /* number of tds associated with this request */
__u16 td_cnt; /* number of tds already serviced */
int state;
unsigned long pipe;
int actual_length;
td_t *td[N_URB_TD]; /* list pointer to all corresponding TDs associated with this request */
} urb_priv_t;
#define URB_DEL 1
/*
* This is the full ohci controller description
*
* Note how the "proper" USB information is just
* a subset of what the full implementation needs. (Linus)
*/
typedef struct ohci {
struct ohci_hcca *hcca; /* hcca */
/*dma_addr_t hcca_dma;*/
int irq;
int disabled; /* e.g. got a UE, we're hung */
int sleeping;
unsigned long flags; /* for HC bugs */
struct ohci_regs *regs; /* OHCI controller's memory */
ed_t *ed_rm_list[2]; /* lists of all endpoints to be removed */
ed_t *ed_bulktail; /* last endpoint of bulk list */
ed_t *ed_controltail; /* last endpoint of control list */
int intrstatus;
__u32 hc_control; /* copy of the hc control reg */
struct usb_device *dev[32];
struct virt_root_hub rh;
const char *slot_name;
} ohci_t;
#define NUM_EDS 8 /* num of preallocated endpoint descriptors */
struct ohci_device {
ed_t ed[NUM_EDS];
int ed_cnt;
};
/* hcd */
/* endpoint */
static int ep_link(ohci_t * ohci, ed_t * ed);
static int ep_unlink(ohci_t * ohci, ed_t * ed);
static ed_t * ep_add_ed(struct usb_device * usb_dev, unsigned long pipe);
/*-------------------------------------------------------------------------*/
/* we need more TDs than EDs */
#define NUM_TD 64
/* +1 so we can align the storage */
td_t gtd[NUM_TD+1];
/* pointers to aligned storage */
td_t *ptd;
/* TDs ... */
static inline struct td *
td_alloc (struct usb_device *usb_dev)
{
int i;
struct td *td;
td = NULL;
for (i = 0; i < NUM_TD; i++)
{
if (ptd[i].usb_dev == NULL)
{
td = &ptd[i];
td->usb_dev = usb_dev;
break;
}
}
return td;
}
static inline void
ed_free (struct ed *ed)
{
ed->usb_dev = NULL;
}

View file

@ -83,7 +83,7 @@
#if defined(CONFIG_405GP) || defined(CONFIG_440) || defined(CONFIG_405EP)
#define EMAC_RESET_TIMEOUT 1000 /* 1000 ms reset timeout */
#define PHY_AUTONEGOTIATE_TIMEOUT 2000 /* 2000 ms autonegotiate timeout */
#define PHY_AUTONEGOTIATE_TIMEOUT 4000 /* 4000 ms autonegotiate timeout */
#define NUM_TX_BUFF 1
/* AS.HARNOIS
@ -271,18 +271,18 @@ static int ppc_4xx_eth_init (struct eth_device *dev, bd_t * bis)
puts ("Waiting for PHY auto negotiation to complete");
i = 0;
while (!(reg_short & PHY_BMSR_AUTN_COMP)) {
if ((i++ % 100) == 0)
putc ('.');
udelay (10000); /* 10 ms */
miiphy_read (CONFIG_PHY_ADDR, PHY_BMSR, &reg_short);
/*
* Timeout reached ?
*/
if (i * 10 > PHY_AUTONEGOTIATE_TIMEOUT) {
if (i > PHY_AUTONEGOTIATE_TIMEOUT) {
puts (" TIMEOUT !\n");
break;
}
if ((i++ % 1000) == 0)
putc ('.');
udelay (1000); /* 1 ms */
miiphy_read (CONFIG_PHY_ADDR, PHY_BMSR, &reg_short);
}
puts (" done\n");
udelay (500000); /* another 500 ms (results in faster booting) */

View file

@ -33,7 +33,9 @@
#define PRINTF(fmt,args...)
#endif
#if (CONFIG_COMMANDS & CFG_CMD_IDE) || (CONFIG_COMMANDS & CFG_CMD_SCSI)
#if ((CONFIG_COMMANDS & CFG_CMD_IDE) || \
(CONFIG_COMMANDS & CFG_CMD_SCSI) || \
(CONFIG_COMMANDS & CFG_CMD_USB) )
/* ------------------------------------------------------------------------- */
/*

View file

@ -35,7 +35,9 @@
#include <ide.h>
#include "part_dos.h"
#if ((CONFIG_COMMANDS & CFG_CMD_IDE) || (CONFIG_COMMANDS & CFG_CMD_SCSI)) && defined(CONFIG_DOS_PARTITION)
#if ((CONFIG_COMMANDS & CFG_CMD_IDE) || \
(CONFIG_COMMANDS & CFG_CMD_SCSI) || \
(CONFIG_COMMANDS & CFG_CMD_USB) ) && defined(CONFIG_DOS_PARTITION)
/* Convert char[4] in little endian format to the host format integer
*/

View file

@ -161,6 +161,8 @@ typedef struct s_Sensor SK_SENSOR;
/*
* Define READ and WRITE Constants.
*/
#undef I2C_READ /* just in case */
#undef I2C_WRITE /* just in case */
#define I2C_READ 0
#define I2C_WRITE 1
#define I2C_BURST 1

View file

@ -218,6 +218,10 @@
*
******************************************************************************/
#include <config.h>
#ifdef CONFIG_SK98
#ifndef lint
static const char SysKonnectFileId[] =
"@(#) $Id: skaddr.c,v 1.48 2003/02/12 17:09:37 tschilli Exp $ (C) SysKonnect.";
@ -1872,3 +1876,4 @@ SK_U32 ToPortNumber) /* Port2 Index */
}
#endif /* __cplusplus */
#endif /* CONFIG_SK98 */

View file

@ -70,6 +70,10 @@
*
******************************************************************************/
#include <config.h>
#ifdef CONFIG_SK98
#ifdef SK_USE_CSUM /* Check if CSUM is to be used. */
#ifndef lint
@ -921,3 +925,5 @@ SK_EVPARA Param) /* Event dependent parameter. */
} /* SkCsEvent */
#endif /* SK_USE_CSUM */
#endif /* CONFIG_SK98 */

View file

@ -340,6 +340,10 @@
*
******************************************************************************/
#include <config.h>
#ifdef CONFIG_SK98
#include "h/skversion.h"
#if 0
#include <linux/module.h>
@ -4862,6 +4866,8 @@ int l;
#endif
#endif /* CONFIG_SK98 */
/*
* Local variables:
* compile-command: "make"

View file

@ -73,6 +73,10 @@
******************************************************************************/
#include <config.h>
#ifdef CONFIG_SK98
/*
Event queue and dispatcher
*/
@ -211,4 +215,6 @@ SK_IOC Ioc) /* IoContext */
SkTimerDone(pAC,Ioc) ;
}
#endif /* CONFIG_SK98 */
/* End of file */

View file

@ -393,6 +393,10 @@
*
******************************************************************************/
#include <config.h>
#ifdef CONFIG_SK98
#include "h/skdrv1st.h"
#include "h/skdrv2nd.h"
@ -2364,3 +2368,5 @@ int Port) /* Port to configure */
return(0);
} /* SkGeInitPort */
#endif /* CONFIG_SK98 */

View file

@ -50,6 +50,10 @@
*
****************************************************************************/
#include <config.h>
#ifdef CONFIG_SK98
/*
* PRIVATE OID handler function prototypes
*/
@ -1054,3 +1058,4 @@ PNMI_STATIC const SK_PNMI_TAB_ENTRY IdTable[] = {
SK_PNMI_RO, Vct, 0},
};
#endif /* CONFIG_SK98 */

View file

@ -432,6 +432,10 @@
****************************************************************************/
#include <config.h>
#ifdef CONFIG_SK98
static const char SysKonnectFileId[] =
"@(#) $Id: skgepnmi.c,v 1.102 2002/12/16 14:03:24 tschilli Exp $"
" (C) SysKonnect.";
@ -8303,3 +8307,5 @@ SK_U32 PhysPortIndex)
}
} /* CheckVctStatus */
#endif /* CONFIG_SK98 */

View file

@ -337,6 +337,10 @@
*
******************************************************************************/
#include <config.h>
#ifdef CONFIG_SK98
/*
* Special Interrupt handler
*
@ -2408,4 +2412,6 @@ SK_U16 IStatus) /* Interrupt Status */
} /* SkPhyIsrLone */
#endif /* OTHER_PHY */
#endif /* CONFIG_SK98 */
/* End of File */

View file

@ -228,6 +228,10 @@
******************************************************************************/
#include <config.h>
#ifdef CONFIG_SK98
/*
* I2C Protocol
*/
@ -1497,3 +1501,5 @@ SK_EVPARA Para) /* Event specific Parameter */
} /* SkI2cEvent*/
#endif /* !SK_DIAG */
#endif /* CONFIG_SK98 */

View file

@ -98,6 +98,10 @@
******************************************************************************/
#include <config.h>
#ifdef CONFIG_SK98
/*
LM80 functions
*/
@ -284,3 +288,5 @@ SK_SENSOR *pSen) /* Sensor to be read */
/* Not completed */
return(0);
}
#endif /* CONFIG_SK98 */

View file

@ -70,6 +70,10 @@
*
******************************************************************************/
#include <config.h>
#ifdef CONFIG_SK98
#include <linux/proc_fs.h>
#include "h/skdrv1st.h"
@ -511,5 +515,4 @@ char * SkNumber(char * str, long long num, int base, int size, int precision
return strorg;
}
#endif /* CONFIG_SK98 */

View file

@ -87,6 +87,10 @@
******************************************************************************/
#include <config.h>
#ifdef CONFIG_SK98
/*
Event queue and dispatcher
*/
@ -233,4 +237,6 @@ SK_IOC Ioc) /* Io context */
return(0) ;
}
#endif /* CONFIG_SK98 */
/* End of file */

View file

@ -280,6 +280,10 @@
*
******************************************************************************/
#include <config.h>
#ifdef CONFIG_SK98
#ifndef lint
static const char SysKonnectFileId[] =
"@(#) $Id: skrlmt.c,v 1.68 2003/01/31 15:26:56 rschmidt Exp $ (C) SysKonnect.";
@ -3500,3 +3504,5 @@ SK_EVPARA Para) /* Event-specific parameter */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* CONFIG_SK98 */

View file

@ -72,6 +72,10 @@
******************************************************************************/
#include <config.h>
#ifdef CONFIG_SK98
/*
Event queue and dispatcher
*/
@ -288,4 +292,6 @@ int Restart) /* Do we need to restart the Hardware timer ? */
}
}
#endif /* CONFIG_SK98 */
/* End of file */

View file

@ -160,6 +160,10 @@
*
******************************************************************************/
#include <config.h>
#ifdef CONFIG_SK98
/*
Please refer skvpd.txt for infomation how to include this module
*/
@ -1323,3 +1327,4 @@ char *msg) /* error log message */
(void)VpdUpdate(pAC, IoC);
}
#endif /* CONFIG_SK98 */

View file

@ -410,6 +410,10 @@
*
******************************************************************************/
#include <config.h>
#ifdef CONFIG_SK98
#include "h/skdrv1st.h"
#include "h/skdrv2nd.h"
@ -4389,4 +4393,6 @@ SK_BOOL StartTest) /* flag for start / get result */
return(0);
} /* SkGmCableDiagStatus */
#endif /* CONFIG_SK98 */
/* End of file */

View file

@ -23,6 +23,10 @@
* MA 02111-1307 USA
*/
#include <config.h>
#ifdef CONFIG_SK98
#include <common.h>
#include "u-boot_compat.h"
@ -114,3 +118,5 @@ void skb_put(struct sk_buff *skb, unsigned int len)
{
skb->len+=len;
}
#endif /* CONFIG_SK98 */

View file

@ -99,6 +99,7 @@
#define CONFIG_BOOTP_MASK (CONFIG_BOOTP_DEFAULT | \
CONFIG_BOOTP_BOOTFILESIZE)
#define CONFIG_TIMESTAMP /* Print image info with timestamp */
#define CONFIG_COMMANDS (CONFIG_CMD_DFL | CFG_CMD_ASKENV)

View file

@ -51,6 +51,8 @@
#define CONFIG_BOOTDELAY 5
#define CONFIG_TIMESTAMP /* Print image info with timestamp */
#define CONFIG_COMMANDS (CONFIG_CMD_DFL | CFG_CMD_PCI)
/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
@ -68,7 +70,7 @@
/* Print Buffer Size
*/
#define CFG_PBSIZE (CFG_CBSIZE + sizeof(CFG_PROMPT) + 16)
#define CFG_MAXARGS 8 /* Max number of command args */
#define CFG_MAXARGS 32 /* Max number of command args */
#define CFG_BARGSIZE CFG_CBSIZE /* Boot Argument Buffer Size */
#define CFG_LOAD_ADDR 0x00400000 /* Default load address */

View file

@ -46,8 +46,39 @@
#endif
#define CONFIG_CONS_INDEX 1
#define CONFIG_BAUDRATE 115200
#define CONFIG_DRAM_SPEED 100 /* MHz */
#define CONFIG_BAUDRATE 9600
#define CONFIG_BOOTDELAY 5 /* autoboot after 5 seconds */
#define CONFIG_TIMESTAMP /* Print image info with timestamp */
#define CONFIG_PREBOOT "echo;" \
"echo Type \"run net_nfs\" to mount root filesystem over NFS;" \
"echo"
#undef CONFIG_BOOTARGS
#define CONFIG_EXTRA_ENV_SETTINGS \
"netdev=eth0\0" \
"nfsargs=setenv bootargs root=/dev/nfs rw " \
"nfsroot=$(serverip):$(rootpath)\0" \
"ramargs=setenv bootargs root=/dev/ram rw\0" \
"addip=setenv bootargs $(bootargs) " \
"ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask)" \
":$(hostname):$(netdev):off panic=1\0" \
"net_self=tftp $(kernel_addr) $(bootfile);" \
"tftp $(ramdisk_addr) $(ramdisk);" \
"run ramargs addip;" \
"bootm $(kernel_addr) $(ramdisk_addr)\0" \
"net_nfs=tftp $(kernel_addr) $(bootfile);" \
"run nfsargs addip;bootm\0" \
"rootpath=/opt/eldk/ppc_82xx\0" \
"bootfile=/tftpboot/SP8240/uImage\0" \
"ramdisk=/tftpboot/SP8240/uRamdisk\0" \
"kernel_addr=200000\0" \
"ramdisk_addr=400000\0" \
""
#define CONFIG_BOOTCOMMAND "run flash_self"
#define CONFIG_COMMANDS ( (CONFIG_CMD_DFL & ~CFG_CMD_AUTOSCRIPT) | \
CFG_CMD_ELF | \
@ -59,6 +90,7 @@
/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
#include <cmd_confdefs.h>
#define CONFIG_DRAM_SPEED 100 /* MHz */
/*
* Miscellaneous configurable options

View file

@ -1,5 +1,5 @@
/*
* (C) Copyright 2002
* (C) Copyright 2002-2003
* Gary Jennejohn <gj@denx.de>
*
* Configuation settings for the TRAB board.
@ -40,6 +40,7 @@
#define CONFIG_S3C2400 1 /* in a SAMSUNG S3C2400 SoC */
#define CONFIG_TRAB 1 /* on a TRAB Board */
#undef CONFIG_TRAB_50MHZ /* run the CPU at 50 MHz */
#define LITTLEENDIAN 1 /* used by usb_ohci.c */
/* input clock of PLL */
#define CONFIG_SYS_CLK_FREQ 12000000 /* TRAB has 12 MHz input clock */
@ -67,6 +68,11 @@
#define CFG_EEPROM_PAGE_WRITE_BITS 3 /* 8 bytes page write mode on 24C04 */
#define CFG_EEPROM_PAGE_WRITE_DELAY_MS 10
/* USB stuff */
#define CONFIG_USB_OHCI 1
#define CONFIG_USB_STORAGE 1
#define CONFIG_DOS_PARTITION 1
/*
* Size of malloc() pool
*/
@ -139,6 +145,8 @@
CONFIG_COMMANDS_ADD_HWFLOW | \
CONFIG_COMMANDS_ADD_VFD | \
CONFIG_COMMANDS_ADD_EEPROM | \
CFG_CMD_USB | \
CFG_CMD_FAT | \
CONFIG_COMMANDS_I2C )
#else
#define CONFIG_COMMANDS (CONFIG_CMD_DFL | \
@ -147,9 +155,14 @@
CONFIG_COMMANDS_ADD_HWFLOW | \
CONFIG_COMMANDS_ADD_VFD | \
CONFIG_COMMANDS_ADD_EEPROM | \
CFG_CMD_USB | \
CFG_CMD_FAT | \
CONFIG_COMMANDS_I2C )
#endif
/* moved up */
#define CFG_HUSH_PARSER 1 /* use "hush" command parser */
/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
#include <cmd_confdefs.h>
@ -164,6 +177,28 @@
#define CONFIG_BOOTCOMMAND "run flash_nfs"
#ifndef CONFIG_BIG_FLASH
#ifdef CFG_HUSH_PARSER
#define CONFIG_EXTRA_ENV_SETTINGS \
"nfs_args=setenv bootargs root=/dev/nfs rw " \
"nfsroot=$serverip:$rootpath\0" \
"rootpath=/opt/eldk/arm_920TDI\0" \
"ram_args=setenv bootargs root=/dev/ram rw\0" \
"add_net=setenv bootargs $bootargs ethaddr=$ethaddr " \
"ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname::off\0" \
"add_misc=setenv bootargs $bootargs console=ttyS0 panic=1\0" \
"load=tftp 0xC100000 /tftpboot/TRAB/u-boot.bin\0" \
"update=protect off 1:0-8;era 1:0-8;cp.b 0xc100000 0 $filesize;" \
"setenv filesize;saveenv\0" \
"loadfile=/tftpboot/TRAB/uImage\0" \
"loadaddr=c400000\0" \
"net_load=tftpboot $loadaddr $loadfile\0" \
"net_nfs=run net_load nfs_args add_net add_misc;bootm\0" \
"kernel_addr=00040000\0" \
"flash_nfs=run nfs_args add_net add_misc;bootm $kernel_addr\0" \
"mdm_init1=ATZ\0" \
"mdm_init2=ATS0=1\0" \
"mdm_flow_control=rts/cts\0"
#else /* !CFG_HUSH_PARSER */
#define CONFIG_EXTRA_ENV_SETTINGS \
"nfs_args=setenv bootargs root=/dev/nfs rw " \
"nfsroot=$(serverip):$(rootpath)\0" \
@ -184,7 +219,29 @@
"mdm_init1=ATZ\0" \
"mdm_init2=ATS0=1\0" \
"mdm_flow_control=rts/cts\0"
#endif /* CFG_HUSH_PARSER */
#else /* CONFIG_BIG_FLASH */
#ifdef CFG_HUSH_PARSER
#define CONFIG_EXTRA_ENV_SETTINGS \
"nfs_args=setenv bootargs root=/dev/nfs rw " \
"nfsroot=$serverip:$rootpath\0" \
"rootpath=/opt/eldk/arm_920TDI\0" \
"ram_args=setenv bootargs root=/dev/ram rw\0" \
"add_net=setenv bootargs $bootargs ethaddr=$ethaddr " \
"ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname::off\0" \
"add_misc=setenv bootargs $bootargs console=ttyS0 panic=1\0" \
"load=tftp 0xC100000 /tftpboot/TRAB/u-boot.bin\0" \
"update=protect off 1:0;era 1:0;cp.b 0xc100000 0 $filesize\0" \
"loadfile=/tftpboot/TRAB/uImage\0" \
"loadaddr=c400000\0" \
"net_load=tftpboot $loadaddr $loadfile\0" \
"net_nfs=run net_load nfs_args add_net add_misc;bootm\0" \
"kernel_addr=00040000\0" \
"flash_nfs=run nfs_args add_net add_misc;bootm $kernel_addr\0" \
"mdm_init1=ATZ\0" \
"mdm_init2=ATS0=1\0" \
"mdm_flow_control=rts/cts\0"
#else /* !CFG_HUSH_PARSER */
#define CONFIG_EXTRA_ENV_SETTINGS \
"nfs_args=setenv bootargs root=/dev/nfs rw " \
"nfsroot=$(serverip):$(rootpath)\0" \
@ -204,6 +261,7 @@
"mdm_init1=ATZ\0" \
"mdm_init2=ATS0=1\0" \
"mdm_flow_control=rts/cts\0"
#endif /* CFG_HUSH_PARSER */
#endif /* CONFIG_BIG_FLASH */
#if 0 /* disabled for development */
@ -223,7 +281,6 @@
*/
#define CFG_LONGHELP /* undef to save memory */
#define CFG_PROMPT "TRAB # " /* Monitor Command Prompt */
/* #define CFG_HUSH_PARSER 1 */ /* use "hush" command parser */
#ifdef CFG_HUSH_PARSER
#define CFG_PROMPT_HUSH_PS2 "> "
#endif

View file

@ -169,7 +169,7 @@ struct usb_device {
* this is how the lowlevel part communicate with the outer world
*/
#ifdef CONFIG_USB_UHCI
#if defined(CONFIG_USB_UHCI) || defined(CONFIG_USB_OHCI)
int usb_lowlevel_init(void);
int usb_lowlevel_stop(void);
int submit_bulk_msg(struct usb_device *dev, unsigned long pipe, void *buffer,int transfer_len);
@ -228,6 +228,11 @@ int usb_string(struct usb_device *dev, int index, char *buf, size_t size);
int usb_set_interface(struct usb_device *dev, int interface, int alternate);
/* big endian -> little endian conversion */
/* some CPUs are already little endian e.g. the ARM920T */
#ifdef LITTLEENDIAN
#define swap_16(x) ((unsigned short)(x))
#define swap_32(x) ((unsigned long)(x))
#else
#define swap_16(x) \
((unsigned short)( \
(((unsigned short)(x) & (unsigned short)0x00ffU) << 8) | \
@ -238,6 +243,7 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate);
(((unsigned long)(x) & (unsigned long)0x0000ff00UL) << 8) | \
(((unsigned long)(x) & (unsigned long)0x00ff0000UL) >> 8) | \
(((unsigned long)(x) & (unsigned long)0xff000000UL) >> 24) ))
#endif /* LITTLEENDIAN */
/*
* Calling this entity a "pipe" is glorifying it. A USB pipe