The sis900 netboot code does not work on my Asus TUSI board, while the
Linux kernel does. The code appears to originate from the same source,
so I back-ported what was necessary to get my card working. Attached is
the unified diff. Good luck!
Felix
diff -ur grub-0.92/ChangeLog grub-0.92-fefe/ChangeLog
--- grub-0.92/ChangeLog Mon Apr 29 20:51:03 2002
+++ grub-0.92-fefe/ChangeLog Sat Jun 8 04:15:20 2002
@@ -1,3 +1,8 @@
+2002-06-04 Felix von Leitner <[EMAIL PROTECTED]>
+
+ * netboot/sis900.c: back-port support for SIS630ET_900_REV from
+ Linux 2.4.18 sources (found on my Asus TUSI mainboard).
+
2002-04-30 Yoshinori K. Okuji <[EMAIL PROTECTED]>
* stage2/boot.c (load_image): For Linux, don't check if the
diff -ur grub-0.92/netboot/sis900.c grub-0.92-fefe/netboot/sis900.c
--- grub-0.92/netboot/sis900.c Wed Jan 2 22:56:40 2002
+++ grub-0.92-fefe/netboot/sis900.c Sat Jun 8 04:11:17 2002
@@ -201,6 +201,31 @@
return 1;
}
+
+static int sis635_get_mac_addr(struct pci_device * pci_dev, struct nic *nic)
+{
+ u32 rfcrSave;
+ u32 i;
+
+ rfcrSave = inl(rfcr + ioaddr);
+
+ outl(rfcrSave | RELOAD, ioaddr + cr);
+ outl(0, ioaddr + cr);
+
+ /* disable packet filtering before setting filter */
+ outl(rfcrSave & ~RFEN, rfcr + ioaddr);
+
+ /* load MAC addr to filter data register */
+ for (i = 0 ; i < 3 ; i++) {
+ outl((i << RFADDR_shift), ioaddr + rfcr);
+ *( ((u16 *)nic->node_addr) + i) = inw(ioaddr + rfdr);
+ }
+
+ /* enable packet filitering */
+ outl(rfcrSave | RFEN, rfcr + ioaddr);
+
+ return 1;
+}
/*
* Function: sis900_probe
@@ -244,6 +269,8 @@
ret = sis630e_get_mac_addr(pci, nic);
else if (revision == SIS630S_900_REV)
ret = sis630e_get_mac_addr(pci, nic);
+ else if ((revision > 0x81) && (revision <= 0x90))
+ ret = sis635_get_mac_addr(pci, nic);
else
ret = sis900_get_mac_addr(pci, nic);
@@ -253,6 +280,9 @@
return NULL;
}
+ if (revision == SIS630ET_900_REV)
+ outl(ACCESSMODE | inl(ioaddr + cr), ioaddr + cr);
+
printf("\nsis900_probe: MAC addr %! at ioaddr %#hX\n",
nic->node_addr, ioaddr);
printf("sis900_probe: Vendor:%#hX Device:%#hX\n", vendor, dev_id);
@@ -265,7 +295,8 @@
u16 mii_status;
u16 phy_id0, phy_id1;
- mii_status = sis900_mdio_read(phy_addr, MII_STATUS);
+ for (i=0; i<2; ++i)
+ mii_status = sis900_mdio_read(phy_addr, MII_STATUS);
if (mii_status == 0xffff || mii_status == 0x0000)
/* the mii is not accessable, try next one */
continue;
@@ -432,6 +463,7 @@
outl(MDC, mdio_addr);
sis900_mdio_delay();
}
+ outl(0,mdio_addr);
return retval;
}
@@ -471,6 +503,7 @@
outb(MDC, mdio_addr);
sis900_mdio_delay();
}
+ outl(0,mdio_addr);
return;
}
diff -ur grub-0.92/netboot/sis900.h grub-0.92-fefe/netboot/sis900.h
--- grub-0.92/netboot/sis900.h Wed Jan 2 22:56:40 2002
+++ grub-0.92-fefe/netboot/sis900.h Sat Jun 8 03:51:27 2002
@@ -39,6 +39,8 @@
/* Symbolic names for bits in various registers */
enum sis900_command_register_bits {
+ RELOAD = 0x00000400,
+ ACCESSMODE = 0x00000200,
RESET = 0x00000100,
SWI = 0x00000080,
RxRESET = 0x00000020,
@@ -320,7 +322,9 @@
enum sis900_revision_id {
SIS630A_900_REV = 0x80, SIS630E_900_REV = 0x81,
- SIS630S_900_REV = 0x82, SIS630EA1_900_REV = 0x83
+ SIS630S_900_REV = 0x82, SIS630EA1_900_REV = 0x83,
+ SIS630ET_900_REV = 0x84, SIS635A_900_REV = 0x90,
+ SIS900B_900_REV = 0x03
};
enum sis630_revision_id {