]> www.infradead.org Git - users/rw/ppcboot.git/commitdiff
Fix bug in MPC824x I2C driver
authorwdenk <wdenk>
Wed, 13 Feb 2002 19:31:55 +0000 (19:31 +0000)
committerwdenk <wdenk>
Wed, 13 Feb 2002 19:31:55 +0000 (19:31 +0000)
Fix CONFIG_IDE renames for RPXClassic
Fix ethernet port switching on SP8240

CHANGELOG
common/board.c
cpu/mpc824x/drivers/i2c/i2c1.c
include/config_RPXClassic.h
include/config_Sandpoint8245.h
net/arp.c
net/bootp.c
net/net.c
net/rarp.c

index be4b3341440c77793e008e3328b9784deb5fd824..5864f4793600e33d2848238724e589353e33c6d1 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -2,6 +2,9 @@
 Modifications for 1.1.5:
 ======================================================================
 
+* Fix output for CFG_FLASH_CHECKSUM
+  (based on patch by Greg Allen, 12 Feb 2002
+
 * Patch by Jonathan De Bruyne, 01 Feb 2002:
   Add support for Siemens IAD210 board
 
index 047ee106f31b5b00e41e9f06701b793a01816f74..cb1dfea7aa9046081ccafaad273b7311a085f737 100644 (file)
@@ -598,8 +598,11 @@ void    board_init_r  (bd_t *bd, ulong dest_addr)
 
     if ((flash_size = flash_init ()) > 0) {
 #ifdef CFG_FLASH_CHECKSUM
-       int flash_crc = 0;
-
+       if (flash_size >= (1 << 20)) {
+               printf ("%2ld MB", flash_size >> 20);
+       } else {
+               printf ("%2ld kB", flash_size >> 10);
+       }
        /*
         * Compute and print flash CRC if flashchecksum is set to 'y'
         *
@@ -607,17 +610,15 @@ void    board_init_r  (bd_t *bd, ulong dest_addr)
         */
        s = getenv ("flashchecksum");
        if (s && (*s == 'y')) {
-               flash_crc = crc32 (0, (const unsigned char *)CFG_FLASH_BASE,
-                                  flash_size);
+               printf ("  CRC: %08X",
+                       crc32 ( 0,
+                               (const unsigned char *)CFG_FLASH_BASE,
+                               flash_size)
+               );
        }
-       if (flash_size >= (1 << 20)) {
-               printf ("%2ld MB", flash_size >> 20);
-       } else {
-               printf ("%2ld kB", flash_size >> 10);
-       }
-       printf ("  CRC: %08X\n", flash_crc);
+       putc('\n');
 #else
-       if (flash_size >= (1 << 20)) {
+       if (flash_size >= (1 << 20)) {
                printf ("%2ld MB\n", flash_size >> 20);
        } else {
                printf ("%2ld kB\n", flash_size >> 10);
index 986b0aa8a18001c3b859edeef53d839121725515..836923791122b02b1b8e54621fa6fdf44f223be9 100644 (file)
@@ -17,7 +17,7 @@
  * no function pointer passed, this protects against calling it.  Also define
  * the global variable that holds the passed pointer.
  */
-#define DELAY_US 100000
+#define TIMEOUT 10*CFG_HZ
 #define PRINT if ( app_print ) app_print
 static int (*app_print)(char *,...);
 
@@ -247,7 +247,6 @@ static I2C_Status I2C_do_buffer( I2C_INTERRUPT_MODE en_int,
 {
   I2CStatus rval;
   unsigned int dev_stat;
-  int time_is_up = 0;
   if (act == I2C_MASTER_RCV)
   {
     /* set up for master-receive transaction */
@@ -279,23 +278,14 @@ static I2C_Status I2C_do_buffer( I2C_INTERRUPT_MODE en_int,
    */
   while ( rval == I2CSUCCESS || rval == I2CADDRESS )
   {
+    int timeval = get_timer(0);
+
     /* poll the device until something happens */
     do
     {
       rval = I2C_Timer_Event( Global_eumbbar, 0 );
-      if ((rval == I2CNOEVENT && !time_is_up)) 
-      {
-        udelay(DELAY_US);
-        time_is_up++;
-      } else {
-        if ((time_is_up && rval == I2CNOEVENT)) 
-        {
-          rval = I2CERROR;
-        }
-      }
     }
-    while ( rval == I2CNOEVENT );
-    time_is_up = 0;
+    while ( rval == I2CNOEVENT && get_timer(timeval) < TIMEOUT);
 
     /* check for error condition */
     if ( rval == I2CSUCCESS || rval == I2CBUFFFULL ||
index 74c18d97b6e3ad8b6381cd45470f7bb955dff1b5..157f90892eca847825f5d1ba8f3301a5fca45729 100644 (file)
  *-----------------------------------------------------------------------
  */
 
-#define        CONFIG_IDE_PCCARD       1       /* Use IDE with PC Card Adapter */
+#define        CONFIG_IDE_8xx_PCCARD   1       /* Use IDE with PC Card Adapter */
 
-#undef CONFIG_IDE_PCMCIA               /* Direct IDE    not supported  */
+#undef CONFIG_IDE_8xx_DIRECT           /* Direct IDE    not supported  */
 #undef CONFIG_IDE_LED                  /* LED   for ide not supported  */
 #undef CONFIG_IDE_RESET                /* reset for ide not supported  */
 
index 2d85babf30e952054aabaf5768a3158bc7883ecc..09b9d21d92d3795feff2a0aa8366d22160176b47 100644 (file)
 #define CONFIG_I2C             1               /* To enable I2C support        */
 
 #define CFG_I2C_EEPROM_ADDR    0x57            /* EEPROM IS24C02               */
+#define CFG_EEPROM_PAGE_WRITE_BITS     3
+#define CFG_EEPROM_PAGE_WRITE_DELAY_MS 10      /* and takes up to 10 msec */
 
 #define CFG_BAUDRATE_TABLE     { 9600, 19200, 38400, 57600, 115200 }
 #define CFG_FLASH_BANKS                { FLASH_BASE0_PRELIM , FLASH_BASE1_PRELIM }
index 80be24c2d16a4f5b2bd20a2408f9d34ebc160ae1..e64679d95bdc0c9e887c00ebff88d7630d6921cb 100644 (file)
--- a/net/arp.c
+++ b/net/arp.c
@@ -31,7 +31,7 @@
 #if (CONFIG_COMMANDS & CFG_CMD_NET)
 
 #define TIMEOUT                5               /* Seconds before trying ARP again */
-#define TIMEOUT_COUNT  10              /* # of timeouts before giving up  */
+#define TIMEOUT_COUNT  1               /* # of timeouts before giving up  */
 
 static void ArpHandler(uchar *pkt, unsigned dest, unsigned src, unsigned len);
 static void ArpTimeout(void);
index 695209c9fb28a6296b779a609fa55b49ec6056bb..2bb27a6ab3c3b6d7b8c5ec93c02370e2f58d0d17 100644 (file)
@@ -33,7 +33,7 @@
 #if (CONFIG_COMMANDS & CFG_CMD_NET)
 
 #define TIMEOUT                5               /* Seconds before trying BOOTP again    */
-#define TIMEOUT_COUNT  10              /* # of timeouts before giving up       */
+#define TIMEOUT_COUNT  1               /* # of timeouts before giving up       */
 
 #define PORT_BOOTPS    67              /* BOOTP server UDP port                */
 #define PORT_BOOTPC    68              /* BOOTP client UDP port                */
index c1dd003af291002056404c3b68d45cce7d8b7448..a20ee8191333f9da76952e1dade26cabb7d3bf86 100644 (file)
--- a/net/net.c
+++ b/net/net.c
@@ -279,8 +279,12 @@ startAgainHandler(uchar * pkt, unsigned dest, unsigned src, unsigned len)
 void
 NetStartAgain(void)
 {
+#ifndef CONFIG_NET_MULTI
        NetSetTimeout(10 * CFG_HZ, startAgainTimeout);
        NetSetHandler(startAgainHandler);
+#else
+       NetState = NETLOOP_RESTART;
+#endif
 }
 
 /**********************************************************************/
index 5742b9bbe0358da5d316dfef55ccf5b6335aea2b..5906e2208ba4f04781e5a66393b2190d4f6e90de 100644 (file)
@@ -31,7 +31,7 @@
 #if (CONFIG_COMMANDS & CFG_CMD_NET)
 
 #define TIMEOUT                5               /* Seconds before trying BOOTP again */
-#define TIMEOUT_COUNT  10              /* # of timeouts before giving up    */
+#define TIMEOUT_COUNT  1               /* # of timeouts before giving up    */
 
 
 int            RarpTry;