From patchwork Fri Jun 9 06:06:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell Currey X-Patchwork-Id: 773664 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wkWyj1Nw4z9s72 for ; Fri, 9 Jun 2017 16:06:53 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="nF8eFOm9"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3wkWyj0LdxzDqMF for ; Fri, 9 Jun 2017 16:06:53 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="nF8eFOm9"; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3wkWyC3cMTzDqLK for ; Fri, 9 Jun 2017 16:06:27 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="nF8eFOm9"; dkim-atps=neutral Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id D6E6E20BB8; Fri, 9 Jun 2017 02:06:24 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute6.internal (MEProxy); Fri, 09 Jun 2017 02:06:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc :x-sasl-enc; s=fm1; bh=BY373OA9YfYbmzkrd6TqHSiDmY5AP9unrjjaxDBoJ U8=; b=nF8eFOm9bIiHjfYxCVyTnzJj62Ti/aC68FEOJtIu5W+dXWt7LRWuXr7qk QcPjAcAvARUTKHzcmWKKQ/i9JpNHFop8q1j0Q5vXC4ViBpybisQ1ftkOT9MJz6Uf 7dwEnYIgvMPskZO5rdQWwDpfOQfOGDJXUytNIcyDgS6se80xNcUuUGFolc3fEjgo gyFd0Fe0ONeJOrMaL46Dwv8tiSOIGyPOY1yi3gsSUnElb1CNFtzvx6ypGfeONxyJ eBGWFlhfnQ7LaHyKYhpG/P8P6YhX4mWw+gvaK+ISxcybEC3QMh2OOk9yWk/g5XDt Il8kDxUEZX12Z0i/R1v38RKm1pK8g== X-ME-Sender: X-Sasl-enc: uENi5Td2Bx8+Py1wFFUnbHdQavS87LHWhQX0ki6hX89k 1496988384 Received: from snap.ozlabs.ibm.com (unknown [122.99.82.10]) by mail.messagingengine.com (Postfix) with ESMTPA id 7C9057E545; Fri, 9 Jun 2017 02:06:23 -0400 (EDT) From: Russell Currey To: skiboot@lists.ozlabs.org Date: Fri, 9 Jun 2017 16:06:03 +1000 Message-Id: <20170609060606.17796-3-ruscur@russell.cc> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20170609060606.17796-1-ruscur@russell.cc> References: <20170609060606.17796-1-ruscur@russell.cc> Subject: [Skiboot] [PATCH 2/5] phb4: Implement root port initialization X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" phb4_root_port_init() was a NOP before, so fix that. Nothing PHB4-specific here. Something may be required in future. Signed-off-by: Russell Currey --- hw/phb4.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/hw/phb4.c b/hw/phb4.c index c97861aa..3957a051 100644 --- a/hw/phb4.c +++ b/hw/phb4.c @@ -486,16 +486,22 @@ static int64_t phb4_get_reserved_pe_number(struct phb *phb) } -static void phb4_root_port_init(struct phb *phb __unused, - struct pci_device *dev __unused, - int ecap __unused, - int aercap __unused) +static void phb4_root_port_init(struct phb *phb, struct pci_device *dev, + int ecap, int aercap) { -#if 0 uint16_t bdfn = dev->bdfn; uint16_t val16; uint32_t val32; + /* + * Use the PHB's callback so that UTL events will be masked or + * unmasked when the link is down or up. + */ + if (dev->slot && dev->slot->ops.prepare_link_change && + phb->slot && phb->slot->ops.prepare_link_change) + dev->slot->ops.prepare_link_change = + phb->slot->ops.prepare_link_change; + // FIXME: check recommended init values for phb4 /* Enable SERR and parity checking */ @@ -549,7 +555,6 @@ static void phb4_root_port_init(struct phb *phb __unused, PCIECAP_AER_RERR_CMD_NFE | PCIECAP_AER_RERR_CMD_CE); pci_cfg_write32(phb, bdfn, aercap + PCIECAP_AER_RERR_CMD, val32); -#endif } static void phb4_switch_port_init(struct phb *phb,