[Etherboot-developers] Patch to support SIS 630ET NIC
Brought to you by:
marty_connor,
stefanhajnoczi
|
From: Doug A. <amb...@am...> - 2002-01-04 16:37:05
|
Hmm, doesn't look like my first mail message made it to the lists, so I'll
try again.
This patch applies against etherboot-5.0.5 and adds support for the
SIS 630ET NIC embedded in the SIS 630ET chipset. I got the changes
from the the Linux sis900 driver.
Thanks,
Doug A.
*** sis900.h.orig Mon Apr 2 02:00:04 2001
--- sis900.h Wed Jan 2 12:47:31 2002
***************
*** 39,44 ****
--- 39,46 ----
/* Symbolic names for bits in various registers */
enum sis900_command_register_bits {
+ RELOAD = 0x00000400,
+ ACCESSMODE = 0x00000200,/* ET */
RESET = 0x00000100,
SWI = 0x00000080,
RxRESET = 0x00000020,
***************
*** 320,326 ****
enum sis900_revision_id {
SIS630A_900_REV = 0x80, SIS630E_900_REV = 0x81,
! SIS630S_900_REV = 0x82, SIS630EA1_900_REV = 0x83
};
enum sis630_revision_id {
--- 322,329 ----
enum sis900_revision_id {
SIS630A_900_REV = 0x80, SIS630E_900_REV = 0x81,
! SIS630S_900_REV = 0x82, SIS630EA1_900_REV = 0x83,
! SIS630ET_900_REV = 0x84
};
enum sis630_revision_id {
*** sis900.c.orig Sat Oct 27 02:13:26 2001
--- sis900.c Wed Jan 2 12:47:01 2002
***************
*** 201,206 ****
--- 201,242 ----
return 1;
}
+
+ /**
+ * sis630e_get_mac_addr: - Get MAC address for SiS630E model
+ * @pci_dev: the sis900 pci device
+ * @net_dev: the net device to get address for
+ *
+ * SiS630E model, use APC CMOS RAM to store MAC address.
+ * APC CMOS RAM is accessed through ISA bridge.
+ * MAC address is read into @net_dev->dev_addr.
+ */
+
+ static int sis635_get_mac_addr(struct pci_device * pci_dev, struct nic *nic,
+ long ioaddr)
+ {
+ 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
***************
*** 240,249 ****
/* get MAC address */
ret = 0;
pcibios_read_config_byte(pci->bus,pci->devfn, PCI_REVISION, &revision);
! if (revision == SIS630E_900_REV || revision == SIS630EA1_900_REV)
ret = sis630e_get_mac_addr(pci, nic);
! else if (revision == SIS630S_900_REV)
! ret = sis630e_get_mac_addr(pci, nic);
else
ret = sis900_get_mac_addr(pci, nic);
--- 276,286 ----
/* get MAC address */
ret = 0;
pcibios_read_config_byte(pci->bus,pci->devfn, PCI_REVISION, &revision);
! if (revision == SIS630E_900_REV || revision == SIS630EA1_900_REV
! || revision == SIS630S_900_REV)
ret = sis630e_get_mac_addr(pci, nic);
! else if ((revision > 0x81) && (revision <= 0x90))
! ret = sis635_get_mac_addr(pci, nic, ioaddr);
else
ret = sis900_get_mac_addr(pci, nic);
***************
*** 252,257 ****
--- 289,299 ----
printf ("sis900_probe: Error MAC address not found\n");
return NULL;
}
+
+ /* 630ET : set the mii access mode as software-mode */
+ 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);
|