From owner-svn-src-all@FreeBSD.ORG Fri Mar 6 20:40:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B0B31065672; Fri, 6 Mar 2009 20:40:10 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E291E8FC1C; Fri, 6 Mar 2009 20:40:09 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n26Ke93h028584; Fri, 6 Mar 2009 20:40:09 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n26Ke9iZ028583; Fri, 6 Mar 2009 20:40:09 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200903062040.n26Ke9iZ028583@svn.freebsd.org> From: Sam Leffler Date: Fri, 6 Mar 2009 20:40:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189456 - head/sys/arm/xscale/ixp425 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2009 20:40:10 -0000 Author: sam Date: Fri Mar 6 20:40:09 2009 New Revision: 189456 URL: http://svn.freebsd.org/changeset/base/189456 Log: o simplify code in ixppcib_conf_setup o fixup debug printfs Modified: head/sys/arm/xscale/ixp425/ixp425_pci.c Modified: head/sys/arm/xscale/ixp425/ixp425_pci.c ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425_pci.c Fri Mar 6 20:17:16 2009 (r189455) +++ head/sys/arm/xscale/ixp425/ixp425_pci.c Fri Mar 6 20:40:09 2009 (r189456) @@ -352,21 +352,15 @@ ixppcib_conf_setup(struct ixppcib_softc int reg) { if (bus == 0) { - if (slot == 0 && func == 0) { - PCI_CSR_WRITE_4(sc, PCI_NP_AD, (reg & ~3)); - } else { - bus &= 0xff; - slot &= 0x1f; - func &= 0x07; - /* configuration type 0 */ - PCI_CSR_WRITE_4(sc, PCI_NP_AD, (1U << (32 - slot)) | - (func << 8) | (reg & ~3)); - } + /* configuration type 0 */ + PCI_CSR_WRITE_4(sc, PCI_NP_AD, + (1U << (32 - (slot & 0x1f))) | + ((func & 0x7) << 8) | (reg & ~3)); } else { - /* configuration type 1 */ + /* configuration type 1 */ PCI_CSR_WRITE_4(sc, PCI_NP_AD, - (bus << 16) | (slot << 11) | - (func << 8) | (reg & ~3) | 1); + (bus << 16) | (slot << 11) | + (func << 8) | (reg & ~3) | 1); } } @@ -392,9 +386,9 @@ ixppcib_read_config(device_t dev, u_int ret >>= (reg & 3) * 8; ret &= 0xffffffff >> ((4 - bytes) * 8); #if 0 - device_printf(dev, "read config: %u:%u:%u %#x(%d) = %#x\n", bus, slot, func, reg, bytes, ret); + device_printf(dev, "%s: %u:%u:%u %#x(%d) = %#x\n", + __func__, bus, slot, func, reg, bytes, ret); #endif - /* check & clear PCI abort */ data = PCI_CSR_READ_4(sc, PCI_ISR); if (data & ISR_PFE) { @@ -414,9 +408,9 @@ ixppcib_write_config(device_t dev, u_int u_int32_t data; #if 0 - device_printf(dev, "write config: %u:%u:%u %#x(%d) = %#x\n", bus, slot, func, reg, bytes, val); + device_printf(dev, "%s: %u:%u:%u %#x(%d) = %#x\n", + __func__, bus, slot, func, reg, bytes, val); #endif - ixppcib_conf_setup(sc, bus, slot, func, reg & ~3); /* Byte enables are active low, so not them first */