From patchwork Sun Feb 8 16:11:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 5797741 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 474A59F30C for ; Sun, 8 Feb 2015 16:12:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 50A0D20166 for ; Sun, 8 Feb 2015 16:12:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 61B8C2012D for ; Sun, 8 Feb 2015 16:12:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755649AbbBHQMG (ORCPT ); Sun, 8 Feb 2015 11:12:06 -0500 Received: from mail-we0-f182.google.com ([74.125.82.182]:43800 "EHLO mail-we0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755657AbbBHQMD (ORCPT ); Sun, 8 Feb 2015 11:12:03 -0500 Received: by mail-we0-f182.google.com with SMTP id l61so22394480wev.13 for ; Sun, 08 Feb 2015 08:12:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=nQZa4jTPR+igItAfZ7vsX3IQwR+pr3i4dCcLmVkXvxg=; b=s6BelCGyuaoLyD83wYOVpYMeQEAXHswc6gDObLFghvJda8rgUxGZuy6FR+GLvjV7ur EYaMNXW9fPQPUjQ9EvGaywq966rEhu1bbtivGgDQPmsfLdsID5m/nTJVupxGf5yVlz7B I42Q0/IZmCq369ZA0sLaMBczEJ1TwnbV2ObL+gLkD8nadyGHksMkIE/1Aw1iimWAs9Bf cBkXvIwqMg/yGS4DChgDYnzWOguV0N5A0wdwBQlqpqOueXYKuKpu+cdmmj4DFfmjct/c d5mmeYCQn1q68OI6WrNgJCbkwNgUp9GQCWZn6cgvAFnC+XSyY9b2zjFQpzo2X7cArFz9 DKYw== X-Received: by 10.180.95.162 with SMTP id dl2mr26222970wib.31.1423411922736; Sun, 08 Feb 2015 08:12:02 -0800 (PST) Received: from linux-tdhb.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by mx.google.com with ESMTPSA id fw5sm12502911wjb.14.2015.02.08.08.12.01 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Feb 2015 08:12:02 -0800 (PST) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: Kalle Valo , linux-wireless@vger.kernel.org Cc: Hauke Mehrtens , brcm80211-dev-list@broadcom.com, =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Subject: [PATCH V3 4/4] bcma: enable support for PCIe Gen 2 host devices Date: Sun, 8 Feb 2015 17:11:50 +0100 Message-Id: <1423411910-22399-4-git-send-email-zajec5@gmail.com> X-Mailer: git-send-email 1.8.4.5 In-Reply-To: <1423411910-22399-1-git-send-email-zajec5@gmail.com> References: <1423409504-16435-1-git-send-email-zajec5@gmail.com> <1423411910-22399-1-git-send-email-zajec5@gmail.com> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Rafa? Mi?ecki --- drivers/bcma/bcma_private.h | 1 + drivers/bcma/host_pci.c | 15 ++++++++++++++- drivers/bcma/main.c | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/bcma/bcma_private.h b/drivers/bcma/bcma_private.h index 3692912..29565e3 100644 --- a/drivers/bcma/bcma_private.h +++ b/drivers/bcma/bcma_private.h @@ -26,6 +26,7 @@ bool bcma_wait_value(struct bcma_device *core, u16 reg, u32 mask, u32 value, int timeout); void bcma_prepare_core(struct bcma_bus *bus, struct bcma_device *core); void bcma_init_bus(struct bcma_bus *bus); +void bcma_unregister_cores(struct bcma_bus *bus); int bcma_bus_register(struct bcma_bus *bus); void bcma_bus_unregister(struct bcma_bus *bus); int __init bcma_bus_early_register(struct bcma_bus *bus); diff --git a/drivers/bcma/host_pci.c b/drivers/bcma/host_pci.c index 5fb87a8..a62a2f9 100644 --- a/drivers/bcma/host_pci.c +++ b/drivers/bcma/host_pci.c @@ -213,16 +213,26 @@ static int bcma_host_pci_probe(struct pci_dev *dev, /* Initialize struct, detect chip */ bcma_init_bus(bus); + /* Scan bus to find out generation of PCIe core */ + err = bcma_bus_scan(bus); + if (err) + goto err_pci_unmap_mmio; + + if (bcma_find_core(bus, BCMA_CORE_PCIE2)) + bus->host_is_pcie2 = true; + /* Register */ err = bcma_bus_register(bus); if (err) - goto err_pci_unmap_mmio; + goto err_unregister_cores; pci_set_drvdata(dev, bus); out: return err; +err_unregister_cores: + bcma_unregister_cores(bus); err_pci_unmap_mmio: pci_iounmap(dev, bus->mmio); err_pci_release_regions: @@ -283,9 +293,12 @@ static const struct pci_device_id bcma_pci_bridge_tbl[] = { { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4357) }, { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4358) }, { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4359) }, + { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4360) }, { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4365) }, + { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43a0) }, { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43a9) }, { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43aa) }, + { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43b1) }, { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4727) }, { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 43227) }, /* 0xa8db, BCM43217 (sic!) */ { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 43228) }, /* 0xa8dc */ diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c index 38bde6e..9635f10 100644 --- a/drivers/bcma/main.c +++ b/drivers/bcma/main.c @@ -363,7 +363,7 @@ static int bcma_register_devices(struct bcma_bus *bus) return 0; } -static void bcma_unregister_cores(struct bcma_bus *bus) +void bcma_unregister_cores(struct bcma_bus *bus) { struct bcma_device *core, *tmp;