From patchwork Wed Jun 28 22:20:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Wang X-Patchwork-Id: 13296397 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 51BB1EB64D7 for ; Wed, 28 Jun 2023 22:20:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=S/nbo+ebgMdV4ZZSJyAeh1YAiJ4mp8iyvOvAOjIJhm0=; b=c242m3XFCQSpsresgLAium4Afw sIS3yG+x9XrZph0sapJ4u6V9MhJZoMQplBH2fOj75ogmSlLJdHdOZrRgo47ngsnoBUfLaLrFpHWW3 cnf+Bx9kOynjLrCIxaN8YklzcXYPd8xSWMyX2rcg5kGjEMr9w6lO9ksWJBhwUn4Xg0xfOE7ytXGzB 1+j/gxE5dNFc5DXJs66FsIVNFD2wxBTIaVcSoe8eykCnjJRKNSdqwvumqqf+B36G5hZkznAWSPbHN q9X8j3bImje5w/DCGrOwueZRjzw3pe329up+BMNfcReHd26gp98HS0IHMV9yo+qT+uesgr11VB4FD /L2G4WmA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qEdWN-00GtCF-0d; Wed, 28 Jun 2023 22:20:19 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qEdWK-00GtB0-1W for linux-mediatek@lists.infradead.org; Wed, 28 Jun 2023 22:20:17 +0000 X-UUID: effebbf8160111ee83ed1395ce914268-20230628 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=S/nbo+ebgMdV4ZZSJyAeh1YAiJ4mp8iyvOvAOjIJhm0=; b=GS1LtMzZXvgNH3LGI6bs4As0WeHw9ohCk/KCiDKNsLsekqnUujnxPHAijKAlyGp2AsEif741PfNuYc6AJ5/pZLb3nNKAnvLskx/yJq+SzMwyfkAtVnyYy5S6UFyNxgZ7vlc7CF6rwrnr1Dt+fkwfiC895D8lVt84n8IqCSIGkw4=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.27,REQID:8e7de35c-84f0-4cb0-ba1c-1182f34c16dd,IP:0,U RL:0,TC:0,Content:-25,EDM:0,RT:0,SF:100,FILE:0,BULK:0,RULE:Release_Ham,ACT ION:release,TS:75 X-CID-INFO: VERSION:1.1.27,REQID:8e7de35c-84f0-4cb0-ba1c-1182f34c16dd,IP:0,URL :0,TC:0,Content:-25,EDM:0,RT:0,SF:100,FILE:0,BULK:0,RULE:Spam_GS981B3D,ACT ION:quarantine,TS:75 X-CID-META: VersionHash:01c9525,CLOUDID:07f37b82-5a99-42ae-a2dd-e4afb731b474,B ulkID:230629062009JV49Z244,BulkQuantity:0,Recheck:0,SF:38|29|28|17|19|48,T C:nil,Content:0,EDM:-3,IP:nil,URL:11|1,File:nil,Bulk:nil,QS:nil,BEC:nil,CO L:0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR,TF_CID_SPAM_SDM,TF_CID_SPAM_ASC,TF_CID_SPAM_FAS, TF_CID_SPAM_FSD,TF_CID_SPAM_ULN X-UUID: effebbf8160111ee83ed1395ce914268-20230628 Received: from mtkmbs13n1.mediatek.inc [(172.21.101.193)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1104578925; Wed, 28 Jun 2023 15:20:07 -0700 Received: from mtkmbs11n1.mediatek.inc (172.21.101.186) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Thu, 29 Jun 2023 06:20:04 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Thu, 29 Jun 2023 06:20:04 +0800 From: To: , , CC: , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v3] Bluetooth: btmtk: add printing firmware information Date: Thu, 29 Jun 2023 06:20:03 +0800 Message-ID: <1c40a12b51ccd6ee2ee002276f5b1ba92c377100.1687990098.git.objelf@gmail.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230628_152016_515592_A28C1BC3 X-CRM114-Status: GOOD ( 11.51 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org From: Chris Lu Add printing firmware information part when driver loading firmware that user can get mediatek bluetooth information. Co-developed-by: Sean Wang Signed-off-by: Sean Wang Signed-off-by: Chris Lu --- v3: resend again with the latest tree --- drivers/bluetooth/btmtk.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/bluetooth/btmtk.c b/drivers/bluetooth/btmtk.c index 9482401d97fa..8490d59502a5 100644 --- a/drivers/bluetooth/btmtk.c +++ b/drivers/bluetooth/btmtk.c @@ -57,6 +57,7 @@ int btmtk_setup_firmware_79xx(struct hci_dev *hdev, const char *fwname, wmt_cmd_sync_func_t wmt_cmd_sync) { struct btmtk_hci_wmt_params wmt_params; + struct btmtk_patch_header *hdr; struct btmtk_global_desc *globaldesc = NULL; struct btmtk_section_map *sectionmap; const struct firmware *fw; @@ -75,9 +76,13 @@ int btmtk_setup_firmware_79xx(struct hci_dev *hdev, const char *fwname, fw_ptr = fw->data; fw_bin_ptr = fw_ptr; + hdr = (struct btmtk_patch_header *)fw_ptr; globaldesc = (struct btmtk_global_desc *)(fw_ptr + MTK_FW_ROM_PATCH_HEADER_SIZE); section_num = le32_to_cpu(globaldesc->section_num); + bt_dev_info(hdev, "HW/SW Version: 0x%04x%04x, Build Time: %s", + le16_to_cpu(hdr->hwver), le16_to_cpu(hdr->swver), hdr->datetime); + for (i = 0; i < section_num; i++) { first_block = 1; fw_ptr = fw_bin_ptr;