Andrew Ip wrote:
>Have you checked out the clock connected to LPC? On W311, FS2 can be
>set to 24 or 48 MHz. It could be the problem, since I have similar problem
>with USB on a custom cle266 board. FYI, it can be programmed thru smb.
>Here is from we have done to program the USB clock.
>...
>You may want to put similar code in serial init. Hope this help.
I tried this and...it worked! My simple test program is below. Linuxbios
puts the smb stuff at 0xf00 and it is already enabled (at least in my patch).
So all I had to do was do the outb's to get it to work. Thanks *very* much.
Note to Ron: Let me know if you want the epia-m, I'll still send one off if
you want it. I've got a spare 10000 (1 gig) that you can have. Note I
don't read email sent to the address I'm posting from...best send to
dash(a)xdr.com to get to me.
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <sys/io.h>
#include <stdlib.h>
#define SMB_STATUS (base + 0)
#define SMB_CONTROL (base + 2)
#define SMB_COMMAND (base + 3)
#define SMB_ADDRESS (base + 4)
#define SMB_DATA (base + 5)
#define I2C_TRANS_CMD 0x40
#define CLOCK_SLAVE_ADDRESS 0x69
int main(int argc, char **argv)
{
int res;
int base=0xf00;
res=iopl(3);
if(res)
{
perror("iopl");
exit(-1);
}
outb( 0xff, SMB_STATUS );
// USB out 48MHz
outb( 0x7f, SMB_DATA );
outb( 0x83, SMB_COMMAND );
outb( (CLOCK_SLAVE_ADDRESS<<1), SMB_ADDRESS );
outb( 0x8|I2C_TRANS_CMD, SMB_CONTROL );
while( inb(SMB_STATUS) & 0x01 );
}
-Dave