This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PCI: IO BAR fix


Index: io/pci/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/io/pci/current/ChangeLog,v
retrieving revision 1.24
diff -u -5 -r1.24 ChangeLog
--- io/pci/current/ChangeLog	9 Jan 2004 16:36:24 -0000	1.24
+++ io/pci/current/ChangeLog	14 Jan 2004 14:54:54 -0000
@@ -1,5 +1,12 @@
+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.
 
 2003-11-27  Andrew Lunn  <andrew.lunn@ascom.ch>
Index: io/pci/current/src/pci.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/io/pci/current/src/pci.c,v
retrieving revision 1.18
diff -u -5 -r1.18 pci.c
--- io/pci/current/src/pci.c	9 Jan 2004 16:36:24 -0000	1.18
+++ io/pci/current/src/pci.c	14 Jan 2004 14:55:10 -0000
@@ -166,10 +166,21 @@
                     i++;
                     dev_info->base_size[i] = 0;
                     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 {
 	// If the device is already configured. Fill in the base_map.
 	CYG_PCI_ADDRESS64 tmp_addr;


-- 
Nick Garnett                    eCos Kernel Architect
http://www.ecoscentric.com      The eCos and RedBoot experts


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]