From: wdenk Date: Wed, 13 Feb 2002 19:31:55 +0000 (+0000) Subject: Fix bug in MPC824x I2C driver X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=98250a670f157b9720112d24fa2576cfbcff05b6;p=users%2Frw%2Fppcboot.git Fix bug in MPC824x I2C driver Fix CONFIG_IDE renames for RPXClassic Fix ethernet port switching on SP8240 --- diff --git a/CHANGELOG b/CHANGELOG index be4b334..5864f47 100644 --- 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 diff --git a/common/board.c b/common/board.c index 047ee10..cb1dfea 100644 --- a/common/board.c +++ b/common/board.c @@ -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); diff --git a/cpu/mpc824x/drivers/i2c/i2c1.c b/cpu/mpc824x/drivers/i2c/i2c1.c index 986b0aa..8369237 100644 --- a/cpu/mpc824x/drivers/i2c/i2c1.c +++ b/cpu/mpc824x/drivers/i2c/i2c1.c @@ -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 || diff --git a/include/config_RPXClassic.h b/include/config_RPXClassic.h index 74c18d9..157f908 100644 --- a/include/config_RPXClassic.h +++ b/include/config_RPXClassic.h @@ -263,9 +263,9 @@ *----------------------------------------------------------------------- */ -#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 */ diff --git a/include/config_Sandpoint8245.h b/include/config_Sandpoint8245.h index 2d85bab..09b9d21 100644 --- a/include/config_Sandpoint8245.h +++ b/include/config_Sandpoint8245.h @@ -144,6 +144,8 @@ #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 } diff --git a/net/arp.c b/net/arp.c index 80be24c..e64679d 100644 --- 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); diff --git a/net/bootp.c b/net/bootp.c index 695209c..2bb27a6 100644 --- a/net/bootp.c +++ b/net/bootp.c @@ -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 */ diff --git a/net/net.c b/net/net.c index c1dd003..a20ee81 100644 --- 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 } /**********************************************************************/ diff --git a/net/rarp.c b/net/rarp.c index 5742b9b..5906e22 100644 --- a/net/rarp.c +++ b/net/rarp.c @@ -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;