From: Kishore Batta <kishore.batta@oss.qualcomm.com>
To: Jonathan Corbet <corbet@lwn.net>,
Shuah Khan <skhan@linuxfoundation.org>,
Jeff Hugo <jeff.hugo@oss.qualcomm.com>,
Carl Vanderlip <carl.vanderlip@oss.qualcomm.com>,
Oded Gabbay <ogabbay@kernel.org>,
Manivannan Sadhasivam <mani@kernel.org>,
Randy Dunlap <rdunlap@infradead.org>
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 <kishore.batta@oss.qualcomm.com>
Subject: [PATCH v8 4/7] bus: mhi: Add QDU100 Sahara variant and firmware fallback
Date: Mon, 12 Oct 2026 23:48:02 +0530 [thread overview]
Message-ID: <20261012-sahara_protocol_new_v2-v8-4-e12939d229a1@oss.qualcomm.com> (raw)
In-Reply-To: <20261012-sahara_protocol_new_v2-v8-0-e12939d229a1@oss.qualcomm.com>
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 <kishore.batta@oss.qualcomm.com>
---
drivers/bus/mhi/host/clients/sahara/sahara.c | 27 ++++++++++++++++--
drivers/bus/mhi/host/pci_generic.c | 41 ++++++++++++++++++++++++++++
2 files changed, 66 insertions(+), 2 deletions(-)
diff --git a/drivers/bus/mhi/host/clients/sahara/sahara.c b/drivers/bus/mhi/host/clients/sahara/sahara.c
index 74bf57f02873e463d0c2cfdd2673237840169df2..4baa47d0b94e326b5bfcaa80c8ddf008881c85c9 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 7193a384cca477be9e4f48cdf5f67e680ef55fc5..dcd49cd15074a20cab62a304143abbd0c0614cec 100644
--- a/drivers/bus/mhi/host/pci_generic.c
+++ b/drivers/bus/mhi/host/pci_generic.c
@@ -47,10 +47,12 @@
* of inband wake support (such as sdx24)
* @no_m3: M3 not supported
* @reset_on_remove: Set true for devices that require SoC during driver removal
+ * @sahara_fw: Sahara firmware mapping
*/
struct mhi_pci_dev_info {
const struct mhi_controller_config *config;
const struct mhi_controller_config *vf_config;
+ const struct mhi_sahara_fw_table *sahara_fw;
const char *name;
const char *fw;
const char *edl;
@@ -287,11 +289,49 @@ static const struct mhi_controller_config mhi_qcom_qdu100_config = {
.event_cfg = mhi_qcom_qdu100_events,
};
+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_pci_dev_info mhi_qcom_qdu100_info = {
.name = "qcom-qdu100",
.fw = "qcom/qdu100/xbl_s.melf",
.edl_trigger = true,
.config = &mhi_qcom_qdu100_config,
+ .sahara_fw = &qdu100_sahara_fw,
.bar_num = MHI_PCI_DEFAULT_BAR_NUM,
.dma_data_width = 32,
.vf_dma_data_width = 40,
@@ -1426,6 +1466,7 @@ static int mhi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
mhi_cntrl->runtime_put = mhi_pci_runtime_put;
mhi_cntrl->mru = info->mru_default;
mhi_cntrl->name = info->name;
+ mhi_cntrl->sahara_fw = info->sahara_fw;
mhi_pdev->no_m3 = info->no_m3;
--
2.34.1
next prev parent reply other threads:[~2026-10-12 18:18 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-12 18:17 [PATCH v8 0/7] Qualcomm Sahara protocol enhancements Kishore Batta
2026-10-12 18:17 ` [PATCH v8 1/7] Add documentation for Sahara protocol Kishore Batta
2026-10-12 18:18 ` [PATCH v8 2/7] bus: mhi: Move Sahara protocol driver under MHI host client drivers Kishore Batta
2026-10-12 20:43 ` Uwe Kleine-König
2026-10-12 21:35 ` Trilok Soni
2026-10-12 18:18 ` [PATCH v8 3/7] bus: mhi: Centralize Sahara firmware image table selection at probe time Kishore Batta
2026-10-12 18:18 ` Kishore Batta [this message]
2026-10-12 18:18 ` [PATCH v8 5/7] bus: mhi: Load DDR training data using device serial number Kishore Batta
2026-10-12 18:18 ` [PATCH v8 6/7] bus: mhi: Capture DDR training data via command mode Kishore Batta
2026-10-12 18:18 ` [PATCH v8 7/7] bus: mhi: Expose DDR training data via controller sysfs Kishore Batta
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261012-sahara_protocol_new_v2-v8-4-e12939d229a1@oss.qualcomm.com \
--to=kishore.batta@oss.qualcomm.com \
--cc=carl.vanderlip@oss.qualcomm.com \
--cc=corbet@lwn.net \
--cc=dri-devel@lists.freedesktop.org \
--cc=jeff.hugo@oss.qualcomm.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mani@kernel.org \
--cc=mhi@lists.linux.dev \
--cc=ogabbay@kernel.org \
--cc=rdunlap@infradead.org \
--cc=skhan@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®