From owner-svn-src-all@FreeBSD.ORG Sun Aug 26 04:39:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BAE5B106564A; Sun, 26 Aug 2012 04:39:20 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A67FD8FC1A; Sun, 26 Aug 2012 04:39:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7Q4dK5x061950; Sun, 26 Aug 2012 04:39:20 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7Q4dKHU061948; Sun, 26 Aug 2012 04:39:20 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208260439.q7Q4dKHU061948@svn.freebsd.org> From: Adrian Chadd Date: Sun, 26 Aug 2012 04:39:20 +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: r239706 - head/sys/mips/atheros 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: Sun, 26 Aug 2012 04:39:20 -0000 Author: adrian Date: Sun Aug 26 04:39:20 2012 New Revision: 239706 URL: http://svn.freebsd.org/changeset/base/239706 Log: Ensure that BAR(0) is set for the PCI slot before the ath(4) PCI registers are written out. This allows EEPROM-less NICs on the AR7241 PCIe bus to be correctly initialised. Tested: * AP91 (AR7240+AR9285) - the existing board support didn't break; * AP99 (AR7241+AR9287) - this fixed the configuration of the AR9287 PCI. Modified: head/sys/mips/atheros/ar724x_pci.c Modified: head/sys/mips/atheros/ar724x_pci.c ============================================================================== --- head/sys/mips/atheros/ar724x_pci.c Sun Aug 26 04:36:59 2012 (r239705) +++ head/sys/mips/atheros/ar724x_pci.c Sun Aug 26 04:39:20 2012 (r239706) @@ -270,6 +270,10 @@ ar724x_pci_fixup(device_t dev, long flas /* Save bar(0) address - just to flush bar(0) (SoC WAR) ? */ bar0 = ar724x_pci_read_config(dev, 0, 0, 0, PCIR_BAR(0), 4); + /* Write temporary BAR0 to map the NIC into a fixed location */ + ar724x_pci_write_config(dev, 0, 0, 0, PCIR_BAR(0), + AR71XX_PCI_MEM_BASE, 4); + val = ar724x_pci_read_config(dev, 0, 0, 0, PCIR_COMMAND, 2); val |= (PCIM_CMD_BUSMASTEREN | PCIM_CMD_MEMEN); ar724x_pci_write_config(dev, 0, 0, 0, PCIR_COMMAND, val, 2);