Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp215325lqg; Fri, 1 Mar 2024 03:07:59 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWol2Y1dmRhDOJewVSS0mt2M7sspSMidCSDnDSQTlYN9NDx/sGatSjSC39qmvVTiGRWdqevr+5mlgUQkQokTv+1rbJASF2V4SFt+e9Ttw== X-Google-Smtp-Source: AGHT+IH8YuJ6TqGXTrUIUf1EN7ht28OfmYLfqdpc64e4UiltLmoyeaYy78CAAYfOPCOo4CBSxGCf X-Received: by 2002:a17:902:ead5:b0:1dc:696d:ec6e with SMTP id p21-20020a170902ead500b001dc696dec6emr1015965pld.21.1709291279009; Fri, 01 Mar 2024 03:07:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709291278; cv=pass; d=google.com; s=arc-20160816; b=qGX7b7BVzpVMr6iYsq7Zyrfwz8tnwJ7QK1mHwv95V65aPn5SzN1AwDUrBerYarmwIH tAZwuN67+SZ1db9yh3v8gl84Oz5SF9Z7sd67HsSGQ28NyvDThL5S+XlkNbQigEg9+9Dm /Vo4qXehcqubjQpoheyqXaqMWbzQ3XQquBZZ4W5M4npt6Y6m2Jw4mzY5utuGYFpGOzD5 Wrru3hfKoet6yZXgZ0OAPgNTfNV2Q+NFrbhqpH5oo6TWjow1A/XCDOyo8k3nU/E2EHbx Nbec1h8ulzSC0R13KueOI0zxS0t5i+KoWo8Rd2A7tWrU/pTG2y9mN6dOZNsmS91d/rAI pYTQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=A9zml/CvjzAftC7vJv7u3EUjy8RUiQoLyK+2Vk9bdWg=; fh=OzGdaeiMjZgYAHajX7vnKwSpSiVzFDxYaf+uz7SF2AY=; b=XtZ5+E8OBSbJQxn2Vp/Jp1tyOZ4dv71+ShaeUgQEux7KWAOx2t58TyQTFpIfwHC0AX Ww8XKtB45k3TpeJeJBoV33BvZry4QSXCXp20rsS2PDSD+eQY3l0CKIXTEasd1vWPwTN+ Rn6NOeUTjAq+2fUbHLSoScLDeqHVWcSrr90/GVrvoIdZY/PXccnepeiwLqiwA6C1pesV k3VIU0qm3VazCMOkYdyNteeLGw4n7SW1aqshadyFqg1J4Py1iDGSb+GWN08pyPoLySU/ O7OiTMWThFGgJMIijQg4PYsJGcBF+fExa8DS+BLdtHGLD139W/PQKB6kEd2RdQ176GiW OeFQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=molgen.mpg.de); spf=pass (google.com: domain of linux-bluetooth+bounces-2226-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-2226-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id ma8-20020a170903094800b001dbcf7ec8aesi3456689plb.1.2024.03.01.03.07.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 03:07:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-2226-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=molgen.mpg.de); spf=pass (google.com: domain of linux-bluetooth+bounces-2226-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-2226-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id A6AE5286E06 for ; Fri, 1 Mar 2024 11:07:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0F9A26BFCD; Fri, 1 Mar 2024 11:07:54 +0000 (UTC) X-Original-To: linux-bluetooth@vger.kernel.org Received: from mx3.molgen.mpg.de (mx3.molgen.mpg.de [141.14.17.11]) (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 87D0E6BFC2 for ; Fri, 1 Mar 2024 11:07:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=141.14.17.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709291273; cv=none; b=uYU92j58VfiS+2DxyyPtTCxGnylFNEzK8XEamGXbwmkKdYXl1IYeSG9sR46C15MdcKoZ3D21OjgG6y+ADInCj41xfXCivL08U4oupJPjZX1HETW2mJ6mllIxCiQlCIBDvq+0buL+vWepNzdTARjl1QdoJNntmmN55hxJ9UstfrM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709291273; c=relaxed/simple; bh=DPAWIm/LmepvffLQnE2gbYi51zt2/JYyOEK2J3xmKW4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=VguUkyCglJcE3TdfrXRDQWbLASmuYCuQ8M5WIDymHb+6Fsy6REa7b3pUA6ttQXVoGIAaz4B0R5RA665JlDEP4C+LDGpjXXuJQ8UQRE9IWLmwB3Wd8X/RIPRQ4qFcxz0csdF+eJhDZrI/LobfoIpHzAmkStkF3q4IzPDxFi7Xhmk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=molgen.mpg.de; spf=pass smtp.mailfrom=molgen.mpg.de; arc=none smtp.client-ip=141.14.17.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=molgen.mpg.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=molgen.mpg.de Received: from [141.14.220.34] (g34.guest.molgen.mpg.de [141.14.220.34]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: pmenzel) by mx.molgen.mpg.de (Postfix) with ESMTPSA id 4EDB061E5FE01; Fri, 1 Mar 2024 12:07:30 +0100 (CET) Message-ID: Date: Fri, 1 Mar 2024 12:07:30 +0100 Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1] Bluetooth: btintel: Add support for downloading secondary boot loader image Content-Language: en-US To: Kiran K Cc: linux-bluetooth@vger.kernel.org, ravishankar.srivatsa@intel.com, chethan.tumkur.narayan@intel.com References: <20240301102412.11151-1-kiran.k@intel.com> From: Paul Menzel In-Reply-To: <20240301102412.11151-1-kiran.k@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Dear Kiran, Thank you for your patch. Am 01.03.24 um 11:24 schrieb Kiran K: > Some variants of Intel controllers like BlazarI supports downloading of support In the diff you write Blazar-I. > secondary bootloader. This patch adds the support to download secondary > boot loader image before downloading operational firmware image. What is the secondary bootloader needed for? > Signed-off-by: Kiran K > --- > dmesg logs: > [ 16.537130] Bluetooth: Core ver 2.22 > [ 16.537135] Bluetooth: Starting self testing > [ 16.540021] Bluetooth: ECDH test passed in 2818 usecs > [ 16.560666] Bluetooth: SMP test passed in 602 usecs > [ 16.560674] Bluetooth: Finished self testing > [ 16.560690] Bluetooth: HCI device and connection manager initialized > [ 16.560695] Bluetooth: HCI socket layer initialized > [ 16.560697] Bluetooth: L2CAP socket layer initialized > [ 16.560700] Bluetooth: SCO socket layer initialized > [ 16.571934] Bluetooth: hci0: Device revision is 0 > [ 16.571940] Bluetooth: hci0: Secure boot is disabled > [ 16.571941] Bluetooth: hci0: OTP lock is disabled > [ 16.571942] Bluetooth: hci0: API lock is enabled > [ 16.571943] Bluetooth: hci0: Debug lock is disabled > [ 16.571943] Bluetooth: hci0: Minimum firmware build 1 week 10 2014 > [ 16.571945] Bluetooth: hci0: Bootloader timestamp 2022.46 buildtype 1 build 26590 > [ 16.572189] Bluetooth: hci0: DSM reset method type: 0x00 > [ 16.575002] Bluetooth: hci0: Found device firmware: intel/ibt-0090-0291-02.sfi > [ 16.575007] Bluetooth: hci0: Boot Address: 0x30099000 > [ 16.575008] Bluetooth: hci0: Firmware Version: 200-10.24 > [ 16.705698] Bluetooth: hci0: Waiting for firmware download to complete > [ 16.705927] Bluetooth: hci0: Firmware loaded in 127852 usecs Unrelated, but this is quite long. > [ 16.705952] Bluetooth: hci0: Waiting for device to boot > [ 16.708519] Bluetooth: hci0: Device booted in 2522 usecs > [ 16.708538] Bluetooth: hci0: Malformed MSFT vendor event: 0x02 (Unrelated, but this is shown on a lot of devices. One more time below.) > [ 16.710296] Bluetooth: hci0: No device address configured > [ 16.712483] Bluetooth: hci0: Found device firmware: intel/ibt-0090-0291.sfi > [ 16.712497] Bluetooth: hci0: Boot Address: 0x10000800 > [ 16.712498] Bluetooth: hci0: Firmware Version: 211-10.24 It’s unclear from the logs, why two firmware files (with different versions) are loaded. > [ 16.930834] Bluetooth: BNEP (Ethernet Emulation) ver 1.3 > [ 16.930840] Bluetooth: BNEP filters: protocol multicast > [ 16.930844] Bluetooth: BNEP socket layer initialized > [ 18.494137] Bluetooth: hci0: Waiting for firmware download to complete > [ 18.494897] Bluetooth: hci0: Firmware loaded in 1740634 usecs Hmm, 1.7 seconds is very long. > [ 18.494972] Bluetooth: hci0: Waiting for device to boot > [ 18.529089] Bluetooth: hci0: Device booted in 33371 usecs > [ 18.529121] Bluetooth: hci0: Malformed MSFT vendor event: 0x02 > [ 18.529914] Bluetooth: hci0: Found Intel DDC parameters: intel/ibt-0090-0291.ddc > [ 18.532158] Bluetooth: hci0: Applying Intel DDC parameters completed > [ 18.532582] Bluetooth: hci0: Found Intel DDC parameters: intel/bdaddress.cfg > [ 18.534109] Bluetooth: hci0: Applying Intel DDC parameters completed > [ 18.537170] Bluetooth: hci0: Firmware timestamp 2024.9 buildtype 0 build 58067 > [ 18.537177] Bluetooth: hci0: Firmware SHA1: 0x81abf1ea > [ 18.540985] Bluetooth: hci0: Fseq status: Success (0x00) > [ 18.540992] Bluetooth: hci0: Fseq executed: 00.00.00.00 > [ 18.540993] Bluetooth: hci0: Fseq BT Top: 00.00.00.00 > [ 18.631360] Bluetooth: MGMT ver 1.22 > [ 18.673023] Bluetooth: RFCOMM TTY layer initialized > [ 18.673031] Bluetooth: RFCOMM socket layer initialized > [ 18.673039] Bluetooth: RFCOMM ver 1.11 Thank you for pasting this. It’d be great if you added it to the commit message, so above ---. > drivers/bluetooth/btintel.c | 38 ++++++++++++++++++++++++++++++++++++- > 1 file changed, 37 insertions(+), 1 deletion(-) > > diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c > index 6ba7f5d1b837..934aad89bbf1 100644 > --- a/drivers/bluetooth/btintel.c > +++ b/drivers/bluetooth/btintel.c > @@ -521,6 +521,9 @@ static int btintel_version_info_tlv(struct hci_dev *hdev, > version->min_fw_build_nn, version->min_fw_build_cw, > 2000 + version->min_fw_build_yy); > break; > + case 0x02: > + variant = "IML"; What does IML mean? > + break; > case 0x03: > variant = "Firmware"; > break; > @@ -2194,10 +2197,26 @@ static void btintel_get_fw_name_tlv(const struct intel_version_tlv *ver, > char *fw_name, size_t len, > const char *suffix) > { > + const char *format; > /* The firmware file name for new generation controllers will be > * ibt-- > */ > - snprintf(fw_name, len, "intel/ibt-%04x-%04x.%s", > + switch (INTEL_HW_VARIANT(ver->cnvi_bt)) { > + /* Only Blazar-I (0x1e) product supports downloading of secondary boot > + * loader image > + */ > + case 0x1e: Should a macro be defined for 0x1e? > + if (ver->img_type == 1) Below you write 0x0x. Should this be consistent? > + format = "intel/ibt-%04x-%04x-02.%s"; > + else > + format = "intel/ibt-%04x-%04x.%s"; > + break; > + default: > + format = "intel/ibt-%04x-%04x.%s"; > + break; > + } > + > + snprintf(fw_name, len, format, > INTEL_CNVX_TOP_PACK_SWAB(INTEL_CNVX_TOP_TYPE(ver->cnvi_top), > INTEL_CNVX_TOP_STEP(ver->cnvi_top)), > INTEL_CNVX_TOP_PACK_SWAB(INTEL_CNVX_TOP_TYPE(ver->cnvr_top), > @@ -2607,6 +2626,23 @@ static int btintel_bootloader_setup_tlv(struct hci_dev *hdev, > if (err) > return err; > > + err = btintel_read_version_tlv(hdev, ver); > + if (err) > + return err; > + > + /* If image type returned is 0x02, then controller supports secondary > + * boot loader image > + */ > + if (ver->img_type == 0x02) { Could a macro be defined for 0x02? > + err = btintel_prepare_fw_download_tlv(hdev, ver, &boot_param); > + if (err) > + return err; > + > + err = btintel_boot(hdev, boot_param); > + if (err) > + return err; > + } > + > btintel_clear_flag(hdev, INTEL_BOOTLOADER); > > btintel_get_fw_name_tlv(ver, ddcname, sizeof(ddcname), "ddc"); Kind regards, Paul