[Etherboot-developers] Intel 82559ER question
Brought to you by:
marty_connor,
stefanhajnoczi
|
From: BHARATHWAJ M. <mb...@co...> - 2001-12-20 17:41:59
|
Hello, I am trying to use etherboot with linuxBIOS (www.linuxbios.org), Intel 82559ER ethernet controller on a digital logic's smartcore-P5 (430TX) Unfortunately, I am getting timing issues. For instance, if I keep adding printfs in the do loop in the function do_eeprom_cmd in eepro100.c, the loop advances, if not it doesn't. Here is my do_eeprom_cmd in eepro100.c: static int do_eeprom_cmd(int cmd, int cmd_len) { unsigned retval = 0; long ee_addr = ioaddr + SCBeeprom; outw(EE_ENB, ee_addr); printf("DEBUGGING -> Before udelay in " __FUNCTION__ "\n"); udelay(2); printf("DEBUGGING -> After udelay in " __FUNCTION__ "\n"); outw(EE_ENB | EE_SHIFT_CLK, ee_addr); printf("DEBUGGING -> After outw in " __FUNCTION__ "\n"); udelay(2); /* Shift the command bits out. */ printf("DEBUGGING -> Before shifting command bits in " __FUNCTION__ "\n"); do { short dataval = (cmd & (1 << cmd_len)) ? EE_WRITE_1 : EE_WRITE_0; printf("DEBUGGING -> cmd_len: %d\n", cmd_len); outw(dataval, ee_addr); printf("DEBUGGING -> After outw(dataval, ee_addr) in " __FUNCTION__ "\n"); udelay(2); printf("DEBUGGING -> After udelay(2)\n"); outw(dataval | EE_SHIFT_CLK, ee_addr); printf("DEBUGGING -> After outw(dataval | EE_SHIFT_CLK, ee_addr)\n"); udelay(2); printf("DEBUGGING -> After udelay(2)\n"); retval = (retval << 1) | ((inw(ee_addr) & EE_DATA_READ) ? 1 : 0); printf("DEBUGGING -> After assigning value for retval in " __FUNCTION__ "\n"); } while (--cmd_len >= 0); printf("DEBUGGING -> After shifting command bits in " __FUNCTION__ "\n"); outw(EE_ENB, ee_addr); udelay(2); /* Terminate the EEPROM access. */ outw(EE_ENB & ~EE_CS, ee_addr); return retval; } Depending on the number of printfs inside the do loop, cmd_len decrements. Can anyone help me resolve this timing issue, at least point me in the correct debugging direction :) ? I am totally lost at the present... Bharath |