[PATCH v2 00/15] qcom: smem: modernize SMEM in U-Boot
Sumit Garg
sumit.garg at kernel.org
Tue May 5 14:35:22 CEST 2026
On Tue, May 05, 2026 at 02:25:01PM +0200, Casey Connolly wrote:
>
>
> On 05/05/2026 12:11, Sumit Garg wrote:
> > Hi Casey,
> >
> > Thanks for the much needed re-spin of the SMEM patch-set.
> >
> > On Mon, May 04, 2026 at 08:57:28PM +0200, Casey Connolly wrote:
> >> Smem is currently implemented a uclass in U-Boot. This carries with it
> >> some implicit limitations about how and when we can actually talk with
> >> it, since its modelled as a device.
> >>
> >> The SMEM uclass is qualcomm specific and has no other users, smem is
> >> also largely useful for parsing the memory map and other tasks which we
> >> have to do before DM is alive anyway.
> >>
> >> Let's drop the old smem code and replace it with a straight port from
> >> Linux, providing a familiar interface and enabling us to access it much
> >> earlier in the boot process than would be possible with a standard
> >> udevice.
> >>
> >> Additionally, this will be easier to maintain going forwards since any
> >> patches from Linux can be more easily ported over.
> >>
> >> With this new smem framework in place, we can now use SMEM to parse the
> >> memory map when it's not provided via some other mechanism and to read
> >> the serial number of the board.
> >>
> >> Implement this functionality and split the snapdragon memory parsing off
> >> to its own file to try and organise things a bit better.
> >>
> >> Since the memory map stored in SMEM doesn't already have some carveouts
> >> let's also be correct about unmapping reserved memory regions, we
> >> should eventually do this on all Qualcomm boards but it's particularly
> >> important when we aren't chainloading from ABL.
> >
> > This was really needed to unmap reserved regions in U-Boot memory map to
> > increase robustness.
>
> agreed, the ~100ms cost sucks but I hope we can bring it down by doing
> this after dcache enable if we can figure that out (would probably rely
> on starting with an initial minimal map to avoid the prefetcher issues)
> but yeah, a problem for the future for sure.
+1
>
> >
> >>
> >> This depends on a fix for unmapping memory regions: https://lore.kernel.org/u-boot/20260504175511.585797-1-casey.connolly@linaro.org/
> >>
> >> ---
> >> Changes in v2:
> >> - Ensure reserved regions are unmapped appropriately when using SMEM as
> >> the source of truth for the memory map.
> >> - Support SMEM ram layout v0/v1 for older platforms using a header from
> >> Qualcomm.
> >
> > It would be better if you can provide proper attribution in the commit
> > to which this header is being picked up.
>
> Where is the header sourced from? I can't really use another patch
> posting as a source.
I would have just mentioned the header to be contributed by:
Aswin Murugan <aswin.murugan at oss.qualcomm.com> in commit message.
>
> >
> >> - Set an environment variable (memmap_source) providing info about
> >> where U-Boots memory map is from.
> >> - Correctly handle serial_num missing on msm8916
> >> - Link to v1: https://lore.kernel.org/r/20241124-b4-modernise-smem-v1-0-b7852c11b67c@linaro.org
> >>
> >
> > FWIW, I tested this patch-set on RB3Gen2 and lemans-evk after dropping
> > the U-Boot DT overrides, so feel free to carry:
>
> Good to know! I assume you removed the hardcoded DT memorymap for testing?
Yeah I did drop the hardcoded DT memory map as you can see here [1].
Feel free to skip picking up DT memory override for Lemans EVK with this
series merged.
[1] https://github.com/qualcomm-linux/u-boot/pull/56
-Sumit
>
> >
> > Tested-by: Sumit Garg <sumit.garg at oss.qualcomm.com>
> >
> > I will give a proper review to this series soon.
>
> Thanks
> >
> > -Sumit
> >
> >> To: u-boot at lists.denx.de
> >> To: Sumit Garg <sumit.garg at kernel.org>
> >> To: u-boot-qcom at groups.io
> >> Cc: Tom Rini <trini at konsulko.com>
> >> Cc: Simon Glass <sjg at chromium.org>
> >> Cc: Casey Connolly <casey.connolly at linaro.org>
> >> Cc: Peng Fan <peng.fan at nxp.com>
> >> Cc: Marek Vasut <marek.vasut+renesas at mailbox.org>
> >> Cc: Alice Guo <alice.guo at nxp.com>
> >> Cc: Quentin Schulz <quentin.schulz at cherry.de>
> >> Cc: Ilias Apalodimas <ilias.apalodimas at linaro.org>
> >> Cc: Neil Armstrong <neil.armstrong at linaro.org>
> >> Cc: Mattijs Korpershoek <mkorpershoek at kernel.org>
> >> Cc: Kuan-Wei Chiu <visitorckw at gmail.com>
> >> Cc: Raymond Mao <raymond.mao at riscstar.com>
> >> Cc: Stefan Roese <stefan.roese at mailbox.org>
> >> Cc: Philip Molloy <philip.molloy at analog.com>
> >> Cc: Jerome Forissier <jerome.forissier at arm.com>
> >> Cc: Marek Vasut <marek.vasut at mailbox.org>
> >> Cc: Varadarajan Narayanan <varadarajan.narayanan at oss.qualcomm.com>
> >> Cc: Patrice Chotard <patrice.chotard at foss.st.com>
> >> Cc: Aswin Murugan <aswin.murugan at oss.qualcomm.com>
> >> Cc: Rasmus Villemoes <ravi at prevas.dk>
> >> Cc: Heiko Schocher <hs at nabladev.com>
> >> Cc: Michal Simek <michal.simek at amd.com>
> >> Cc: Sughosh Ganu <sughosh.ganu at arm.com>
> >> Cc: Antony Kurniawan Soemardi <linux at smankusors.com>
> >> Cc: Luca Weiss <luca.weiss at fairphone.com>
> >> Cc: Balaji Selvanathan <balaji.selvanathan at oss.qualcomm.com>
> >>
> >> ---
> >> Casey Connolly (15):
> >> Revert "dm: SMEM (Shared memory) uclass"
> >> smem: drop drivers/smem
> >> Revert "test: smem: add basic smem test"
> >> Revert "drivers: smem: sandbox"
> >> mach-snapdragon: fix reserved memory carveout
> >> soc: qcom: import smem from Linux 6.11-rc2
> >> soc: qcom: smem: adjust headers for U-Boot
> >> soc: qcom: smem: adjust for U-Boot
> >> soc: qcom: smem: get serial number from socinfo
> >> soc: qcom: smem: stub functions
> >> soc: qcom: smem: add build infra
> >> mach-snapdragon: move memory parsing to its own file
> >> mach-snapdragon: support parsing memory map from SMEM
> >> mach-snapdragon: fetch serial# from SMEM
> >> configs: add qcom_sm8650_defconfig and debug fragment
> >>
> >> MAINTAINERS | 1 -
> >> arch/arm/Kconfig | 3 +-
> >> arch/arm/mach-snapdragon/Makefile | 2 +-
> >> arch/arm/mach-snapdragon/board.c | 253 ++++-----
> >> arch/arm/mach-snapdragon/dram.c | 239 ++++++++
> >> arch/arm/mach-snapdragon/qcom-priv.h | 17 +
> >> arch/arm/mach-snapdragon/rampart.h | 194 +++++++
> >> arch/sandbox/dts/test.dts | 4 -
> >> board/qualcomm/debug-sm8650.config | 5 +
> >> configs/qcom_sm8650_defconfig | 16 +
> >> configs/sandbox64_defconfig | 2 -
> >> configs/sandbox_defconfig | 2 -
> >> drivers/Kconfig | 2 -
> >> drivers/Makefile | 1 -
> >> drivers/smem/Kconfig | 25 -
> >> drivers/smem/Makefile | 7 -
> >> drivers/smem/sandbox_smem.c | 44 --
> >> drivers/smem/smem-uclass.c | 46 --
> >> drivers/soc/qcom/Kconfig | 8 +
> >> drivers/soc/qcom/Makefile | 1 +
> >> drivers/{smem/msm_smem.c => soc/qcom/smem.c} | 777 ++++++++++++++++-----------
> >> include/dm/uclass-id.h | 1 -
> >> include/smem.h | 90 ----
> >> include/soc/qcom/smem.h | 36 ++
> >> include/soc/qcom/socinfo.h | 111 ++++
> >> test/dm/Makefile | 1 -
> >> test/dm/smem.c | 26 -
> >> 27 files changed, 1186 insertions(+), 728 deletions(-)
> >> ---
> >> base-commit: 2920b49fb117dd70b6219804bf0d298c96f184f2
> >>
> >> // Casey (she/they)
> >>
>
> --
> // Casey (she/her)
>
More information about the U-Boot
mailing list