kernels/linux-2.4.0/arch/ppc/mbxboot/embed_config.c
/* Read the EEPROM on the RPX-Lite board.
*/
Read the EEPROM on the RPX-Lite board.
Read the EEPROM on the RPX - Lite board .
void
rpx_cfg(bd_t *bd)
{
	u_char	eebuf[256], *cp;
#if 1
	iic_read(0xa8, eebuf, 0, 128);
	iic_read(0xa8, &eebuf[128], 128, 128);
	{
		int i;
		cp = (u_char *)0xfa000000;
		for (i=0; i<256; i++)
			*cp++ = eebuf[i];
	}
	cp = eebuf;
	for (;;) {
		if (*cp == 'E') {
			cp++;
			if (*cp == 'A') {
				cp += 2;
				rpx_eth(bd, cp);
			}
		}
		if (*cp == 'S') {
			cp++;
			if (*cp == 'B') {
				cp += 2;
				rpx_brate(bd, cp);
			}
		}
		if (*cp == 'D') {
			cp++;
			if (*cp == '1') {
				cp += 2;
				rpx_memsize(bd, cp);
			}
		}
		if (*cp == 'H') {
			cp++;
			if (*cp == 'Z') {
				cp += 2;
				rpx_cpuspeed(bd, cp);
			}
		}
		while ((*cp != '\n') && (*cp != 0xff))
			cp++;
		cp++;
		if ((*cp == 0) || (*cp == 0xff))
			break;
	}
	bd->bi_memstart = 0;
#else
	bd->bi_memstart = 0;
	bd->bi_memsize = (8 * 1024 * 1024);
	bd->bi_intfreq = 48;
	bd->bi_busfreq = 48;
	bd->bi_baudrate = 9600;
#endif
}
void rpx_cfg ( bd_t * bd ) { u_char eebuf [ 256 ] , * cp ; #if 1 iic_read ( 0xa8 , eebuf , 0 , 128 ) ; iic_read ( 0xa8 , & eebuf [ 128 ] , 128 , 128 ) ; { int i ; cp = ( u_char * ) 0xfa000000 ; for ( i = 0 ; i < 256 ; i ++ ) * cp ++ = eebuf [ i ] ; } cp = eebuf ; for ( ; ; ) { if ( * cp == ' ' ) { cp ++ ; if ( * cp == ' ' ) { cp += 2 ; rpx_eth ( bd , cp ) ; } } if ( * cp == ' ' ) { cp ++ ; if ( * cp == ' ' ) { cp += 2 ; rpx_brate ( bd , cp ) ; } } if ( * cp == ' ' ) { cp ++ ; if ( * cp == ' ' ) { cp += 2 ; rpx_memsize ( bd , cp ) ; } } if ( * cp == ' ' ) { cp ++ ; if ( * cp == ' ' ) { cp += 2 ; rpx_cpuspeed ( bd , cp ) ; } } while ( ( * cp != ' \n ' ) && ( * cp != 0xff ) ) cp ++ ; cp ++ ; if ( ( * cp == 0 ) || ( * cp == 0xff ) ) break ; } bd -> bi_memstart = 0 ; #else bd -> bi_memstart = 0 ; bd -> bi_memsize = ( 8 * 1024 * 1024 ) ; bd -> bi_intfreq = 48 ; bd -> bi_busfreq = 48 ; bd -> bi_baudrate = 9600 ; #endif }
Read the EEPROM on the RPX-Lite board.
Read the EEPROM on the RPX - Lite board .
/* Read the first 256 bytes of the EEPROM.  I think this
	 * is really all there is, and I hope if it gets bigger the
	 * info we want is still up front.
	 */ /* We look for two things, the Ethernet address and the
	 * serial baud rate.  The records are separated by
	 * newlines.
	 */ /* Scan to the end of the record.
		*/ /* If the next character is a 0 or ff, we are done.
		*/ /* For boards without initialized EEPROM.
	*/