From owner-svn-src-all@freebsd.org Tue Oct 30 00:47:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8786210EED9B; Tue, 30 Oct 2018 00:47:41 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 37B7D8D2DA; Tue, 30 Oct 2018 00:47:41 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0BB2415F31; Tue, 30 Oct 2018 00:47:41 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9U0leCk059214; Tue, 30 Oct 2018 00:47:40 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9U0leix059213; Tue, 30 Oct 2018 00:47:40 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201810300047.w9U0leix059213@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 30 Oct 2018 00:47:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339902 - head/sys/powerpc/mpc85xx X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/mpc85xx X-SVN-Commit-Revision: 339902 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 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: Tue, 30 Oct 2018 00:47:41 -0000 Author: jhibbits Date: Tue Oct 30 00:47:40 2018 New Revision: 339902 URL: https://svnweb.freebsd.org/changeset/base/339902 Log: powerpc/mpc85xx: Reset the PCIe bus on attach It seems if a Radeon card is already initialized by u-boot, it won't be reinitialized by the kernel, and the DRM module will fail to attach. This steals the reset code from mips/octopci.c to blindly reset the bus on attach. This was tested on a AmigaOne X5000/20, such that it can be booted from the local video console, and get a video console in FreeBSD. Modified: head/sys/powerpc/mpc85xx/pci_mpc85xx.c Modified: head/sys/powerpc/mpc85xx/pci_mpc85xx.c ============================================================================== --- head/sys/powerpc/mpc85xx/pci_mpc85xx.c Tue Oct 30 00:23:37 2018 (r339901) +++ head/sys/powerpc/mpc85xx/pci_mpc85xx.c Tue Oct 30 00:47:40 2018 (r339902) @@ -562,7 +562,7 @@ fsl_pcib_init(struct fsl_pcib_softc *sc, int bus, int int new_pribus, new_secbus, new_subbus; int slot, func, maxfunc; uint16_t vendor, device; - uint8_t command, hdrtype, subclass; + uint8_t brctl, command, hdrtype, subclass; secbus = bus; for (slot = 0; slot <= maxslot; slot++) { @@ -605,6 +605,17 @@ fsl_pcib_init(struct fsl_pcib_softc *sc, int bus, int /* Allow all DEVTYPE 1 devices */ if (hdrtype != PCIM_HDRTYPE_BRIDGE) continue; + + brctl = fsl_pcib_read_config(sc->sc_dev, bus, slot, func, + PCIR_BRIDGECTL_1, 1); + brctl |= PCIB_BCR_SECBUS_RESET; + fsl_pcib_write_config(sc->sc_dev, bus, slot, func, + PCIR_BRIDGECTL_1, brctl, 1); + DELAY(100000); + brctl &= ~PCIB_BCR_SECBUS_RESET; + fsl_pcib_write_config(sc->sc_dev, bus, slot, func, + PCIR_BRIDGECTL_1, brctl, 1); + DELAY(100000); secbus++;