From patchwork Wed Nov 21 07:53:42 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: 10692071 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 42EF715A7 for ; Wed, 21 Nov 2018 07:54:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3877E28DED for ; Wed, 21 Nov 2018 07:54:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2C09529412; Wed, 21 Nov 2018 07:54:01 +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 BCB8128DED for ; Wed, 21 Nov 2018 07:54:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728337AbeKUS10 (ORCPT ); Wed, 21 Nov 2018 13:27:26 -0500 Received: from mail-eopbgr730138.outbound.protection.outlook.com ([40.107.73.138]:59712 "EHLO NAM05-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728220AbeKUS1Z (ORCPT ); Wed, 21 Nov 2018 13:27:25 -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=nOT1SZp1bYYEHLxo+tH5HO0Yy0OR2YwVVbYONHjrNEg=; b=TZjbRe/hJSziUROm3uqLtOFgoqMUVv9gsChhPQDHSUVKo6KMkbkPhVv3/GDs6PtHp+2O59UyrT5lWe5/obJtoOseYh5KyBwZueIEN8pJoXVSbgYxUhizSh2yAdDAXsFmPe/3uTmW57km8ZPhyJ3F6hHQAV0d0xtCn3cLeexDH5E= Received: from BY1PR0601MB1436.namprd06.prod.outlook.com (10.162.111.23) by BY1PR0601MB1174.namprd06.prod.outlook.com (10.160.195.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1339.23; Wed, 21 Nov 2018 07:53:42 +0000 Received: from BY1PR0601MB1436.namprd06.prod.outlook.com ([fe80::809a:6ca8:db12:f5ae]) by BY1PR0601MB1436.namprd06.prod.outlook.com ([fe80::809a:6ca8:db12:f5ae%4]) with mapi id 15.20.1339.027; Wed, 21 Nov 2018 07:53:42 +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 V4 1/8] brcmfmac: add 4354 raw pcie device id Thread-Topic: [PATCH V4 1/8] brcmfmac: add 4354 raw pcie device id Thread-Index: AQHUgW9Szxi/FYy50UGPfWD2uOV+dg== Date: Wed, 21 Nov 2018 07:53:42 +0000 Message-ID: <1542786800-146083-2-git-send-email-chi-hsien.lin@cypress.com> References: <1542786800-146083-1-git-send-email-chi-hsien.lin@cypress.com> In-Reply-To: <1542786800-146083-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: BYAPR03CA0024.namprd03.prod.outlook.com (2603:10b6:a02:a8::37) To BY1PR0601MB1436.namprd06.prod.outlook.com (2a01:111:e400:522c::23) x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BY1PR0601MB1174;6:FNQ3b1WMprEhsPQ+vtc/Xarj5sr0X0HFldJQLUgJ5RjkxTYvAbbiUkCdZTHOaG4PNYIxdnkI/5Oq+KMc0SPxrq0YQE+tmFpkQyX7+IQIxHlfPmYZhpyZT0/4kkVUivqw0ytbz5UIFBlb0eyvyUc6zXxr3Ng1QmtfCKIWxMHRkTLU6tnjd5fCWW3eiMXTnml61tHTwZ19WJ+suu6GqpXQsTporCvodpR8nmhc52kZ/7kqTIXlgGPu1BZYmrdlBKCsgvsZ6kdk948IXnd07dhm+4l6R0mqqkKkHa8uv+U5l6dgUiqyZ6DdxIBmNxvy/kOkLStAg0GdYxqgFSXIZQIaQo/VIXSeiTjn/t6qFlnSgbslmX54ZKpGcmnvmymGpU1HZWhZAX3uC1ZeXVxH1ANYtXu8RYwfcxSCEKv62kGeJpFeeKChEA/mEsajR47i+DJhMHA5Y9skNpaWZaZZlfuGTQ==;5:nI42cogP9Q+/B70n+XiufctNWD2VflGU4VmHDTBFlvT7i9y6qyQNZfMrqB/H0PAM1jevfG9P5fxK1AGHphJ76c6cjPgYX1WA2eOMyqvfAZ2eag5UjFYYFUtPECqfF0kaYvqyp4EocooFz3NRnyvX+aC/e0ZAETi49OvkV4+raXE=;7:zLdGrKEhtQwCoL/nsqQZCAAfihf57gj6aGdK9aBTiNP+tV1fc+ANU1f30L0ZSg4NMnykS7uNjmiVqhWqQEKcZr8HNSZFiAN8dZbc2sLsPREAR/Gv58/CJpuRd+Xd2+XcVso8j2UQNte2p0W+K6oFzg== x-ms-office365-filtering-correlation-id: 93300cb8-3efc-43dc-eff8-08d64f8674c9 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);SRVR:BY1PR0601MB1174; x-ms-traffictypediagnostic: BY1PR0601MB1174: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Chi-Hsien.Lin@cypress.com; x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(3231442)(944501410)(52105112)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123562045)(20161123560045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(201708071742011)(7699051)(76991095);SRVR:BY1PR0601MB1174;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0601MB1174; x-forefront-prvs: 08635C03D4 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39860400002)(136003)(366004)(376002)(396003)(346002)(189003)(199004)(107886003)(478600001)(36756003)(72206003)(97736004)(8676002)(81166006)(81156014)(186003)(68736007)(6916009)(8936002)(71190400001)(54906003)(2906002)(316002)(25786009)(2501003)(71200400001)(6116002)(3846002)(99286004)(6436002)(2351001)(256004)(305945005)(6486002)(76176011)(7736002)(105586002)(6506007)(4326008)(386003)(52116002)(5640700003)(102836004)(66066001)(2616005)(106356001)(476003)(14454004)(486006)(26005)(11346002)(86362001)(53936002)(2900100001)(446003)(6512007)(5660300001)(575784001);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR0601MB1174;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: 3XkVdaLhdhGzClB0+vSx2tIvF0eJC4vW6u49R0i7ac8pVmbMZTb5J5aivAH3JUlV0iiisv4ILTIBAmdW5AsUtLvN42aE/ExrsvXZOFEnW5pKYIvFDaPODyJV5jemrgOvNGiThwjCiIoEiz9bAzK38bIo1x4Dc02T26dgNij3rFvK0orl//UHGp2eq7L94x+hrc0ZPRijMEx6tWU7H1/IEJ3Ud4sBepx0Q++5MytX5h1ITiwHpHRdE5oJwSZhNqLZZWenG4jX3GBqKpGq9fDVTwHJekQBz62LrteFpn0VRqOmcc0csT/YSphgA0BOwNf99BaFTPTu1PFaNe9AkYDXTyzsUC3iC/aJU6x2H3TSQtU= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: 93300cb8-3efc-43dc-eff8-08d64f8674c9 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Nov 2018 07:53:42.8888 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 011addfc-2c09-450d-8938-e0bbc2dd2376 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0601MB1174 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 956a8b236836..16d7dda965d8 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c @@ -2019,6 +2019,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 Wed Nov 21 07:53:44 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: 10692069 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 539EA15A7 for ; Wed, 21 Nov 2018 07:54:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 48B5628DED for ; Wed, 21 Nov 2018 07:54:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3A08029412; Wed, 21 Nov 2018 07:54: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 BA37728DED for ; Wed, 21 Nov 2018 07:53:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728333AbeKUS1Z (ORCPT ); Wed, 21 Nov 2018 13:27:25 -0500 Received: from mail-eopbgr750121.outbound.protection.outlook.com ([40.107.75.121]:39472 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725999AbeKUS1Z (ORCPT ); Wed, 21 Nov 2018 13:27:25 -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=qay0aFW/E2FYhElg8U8JOaHkpaO+VZRJJs5m0wcZq7Y=; b=yyF7qdslToDFthx3uWPE9nwGOjBljz1Hd4+9QpSchnRIslKjl4sNY4EH5GUgvS2wPwNoB/ePzzVPtvTK2Gd0A8pbBdsbYaTYjdZ1RK7xEP7AEW/rtC52RW6MHOlK2hpDITfqTJvZBb0qwFsEnghm0YjnvoRNFpehE5Huf7iIBUQ= Received: from BY1PR0601MB1436.namprd06.prod.outlook.com (10.162.111.23) by BY1PR0601MB1174.namprd06.prod.outlook.com (10.160.195.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1339.23; Wed, 21 Nov 2018 07:53:44 +0000 Received: from BY1PR0601MB1436.namprd06.prod.outlook.com ([fe80::809a:6ca8:db12:f5ae]) by BY1PR0601MB1436.namprd06.prod.outlook.com ([fe80::809a:6ca8:db12:f5ae%4]) with mapi id 15.20.1339.027; Wed, 21 Nov 2018 07:53:44 +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 V4 2/8] brcmfmac: set F2 watermark to 256 for 4373 Thread-Topic: [PATCH V4 2/8] brcmfmac: set F2 watermark to 256 for 4373 Thread-Index: AQHUgW9TcRwOLz1cHU2PRs7Wd0tBtw== Date: Wed, 21 Nov 2018 07:53:44 +0000 Message-ID: <1542786800-146083-3-git-send-email-chi-hsien.lin@cypress.com> References: <1542786800-146083-1-git-send-email-chi-hsien.lin@cypress.com> In-Reply-To: <1542786800-146083-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: BYAPR03CA0024.namprd03.prod.outlook.com (2603:10b6:a02:a8::37) To BY1PR0601MB1436.namprd06.prod.outlook.com (2a01:111:e400:522c::23) x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BY1PR0601MB1174;6:hOyvtVmzL74HZmqBOFaDd9TKIGGfXeSHu4w4hXS4pkNVh3rsg277wCHiYCFJoz8R3ISFFra6wJDLBKrgFXGm1+xjrs/aRFZNX0ujomsSfa30wVekfwdcAzfH0/NwMu0m/2Xzr3uwr3HUEdXPAfG+3G/5YTHvSBhbgClCP6xtqm9/VjUhJZqC+6XUh3Hb0hg6gTKw5OmawANJYAxwvPSA+/VC2qJx14nIX4zdohefLY9XjEYyobo9mny+PcUgrqj8ZjiBVCL1F8QNjjPhAO8zl0kI52szc2/bAqs5RdRajfQ0IdyBjIdkIVuj2eVOyEog8Jy7glYdAMAjCuzHfmNUho0fy1SX7e7G53pMujf2kbFxbh2aTcJ6tQFjleAZwH7He3eRWaaBCqjKs9u0sx4YLMgowolWKdYelKPwDnfKCCdgLXSGMPzrib4BiIwyzT5knuSZLz2M3OX7YNHqaGZJLQ==;5:Jyqle+m1eS2g/CPKfTXHckhLdW7m36JygNwgKTt1f9AAxNF5hXP4JMPTyXQAraztkyH/TIVMC8YXJzUVwnGjolfneGgvTu3EFGDIQuXaTvAwr8fF/ttrh9FhQtKPvHl31U/y7F6M3g2m6ubCOtfZHyV9sjp9kNNudGAu+mXHnuI=;7:oTdDv67dTyshDtRggztUdrMQiJty/RUbZWpIVgA24soX5w4+mj31JGrHYgW+mkl0YErgEnqUqFLv437wxERy95jxs5qrlUn1WjxRtvITZ/jollbYga4lBdNEiULOBmJSaHZlR7ZnjRv/v0Lgyzz32g== x-ms-office365-filtering-correlation-id: 3859e94f-5b4f-404c-d505-08d64f86758f x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);SRVR:BY1PR0601MB1174; x-ms-traffictypediagnostic: BY1PR0601MB1174: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Chi-Hsien.Lin@cypress.com; x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(3231442)(944501410)(52105112)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123562045)(20161123560045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(201708071742011)(7699051)(76991095);SRVR:BY1PR0601MB1174;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0601MB1174; x-forefront-prvs: 08635C03D4 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39860400002)(136003)(366004)(376002)(396003)(346002)(189003)(199004)(107886003)(478600001)(36756003)(72206003)(97736004)(8676002)(81166006)(81156014)(186003)(68736007)(6916009)(8936002)(71190400001)(54906003)(2906002)(316002)(25786009)(2501003)(71200400001)(6116002)(3846002)(99286004)(6436002)(2351001)(256004)(305945005)(6486002)(76176011)(7736002)(105586002)(6506007)(4326008)(386003)(52116002)(5640700003)(102836004)(66066001)(2616005)(106356001)(476003)(14454004)(486006)(26005)(11346002)(86362001)(53936002)(2900100001)(446003)(6512007)(5660300001)(575784001);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR0601MB1174;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: Dnj30mwUUiaOMSG5WcUPw3L5xLvTdXnPO6Rd6p3hGBLcd4FMC3H6gayPizIJOgie3EulXEoSuIeIRBihxRAkPAgOwniAfiyDan8O4Ko6CVMvbwmPesW2Ubkw7zZ6WkuVU5XRgKT05RXcAZiKWZ3ofY8mfKW0XWcrEMJLzUiWAPgTpudUynal/uhmg9gPfo/vpWNjHkedvhscQbxrfaGqP+RZVl787PEzkvkfSvNdr5ZKldol/TEApjmrZWBKeZKrho18CyM0VDqj4MFiR7rD+s8SP+hVDVlnJzXZve5APE8YKW5V60PaaGLlqD+cIf3ZJvdhoUQ7aGdq5PAWRBzk9zCNgrExc/+2fIy6InJBuI4= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3859e94f-5b4f-404c-d505-08d64f86758f X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Nov 2018 07:53:44.1076 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 011addfc-2c09-450d-8938-e0bbc2dd2376 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0601MB1174 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 22646a3b911e..c833e24c751c 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 Wed Nov 21 07:53: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: 10692073 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 18BB913AD for ; Wed, 21 Nov 2018 07:54:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0EDC528DED for ; Wed, 21 Nov 2018 07:54:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0367929412; Wed, 21 Nov 2018 07:54:02 +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 9262A28DED for ; Wed, 21 Nov 2018 07:54:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728350AbeKUS11 (ORCPT ); Wed, 21 Nov 2018 13:27:27 -0500 Received: from mail-eopbgr750121.outbound.protection.outlook.com ([40.107.75.121]:39472 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728322AbeKUS10 (ORCPT ); Wed, 21 Nov 2018 13:27:26 -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=/z5VZ8Xr4BUy+e9vpXvu91P7emkl/xhcAUXTpfAK/nc=; b=fIZdKCCP287BiAzBIpBqcBrkYs1EjVxNXiitYudMjPwGd0h3w8c02zm6/kkR4/rwYZ4UA9CrumS0au05z6yx/724WzdvEI4MzSF9fLhNRqxSamm1DKGvbwFeEz1T/E2z1zR+4o32Lx45wm9lDaDDiEPWRIjTHIvO/WO/Hv1e31Q= Received: from BY1PR0601MB1436.namprd06.prod.outlook.com (10.162.111.23) by BY1PR0601MB1174.namprd06.prod.outlook.com (10.160.195.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1339.23; Wed, 21 Nov 2018 07:53:45 +0000 Received: from BY1PR0601MB1436.namprd06.prod.outlook.com ([fe80::809a:6ca8:db12:f5ae]) by BY1PR0601MB1436.namprd06.prod.outlook.com ([fe80::809a:6ca8:db12:f5ae%4]) with mapi id 15.20.1339.027; Wed, 21 Nov 2018 07:53:45 +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 V4 3/8] brcmfmac: set SDIO F1 MesBusyCtrl for CYW4373 Thread-Topic: [PATCH V4 3/8] brcmfmac: set SDIO F1 MesBusyCtrl for CYW4373 Thread-Index: AQHUgW9UYqk/6BYCE0mOJfK/GneMnw== Date: Wed, 21 Nov 2018 07:53:45 +0000 Message-ID: <1542786800-146083-4-git-send-email-chi-hsien.lin@cypress.com> References: <1542786800-146083-1-git-send-email-chi-hsien.lin@cypress.com> In-Reply-To: <1542786800-146083-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: BYAPR03CA0024.namprd03.prod.outlook.com (2603:10b6:a02:a8::37) To BY1PR0601MB1436.namprd06.prod.outlook.com (2a01:111:e400:522c::23) x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BY1PR0601MB1174;6:Rvw2rIZSa6UR3u+HXYMsqH6md/1SF/OH1Rycg2yABdjb+iy8Uua6o8ZdrDZH9gDAjhGZWefz37HzhVTKerJftn+kcFhQw2OY4AVIS5kivxgUi90UuSiYDODlL5+QW42IesEdUdfP4udw8GuGB45Gq2Wr6zJ4pMBoLY+NNtvyu4n4oyzZ6I+0dV7Z7EBbsLpmOLzdBE1fi1Itb+JN/Uyhbek+7wbW5px77r2IMmSK6KoxpXFXdIQfwphsBjJJ5ZsrvsKTMCWupBsYcgdq4HPR8lNaZW8K+hKiAr7QtYFNO2Q3vVAN1f3a7q+t4xeXrsOADnHq1UwHG4MEACQqEHrzn9znShVUJVPMMvc1U+OK54U8ulmcO4n1Dc6FbY4M2PTh1/oB4bP8aab1zhzrbh/NfkjCxQLTLZ2XVt9ozqljduybo9pCCHVtiu0uhJv9DaJHM1x39q7YpwYgQd+EZEfKTQ==;5:N0yTAueRpmmGhrAs4v0+myIkzsq153R/pUUCXgNa/vvS8Uws8Ip4/y55wEsMHYf1wQw0g5pE7M80Oy6VOIRzMomPbBocbMYpI03d9Q0pbLpD8BgSsTMfXdnYgcK/8yR9EJcDqfaZHZGS7KC2RvL6uPHkKmf4Q3BkselH3eUpHyU=;7:NYwLGgbuZV33fxJ5cLyH1Tb6TPd+M0Oiks5i2AjvkBxSyWvzMPBdJt1IGBm8VSkTQ/VU+eJUCgmhdQGmBHapQc0FU54rWocVKf9Ml7ToDxvg4vu3LjAFiFbtsALCS/IGVdIXY61lqlv/Z0DfwMhVLg== x-ms-office365-filtering-correlation-id: b639ed1a-5f01-4601-57c5-08d64f867653 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);SRVR:BY1PR0601MB1174; x-ms-traffictypediagnostic: BY1PR0601MB1174: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Chi-Hsien.Lin@cypress.com; x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(3231442)(944501410)(52105112)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123562045)(20161123560045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(201708071742011)(7699051)(76991095);SRVR:BY1PR0601MB1174;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0601MB1174; x-forefront-prvs: 08635C03D4 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39860400002)(136003)(366004)(376002)(396003)(346002)(189003)(199004)(107886003)(478600001)(36756003)(72206003)(97736004)(8676002)(81166006)(81156014)(186003)(68736007)(6916009)(8936002)(71190400001)(54906003)(2906002)(316002)(25786009)(2501003)(71200400001)(6116002)(3846002)(99286004)(6436002)(2351001)(256004)(305945005)(6486002)(76176011)(7736002)(105586002)(6506007)(4326008)(386003)(52116002)(14444005)(5640700003)(102836004)(66066001)(2616005)(106356001)(476003)(14454004)(486006)(26005)(11346002)(86362001)(53936002)(2900100001)(446003)(6512007)(5660300001)(575784001);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR0601MB1174;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: 5bStXyk0K0fTDXH0n09/iKyIXvVECvrfQbqM7I1bgVA16u/Rxo99c9VGMaIktxd320xDmoHu1yXI/sn8ZB0sYuebYCUctYpuRVgKg86aho3zbQq/W515HRoREstYiZqM1Q4v6OQ7FXOHUxOILOU7i4KqIsEC6z7e5aqz4sXHnQVbgUQegbw+iFEKPiBPZq7p6696Y6gD8sIQp5CmpD2a3AAPvwKFYXFWFyDhVYzS7fckkbg9gXQ6r359vEdHb7MCKmpUMxQd0v3iJFF7Csw3MKNWR+m04Y/sd25HgGSx3zl1CH86R98g1ruyNlTteVhEW3I8fNX47mjWDRGlcTyJ87EUaoiIRRChr3udOoar0xM= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: b639ed1a-5f01-4601-57c5-08d64f867653 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Nov 2018 07:53:45.8264 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 011addfc-2c09-450d-8938-e0bbc2dd2376 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0601MB1174 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 & sdio device RX FIFO watermark should be 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 | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c index c833e24c751c..7a0601543dff 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..34b031154da9 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h @@ -77,7 +77,7 @@ #define SBSDIO_GPIO_OUT 0x10006 /* gpio enable */ #define SBSDIO_GPIO_EN 0x10007 -/* rev < 7, watermark for sdio device */ +/* rev < 7, watermark for sdio device TX path */ #define SBSDIO_WATERMARK 0x10008 /* control busy signal generation */ #define SBSDIO_DEVICE_CTL 0x10009 @@ -104,6 +104,13 @@ #define SBSDIO_FUNC1_RFRAMEBCHI 0x1001C /* MesBusyCtl (rev 11) */ #define SBSDIO_FUNC1_MESBUSYCTRL 0x1001D +/* Watermark for sdio device RX path */ +#define SBSDIO_MESBUSY_RXFIFO_WM_MASK 0x7F +#define SBSDIO_MESBUSY_RXFIFO_WM_SHIFT 0 +/* Enable busy capability for MES access */ +#define SBSDIO_MESBUSYCTRL_ENAB 0x80 +#define SBSDIO_MESBUSYCTRL_ENAB_SHIFT 7 + /* Sdio Core Rev 12 */ #define SBSDIO_FUNC1_WAKEUPCTRL 0x1001E #define SBSDIO_FUNC1_WCTRL_ALPWAIT_MASK 0x1 From patchwork Wed Nov 21 07:53:47 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: 10692077 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 6283C15A7 for ; Wed, 21 Nov 2018 07:54:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5475529467 for ; Wed, 21 Nov 2018 07:54:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4828129662; Wed, 21 Nov 2018 07:54:04 +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 756C129467 for ; Wed, 21 Nov 2018 07:54:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728343AbeKUS11 (ORCPT ); Wed, 21 Nov 2018 13:27:27 -0500 Received: from mail-eopbgr730138.outbound.protection.outlook.com ([40.107.73.138]:59712 "EHLO NAM05-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725999AbeKUS10 (ORCPT ); Wed, 21 Nov 2018 13:27:26 -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=7ivpPpbNOb2P0MMAFr8OlxU0Po2WiLPJw7PY4QNmDAs=; b=Whgyt874QL0GZUbl5J1Yz4SqiQBRgVZ2Y2joR1+R0l3Ppo3P2UV6UTr/FUGM39YB9crgqHF5tKZDhaQjakZIblS9Xo1ivJ3W1NtkXGbwXGbHJW0ifMGlob+ZM+c1KPpoqpRSbZyPBj8TL3xKg7AQ+Wvt8LyBl0Y4sMEOHLS8oug= Received: from BY1PR0601MB1436.namprd06.prod.outlook.com (10.162.111.23) by BY1PR0601MB1174.namprd06.prod.outlook.com (10.160.195.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1339.23; Wed, 21 Nov 2018 07:53:47 +0000 Received: from BY1PR0601MB1436.namprd06.prod.outlook.com ([fe80::809a:6ca8:db12:f5ae]) by BY1PR0601MB1436.namprd06.prod.outlook.com ([fe80::809a:6ca8:db12:f5ae%4]) with mapi id 15.20.1339.027; Wed, 21 Nov 2018 07:53:47 +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 V4 4/8] brcmfmac: add support for CYW43012 SDIO chipset Thread-Topic: [PATCH V4 4/8] brcmfmac: add support for CYW43012 SDIO chipset Thread-Index: AQHUgW9VW+5dQ8cB00CLGGxEcIiarw== Date: Wed, 21 Nov 2018 07:53:47 +0000 Message-ID: <1542786800-146083-5-git-send-email-chi-hsien.lin@cypress.com> References: <1542786800-146083-1-git-send-email-chi-hsien.lin@cypress.com> In-Reply-To: <1542786800-146083-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: BYAPR03CA0024.namprd03.prod.outlook.com (2603:10b6:a02:a8::37) To BY1PR0601MB1436.namprd06.prod.outlook.com (2a01:111:e400:522c::23) x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BY1PR0601MB1174;6:ecGIL7lBtcVW8GzR0+nBSBH+pZ6bFgu63bpBvK8Kuknk8Gt5OaElssojEBcN0G3hcK3neGTCuGJhAGHOxkvFbmpUAV5JurJ9E7JtVNfAaS+ANUeQIer3PD9GEzTmsyMribHZHeOl5YmRAbSpGD9Vj37mV+2qOI8MX0/DrNZVGmsOePBgRd4hORay3k2A9lWdYcdvGeqTsW4pE3s1eSiE60M+0wwAfBK7dxgMBjJiv2TV/s+MuGBigev2kNLe5x4Y5qdRTN+bQM8eZaIZLlp2wMz24STkDIH0eTeLothpGQJPnJn/PtCHfoSHvZ6Zo0bTUbtGpnp5jeX6+ilen7C02JgoTIkLrDI3Empm0FqApiLbaOofpSLS4wTZuJnthnfWuX3uQaja6vKiAF/mviD+d77UU3Mv0mRsmliWsAeiE1Goq0G6HXb4RI52zuCXwjBPbqmceJ/EIjBndq/o2zH2SQ==;5:01xwOWtv/fyhhNhcCaanP7YaA57MIiMb+HosOMC707fLqKR0f4xiE2rPAE81WUMff3g2h171Lq38UqwppbVEAkXlj9fl4++dd4+w74AcgMF/aOk4wbvn3XeYyh/x91TDXmf4Xbv1dAy34EgyViA9mA0zyxuyScwHA91FCzNcCTw=;7:hqSFw+t8WWje5Zc4zwirSg/Tr1QuYYQd9QO2XC3j7w9UkCKVWgDUrpPSoYsKEjerjKgn5OCt9oxBxjUEtXXU8krMNaV00yOdffg59MbAX5kuThO302g6KViG90ZBjlAwEE0697RkZmQOUXWm+RCXpg== x-ms-office365-filtering-correlation-id: 7cb95394-ae73-45c2-75c5-08d64f867752 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);SRVR:BY1PR0601MB1174; x-ms-traffictypediagnostic: BY1PR0601MB1174: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Chi-Hsien.Lin@cypress.com; x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(3231442)(944501410)(52105112)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123562045)(20161123560045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(201708071742011)(7699051)(76991095);SRVR:BY1PR0601MB1174;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0601MB1174; x-forefront-prvs: 08635C03D4 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39860400002)(136003)(366004)(376002)(396003)(346002)(189003)(199004)(107886003)(478600001)(36756003)(72206003)(97736004)(8676002)(81166006)(81156014)(186003)(68736007)(6916009)(8936002)(71190400001)(54906003)(2906002)(316002)(25786009)(2501003)(71200400001)(6116002)(3846002)(99286004)(6436002)(2351001)(256004)(305945005)(6486002)(76176011)(7736002)(105586002)(6506007)(4326008)(386003)(52116002)(5640700003)(102836004)(66066001)(2616005)(106356001)(476003)(14454004)(486006)(26005)(11346002)(86362001)(53936002)(2900100001)(446003)(6512007)(5660300001)(575784001);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR0601MB1174;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: UyIHyucFb8aogXJyZLbkyH+e8rfDHjuP0Kk5uvTEzrsY+ivlPWL6vnIEGcDwHQLQaoj13CVo0mkjXrumwZHES6vfp0/RDQcaPyZAK2C6mGWnp865kSiu67n5Vbt75nyyDavVOQMDeEwKl6K1o51t7cah3gPobM+HyXvxJQfbkJcgDjLdwQuVHqAjzSxmpnquwpw5lzFAAiORprMCsy0iXlNDj0XxqTvBdSTFTChvkf4cT4aw6r2Ewwv7ihxQePBJ9zClEXpUYGNqYf76oPVxZLDCRb16cLNvAeUnMvmrLCHoSiD8pfJK5LHLHRIx3wr0BPIKDHwiMSWP5sUgB5Bajg4IAHKVMCV6Uf/Cdx3n3P4= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7cb95394-ae73-45c2-75c5-08d64f867752 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Nov 2018 07:53:47.0296 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 011addfc-2c09-450d-8938-e0bbc2dd2376 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0601MB1174 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 b2ad2122c8c4..d64bf233b12c 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c @@ -983,6 +983,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 7a0601543dff..73a034172c4c 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 Wed Nov 21 07:53:48 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: 10692079 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 2852B15A7 for ; Wed, 21 Nov 2018 07:54:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1DCEA294D0 for ; Wed, 21 Nov 2018 07:54:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 11F2729662; Wed, 21 Nov 2018 07:54:05 +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 8C28C2966F for ; Wed, 21 Nov 2018 07:54:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728370AbeKUS1a (ORCPT ); Wed, 21 Nov 2018 13:27:30 -0500 Received: from mail-eopbgr750121.outbound.protection.outlook.com ([40.107.75.121]:39472 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728220AbeKUS11 (ORCPT ); Wed, 21 Nov 2018 13:27: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=yszK0sgGuc7rC0dOUh9okPjq2IPBgKxkWQICDZb1kG4=; b=fLuHYyrtbXFQjgKAN80h7sxCnCvzKKSOYC1I4d7ku+daki8kBiWe4ZtfaDBH8CreCYUfHz/H7Ntaiyt1Smu5n2nIyumMU0SuWZA3lokgp+M9/XqvT7lBhiJFKX9DtFrP92RC+NWMPF1bd6xHw+9NSAk74Pyt/A56foMKVHzrVRQ= Received: from BY1PR0601MB1436.namprd06.prod.outlook.com (10.162.111.23) by BY1PR0601MB1174.namprd06.prod.outlook.com (10.160.195.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1339.23; Wed, 21 Nov 2018 07:53:48 +0000 Received: from BY1PR0601MB1436.namprd06.prod.outlook.com ([fe80::809a:6ca8:db12:f5ae]) by BY1PR0601MB1436.namprd06.prod.outlook.com ([fe80::809a:6ca8:db12:f5ae%4]) with mapi id 15.20.1339.027; Wed, 21 Nov 2018 07:53:48 +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 V4 5/8] brcmfmac: allow GCI core enumuration Thread-Topic: [PATCH V4 5/8] brcmfmac: allow GCI core enumuration Thread-Index: AQHUgW9V6xS6fJoicU2H9HD2snZdiw== Date: Wed, 21 Nov 2018 07:53:48 +0000 Message-ID: <1542786800-146083-6-git-send-email-chi-hsien.lin@cypress.com> References: <1542786800-146083-1-git-send-email-chi-hsien.lin@cypress.com> In-Reply-To: <1542786800-146083-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: BYAPR03CA0024.namprd03.prod.outlook.com (2603:10b6:a02:a8::37) To BY1PR0601MB1436.namprd06.prod.outlook.com (2a01:111:e400:522c::23) x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BY1PR0601MB1174;6:nX4ICoRMWRLDuhSna/7J9aZ8ot1PTB4mqNVmL5seRigWhpLQQTO95Sc6JAyu8jsUMPTLBglAKYY83ae34xq0/E1KNZs435zHYetrLNmu8kl6ghYDU2gyWiHK802bitrvzoHwBvABWuFUsLIo8641AgFrZ6x8NwnodjEhC0yyOZHfo4xvAlG+YZPeVP3pS7CpOFK2m9a9FMAKB9HAKQx7qnYDT8GGiiaU+olEOTrBvDiMfYCVZhVrpzRKd1oPaa3pzCE8m05xDq6zfEulfwQZcLpawwN4vmWsH5uJtD9BG7SEGzRzE3y295q3PRrryLqEhLZtxv8tm23y5XDnGLV6RQThgNPrhIvKSqD/5xgUZHcKz7FOyEjma3ARRBwS0GoERS9DXuPY+IYHduPq5FT5+vt9lIxQcR39QcaGDrr19yxHLz6V2WjrWhkI4HFhsfkCEsiaalVRXk8bkaTG2PqoEA==;5:k9dxSI8zKS24Gah8htEF72RlaYkG5TqkSZ2w7iO4suvyG7wb1HW1XIeNWk/LyHMaxdDLw/ropGZbMfvMJlsLT5vlXzwfeAWRb51qeCYCtms0KgvEKlYUII+XXXOg+9D6z6ZOJxlj+ckncRhe6i+AKk6iZGOFP90F8Ml5A0a2qU4=;7:Z4IfEeV1J3MQpgLBv8Mqe9Y1bA+4OHhmXcIm7QMnavzyLMfzplGrWS+RBemgeAKd6q9YCXkFuAjQWhqdysPkPkl0Y/LWDAcLpEq6ZWrIvMTP9Z03ybr+TdhS4k4+J2iv82Kr5TFI9z42jgCzEPbdOA== x-ms-office365-filtering-correlation-id: bc3a18b5-57f4-4b27-47d0-08d64f867805 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);SRVR:BY1PR0601MB1174; x-ms-traffictypediagnostic: BY1PR0601MB1174: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Chi-Hsien.Lin@cypress.com; x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(3231442)(944501410)(52105112)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123562045)(20161123560045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(201708071742011)(7699051)(76991095);SRVR:BY1PR0601MB1174;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0601MB1174; x-forefront-prvs: 08635C03D4 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39860400002)(136003)(366004)(376002)(396003)(346002)(189003)(199004)(107886003)(478600001)(36756003)(72206003)(97736004)(8676002)(81166006)(81156014)(186003)(68736007)(6916009)(8936002)(71190400001)(54906003)(2906002)(316002)(25786009)(2501003)(71200400001)(6116002)(3846002)(99286004)(6436002)(2351001)(256004)(305945005)(6486002)(76176011)(7736002)(105586002)(6506007)(4326008)(386003)(52116002)(5640700003)(102836004)(66066001)(2616005)(106356001)(476003)(14454004)(486006)(26005)(11346002)(86362001)(53936002)(2900100001)(446003)(6512007)(5660300001);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR0601MB1174;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: ItTE3RuYgqP+C29qjsMPjuSWzoVywZ/2zHdgsRMp2UuHMe9B2wvS4kbSUQcOQlMQVvrqqk7Q+Ul2Sq9fFSufCzCda2MhjsLJAMuBIGzZXfiwcdt15hEHtIstlMLtqNxbnoo8CTyLh+oBbFJKYbok+aXXRExlt/Aij4V3Ts2MFoGp4YQv9AfX/0PTXOWhEgntievpVoTxkbsPUidyBerCHzNhPuyeHFKCR9WGRNXBHPdxS5DMp0AxTb3HFjHl3nY2kWHe4ELawD0b75pm4DBNjOkM5sZcFZ5cz7oR6VRiozYMsIiDawwzKPYmJgYuHrd2D9gLGlL+JDDc/Z1imUg8Fb/NP6Ju/xS/A7u3jxvhP7c= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: bc3a18b5-57f4-4b27-47d0-08d64f867805 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Nov 2018 07:53:48.2171 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 011addfc-2c09-450d-8938-e0bbc2dd2376 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0601MB1174 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 Wed Nov 21 07:53:49 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: 10692075 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 EA14D13AD for ; Wed, 21 Nov 2018 07:54:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E0673293E5 for ; Wed, 21 Nov 2018 07:54:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D4DEF29412; Wed, 21 Nov 2018 07:54:02 +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 7720A28DED for ; Wed, 21 Nov 2018 07:54:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728355AbeKUS12 (ORCPT ); Wed, 21 Nov 2018 13:27:28 -0500 Received: from mail-eopbgr730138.outbound.protection.outlook.com ([40.107.73.138]:59712 "EHLO NAM05-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728285AbeKUS11 (ORCPT ); Wed, 21 Nov 2018 13:27: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=Be11iNvYxsStvcW9ocCJyVZPVwaCjiR0/zdsd2Gd0E4=; b=Jf0xBNSecvNQfwHQQTtoHicxXP+3Tc1iUJ62ryAUXW5E+RQvhTOKBJ4Og2S4Mw78DLUMcfbwcMHYpjD9uRfQcah90uVQNz79pc8rgJBm2YNkTH7nBoJWiyTMmB2Phce1eMhXmc7ZGIaIFRzSCt8JUPvELD1brrUutfHnva8ouXg= Received: from BY1PR0601MB1436.namprd06.prod.outlook.com (10.162.111.23) by BY1PR0601MB1174.namprd06.prod.outlook.com (10.160.195.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1339.23; Wed, 21 Nov 2018 07:53:49 +0000 Received: from BY1PR0601MB1436.namprd06.prod.outlook.com ([fe80::809a:6ca8:db12:f5ae]) by BY1PR0601MB1436.namprd06.prod.outlook.com ([fe80::809a:6ca8:db12:f5ae%4]) with mapi id 15.20.1339.027; Wed, 21 Nov 2018 07:53:49 +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 V4 6/8] brcmfmac: update 43012 F2 watermark setting to fix DMA Error during UDP RX Traffic Thread-Topic: [PATCH V4 6/8] brcmfmac: update 43012 F2 watermark setting to fix DMA Error during UDP RX Traffic Thread-Index: AQHUgW9WGPjn5GwWlU+NeXk1PkQChg== Date: Wed, 21 Nov 2018 07:53:49 +0000 Message-ID: <1542786800-146083-7-git-send-email-chi-hsien.lin@cypress.com> References: <1542786800-146083-1-git-send-email-chi-hsien.lin@cypress.com> In-Reply-To: <1542786800-146083-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: BYAPR03CA0024.namprd03.prod.outlook.com (2603:10b6:a02:a8::37) To BY1PR0601MB1436.namprd06.prod.outlook.com (2a01:111:e400:522c::23) x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BY1PR0601MB1174;6:euNDe8568dzLVADif92J+mFz14MPh/T02y84y7rJdrizrbb254+OUdVex3MF9HV+FKuWuW69r1BhRLy9PDLLLFdb5L/5gtv197/5XCkCi78DyMxzQZA0RduZZg4aPYlklbsA8vQZkHF16yp1aoS+1xLkSs9Ndfvz0QCQhkkfp1ruTY19NWsHh+thfiJpnZ2Zw4LiHBndfAc38cSnHVtVb07WFKwdz5Mq/4QqLl3EIRkRBm/z9/ifLa3JZbi88kvGK2lXLUFu3GcC3a20GAphFrQqUsv/G7yV4RpEDeIeZCmKqMwYHQN5Ihj9WLqLuSeL0EJxih+fo3/YPNXc3juqIfkJinUFLsCI98Vdw9+TOJ5VcumnJvUQnJZeTCj4iWBIu80zB3B8oO3wOPGu9keTc6m1VvNp/qXJ3CBXlnmUUUKWfYElhQ5hpvkuL2nGcTBgK5KPP/Oont6urROeLvqXiw==;5:b2aJPPg4n/92vroKcOT+toNhAfj6FX26b5NDooA0vXQ0dllfAMLMkug9lHf+shZOIcOe0WngRZx6mfCFtdvSPoWcyivoxQDuNds1Da+kjZPxnCqDV6TKOKeLPTZexkHWqCVE6sLIyMNssfSNW/zMFFtcgByBnGABjPyNhIBlBNU=;7:1Q8rRjzgGqimbvma9CT1Vib7Wj+MW4APe+pkfwwkf4z3TDnYYv9KfwW45vzH5RrL2cuEHBPvvL+O68foiP4OHAfxw8DKg/4zWGmTyQZ4pqMrp8S9q3Ts88bug6tZFWA/eD1Atle7NLu6bGJL+kKKzw== x-ms-office365-filtering-correlation-id: 6b0bf5dd-ab50-4a6c-4108-08d64f8678bf x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);SRVR:BY1PR0601MB1174; x-ms-traffictypediagnostic: BY1PR0601MB1174: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Chi-Hsien.Lin@cypress.com; x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(3231442)(944501410)(52105112)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123562045)(20161123560045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(201708071742011)(7699051)(76991095);SRVR:BY1PR0601MB1174;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0601MB1174; x-forefront-prvs: 08635C03D4 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39860400002)(136003)(366004)(376002)(396003)(346002)(189003)(199004)(107886003)(478600001)(36756003)(72206003)(97736004)(8676002)(81166006)(81156014)(186003)(68736007)(6916009)(8936002)(71190400001)(54906003)(2906002)(316002)(25786009)(2501003)(71200400001)(6116002)(3846002)(99286004)(6436002)(2351001)(256004)(305945005)(6486002)(76176011)(7736002)(105586002)(6506007)(4326008)(386003)(52116002)(5640700003)(102836004)(66066001)(2616005)(106356001)(476003)(14454004)(486006)(26005)(11346002)(86362001)(53936002)(2900100001)(446003)(6512007)(5660300001)(575784001);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR0601MB1174;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: HJ/ZSCrqhtc7VEdJu1jlUD72OlLcsLHQkaSKxPp0rg5KhV6yM+kCtFhgEuYc/3NBB8ACl220DrdEi61/5KR+BGoVheahZh3FeOui786GuRxfB62LHUYCZV5UVd0CUEosP0PkJ6Q0LXU/CbPX7VRyf7pPX22iVTVZth9EZ3Af8o7AfojKI/6+p37v63oUY5oV7nxOMHSbapmDAPcXw7yovphv1nr50E+7CapQ8IA8m7/oNpMpbEoID+8O+dEPQgOQmeWOqCHIGuG3qe4qg09WDHdZZhdkCtkWP2xi8KkAboEJkSuQwox7uumspo7uGt6UwG58cNS+tkeyGwD1cHmeImZJo/0GCkgONjmWwC71/J4= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6b0bf5dd-ab50-4a6c-4108-08d64f8678bf X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Nov 2018 07:53:49.5922 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 011addfc-2c09-450d-8938-e0bbc2dd2376 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0601MB1174 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 73a034172c4c..fe0cb398ab44 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 Wed Nov 21 07:53:50 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: 10692083 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 D791B15A7 for ; Wed, 21 Nov 2018 07:54:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CB67129467 for ; Wed, 21 Nov 2018 07:54:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BF50429662; Wed, 21 Nov 2018 07:54:06 +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 5E1BC29467 for ; Wed, 21 Nov 2018 07:54:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728360AbeKUS13 (ORCPT ); Wed, 21 Nov 2018 13:27:29 -0500 Received: from mail-eopbgr730138.outbound.protection.outlook.com ([40.107.73.138]:59712 "EHLO NAM05-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728322AbeKUS13 (ORCPT ); Wed, 21 Nov 2018 13:27:29 -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=/FkKHbpAK2cksWMWQ7eme0yEGOzDdYoc5GCIVVD/vCk=; b=Gj1qjB2N0bMdC0v4AU2zlVpULAF2kLbi8SQPHNn6UoWH243YAbiZ+2Cvky3QYcSqE8rBCuiwehpTRuIO2A7tWhmpyF9VWiNZvpkno2RCiQU7m4vCju31qsZlLK4tcWICNxXidzK5xI46A3iZqOsbRph4FvS3hH9kxWfxx2w3fxk= Received: from BY1PR0601MB1436.namprd06.prod.outlook.com (10.162.111.23) by BY1PR0601MB1174.namprd06.prod.outlook.com (10.160.195.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1339.23; Wed, 21 Nov 2018 07:53:51 +0000 Received: from BY1PR0601MB1436.namprd06.prod.outlook.com ([fe80::809a:6ca8:db12:f5ae]) by BY1PR0601MB1436.namprd06.prod.outlook.com ([fe80::809a:6ca8:db12:f5ae%4]) with mapi id 15.20.1339.027; Wed, 21 Nov 2018 07:53:50 +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 V4 7/8] brcmfmac: 4373 save-restore support Thread-Topic: [PATCH V4 7/8] brcmfmac: 4373 save-restore support Thread-Index: AQHUgW9XUP/iZ2f0WE+y9MzjRqaUHg== Date: Wed, 21 Nov 2018 07:53:50 +0000 Message-ID: <1542786800-146083-8-git-send-email-chi-hsien.lin@cypress.com> References: <1542786800-146083-1-git-send-email-chi-hsien.lin@cypress.com> In-Reply-To: <1542786800-146083-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: BYAPR03CA0024.namprd03.prod.outlook.com (2603:10b6:a02:a8::37) To BY1PR0601MB1436.namprd06.prod.outlook.com (2a01:111:e400:522c::23) x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BY1PR0601MB1174;6:VrRrH1aQWP9qcJsWTVzZ+sjJis7hETYDO6DZQMnlvv58hFNjRoAlkNaRMHj/eH/mwXcXd9+HxIocRpCxu4ZmEmVLtYHUzYzuyZbxFujwmj7I0/x9UYTgA0pc65DC6WGm9/iqAxusFqtosQN+Dk5Mtuj4yUKtMVzq5Sh9eztXMJez3PdVzhC4OjSikmmVKygSnGJT763oykbTS8pUn4eQPM99zfOXmOr1aAAlvbZs/B7io1rbscA1R/reS7SrvM3EYixiF31Jecab/Z3VdkWbfFPuFAMQLAAEAnU8km7QEEnFpgiHri0UqiX0MhjCXlHnH7S846qLZKfk3CfY7+2aiaMZngZZ+tvjYqDYiPydWw7NF8TyoP0BRTO3JetJHT9koaR4vX2HvwijvVvf8syoq04z6UKWJudkBFtCqnxF9Ovb4+m+09fz9s+zKVZiuu6x7Juxea0X7QziLGTjJ5utrA==;5:jRMvnFk49nO1jw7RQve9dOKeiecnBBw3AvDo/NukNB9f/0mXsCi6CSd0n1rGYjB48cRcuF3/y8KGnBnqMI43AoMMB2Z6mLyfzld9FpBvwJcB4tvtSKHwyOLidIHl7ROD45SFWyYEm4b/N8+0mVgshzsabGW71a0VLFS0kxn59KY=;7:xyoR5l1ucIhF3Ea6QDF9ex2RL5VvNCqewpZKkSYcE6QvRqRU3ABtlNa1SAmD8VcChuCYaHXcY0QUI5bzwv3pBF88MDcSu8MQcol+ttzqLNEEX6S7VQ/9w9CyIfFEbVkF53z7Mz/QAnhaXmfew+jcFA== x-ms-office365-filtering-correlation-id: 01f9c471-2dbb-49d1-4d33-08d64f86798c x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);SRVR:BY1PR0601MB1174; x-ms-traffictypediagnostic: BY1PR0601MB1174: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Chi-Hsien.Lin@cypress.com; x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(3231442)(944501410)(52105112)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123562045)(20161123560045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(201708071742011)(7699051)(76991095);SRVR:BY1PR0601MB1174;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0601MB1174; x-forefront-prvs: 08635C03D4 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39860400002)(136003)(366004)(376002)(396003)(346002)(189003)(199004)(107886003)(478600001)(36756003)(72206003)(97736004)(8676002)(81166006)(81156014)(186003)(68736007)(6916009)(8936002)(71190400001)(54906003)(2906002)(316002)(25786009)(2501003)(71200400001)(6116002)(3846002)(99286004)(6436002)(2351001)(256004)(305945005)(6486002)(76176011)(7736002)(105586002)(6506007)(4326008)(386003)(52116002)(5640700003)(102836004)(66066001)(2616005)(106356001)(476003)(14454004)(486006)(26005)(11346002)(86362001)(53936002)(2900100001)(446003)(6512007)(5660300001)(575784001);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR0601MB1174;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: 9YXYV57soXvdVkQw/ktq/JZYs99aHvKHAbwYk3VP0i7Weny2tvXp7DmOUzgOufLGH3mdmqmFqAE47OBk15edlh1zuLunFU2/hEEJTG5wLoRJ/tYHzlLOcJX3/L+UUtNKw4T1jsxVTW3U7674lzd2hsZGfnSo19SueyWuoj5hK3wtC0pllifPQkZVV0HGbEALPbyZUuHF/Hlbn30CW0oXmdfEPff/jzlwdMLPT28Ep0BNHeUWImo0GMtOe6AXG8mhaW5GH8tapiT+gdGg+QT3XzMF+fSNNBwbI7Xu9ApLLQiLLuraZ9UOwofO+x1ZCSoOrndscYDUvoxaMJu7XAqkA2COqpmBz77gquRwe+qaSHE= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: 01f9c471-2dbb-49d1-4d33-08d64f86798c X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Nov 2018 07:53:50.9360 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 011addfc-2c09-450d-8938-e0bbc2dd2376 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0601MB1174 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 chipcommon sr_control0 register to check 4373 sr support. Reviewed-by: Arend van Spriel Signed-off-by: Chi-Hsien Lin --- .../net/wireless/broadcom/brcm80211/brcmfmac/chip.c | 5 +++++ .../wireless/broadcom/brcm80211/include/chipcommon.h | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c index a8d3b96b727f..22534bf2a90c 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 & CC_SR_CTL0_ENABLE_MASK) != 0; case CY_CC_43012_CHIP_ID: addr = CORE_CC_REG(pmu->base, retention_ctl); reg = chip->ops->read32(chip->ctx, addr); diff --git a/drivers/net/wireless/broadcom/brcm80211/include/chipcommon.h b/drivers/net/wireless/broadcom/brcm80211/include/chipcommon.h index e1fd499930a0..de8225e6248b 100644 --- a/drivers/net/wireless/broadcom/brcm80211/include/chipcommon.h +++ b/drivers/net/wireless/broadcom/brcm80211/include/chipcommon.h @@ -269,6 +269,25 @@ struct chipcregs { /* GSIO (spi/i2c) present, rev >= 37 */ #define CC_CAP2_GSIO 0x00000002 +/* sr_control0, rev >= 48 */ +#define CC_SR_CTL0_ENABLE_MASK BIT(0) +#define CC_SR_CTL0_ENABLE_SHIFT 0 +#define CC_SR_CTL0_EN_SR_ENG_CLK_SHIFT 1 /* sr_clk to sr_memory enable */ +#define CC_SR_CTL0_RSRC_TRIGGER_SHIFT 2 /* Rising edge resource trigger 0 to + * sr_engine + */ +#define CC_SR_CTL0_MIN_DIV_SHIFT 6 /* Min division value for fast clk + * in sr_engine + */ +#define CC_SR_CTL0_EN_SBC_STBY_SHIFT 16 +#define CC_SR_CTL0_EN_SR_ALP_CLK_MASK_SHIFT 18 +#define CC_SR_CTL0_EN_SR_HT_CLK_SHIFT 19 +#define CC_SR_CTL0_ALLOW_PIC_SHIFT 20 /* Allow pic to separate power + * domains + */ +#define CC_SR_CTL0_MAX_SR_LQ_CLK_CNT_SHIFT 25 +#define CC_SR_CTL0_EN_MEM_DISABLE_FOR_SLEEP 30 + /* pmucapabilities */ #define PCAP_REV_MASK 0x000000ff #define PCAP_RC_MASK 0x00001f00 From patchwork Wed Nov 21 07:53:52 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: 10692081 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 0FD7C13AD for ; Wed, 21 Nov 2018 07:54:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0625629467 for ; Wed, 21 Nov 2018 07:54:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EDECE29662; Wed, 21 Nov 2018 07:54:05 +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 8FE57294D0 for ; Wed, 21 Nov 2018 07:54:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728367AbeKUS1a (ORCPT ); Wed, 21 Nov 2018 13:27:30 -0500 Received: from mail-eopbgr750121.outbound.protection.outlook.com ([40.107.75.121]:39472 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728351AbeKUS12 (ORCPT ); Wed, 21 Nov 2018 13:27:28 -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=n4wbt8nBICgbIJl+8dzvXaFtziMJUVtADxNgY2mnx/0=; b=TIDPqmC6ABwZ5YF5N899J+CfugE7dq8Ex3zylRvRU9pS6o3uWVHxf3FSbhJsi05Z72i/+IxIlat8PgL6PUWN9apbDJ04Om4P78qbbhsRP2pW7UtiAjV4SDoxQyMyWtMXI3oXG3jERR00mKLA7Mhb7GhIwkS83dwXyLR2o+IPXS4= Received: from BY1PR0601MB1436.namprd06.prod.outlook.com (10.162.111.23) by BY1PR0601MB1174.namprd06.prod.outlook.com (10.160.195.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1339.23; Wed, 21 Nov 2018 07:53:52 +0000 Received: from BY1PR0601MB1436.namprd06.prod.outlook.com ([fe80::809a:6ca8:db12:f5ae]) by BY1PR0601MB1436.namprd06.prod.outlook.com ([fe80::809a:6ca8:db12:f5ae%4]) with mapi id 15.20.1339.027; Wed, 21 Nov 2018 07:53:52 +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 V4 8/8] brcmfmac: disable command decode in sdio_aos Thread-Topic: [PATCH V4 8/8] brcmfmac: disable command decode in sdio_aos Thread-Index: AQHUgW9Y/TqIgy+nL06omvN1haHkAw== Date: Wed, 21 Nov 2018 07:53:52 +0000 Message-ID: <1542786800-146083-9-git-send-email-chi-hsien.lin@cypress.com> References: <1542786800-146083-1-git-send-email-chi-hsien.lin@cypress.com> In-Reply-To: <1542786800-146083-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: BYAPR03CA0024.namprd03.prod.outlook.com (2603:10b6:a02:a8::37) To BY1PR0601MB1436.namprd06.prod.outlook.com (2a01:111:e400:522c::23) x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BY1PR0601MB1174;6:7NAbfSqj7jl5aSKW00plkubX1mohxKWWJbv4qM/gLnaJwgV4+fe8yoLLG/EFhOHeM4jtZ28Rrthk38M/j9aBwiRGvOUCRTNb8c45DEUupHKdh5grh4NZO7N4zMtJiG3/8pKXK7X/85z4ochJuc/bYckG/uZvGBzRazs6WoDYm9V5a6lf6HrgZJXuPZIQ6wSLYOvg2fMcRkyvRPMbMHaUuB+ErpuWr/vzC9cv2LH3W7MyrWyYbjrCEzjq3uVW0sJAVFXKCsy1YyIDd+KvZLnn19CqCkscA/hc37j89RpwkJU89A1GaGAqj2+0gdjfrynfTBJYCTed8zDY/nV0N3IlyqybfvF53B3aoRZ3agX63MfSevD1gtwz7E65NZhwO8hBFCQl18RwMK1oO/7PxvwgMr679V9ac9Bg8xAk6KMo/ocdoMWA4vJ+FRk5MD05slZCCvVEh3uj3P4TuKJpw5ePCA==;5:HrUunOvDWjhcO3sXi5IuV0/zfcURODdsgYfysZGPJ7pqzpl6SmDSe/B1foF4OKMVYKCeFcNBsuyi+JlwSY+moHtCTzCHvbq4dUnsjr8EUgOp9JJbg/GqHFsbCqMsdtFpxNDiHDcP9WVcz4aoVzj+Rc2VYqEzxlvDL75ZqSgktlw=;7:v0hl7SjLlx4FGEpjB8/84+n8LRdYHA7ugqo4KjgLkzOzVlJ7/oPtnI2pJt9gvtL7mxjVgkMlcLIEc/Sp+gYQvuhW2AI5HPHFd0LdQpmPAMpMbqeRduDLOPkiLX7CQ7m/sIk3qv3sH6Hl23pdarGghw== x-ms-office365-filtering-correlation-id: 2325c541-dd19-4591-4543-08d64f867a65 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);SRVR:BY1PR0601MB1174; x-ms-traffictypediagnostic: BY1PR0601MB1174: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Chi-Hsien.Lin@cypress.com; x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(3231442)(944501410)(52105112)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123562045)(20161123560045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(201708071742011)(7699051)(76991095);SRVR:BY1PR0601MB1174;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0601MB1174; x-forefront-prvs: 08635C03D4 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39860400002)(136003)(366004)(376002)(396003)(346002)(189003)(199004)(107886003)(478600001)(551934003)(36756003)(72206003)(97736004)(8676002)(81166006)(81156014)(186003)(68736007)(6916009)(8936002)(71190400001)(54906003)(2906002)(316002)(25786009)(2501003)(71200400001)(6116002)(3846002)(99286004)(6436002)(2351001)(256004)(305945005)(6486002)(76176011)(7736002)(105586002)(6506007)(4326008)(386003)(52116002)(14444005)(5640700003)(102836004)(66066001)(2616005)(106356001)(476003)(14454004)(486006)(26005)(11346002)(86362001)(53936002)(2900100001)(446003)(6512007)(5660300001)(575784001);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR0601MB1174;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: pQBUnPyA7PZ/xFe3OPLs0/4R3DRdtkeHwOaFrrYbmurH4LqK7d2j1Mb+9QoPeBk+8Kvk6uUDbLZSDe/ry/guvn9eeWv5V/4UdOK/JK1tQg63t4ba9c0YPYvoyo1Md82G0J1M2/cVjA75zTWn1WZwYwlakA2cXg8J5HEyYPSwmHC9vylIDMNzQfJZKxoqdjowuc77gC17F/c+4smLHVoSvsxb+6dI9PMwpT78+AYrkYuCUZAFe4CnsAb85Vjd2JgcMGddC/6K/wHaTai6JHodjSoYjXhcrdm4yPrSVa+NO3QHqzBw+RSdqk2pbY3ReaX0M2qV/F/WvyqsxjkkDA0nIkjioDlg1m64RbIBeDmf9W4= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2325c541-dd19-4591-4543-08d64f867a65 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Nov 2018 07:53:52.3110 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 011addfc-2c09-450d-8938-e0bbc2dd2376 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0601MB1174 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 fe0cb398ab44..0cd5b8d970d7 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;