From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 3281B426680 for ; Wed, 1 Jul 2026 10:38:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782902290; cv=none; b=NJL2Lo8fXGkjQBKtVcC3XzZs4UeDBJcvIJrqo+wcC1Ej/Sl8a0VM1T13M4Yt8Ob44cJSnXVdyHhlAj7riHQ3JlVrB+mEqwdzKJ/4pSglYwEYLDQeJBICvetoTKWZCOrRiMl326yn6LvVjXAJX7DTa87BzUK6BVx63pJdgfaODno= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782902290; c=relaxed/simple; bh=y9g67LoOAK1zIYhgVoqMtpnLtPZtPHG+SZ4nbuUAoiw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=KPXEYv5pZpxOD0yj0v5ABoXj5OScP5lCpv4/VVsVL/mMpppB0cp+f3IYkL7trrnpAPSA4HComLrT8wfsFm98fph1i2yLucyt5diAHe5QE3zUbBiHP/2seZn6Nl6Oa6IZH0pPvXC3PbYK+D3kVexYOorrl3gS3l4chW71dAPwU58= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=cpbEpQKY; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=iBHROBo4; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="cpbEpQKY"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="iBHROBo4" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 661A904D753610 for ; Wed, 1 Jul 2026 10:38:07 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= eWnkB32rC8c/c1FmukfGJLAkXTQ/yzUwW5QZTJ1tuHA=; b=cpbEpQKYeJAibeQw DF/pYebaDlq3kYo/OPlezrMmkbtB6HKnIvcZnKq7/Uh0zSHdvpfOyepU7UY0/qJL oEseZXD5mMrlJAK4uD/xXudLJbf9dKPglADPs2AVOJo5id7HDRP4SaAoCLVDFVE2 QohC+zc7CKE2QUntNlQFdxP4Y1AxlMMEuatAX4mGAaxZJMzFvlg/8Z4fVGehZzFS ra1u84e/bpbRSFwME5y+dHge3mAyLIUyKohwqKRgFaVLkai8OJo0TdGlI7DbhzVa Q7l1eg/sLgcHyA3Dnu1COBxvzH0/75VQAGGxiLOyyE1r+2j9Y+9Ssm85CTGbra+s qcC/VQ== Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4f4rsy27r6-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 01 Jul 2026 10:38:07 +0000 (GMT) Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-37d125687b6so605803a91.1 for ; Wed, 01 Jul 2026 03:38:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1782902286; x=1783507086; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=eWnkB32rC8c/c1FmukfGJLAkXTQ/yzUwW5QZTJ1tuHA=; b=iBHROBo4iSm+61nMFQQYSg2Tf2tgMZZnY+gNstHthmaD6ZWvn2arO5lQekjsDuhlEa s1J7P8rO7kOKyqsuV9sc/YvMcp4DRmWgF8r14dJ0psOvVJe2SnsvBv26MEXYOSs0up3X qCRc8D99kZ/ClOLdfGcpVjwRWyvLLWPR5QhJ54g6vjNuS/lX4y7PX6UsJLYEHm5s6r9N HUKDVBbweRlddJXej0x+V4aCl3I1Rcsjmf1TZAGbwJitBbVsyK8DY1VBhS1H6B9IOuFM Li9Tkn8G9JGMCKp/lTFHkblBGG5+MVFpjXaDrtt9eps7yAIvN05VaYHJrLOJO6ssjIn9 /slw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782902286; x=1783507086; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=eWnkB32rC8c/c1FmukfGJLAkXTQ/yzUwW5QZTJ1tuHA=; b=V99F9tnFKPeIBgbsJI/5RecJsAt9cISuf9k6LsI8bgiR2bYdUF1q/YNIxD+PcvLIB/ 6eljtU2VwNEfRPBqCj5ptABPB9+2pquXE5NvjCj5P6LRrcZsNuVcnM5WcKcD4mEhAX/1 PMtKNHfUe0moT5v6w3KEcxYYBJJINdfA7cj1rY+Q8GMroMv9Zi2uDWmWXJGue3S21UgI wZzY7JhkLAbg8vrtuPLdYVvhzCU0tygWIEDFaOtzC3GO31IFOJ7Ki1Uu0NPoecup4PSu 0tKW3fV12TFBUXwxRjGHYq+O7SXMnvV0mjmqxZG3A0MqL6C+I48f79vGAHW5FpWG83P9 vQOQ== X-Forwarded-Encrypted: i=1; AHgh+RrHpXhH35UnYx/BBZ3wR6IxKh2gadfXy6ScyWqZG8s4/ay62QYhII1/4dKkSTLg2yA5oh3hotsUgFm75bI=@vger.kernel.org X-Gm-Message-State: AOJu0Yz8yi4Qv/iK6oucPsAkhCEx+I7EBveYej8HAnZfHzccjLWW7bM0 Uqa3L5w6/uo0hsf1CEAfr1f/r5MOLqs71Pkt8sFodOMYGNMTC3OLI51xIJp5/6PsLvRhYx86TVq /Lcb2gevJLH0qlszWoZAmbfIL7Ti1p9TuvDM9K8Rh5lFkLtyGH4+7DVKuoMzPXMIuenU= X-Gm-Gg: AfdE7cnfV3R5oIyMcXamG6CPhyssOEUIF+ugU7CIAAl0ohLtwTB/fG0PsqvCazeZwaR diB5Xhj9nG8HadfUkre2+FJOrH7NbNuavc6qdO7UfZ9BfTfvw1kL6kq3juqRHPQcG9uvqwU2hLK ecIogMWHv4bBfNY3FMIHKrzJvyfaMA9k68YQHcXVraYpOtpR5Z/KdetDqJKmOnPvcUEcZwLdDIK uxzRO6VyQQUwumGRAHdvtLXVodN1dfAh3Zvfe4ct1rYGWe4msZaqs1J3COIvtr3vv4vLf7gzz0I mhw+ogwDXSUgbQVQMLYqzAGCsuxo72uG6VTb0hfycB1GDVqdlfbV1lDnGfoTBVQsv4Pq9u7o4kN NQ/rrWFnZblKxhkmZIB4+HXzJB9r/45HUB6MeZB6P X-Received: by 2002:a17:90b:562c:b0:37f:9ce3:ca97 with SMTP id 98e67ed59e1d1-380aa20e0cemr953621a91.32.1782902286105; Wed, 01 Jul 2026 03:38:06 -0700 (PDT) X-Received: by 2002:a17:90b:562c:b0:37f:9ce3:ca97 with SMTP id 98e67ed59e1d1-380aa20e0cemr953589a91.32.1782902285554; Wed, 01 Jul 2026 03:38:05 -0700 (PDT) Received: from hu-batta-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-38095bc8a2asm765251a91.0.2026.07.01.03.38.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jul 2026 03:38:05 -0700 (PDT) From: Kishore Batta Date: Wed, 01 Jul 2026 16:07:38 +0530 Subject: [PATCH v6 4/7] bus: mhi: Add QDU100 Sahara variant and firmware fallback Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260701-sahara_protocol_new_v2-v6-4-3a78362c4741@oss.qualcomm.com> References: <20260701-sahara_protocol_new_v2-v6-0-3a78362c4741@oss.qualcomm.com> In-Reply-To: <20260701-sahara_protocol_new_v2-v6-0-3a78362c4741@oss.qualcomm.com> To: Jonathan Corbet , Shuah Khan , Jeff Hugo , Carl Vanderlip , Oded Gabbay , Manivannan Sadhasivam Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, mhi@lists.linux.dev, Kishore Batta X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1782902263; l=5296; i=kishore.batta@oss.qualcomm.com; s=20260206; h=from:subject:message-id; bh=y9g67LoOAK1zIYhgVoqMtpnLtPZtPHG+SZ4nbuUAoiw=; b=jnKA84aJ1sECKLlROc87nix/+fJvHhxdehrww1VkOlAbyhF3aSuQQrLie42XItz0ub6ZmN/ZB r689bN1jkB9CaoIdFwF+Sin8UMVYjo36Y1sA5IsNj8RHzmnCNZTo7W3 X-Developer-Key: i=kishore.batta@oss.qualcomm.com; a=ed25519; pk=vJo8RvTf+HZpRLK2oOIljmbn9l3zFkibCGh+blaqZCw= X-Proofpoint-GUID: Dryc6N46AAjfAhFAVfwJYldZ8bf12Pt5 X-Authority-Analysis: v=2.4 cv=fLgJG5ae c=1 sm=1 tr=0 ts=6a44ee0f cx=c_pps a=UNFcQwm+pnOIJct1K4W+Mw==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=3WHJM1ZQz_JShphwDgj5:22 a=EUspDBNiAAAA:8 a=3TBL8zyTcm-CCHetwZgA:9 a=QEXdDO2ut3YA:10 a=uKXjsCUrEbL0IQVhDsJ9:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzAxMDExMSBTYWx0ZWRfX23K2H/xxTbIT 3IXvQe9EQDAuMQylgPsdx8ouxNDAbe32wPME3pCPcWO63qoiaF54cZoZNny0NUlrj/Qkq5ZA1Xw rK/9VFVQm296isKObjZoP2dxzcbcg62tgxFAum1pu/7S8w+Sd8sFXQlxabGrbpNNkbTy9SOlneh RLYAaI8IZ9nMgGiT9TLdWD8+myYkQW6RIeWe1pOoMkfQ5cH7fmiPdxA95rap6QaycsWLboHsDfA Y0eEGQoldTiTicMFwXMgVD4hLne+uUKk4qakMvX4MnkaicIlA9Tn3jvjGTaChCxgL0vIzLN5WND dVWd7Z+lYVckIB0Mu+6CdCtyV3h3qHiB0GW25YJaJTIy05WyKNLcJx2qR6K6u/ncY1vcMUFh5sE j1J6fGmarpcAZi6lUKl6wvZTPopsR/o77qu7WiziFDJNJcDEQtOHUvlOaXU1rQOmdipwIejcpK8 hyV+CtIDk0FOLdcFMnw== X-Proofpoint-ORIG-GUID: Dryc6N46AAjfAhFAVfwJYldZ8bf12Pt5 X-Proofpoint-Spam-Info: AW1haW4tMjYwNzAxMDExMSBTYWx0ZWRfXxD4eSixBbu9v yjBu9ss2YwqXJIXz5uA73i433CU/1DUwXdEIzzTkM8yi+rvuFiXR8ZXiqaRC0Ypevm80NmtzIWA I3GXV5AREtqQemr/j3y2+aNYxM3k3ok= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-07-01_03,2026-06-26_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 phishscore=0 malwarescore=0 suspectscore=0 priorityscore=1501 bulkscore=0 spamscore=0 adultscore=0 lowpriorityscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607010111 The Sahara driver currently selects a firmware image table based on the attached device, but it does not recognize QDU100 devices that expose the protocol on the SAHARA MHI channel. As a result, the host cannot associate QDU100 devices with the correct firmware namespace during image transfer. Extend the probe time variant selection to match the SAHARA MHI channel and associate it with the QDU100 firmware folder. Add a firmware lookup fallback for cases where an image does not have an explicit entry in the device's firmware table. This allows required images to be provisioned by the platform. This change only affects devices matched on the SAHARA MHI channel and does not change behavior for existing AIC100 and AIC200 devices. Signed-off-by: Kishore Batta --- drivers/bus/mhi/host/clients/sahara/sahara.c | 27 +++++++++++++++-- drivers/bus/mhi/host/pci_generic.c | 45 ++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+), 2 deletions(-) diff --git a/drivers/bus/mhi/host/clients/sahara/sahara.c b/drivers/bus/mhi/host/clients/sahara/sahara.c index e339c67e236af271645ca81cc517efd9eead87e4..9adbd84859073d8024ba2a5fcfa33897439d6759 100644 --- a/drivers/bus/mhi/host/clients/sahara/sahara.c +++ b/drivers/bus/mhi/host/clients/sahara/sahara.c @@ -189,6 +189,7 @@ static bool is_streaming(struct sahara_context *context) static int sahara_find_image(struct sahara_context *context, u32 image_id) { + char *fw_path; int ret; if (image_id == context->active_image_id) @@ -201,8 +202,28 @@ static int sahara_find_image(struct sahara_context *context, u32 image_id) } if (image_id >= context->table_size || !context->image_table[image_id]) { - dev_err(&context->mhi_dev->dev, "request for unknown image: %d\n", image_id); - return -EINVAL; + if (!context->fw_folder) { + dev_err(&context->mhi_dev->dev, + "Request for unknown image: %u (no fw folder)\n", image_id); + return -EINVAL; + } + + fw_path = kasprintf(GFP_KERNEL, "qcom/%s/%u", + context->fw_folder, image_id); + if (!fw_path) + return -ENOMEM; + + ret = firmware_request_nowarn(&context->firmware, + fw_path, + &context->mhi_dev->dev); + kfree(fw_path); + if (ret) { + dev_err(&context->mhi_dev->dev, + "request for unknown image: %d\n", image_id); + return -EINVAL; + } + context->active_image_id = image_id; + return 0; } /* @@ -870,8 +891,10 @@ static void sahara_mhi_dl_xfer_cb(struct mhi_device *mhi_dev, struct mhi_result static const struct mhi_device_id sahara_mhi_match_table[] = { { .chan = "QAIC_SAHARA", }, + { .chan = "SAHARA"}, {}, }; +MODULE_DEVICE_TABLE(mhi, sahara_mhi_match_table); static struct mhi_driver sahara_mhi_driver = { .id_table = sahara_mhi_match_table, diff --git a/drivers/bus/mhi/host/pci_generic.c b/drivers/bus/mhi/host/pci_generic.c index 391ab146f501c6ce1c81f6138f7c491a49c2f264..82e41632afc555a53dec3d8395558ae039b33bbd 100644 --- a/drivers/bus/mhi/host/pci_generic.c +++ b/drivers/bus/mhi/host/pci_generic.c @@ -300,6 +300,43 @@ static const struct mhi_pci_dev_info mhi_qcom_qdu100_info = { .reset_on_remove = true, }; +static const char * const qdu100_image_table[] = { + [5] = "qcom/qdu100/uefi.elf", + [8] = "qcom/qdu100/qdsp6sw.mbn", + [16] = "qcom/qdu100/efs1.bin", + [17] = "qcom/qdu100/efs2.bin", + [20] = "qcom/qdu100/efs3.bin", + [23] = "qcom/qdu100/aop.mbn", + [25] = "qcom/qdu100/tz.mbn", + [29] = "qcom/qdu100/zeros_1sector.bin", + [33] = "qcom/qdu100/hypvm.mbn", + [34] = "qcom/qdu100/mdmddr.mbn", + [36] = "qcom/qdu100/multi_image_qti.mbn", + [37] = "qcom/qdu100/multi_image.mbn", + [38] = "qcom/qdu100/xbl_config.elf", + [39] = "qcom/qdu100/abl_userdebug.elf", + [40] = "qcom/qdu100/zeros_1sector.bin", + [41] = "qcom/qdu100/devcfg.mbn", + [42] = "qcom/qdu100/zeros_1sector.bin", + [45] = "qcom/qdu100/tools_l.elf", + [46] = "qcom/qdu100/Quantum.elf", + [47] = "qcom/qdu100/quest.elf", + [48] = "qcom/qdu100/xbl_ramdump.elf", + [49] = "qcom/qdu100/shrm.elf", + [50] = "qcom/qdu100/cpucp.elf", + [51] = "qcom/qdu100/aop_devcfg.mbn", + [52] = "qcom/qdu100/fw_csm_gsi_3.0.elf", + [53] = "qcom/qdu100/qdsp6sw_dtbs.elf", + [54] = "qcom/qdu100/qupv3fw.elf", +}; + +static const struct mhi_sahara_fw_table qdu100_sahara_fw = { + .image_table = qdu100_image_table, + .table_size = ARRAY_SIZE(qdu100_image_table), + .fw_folder = "qdu100", + .non_streaming = false, +}; + static const struct mhi_channel_config mhi_qcom_sa8775p_channels[] = { MHI_CHANNEL_CONFIG_UL(46, "IP_SW0", 2048, 1), MHI_CHANNEL_CONFIG_DL(47, "IP_SW0", 2048, 2), @@ -1399,6 +1436,14 @@ static int mhi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) pci_set_drvdata(pdev, mhi_pdev); + /* + * Provide Sahara firmware mapping. Sahara consumes it via + * mhi_dev->mhi_cntrl->sahara_fw at probe time. + */ + if (info == &mhi_qcom_qdu100_info || + (info->name && !strcmp(info->name, "qcom-qdu100"))) + mhi_cntrl->sahara_fw = &qdu100_sahara_fw; + /* Have stored pci confspace at hand for restore in sudden PCI error. * cache the state locally and discard the PCI core one. */ -- 2.34.1