From patchwork Fri Aug 23 12:42:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: POPESCU Catalin X-Patchwork-Id: 13775078 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2074.outbound.protection.outlook.com [40.107.21.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CF4EC566A; Fri, 23 Aug 2024 12:42:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.74 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724416978; cv=fail; b=d3bS818xvIuNLUp4Tzc//f2ZXpabkr0PDojSFRoEbx02OcIVe2XwZK+XfCuLkuIANIb0Omht6rpZplA5eH+nD47u+KC228hXzXfbbhcbepUEXe6Xk3lvy5NmGl6Kk41etO7SbcoI4x4EGt7hJ78czKRA0fBTMPS4Omx4xUJAsVs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724416978; c=relaxed/simple; bh=qFeohQtiqgPnJ8WFgHXVTSiwokkFSUPxUwQX2Pm2Yvg=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type; b=NUL+Gb9pSnm2T72bn8ypqDjtIJJUxPdh1ZFfdMaonBl4g3BYCwBPxOM8IcuKpa49eWgBpL+qzy2GXyCU3Qn3CqSS4sXB8JiEkxIJr0Eb53r/S1LZlMKLSgD1W8n7uMNLPDmBxIfxJQIbVpqqe2ejiKSvJPLto/7ArezM1Tx4n5U= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=leica-geosystems.com; spf=fail smtp.mailfrom=leica-geosystems.com; dkim=pass (1024-bit key) header.d=leica-geosystems.com header.i=@leica-geosystems.com header.b=u5r4ew5e; arc=fail smtp.client-ip=40.107.21.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=leica-geosystems.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=leica-geosystems.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=leica-geosystems.com header.i=@leica-geosystems.com header.b="u5r4ew5e" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=RY5vMQge9Y2L9EeUoOgvqGqlknkBO5/zt3PUFtvkOur0fPRBne8t50kmQq0tBOtxlidIkvNXabmwx4hoUROOKMha0nycvS4/lo5kw+Ove201yvPZrVLR56nvPK9Z65jfMI/F450LSEaDZK2ea24A/3pGUJOBjFcRooFUUq0NN2SMsOJeB7YKnsbIKdiVI0pZm//Fzecvwg1Z7v0ilDQHrG/EdpbzY9Z13xuumgvenSUU5oVFgIRl/crnkFNBtOiWet8lSTS+kVxEpi0ItCX2bYPJhlJxp3KFDrA2UjkBA9jQXGCihlU75zaxz/FdeY+uguD9By0WSTNdPPt0XZ6FwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=jOuedaJwgTweDSr6meloy9y/hSWTHmo139oBre89Rxk=; b=QPIgza/LRhSM+v/mH3y8N4VCVLrIAe0v6emEhU7g/1fE72pxTqOlivyeBaXOEHBGFys4WzFWwvQsy9K+kqtmO+uJ/l8EgC2j7qYu6MSxoYoL60Cmb0AXi1n42pF3iMJh2872u1zMZlcYnj+DVdOUyJFHEkwiWhEGzvHy4OokdNpV0Dw8ohavvFIUdhXWerFqpt8TopRmgAPFToY+yNd/fBjnPoNDibDPLrzVIwTOsshSEayGIET5F7WZ2si3Mauc+tFqjEkQ8QQESmEwSguZKd4OOMuud5pegKuyMHLfxp9YpEFteurBME6kL+65fHuSddlBggl6m9Uh8rtCXhfgkw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 193.8.40.94) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=leica-geosystems.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=leica-geosystems.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leica-geosystems.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jOuedaJwgTweDSr6meloy9y/hSWTHmo139oBre89Rxk=; b=u5r4ew5e2QtIO7ynoCysdRr7ZnrWUo483qfPkc3C107VKhPiuMIJpmWu0v+YMOyQGyjaG6yEj1Fs0zd3ail8Drq+z+zaVDUReWPLpY7J/97BlWTPDXja6/I5dgM9wis/lH1hTLvGFNMv1eMHHcp+YMXkd4DGlMpdBQzqOsfIZG4= Received: from AM0PR02CA0118.eurprd02.prod.outlook.com (2603:10a6:20b:28c::15) by PA4PR06MB7328.eurprd06.prod.outlook.com (2603:10a6:102:d7::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.20; Fri, 23 Aug 2024 12:42:52 +0000 Received: from AM4PEPF00027A60.eurprd04.prod.outlook.com (2603:10a6:20b:28c:cafe::bc) by AM0PR02CA0118.outlook.office365.com (2603:10a6:20b:28c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.18 via Frontend Transport; Fri, 23 Aug 2024 12:42:52 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 193.8.40.94) smtp.mailfrom=leica-geosystems.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=leica-geosystems.com; Received-SPF: Pass (protection.outlook.com: domain of leica-geosystems.com designates 193.8.40.94 as permitted sender) receiver=protection.outlook.com; client-ip=193.8.40.94; helo=hexagon.com; pr=C Received: from hexagon.com (193.8.40.94) by AM4PEPF00027A60.mail.protection.outlook.com (10.167.16.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.11 via Frontend Transport; Fri, 23 Aug 2024 12:42:51 +0000 Received: from aherlnxbspsrv01.lgs-net.com ([10.60.34.116]) by hexagon.com with Microsoft SMTPSVC(10.0.17763.1697); Fri, 23 Aug 2024 14:42:51 +0200 From: Catalin Popescu To: amitkumar.karwar@nxp.com, neeraj.sanjaykale@nxp.com, marcel@holtmann.org, luiz.dentz@gmail.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org Cc: linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, bsp-development.geo@leica-geosystems.com, customers.leicageo@pengutronix.de, Catalin Popescu Subject: [PATCH next 1/2] dt-bindings: net: bluetooth: nxp: support multiple init baudrates Date: Fri, 23 Aug 2024 14:42:38 +0200 Message-Id: <20240823124239.2263107-1-catalin.popescu@leica-geosystems.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-OriginalArrivalTime: 23 Aug 2024 12:42:51.0601 (UTC) FILETIME=[F79D0C10:01DAF559] X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM4PEPF00027A60:EE_|PA4PR06MB7328:EE_ X-MS-Office365-Filtering-Correlation-Id: 9204f9da-dfb1-4c4d-9dc0-08dcc3711a38 X-SET-LOWER-SCL-SCANNER: YES X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376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2tiD7mgqZ1I1WNOrq7kq5NVzST3J5DEVDSD4p2fUclyQQ3pc7Dc7xxynbx1+XieO1qa8nTb8+rO7E7tuVzk/x9X9+sgz9we0oxoV0/PXGZ9o5YcfoZ4UGm/Cq3S3VRX/zX/2Iv9XEQ8zmP7SdVmCENrNhPleSp7rp2Ly0lx19TGycKrmm1oeAS6CxfV4pp08maZ+h9KAW4j3+YeUQlu+FX1OK0GWLDl+aW9y8CWUc53Q997hcvkYWJPy5xuo2Rmui25sW13vAS640FSUdC2Qkan9YLOzZ1Qnm07azNHhBhnTSNBjqt7tvyq615WbqpAKMQxC0aY8Of6CDlwLuSnv6oW1KD4YgQ0ghX0zvHtAn3ydTQ9IAHxXIuSjPwRTITEe5unzmZ0sew7ltWeveZxAZvhPiXnIj/bYjqoM3eBMQAAnPn4gt47vFMljg== X-Forefront-Antispam-Report: CIP:193.8.40.94;CTRY:CH;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:hexagon.com;PTR:ahersrvdom50.leica-geosystems.com;CAT:NONE;SFS:(13230040)(1800799024)(376014)(82310400026)(36860700013)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: leica-geosystems.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2024 12:42:51.7469 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9204f9da-dfb1-4c4d-9dc0-08dcc3711a38 X-MS-Exchange-CrossTenant-Id: 1b16ab3e-b8f6-4fe3-9f3e-2db7fe549f6a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=1b16ab3e-b8f6-4fe3-9f3e-2db7fe549f6a;Ip=[193.8.40.94];Helo=[hexagon.com] X-MS-Exchange-CrossTenant-AuthSource: AM4PEPF00027A60.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR06MB7328 Make "fw-init-baudrate" a list of baudrates in order to support chips using different baudrates assuming that we could not detect the supported baudrate otherwise. Signed-off-by: Catalin Popescu --- .../devicetree/bindings/net/bluetooth/nxp,88w8987-bt.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) base-commit: c79c85875f1af04040fe4492ed94ce37ad729c4d prerequisite-patch-id: 0000000000000000000000000000000000000000 diff --git a/Documentation/devicetree/bindings/net/bluetooth/nxp,88w8987-bt.yaml b/Documentation/devicetree/bindings/net/bluetooth/nxp,88w8987-bt.yaml index 37a65badb448..42e3713927de 100644 --- a/Documentation/devicetree/bindings/net/bluetooth/nxp,88w8987-bt.yaml +++ b/Documentation/devicetree/bindings/net/bluetooth/nxp,88w8987-bt.yaml @@ -25,11 +25,12 @@ properties: fw-init-baudrate: $ref: /schemas/types.yaml#/definitions/uint32 + maxItems: 8 default: 115200 description: - Chip baudrate after FW is downloaded and initialized. - This property depends on the module vendor's - configuration. + List of chip baudrates after FW is downloaded and initialized. + The driver goes through the list until it founds a working baudrate. + This property depends on the module vendor's configuration. firmware-name: maxItems: 1 From patchwork Fri Aug 23 12:42:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: POPESCU Catalin X-Patchwork-Id: 13775077 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2069.outbound.protection.outlook.com [40.107.20.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1D86E185B6B; Fri, 23 Aug 2024 12:42:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.69 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724416978; cv=fail; b=GM+PLp0icjeElQSNUyjl25YO467JCnHpcF7iJ2UENSZQbksAD0GGXpEMKOtlAM9Z3M4m5+0ThHvMUVPerT31Ur8IqWVgd6MoSG5HxoBwndFyJpAGf7iDqYsTddCzGOphV3qN5PQ09SFSVXY7qJR8bItZD23jc/o1QPKnAiv8im4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724416978; c=relaxed/simple; bh=Ot3kI2dUnQrpGtbw1siGoDr2XWEEhsyh9/hpujxM+J4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=gYmHo+NzJtU0w6qFUY4yoWs78xCQGLZ8HACggmbWPZ5dYyQyExCW0NvBXovZBpRgI0WTVIV/ziAB6XPL1HUkUqqaFWi1695SALXSDB5qGiGOEbWf/uZc4gWjpM+DoMvRXK/GulZAgedZ7VmQJu6ChQqgxBnUXQ+KaNm/r0xzFjE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=leica-geosystems.com; spf=fail smtp.mailfrom=leica-geosystems.com; dkim=pass (1024-bit key) header.d=leica-geosystems.com header.i=@leica-geosystems.com header.b=T5W2lB/V; arc=fail smtp.client-ip=40.107.20.69 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=leica-geosystems.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=leica-geosystems.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=leica-geosystems.com header.i=@leica-geosystems.com header.b="T5W2lB/V" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xPBhzKjOT6AHaBF4g1M6VuVLzv+ImXE2bNGRo6vCPbAst5073rqyAPeJjblZi5NrXrv6kh0fklgfQDRtKerRZHW1xWe/2ydOYqUDvcB2i3+/cQ9JprTspxEIh8Q2XJBzkxkKRXDGOUH5FZJB+6dP3TkZtW6cc8rxXudxG+ziEJNXv20obOVdAtAdUaCCdzusxHLC59MC0X6Uo0el2FJTEe0XIAbcg8EbgCWZGUHoJsWcxUPZG8siJkmDpAccBNuCOUSDlZilZTbS6cy8yReHjSiypIt/tHEjainodzhAt+PKbztIGRvZaBbsRRatcVMxUfFBcoXsC8j1x94msagaiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=14/BF0fuOAMrL0uGmRceyzw1mBluSYeMnwnwEfwpaDA=; b=Hn7fbN1FlMz6eIIIA8ODS9//tXQkQGaQQa9JqWhpWMrRwrE1kzUlU8CNmbDGrGD8ud4sKoTF41Gaqe862t98mvtxhehzxpYKeXg/ikTbZdMbRo2j/XA1woZ0wmeFBA9htrkEsmwEfewcncV8q5slEseJDfVoIWYbFu8n9yLAqQILgODXdPI1rbLr2TG4HB+qQ+Dye/qfDPSwSDbTMksm4lkUqJP0kYcN4fZtifl2rehvvvWK3kcXlwmWq5wgHYAJc3QAH2tx990e4gVGtvlcpf0yhzWUfjKO1k8ViiI06ETbL8R5/aY2H0zJkGSUO7BMEQVbYAMyk3MpDhjUt+vGaQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 193.8.40.94) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=leica-geosystems.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=leica-geosystems.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leica-geosystems.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=14/BF0fuOAMrL0uGmRceyzw1mBluSYeMnwnwEfwpaDA=; b=T5W2lB/VOdkz2jBNPDI7ve4hJEAyEj3pfGqimsDnLLNRJLfvQsMumXNpMrsVL7vln4t+emzVlGhtcX7PedAXYDNvSc00AvQpnRi2AAPYuhaN7O/banOZVO+JQPIENMfa60QgQEjgVKC5r/hw/SOtpfgPDMhXo3r3P3BOZ46jHwY= Received: from AM0PR02CA0131.eurprd02.prod.outlook.com (2603:10a6:20b:28c::28) by GV1PR06MB8402.eurprd06.prod.outlook.com (2603:10a6:150:21::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.18; Fri, 23 Aug 2024 12:42:52 +0000 Received: from AM4PEPF00027A60.eurprd04.prod.outlook.com (2603:10a6:20b:28c:cafe::d0) by AM0PR02CA0131.outlook.office365.com (2603:10a6:20b:28c::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.25 via Frontend Transport; Fri, 23 Aug 2024 12:42:52 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 193.8.40.94) smtp.mailfrom=leica-geosystems.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=leica-geosystems.com; Received-SPF: Pass (protection.outlook.com: domain of leica-geosystems.com designates 193.8.40.94 as permitted sender) receiver=protection.outlook.com; client-ip=193.8.40.94; helo=hexagon.com; pr=C Received: from hexagon.com (193.8.40.94) by AM4PEPF00027A60.mail.protection.outlook.com (10.167.16.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.11 via Frontend Transport; Fri, 23 Aug 2024 12:42:52 +0000 Received: from aherlnxbspsrv01.lgs-net.com ([10.60.34.116]) by hexagon.com with Microsoft SMTPSVC(10.0.17763.1697); Fri, 23 Aug 2024 14:42:52 +0200 From: Catalin Popescu To: amitkumar.karwar@nxp.com, neeraj.sanjaykale@nxp.com, marcel@holtmann.org, luiz.dentz@gmail.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org Cc: linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, bsp-development.geo@leica-geosystems.com, customers.leicageo@pengutronix.de, Catalin Popescu Subject: [PATCH next 2/2] Bluetooth: btnxpuart: support multiple init baudrates Date: Fri, 23 Aug 2024 14:42:39 +0200 Message-Id: <20240823124239.2263107-2-catalin.popescu@leica-geosystems.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240823124239.2263107-1-catalin.popescu@leica-geosystems.com> References: <20240823124239.2263107-1-catalin.popescu@leica-geosystems.com> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-OriginalArrivalTime: 23 Aug 2024 12:42:52.0523 (UTC) FILETIME=[F829BBB0:01DAF559] X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM4PEPF00027A60:EE_|GV1PR06MB8402:EE_ X-MS-Office365-Filtering-Correlation-Id: 32830822-40ea-45b8-d765-08dcc3711ace X-SET-LOWER-SCL-SCANNER: YES X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|82310400026|36860700013|921020; X-Microsoft-Antispam-Message-Info: FpXij4mBUOon7cFLIIk6MUNjeFHCK5TZZKrgu7ECDb5zB60D5YyW2phMqcR6qH2pfQyif740mNIZfj5Jbh48AfyGS/zqYq527TU2o8AIE1Mn6iHBr5kMUa8lO+zDgQB5BpfDx3Wg0m07+e5Ujn26Auo9fkI7WzMeNZP3z6ecI4Lr9gZ7WW9udolNYZVuMH9fXja2QLuCYqZiqqSbMGYzc3PUIydRxKQ81Rai/3ItmsA16KxpEwszaWzr4PllJf7+BWR9x4yGXz8O7zyYsp7mzmDPEEW365W8AS+aOolN2bJF5Ydjy+UMQTAOLEZPxS3uPMTkmOgzHckI/WOXleNDDaaZRAA3UGJex9v+v17Any4BaXbz3u27T/UQM65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+aNmMxMRXnCbJ2snjin4D53rM1ajOX0R2qQ== X-Forefront-Antispam-Report: CIP:193.8.40.94;CTRY:CH;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:hexagon.com;PTR:ahersrvdom50.leica-geosystems.com;CAT:NONE;SFS:(13230040)(1800799024)(376014)(82310400026)(36860700013)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: leica-geosystems.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2024 12:42:52.7312 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 32830822-40ea-45b8-d765-08dcc3711ace X-MS-Exchange-CrossTenant-Id: 1b16ab3e-b8f6-4fe3-9f3e-2db7fe549f6a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=1b16ab3e-b8f6-4fe3-9f3e-2db7fe549f6a;Ip=[193.8.40.94];Helo=[hexagon.com] X-MS-Exchange-CrossTenant-AuthSource: AM4PEPF00027A60.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR06MB8402 We need to support simultaneously different versions of the same chip that are using different baudrates (example: engineering and production samples). This happens typically when OTP has been modified and new primary baudrate is being used. As there's no other way to detect the correct baudrate, we need the driver to go through the list of configured baudrates and try each one out until it finds the matching one. Signed-off-by: Catalin Popescu --- drivers/bluetooth/btnxpuart.c | 45 ++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/drivers/bluetooth/btnxpuart.c b/drivers/bluetooth/btnxpuart.c index 7c2030cec10e..2bfb0ab114f4 100644 --- a/drivers/bluetooth/btnxpuart.c +++ b/drivers/bluetooth/btnxpuart.c @@ -180,7 +180,8 @@ struct btnxpuart_dev { u32 new_baudrate; u32 current_baudrate; - u32 fw_init_baudrate; + u32 fw_primary_baudrate; + u32 fw_init_baudrate[8]; bool timeout_changed; bool baudrate_changed; bool helper_downloaded; @@ -1159,7 +1160,7 @@ static int nxp_set_ind_reset(struct hci_dev *hdev, void *data) static int nxp_setup(struct hci_dev *hdev) { struct btnxpuart_dev *nxpdev = hci_get_drvdata(hdev); - int err = 0; + int i, err = 0; if (nxp_check_boot_sign(nxpdev)) { bt_dev_dbg(hdev, "Need FW Download."); @@ -1171,12 +1172,20 @@ static int nxp_setup(struct hci_dev *hdev) clear_bit(BTNXPUART_FW_DOWNLOADING, &nxpdev->tx_state); } - serdev_device_set_baudrate(nxpdev->serdev, nxpdev->fw_init_baudrate); - nxpdev->current_baudrate = nxpdev->fw_init_baudrate; + for (i = 0; i < ARRAY_SIZE(nxpdev->fw_init_baudrate); i++) { + serdev_device_set_baudrate(nxpdev->serdev, nxpdev->fw_init_baudrate[i]); + nxpdev->current_baudrate = nxpdev->fw_init_baudrate[i]; + + if (nxpdev->current_baudrate != HCI_NXP_SEC_BAUDRATE) { + nxpdev->new_baudrate = HCI_NXP_SEC_BAUDRATE; + err = nxp_set_baudrate_cmd(hdev, NULL); + if (err) + continue; + } - if (nxpdev->current_baudrate != HCI_NXP_SEC_BAUDRATE) { - nxpdev->new_baudrate = HCI_NXP_SEC_BAUDRATE; - hci_cmd_sync_queue(hdev, nxp_set_baudrate_cmd, NULL, NULL); + nxpdev->fw_primary_baudrate = nxpdev->fw_init_baudrate[i]; + bt_dev_dbg(hdev, "Using primary baudrate %d", nxpdev->fw_primary_baudrate); + break; } ps_init(hdev); @@ -1454,6 +1463,10 @@ static int nxp_serdev_probe(struct serdev_device *serdev) { struct hci_dev *hdev; struct btnxpuart_dev *nxpdev; + struct property *prop; + const __be32 *cur; + u32 value; + int i = 0; nxpdev = devm_kzalloc(&serdev->dev, sizeof(*nxpdev), GFP_KERNEL); if (!nxpdev) @@ -1472,10 +1485,13 @@ static int nxp_serdev_probe(struct serdev_device *serdev) init_waitqueue_head(&nxpdev->fw_dnld_done_wait_q); init_waitqueue_head(&nxpdev->check_boot_sign_wait_q); - device_property_read_u32(&nxpdev->serdev->dev, "fw-init-baudrate", - &nxpdev->fw_init_baudrate); - if (!nxpdev->fw_init_baudrate) - nxpdev->fw_init_baudrate = FW_INIT_BAUDRATE; + nxpdev->fw_init_baudrate[0] = FW_INIT_BAUDRATE; + of_property_for_each_u32(dev_of_node(&nxpdev->serdev->dev), + "fw-init-baudrate", prop, cur, value) { + nxpdev->fw_init_baudrate[i] = value; + if (++i == ARRAY_SIZE(nxpdev->fw_init_baudrate)) + break; + } set_bit(BTNXPUART_FW_DOWNLOADING, &nxpdev->tx_state); @@ -1525,12 +1541,13 @@ static void nxp_serdev_remove(struct serdev_device *serdev) wake_up_interruptible(&nxpdev->check_boot_sign_wait_q); wake_up_interruptible(&nxpdev->fw_dnld_done_wait_q); } else { - /* Restore FW baudrate to fw_init_baudrate if changed. + /* Restore FW baudrate to fw_primary_baudrate if changed. * This will ensure FW baudrate is in sync with * driver baudrate in case this driver is re-inserted. */ - if (nxpdev->current_baudrate != nxpdev->fw_init_baudrate) { - nxpdev->new_baudrate = nxpdev->fw_init_baudrate; + if (nxpdev->fw_primary_baudrate && + (nxpdev->current_baudrate != nxpdev->fw_primary_baudrate)) { + nxpdev->new_baudrate = nxpdev->fw_primary_baudrate; nxp_set_baudrate_cmd(hdev, NULL); } }