From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262221AbUKWEcJ (ORCPT ); Mon, 22 Nov 2004 23:32:09 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262197AbUKVQky (ORCPT ); Mon, 22 Nov 2004 11:40:54 -0500 Received: from mx1.redhat.com ([66.187.233.31]:3988 "EHLO mx1.redhat.com") by vger.kernel.org with ESMTP id S262173AbUKVQPA (ORCPT ); Mon, 22 Nov 2004 11:15:00 -0500 From: David Howells To: akpm@osdl.org cc: linux-kernel@vger.kernel.org Subject: [PATCH] Fix FRV PCI config space write User-Agent: EMH/1.14.1 SEMI/1.14.5 (Awara-Onsen) FLIM/1.14.5 (Demachiyanagi) APEL/10.6 Emacs/21.3 (i386-redhat-linux-gnu) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: text/plain; charset=US-ASCII Date: Mon, 22 Nov 2004 16:14:51 +0000 Message-ID: <14527.1101140091@redhat.com> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org The attached patch makes byte and word writes to PCI config space work. The problem was that the pointer to the appropriate chunk of the config port needs to be juggled to allow for the fact that FRV is big endian in this case. Signed-Off-By: David Howells --- warthog>diffstat pci-write-2610rc2mm3.diff pci-vdk.c | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) diff -uNr /warthog/kernels/linux-2.6.10-rc2-mm3/arch/frv/mb93090-mb00/pci-vdk.c linux-2.6.10-rc2-mm3-frv/arch/frv/mb93090-mb00/pci-vdk.c --- /warthog/kernels/linux-2.6.10-rc2-mm3/arch/frv/mb93090-mb00/pci-vdk.c 2004-11-22 10:53:41.000000000 +0000 +++ linux-2.6.10-rc2-mm3-frv/arch/frv/mb93090-mb00/pci-vdk.c 2004-11-22 11:45:09.905240995 +0000 @@ -44,9 +44,14 @@ #define __get_PciCfgDataW(A) readw((volatile void __iomem *) __region_CS1 + 0x88 + ((A) & 2)) #define __get_PciCfgDataL(A) readl((volatile void __iomem *) __region_CS1 + 0x88) -#define __set_PciCfgDataB(A,V) writeb((V), (volatile void __iomem *) __region_CS1 + 0x88 + ((A) & 3)) -#define __set_PciCfgDataW(A,V) writew((V), (volatile void __iomem *) __region_CS1 + 0x88 + ((A) & 2)) -#define __set_PciCfgDataL(A,V) writel((V), (volatile void __iomem *) __region_CS1 + 0x88) +#define __set_PciCfgDataB(A,V) \ + writeb((V), (volatile void __iomem *) __region_CS1 + 0x88 + (3 - ((A) & 3))) + +#define __set_PciCfgDataW(A,V) \ + writew((V), (volatile void __iomem *) __region_CS1 + 0x88 + (2 - ((A) & 2))) + +#define __set_PciCfgDataL(A,V) \ + writel((V), (volatile void __iomem *) __region_CS1 + 0x88) #define __get_PciBridgeDataB(A) readb((volatile void __iomem *) __region_CS1 + 0x800 + (A)) #define __get_PciBridgeDataW(A) readw((volatile void __iomem *) __region_CS1 + 0x800 + (A))