From patchwork Wed May 22 13:12:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 2601821 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 4DA26DF215 for ; Wed, 22 May 2013 13:12:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754836Ab3EVNMq (ORCPT ); Wed, 22 May 2013 09:12:46 -0400 Received: from mail.free-electrons.com ([94.23.35.102]:38810 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754348Ab3EVNMq (ORCPT ); Wed, 22 May 2013 09:12:46 -0400 Received: by mail.free-electrons.com (Postfix, from userid 106) id 92F92BB1; Wed, 22 May 2013 15:12:45 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.3.2 Received: from localhost (col31-4-88-188-83-94.fbx.proxad.net [88.188.83.94]) by mail.free-electrons.com (Postfix) with ESMTPSA id 07D4F744; Wed, 22 May 2013 15:12:44 +0200 (CEST) From: Thomas Petazzoni To: Bjorn Helgaas , linux-pci@vger.kernel.org, Jason Cooper , Andrew Lunn , Gregory Clement Cc: Ezequiel Garcia , Lior Amsalem , Maen Suleiman , Jason Gunthorpe , linux-arm-kernel@lists.infradead.org Subject: [PATCH 3/4] pci: mvebu: emulate an empty capability list Date: Wed, 22 May 2013 15:12:37 +0200 Message-Id: <1369228358-32580-4-git-send-email-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1369228358-32580-1-git-send-email-thomas.petazzoni@free-electrons.com> References: <1369228358-32580-1-git-send-email-thomas.petazzoni@free-electrons.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Currently, our PCI-to-PCI bridge emulation doesn't emulate a proper capability list, which leads 'lspci -v' to show: Capabilities: [fc] In order to fix this, this commit improve the PCI-to-PCI bridge emulation to emulate an empty capability list. It might be later extended to expose things like the PCI Express Capability header, but an empty capability list is sufficient for now. lspci -v now shows the much nicer: Capabilities: [40] #00 [0000] Signed-off-by: Thomas Petazzoni --- drivers/pci/host/pci-mvebu.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/pci/host/pci-mvebu.c b/drivers/pci/host/pci-mvebu.c index c21ca84..c887598 100644 --- a/drivers/pci/host/pci-mvebu.c +++ b/drivers/pci/host/pci-mvebu.c @@ -440,6 +440,16 @@ static int mvebu_sw_pci_bridge_read(struct mvebu_pcie_port *port, *value = 0; break; + case PCI_CAPABILITY_LIST: + /* Offset of the capability list */ + *value = 0x40; + break; + + case 0x40: + /* We have no element in our capability list */ + *value = 0; + break; + default: *value = 0xffffffff; return PCIBIOS_BAD_REGISTER_NUMBER;