From owner-svn-src-head@FreeBSD.ORG Thu Jan 24 11:42:16 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DC4C93A9; Thu, 24 Jan 2013 11:42:16 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C6EB1F7; Thu, 24 Jan 2013 11:42:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0OBgGIP015955; Thu, 24 Jan 2013 11:42:16 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0OBgGui015954; Thu, 24 Jan 2013 11:42:16 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201301241142.r0OBgGui015954@svn.freebsd.org> From: "Jayachandran C." Date: Thu, 24 Jan 2013 11:42:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245877 - head/sys/mips/nlm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2013 11:42:16 -0000 Author: jchandra Date: Thu Jan 24 11:42:16 2013 New Revision: 245877 URL: http://svnweb.freebsd.org/changeset/base/245877 Log: Little-endian fix for PCI on Broadcom XLP. Update the function xlp_pcib_hardware_swap_enable() to do nothing when BYTE_ORDER is not BIG_ENDIAN. PCIe hardware swap is not requred in little-endian mode as the endianness matches that of CPU. Modified: head/sys/mips/nlm/xlp_pci.c Modified: head/sys/mips/nlm/xlp_pci.c ============================================================================== --- head/sys/mips/nlm/xlp_pci.c Thu Jan 24 09:36:50 2013 (r245876) +++ head/sys/mips/nlm/xlp_pci.c Thu Jan 24 11:42:16 2013 (r245877) @@ -487,12 +487,14 @@ xlp_pcib_write_config(device_t dev, u_in } /* - * Enable byte swap in hardware. Program a link's PCIe SWAP regions - * from the link's IO and MEM address ranges. + * Enable byte swap in hardware when compiled big-endian. + * Programs a link's PCIe SWAP regions from the link's IO and MEM address + * ranges. */ static void xlp_pcib_hardware_swap_enable(int node, int link) { +#if BYTE_ORDER == BIG_ENDIAN uint64_t bbase, linkpcibase; uint32_t bar; int pcieoffset; @@ -514,6 +516,7 @@ xlp_pcib_hardware_swap_enable(int node, bar = nlm_read_bridge_reg(bbase, BRIDGE_PCIEIO_LIMIT0 + link); nlm_write_pci_reg(linkpcibase, PCIE_BYTE_SWAP_IO_LIM, bar | 0xFFF); +#endif } static int