From owner-svn-src-head@freebsd.org Sun Nov 10 04:24:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 24EF01A97A5; Sun, 10 Nov 2019 04:24:37 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 479grh6QSCz4XQJ; Sun, 10 Nov 2019 04:24:36 +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 BCA5C218D6; Sun, 10 Nov 2019 04:24:36 +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 xAA4Oa8O083812; Sun, 10 Nov 2019 04:24:36 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAA4OaPb083810; Sun, 10 Nov 2019 04:24:36 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201911100424.xAA4OaPb083810@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 10 Nov 2019 04:24:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354584 - head/sys/powerpc/powernv X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/powernv X-SVN-Commit-Revision: 354584 X-SVN-Commit-Repository: base 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.29 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: Sun, 10 Nov 2019 04:24:37 -0000 Author: jhibbits Date: Sun Nov 10 04:24:36 2019 New Revision: 354584 URL: https://svnweb.freebsd.org/changeset/base/354584 Log: powerpc64/powernv: Use OPAL call for non-POWER8 PCI TCE reset According to the OPAL documentation, only the POWER8 (PHB3) should use the register write TCE reset method. All others should use the OPAL call. On POWER9 the call is semantically identical to the register write, with a wait for completion. Modified: head/sys/powerpc/powernv/opal.h head/sys/powerpc/powernv/opal_pci.c Modified: head/sys/powerpc/powernv/opal.h ============================================================================== --- head/sys/powerpc/powernv/opal.h Sun Nov 10 03:45:16 2019 (r354583) +++ head/sys/powerpc/powernv/opal.h Sun Nov 10 04:24:36 2019 (r354584) @@ -129,6 +129,11 @@ int opal_call(uint64_t token, ...); #define OPAL_IGNORE_RID_FUNC_NUMBER 0 #define OPAL_COMPARE_RID_FUNC_NUMBER 1 +/* For OPAL_PCI_TCE_KILL */ +#define OPAL_PCI_TCE_KILL_PAGE 0 +#define OPAL_PCI_TCE_KILL_PE 1 +#define OPAL_PCI_TCE_KILL_ALL 2 + #define OPAL_SUCCESS 0 #define OPAL_PARAMETER -1 #define OPAL_BUSY -2 Modified: head/sys/powerpc/powernv/opal_pci.c ============================================================================== --- head/sys/powerpc/powernv/opal_pci.c Sun Nov 10 03:45:16 2019 (r354583) +++ head/sys/powerpc/powernv/opal_pci.c Sun Nov 10 04:24:36 2019 (r354584) @@ -409,10 +409,12 @@ opalpci_attach(device_t dev) /* * Invalidate all previous TCE entries. - * - * TODO: add support for other PHBs than PHB3 */ - pci_phb3_tce_invalidate_entire(sc); + if (ofw_bus_is_compatible(dev, "power8-pciex")) + pci_phb3_tce_invalidate_entire(sc); + else + opal_call(OPAL_PCI_TCE_KILL, sc->phb_id, OPAL_PCI_TCE_KILL_ALL, + OPAL_PCI_DEFAULT_PE, 0, 0, 0); /* * Get MSI properties