add the msm800srv ; put the usb in the right place.
[coreboot.git] / src / mainboard / digitallogic / msm800sev / mainboard.c
1 #include <console/console.h>
2 #include <device/device.h>
3 #include <device/pci.h>
4 #include <device/pci_ids.h>
5 #include <device/pci_ops.h>
6 #include <arch/io.h>
7 #include "chip.h"
8
9
10 static void init(struct device *dev)
11 {
12         unsigned bus = 0;
13         unsigned devNic = PCI_DEVFN(0xd, 0);    
14         unsigned devUsb = PCI_DEVFN(0xf, 4);
15         device_t usb = NULL, nic = NULL;
16         unsigned char irqUsb = 0xa, irqNic = 0xb;
17
18         printk_debug("DIGITALLOGIC MSM800SSEV  ENTER %s\n", __FUNCTION__);
19
20         // FIXME: do we need to initialize USB OHCI this way?
21         printk_debug("%s (%x,%x) set USB PCI interrupt line to %d\n", 
22                 __FUNCTION__, bus, devUsb, irqUsb);
23
24         // initialize the USB controller
25         usb = dev_find_slot(bus, devUsb);
26         if (!usb) printk_err("Could not find USB\n");
27         else pci_write_config8(usb, PCI_INTERRUPT_LINE, irqUsb);
28
29         printk_debug("%s (%x,%x) set NIC PCI interrupt line to %d\n", 
30                 __FUNCTION__, bus, devNic, irqNic);
31
32         // initialize theEEPRO 100
33         nic = dev_find_slot(bus, devNic);
34         if (!nic) printk_err("Could not find USB\n");
35         else pci_write_config8(nic, PCI_INTERRUPT_LINE, irqNic);
36
37         printk_debug("DIGITALLOGIC MSM800SSEV EXIT %s\n", __FUNCTION__);
38 }
39
40 static void enable_dev(struct device *dev)
41 {
42         dev->ops->init = init;
43 }
44
45 struct chip_operations mainboard_digitallogic_msm800sev_ops = {
46         CHIP_NAME("digitallogip msm800sev mainboard ")
47         .enable_dev = enable_dev,
48
49 };