]> xenbits.xensource.com Git - seabios.git/commit
fix low bits in ROM and I/O sizing
authorKevin O'Connor <kevin@koconnor.net>
Wed, 14 Oct 2009 23:28:04 +0000 (19:28 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Wed, 14 Oct 2009 23:28:04 +0000 (19:28 -0400)
commit2f442fd566d683253cf23560867a34243c185550
treeaf3f52cd95be4a0996f7b770b89bf9bc56fe7b5e
parentd948e2b1f98ddf2449dcf59dbc46d64f3ea0d311
fix low bits in ROM and I/O sizing

This cleans up handling of low bits during BAR sizing,
to match PCI spec requirements, and to use symbolic
constants from pci_regs.h

Issues fixed:
For ROM BARs, bit 0 is writeable (enable bit), which we not
only don't want to set, but it will stick and make us think
it's an I/O port resource.
Further, PCI spec defines the following bits as reserved:
- bit 1 in I/O BAR
- bits 10:1 in ROM BAR
and we should be careful and preserve any values there,
and should ignore anything we read from these registers.
Bits 3:2 in I/O BAR might be writeable, so it
is wrong to mask them when calculating BAR size.

Spec references:
See 6.2.5.1 for I/O and memory, and 6.2.5.2 for ROM,
6.1 for reserved bit handling;
pages 225, 228 and 214 in PCI spec revision 3.0.

See also Qemu pcbios commit 6ddb9f5c742b2b82b1755d7ec2a127f6e20e3806

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
src/pciinit.c