changeset 1467:8ad4d297cbf8

* 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.
author nickg
date Wed, 14 Jan 2004 15:39:43 +0000
parents 4534df73d5ba
children ded5649bf573
files packages/io/pci/current/ChangeLog packages/io/pci/current/src/pci.c
diffstat 2 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/packages/io/pci/current/ChangeLog
+++ b/packages/io/pci/current/ChangeLog
@@ -1,3 +1,10 @@
+2004-01-14  Nick Garnett  <nickg@calivar.com>
+
+	* 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  <dvrabel@arcom.com>
         
 	* src/pci.c (cyg_pci_find_device): Remove debug message.
--- 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 {