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>
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 v3 0/9] Qualcomm Sahara protocol enhancements.
Date: Tue, 10 Mar 2026 12:51:57 +0530 [thread overview]
Message-ID: <20260310-sahara_protocol_new_v2-v3-0-994ea4b0d5ad@oss.qualcomm.com> (raw)
Hi All,
This series reworks the Sahara protocol driver to make it reusable for
multiple MHI based devices and adds support for capturing, restoring and
exposing DDR training data using the Sahara command mode.
The Sahara protocol is transported over the MHI bus and is used by multiple
flashless devices to transfer firmware images, retrieve memory dumps and
exchange command mode data during early boot. However, the current
implementation lives under the QAIC accelerator driver and contains
device-specific assumptions that limit reuse.
Some MHI devices (for example, QDU100) expose the sahara protocol directly
on a "SAHARA" MHI channel and rely on command mode to exchange DDR training
data with the host. The existing driver does not bind to such devices and
ignores Sahara command mode packets, causing training data to be dropped.
This series addresses these issues by relocating the Sahara driver to the
MHI subsystem, centralizing device specific configuration and adding command
mode handling for DDR training data.
Overview of the changes in this series -
1. Move Sahara under the MHI subsystem:
a. Relocate the sahara protocol driver from QAIC accelerator tree to
drivers/bus/mhi.
b. Register Sahara as an independent MHI protocol driver.
2. Generalize device matching and configuration
a. Allow the driver to bind to devices exposing the protocol on a
SAHARA MHI channel.
b. Centralize firmware image table selection at probe time using a variant
table, instead of scattered conditionals.
c. Preserve existing behavior on AIC devices.
3. Add QDU100 firmware image table support
a. Add a QDU100 image table and select it based on the matched MHI channel.
b. No separate client driver or registration mechanism is required.
4. Add Sahara command mode support for DDR training.
a. Handle command mode packets(CMD_READY, EXECUTE, EXECUTE_DATA).
b. Query supported commands and retrieve DDR training data from the device.
c. Allocate receive buffers based on the reported payload size and copy
raw data from the MHI DL.
d. Store training data in controller-scoped memory using devres so it
survives sahara channel teardown.
5. Expose DDR training data to userspace
a. Add a read-only binary sysfs attribute under the MHI controller device.
b. The attribute reads directly from controller-scoped storage and remains
available after the Sahara channel device is removed.
c. Cleanup is handled automatically via device-managed resources.
6. Document the sysfs ABI
a. Add ABI documentation describing the DDR training data sysfs node.
Signed-off-by: Kishore Batta <kishore.batta@oss.qualcomm.com>
---
Changes in v3:
- Dropped the explicit image table entry for the boot critical image ID and
added a generic image ID based firmware lookup fallback.
- Link to v2: https://lore.kernel.org/r/20260307-sahara_protocol_new_v2-v2-0-29dc748b5e9c@oss.qualcomm.com
Changes in v2:
- Rebased onto latest linux-next tip.
- Reworked commit messages to clearly start with the problem being solved and
end with a technical description of the change.
- Moved the Sahara driver to drivers/bus/mhi instead of drivers/soc/qcom,
reflecting that its an MHI protocol driver rather than a SoC specific driver.
- Removed client side image table registration and consolidated firmware
selection directly in the sahara driver using a probe-time variant
mechanism.
- Ensured each patch is self-contained and does not break the build or runtime
behavior at any intermediate point.
- Simplified state handling and lifetime management to avoid duplicated state
tracking and ad-hoc cleanup.
- Updated sysfs handling to use controller-scoped devres and avoid one-shot
reads or manual teardown.
- Link to v1: https://lore.kernel.org/r/20250825101926.2160554-1-kishore.batta@oss.qualcomm.com
---
Kishore Batta (9):
Add documentation for Sahara protocol.
bus: mhi: Move sahara protocol driver under drivers/bus/mhi
bus: mhi: Match devices exposing the protocol on the SAHARA channel
bus: mhi: Centralize firmware image table selection at probe time
bus: mhi: Add QDU100 variant and image_id firmware fallback
bus: mhi: Load DDR training data using per-device serial number
bus: mhi: Capture DDR training data using command mode
bus: mhi: Expose DDR training data via controller sysfs
Documentation: ABI: Add sysfs ABI documentation for DDR training data
.../ABI/testing/sysfs-bus-mhi-ddr_training_data | 19 +
Documentation/sahara/index.rst | 14 +
Documentation/sahara/sahara_protocol.rst | 1241 ++++++++++++++++++++
drivers/accel/qaic/Kconfig | 1 +
drivers/accel/qaic/Makefile | 3 +-
drivers/accel/qaic/qaic_drv.c | 11 +-
drivers/bus/mhi/Kconfig | 1 +
drivers/bus/mhi/Makefile | 3 +
drivers/bus/mhi/sahara/Kconfig | 18 +
drivers/bus/mhi/sahara/Makefile | 2 +
drivers/{accel/qaic => bus/mhi/sahara}/sahara.c | 601 +++++++++-
{drivers/accel/qaic => include/linux}/sahara.h | 0
12 files changed, 1869 insertions(+), 45 deletions(-)
---
base-commit: a0ae2a256046c0c5d3778d1a194ff2e171f16e5f
change-id: 20260307-sahara_protocol_new_v2-662854773cf7
Best regards,
--
Kishore Batta <kishore.batta@oss.qualcomm.com>
next reply other threads:[~2026-03-10 7:22 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-10 7:21 Kishore Batta [this message]
2026-03-10 7:21 ` [PATCH v3 1/9] Add documentation for Sahara protocol Kishore Batta
2026-03-11 3:35 ` Claude review: " Claude Code Review Bot
2026-03-10 7:21 ` [PATCH v3 2/9] bus: mhi: Move sahara protocol driver under drivers/bus/mhi Kishore Batta
2026-03-11 3:35 ` Claude review: " Claude Code Review Bot
2026-03-10 7:22 ` [PATCH v3 3/9] bus: mhi: Match devices exposing the protocol on the SAHARA channel Kishore Batta
2026-03-11 3:35 ` Claude review: " Claude Code Review Bot
2026-03-10 7:22 ` [PATCH v3 4/9] bus: mhi: Centralize firmware image table selection at probe time Kishore Batta
2026-03-11 3:35 ` Claude review: " Claude Code Review Bot
2026-03-10 7:22 ` [PATCH v3 5/9] bus: mhi: Add QDU100 variant and image_id firmware fallback Kishore Batta
2026-03-11 3:35 ` Claude review: " Claude Code Review Bot
2026-03-10 7:22 ` [PATCH v3 6/9] bus: mhi: Load DDR training data using per-device serial number Kishore Batta
2026-03-11 3:35 ` Claude review: " Claude Code Review Bot
2026-03-10 7:22 ` [PATCH v3 7/9] bus: mhi: Capture DDR training data using command mode Kishore Batta
2026-03-11 3:35 ` Claude review: " Claude Code Review Bot
2026-03-10 7:22 ` [PATCH v3 8/9] bus: mhi: Expose DDR training data via controller sysfs Kishore Batta
2026-03-11 3:35 ` Claude review: " Claude Code Review Bot
2026-03-10 7:22 ` [PATCH v3 9/9] Documentation: ABI: Add sysfs ABI documentation for DDR training data Kishore Batta
2026-03-11 3:35 ` Claude review: " Claude Code Review Bot
2026-03-11 3:35 ` Claude review: Qualcomm Sahara protocol enhancements Claude Code Review Bot
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=20260310-sahara_protocol_new_v2-v3-0-994ea4b0d5ad@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=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