From 99dcf231f48433a07cbd47ecb0c23301a6b5b34e Mon Sep 17 00:00:00 2001 From: "Ronald G. Minnich" Date: Tue, 30 Sep 2003 02:16:47 +0000 Subject: The epia now works. Now to fix the ram ... git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1159 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- src/devices/device.c | 22 +++++++++++++++------- src/devices/pci_device.c | 4 ++++ src/devices/root_device.c | 6 ++++++ 3 files changed, 25 insertions(+), 7 deletions(-) (limited to 'src/devices') diff --git a/src/devices/device.c b/src/devices/device.c index e52cc2a57e..289c0766ea 100644 --- a/src/devices/device.c +++ b/src/devices/device.c @@ -251,6 +251,17 @@ void compute_allocate_resource( min_align = 0; base = bridge->base; + printk_spew("%s: bus %p, bridge %p, type_mask 0x%x, type 0x%x\n", + __FUNCTION__, + bus, bridge, type_mask, type); + printk_spew("vendor 0x%x device 0x%x class 0x%x \n", + bus->dev->vendor, bus->dev->device, bus->dev->class); + printk_spew("%s compute_allocate_%s: base: %08lx size: %08lx align: %d gran: %d\n", + dev_path(bus->dev), + (bridge->flags & IORESOURCE_IO)? "io": + (bridge->flags & IORESOURCE_PREFETCH)? "prefmem" : "mem", + base, bridge->size, bridge->align, bridge->gran); + /* We want different minimum alignments for different kinds of * resources. These minimums are not device type specific * but resource type specific. @@ -262,12 +273,6 @@ void compute_allocate_resource( min_align = log2(DEVICE_MEM_ALIGN); } - printk_spew("%s compute_allocate_%s: base: %08lx size: %08lx align: %d gran: %d\n", - dev_path(dev), - (bridge->flags & IORESOURCE_IO)? "io": - (bridge->flags & IORESOURCE_PREFETCH)? "prefmem" : "mem", - base, bridge->size, bridge->align, bridge->gran); - /* Make certain I have read in all of the resources */ read_resources(bus); @@ -439,12 +444,13 @@ void dev_enumerate(void) void dev_configure(void) { struct device *root = &dev_root; - printk_info("Allocating resources..."); + printk_info("%s: Allocating resources...", __FUNCTION__); printk_debug("\n"); root->ops->read_resources(root); + printk_spew("%s: done reading resources...\n", __FUNCTION__); /* Make certain the io devices are allocated somewhere * safe. */ @@ -459,8 +465,10 @@ void dev_configure(void) root->resource[1].flags |= IORESOURCE_SET; // now just set things into registers ... we hope ... root->ops->set_resources(root); + printk_spew("%s: done setting resources...\n", __FUNCTION__); allocate_vga_resource(); + printk_spew("%s: done vga resources...\n", __FUNCTION__); printk_info("done.\n"); } diff --git a/src/devices/pci_device.c b/src/devices/pci_device.c index c387f3569f..a4789d22f4 100644 --- a/src/devices/pci_device.c +++ b/src/devices/pci_device.c @@ -174,6 +174,7 @@ static void pci_bridge_read_bases(struct device *dev) /* FIXME handle bridges without some of the optional resources */ + printk_spew("%s: path %s\n", __FUNCTION__, dev_path(dev)); /* Initialize the io space constraints on the current bus */ dev->resource[reg].base = 0; dev->resource[reg].size = 0; @@ -213,6 +214,7 @@ static void pci_bridge_read_bases(struct device *dev) reg++; dev->resources = reg; + printk_spew("DONE %s: path %s\n", __FUNCTION__, dev_path(dev)); } @@ -630,6 +632,7 @@ unsigned int pci_scan_bridge(struct device *dev, unsigned int max) uint32_t buses; uint16_t cr; + printk_spew("%s: dev %p, max %d\n", __FUNCTION__, dev, max); bus = &dev->link[0]; dev->links = 1; @@ -673,5 +676,6 @@ unsigned int pci_scan_bridge(struct device *dev, unsigned int max) pci_write_config32(dev, PCI_PRIMARY_BUS, buses); pci_write_config16(dev, PCI_COMMAND, cr); + printk_spew("%s returns max %d\n", __FUNCTION__, max); return max; } diff --git a/src/devices/root_device.c b/src/devices/root_device.c index c05a2cd015..ae02277363 100644 --- a/src/devices/root_device.c +++ b/src/devices/root_device.c @@ -11,6 +11,7 @@ void root_dev_read_resources(device_t root) { int res = 0; + printk_spew("%s . Root is %p\n", __FUNCTION__, root); /* Initialize the system wide io space constraints */ root->resource[res].base = 0x400; root->resource[res].size = 0; @@ -19,6 +20,8 @@ void root_dev_read_resources(device_t root) root->resource[res].limit = 0xffffUL; root->resource[res].flags = IORESOURCE_IO; root->resource[res].index = 0; + printk_spew("%s . link %p, resource %p\n", __FUNCTION__, + &root->link[0], &root->resource[res]); compute_allocate_resource(&root->link[0], &root->resource[res], IORESOURCE_IO, IORESOURCE_IO); res++; @@ -31,11 +34,14 @@ void root_dev_read_resources(device_t root) root->resource[res].limit = 0xffffffffUL; root->resource[res].flags = IORESOURCE_MEM; root->resource[res].index = 1; + printk_spew("%s . link %p, resource %p\n", __FUNCTION__, + &root->link[0], &root->resource[res]); compute_allocate_resource(&root->link[0], &root->resource[res], IORESOURCE_MEM, IORESOURCE_MEM); res++; root->resources = res; + printk_spew("%s DONE\n", __FUNCTION__); } /** -- cgit v1.2.3