From patchwork Tue Jul 18 06:49:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell Currey X-Patchwork-Id: 789937 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xBW3t5Vr9z9sBR for ; Tue, 18 Jul 2017 16:49:30 +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="fcnH5Ygi"; 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 3xBW3t2kTxzDrGQ for ; Tue, 18 Jul 2017 16:49:30 +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="fcnH5Ygi"; 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 3xBW3h4C9ZzDrFh for ; Tue, 18 Jul 2017 16:49:19 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="fcnH5Ygi"; dkim-atps=neutral Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 2B02820B88; Tue, 18 Jul 2017 02:49:17 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute6.internal (MEProxy); Tue, 18 Jul 2017 02:49:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:message-id:subject:to :x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s=fm1; bh=O4/es9 j2fJXd2JVH57hv5gpcnDqrIE1/m/qdYCjiGFM=; b=fcnH5YgiPCEfKln8yTY2zB Q6EpqnHXumUnlhakEXySFlcp/nSaHLD+S9vM/SpaOLVSoKVs4+ppZcXSFYMlkndA 0xqFZ7bvZiFIQ+QO2Jedvx5qeQDDfq/G46hfaLovRyLz+nlk4x7eXXOJLgzdvQRj SDZ+8h0U6xYuUc3YFMMbIYd2x4wkJxnTG/VB8VrmkppM3OjQoRvcekQJ2aXcpd+u o+WqsUb9vSOcoqIQtmqn00ndNV4ny+ocjG98cjJbIQifEPi/PbIg0+dbtkgTE9Oi 1OpCmQa8pcSWiF8StwYa6TUnCS3xuXUh4cqs6o+S+VT6ZDPaX5E14kCVN/RUf6zA == X-ME-Sender: X-Sasl-enc: uljGlJS9BFXbq5irexcpDzQ/Ch3Dy8e/L8o2pXBECeDw 1500360556 Received: from snap.ozlabs.ibm.com (unknown [122.99.82.10]) by mail.messagingengine.com (Postfix) with ESMTPA id 0E5A37E855; Tue, 18 Jul 2017 02:49:15 -0400 (EDT) From: Russell Currey To: skiboot@lists.ozlabs.org Date: Tue, 18 Jul 2017 16:49:12 +1000 Message-Id: <20170718064912.12513-1-ruscur@russell.cc> X-Mailer: git-send-email 2.13.3 Subject: [Skiboot] [PATCH] phb4: Initialization sequence updates 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" Mostly errata workarounds, some DD1 specific. The step Init_5 was moved to Init_16, so the numbering was updated to reflect this. Signed-off-by: Russell Currey --- hw/phb4.c | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/hw/phb4.c b/hw/phb4.c index 2f3af3ae..eece5f07 100644 --- a/hw/phb4.c +++ b/hw/phb4.c @@ -3588,7 +3588,10 @@ static void phb4_init_errors(struct phb4 *p) out_be64(p->regs + 0x1908, 0x0000000000000000ull); out_be64(p->regs + 0x1920, 0x000000004d1780f8ull); out_be64(p->regs + 0x1928, 0x0000000000000000ull); - out_be64(p->regs + 0x1930, 0xffffffffb2e87f07ull); + if (p->rev == PHB4_REV_NIMBUS_DD10) + out_be64(p->regs + 0x1930, 0xffffffffb2e87f07ull); + else + out_be64(p->regs + 0x1930, 0xffffffffb2f87f07ull); out_be64(p->regs + 0x1940, 0x0000000000000000ull); out_be64(p->regs + 0x1948, 0x0000000000000000ull); out_be64(p->regs + 0x1950, 0x0000000000000000ull); @@ -3603,12 +3606,12 @@ static void phb4_init_errors(struct phb4 *p) out_be64(p->regs + 0x1c40, 0x0000000000000000ull); out_be64(p->regs + 0x1c48, 0x0000000000000000ull); out_be64(p->regs + 0x1c50, 0x0000000000000000ull); - out_be64(p->regs + 0x1c58, 0x0000000000000000ull); + out_be64(p->regs + 0x1c58, 0x0040000000000000ull); /* Init_73..81 - TXE errors */ out_be64(p->regs + 0x0d00, 0xffffffffffffffffull); out_be64(p->regs + 0x0d08, 0x0000000000000000ull); - out_be64(p->regs + 0x0d18, 0xffffffffffffffffull); + out_be64(p->regs + 0x0d18, 0xffffff0fffffffffull); out_be64(p->regs + 0x0d28, 0x0000400a00000000ull); out_be64(p->regs + 0x0d30, 0xdff7fd01f7ddfff0ull); /* XXX CAPI has diff. value */ out_be64(p->regs + 0x0d40, 0x0000000000000000ull); @@ -3624,7 +3627,10 @@ static void phb4_init_errors(struct phb4 *p) out_be64(p->regs + 0x0da8, 0xc00000b801000060ull); else out_be64(p->regs + 0x0da8, 0xc00008b801000060ull); - out_be64(p->regs + 0x0db0, 0x3bffd703fe7fbf8full); /* XXX CAPI has diff. value */ + if (p->rev == PHB4_REV_NIMBUS_DD10) /* XXX CAPI has diff. value */ + out_be64(p->regs + 0x0db0, 0x3bffd703fe7fbf8full); + else + out_be64(p->regs + 0x0db0, 0xfbffd703fe7fbf8full); out_be64(p->regs + 0x0dc0, 0x0000000000000000ull); out_be64(p->regs + 0x0dc8, 0x0000000000000000ull); out_be64(p->regs + 0x0dd0, 0x0000000000000000ull); @@ -3635,7 +3641,10 @@ static void phb4_init_errors(struct phb4 *p) out_be64(p->regs + 0x0e08, 0x0000000000000000ull); out_be64(p->regs + 0x0e18, 0xffffffffffffffffull); out_be64(p->regs + 0x0e28, 0x0000600000000000ull); - out_be64(p->regs + 0x0e30, 0xffff9effff7fff57ull); /* XXX CAPI has diff. value */ + if (p->rev == PHB4_REV_NIMBUS_DD10) /* XXX CAPI has diff. value */ + out_be64(p->regs + 0x0e30, 0xffff9effff7fff57ull); + else + out_be64(p->regs + 0x0e30, 0xfffffeffff7fff57ull); out_be64(p->regs + 0x0e40, 0x0000000000000000ull); out_be64(p->regs + 0x0e48, 0x0000000000000000ull); out_be64(p->regs + 0x0e50, 0x0000000000000000ull); @@ -3734,16 +3743,13 @@ static void phb4_init_hw(struct phb4 *p, bool first_init) PHBDBG(p, "New system config : 0x%016llx\n", in_be64(p->regs + PHB_PCIE_SCR)); - /* Init_5 - Wait for DLP PGRESET to clear */ - /* This is broken in spec 053, moving that step to after Init_16 */ - - /* Init_6 - deassert CFG reset */ + /* Init_5 - deassert CFG reset */ creset = in_be64(p->regs + PHB_PCIE_CRESET); PHBDBG(p, "Initial PHB CRESET is 0x%016llx\n", creset); creset &= ~PHB_PCIE_CRESET_CFG_CORE; out_be64(p->regs + PHB_PCIE_CRESET, creset); - /* Init_7..14 - PCIE DLP Lane EQ control */ + /* Init_6..13 - PCIE DLP Lane EQ control */ if (p->lane_eq) { out_be64(p->regs + PHB_PCIE_LANE_EQ_CNTL0, be64_to_cpu(p->lane_eq[0])); out_be64(p->regs + PHB_PCIE_LANE_EQ_CNTL1, be64_to_cpu(p->lane_eq[1])); @@ -3759,11 +3765,11 @@ static void phb4_init_hw(struct phb4 *p, bool first_init) } } - /* Init_15 - Clear link training */ + /* Init_14 - Clear link training */ phb4_pcicfg_write32(&p->phb, 0, 0x78, 0x07FE0000 | p->max_link_speed); - /* Init_16 - deassert cores reset */ + /* Init_15 - deassert cores reset */ /* * Lift the PHB resets but not PERST, this will be lifted * later by the initial PERST state machine @@ -3772,7 +3778,7 @@ 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) */ + /* Init_16 - Wait for DLP PGRESET to clear */ if (!phb4_wait_dlp_reset(p)) goto failed; @@ -3836,7 +3842,7 @@ static void phb4_init_hw(struct phb4 *p, bool first_init) /* Init_126..130 - Re-enable error interrupts */ out_be64(p->regs + PHB_ERR_IRQ_ENABLE, 0xca8880cc00000000ull); - out_be64(p->regs + PHB_TXE_ERR_IRQ_ENABLE, 0x200840fe08200000ull); + out_be64(p->regs + PHB_TXE_ERR_IRQ_ENABLE, 0x2008400e08200000ull); out_be64(p->regs + PHB_RXE_ARB_ERR_IRQ_ENABLE, 0xc40028fc01804070ull); out_be64(p->regs + PHB_RXE_MRG_ERR_IRQ_ENABLE, 0x00006100008000a8ull); if (p->rev == PHB4_REV_NIMBUS_DD10)