From: Qiang Yu <qiang.yu@oss.qualcomm.com>
To: Manivannan Sadhasivam <mani@kernel.org>
Cc: mhi@lists.linux.dev, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org,
Mayank Rana <mayank.rana@oss.qualcomm.com>,
Baochen Qiang <quic_bqiang@quicinc.com>
Subject: Re: [PATCH v4] mhi: host: Add support for dual ELF image format
Date: Tue, 23 Dec 2025 18:25:01 -0800 [thread overview]
Message-ID: <aUtO/UOSjQM8gNab@hu-qianyu-lv.qualcomm.com> (raw)
In-Reply-To: <a5obqgu6swi7eq2j2n2655twn4aw2muzkrr5txmbg2qdfzs36y@7v6maj5pdw6c>
On Tue, Dec 23, 2025 at 04:45:50PM +0530, Manivannan Sadhasivam wrote:
> On Tue, Dec 23, 2025 at 01:16:46AM -0800, Qiang Yu wrote:
> > From: Mayank Rana <mayank.rana@oss.qualcomm.com>
> >
> > Currently, the FBC image contains a single ELF header followed by segments
> > for both SBL and WLAN FW. However, TME-L (Trust Management Engine Lite)
> > supported devices (e.g., QCC2072) require separate ELF headers for SBL and
> > WLAN FW segments due to TME-L image authentication requirements.
> >
> > Current image format contains two sections in a single binary:
> > - First 512KB: ELF header + SBL segments
> > - Remaining: WLAN FW segments (raw data)
> >
> > The TME-L supported image format contains two complete ELF files in a
> > single binary:
> > - First 512KB: Complete SBL ELF file (ELF header + SBL segments)
> > - Remaining: Complete WLAN FW ELF file (ELF header + WLAN FW segments)
> >
> > Download behavior:
> > - Legacy: 1. First 512KB via BHI (ELF header + SBL)
> > 2. Full image via BHIe
> >
> > - TME-L: 1. First 512KB via BHI (SBL ELF file)
> > 2. Remaining via BHIe (WLAN FW ELF file only)
> >
> > Add runtime detection to automatically identify the image format by
> > checking for the presence of a second ELF header at the 512KB boundary.
> > When detected, MHI skips the first 512KB during WLAN FW download over BHIe
> > as it is loaded in BHI phase.
> >
> > Reviewed-by: Baochen Qiang <quic_bqiang@quicinc.com>
> > Signed-off-by: Mayank Rana <mayank.rana@oss.qualcomm.com>
> > Co-developed-by: Qiang Yu <qiang.yu@oss.qualcomm.com>
> > Signed-off-by: Qiang Yu <qiang.yu@oss.qualcomm.com>
>
> This version is not anyway close to the previous one. So all the tags from
> Mayank and Baochen are irrelevant.
Ohk, let me remove invalid tags and post patch v5.
- Qiang Yu
>
> - Mani
>
> > ---
> > Changes in v4:
> > - Detect image format runtime by checking second ELF header instead of using a flag.
> > - Link to v3: https://lore.kernel.org/r/20251201-wlan_image_load_skip_512k-v3-1-bedb5498a58a@oss.qualcomm.com
> >
> > Changes in v3:
> > - Reword commit message.
> > - Reword comments of standard_elf_image flag
> > - Add reviewed-by tag.
> > - Link to v2: https://lore.kernel.org/mhi/20250603-standard_elf_image_load_support-v2-1-cce97644e99e@oss.qualcomm.com/
> >
> > Changes in v2:
> > - V1 patch is paused because of no user. WLAN team plan to add support for
> > new WLAN chip that requires this patch, so send v2.
> > - Change author and SOB with new mail address.
> > - Reword commit message.
> > - Place standard_elf_image flag after wake_set in struct mhi_controller
> > - Link to v1: https://lore.kernel.org/mhi/1689907189-21844-1-git-send-email-quic_qianyu@quicinc.com/
> > ---
> > drivers/bus/mhi/host/boot.c | 11 +++++++++++
> > 1 file changed, 11 insertions(+)
> >
> > diff --git a/drivers/bus/mhi/host/boot.c b/drivers/bus/mhi/host/boot.c
> > index 205d83ac069f15a19ab2d66a63692e5d60334d4c..6ba0f16854d3a839e987f19d782600467b5f9836 100644
> > --- a/drivers/bus/mhi/host/boot.c
> > +++ b/drivers/bus/mhi/host/boot.c
> > @@ -584,6 +584,17 @@ void mhi_fw_load_handler(struct mhi_controller *mhi_cntrl)
> > * device transitioning into MHI READY state
> > */
> > if (fw_load_type == MHI_FW_LOAD_FBC) {
> > +
> > + /*
> > + * Some FW combine two separate ELF images (SBL + WLAN FW) in a single
> > + * file. Hence, check for the existence of the second ELF header after
> > + * SBL. If present, load the second image separately.
> > + */
> > + if (!memcmp(fw_data + mhi_cntrl->sbl_size, ELFMAG, SELFMAG)) {
> > + fw_data += mhi_cntrl->sbl_size;
> > + fw_sz -= mhi_cntrl->sbl_size;
> > + }
> > +
> > ret = mhi_alloc_bhie_table(mhi_cntrl, &mhi_cntrl->fbc_image, fw_sz);
> > if (ret) {
> > release_firmware(firmware);
> >
> > ---
> > base-commit: ac35e04f8000aaaf98635792464647e7a6f3422e
> > change-id: 20251129-wlan_image_load_skip_512k-ddcfe49db8e3
> >
> > Best regards,
> > --
> > Qiang Yu <qiang.yu@oss.qualcomm.com>
> >
>
> --
> மணிவண்ணன் சதாசிவம்
prev parent reply other threads:[~2025-12-24 2:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-23 9:16 Qiang Yu
2025-12-23 11:15 ` Manivannan Sadhasivam
2025-12-24 2:25 ` Qiang Yu [this message]
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=aUtO/UOSjQM8gNab@hu-qianyu-lv.qualcomm.com \
--to=qiang.yu@oss.qualcomm.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mani@kernel.org \
--cc=mayank.rana@oss.qualcomm.com \
--cc=mhi@lists.linux.dev \
--cc=quic_bqiang@quicinc.com \
/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®