From patchwork Sat Jun 24 19:17:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Neuling X-Patchwork-Id: 780376 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 3ww4r02LqFz9s3T for ; Sun, 25 Jun 2017 05:19:12 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3ww4r01ZzXzDr1h for ; Sun, 25 Jun 2017 05:19:12 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from ozlabs.org (ozlabs.org [103.22.144.67]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3ww4p82dhvzDr1f for ; Sun, 25 Jun 2017 05:17:36 +1000 (AEST) Received: from localhost.localdomain (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 3ww4p75hhSz9s3T; Sun, 25 Jun 2017 05:17:35 +1000 (AEST) Received: by localhost.localdomain (Postfix, from userid 1000) id 3CCE7EEE100; Sun, 25 Jun 2017 05:17:35 +1000 (AEST) From: Michael Neuling To: stewart@linux.vnet.ibm.com Date: Sat, 24 Jun 2017 14:17:08 -0500 Message-Id: <20170624191728.14793-4-mikey@neuling.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170624191728.14793-1-mikey@neuling.org> References: <20170624191728.14793-1-mikey@neuling.org> Subject: [Skiboot] [PATCH v2 03/23] phb4: Workaround bug in spec 053 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: , Cc: skiboot@lists.ozlabs.org, Michael Neuling MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" From: Benjamin Herrenschmidt Wait for DLP PGRESET to clear *after* lifting the PCIe core reset Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Michael Neuling --- hw/phb4.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/phb4.c b/hw/phb4.c index 5e709fee9d..d3e170aa3a 100644 --- a/hw/phb4.c +++ b/hw/phb4.c @@ -3544,8 +3544,7 @@ static void phb4_init_hw(struct phb4 *p, bool first_init) in_be64(p->regs + PHB_PCIE_SCR)); /* Init_5 - Wait for DLP PGRESET to clear */ - if (!phb4_wait_dlp_reset(p)) - goto failed; + /* This is broken in spec 053, moving that step to after Init_16 */ /* Init_6 - deassert CFG reset */ creset = in_be64(p->regs + PHB_PCIE_CRESET); @@ -3582,6 +3581,10 @@ static void phb4_init_hw(struct phb4 *p, bool first_init) creset |= PHB_PCIE_CRESET_PIPE_N; out_be64(p->regs + PHB_PCIE_CRESET, creset); + /* (Moved from Init_5) */ + if (!phb4_wait_dlp_reset(p)) + goto failed; + /* Init_17 - PHB Control */ val = PHB_CTRLR_IRQ_PGSZ_64K; if (p->rev == PHB4_REV_NIMBUS_DD10) {