mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Val Packett <val@packett.cool>
To: Miquel Raynal <miquel.raynal@bootlin.com>,
	Junhao Xie <bigfoot@radxa.com>
Cc: Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konradybcio@kernel.org>,
	Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mtd@lists.infradead.org, Xilin Wu <sophon@radxa.com>
Subject: Re: [PATCH v2 0/2] mtd: devices: Qualcomm SCM storage support
Date: Fri, 13 Mar 2026 07:16:48 -0300	[thread overview]
Message-ID: <de081bdc-4b10-4cbe-9b09-4652b63bc4b9@packett.cool> (raw)
In-Reply-To: <87jywthpsj.fsf@bootlin.com>

On 2/3/26 11:20 AM, Miquel Raynal wrote:

>>>> For something like the "DPP" partition, I think it's better to access it
>>>> from userspace than from kernel.
>>> If it's a MAC address that you are accessing, direct userspace does not
>>> sound like a good fit. If I may, NVMEM cells are there exactly for this
>>> purpose: identifying the content of a subpart of a storage device in a
>>> storage agnostic way. The NVMEM cells are made available to in-kernel
>>> drivers (ie. network devices have all the infrastructure to get the MAC
>>> address from there) and their content is also exposed to userspace
>>> through sysfs now.
>> Qualcomm's SPI-NOR boot firmware uses a GPT partition table. The "DPP"
>> partition contains a FAT file system, and the MAC address is stored in
>> one of these files.
>>
>> Because the data is stored inside a filesystem rather than at a fixed
>> offset, it does not fit well with the NVMEM model, which assumes simple
>> offset-based access.
> Not anymore, there are nvmem layouts now that are much more
> flexible, so if a network driver shall get this MAC address, it is still
> doable.
>
> Otherwise there is no such need, and in the case of a file in a FAT
> filesystem, I guess it is preferable to use mtdblock/ubiblock in order
> to expose a block device and mount it from userspace.
>
> Please note that exposing a FAT filesystem on top of a SPI NOR is very
> inappropriate. FAT is a block filesystem, not aware of all the MTD
> specificities (like bad blocks).

FWIW there is an existing widely used solution (workaround?) for the MAC 
address: dtbloader reads the DPP partition in UEFI and applies the MAC 
address as a DT fixup.

https://github.com/TravMurav/dtbloader/blob/493e7e82025edddab29fe99c2b6ec566f6e01ac1/src/qcom.c#L260

(But this means that any dtbloader alternative such as the systemd UKI 
stub must also implement the same thing, which is not great.)

Reading that code, it does not seem to be a FAT filesystem exactly? It's 
something called "RWFS" where files have 49-char long names and a 
49-char "vendor" string field that's either "QCOM" or "OEM".


Also on the rare older devices that have SNOC WiFi/modem but NVMe 
storage —basically the Surface Pro X— the modem partitions need to be 
accessed from userspace (rmtfs) and they're stored on the NOR flash. 
Well, at least in the WiFi-only case even blank files are enough to 
replace them :) but for cellular I think the IMEI and stuff is there..


So this all sounds supremely annoying, we have a GPT partitioned flash 
where some specific partitions should be given to the WiFi&BT drivers 
(as nvmem cells?) but others should be accessible as mtdblock devices in 
userspace >_<


~val


  reply	other threads:[~2026-03-13 10:17 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-26 11:44 Junhao Xie
2026-01-26 11:44 ` [PATCH v2 1/2] firmware: qcom: scm: Add SCM storage interface support Junhao Xie
2026-01-28 13:39   ` Konrad Dybcio
2026-01-30 10:58     ` Junhao Xie
2026-01-26 11:44 ` [PATCH v2 2/2] mtd: devices: Add Qualcomm SCM storage driver Junhao Xie
2026-01-29 19:01   ` Miquel Raynal
2026-01-28 13:26 ` [PATCH v2 0/2] mtd: devices: Qualcomm SCM storage support Konrad Dybcio
2026-01-28 14:13   ` Miquel Raynal
2026-01-28 20:31     ` Bjorn Andersson
2026-01-29 18:38       ` Miquel Raynal
2026-01-29 13:05   ` Junhao Xie
2026-01-28 20:42 ` Bjorn Andersson
2026-01-30 13:39   ` Junhao Xie
2026-01-30 14:10     ` Miquel Raynal
2026-01-30 16:45       ` Junhao Xie
2026-02-03 14:20         ` Miquel Raynal
2026-03-13 10:16           ` Val Packett [this message]
2026-01-28 21:43 ` Trilok Soni
2026-01-29 12:47   ` Junhao Xie
2026-01-29 14:17     ` Konrad Dybcio

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=de081bdc-4b10-4cbe-9b09-4652b63bc4b9@packett.cool \
    --to=val@packett.cool \
    --cc=andersson@kernel.org \
    --cc=bigfoot@radxa.com \
    --cc=konradybcio@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=sophon@radxa.com \
    --cc=vigneshr@ti.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®