Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp19846532rwd; Wed, 28 Jun 2023 15:26:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5zEv9sL7677uEtJZtmvmKvbxQs6vBysljVYI1xlD8MBxYo0qlL6I7m7QXeBJpudO1GZiyL X-Received: by 2002:a17:903:41d0:b0:1b5:31f8:2450 with SMTP id u16-20020a17090341d000b001b531f82450mr17400767ple.51.1687991216111; Wed, 28 Jun 2023 15:26:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687991216; cv=none; d=google.com; s=arc-20160816; b=J98jEmL/3+gKhwPTiRPi5d0QNWW1k7jUm0I7OImtLmxbqESIYVpWI3MoVU/P39ropd j2+Z8nfgFIeJY53kWsHvHe+W1Mq5bngX2Je1a2HM8jGkYNiaXJuUui/FPNpxQiC9hGrZ dNvrBDBDkZ1rLOnY2E6BIhP4YNf4EyejrtjUooa4irWngeafxnXyUezD32Pxfq4YiOFz 1cxFYVa6t7YAt/++EdL0AOcKi7KHoJvicl0gdtc/vxtnfTftxbmhpOngwm7uwgQ1q0iR RAH/cwv78/KcMIRIxfASmTeF311xqiy0pW7TIdjBjamWxBQRQVaaHBWM3mchlc0kwf3Z l4Mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=S/nbo+ebgMdV4ZZSJyAeh1YAiJ4mp8iyvOvAOjIJhm0=; fh=B8Xx3Gf2lShXZtipPxvFFAw2cI5kPgCsxyMhs2JDQwM=; b=wdoa38m9GsFom5YpmzNk78EbzcP/xRasN+JckeUEG90fjmES7vDhY2aANLbZ+94eof UZ4oXdo/jvPTO7Rsc//D54vSljx6Gg9/ZsEsY5guLdhkpLTHmb/faz4JvzcKVKWtbuQX HdynDQaajv7BHsA85YHV4i3NcCq5DdGmhXz5qGuKq9mj5PiKlml44jPDpIky62fvvMaA red8B6bBNIZgnvu9MqVjJkatDi653omNcGeTCczloEp87VBIdJmgJjdc1Za3Q4d3+MEm gU6dtnA94VQjFAqLOpaiBXGJ/j/OSSzWXhFgrHz83E3CwG5Jmny1vefmTx4kHAhBfQla eGLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=GS1LtMzZ; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o19-20020a170902779300b001b69de1eac0si8985668pll.367.2023.06.28.15.26.29; Wed, 28 Jun 2023 15:26:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=GS1LtMzZ; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229865AbjF1WUV (ORCPT + 99 others); Wed, 28 Jun 2023 18:20:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229524AbjF1WUT (ORCPT ); Wed, 28 Jun 2023 18:20:19 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CEB61FCD; Wed, 28 Jun 2023 15:20:11 -0700 (PDT) X-UUID: ef59e15a160111ee9cb5633481061a41-20230629 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:0d5afe75-e8b1-4ed6-a931-76c706a454d4,IP:0,U RL:0,TC:0,Content:-25,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:-25 X-CID-META: VersionHash:01c9525,CLOUDID:0884a50d-c22b-45ab-8a43-3004e9216b56,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:11|1,File:nil,Bulk:nil,QS:nil,BEC:nil,COL: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_ULN X-UUID: ef59e15a160111ee9cb5633481061a41-20230629 Received: from mtkmbs11n1.mediatek.inc [(172.21.101.185)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1265616894; Thu, 29 Jun 2023 06:20:06 +0800 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 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,SPF_HELO_PASS,T_SCC_BODY_TEXT_LINE,T_SPF_TEMPERROR, UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.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; -- 2.25.1