From patchwork Fri Apr 22 09:03:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrejs Cainikovs X-Patchwork-Id: 12823134 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D4399C433FE for ; Fri, 22 Apr 2022 09:03:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1445836AbiDVJGj (ORCPT ); Fri, 22 Apr 2022 05:06:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1359739AbiDVJGi (ORCPT ); Fri, 22 Apr 2022 05:06:38 -0400 Received: from CHE01-GV0-obe.outbound.protection.outlook.com (mail-gv0che01on2128.outbound.protection.outlook.com [40.107.23.128]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E27D853712; Fri, 22 Apr 2022 02:03:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R7tVaNWmi/LSMDSHYdRr6oQRRJGfaojbWmVUXsHHIPCnojleMsRnU7ZUnkvy1pnmDiwCAirZxj82qL8g7ffw77b6EpjS2nyMxRFn/gOp/BkcRq+xOR9/DA/d1drKgZn8CeXVw37TfaBUYW7AIU5u8nvwuXb8v+xIFL0B7RJlwStcWBFkjFFsczyGDxszHyAagZmqEvNP/6Mo/WG23DU9w3+A6nqceoJIHwfFInlPSd4Ut35G6NGnIfFSd7Nk88Rf0Y+ypbJSruq4wJ/u+CzOGmi83k7XqYOBmc6IokHuNX6YR+4LNdgt+AmFVCXQH79odyUlso65AQu1uiRIfTXixw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=GoZjLK97WI4aQlNkrx10mSm0M1CPn3sGa6ohjZnI1yk=; b=KuiLfrTddDRX15TCcXScsRMv8mwtuJduS5Bnx8cR3e2n0/9Pk3/egXe2h5qZLLH6ZatHJRLWhKfu8ZJ8PVZIEnC7fwzL0Q1aYCKRQPjsJpHIMclGvG2t4k/0gPJJqrw7kzB0v3dAuscgc6bvyUhkGEsstOkNiusFNWIDvh/9ZS0iK42c6hwOuQG+UhKBlfJCWpYVsViCWFlij+AL8vw+zRFm0IbhwMBZyb1ann8mkR/nse4uUColDyxDHj/YwitPnyXN8Ca/JkQRvQ5OmKs3ffm1rK63P8n3ONGlQ84suGozvPBvw3cW9hur//ytx0HrPm/10ZkNYtgXuIXtG3wrNw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=toradex.com; dmarc=pass action=none header.from=toradex.com; dkim=pass header.d=toradex.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toradex.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GoZjLK97WI4aQlNkrx10mSm0M1CPn3sGa6ohjZnI1yk=; b=TfE2ZgRYqeAFihQbUbs8/efB7mjgXITxz9Ugr33yenez4vKPVXRXYJk2Dr5yncdom2AfCknOn6MhURK5FKcwOxjihIImMI6/zmuk/NobA+XZyEkoncBRfFcyZI6Kws+1tchd4mcmOgpeORXsAXhRuLHfVCSOq39b/9IzxhvVI2A= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=toradex.com; Received: from GVAP278MB0929.CHEP278.PROD.OUTLOOK.COM (2603:10a6:710:57::6) by ZR0P278MB0393.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:34::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.14; Fri, 22 Apr 2022 09:03:41 +0000 Received: from GVAP278MB0929.CHEP278.PROD.OUTLOOK.COM ([fe80::d03a:14ba:bd9a:e165]) by GVAP278MB0929.CHEP278.PROD.OUTLOOK.COM ([fe80::d03a:14ba:bd9a:e165%7]) with mapi id 15.20.5186.015; Fri, 22 Apr 2022 09:03:41 +0000 From: Andrejs Cainikovs To: linux-wireless@vger.kernel.org, Amitkumar Karwar , Ganapathi Bhat , Sharvari Harisangam , Xinming Hu Cc: Andrejs Cainikovs , Kalle Valo , "David S . Miller" , Jakub Kicinski , Brian Norris , =?utf-8?q?Jonas_Dre=C3=9Fler?= , =?utf-8?q?Alvin_=C5=A0ipra?= =?utf-8?q?ga?= , Francesco Dolcini , netdev@vger.kernel.org Subject: [PATCH v2 1/2] mwifiex: Select firmware based on strapping Date: Fri, 22 Apr 2022 11:03:12 +0200 Message-Id: <20220422090313.125857-2-andrejs.cainikovs@toradex.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220422090313.125857-1-andrejs.cainikovs@toradex.com> References: <20220422090313.125857-1-andrejs.cainikovs@toradex.com> X-ClientProxiedBy: ZR0P278CA0151.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:41::12) To GVAP278MB0929.CHEP278.PROD.OUTLOOK.COM (2603:10a6:710:57::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cd730d8f-22cd-46ad-6b47-08da243eff3c X-MS-TrafficTypeDiagnostic: ZR0P278MB0393:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: giSG7MwrSEDJJKI9w5gd7x0LHXmJx3Ir3+xW8m2IoBR1S0wyO16x+SEuiW0SRfTOWrvDFz9KL+Gv8YAKOtH4DW37p/ZQQKUdYgvXk40sNemW/GlfAX1AixH5nGO2latG3+Mz7To8xNuHLPSY1FiTx7yqYowIsa6zr9RvT1eYJQZWlW3iIftsORBCKEnzoAYLJn+eWK+OpHYkQsEHmLn6dCobZGoEnIIyQqEhPUg4SVyXIM6BweZsTmkC0oAMBu1WaAmzNUVVtJrzFWUdEQayB7cH2E+FE71UlqUjhYDU6ZnZW0fSjM8zTBvlPo716bQYXPTWep8vlxjzDedGhdpuw3V01scY/RefaRhdZ28oc0L4ncIYkEN7j6aV+5EgUU2VgVKc+dFjlu9ZO/vW/KRrWMkEU31toojcfcCpQX83AaDrPShgRfYWGiar1mzQLu5D4u85P5fmfz9Pc/YRCCU+W2OwBHFP/MnfJ8dzY/MgQ3V5vpEikf9PNJzFl4pl8qKpz4Ifj3ha0VOepjp6qLNMtgsBLw5scWo7TDwKeMLFDC911SEeoEiASldfeh8wUdkBn1G4i8to8RwoLGzlmdLU25Av0qmFZ4E9z0RquVBlliHh1W200coS4/2HoL6ScrNiZmIpJPCHwVSUa+8tcB7KU5a23RsHLBV1DWCJitsZffP3jl8RIhvpl+xZ9+D28apF/Y3aMnGXeftMCVq66RH5OmNSRnclLbtajlEfzMh1uwtl5adBCeJ5reUZigp2yp7mPuoX9iLC7a/la4jI2OsmCp65lT1sO7NautWUH9Db28Q= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:GVAP278MB0929.CHEP278.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(396003)(39850400004)(136003)(346002)(376002)(6506007)(2616005)(6512007)(86362001)(316002)(6666004)(44832011)(2906002)(5660300002)(7416002)(54906003)(26005)(1076003)(8936002)(110136005)(38100700002)(186003)(52116002)(508600001)(38350700002)(966005)(6486002)(36756003)(8676002)(4326008)(66574015)(66476007)(66556008)(66946007)(83380400001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?r0yFhhGRElm2j6Z7obwgyF7D/0ZW?= =?utf-8?q?fNsD8dxf4aVhUIaVfR5qDkwOLsu/g20pLi/+SjDe98s3pfVLQjwxldTjG4JS+6g7K?= =?utf-8?q?o+Rw4/CL5L/Yax2uLLl0QAC44rH8PktyreeuAcUtrL37Tf5L7UBRO/k2Il6IzZJu+?= =?utf-8?q?RSCcwCHhDqJY2MbQYMPEWVHNbzU7riP61mKWRIzgt6d84A8hwYiwy0JNzC6yxyMt0?= =?utf-8?q?YvDKXdirDA/t5VXUU/3/6tBq2Zgv77mqW6YFMwkVFjAbdLblSy1hVuflEp8R9bpdH?= =?utf-8?q?p/0j5hrfNQtCNSfy2/neZew8t+uypJ6CztK1hLjSC71o4ogWq/Ai43U3SCVW5KoHH?= =?utf-8?q?iORQIObB17V7HXu/0lvCFUczy1jzFDksOoRT52xS0G1Y27XYoToHngREaaI6HS+Ls?= =?utf-8?q?QW3mbZPyH0vsDZQRnkLLNbI4znIkuOcrZftRrHa9TnPNq//M6F2wF3FVjJE/GRaFL?= =?utf-8?q?nl+nApwdA+cnSfVG82GbB1xbD9Q7s6DEoqdN5vsTrBvEXNeHp4LUGA2ape8UCEJtb?= =?utf-8?q?7Rv96i5xA/l6SHD/ox5KhqELDjDto6p/qYRCvSunla4bQdmcWEJsUsee9DCt+HohP?= =?utf-8?q?DFpJdtEkCSpMZ984q7uA8ct/K0Q62f6Lh5fpN62UuNIUAFQ7ngrEelVmo21qdKmJ+?= =?utf-8?q?L9pLHYZL57MhMbtcKDrs25bqesspepDIW9vzI+sJJUHYotc4OH2SPS+aldkR3/F/w?= =?utf-8?q?SGYUxviEpz94LeTqHPwM7H4c1vp2jOj+QKonMycIoUqZQU1BrKPFGXl16nO2zJnFh?= =?utf-8?q?mWNSj/0tI7fAIl6RTTHWnMkv7/CBeEFKdFYscCrjAa1p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JRsrn+U9fZEcg0=3D?= X-OriginatorOrg: toradex.com X-MS-Exchange-CrossTenant-Network-Message-Id: cd730d8f-22cd-46ad-6b47-08da243eff3c X-MS-Exchange-CrossTenant-AuthSource: GVAP278MB0929.CHEP278.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2022 09:03:41.5849 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d9995866-0d9b-4251-8315-093f062abab4 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: vBhLL0MvdRlR03H8CtFFQJP3burn+xRsI6x2T1ckNyt9r9k5eJnVMD79PNBx0qoXiPZcO9pbwtxAAY8J19LknSxkXLWlS/CWnd77S0u6O6s= X-MS-Exchange-Transport-CrossTenantHeadersStamped: ZR0P278MB0393 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Some WiFi/Bluetooth modules might have different host connection options, allowing to either use SDIO for both WiFi and Bluetooth, or SDIO for WiFi and UART for Bluetooth. It is possible to detect whether a module has SDIO-SDIO or SDIO-UART connection by reading its host strap register. This change introduces a way to automatically select appropriate firmware depending of the connection method, and removes a need of symlinking or overwriting the original firmware file with a required one. Host strap register used in this commit comes from the NXP driver [1] hosted at Code Aurora. [1] https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_sdio_mmc.c?h=rel_imx_5.4.70_2.3.2&id=688b67b2c7220b01521ffe560da7eee33042c7bd#n1274 Signed-off-by: Andrejs Cainikovs Reviewed-by: Alvin Šipraga --- drivers/net/wireless/marvell/mwifiex/sdio.c | 21 ++++++++++++++++++++- drivers/net/wireless/marvell/mwifiex/sdio.h | 5 +++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.c b/drivers/net/wireless/marvell/mwifiex/sdio.c index 4f3238d2a171..d26efd56be08 100644 --- a/drivers/net/wireless/marvell/mwifiex/sdio.c +++ b/drivers/net/wireless/marvell/mwifiex/sdio.c @@ -182,6 +182,9 @@ static const struct mwifiex_sdio_card_reg mwifiex_reg_sd8997 = { .host_int_rsr_reg = 0x4, .host_int_status_reg = 0x0C, .host_int_mask_reg = 0x08, + .host_strap_reg = 0xF4, + .host_strap_mask = 0x01, + .host_strap_value = 0x00, .status_reg_0 = 0xE8, .status_reg_1 = 0xE9, .sdio_int_mask = 0xff, @@ -283,6 +286,9 @@ static const struct mwifiex_sdio_card_reg mwifiex_reg_sd8987 = { .host_int_rsr_reg = 0x4, .host_int_status_reg = 0x0C, .host_int_mask_reg = 0x08, + .host_strap_reg = 0xF4, + .host_strap_mask = 0x01, + .host_strap_value = 0x00, .status_reg_0 = 0xE8, .status_reg_1 = 0xE9, .sdio_int_mask = 0xff, @@ -536,6 +542,7 @@ mwifiex_sdio_probe(struct sdio_func *func, const struct sdio_device_id *id) struct mwifiex_sdio_device *data = (void *)id->driver_data; card->firmware = data->firmware; + card->firmware_sdiouart = data->firmware_sdiouart; card->reg = data->reg; card->max_ports = data->max_ports; card->mp_agg_pkt_limit = data->mp_agg_pkt_limit; @@ -2439,6 +2446,7 @@ static int mwifiex_register_dev(struct mwifiex_adapter *adapter) int ret; struct sdio_mmc_card *card = adapter->card; struct sdio_func *func = card->func; + const char *firmware = card->firmware; /* save adapter pointer in card */ card->adapter = adapter; @@ -2455,7 +2463,18 @@ static int mwifiex_register_dev(struct mwifiex_adapter *adapter) return ret; } - strcpy(adapter->fw_name, card->firmware); + /* Select correct firmware (sdsd or sdiouart) firmware based on the strapping + * option + */ + if (card->firmware_sdiouart) { + u8 val; + + mwifiex_read_reg(adapter, card->reg->host_strap_reg, &val); + if ((val & card->reg->host_strap_mask) == card->reg->host_strap_value) + firmware = card->firmware_sdiouart; + } + strcpy(adapter->fw_name, firmware); + if (card->fw_dump_enh) { adapter->mem_type_mapping_tbl = generic_mem_type_map; adapter->num_mem_types = 1; diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.h b/drivers/net/wireless/marvell/mwifiex/sdio.h index 5648512c9300..ad2c28cbb630 100644 --- a/drivers/net/wireless/marvell/mwifiex/sdio.h +++ b/drivers/net/wireless/marvell/mwifiex/sdio.h @@ -196,6 +196,9 @@ struct mwifiex_sdio_card_reg { u8 host_int_rsr_reg; u8 host_int_status_reg; u8 host_int_mask_reg; + u8 host_strap_reg; + u8 host_strap_mask; + u8 host_strap_value; u8 status_reg_0; u8 status_reg_1; u8 sdio_int_mask; @@ -241,6 +244,7 @@ struct sdio_mmc_card { struct completion fw_done; const char *firmware; + const char *firmware_sdiouart; const struct mwifiex_sdio_card_reg *reg; u8 max_ports; u8 mp_agg_pkt_limit; @@ -274,6 +278,7 @@ struct sdio_mmc_card { struct mwifiex_sdio_device { const char *firmware; + const char *firmware_sdiouart; const struct mwifiex_sdio_card_reg *reg; u8 max_ports; u8 mp_agg_pkt_limit; From patchwork Fri Apr 22 09:03:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrejs Cainikovs X-Patchwork-Id: 12823135 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D8DDC433F5 for ; Fri, 22 Apr 2022 09:03:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1445847AbiDVJGm (ORCPT ); Fri, 22 Apr 2022 05:06:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1445817AbiDVJGj (ORCPT ); Fri, 22 Apr 2022 05:06:39 -0400 Received: from CHE01-GV0-obe.outbound.protection.outlook.com (mail-gv0che01on2128.outbound.protection.outlook.com [40.107.23.128]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11B3C53721; Fri, 22 Apr 2022 02:03:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mO+50MTHbmuJgBuD3BZ0436VeQULUoc3Fy1LTChHFex0ryqPHVbHgPTKHHqyLrlbyGgE77mH7hOD1J3xmBBVFLtyRN5dKarFeIvLxUGnexN++z5r4h/oozINIAoffpJ5XWJytaEl51fRcvnCg0PksvJljbtgsgbEPPhyLWZmPAbix2/3wkjl8j/MpI+AJXraZaIkkDKGoP9/oMes4aUEDOSb0cn6Hs8G8vEuYRdZQT0wswSqLgqRrFUSCanspdX7U121Ko94oG81WOZzcaJGjQ96Ml1hbEttqPdZCHY2bLwNJ4jXZ1et4jnZHp0dHuCJpoNeQhn5Xpi/FIgJucIy2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ZYiG24tOGlyADGlOXcOCJ5qL5JoqvEtCZ3Ax1uT9nhY=; b=JhTHt+hA3MCxaa9PzyZ8AasaufxpNz5HfGYhCMPY4g6v7sG7jaGaFW8w/jdI3+9qDmiukzGEbBx6K70fIFgyDW3Qr0g3/FpURxizfo6sKBI8Y1T9eYMLpGR3Xewt0RnPs3MkFB7fdLXHgpu7Nk9AMRFLEWx2N2x4gCmYymTbrOC2YokdJ6UbX/4JbgO4fRGG5XoKIJGt3NOYvXQGWJGTvLOb83S9CHuR5KTYlqqLxQF7y1SFKb7dcwLov9v3qqfGlOkpl9M9zkfE8sdQdFUmHr41efghVt8j7TCS/PhchFFw0UWq39T/A7ewLPBHza3x6LX/6dbBgANMgkAbJc3pSw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=toradex.com; dmarc=pass action=none header.from=toradex.com; dkim=pass header.d=toradex.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toradex.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZYiG24tOGlyADGlOXcOCJ5qL5JoqvEtCZ3Ax1uT9nhY=; b=k+vhRmwCQfm77hL75UupkUXez9Vr2unlL+ajnDG4vfVOG3y/oE7OG0HZ38TJFNRqoGDcbPOb1TXeMhT8kHYGX7aIM9darQdcP4Uy8lRmI1rnDrYQ8eOD06+U5KR4YbmHoFEkQKfq4znES91Iwp6iNnl2/U900vDnNElSnWI7T6Q= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=toradex.com; Received: from GVAP278MB0929.CHEP278.PROD.OUTLOOK.COM (2603:10a6:710:57::6) by ZR0P278MB0393.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:34::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.14; Fri, 22 Apr 2022 09:03:42 +0000 Received: from GVAP278MB0929.CHEP278.PROD.OUTLOOK.COM ([fe80::d03a:14ba:bd9a:e165]) by GVAP278MB0929.CHEP278.PROD.OUTLOOK.COM ([fe80::d03a:14ba:bd9a:e165%7]) with mapi id 15.20.5186.015; Fri, 22 Apr 2022 09:03:42 +0000 From: Andrejs Cainikovs To: linux-wireless@vger.kernel.org, Amitkumar Karwar , Ganapathi Bhat , Sharvari Harisangam , Xinming Hu Cc: Andrejs Cainikovs , Kalle Valo , "David S . Miller" , Jakub Kicinski , Brian Norris , =?utf-8?q?Jonas_Dre=C3=9Fler?= , =?utf-8?q?Alvin_=C5=A0ipra?= =?utf-8?q?ga?= , Francesco Dolcini , netdev@vger.kernel.org Subject: [PATCH v2 2/2] mwifiex: Add SD8997 SDIO-UART firmware Date: Fri, 22 Apr 2022 11:03:13 +0200 Message-Id: <20220422090313.125857-3-andrejs.cainikovs@toradex.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220422090313.125857-1-andrejs.cainikovs@toradex.com> References: <20220422090313.125857-1-andrejs.cainikovs@toradex.com> X-ClientProxiedBy: ZR0P278CA0151.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:41::12) To GVAP278MB0929.CHEP278.PROD.OUTLOOK.COM (2603:10a6:710:57::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 82bc273e-0f4d-4692-f99a-08da243eff7c X-MS-TrafficTypeDiagnostic: ZR0P278MB0393:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aggiw/yNJU1pwcyeDxhA9Sd0KbmuGxyMkJ8Oh2BO0+fMlSQRCpLkRuM6gw+EiBP+nbfcMJNRjX8mDZBRx9MK4t7bz608to44OKmbVkTrpJVHFnUF6ZLwgUaRwVMFVHBNUPGGnZh4cfx1MaazLz8SkUyrqT9pdPgg6EvyoigqKToJ4OsCUdZIFZADiwe2IHoJcAha+MSHxPDZ3BcWMdFmTeXJgU8Qm0//nCCf2Fgld0CbXE6wuivajC4brN99c4w1qd2gbIrOjcXiuHyLy0Au0Wrv05ztOoM8Jyxu+ledd+f1GHNAWgY3T3jmKD53QxDkDM0SmPXosBLyl3+J0rou8mIz506eE4hjK4Ta0+Qin1tnimO4vg+c57wcRwOa658EjReZ9n/92RycoiC3hTbdudpwY3nVIEVbVY4JUmArZSSlS29ZugoK1tiBY51O4/T3nI/EZMApCu5GVToGgZsxKjt7bbeKgNADIoCTGCGz1LaIIB+dCTasdwnaFdoyzYKDJAwmRzfh8tnNooXWdfK526mY382TR2R5ypVi2y851ps9g+g8tM2MkxikpRzZJWn/s8h1IOxpCdaUrCoGTNV6kU6O3tD3VIZK7xPh6vL0ABtSXxyGDaojrcx0K8XtNdVeajdxdq9AWt29NUKxY+NW3H7RVcTudSJDlO5SBb9izCyOELd9DnwE4Irizo/AxFKiU9T5aTjcjhh/BegK8lq+Hg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:GVAP278MB0929.CHEP278.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(396003)(39850400004)(136003)(346002)(376002)(6506007)(2616005)(6512007)(86362001)(316002)(6666004)(44832011)(2906002)(5660300002)(7416002)(54906003)(26005)(1076003)(8936002)(110136005)(38100700002)(186003)(52116002)(508600001)(38350700002)(6486002)(36756003)(8676002)(4326008)(66476007)(66556008)(66946007)(83380400001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: SnMIsQcNd0CrpkoMJ8aySGQfmRXA2gv89s9VL5KWinMx9dbC2Ol6X4tlNb5qC0OSAitQdPV7IJWWTuavZo812kHqo3aYQ6pF6A4zWoqUP9syf+FffHX3eqoy9fMamgXkosWfin3jDZJXwK3AMnXsulBDl7gmL1yXu/gwWldwHAVg8h5Ddd19vUDzaDJ7Gq4jgWiAcfqWS63AvNgBb1quAi2KhTXAinUSpaih6WJIQxE5wkIM16iMwlDJnwwI46GY9k6YEIbeUuehti4y/BU9UW1UPgumIBMxtroo1eaYwyQPggsR+7MG60utjEY5I5ja5IynZAwdcc7qdu9ziUjB3GXEMuBLhuvMNI9akdYOMnLru5fPAnNJL6yE7TKEb3/smTcQS5ULIv9eH+R3hEagJi2XZcp5b3fSo2dWeyFgqBE/roOljDCSn7j+q+1Itz1x1z02K0gXNdnWmmi0G7Ulcg2d5vBmRRFvcePdDgACjuo1pGEapJvF9kfSqgQ4ev8GJdyNZlL7tOCEtLOYx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8bsUNEaRLgkk0xG+CzFfi+A73Tc8U2f+KJm4s5tkM6uNnjeXXS1WbrfYlVyYVPIE5RgriJVAMZ0zdtsCO8HqTrORJxESD8Zjka4T5YKxyW+9eNcIxKyBHTR85R1aYiLCRYy0XMBv3FJ16h4ESzDP4apveMHc2fLvJpnlc= X-OriginatorOrg: toradex.com X-MS-Exchange-CrossTenant-Network-Message-Id: 82bc273e-0f4d-4692-f99a-08da243eff7c X-MS-Exchange-CrossTenant-AuthSource: GVAP278MB0929.CHEP278.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2022 09:03:42.0080 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d9995866-0d9b-4251-8315-093f062abab4 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: CrHs5R0QV+RwyyTbQHnZ9gXQf0qXJ6Giqg6OXsLWfeR0bi5flUd9/1I0SH8PuXZoVdZhL9Zv6nYXwEaB+AoX5N7WYYzwfLv17c/g3PWMnmY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: ZR0P278MB0393 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org With a recent change now it is possible to detect the strapping option on SD8997, which allows to pick up a correct firmware for either SDIO-SDIO or SDIO-UART. This commit enables SDIO-UART firmware on SD8997. Signed-off-by: Andrejs Cainikovs --- drivers/net/wireless/marvell/mwifiex/sdio.c | 2 ++ drivers/net/wireless/marvell/mwifiex/sdio.h | 1 + 2 files changed, 3 insertions(+) diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.c b/drivers/net/wireless/marvell/mwifiex/sdio.c index d26efd56be08..76004bda0c02 100644 --- a/drivers/net/wireless/marvell/mwifiex/sdio.c +++ b/drivers/net/wireless/marvell/mwifiex/sdio.c @@ -408,6 +408,7 @@ static const struct mwifiex_sdio_device mwifiex_sdio_sd8977 = { static const struct mwifiex_sdio_device mwifiex_sdio_sd8997 = { .firmware = SD8997_DEFAULT_FW_NAME, + .firmware_sdiouart = SD8997_SDIOUART_FW_NAME, .reg = &mwifiex_reg_sd8997, .max_ports = 32, .mp_agg_pkt_limit = 16, @@ -3176,3 +3177,4 @@ MODULE_FIRMWARE(SD8887_DEFAULT_FW_NAME); MODULE_FIRMWARE(SD8977_DEFAULT_FW_NAME); MODULE_FIRMWARE(SD8987_DEFAULT_FW_NAME); MODULE_FIRMWARE(SD8997_DEFAULT_FW_NAME); +MODULE_FIRMWARE(SD8997_SDIOUART_FW_NAME); diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.h b/drivers/net/wireless/marvell/mwifiex/sdio.h index ad2c28cbb630..28e8f76bdd58 100644 --- a/drivers/net/wireless/marvell/mwifiex/sdio.h +++ b/drivers/net/wireless/marvell/mwifiex/sdio.h @@ -39,6 +39,7 @@ #define SD8977_DEFAULT_FW_NAME "mrvl/sdsd8977_combo_v2.bin" #define SD8987_DEFAULT_FW_NAME "mrvl/sd8987_uapsta.bin" #define SD8997_DEFAULT_FW_NAME "mrvl/sdsd8997_combo_v4.bin" +#define SD8997_SDIOUART_FW_NAME "mrvl/sdiouart8997_combo_v4.bin" #define BLOCK_MODE 1 #define BYTE_MODE 0