Doing it this way is better: first assign align value to be at least of min_align then compare align with bridge->align to see if bridge->align needs updated. ... ... while((dev = largest_resource(bus, &resource, type_mask, type))) { resource_t size; /* Do NOT I repeat do not ignore resources which have zero size. * If they need to be ignored dev->read_resources should not even * return them. Some resources must be set even when they have * no size. PCI bridge resources are a good example of this. */ /* Make certain we are dealing with a good minimum size */ size = resource->size; align = resource->align; if (align < min_align) { align = min_align; }
/* Propogate the resource alignment to the bridge register */ if (align > bridge->align) { bridge->align = align; } if (resource->flags & IORESOURCE_FIXED) { continue; }
... ...
I noticed this problem, if certian devices are disabled (like onboard vga for example). The other enabled devices try to use 0xfec00000 for memory allocation, causing APIC to fail. I think the above code looks good :-) Have you done up a patch?
I noticed this problem, if certian devices are disabled (like onboard vga for example). The other enabled devices try to use 0xfec00000 for memory allocation, causing APIC to fail. I think the above code looks good :-) Have you done up a patch?
yes, I just made a patch:
Index: src/devices/device.c =================================================================== --- src/devices/device.c (revision 3254) +++ src/devices/device.c (working copy) @@ -305,11 +305,6 @@ * return them. Some resources must be set even when they have * no size. PCI bridge resources are a good example of this. */ - /* Propogate the resource alignment to the bridge register */ - if (resource->align > bridge->align) { - bridge->align = resource->align; - } - /* Make certain we are dealing with a good minimum size */ size = resource->size; align = resource->align; @@ -317,6 +312,11 @@ align = min_align; }
+ /* Propogate the resource alignment to the bridge register */ + if (align > bridge->align) { + bridge->align = align; + } + if (resource->flags & IORESOURCE_FIXED) { continue; }
First time to send an attachment, not sure if it works, so I pasted the code in this mail ;-)
Dear Aaron,
Am Mittwoch, den 23.04.2008, 22:07 +0800 schrieb aaron lwe:
First time to send an attachment, not sure if it works, so I pasted the code in this mail ;-)
I received your attachment and was able to open it.
Although I cannot test or verify your patch, I think you have to add a Signed-Off-By line [1]. Otherwise your patch cannot be acked and then commited.
Thanks and according to the comments I read great investigation and solution,
Paul
[1] http://www.coreboot.org/Development_Guidelines#Sign-off_Procedure
You just need to add a Signed-Off-By as stated in the development guidelines. In the mean time I will test it and if all goes well you'll get my Acked-by, and then it can be commited.
Thanks, Joseph Smith Set-Top-Linux www.settoplinux.org
-----Original Message----- From: coreboot-bounces@coreboot.org [mailto:coreboot-bounces@coreboot.org] On Behalf Of aaron lwe Sent: Wednesday, April 23, 2008 10:07 AM To: joe@settoplinux.org Cc: rminnich@gmail.com; coreboot@coreboot.org Subject: [coreboot] pci device memory allocation problem
I noticed this problem, if certian devices are disabled (like onboard
vga for example). The other enabled devices try to use 0xfec00000 for memory allocation, causing APIC to fail. I think the above code looks good :-)
Have you done up a patch?
yes, I just made a patch:
Index: src/devices/device.c
--- src/devices/device.c (revision 3254) +++ src/devices/device.c (working copy) @@ -305,11 +305,6 @@ * return them. Some resources must be set even when they have * no size. PCI bridge resources are a good example of this. */
/* Propogate the resource alignment to the bridge register
*/
if (resource->align > bridge->align) {
bridge->align = resource->align;
}
/* Make certain we are dealing with a good minimum size */ size = resource->size; align = resource->align;
@@ -317,6 +312,11 @@ align = min_align; }
/* Propogate the resource alignment to the bridge register
*/
if (align > bridge->align) {
bridge->align = align;
}
if (resource->flags & IORESOURCE_FIXED) { continue; }
First time to send an attachment, not sure if it works, so I pasted the code in this mail ;-)
You just need to add a Signed-Off-By as stated in the development guidelines. In the mean time I will test it and if all goes well you'll get my Acked-by, and then it can be commited.
Oh, I see.
Signed-off-by: Aaron Lwe aaron.lwe@gmail.com
Thanks.