1 #include <console/console.h>
4 #include <device/device.h>
5 #include <device/pci.h>
12 static void ram_resource(device_t dev, unsigned long index,
13 unsigned long basek, unsigned long sizek)
15 struct resource *resource;
20 resource = new_resource(dev, index);
21 resource->base = ((resource_t)basek) << 10;
22 resource->size = ((resource_t)sizek) << 10;
23 resource->flags = IORESOURCE_MEM | IORESOURCE_CACHEABLE | \
24 IORESOURCE_FIXED | IORESOURCE_STORED | IORESOURCE_ASSIGNED;
27 static void pci_domain_set_resources(device_t dev)
31 /* Report the memory regions */
33 ram_resource(dev, idx++, 0, 1024*1024); /* FIXME */
35 /* And assign the resources */
36 assign_resources(&dev->link[0]);
39 static struct device_operations pci_domain_ops = {
40 .read_resources = pci_domain_read_resources,
41 .set_resources = pci_domain_set_resources,
42 .enable_resources = enable_childrens_resources,
44 .scan_bus = pci_domain_scan_bus,
45 .ops_pci_bus = &pci_ppc_conf1,
48 static void cpu_bus_init(device_t dev)
50 initialize_cpus(&dev->link[0]);
53 static void cpu_bus_noop(device_t dev)
57 static struct device_operations cpu_bus_ops = {
58 .read_resources = cpu_bus_noop,
59 .set_resources = cpu_bus_noop,
60 .enable_resources = cpu_bus_noop,
65 static void enable_dev(struct device *dev)
67 /* Set the operations if it is a special bus type */
68 if (dev->path.type == DEVICE_PATH_PCI_DOMAIN) {
69 dev->ops = &pci_domain_ops;
71 else if (dev->path.type == DEVICE_PATH_CPU_BUS) {
72 dev->ops = &cpu_bus_ops;
76 struct chip_operations northbridge_ibm_cpc925_ops = {
77 CHIP_NAME("IBM CPC925 Northbridge")
78 .enable_dev = enable_dev,