# HG changeset patch # User nickg # Date 1074094783 0 # Node ID 8ad4d297cbf8eef6042b409c740516c266260883 # Parent 4534df73d5ba7da63da94286c155b8c0dd91574b * src/pci.c (cyg_pci_get_device_info): Added fix for devices that only implement the bottom 16 bits of an IO BAR. This is allowed by the standard but is very rare and mostly present in older devices only. Without this cyg_pci_allocate_io_priv() gets confused. diff --git a/packages/io/pci/current/ChangeLog b/packages/io/pci/current/ChangeLog --- a/packages/io/pci/current/ChangeLog +++ b/packages/io/pci/current/ChangeLog @@ -1,3 +1,10 @@ +2004-01-14 Nick Garnett + + * src/pci.c (cyg_pci_get_device_info): Added fix for devices that + only implement the bottom 16 bits of an IO BAR. This is allowed by + the standard but is very rare and mostly present in older devices + only. Without this cyg_pci_allocate_io_priv() gets confused. + 2004-01-09 David Vrabel * src/pci.c (cyg_pci_find_device): Remove debug message. diff --git a/packages/io/pci/current/src/pci.c b/packages/io/pci/current/src/pci.c --- a/packages/io/pci/current/src/pci.c +++ b/packages/io/pci/current/src/pci.c @@ -168,6 +168,17 @@ cyg_pci_get_device_info ( cyg_pci_device dev_info->base_map[i] = 0xffffffff; } } + + // Fix any IO devices that only implement the bottom 16 + // bits of the the BAR. Just fill in these bits so it + // looks like a full 32 bit BAR. + if ((CYG_PCI_CFG_BAR_SPACE_IO == + (size & CYG_PCI_CFG_BAR_SPACE_MASK)) && + ((size & 0xFFFF0000) == 0) + ) + { + dev_info->base_size[i] |= 0xFFFF0000; + } } dev_info->num_bars = bar_count; } else {