38e62fa366ea6d89c2ac4551935238409d470303
[coreboot.git] / src / southbridge / via / vt8235 / vt8235_nic.c
1 #include <console/console.h>
2 #include <device/device.h>
3 #include <device/pci.h>
4 #include <device/pci_ops.h>
5 #include <device/pci_ids.h>
6 #include "vt8235.h"
7
8 /*
9  * Enable the ethernet device and turn off stepping (because it is integrated 
10  * inside the southbridge)
11  */
12 static void nic_init(struct device *dev)
13 {
14         uint8_t byte;
15
16         printk_debug("Configuring VIA Rhine LAN\n");
17
18         /* We don't need stepping - though the device supports it */
19         byte = pci_read_config8(dev, PCI_COMMAND);
20         byte &= ~PCI_COMMAND_WAIT;
21         pci_write_config8(dev, PCI_COMMAND, byte);
22 }
23
24 static struct device_operations nic_ops = {
25         .read_resources   = pci_dev_read_resources,
26         .set_resources    = pci_dev_set_resources,
27         .enable_resources = pci_dev_enable_resources,
28         .init             = nic_init,
29         .enable           = 0,
30         .ops_pci          = 0,
31 };
32
33 static struct pci_driver northbridge_driver __pci_driver = {
34         .ops    = &nic_ops,
35         .vendor = PCI_VENDOR_ID_VIA,
36         .device = PCI_DEVICE_ID_VIA_8233_7,
37 };