linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [1/5] pasemi: allow 8KB config space for I/O bridge
@ 2007-04-16  6:26 Olof Johansson
  2007-04-16  6:27 ` [PATCH] [2/5] pasemi: enable one more hid bit Olof Johansson
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Olof Johansson @ 2007-04-16  6:26 UTC (permalink / raw)
  To: paulus; +Cc: linuxppc-dev

Device 0 function 0 on the root bus is really a two-function bus agent,
but only the first function is visible. Because of this, we need to
allow config accesses into the second range. Modify the check for valid
offsets accordingly.

Signed-off-by: Olof Johansson <olof@lixom.net>

Index: linux-2.6/arch/powerpc/platforms/pasemi/pci.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/pasemi/pci.c
+++ linux-2.6/arch/powerpc/platforms/pasemi/pci.c
@@ -33,7 +33,17 @@
 
 #define PA_PXP_CFA(bus, devfn, off) (((bus) << 20) | ((devfn) << 12) | (off))
 
-#define CONFIG_OFFSET_VALID(off) ((off) < 4096)
+static inline int pa_pxp_offset_valid(u8 bus, u8 devfn, int offset)
+{
+	/* Device 0 Function 0 is special: It's config space spans function 1 as
+	 * well, so allow larger offset. It's really a two-function device but the
+	 * second function does not probe.
+	 */
+	if (bus == 0 && devfn == 0)
+		return offset < 8192;
+	else
+		return offset < 4096;
+}
 
 static void volatile __iomem *pa_pxp_cfg_addr(struct pci_controller *hose,
 				       u8 bus, u8 devfn, int offset)
@@ -51,7 +61,7 @@ static int pa_pxp_read_config(struct pci
 	if (!hose)
 		return PCIBIOS_DEVICE_NOT_FOUND;
 
-	if (!CONFIG_OFFSET_VALID(offset))
+	if (!pa_pxp_offset_valid(bus->number, devfn, offset))
 		return PCIBIOS_BAD_REGISTER_NUMBER;
 
 	addr = pa_pxp_cfg_addr(hose, bus->number, devfn, offset);
@@ -85,7 +95,7 @@ static int pa_pxp_write_config(struct pc
 	if (!hose)
 		return PCIBIOS_DEVICE_NOT_FOUND;
 
-	if (!CONFIG_OFFSET_VALID(offset))
+	if (!pa_pxp_offset_valid(bus->number, devfn, offset))
 		return PCIBIOS_BAD_REGISTER_NUMBER;
 
 	addr = pa_pxp_cfg_addr(hose, bus->number, devfn, offset);

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2007-05-01  4:44 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-16  6:26 [PATCH] [1/5] pasemi: allow 8KB config space for I/O bridge Olof Johansson
2007-04-16  6:27 ` [PATCH] [2/5] pasemi: enable one more hid bit Olof Johansson
2007-04-24  0:27   ` Benjamin Herrenschmidt
2007-04-24  1:04     ` Olof Johansson
2007-04-16  6:28 ` [PATCH] [3/5] pasemi: reset mpic on boot Olof Johansson
2007-04-16  6:30 ` [PATCH] [4/5] pasemi: PA6T oprofile support Olof Johansson
2007-04-18  6:38   ` [PATCH] [4/5] [v2] " Olof Johansson
2007-04-16  6:31 ` [PATCH] [5/5] pasemi: GPIO MDIO of_platform driver Olof Johansson
2007-04-16 23:07   ` Arnd Bergmann
2007-04-17  0:47     ` Olof Johansson
2007-04-18  6:39   ` [PATCH] [5/5] [v2] " Olof Johansson
2007-05-01  4:35     ` Paul Mackerras
2007-05-01  4:45       ` Olof Johansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).