From a2663ea4fc9d18cb8000c97ed92c3c668eda8e04 Mon Sep 17 00:00:00 2001 From: wdenk Date: Sun, 7 Dec 2003 18:32:37 +0000 Subject: =?UTF-8?q?*=20Patches=20by=20David=20M=FCller,=2014=20Nov=202003:?= =?UTF-8?q?=20=20=20-=20board/mpl/common/common=5Futil.c=20=20=20=20=20*?= =?UTF-8?q?=20implement=20support=20for=20BZIP2=20compressed=20images=20?= =?UTF-8?q?=20=20=20=20*=20various=20cleanups=20(printf=20->=20puts,=20...?= =?UTF-8?q?)=20=20=20-=20board/mpl/common/flash.c=20=20=20=20=20*=20report?= =?UTF-8?q?=20correct=20errors=20to=20upper=20layers=20=20=20=20=20*=20che?= =?UTF-8?q?ck=20the=20erase=20fail=20and=20VPP=20low=20bits=20in=20status?= =?UTF-8?q?=20reg=20=20=20-=20board/mpl/vcma9/cmd=5Fvcma9.c=20=20=20-=20bo?= =?UTF-8?q?ard/mpl/vcma9/flash.c=20=20=20=20=20*=20various=20cleanups=20(p?= =?UTF-8?q?rintf=20->=20puts,=20...)=20=20=20-=20common/cmd=5Fusb.c=20=20?= =?UTF-8?q?=20=20=20*=20fix=20typo=20in=20comment=20=20=20-=20cpu/arm920t/?= =?UTF-8?q?usb=5Fohci.c=20=20=20=20=20*=20support=20for=20S3C2410=20is=20m?= =?UTF-8?q?issing=20in=20#if=20line=20=20=20-=20drivers/cs8900.c=20=20=20?= =?UTF-8?q?=20=20*=20reinit=20some=20registers=20in=20case=20of=20error=20?= =?UTF-8?q?(cable=20missing,=20...)=20=20=20-=20fs/fat/fat.c=20=20=20=20?= =?UTF-8?q?=20*=20support=20for=20USB/MMC=20devices=20is=20missing=20in=20?= =?UTF-8?q?#if=20line=20=20=20-=20include/configs/MIP405.h=20=20=20-=20inc?= =?UTF-8?q?lude/configs/PIP405.h=20=20=20=20=20*=20enable=20BZIP2=20suppor?= =?UTF-8?q?t=20=20=20=20=20*=20enlarge=20malloc=20space=20to=201MiB=20beca?= =?UTF-8?q?use=20of=20BZIP2=20support=20=20=20-=20include/configs/VCMA9.h?= =?UTF-8?q?=20=20=20=20=20*=20enable=20BZIP2=20support=20=20=20=20=20*=20e?= =?UTF-8?q?nlarge=20malloc=20space=20to=201MiB=20because=20of=20BZIP2=20su?= =?UTF-8?q?pport=20=20=20=20=20*=20enable=20USB=20support=20=20=20-=20lib?= =?UTF-8?q?=5Farm/armlinux.c=20=20=20=20=20*=20change=20calling=20conventi?= =?UTF-8?q?on=20of=20ARM=20Linux=20kernel=20as=20=20=20=20=20=20=20describ?= =?UTF-8?q?ed=20on=20http://www.arm.linux.org.uk/developer/booting.php?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Patch by Thomas Lange, 14 Nov 2003: Split dbau1x00 into dbau1000, dbau1100 and dbau1500 configs to support all these AMD boards. * Patch by Thomas Lange, 14 Nov 2003: Workaround for mips au1x00 physical memory accesses (the au1x00 uses a 36 bit bus internally and cannot access physical memory directly. Use the uncached SDRAM address instead of the physical one.) --- drivers/cs8900.c | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) (limited to 'drivers') diff --git a/drivers/cs8900.c b/drivers/cs8900.c index d35332c..082434c 100644 --- a/drivers/cs8900.c +++ b/drivers/cs8900.c @@ -45,6 +45,7 @@ #if (CONFIG_COMMANDS & CFG_CMD_NET) +#undef DEBUG /* packet page register access functions */ @@ -99,6 +100,20 @@ static void eth_reset (void) /*NOP*/; } +static void eth_reginit (void) +{ + /* receive only error free packets addressed to this card */ + put_reg (PP_RxCTL, PP_RxCTL_IA | PP_RxCTL_Broadcast | PP_RxCTL_RxOK); + /* do not generate any interrupts on receive operations */ + put_reg (PP_RxCFG, 0); + /* do not generate any interrupts on transmit operations */ + put_reg (PP_TxCFG, 0); + /* do not generate any interrupts on buffer operations */ + put_reg (PP_BufCFG, 0); + /* enable transmitter/receiver mode */ + put_reg (PP_LineCTL, PP_LineCTL_Rx | PP_LineCTL_Tx); +} + void cs8900_get_enetaddr (uchar * addr) { int i; @@ -181,21 +196,7 @@ int eth_init (bd_t * bd) put_reg (PP_IA + 2, bd->bi_enetaddr[2] | (bd->bi_enetaddr[3] << 8)); put_reg (PP_IA + 4, bd->bi_enetaddr[4] | (bd->bi_enetaddr[5] << 8)); - /* receive only error free packets addressed to this card */ - put_reg (PP_RxCTL, PP_RxCTL_IA | PP_RxCTL_Broadcast | PP_RxCTL_RxOK); - - /* do not generate any interrupts on receive operations */ - put_reg (PP_RxCFG, 0); - - /* do not generate any interrupts on transmit operations */ - put_reg (PP_TxCFG, 0); - - /* do not generate any interrupts on buffer operations */ - put_reg (PP_BufCFG, 0); - - /* enable transmitter/receiver mode */ - put_reg (PP_LineCTL, PP_LineCTL_Rx | PP_LineCTL_Tx); - + eth_reginit (); return 0; } @@ -215,9 +216,10 @@ extern int eth_rx (void) status = CS8900_RTDATA; /* stat */ rxlen = CS8900_RTDATA; /* len */ +#ifdef DEBUG if (rxlen > PKTSIZE_ALIGN + PKTALIGN) printf ("packet too big!\n"); - +#endif for (addr = (unsigned short *) NetRxPackets[0], i = rxlen >> 1; i > 0; i--) *addr++ = CS8900_RTDATA; @@ -245,10 +247,13 @@ retry: /* Test to see if the chip has allocated memory for the packet */ if ((get_reg (PP_BusSTAT) & PP_BusSTAT_TxRDY) == 0) { /* Oops... this should not happen! */ +#ifdef DEBUG printf ("cs: unable to send packet; retrying...\n"); +#endif for (tmo = get_timer (0) + 5 * CFG_HZ; get_timer (0) < tmo;) /*NOP*/; eth_reset (); + eth_reginit (); goto retry; } @@ -266,7 +271,9 @@ retry: /* nothing */ ; if ((s & (PP_TER_CRS | PP_TER_TxOK)) != PP_TER_TxOK) { +#ifdef DEBUG printf ("\ntransmission error %#x\n", s); +#endif } return 0; -- cgit v1.1