Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1431117ybb; Thu, 26 Mar 2020 00:09:00 -0700 (PDT) X-Google-Smtp-Source: ADFU+vttDtBnAR2GyTBfDSJ7fuv9gt9l9q3cABgELJPyCG1SxLoTMGzRfugIBMTDBgVkYxpTjV1y X-Received: by 2002:aca:5057:: with SMTP id e84mr926024oib.120.1585206540606; Thu, 26 Mar 2020 00:09:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585206540; cv=none; d=google.com; s=arc-20160816; b=shPS1a7pcEp5erC8DZjuOwyWF2A4NRe6o/N6aMU0kTSP1wVUIxHCbHyfcbr4Bejuzl Obck+1JqNkcXegZnRZSwZuvTMb9Sc0689VNgMUw4Y7V1qSLbAndWX4UT48qowJ0pRSgl OUReV/cNQotaGUtid0je2c7JPpxSW90/EnaP2fQrk9rthK4AgjepSviwmfYnjqOJo+GG AZN5JfX2J5g56DKLNIinK1y5FnPpIvZAHbGnVMHg/hlCSGQCFang9WJhVVNd+GSZA7FC u84R0jTyMFptrSifnANcT4cscvVhua+kqzZknqL0Oyn6gZyNjcgE2xuUNhO4tA6K+UHv a0Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=usE/ys/z8ZrEvebTD5q/zOIViwN/Qr3bNxaYZNYeDg8=; b=sx1g0PjwWrMR6uXCP9BUStZt0G1CXxo9MYVvJVnj3CPAe2CMQ9NZhW8yb+iNN89r4f zmCJV+NOaqWUcI5OIAm4qHuZBm6ZgX/BZqrWwfihFkdoF0ckJwIXiQ35w2SFCUczksJa H+hSJwuygoG010oU+X24w86qlqyzNawWXYTI8NBwwPwViif4uZ/JOOYnSfAis8HlGHLn nx75EPvJvN40E/w6Ik9jOtjsTWLTNk708mZEjILe+RT/1npg/r/Gc2jaX3GUfBwNa1R7 gegd9kleK+1gIZxqudE+nMcz0uqMzfr9oGKQh9vdtDdLvPY+VTe86MB7sXfbdTPbLo1J fagA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=Giw12tZA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l19si693865otp.119.2020.03.26.00.08.48; Thu, 26 Mar 2020 00:09:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=Giw12tZA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727831AbgCZHIP (ORCPT + 99 others); Thu, 26 Mar 2020 03:08:15 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:39730 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727817AbgCZHIN (ORCPT ); Thu, 26 Mar 2020 03:08:13 -0400 Received: by mail-wm1-f67.google.com with SMTP id a9so5750837wmj.4 for ; Thu, 26 Mar 2020 00:08:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=usE/ys/z8ZrEvebTD5q/zOIViwN/Qr3bNxaYZNYeDg8=; b=Giw12tZAymXDFbxQpbLEzz6w7r0O1eeZFHByJRUEwF4s3fssUnmfVK37HovY8MSG8g aB0CYd0nDge3IebAXKcKCn8DL9FO01QrQqv4ZQkSxBXz+3/jUAxHH7CjlMq4PusOsrRa AIAUX+paTRcoYbFPrM7u3LFEUrqEoZNo+GqDI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=usE/ys/z8ZrEvebTD5q/zOIViwN/Qr3bNxaYZNYeDg8=; b=HSvyzHs1dAFgc1sXgLrng8TSJz4DkE1/E48WdpvZ3Xk7JcNtfopbPhp3zsEf1Dbgfl Zsbj2EzHko08yEmBTTqLpKLtnOJ3YHgM+DX9cNdDtrB6LqAJlddOyr6MSnAcdtnBIDd0 oKJSLpim4KjNkf/w3sbaiP1I8MeyXGvfnDo13F9hvI1azXDpF7NYUhsC6h39R52v9M0t Do4VsmMLWa+XiCA0QE+KLP6RMlWahclpvBIzaylzcN6lgGPma1UxzaCkcuIZumCLAV0D AE9w/tt8Ivq60FK4slwjnWQoCk3dXUyK2IKMxJJqizeTckDoVDyiXnkOREgH2Cyn6BUI OpHg== X-Gm-Message-State: ANhLgQ1Te+RALPr2uPc5Cvr4XEfd9/PRpg8n0W4O509tw9xsmHknEVat o5/ie4udF9lmDytbFheyatB8yQ== X-Received: by 2002:a1c:8090:: with SMTP id b138mr1644314wmd.55.1585206491567; Thu, 26 Mar 2020 00:08:11 -0700 (PDT) Received: from mannams-OptiPlex-7010.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id u8sm2129446wrn.69.2020.03.26.00.08.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Mar 2020 00:08:10 -0700 (PDT) From: Srinath Mannam To: Lorenzo Pieralisi , Bjorn Helgaas , Florian Fainelli , Ray Jui , Andrew Murray Cc: bcm-kernel-feedback-list@broadcom.com, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Srinath Mannam Subject: [PATCH 3/3] PCI: iproc: Display PCIe Link information Date: Thu, 26 Mar 2020 12:37:27 +0530 Message-Id: <1585206447-1363-4-git-send-email-srinath.mannam@broadcom.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1585206447-1363-1-git-send-email-srinath.mannam@broadcom.com> References: <1585206447-1363-1-git-send-email-srinath.mannam@broadcom.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add more comprehensive information to show PCIe link speed and link width to the console. Signed-off-by: Srinath Mannam --- drivers/pci/controller/pcie-iproc.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/pcie-iproc.c b/drivers/pci/controller/pcie-iproc.c index e7f0d58..ed41357 100644 --- a/drivers/pci/controller/pcie-iproc.c +++ b/drivers/pci/controller/pcie-iproc.c @@ -823,6 +823,8 @@ static int iproc_pcie_check_link(struct iproc_pcie *pcie) #define PCI_TARGET_LINK_SPEED_MASK 0xf #define PCI_TARGET_LINK_SPEED_GEN2 0x2 #define PCI_TARGET_LINK_SPEED_GEN1 0x1 +#define PCI_TARGET_LINK_WIDTH_MASK 0x3f +#define PCI_TARGET_LINK_WIDTH_OFFSET 0x4 iproc_pci_raw_config_read32(pcie, 0, IPROC_PCI_EXP_CAP + PCI_EXP_LNKCTL2, 4, &link_ctrl); @@ -843,7 +845,14 @@ static int iproc_pcie_check_link(struct iproc_pcie *pcie) } } - dev_info(dev, "link: %s\n", link_is_active ? "UP" : "DOWN"); + if (link_is_active) { + dev_info(dev, "link UP @ Speed Gen-%d and width-x%d\n", + link_status & PCI_TARGET_LINK_SPEED_MASK, + (link_status >> PCI_TARGET_LINK_WIDTH_OFFSET) & + PCI_TARGET_LINK_WIDTH_MASK); + } else { + dev_info(dev, "link DOWN\n"); + } return link_is_active ? 0 : -ENODEV; } -- 2.7.4