From patchwork Mon Nov 12 07:29:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chi-Hsien Lin X-Patchwork-Id: 10678255 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 67A4B14DB for ; Mon, 12 Nov 2018 07:29:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 528E329F9B for ; Mon, 12 Nov 2018 07:29:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 45EEF29FD0; Mon, 12 Nov 2018 07:29:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C400A29F9B for ; Mon, 12 Nov 2018 07:29:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727021AbeKLRV1 (ORCPT ); Mon, 12 Nov 2018 12:21:27 -0500 Received: from mail-eopbgr760099.outbound.protection.outlook.com ([40.107.76.99]:33182 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725871AbeKLRV1 (ORCPT ); Mon, 12 Nov 2018 12:21:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cypress.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pOAgOE9O5OsqbBTQRoE3HCmSsjleg39+ravDkPzJJu8=; b=tUngLae9vgwHB5U/si5qinpd8t6fXihL/6jv/oA0ciCcx8A2FF67IEXRuKZnGYFbdG4AOn/WnEsrgMFNhnVfZeixZeDTW2c6Ml/zV4glXD0YhrPq3QOy0uOrjPysszHV6d2tGFecnFhlNnt3UysQvpQEbZ5bPt0o9UGExMVO8Ag= Received: from BY1PR0601MB1436.namprd06.prod.outlook.com (10.162.111.23) by BY1PR0601MB1126.namprd06.prod.outlook.com (10.160.196.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.29; Mon, 12 Nov 2018 07:29:25 +0000 Received: from BY1PR0601MB1436.namprd06.prod.outlook.com ([fe80::199f:c63e:1449:1979]) by BY1PR0601MB1436.namprd06.prod.outlook.com ([fe80::199f:c63e:1449:1979%3]) with mapi id 15.20.1294.044; Mon, 12 Nov 2018 07:29:25 +0000 From: Chi-Hsien Lin To: "linux-wireless@vger.kernel.org" CC: "brcm80211-dev-list@broadcom.com" , brcm80211-dev-list , Arend van Spriel , Franky Lin , Hante Meuleman , Wright Feng , Kalle Valo , Winnie Chang , Chi-Hsien Lin Subject: [PATCH V2 1/8] brcmfmac: add 4354 raw pcie device id Thread-Topic: [PATCH V2 1/8] brcmfmac: add 4354 raw pcie device id Thread-Index: AQHUellwYNF0950nbUG3XD8v/WIxSw== Date: Mon, 12 Nov 2018 07:29:25 +0000 Message-ID: <1542007730-47284-2-git-send-email-chi-hsien.lin@cypress.com> References: <1542007730-47284-1-git-send-email-chi-hsien.lin@cypress.com> In-Reply-To: <1542007730-47284-1-git-send-email-chi-hsien.lin@cypress.com> Accept-Language: en-US, zh-TW Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [12.110.209.245] x-clientproxiedby: HK0PR03CA0084.apcprd03.prod.outlook.com (2603:1096:203:72::24) To BY1PR0601MB1436.namprd06.prod.outlook.com (2a01:111:e400:522c::23) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Chi-Hsien.Lin@cypress.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BY1PR0601MB1126;6:tjYAYPeSDwQgT1yctZFF3XUv1rnQwI8jEM7cHL7YkENRI2qFKXTZH4xtVoBtIh4ZECGhz1MAphgISP/S0t6Vy65reP75QaY2UmEAWs3Zzb4Rd0/sf10H6Js65pZ2ovBGNCFVcbKoAP/v8fkqqSivDOzvUWeJ2SQF67wPTrKYuizuiciu3sriE3v2g+ev8toaZA+vlyZhGRE3b4Kfbj/dZ/CgkYT65Xwm6eRZ7J1ZaYa/007ZklqhFo9n7SjD7Z7fb21mMs4sdVh/m+01V0zzgE6dkjPRZhb1lVVIfBPtWPETwPaGJFfE2+tdplxuZohIbZr8A/lvO9puB6T9nVdPQrjStILYjKhdcv+lBZYXMyWohiOAYlOE3ORpDwUtxD7ULFG+iUGYkHQD+Vj8ttsRmnYK4bdDTxjCnFTiwns5CHSGmmPNQzhTzg/6BPNHinhOYTpIfLv+6g0Ymml5K34cuQ==;5:1SKl/4o1+SStQ00oVa2qsUNQXyoppTauSjFb/+xeDpI6LexcFD69AezMdLtSbn5ehckYmyMPg5mpVgJcVwD058SxyfKts5S7WmF/+BQKZRdX1++nd165KP3h64XF6XWue16gr0NlPDG4fIzMRvlzfooTYe8jQcqFdrK6CPwHwow=;7:iqqZHlv5JIzLYNAnvLdqyrJtCAxyHw+AMTCgz0X1fBulxuJzNoxbMczzT7w0kk/52e9YrRT90oKe7+WGp8hLMvrRUyDsGpYS6TuXT4hn9Y5Q/QcrsgmAhV44LUEOFytKeK6dmElNEU7Laa/ZhrirSg== x-ms-office365-filtering-correlation-id: 0ea487c1-9803-4c9f-464a-08d64870922a x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390040)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:BY1PR0601MB1126; x-ms-traffictypediagnostic: BY1PR0601MB1126: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(258095267146985)(208715162771679); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(3231382)(944501410)(52105112)(93006095)(93001095)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:BY1PR0601MB1126;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0601MB1126; x-forefront-prvs: 0854128AF0 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(346002)(396003)(376002)(39850400004)(136003)(189003)(199004)(25786009)(4326008)(2906002)(76176011)(3846002)(6116002)(99286004)(52116002)(81156014)(81166006)(478600001)(68736007)(8676002)(6486002)(14454004)(66066001)(5640700003)(6436002)(72206003)(8936002)(256004)(386003)(102836004)(6506007)(106356001)(105586002)(54906003)(6916009)(2351001)(575784001)(86362001)(305945005)(2616005)(5660300001)(36756003)(7736002)(316002)(2900100001)(186003)(71200400001)(446003)(11346002)(476003)(486006)(71190400001)(53936002)(6512007)(2501003)(97736004)(26005)(107886003);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR0601MB1126;H:BY1PR0601MB1436.namprd06.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: cypress.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: Dqbvcx0nK3BRGlrbzq5BWz8WB1ToKw1ZbnjvoeKduRa6Uvhxz/9xmStRPA6NvQe3Hnj2r/BpTQfRfXo6s0PJk82NeqHBV45e72X0G9fBnoJFygZc6xzmQ8Eqx5IcrhBjh0KhDl/cS0LNONQiz0//ulKjomXMR+nJ236a6Cpr//cSM7NJtzW3jYs6FhFbqGZh1ZNaY7PiGor5FE35qkWVcDIPtnCJl87+gNGmSFxv3IXcnD2OBQoJ9fcVh03FDUfQat6CYvDZXgauqUAnsGsAZGsWO1hMtCReTAqS2kgPSkqLZNJaRN9vMn38C66/DujbSt/OKbzVO/wvjQ6Go9xKJ0OrUnbnSJNgzryNoR5XAsc= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0ea487c1-9803-4c9f-464a-08d64870922a X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Nov 2018 07:29:25.1680 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 011addfc-2c09-450d-8938-e0bbc2dd2376 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0601MB1126 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Winnie Chang Add the raw 4354 PCIe device ID for unprogrammed Cypress boards. Reviewed-by: Arend Van Spriel Signed-off-by: Winnie Chang Signed-off-by: Chi-Hsien Lin --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 1 + drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c index 5dea569d63ed..8887bbc0084f 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c @@ -2018,6 +2018,7 @@ static const struct dev_pm_ops brcmf_pciedrvr_pm = { static const struct pci_device_id brcmf_pcie_devid_table[] = { BRCMF_PCIE_DEVICE(BRCM_PCIE_4350_DEVICE_ID), BRCMF_PCIE_DEVICE_SUB(0x4355, BRCM_PCIE_VENDOR_ID_BROADCOM, 0x4355), + BRCMF_PCIE_DEVICE(BRCM_PCIE_4354_RAW_DEVICE_ID), BRCMF_PCIE_DEVICE(BRCM_PCIE_4356_DEVICE_ID), BRCMF_PCIE_DEVICE(BRCM_PCIE_43567_DEVICE_ID), BRCMF_PCIE_DEVICE(BRCM_PCIE_43570_DEVICE_ID), diff --git a/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h b/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h index 686f7a85a045..acb87238922f 100644 --- a/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h +++ b/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h @@ -74,6 +74,7 @@ /* PCIE Device IDs */ #define BRCM_PCIE_4350_DEVICE_ID 0x43a3 #define BRCM_PCIE_4354_DEVICE_ID 0x43df +#define BRCM_PCIE_4354_RAW_DEVICE_ID 0x4354 #define BRCM_PCIE_4356_DEVICE_ID 0x43ec #define BRCM_PCIE_43567_DEVICE_ID 0x43d3 #define BRCM_PCIE_43570_DEVICE_ID 0x43d9 From patchwork Mon Nov 12 07:29:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chi-Hsien Lin X-Patchwork-Id: 10678257 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DF34914DB for ; Mon, 12 Nov 2018 07:29:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C407429F9B for ; Mon, 12 Nov 2018 07:29:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B7C9929FD0; Mon, 12 Nov 2018 07:29:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3AED529F9B for ; Mon, 12 Nov 2018 07:29:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727050AbeKLRVc (ORCPT ); Mon, 12 Nov 2018 12:21:32 -0500 Received: from mail-eopbgr760131.outbound.protection.outlook.com ([40.107.76.131]:21756 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725871AbeKLRVb (ORCPT ); Mon, 12 Nov 2018 12:21:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cypress.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=c09pF5r/4wKcoBqQKDAcMAlaYqRQWLeMhoMTlccPudU=; b=DsuDws2Da2eYDkDDmYVhdDuKEOc3kl0G28K9o2GC3zfWWSjrbjvWtLgSn1g7Wdy6FAF42h/n6gVMtI1P2s0ubNndBNzW6GbSd6C7X3logynfiKKnCMomqyDsNAHSgsu85x1kHDKqHHeWGjKbkZBuO5rmGrd7ZVZVOJ+CxINj1ro= Received: from BY1PR0601MB1436.namprd06.prod.outlook.com (10.162.111.23) by BY1PR0601MB1126.namprd06.prod.outlook.com (10.160.196.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.29; Mon, 12 Nov 2018 07:29:30 +0000 Received: from BY1PR0601MB1436.namprd06.prod.outlook.com ([fe80::199f:c63e:1449:1979]) by BY1PR0601MB1436.namprd06.prod.outlook.com ([fe80::199f:c63e:1449:1979%3]) with mapi id 15.20.1294.044; Mon, 12 Nov 2018 07:29:30 +0000 From: Chi-Hsien Lin To: "linux-wireless@vger.kernel.org" CC: "brcm80211-dev-list@broadcom.com" , brcm80211-dev-list , Arend van Spriel , Franky Lin , Hante Meuleman , Wright Feng , Kalle Valo , Chi-Hsien Lin Subject: [PATCH V2 2/8] brcmfmac: set F2 watermark to 256 for 4373 Thread-Topic: [PATCH V2 2/8] brcmfmac: set F2 watermark to 256 for 4373 Thread-Index: AQHUelly4O8E7afA+E617igGp9CtlQ== Date: Mon, 12 Nov 2018 07:29:29 +0000 Message-ID: <1542007730-47284-3-git-send-email-chi-hsien.lin@cypress.com> References: <1542007730-47284-1-git-send-email-chi-hsien.lin@cypress.com> In-Reply-To: <1542007730-47284-1-git-send-email-chi-hsien.lin@cypress.com> Accept-Language: en-US, zh-TW Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [12.110.209.245] x-clientproxiedby: HK0PR03CA0084.apcprd03.prod.outlook.com (2603:1096:203:72::24) To BY1PR0601MB1436.namprd06.prod.outlook.com (2a01:111:e400:522c::23) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Chi-Hsien.Lin@cypress.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BY1PR0601MB1126;6:i0rMTqXpe2zSEZXvnDkqcikhK8Glez65Bb8wSqN/ehVEAIThTvzBOBWIfwYDtROLkwCSfxBVmwQZM01YQ1Q7QzdxbeI9lGd/nayeTAuuYhDKUQaUjz/QOqsZQK6HJ0e8Bspj4tjhYnQNie99RmzsHhY+A6d7waAJPBUxCM16Pf558V7oU4v839fZ6UtbntzTggPwwhc2GCeOl5YuoplETsqM+2bskkKtalkVkVMnyVvFhmMnxkk+umcF0b5bwrmWHCT38tMY+lxRW49v5yjg8SufDJzCeYNqj9SjK4Zo1iNigXINC2UyfMhKv5jE8OKR3ipEZiHU7rgQo3Movbyxbc8DM9Kcq8zZo40JxD7vH4cyX4Ge3CLAYmFIomHWVAgsb5imuD1c1TWJL4QohZ6mQJvSzHn3PqpbgbO4cCnc2tTH3WjPndQu233nWz4cnkvrAF1h2SRq7xllpI1Qgn00ug==;5:XfTpaGN/5+3itNUh7jUdiqbmIYgxHAoo5bBeQwKubHRL49BVEc1ZKfQjJ0zY1yrxB9NxsfmMrTxagfY9ByuChrgn6lRBWRsptBJsfEQmF52F444zvOQ4zoUYqsOLcc2DS78vA+UcA+lgntTglznAW2QlB6AlXIhWZ5GNCLMsmgo=;7:6oM5sOqgMUIH5ZCNOm2txmHiOrVGYr31vJRqZGLFroZ0/tqSUvRC7e1US370xDznPf15ivt440QOgA0yABhH4SPyP3PZarww9UJjTFOtSGfVA4sz7TKma6m1KpH2Nq30gBKUNZCITb2Eu4+Feny9cw== x-ms-office365-filtering-correlation-id: 5102c69c-a187-433d-46c0-08d648709509 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390040)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:BY1PR0601MB1126; x-ms-traffictypediagnostic: BY1PR0601MB1126: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(258095267146985)(208715162771679); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(3231382)(944501410)(52105112)(93006095)(93001095)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:BY1PR0601MB1126;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0601MB1126; x-forefront-prvs: 0854128AF0 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(346002)(396003)(376002)(39850400004)(136003)(189003)(199004)(25786009)(4326008)(2906002)(76176011)(3846002)(6116002)(99286004)(52116002)(81156014)(81166006)(478600001)(68736007)(8676002)(6486002)(14454004)(66066001)(5640700003)(6436002)(72206003)(8936002)(256004)(386003)(102836004)(6506007)(106356001)(105586002)(54906003)(6916009)(2351001)(575784001)(86362001)(305945005)(2616005)(5660300001)(36756003)(7736002)(316002)(2900100001)(186003)(71200400001)(446003)(11346002)(476003)(486006)(71190400001)(53936002)(6512007)(2501003)(97736004)(26005)(107886003);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR0601MB1126;H:BY1PR0601MB1436.namprd06.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: cypress.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: S+7Poh8Hv1bMeLCpPa+vpPrULTp/oQ8xjKRsrRrqalgGpsqqUwGdSXxUoOcX1FrDpvJLSZXbmm8U7rVmtDydcaYLOuF2fdhSMvroBHWpxwscXRrbzTEsG6/4t7TORZHrT8sStJYaJwpWYXrIF+ik2A7xM+itTCloEangRyekEqRQK6hO3XynPKx3UQENgX8/L+fwBK6ph9qIvrkWigZH5uIgmhJHQymkYJQl1fVEAAnZVWTlNCHO8skiWmjALiRqGo0tSERqx17kngA6cFm4YLXy1XVUxmrZyZpsa40Zt0XBEWwuYOytgx+7PkCX2aZzpOSIgrtZUvt7aXlhP6yNSEsonJEJ+CrshvIkkvyjs8s= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5102c69c-a187-433d-46c0-08d648709509 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Nov 2018 07:29:29.9689 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 011addfc-2c09-450d-8938-e0bbc2dd2376 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0601MB1126 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wright Feng We got SDIO_CRC_ERROR with 4373 on SDR104 when doing bi-directional throughput test. Enable watermark to 256 to guarantee the operation stability. Reviewed-by: Arend van Spriel Signed-off-by: Wright Feng Signed-off-by: Chi-Hsien Lin --- .../wireless/broadcom/brcm80211/brcmfmac/sdio.c | 26 ++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c index b2e1ab5adb64..05b8cfea5f9f 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c @@ -49,6 +49,10 @@ #define DCMD_RESP_TIMEOUT msecs_to_jiffies(2500) #define CTL_DONE_TIMEOUT msecs_to_jiffies(2500) +/* watermark expressed in number of words */ +#define DEFAULT_F2_WATERMARK 0x8 +#define CY_4373_F2_WATERMARK 0x40 + #ifdef DEBUG #define BRCMF_TRAP_INFO_SIZE 80 @@ -138,6 +142,8 @@ struct rte_console { /* 1: isolate internal sdio signals, put external pads in tri-state; requires * sdio bus power cycle to clear (rev 9) */ #define SBSDIO_DEVCTL_PADS_ISO 0x08 +/* 1: enable F2 Watermark */ +#define SBSDIO_DEVCTL_F2WM_ENAB 0x10 /* Force SD->SB reset mapping (rev 11) */ #define SBSDIO_DEVCTL_SB_RST_CTL 0x30 /* Determined by CoreControl bit */ @@ -4046,6 +4052,7 @@ static void brcmf_sdio_firmware_callback(struct device *dev, int err, void *nvram; u32 nvram_len; u8 saveclk; + u8 devctl; brcmf_dbg(TRACE, "Enter: dev=%s, err=%d\n", dev_name(dev), err); @@ -4101,8 +4108,23 @@ static void brcmf_sdio_firmware_callback(struct device *dev, int err, brcmf_sdiod_writel(sdiod, core->base + SD_REG(hostintmask), bus->hostintmask, NULL); - - brcmf_sdiod_writeb(sdiod, SBSDIO_WATERMARK, 8, &err); + switch (sdiod->func1->device) { + case SDIO_DEVICE_ID_CYPRESS_4373: + brcmf_dbg(INFO, "set F2 watermark to 0x%x*4 bytes\n", + CY_4373_F2_WATERMARK); + brcmf_sdiod_writeb(sdiod, SBSDIO_WATERMARK, + CY_4373_F2_WATERMARK, &err); + devctl = brcmf_sdiod_readb(sdiod, SBSDIO_DEVICE_CTL, + &err); + devctl |= SBSDIO_DEVCTL_F2WM_ENAB; + brcmf_sdiod_writeb(sdiod, SBSDIO_DEVICE_CTL, devctl, + &err); + break; + default: + brcmf_sdiod_writeb(sdiod, SBSDIO_WATERMARK, + DEFAULT_F2_WATERMARK, &err); + break; + } } else { /* Disable F2 again */ sdio_disable_func(sdiod->func2); From patchwork Mon Nov 12 07:29:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chi-Hsien Lin X-Patchwork-Id: 10678259 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A507215A6 for ; Mon, 12 Nov 2018 07:29:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E8E229F9B for ; Mon, 12 Nov 2018 07:29:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 824F929FD0; Mon, 12 Nov 2018 07:29:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2626029FCA for ; Mon, 12 Nov 2018 07:29:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727090AbeKLRVi (ORCPT ); Mon, 12 Nov 2018 12:21:38 -0500 Received: from mail-eopbgr760121.outbound.protection.outlook.com ([40.107.76.121]:15339 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727063AbeKLRVi (ORCPT ); Mon, 12 Nov 2018 12:21:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cypress.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eslWfkP/XGHrcyLrCt/dZ0vzor0cYYZUmnyWf0Qg6ek=; b=mYzRXrwMz8F8dRQZUdmhAojqubYl9wM18qLS0URI7gpBIbumbsUut/+nezZrfUAnEgHJki/f+nbwsHjzLuFnmuPCCaJOOQPvkGC+gcceBgThc8TRc6rPRvvYUxPqMva4DeW7GFRivjy7XyIVXM8KSL7MEqTehkEyyIK4VfWdaUE= Received: from BY1PR0601MB1436.namprd06.prod.outlook.com (10.162.111.23) by BY1PR0601MB1126.namprd06.prod.outlook.com (10.160.196.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.29; Mon, 12 Nov 2018 07:29:35 +0000 Received: from BY1PR0601MB1436.namprd06.prod.outlook.com ([fe80::199f:c63e:1449:1979]) by BY1PR0601MB1436.namprd06.prod.outlook.com ([fe80::199f:c63e:1449:1979%3]) with mapi id 15.20.1294.044; Mon, 12 Nov 2018 07:29:35 +0000 From: Chi-Hsien Lin To: "linux-wireless@vger.kernel.org" CC: "brcm80211-dev-list@broadcom.com" , brcm80211-dev-list , Arend van Spriel , Franky Lin , Hante Meuleman , Wright Feng , Kalle Valo , Madhan Mohan R , Madhan Mohan R , Chi-Hsien Lin Subject: [PATCH V2 3/8] brcmfmac: set SDIO F1 MesBusyCtrl for CYW4373 Thread-Topic: [PATCH V2 3/8] brcmfmac: set SDIO F1 MesBusyCtrl for CYW4373 Thread-Index: AQHUell27YgOaOPIa02NnIpm+Ru2HQ== Date: Mon, 12 Nov 2018 07:29:35 +0000 Message-ID: <1542007730-47284-4-git-send-email-chi-hsien.lin@cypress.com> References: <1542007730-47284-1-git-send-email-chi-hsien.lin@cypress.com> In-Reply-To: <1542007730-47284-1-git-send-email-chi-hsien.lin@cypress.com> Accept-Language: en-US, zh-TW Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [12.110.209.245] x-clientproxiedby: HK0PR03CA0084.apcprd03.prod.outlook.com (2603:1096:203:72::24) To BY1PR0601MB1436.namprd06.prod.outlook.com (2a01:111:e400:522c::23) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Chi-Hsien.Lin@cypress.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BY1PR0601MB1126;6:t110n/0rY4ot1s1Dkyht4gVWt5dz+VWrMZHG8nYNe47xtbnxmmiwhEbFReSu8Ej7/ekDaFG7HztOhERkpeJdQmrnbsTZ4SgtXoTdlnPPkKpJX7kpT58Nw8vGAmehNgczPqJ7N7V34LhqmPg+mR5w7oXpyqvs/h6pe2k2jpRP8gHfc0HESwgwsM9yNKtT8GyLw801Pstq00ObRcc+R4fo7hMCNuTHhz1kZba7HGh31D8p+RfVYL+BEGtppgHlvNbL17Wfkmq39syLcwt+dNQhqcQnMgWEaq4eHjWiDrzcMORIDzYOjY5rJwjOcDNAXwMQCsy/RRAcHB++dwC7lRErzTsIlVjjeb43+Pu7AUME1gm4UjS7sItQsJj/aCPLXoNOyT5lMGRUdSBQgSIhri1wzxaqa0mxtssl5wdGxrqndXc+jD4RHCDVW3RLpCREnCNAaDdS58sBTI+H+PBwyI9+Vw==;5:o3qZnI1HI3Q9/rNWmlFx56Wsai6amnIuGdndUl8JxHCTsyfsbWQxr6SQzbH31JgITDS8yADUcsVUisEG0tbX9wfXOvmesWCpKLeEFRb9QV0jFUpHQhry+iVM77lR7FkrgCk41g/e8XueXLnIOHZy9TkPPomOxwPNwHVLTsL+mvI=;7:wXPPJZPlThDRxioVaeH1qX8cOgSq7YZBR2nOve6H/+Vu3qapfevpT9pxoPLJFkwE57qcCw1+P3tz7y1uPxihLU14z9y7/3xRA3rsYk4H0JlQMKUfxlA/yarqMUkAmIhSnTEGsFu8A0pwg3u2Ge9BgQ== x-ms-office365-filtering-correlation-id: 90cdfbc5-5750-40c4-0566-08d64870985e x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390040)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:BY1PR0601MB1126; x-ms-traffictypediagnostic: BY1PR0601MB1126: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(258095267146985)(208715162771679); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(3231382)(944501410)(52105112)(93006095)(93001095)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:BY1PR0601MB1126;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0601MB1126; x-forefront-prvs: 0854128AF0 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(346002)(396003)(376002)(39850400004)(136003)(189003)(199004)(25786009)(4326008)(2906002)(76176011)(3846002)(6116002)(99286004)(52116002)(81156014)(81166006)(478600001)(68736007)(8676002)(6486002)(14454004)(66066001)(5640700003)(6436002)(72206003)(8936002)(14444005)(256004)(386003)(102836004)(6506007)(106356001)(105586002)(54906003)(6916009)(2351001)(575784001)(86362001)(305945005)(2616005)(5660300001)(36756003)(7736002)(316002)(2900100001)(186003)(71200400001)(446003)(11346002)(476003)(486006)(71190400001)(53936002)(6512007)(2501003)(97736004)(26005)(107886003);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR0601MB1126;H:BY1PR0601MB1436.namprd06.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: cypress.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 14f7maXit2YQP/WnhBZV+wh1EPa6Av982K7AoRdn5JvC2HguQ4CHdlH09TtIXd4mn6uaXUjcgsC1FzCwgCnjazygVa3K26AfbN0NQ+hb906Y0XS9SS+ef49+48l1FEqByqP6jdnJjBKEuxNhY0Zgmqujke4tgAHaSAfKNG9KhLs6AOcanWredtQHdykTibZV2b7ZXHtoUhJDWUimgX/PeHDKBF/JvHRFDVVfbB/RAMWxtgyw6dXzRrzQZZbHWlGVGbq2fx1jOzJOIGlVPx6mQuIi33B1eYaEr6TYvsV8oJeLhltOyftGqeuWHobldDCXMCJ5nNShJAIIwOiw0N2C4cT2VMBHvybZbVIK3uJYAlU= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: 90cdfbc5-5750-40c4-0566-08d64870985e X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Nov 2018 07:29:35.5774 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 011addfc-2c09-450d-8938-e0bbc2dd2376 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0601MB1126 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Madhan Mohan R Along with F2 watermark (existing) configuration, F1 MesBusyCtrl should be enabled & configured to avoid overflow errors. Reviewed-by: Arend van Spriel Signed-off-by: Madhan Mohan R Signed-off-by: Chi-Hsien Lin --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 3 +++ drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c index 05b8cfea5f9f..b9ec40cc7d6b 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c @@ -4119,6 +4119,9 @@ static void brcmf_sdio_firmware_callback(struct device *dev, int err, devctl |= SBSDIO_DEVCTL_F2WM_ENAB; brcmf_sdiod_writeb(sdiod, SBSDIO_DEVICE_CTL, devctl, &err); + brcmf_sdiod_writeb(sdiod, SBSDIO_FUNC1_MESBUSYCTRL, + CY_4373_F2_WATERMARK | + SBSDIO_MESBUSYCTRL_ENAB, &err); break; default: brcmf_sdiod_writeb(sdiod, SBSDIO_WATERMARK, diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h index 7faed831f07d..8aaabca1eb0e 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h @@ -104,6 +104,9 @@ #define SBSDIO_FUNC1_RFRAMEBCHI 0x1001C /* MesBusyCtl (rev 11) */ #define SBSDIO_FUNC1_MESBUSYCTRL 0x1001D +/* Enable busy capability for MES access */ +#define SBSDIO_MESBUSYCTRL_ENAB 0x80 + /* Sdio Core Rev 12 */ #define SBSDIO_FUNC1_WAKEUPCTRL 0x1001E #define SBSDIO_FUNC1_WCTRL_ALPWAIT_MASK 0x1 From patchwork Mon Nov 12 07:29:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chi-Hsien Lin X-Patchwork-Id: 10678261 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3B93614E2 for ; Mon, 12 Nov 2018 07:29:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 25D2E29F9B for ; Mon, 12 Nov 2018 07:29:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1981B29FD0; Mon, 12 Nov 2018 07:29:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 44AF529F9B for ; Mon, 12 Nov 2018 07:29:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727106AbeKLRVq (ORCPT ); Mon, 12 Nov 2018 12:21:46 -0500 Received: from mail-eopbgr760138.outbound.protection.outlook.com ([40.107.76.138]:10776 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727063AbeKLRVp (ORCPT ); Mon, 12 Nov 2018 12:21:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cypress.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fjFf8SdAMgENdPhbWKlOzpj/y8HJdhYym3FwDM5Wm10=; b=TPzj+85RXQ4kLIUV/VvjJ3lKKaGofKO4M4a25VYYB3kUG5fgeuShK6VGadAvg3ySS/Tv3Lcd0pl2bePlgdvXDoU14ZwaNkrqcfHZMzfFu3rLA3HsqbU7I1kH7JTdPr2VqF/RhCxm6Us0/SMf7ToRioqPKV1rbhwn5URnt5VWo8M= Received: from BY1PR0601MB1436.namprd06.prod.outlook.com (10.162.111.23) by BY1PR0601MB1126.namprd06.prod.outlook.com (10.160.196.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.29; Mon, 12 Nov 2018 07:29:40 +0000 Received: from BY1PR0601MB1436.namprd06.prod.outlook.com ([fe80::199f:c63e:1449:1979]) by BY1PR0601MB1436.namprd06.prod.outlook.com ([fe80::199f:c63e:1449:1979%3]) with mapi id 15.20.1294.044; Mon, 12 Nov 2018 07:29:40 +0000 From: Chi-Hsien Lin To: "linux-wireless@vger.kernel.org" CC: "brcm80211-dev-list@broadcom.com" , brcm80211-dev-list , Arend van Spriel , Franky Lin , Hante Meuleman , Wright Feng , Kalle Valo , Chi-Hsien Lin , Praveen Babu Chandran Subject: [PATCH V2 4/8] brcmfmac: add support for CYW43012 SDIO chipset Thread-Topic: [PATCH V2 4/8] brcmfmac: add support for CYW43012 SDIO chipset Thread-Index: AQHUell541Cgg3DpKUOiw+yxDmoayg== Date: Mon, 12 Nov 2018 07:29:40 +0000 Message-ID: <1542007730-47284-5-git-send-email-chi-hsien.lin@cypress.com> References: <1542007730-47284-1-git-send-email-chi-hsien.lin@cypress.com> In-Reply-To: <1542007730-47284-1-git-send-email-chi-hsien.lin@cypress.com> Accept-Language: en-US, zh-TW Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [12.110.209.245] x-clientproxiedby: HK0PR03CA0084.apcprd03.prod.outlook.com (2603:1096:203:72::24) To BY1PR0601MB1436.namprd06.prod.outlook.com (2a01:111:e400:522c::23) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Chi-Hsien.Lin@cypress.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BY1PR0601MB1126;6:y4zyBHKS4KrigQGZUlNBkVhK1ZNai1vMdQHzngAdHKZH8T0P7YEhR42irrblCJOJNfAGAbn1uALKzPys8Hqcz5TRoydoip5NmOf8UolNfBpr0+TP2Lzznf66AhaUMjWbb3v1Eogx7wCq7fw0ayV/RN7SwHqnIuHmoCaRArtOhx4jYTBztEsuypzEqFAzTRKxe6NWfcEfsDVzbEjTvdSLh/8bToOW7LcJCAjqy5/Q2rt0pO/uCZP+ywx0YibU0K5fAOPyI818OVfP6g5wuRpCWoTi7Mabc79/vhskaowQlAGRNovrq4di7SI9cDgSKc89KuX0Wep3pdVvkHMa6752lBymShD160aiOUlXOb64VYNtQkHsNARvF/aQQozd0GvJ84UKYoc8v+XIz7GS3o0WYVX7GfMaz+t0mE5/rK07pStWUk0Rc+8mAeRtWYSHnAhyNKvgelQZkMWDKUmj82Ajgg==;5:9EKpL4tbB54yGI6k47SqCo3dlmen8ZRMMu883jKwIqOqPqNnAK7TP7udTUkq2gOzTJPr+wKGO/UneMV+l9bodaPv7FFSWqy0orN5FWcfjR8bBSkqYhnHLkKSNVHnQ/YgbgmfX9Z1dVr5gZQdvn9sImhddcs/HA1uflOjxJEOyLU=;7:SWFoGGczm9jNtjZwJOHYalMBEPjiDrNufn/yDq5iHTt6kbT6TiYVHHAy+fMXNVjRkH2+9w3ScmneqYWdDY1eVXm9oL+sn1rkEd804JTgpJGpZRlM8bFsF0FKpRbDsabkZwmTqx4jrmGAv6LC+C1irw== x-ms-office365-filtering-correlation-id: b2a870cf-d410-4837-95d7-08d648709b6d x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390040)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:BY1PR0601MB1126; x-ms-traffictypediagnostic: BY1PR0601MB1126: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(208715162771679)(258095267146985); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(3231382)(944501410)(52105112)(93006095)(93001095)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:BY1PR0601MB1126;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0601MB1126; x-forefront-prvs: 0854128AF0 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(346002)(396003)(376002)(39850400004)(136003)(189003)(199004)(25786009)(4326008)(2906002)(76176011)(3846002)(6116002)(99286004)(52116002)(81156014)(81166006)(478600001)(68736007)(8676002)(6486002)(14454004)(66066001)(5640700003)(6436002)(72206003)(8936002)(256004)(386003)(102836004)(6506007)(106356001)(105586002)(54906003)(6916009)(2351001)(575784001)(86362001)(305945005)(2616005)(5660300001)(36756003)(7736002)(316002)(2900100001)(186003)(71200400001)(446003)(11346002)(476003)(486006)(71190400001)(53936002)(6512007)(2501003)(97736004)(26005)(107886003);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR0601MB1126;H:BY1PR0601MB1436.namprd06.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: cypress.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: yjUFlVycBIf8WKPb66tgYXLLJe7f1sdYFWB00oyAFyn61yO2emErHmS7I8pHVF8f9JYqFP5Yav7/uwls3FHm3OUWBoiD2ixifDFaoKQRwXjiOR6VUyhOjLU1QxVKwJ0AKWtUAyISg8SbuNq+WotibPNZtlmB2UjnjdWJJ+3evPQwJWsTSvFsdeMADwHm2V6gOboFg5XyUNRMgFCpFz/6ol345LNxbPvWqfKuZVIWLzjHe9TTBOyP1jCPriOy1Y3TbDnSYTnknX0wHo9G4mK22A7zPe4Wys2Mbw/yMWDyI6IXNBBMiEi2wKTCRh5Dk1ESSxor4U0Udg9M460AHGaJy9FsTWHX0w6lV08D8HYdXfs= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: b2a870cf-d410-4837-95d7-08d648709b6d X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Nov 2018 07:29:40.6796 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 011addfc-2c09-450d-8938-e0bbc2dd2376 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0601MB1126 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP CYW43012 is a 1x1 802.11a/b/g/n Dual-Band HT20, 256-QAM/Turbo QAM. It is an Ultra Low Power WLAN+BT combo chip. Reviewed-by: Arend van Spriel Signed-off-by: Chi-Hsien Lin Signed-off-by: Praveen Babu C --- .../wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 1 + .../wireless/broadcom/brcm80211/brcmfmac/chip.c | 14 +++- .../wireless/broadcom/brcm80211/brcmfmac/sdio.c | 74 ++++++++++++++++++---- .../broadcom/brcm80211/include/brcm_hw_ids.h | 1 + include/linux/mmc/sdio_ids.h | 1 + 5 files changed, 78 insertions(+), 13 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c index 3e37c8cf82c6..c1d4f93f7347 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c @@ -972,6 +972,7 @@ static const struct sdio_device_id brcmf_sdmmc_ids[] = { BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4354), BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4356), BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_CYPRESS_4373), + BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_CYPRESS_43012), { /* end: all zeroes */ } }; MODULE_DEVICE_TABLE(sdio, brcmf_sdmmc_ids); diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c index 927d62b3d41b..a3c857721446 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c @@ -165,6 +165,7 @@ struct sbconfig { #define SRCI_LSS_MASK 0x00f00000 #define SRCI_LSS_SHIFT 20 #define SRCI_SRNB_MASK 0xf0 +#define SRCI_SRNB_MASK_EXT 0x100 #define SRCI_SRNB_SHIFT 4 #define SRCI_SRBSZ_MASK 0xf #define SRCI_SRBSZ_SHIFT 0 @@ -592,7 +593,13 @@ static void brcmf_chip_socram_ramsize(struct brcmf_core_priv *sr, u32 *ramsize, if (lss != 0) *ramsize += (1 << ((lss - 1) + SR_BSZ_BASE)); } else { - nb = (coreinfo & SRCI_SRNB_MASK) >> SRCI_SRNB_SHIFT; + /* length of SRAM Banks increased for corerev greater than 23 */ + if (sr->pub.rev >= 23) { + nb = (coreinfo & (SRCI_SRNB_MASK | SRCI_SRNB_MASK_EXT)) + >> SRCI_SRNB_SHIFT; + } else { + nb = (coreinfo & SRCI_SRNB_MASK) >> SRCI_SRNB_SHIFT; + } for (i = 0; i < nb; i++) { retent = brcmf_chip_socram_banksize(sr, i, &banksize); *ramsize += banksize; @@ -1356,6 +1363,11 @@ bool brcmf_chip_sr_capable(struct brcmf_chip *pub) addr = CORE_CC_REG(base, sr_control1); reg = chip->ops->read32(chip->ctx, addr); return reg != 0; + case CY_CC_43012_CHIP_ID: + addr = CORE_CC_REG(pmu->base, retention_ctl); + reg = chip->ops->read32(chip->ctx, addr); + return (reg & (PMU_RCTL_MACPHY_DISABLE_MASK | + PMU_RCTL_LOGIC_DISABLE_MASK)) == 0; default: addr = CORE_CC_REG(pmu->base, pmucapabilities_ext); reg = chip->ops->read32(chip->ctx, addr); diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c index b9ec40cc7d6b..7707b0169c21 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c @@ -624,6 +624,7 @@ BRCMF_FW_DEF(43455, "brcmfmac43455-sdio"); BRCMF_FW_DEF(4354, "brcmfmac4354-sdio"); BRCMF_FW_DEF(4356, "brcmfmac4356-sdio"); BRCMF_FW_DEF(4373, "brcmfmac4373-sdio"); +BRCMF_FW_DEF(43012, "brcmfmac43012-sdio"); static const struct brcmf_firmware_mapping brcmf_sdio_fwnames[] = { BRCMF_FW_ENTRY(BRCM_CC_43143_CHIP_ID, 0xFFFFFFFF, 43143), @@ -643,7 +644,8 @@ static const struct brcmf_firmware_mapping brcmf_sdio_fwnames[] = { BRCMF_FW_ENTRY(BRCM_CC_4345_CHIP_ID, 0xFFFFFFC0, 43455), BRCMF_FW_ENTRY(BRCM_CC_4354_CHIP_ID, 0xFFFFFFFF, 4354), BRCMF_FW_ENTRY(BRCM_CC_4356_CHIP_ID, 0xFFFFFFFF, 4356), - BRCMF_FW_ENTRY(CY_CC_4373_CHIP_ID, 0xFFFFFFFF, 4373) + BRCMF_FW_ENTRY(CY_CC_4373_CHIP_ID, 0xFFFFFFFF, 4373), + BRCMF_FW_ENTRY(CY_CC_43012_CHIP_ID, 0xFFFFFFFF, 43012) }; static void pkt_align(struct sk_buff *p, int len, int align) @@ -677,6 +679,14 @@ brcmf_sdio_kso_control(struct brcmf_sdio *bus, bool on) /* 1st KSO write goes to AOS wake up core if device is asleep */ brcmf_sdiod_writeb(bus->sdiodev, SBSDIO_FUNC1_SLEEPCSR, wr_val, &err); + /* In case of 43012 chip, the chip could go down immediately after + * KSO bit is cleared. So the further reads of KSO register could + * fail. Thereby just bailing out immediately after clearing KSO + * bit, to avoid polling of KSO bit. + */ + if (!on && bus->ci->chip == CY_CC_43012_CHIP_ID) + return err; + if (on) { /* device WAKEUP through KSO: * write bit 0 & read back until @@ -2402,6 +2412,14 @@ static int brcmf_sdio_tx_ctrlframe(struct brcmf_sdio *bus, u8 *frame, u16 len) return ret; } +static bool brcmf_chip_is_ulp(struct brcmf_chip *ci) +{ + if (ci->chip == CY_CC_43012_CHIP_ID) + return true; + else + return false; +} + static void brcmf_sdio_bus_stop(struct device *dev) { struct brcmf_bus *bus_if = dev_get_drvdata(dev); @@ -2409,7 +2427,7 @@ static void brcmf_sdio_bus_stop(struct device *dev) struct brcmf_sdio *bus = sdiodev->bus; struct brcmf_core *core = bus->sdio_core; u32 local_hostintmask; - u8 saveclk; + u8 saveclk, bpreq; int err; brcmf_dbg(TRACE, "Enter\n"); @@ -2436,9 +2454,14 @@ static void brcmf_sdio_bus_stop(struct device *dev) /* Force backplane clocks to assure F2 interrupt propagates */ saveclk = brcmf_sdiod_readb(sdiodev, SBSDIO_FUNC1_CHIPCLKCSR, &err); - if (!err) - brcmf_sdiod_writeb(sdiodev, SBSDIO_FUNC1_CHIPCLKCSR, - (saveclk | SBSDIO_FORCE_HT), &err); + if (!err) { + bpreq = saveclk; + bpreq |= brcmf_chip_is_ulp(bus->ci) ? + SBSDIO_HT_AVAIL_REQ : SBSDIO_FORCE_HT; + brcmf_sdiod_writeb(sdiodev, + SBSDIO_FUNC1_CHIPCLKCSR, + bpreq, &err); + } if (err) brcmf_err("Failed to force clock for F2: err %d\n", err); @@ -3328,20 +3351,45 @@ static int brcmf_sdio_download_firmware(struct brcmf_sdio *bus, return bcmerror; } +static bool brcmf_sdio_aos_no_decode(struct brcmf_sdio *bus) +{ + if (bus->ci->chip == CY_CC_43012_CHIP_ID) + return true; + else + return false; +} + static void brcmf_sdio_sr_init(struct brcmf_sdio *bus) { int err = 0; u8 val; + u8 wakeupctrl; + u8 cardcap; + u8 chipclkcsr; brcmf_dbg(TRACE, "Enter\n"); + if (brcmf_chip_is_ulp(bus->ci)) { + wakeupctrl = SBSDIO_FUNC1_WCTRL_ALPWAIT_SHIFT; + chipclkcsr = SBSDIO_HT_AVAIL_REQ; + } else { + wakeupctrl = SBSDIO_FUNC1_WCTRL_HTWAIT_SHIFT; + chipclkcsr = SBSDIO_FORCE_HT; + } + + if (brcmf_sdio_aos_no_decode(bus)) { + cardcap = SDIO_CCCR_BRCM_CARDCAP_CMD_NODEC; + } else { + cardcap = (SDIO_CCCR_BRCM_CARDCAP_CMD14_SUPPORT | + SDIO_CCCR_BRCM_CARDCAP_CMD14_EXT); + } + val = brcmf_sdiod_readb(bus->sdiodev, SBSDIO_FUNC1_WAKEUPCTRL, &err); if (err) { brcmf_err("error reading SBSDIO_FUNC1_WAKEUPCTRL\n"); return; } - - val |= 1 << SBSDIO_FUNC1_WCTRL_HTWAIT_SHIFT; + val |= 1 << wakeupctrl; brcmf_sdiod_writeb(bus->sdiodev, SBSDIO_FUNC1_WAKEUPCTRL, val, &err); if (err) { brcmf_err("error writing SBSDIO_FUNC1_WAKEUPCTRL\n"); @@ -3350,8 +3398,7 @@ static void brcmf_sdio_sr_init(struct brcmf_sdio *bus) /* Add CMD14 Support */ brcmf_sdiod_func0_wb(bus->sdiodev, SDIO_CCCR_BRCM_CARDCAP, - (SDIO_CCCR_BRCM_CARDCAP_CMD14_SUPPORT | - SDIO_CCCR_BRCM_CARDCAP_CMD14_EXT), + cardcap, &err); if (err) { brcmf_err("error writing SDIO_CCCR_BRCM_CARDCAP\n"); @@ -3359,7 +3406,7 @@ static void brcmf_sdio_sr_init(struct brcmf_sdio *bus) } brcmf_sdiod_writeb(bus->sdiodev, SBSDIO_FUNC1_CHIPCLKCSR, - SBSDIO_FORCE_HT, &err); + chipclkcsr, &err); if (err) { brcmf_err("error writing SBSDIO_FUNC1_CHIPCLKCSR\n"); return; @@ -4051,7 +4098,7 @@ static void brcmf_sdio_firmware_callback(struct device *dev, int err, const struct firmware *code; void *nvram; u32 nvram_len; - u8 saveclk; + u8 saveclk, bpreq; u8 devctl; brcmf_dbg(TRACE, "Enter: dev=%s, err=%d\n", dev_name(dev), err); @@ -4085,8 +4132,11 @@ static void brcmf_sdio_firmware_callback(struct device *dev, int err, /* Force clocks on backplane to be sure F2 interrupt propagates */ saveclk = brcmf_sdiod_readb(sdiod, SBSDIO_FUNC1_CHIPCLKCSR, &err); if (!err) { + bpreq = saveclk; + bpreq |= brcmf_chip_is_ulp(bus->ci) ? + SBSDIO_HT_AVAIL_REQ : SBSDIO_FORCE_HT; brcmf_sdiod_writeb(sdiod, SBSDIO_FUNC1_CHIPCLKCSR, - (saveclk | SBSDIO_FORCE_HT), &err); + bpreq, &err); } if (err) { brcmf_err("Failed to force clock for F2: err %d\n", err); diff --git a/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h b/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h index acb87238922f..839980da9643 100644 --- a/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h +++ b/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h @@ -60,6 +60,7 @@ #define BRCM_CC_43664_CHIP_ID 43664 #define BRCM_CC_4371_CHIP_ID 0x4371 #define CY_CC_4373_CHIP_ID 0x4373 +#define CY_CC_43012_CHIP_ID 43012 /* USB Device IDs */ #define BRCM_USB_43143_DEVICE_ID 0xbd1e diff --git a/include/linux/mmc/sdio_ids.h b/include/linux/mmc/sdio_ids.h index 4224902a8e22..4332199c71c2 100644 --- a/include/linux/mmc/sdio_ids.h +++ b/include/linux/mmc/sdio_ids.h @@ -42,6 +42,7 @@ #define SDIO_DEVICE_ID_BROADCOM_4354 0x4354 #define SDIO_DEVICE_ID_BROADCOM_4356 0x4356 #define SDIO_DEVICE_ID_CYPRESS_4373 0x4373 +#define SDIO_DEVICE_ID_CYPRESS_43012 43012 #define SDIO_VENDOR_ID_INTEL 0x0089 #define SDIO_DEVICE_ID_INTEL_IWMC3200WIMAX 0x1402 From patchwork Mon Nov 12 07:29:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chi-Hsien Lin X-Patchwork-Id: 10678263 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2236E14DB for ; Mon, 12 Nov 2018 07:29:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0CF8929F9B for ; Mon, 12 Nov 2018 07:29:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 00D9329FD0; Mon, 12 Nov 2018 07:29:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9789C29F9B for ; Mon, 12 Nov 2018 07:29:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727135AbeKLRVs (ORCPT ); Mon, 12 Nov 2018 12:21:48 -0500 Received: from mail-eopbgr760131.outbound.protection.outlook.com ([40.107.76.131]:35520 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725871AbeKLRVs (ORCPT ); Mon, 12 Nov 2018 12:21:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cypress.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yszK0sgGuc7rC0dOUh9okPjq2IPBgKxkWQICDZb1kG4=; b=abiXhBixCsfLOqUuj7YfMact/rILH2Rev7p/EqFA5M7vnXwrXry2R0i1FPXYNN0ScQ2r/yAuYBtnLLyOXZb6tTFknCEjFUt0xIxaDOctt+ISOWE8cjW7iDc5yjaZiO15Tb7SRaCyMkxA41D0h7W9GBULyl9nm02OvM+UuvmbjCQ= Received: from BY1PR0601MB1436.namprd06.prod.outlook.com (10.162.111.23) by BY1PR0601MB1126.namprd06.prod.outlook.com (10.160.196.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.29; Mon, 12 Nov 2018 07:29:46 +0000 Received: from BY1PR0601MB1436.namprd06.prod.outlook.com ([fe80::199f:c63e:1449:1979]) by BY1PR0601MB1436.namprd06.prod.outlook.com ([fe80::199f:c63e:1449:1979%3]) with mapi id 15.20.1294.044; Mon, 12 Nov 2018 07:29:46 +0000 From: Chi-Hsien Lin To: "linux-wireless@vger.kernel.org" CC: "brcm80211-dev-list@broadcom.com" , brcm80211-dev-list , Arend van Spriel , Franky Lin , Hante Meuleman , Wright Feng , Kalle Valo , Chi-Hsien Lin Subject: [PATCH V2 5/8] brcmfmac: allow GCI core enumuration Thread-Topic: [PATCH V2 5/8] brcmfmac: allow GCI core enumuration Thread-Index: AQHUell8qUxBrGET4EyJQkOGqtbdzg== Date: Mon, 12 Nov 2018 07:29:45 +0000 Message-ID: <1542007730-47284-6-git-send-email-chi-hsien.lin@cypress.com> References: <1542007730-47284-1-git-send-email-chi-hsien.lin@cypress.com> In-Reply-To: <1542007730-47284-1-git-send-email-chi-hsien.lin@cypress.com> Accept-Language: en-US, zh-TW Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [12.110.209.245] x-clientproxiedby: HK0PR03CA0084.apcprd03.prod.outlook.com (2603:1096:203:72::24) To BY1PR0601MB1436.namprd06.prod.outlook.com (2a01:111:e400:522c::23) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Chi-Hsien.Lin@cypress.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BY1PR0601MB1126;6:qpEArRvOr2/p02mEHvZXrGZuZNF233UUcV5ukf1IU6OEi4JTUi84S7dtYtvpp2N4TFC+lQVhb4Uht/+ZQSx8mxNggPNTH2DVzPZRkur3fQODnHx60lgAv5VrdLcFoYX8o4QwySkcK3iaGD6fNYWd8O/+KhDtsFWvtoZ7Xf8CDBfGwEePvcDIhmbeObYIcQ6M1Vz7Zgm2jowutts6okhaVRKa3LUqvUqc5ny51wtuwOJalwmPr28rI1LVeBZ4fTYXH854HdHSlRTmwbuA3lJ0cXjmIomYnUcL44hzOeMw/k5lwJuxLAbxTld4G/wAfCYEq8J0HJ5qTNySNCWjYaoBvTHFd7x6lzg3Kyrx09gJHSK9ojSX3FT16Rxrb+HkYxFswuZ7mTbVgmY2qFuWlTU3WaxHIgWA5S0dGZ1E7RrSjdjv+xLrjTB4mh4O8EgEezBiMv5xsUAaMVW09EEHP31mTQ==;5:ocbf349Q/i3wbFZa2PqQS9eelRalIEE2opzRAa4L8koMiVAbU028NGlEpr1ymZds33vLN7XPLW9QMii6VUuJAciR3aWWlbam/UkF2n5TgyhRJxa8Z9E4bVyFHB4IWbP1mko35gEj7iEST+3hYRXumRzxaocRZqL+afWcX9fwHPA=;7:Ctog587jHovemhKKKoWUjgD5hQL0PlWFCBDe16W26pZTNxvMTAM9qlwaKGdGkysPzNttFxxZrUHY20p312N5dDa3LWNoOs12eMiXsp3b3Id7p+mkcubIX59ZwhrpnlNKRwUuJwmIzaovVcuhrJRrNQ== x-ms-office365-filtering-correlation-id: 3587e413-cf60-41c8-3043-08d648709e63 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390040)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:BY1PR0601MB1126; x-ms-traffictypediagnostic: BY1PR0601MB1126: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(208715162771679)(258095267146985); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(3231382)(944501410)(52105112)(93006095)(93001095)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:BY1PR0601MB1126;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0601MB1126; x-forefront-prvs: 0854128AF0 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(346002)(396003)(376002)(39850400004)(136003)(189003)(199004)(25786009)(4326008)(2906002)(76176011)(3846002)(6116002)(99286004)(52116002)(81156014)(81166006)(478600001)(68736007)(8676002)(6486002)(14454004)(66066001)(5640700003)(6436002)(72206003)(8936002)(256004)(386003)(102836004)(6506007)(106356001)(105586002)(54906003)(6916009)(2351001)(86362001)(305945005)(2616005)(5660300001)(36756003)(7736002)(316002)(2900100001)(186003)(71200400001)(446003)(11346002)(476003)(486006)(71190400001)(53936002)(6512007)(2501003)(97736004)(26005)(107886003);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR0601MB1126;H:BY1PR0601MB1436.namprd06.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: cypress.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: TRdUZ1+l0A85otosYHdisorKk3jSLPz29ZGdOhq9KXrMabwd6o0MtpgtiyqkdR2+PT0bqcP3OgOcJxFeN4stbRIVfT2LzIupIr0wTO5w3iwgZrhPUyOFLWCtEEIBEJV2B2NffgkBvq1dPlsF/PRcrywC54jLCsvXyBZhFLXBQK26RaZpv2iI0h2cm557EUCgOHDYrCMWFHUkFm+pduUuJZzVyvp4FoEAPFF/8xOhxPZ3tMK7y2oHlOEw8kv5KkKMu3MfbAESPagLZ3pUZr+FmqKcmf9RaySPbOqh2wHfmC4T9Sd4Uqf7oybzEfWjMWWj+uicfUGfeBNYgtBg5c07fl/okQVSBCSC41SW4mGCd3A= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3587e413-cf60-41c8-3043-08d648709e63 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Nov 2018 07:29:45.9899 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 011addfc-2c09-450d-8938-e0bbc2dd2376 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0601MB1126 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP GCI core is needed for ULP operation. Allow GCI core enumuration with below changes: - Allow GCI to be added to core list even when it doesn't have a wrapper. - Allow 8K address space size. - Don't overwrite the address value when an additional size descriptor is in place. Reviewed-by: Arend van Spriel Signed-off-by: Chi-Hsien Lin --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c index a3c857721446..a8d3b96b727f 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c @@ -786,7 +786,7 @@ static int brcmf_chip_dmp_get_regaddr(struct brcmf_chip_priv *ci, u32 *eromaddr, u32 *regbase, u32 *wrapbase) { u8 desc; - u32 val; + u32 val, szdesc; u8 mpnum = 0; u8 stype, sztype, wraptype; @@ -832,14 +832,15 @@ static int brcmf_chip_dmp_get_regaddr(struct brcmf_chip_priv *ci, u32 *eromaddr, /* next size descriptor can be skipped */ if (sztype == DMP_SLAVE_SIZE_DESC) { - val = brcmf_chip_dmp_get_desc(ci, eromaddr, NULL); + szdesc = brcmf_chip_dmp_get_desc(ci, eromaddr, NULL); /* skip upper size descriptor if present */ - if (val & DMP_DESC_ADDRSIZE_GT32) + if (szdesc & DMP_DESC_ADDRSIZE_GT32) brcmf_chip_dmp_get_desc(ci, eromaddr, NULL); } - /* only look for 4K register regions */ - if (sztype != DMP_SLAVE_SIZE_4K) + /* look for 4K or 8K register regions */ + if (sztype != DMP_SLAVE_SIZE_4K && + sztype != DMP_SLAVE_SIZE_8K) continue; stype = (val & DMP_SLAVE_TYPE) >> DMP_SLAVE_TYPE_S; @@ -896,7 +897,8 @@ int brcmf_chip_dmp_erom_scan(struct brcmf_chip_priv *ci) /* need core with ports */ if (nmw + nsw == 0 && - id != BCMA_CORE_PMU) + id != BCMA_CORE_PMU && + id != BCMA_CORE_GCI) continue; /* try to obtain register address info */ From patchwork Mon Nov 12 07:29:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chi-Hsien Lin X-Patchwork-Id: 10678265 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 29DBB14E2 for ; Mon, 12 Nov 2018 07:29:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1310529F9B for ; Mon, 12 Nov 2018 07:29:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 048A029FD0; Mon, 12 Nov 2018 07:29:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 939FE29F9B for ; Mon, 12 Nov 2018 07:29:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727147AbeKLRVx (ORCPT ); Mon, 12 Nov 2018 12:21:53 -0500 Received: from mail-eopbgr760111.outbound.protection.outlook.com ([40.107.76.111]:51743 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725871AbeKLRVx (ORCPT ); Mon, 12 Nov 2018 12:21:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cypress.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=O1VCAHZvgi9BRHQ2RHE59GabMNr5piN6aM+mVEMjF4g=; b=aQHXyDlDV8uEOGdn6/CbS1zU/Q9vVHx8Nwpz23ogFAJ9XPn7/8T797ycuLaEeV7tlRPVwGzfOpAWCd2SskQIIsdQk6GImE0xSKQ8m4mOpxXzaRbcalowCEv7GC1OhAtCd7wUlReqTNq9OqMhgclkJzoiraU7xK08tDQ5NAKff7g= Received: from BY1PR0601MB1436.namprd06.prod.outlook.com (10.162.111.23) by BY1PR0601MB1126.namprd06.prod.outlook.com (10.160.196.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.29; Mon, 12 Nov 2018 07:29:51 +0000 Received: from BY1PR0601MB1436.namprd06.prod.outlook.com ([fe80::199f:c63e:1449:1979]) by BY1PR0601MB1436.namprd06.prod.outlook.com ([fe80::199f:c63e:1449:1979%3]) with mapi id 15.20.1294.044; Mon, 12 Nov 2018 07:29:51 +0000 From: Chi-Hsien Lin To: "linux-wireless@vger.kernel.org" CC: "brcm80211-dev-list@broadcom.com" , brcm80211-dev-list , Arend van Spriel , Franky Lin , Hante Meuleman , Wright Feng , Kalle Valo , Naveen Gupta , Chi-Hsien Lin Subject: [PATCH V2 6/8] brcmfmac: update 43012 F2 watermark setting to fix DMA Error during UDP RX Traffic Thread-Topic: [PATCH V2 6/8] brcmfmac: update 43012 F2 watermark setting to fix DMA Error during UDP RX Traffic Thread-Index: AQHUell/i2NozFkudUaxpNpPaeE67Q== Date: Mon, 12 Nov 2018 07:29:51 +0000 Message-ID: <1542007730-47284-7-git-send-email-chi-hsien.lin@cypress.com> References: <1542007730-47284-1-git-send-email-chi-hsien.lin@cypress.com> In-Reply-To: <1542007730-47284-1-git-send-email-chi-hsien.lin@cypress.com> Accept-Language: en-US, zh-TW Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [12.110.209.245] x-clientproxiedby: HK0PR03CA0084.apcprd03.prod.outlook.com (2603:1096:203:72::24) To BY1PR0601MB1436.namprd06.prod.outlook.com (2a01:111:e400:522c::23) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Chi-Hsien.Lin@cypress.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BY1PR0601MB1126;6:82JajRksKs7gAeNEOe/TMMwyG3mWoNIZlqeObgwWlQcp47xYNtNNTjTkrT35q1WX9NCaxUe8VQykk7ynYLf3i0orw+pDZjslCzuVtfEGp9uULRq37xk9cS9fLWnHBri8cbrLad9tuTSBq1dWnNcUTvGahI1EyGLdr+rDfRLeJDcsgRvEUBX88oWofW4uDugtP6UP1vkKCaHQIbtwM6DvAbL/XJEh+ZEPfyPy2ZOVEawsjAWFn4zwqqMNNwnC6rJCUaFEBMU3Td9xHgh36xZIK/VpTNNX0M/78XYJllDhpLyG03+k+hatHw5TjNsuQrfcv+XK36Vjn89FUWg5SKB0dqlcGbisRqCkiM4Wt+GlSCJOSmIt8Yi4pVWgxZEA3roOzFIjraVm4cDThQb38OR/W+DbgDywoxyFVE5yz7pxVES8pOawkMPJNCwFZaQWoxGJ7mBZWIZO5Wli2zlZyu+tgg==;5:19i7D/45wvGF+LlXxQkimDTLvGr/CKMgBA8T24RP2nCgVsbGZBT0EHI6Qd59t0yCsozMkhu6IOAiqiL4Jm0ZgOPvP81yx9mKUn9XNGNxsui/avtB6MgrNGuOWGr8xazZT3O4ua4RqutffSFtS9Y4qptQJ/d3PcsGQq8d3GbycfY=;7:/WL4cemHYet4DymzJ9wksYy01zem+QtjFfSWzm3dWCuFOQhS8JvwErYOVIWIPNDOFrtXyQTVUx5Ia2HWQHAypESKEFRaM/gz709IqlSUpXN/ANR9NitcDwnek1SYcKqriJ/gscOegsmptRT9miamwg== x-ms-office365-filtering-correlation-id: d10d04cb-c8d4-43b1-286b-08d64870a1ae x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390040)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:BY1PR0601MB1126; x-ms-traffictypediagnostic: BY1PR0601MB1126: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(258095267146985)(208715162771679); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(3231382)(944501410)(52105112)(93006095)(93001095)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:BY1PR0601MB1126;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0601MB1126; x-forefront-prvs: 0854128AF0 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(346002)(396003)(376002)(39850400004)(136003)(189003)(199004)(25786009)(4326008)(2906002)(76176011)(3846002)(6116002)(99286004)(52116002)(81156014)(81166006)(478600001)(68736007)(8676002)(6486002)(14454004)(66066001)(5640700003)(6436002)(72206003)(8936002)(256004)(386003)(102836004)(6506007)(106356001)(105586002)(54906003)(6916009)(2351001)(86362001)(305945005)(2616005)(5660300001)(36756003)(7736002)(316002)(2900100001)(186003)(71200400001)(446003)(11346002)(476003)(486006)(71190400001)(53936002)(6512007)(2501003)(97736004)(26005)(107886003);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR0601MB1126;H:BY1PR0601MB1436.namprd06.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: cypress.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: QcxcgEuGONSWKbp+CjB3sl7prX8QNMNfurDc10vQxzNY/JR1GpojX03Zo+rUui29fIDifAOXmwtRvjfmK7qAztwqUrCpNgpUjHkFZRY4YqxnYJzcMXWWSG5+fqraRDnKqUkrOpS/SNa7FD2BSHH7GIhXdZqRSXJw4Z0v66SI+BnH9+Xyh/Fn7ebCUEHCigk8zTH+N2EKTSnDOQig+E1qtyPmzOtf5gW8LEpc1aY9GOj7x7Z5oOQWKf+0RaBEx/NdlOcKJsYjhPECxaWN9WiR5GraplMRzhUFyUOqX8fUzYaFZh8bJrc+LBvGrLU2bgQrCXGpQAK5xrL7dLjXGQL3TkGnoISWk+TPD7JNS/SXHwU= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: d10d04cb-c8d4-43b1-286b-08d64870a1ae X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Nov 2018 07:29:51.2291 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 011addfc-2c09-450d-8938-e0bbc2dd2376 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0601MB1126 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Naveen Gupta The number of words that the read FIFO has to contain except the end of frame before sends data back to the host. Max watermark = (512B - 2* (BurstLength))/4 = (512 - 128)/4 = 384/4 = 0x60 so if burst length (i.e. BurstLength = 64) is increased, watermark has to be reduced. This is the optimal setting for this chip. Reviewed-by: Arend van Spriel Signed-off-by: Naveen Gupta Signed-off-by: Chi-Hsien Lin --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c index 7707b0169c21..e1708e297d07 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c @@ -52,6 +52,7 @@ /* watermark expressed in number of words */ #define DEFAULT_F2_WATERMARK 0x8 #define CY_4373_F2_WATERMARK 0x40 +#define CY_43012_F2_WATERMARK 0x60 #ifdef DEBUG @@ -4173,6 +4174,17 @@ static void brcmf_sdio_firmware_callback(struct device *dev, int err, CY_4373_F2_WATERMARK | SBSDIO_MESBUSYCTRL_ENAB, &err); break; + case SDIO_DEVICE_ID_CYPRESS_43012: + brcmf_dbg(INFO, "set F2 watermark to 0x%x*4 bytes\n", + CY_43012_F2_WATERMARK); + brcmf_sdiod_writeb(sdiod, SBSDIO_WATERMARK, + CY_43012_F2_WATERMARK, &err); + devctl = brcmf_sdiod_readb(sdiod, SBSDIO_DEVICE_CTL, + &err); + devctl |= SBSDIO_DEVCTL_F2WM_ENAB; + brcmf_sdiod_writeb(sdiod, SBSDIO_DEVICE_CTL, devctl, + &err); + break; default: brcmf_sdiod_writeb(sdiod, SBSDIO_WATERMARK, DEFAULT_F2_WATERMARK, &err); From patchwork Mon Nov 12 07:29:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chi-Hsien Lin X-Patchwork-Id: 10678267 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C114614E2 for ; Mon, 12 Nov 2018 07:30:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AA6FF29F9B for ; Mon, 12 Nov 2018 07:30:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9D90029FD0; Mon, 12 Nov 2018 07:30:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4809D29F9B for ; Mon, 12 Nov 2018 07:30:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727152AbeKLRV6 (ORCPT ); Mon, 12 Nov 2018 12:21:58 -0500 Received: from mail-eopbgr760133.outbound.protection.outlook.com ([40.107.76.133]:54833 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727063AbeKLRV5 (ORCPT ); Mon, 12 Nov 2018 12:21:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cypress.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=w70NKXnt9GJ9/b4qQ6KTrV3vkQH8rlh70UyNt8KXKjg=; b=aTWvWhk1bsEVFEEZxO2hA63gmSxB/jnPKDMNbpWgJ44bBVQSmFkTVlW9lvXNpBe1e6FRZ2uZLTvCjpWZTWnNOx3PkBP8a/TWFDmARBE+LEncHBCus/9U3PJxvH1SjYbGvPb0hs9MwYWLb8Zblwg29+0uPzm9QaVYpwZlo63HXpk= Received: from BY1PR0601MB1436.namprd06.prod.outlook.com (10.162.111.23) by BY1PR0601MB1126.namprd06.prod.outlook.com (10.160.196.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.29; Mon, 12 Nov 2018 07:29:56 +0000 Received: from BY1PR0601MB1436.namprd06.prod.outlook.com ([fe80::199f:c63e:1449:1979]) by BY1PR0601MB1436.namprd06.prod.outlook.com ([fe80::199f:c63e:1449:1979%3]) with mapi id 15.20.1294.044; Mon, 12 Nov 2018 07:29:56 +0000 From: Chi-Hsien Lin To: "linux-wireless@vger.kernel.org" CC: "brcm80211-dev-list@broadcom.com" , brcm80211-dev-list , Arend van Spriel , Franky Lin , Hante Meuleman , Wright Feng , Kalle Valo , Chi-Hsien Lin Subject: [PATCH V2 7/8] brcmfmac: 4373 save-restore support Thread-Topic: [PATCH V2 7/8] brcmfmac: 4373 save-restore support Thread-Index: AQHUelmCvSUU4MYki0WOXWO9KGq0hw== Date: Mon, 12 Nov 2018 07:29:55 +0000 Message-ID: <1542007730-47284-8-git-send-email-chi-hsien.lin@cypress.com> References: <1542007730-47284-1-git-send-email-chi-hsien.lin@cypress.com> In-Reply-To: <1542007730-47284-1-git-send-email-chi-hsien.lin@cypress.com> Accept-Language: en-US, zh-TW Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [12.110.209.245] x-clientproxiedby: HK0PR03CA0084.apcprd03.prod.outlook.com (2603:1096:203:72::24) To BY1PR0601MB1436.namprd06.prod.outlook.com (2a01:111:e400:522c::23) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Chi-Hsien.Lin@cypress.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BY1PR0601MB1126;6:XiJriCEGw4P/8g+SEC2yRqvx5xAzUMeuEXzTDv0kE57wi6B8i4McbbAr1tukFIyZO2K/LJ3edxIkK0zKS+o2aZ0t0bY94SSuE7fnKVshf9xKEoTQI3hsx+6QR4yk6LhDChB9V5LIxEJxmxIE+QUhd5TxAedj7Vf5frCNDd2Pq/L0CtkXx3X/8PuGz73gTx2Awje8b1dtVXPyNaf4UUi7zcce0/+sRl5p4wgCFkP1qlshQyVyJ9olOCEc2v/zzAi/s0ZnQfYOtSoW+T9mG4YtfslhBBJlB9QAUYbGpihfUG+2nyzLwp4e4su3r2cN/6ghD0kxr3P+/Fc0SZ3oNV5vX7wk+5xbD5poBFmmnlv3uwfNjDaalzqNOLe0unyDSzyWR/1ZocDS+CQpEXQtw/fmTsUqEi5Fi5Un+mWkG6Xh02kbtgDo2Dzrk5seEyTTiXGjXPFi5Zm6+iP61q5BDcrXlw==;5:P+6vkFqkQz9VSDktF4bAToT5J/Rxk+6znDLLYBcn7LwX/1B6mSCfEMALyyFS2sT5+k7GVKWqCD3T2Kmv4n0wt6QbtA9JVAOEtEK+ylbMt1OFMh1oga/OvfXTWxEJqPYf6E/r2GXoYY/B4sRvJbgzRnoZ/uDLmKuoTLidW4DVfPI=;7:At/lQP9PI7qrYdm1eVWZ3XgRoQsvRRxBwaKTDQW8kr/agJoGGOI3USzqxzuVrtacdgAqSzvgKjJc4XHBg+jxLucMChgHTU2gy8NHWHwtRjVrL1ls+HnSzeXRSl8CjI9gyNmglI8Dv8QOHg8LY85GtQ== x-ms-office365-filtering-correlation-id: d64485d0-12b2-42d4-c546-08d64870a48d x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390040)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:BY1PR0601MB1126; x-ms-traffictypediagnostic: BY1PR0601MB1126: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(208715162771679)(258095267146985); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(3231382)(944501410)(52105112)(93006095)(93001095)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:BY1PR0601MB1126;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0601MB1126; x-forefront-prvs: 0854128AF0 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(346002)(396003)(376002)(39850400004)(136003)(189003)(199004)(25786009)(4326008)(2906002)(76176011)(3846002)(6116002)(99286004)(52116002)(81156014)(81166006)(478600001)(68736007)(8676002)(6486002)(14454004)(66066001)(5640700003)(6436002)(72206003)(8936002)(256004)(386003)(102836004)(6506007)(106356001)(105586002)(54906003)(6916009)(2351001)(86362001)(305945005)(2616005)(5660300001)(36756003)(7736002)(316002)(2900100001)(186003)(71200400001)(446003)(11346002)(476003)(486006)(71190400001)(53936002)(6512007)(2501003)(97736004)(26005)(107886003);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR0601MB1126;H:BY1PR0601MB1436.namprd06.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: cypress.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 7zMD0iqOqSQEdlqLcUuHqqXZbs0KBz66FHaSR5Ao5wcW1zvSp+4/58gbAkCRjR4piIdZENEyCtA6oq39YFWGNlWaGdPuUQGWQ+lOnP61GZk8mSiEZ7697SK+xXMRYkktEN2+zE6QDw56TnEyAd5pkdyscNY5GtdnIO4UubIhMCGUxqjFrgBrdEtadb12upuqREnUXjva/4dPXC/7R/9+GbSKKd+h/M3sDNLRCuRlLqqzFHFadT/+xcLUqHF153DMiJ7Z3YvDJsA018/or7iG8xw0Ad3z62Y07bcFsbxns8JrGYQU6BSwIRTwngSo584z9aYpOMhLwnWXLRgEeTtgekTdTP2WHhyljIQOGKngcXk= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: d64485d0-12b2-42d4-c546-08d64870a48d X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Nov 2018 07:29:55.9780 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 011addfc-2c09-450d-8938-e0bbc2dd2376 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0601MB1126 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use sr_eng_en bit to check 4373 sr support. Reviewed-by: Arend van Spriel Signed-off-by: Chi-Hsien Lin --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c index a8d3b96b727f..08d5173d000c 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c @@ -1365,6 +1365,11 @@ bool brcmf_chip_sr_capable(struct brcmf_chip *pub) addr = CORE_CC_REG(base, sr_control1); reg = chip->ops->read32(chip->ctx, addr); return reg != 0; + case CY_CC_4373_CHIP_ID: + /* explicitly check SR engine enable bit */ + addr = CORE_CC_REG(base, sr_control0); + reg = chip->ops->read32(chip->ctx, addr); + return (reg & BIT(0)) != 0; case CY_CC_43012_CHIP_ID: addr = CORE_CC_REG(pmu->base, retention_ctl); reg = chip->ops->read32(chip->ctx, addr); From patchwork Mon Nov 12 07:30:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chi-Hsien Lin X-Patchwork-Id: 10678269 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E6C0F14BD for ; Mon, 12 Nov 2018 07:30:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D101629FCA for ; Mon, 12 Nov 2018 07:30:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C4E6729FD4; Mon, 12 Nov 2018 07:30:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6930929FCA for ; Mon, 12 Nov 2018 07:30:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727182AbeKLRWF (ORCPT ); Mon, 12 Nov 2018 12:22:05 -0500 Received: from mail-eopbgr720108.outbound.protection.outlook.com ([40.107.72.108]:21856 "EHLO NAM05-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727090AbeKLRWF (ORCPT ); Mon, 12 Nov 2018 12:22:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cypress.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ODll1bNPEx6nnAWdPNxxeUfNx7WQz4dZMSIdzbpAaVM=; b=IMzyJ3MmxGu3mChLU+xggq/DG9B0YEmSiDRad9S62qaVwQJQ9RAgQNe+uYg6ukLkDBpMmRiiheSjxxF5KBYfoUuuHxrTIKl6nxEu5r/QFi4SztOyhuzUFk4Op3BRiZEgyxGNgfO8WL8u5pju3oVxXsFzjcB5czQYZAw7Hde1NYc= Received: from BY1PR0601MB1436.namprd06.prod.outlook.com (10.162.111.23) by BY1PR0601MB1269.namprd06.prod.outlook.com (10.161.205.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.32; Mon, 12 Nov 2018 07:30:01 +0000 Received: from BY1PR0601MB1436.namprd06.prod.outlook.com ([fe80::199f:c63e:1449:1979]) by BY1PR0601MB1436.namprd06.prod.outlook.com ([fe80::199f:c63e:1449:1979%3]) with mapi id 15.20.1294.044; Mon, 12 Nov 2018 07:30:01 +0000 From: Chi-Hsien Lin To: "linux-wireless@vger.kernel.org" CC: "brcm80211-dev-list@broadcom.com" , brcm80211-dev-list , Arend van Spriel , Franky Lin , Hante Meuleman , Wright Feng , Kalle Valo , Double Lo , Madhan Mohan R , Chi-Hsien Lin Subject: [PATCH V2 8/8] brcmfmac: disable command decode in sdio_aos Thread-Topic: [PATCH V2 8/8] brcmfmac: disable command decode in sdio_aos Thread-Index: AQHUelmF2vP3kzbp0k6zZArwSuxTeQ== Date: Mon, 12 Nov 2018 07:30:01 +0000 Message-ID: <1542007730-47284-9-git-send-email-chi-hsien.lin@cypress.com> References: <1542007730-47284-1-git-send-email-chi-hsien.lin@cypress.com> In-Reply-To: <1542007730-47284-1-git-send-email-chi-hsien.lin@cypress.com> Accept-Language: en-US, zh-TW Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [12.110.209.245] x-clientproxiedby: HK0PR03CA0084.apcprd03.prod.outlook.com (2603:1096:203:72::24) To BY1PR0601MB1436.namprd06.prod.outlook.com (2a01:111:e400:522c::23) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Chi-Hsien.Lin@cypress.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BY1PR0601MB1269;6:2uSZ+2iNcCXD326w6epPB3+uTCvQjPnb2JsLbslFid6q/SmxLrmelZ2e6WlcyV4WfgqJc9s6CbuI5z59LGrvsXTK/tWjaBFJue0GMy1eL4ABoAZRT4U45TSzPTiHOCpgr/87nSqBHmFMtOU+COq3qDjNJLOBF74bNSMvpEkWmbeM28MgF2LVh8lEZc2/Yp36Gs7EY5pdltWKPVIJ6cNrYh5fvpRCnuagwgDmuZDSmLDVY6iAl1spuRFTsLXYqGxgBCa0zVGqymed0ZqoIUL4w6UUUibscU9zxE6zi0WaQe5IoeJuZve/RFResJaICkZ5HznOhL0pte6CUu0I7Yfx47KnwhYMWhAqUq3a8dNJRwxuRP1Rh4v36XyVev5YYR2qRXQUyxSK3ZLohP93yPiuaWsFz0bqNaH2KlAUMPRHyrzna/JTpOTKWzDrHT5fKvi4wra9ocjL7CStIEBkUC1+Qg==;5:nxRlDtUOn2S1d5sWMRVj9dV2AbcVV3Ur+CsqlhEv0fANZkn8l7MbCTEzx5wRPTbJvXUwIf7hd8vPgxcy8kPbEARpCxY1KUbcr5nNQlpynyjcrg5clbnru2ofzd4GBa1O/1KvITVedLIz5aZfn7X/rzAGuBfJNNC1XntwymgQHS4=;7:jo8bgv2YUXxLeqGpWV5ECHO3C5ZjJ9NQFoYA/TlMiE85/2tV3L/WSRes/Qb9u7KmgkyhQWbmzqguhQ2H8e/DCCMMsogjncAMAHGHbB026jfTMzzM/Lz0Jxc7krEZxexm16YYwLBbCQ/IWuJtQfJrMg== x-ms-office365-filtering-correlation-id: f40b6478-09e7-4164-019e-08d64870a7cb x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390040)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:BY1PR0601MB1269; x-ms-traffictypediagnostic: BY1PR0601MB1269: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(258095267146985)(208715162771679); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231382)(944501410)(52105112)(10201501046)(3002001)(93006095)(93001095)(6055026)(148016)(149066)(150057)(6041310)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095);SRVR:BY1PR0601MB1269;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0601MB1269; x-forefront-prvs: 0854128AF0 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(979002)(366004)(346002)(39850400004)(136003)(396003)(376002)(189003)(199004)(72206003)(2906002)(76176011)(446003)(6916009)(6486002)(8936002)(478600001)(14454004)(11346002)(81156014)(66066001)(5660300001)(81166006)(7736002)(68736007)(2501003)(52116002)(86362001)(54906003)(305945005)(316002)(8676002)(2351001)(26005)(71200400001)(2616005)(186003)(6512007)(476003)(71190400001)(486006)(6436002)(106356001)(551934003)(25786009)(5640700003)(97736004)(4326008)(102836004)(386003)(105586002)(6506007)(256004)(14444005)(99286004)(107886003)(3846002)(6116002)(2900100001)(36756003)(53936002)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR0601MB1269;H:BY1PR0601MB1436.namprd06.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: cypress.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: ZkOowNcKrjGyswkWuBSpKr4pIfSA0LBwrEd83sccz8FSlyX2vSfgE55xEH+7cbNHIc4iENtZEHpaJwA+V1Qls0HLI+KJv2IHFyc4L2Ot8CnYrxXXj55BiBfJpvqW6gi56v/h1tQ6NsOK9UMfatgp+CVQobx1bPl5uegrEOD8YnBnExhdPQDakciGKgwgDKqkRBm6Z/pRLBvc9PErHg/clnF8RUfYIsCyapL0RydifrJKPE7b3dKSGEmqJ2sNpzBFkyA2+qLjn0lUfisGWaR5qlMlDt9kPsZImb9+ht0r4/rJ4dEtGdxtk1KhCZaRiVwabY2NgvAHIYaUwSL7JO0qkQGcjOXFxE5usdlXM1U0sPo= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: f40b6478-09e7-4164-019e-08d64870a7cb X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Nov 2018 07:30:01.6757 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 011addfc-2c09-450d-8938-e0bbc2dd2376 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0601MB1269 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wright Feng AOS is a part of the SDIOD core that becomes active when the rest of SDIOD is sleeping to keep SDIO bus alive responding to reduced set of commands. Transaction between AOS and SDIOD is not protected, and if cmd 52 is received in AOS and in the middle of response state changed from AOS to SDIOD, response is corrupted and it causes to SDIO Host controller to hang. Command decode for below chips are disabled in this commit: - 4339 - 4345 - 4354 - 4373 Reviewed-by: Arend van Spriel Signed-off-by: Wright Feng Signed-off-by: Double Lo Signed-off-by: Madhan Mohan R Signed-off-by: Chi-Hsien Lin --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c index e1708e297d07..e5f487b37c5a 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c @@ -3354,7 +3354,11 @@ static int brcmf_sdio_download_firmware(struct brcmf_sdio *bus, static bool brcmf_sdio_aos_no_decode(struct brcmf_sdio *bus) { - if (bus->ci->chip == CY_CC_43012_CHIP_ID) + if (bus->ci->chip == CY_CC_43012_CHIP_ID || + bus->ci->chip == CY_CC_4373_CHIP_ID || + bus->ci->chip == BRCM_CC_4339_CHIP_ID || + bus->ci->chip == BRCM_CC_4345_CHIP_ID || + bus->ci->chip == BRCM_CC_4354_CHIP_ID) return true; else return false;