U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Sumit Garg <sumit.garg@kernel.org>
To: Casey Connolly <casey.connolly@linaro.org>
Cc: u-boot@lists.denx.de, u-boot-qcom@groups.io,
	Tom Rini <trini@konsulko.com>, Simon Glass <sjg@chromium.org>,
	Peng Fan <peng.fan@nxp.com>,
	Marek Vasut <marek.vasut+renesas@mailbox.org>,
	Alice Guo <alice.guo@nxp.com>,
	Quentin Schulz <quentin.schulz@cherry.de>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Mattijs Korpershoek <mkorpershoek@kernel.org>,
	Kuan-Wei Chiu <visitorckw@gmail.com>,
	Raymond Mao <raymond.mao@riscstar.com>,
	Stefan Roese <stefan.roese@mailbox.org>,
	Philip Molloy <philip.molloy@analog.com>,
	Jerome Forissier <jerome.forissier@arm.com>,
	Marek Vasut <marek.vasut@mailbox.org>,
	Varadarajan Narayanan <varadarajan.narayanan@oss.qualcomm.com>,
	Patrice Chotard <patrice.chotard@foss.st.com>,
	Aswin Murugan <aswin.murugan@oss.qualcomm.com>,
	Rasmus Villemoes <ravi@prevas.dk>,
	Heiko Schocher <hs@nabladev.com>,
	Michal Simek <michal.simek@amd.com>,
	Sughosh Ganu <sughosh.ganu@arm.com>,
	Antony Kurniawan Soemardi <linux@smankusors.com>,
	Luca Weiss <luca.weiss@fairphone.com>,
	Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
Subject: Re: [PATCH v2 00/15] qcom: smem: modernize SMEM in U-Boot
Date: Tue, 5 May 2026 18:05:22 +0530	[thread overview]
Message-ID: <afnkCp5tN342zORz@sumit-xelite> (raw)
In-Reply-To: <21d5d2a1-e904-44b0-92c2-378035e158c0@linaro.org>

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@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@oss.qualcomm.com>
> > 
> > I will give a proper review to this series soon.
> 
> Thanks
> > 
> > -Sumit
> > 
> >> To: u-boot@lists.denx.de
> >> To: Sumit Garg <sumit.garg@kernel.org>
> >> To: u-boot-qcom@groups.io
> >> Cc: Tom Rini <trini@konsulko.com>
> >> Cc: Simon Glass <sjg@chromium.org>
> >> Cc: Casey Connolly <casey.connolly@linaro.org>
> >> Cc: Peng Fan <peng.fan@nxp.com>
> >> Cc: Marek Vasut <marek.vasut+renesas@mailbox.org>
> >> Cc: Alice Guo <alice.guo@nxp.com>
> >> Cc: Quentin Schulz <quentin.schulz@cherry.de>
> >> Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
> >> Cc: Neil Armstrong <neil.armstrong@linaro.org>
> >> Cc: Mattijs Korpershoek <mkorpershoek@kernel.org>
> >> Cc: Kuan-Wei Chiu <visitorckw@gmail.com>
> >> Cc: Raymond Mao <raymond.mao@riscstar.com>
> >> Cc: Stefan Roese <stefan.roese@mailbox.org>
> >> Cc: Philip Molloy <philip.molloy@analog.com>
> >> Cc: Jerome Forissier <jerome.forissier@arm.com>
> >> Cc: Marek Vasut <marek.vasut@mailbox.org>
> >> Cc: Varadarajan Narayanan <varadarajan.narayanan@oss.qualcomm.com>
> >> Cc: Patrice Chotard <patrice.chotard@foss.st.com>
> >> Cc: Aswin Murugan <aswin.murugan@oss.qualcomm.com>
> >> Cc: Rasmus Villemoes <ravi@prevas.dk>
> >> Cc: Heiko Schocher <hs@nabladev.com>
> >> Cc: Michal Simek <michal.simek@amd.com>
> >> Cc: Sughosh Ganu <sughosh.ganu@arm.com>
> >> Cc: Antony Kurniawan Soemardi <linux@smankusors.com>
> >> Cc: Luca Weiss <luca.weiss@fairphone.com>
> >> Cc: Balaji Selvanathan <balaji.selvanathan@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)
> 

      reply	other threads:[~2026-05-05 12:35 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-04 18:57 [PATCH v2 00/15] qcom: smem: modernize SMEM in U-Boot Casey Connolly
2026-05-04 18:57 ` [PATCH v2 01/15] Revert "dm: SMEM (Shared memory) uclass" Casey Connolly
2026-05-05 10:15   ` Sumit Garg
2026-05-07 15:31   ` Simon Glass
2026-05-07 20:05     ` Casey Connolly
2026-05-18 14:34   ` Neil Armstrong
2026-05-04 18:57 ` [PATCH v2 02/15] smem: drop drivers/smem Casey Connolly
2026-05-18 14:34   ` Neil Armstrong
2026-05-04 18:57 ` [PATCH v2 03/15] Revert "test: smem: add basic smem test" Casey Connolly
2026-05-05 10:26   ` Sumit Garg
2026-05-18 14:34   ` Neil Armstrong
2026-05-04 18:57 ` [PATCH v2 04/15] Revert "drivers: smem: sandbox" Casey Connolly
2026-05-05 10:26   ` Sumit Garg
2026-05-18 14:34   ` Neil Armstrong
2026-05-18 15:51   ` Fabio Estevam
2026-05-04 18:57 ` [PATCH v2 05/15] mach-snapdragon: fix reserved memory carveout Casey Connolly
2026-05-05 12:25   ` Sumit Garg
2026-05-05 12:39     ` Casey Connolly
2026-05-07  7:45       ` Sumit Garg
2026-05-07 20:29         ` Casey Connolly
2026-05-04 18:57 ` [PATCH v2 06/15] soc: qcom: import smem from Linux 6.11-rc2 Casey Connolly
2026-05-05 12:40   ` Sumit Garg
2026-05-05 12:45     ` Casey Connolly
2026-05-18 14:36   ` Neil Armstrong
2026-05-04 18:57 ` [PATCH v2 07/15] soc: qcom: smem: adjust headers for U-Boot Casey Connolly
2026-05-05 12:43   ` Sumit Garg
2026-05-18 14:36   ` Neil Armstrong
2026-05-04 18:57 ` [PATCH v2 08/15] soc: qcom: smem: adjust " Casey Connolly
2026-05-08 10:43   ` Aswin Murugan
2026-05-11 12:22     ` Casey Connolly
2026-05-18 11:03   ` Sumit Garg
2026-05-04 18:57 ` [PATCH v2 09/15] soc: qcom: smem: get serial number from socinfo Casey Connolly
2026-05-18 12:49   ` Sumit Garg
2026-05-04 18:57 ` [PATCH v2 10/15] soc: qcom: smem: stub functions Casey Connolly
2026-05-18 14:37   ` Neil Armstrong
2026-05-04 18:57 ` [PATCH v2 11/15] soc: qcom: smem: add build infra Casey Connolly
2026-05-18 12:53   ` Sumit Garg
2026-05-18 14:38   ` Neil Armstrong
2026-05-04 18:57 ` [PATCH v2 12/15] mach-snapdragon: move memory parsing to its own file Casey Connolly
2026-05-18 12:54   ` Sumit Garg
2026-05-18 14:40   ` Neil Armstrong
2026-05-04 18:57 ` [PATCH v2 13/15] mach-snapdragon: support parsing memory map from SMEM Casey Connolly
2026-05-18 14:48   ` Neil Armstrong
2026-05-21 13:36   ` Stephan Gerhold
2026-05-04 18:57 ` [PATCH v2 14/15] mach-snapdragon: fetch serial# " Casey Connolly
2026-05-18 13:15   ` Sumit Garg
2026-05-04 18:57 ` [PATCH v2 15/15] configs: add qcom_sm8650_defconfig and debug fragment Casey Connolly
2026-05-05  6:45   ` Luca Weiss
2026-05-05 10:11 ` [PATCH v2 00/15] qcom: smem: modernize SMEM in U-Boot Sumit Garg
2026-05-05 12:25   ` Casey Connolly
2026-05-05 12:35     ` Sumit Garg [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=afnkCp5tN342zORz@sumit-xelite \
    --to=sumit.garg@kernel.org \
    --cc=alice.guo@nxp.com \
    --cc=aswin.murugan@oss.qualcomm.com \
    --cc=balaji.selvanathan@oss.qualcomm.com \
    --cc=casey.connolly@linaro.org \
    --cc=hs@nabladev.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=jerome.forissier@arm.com \
    --cc=linux@smankusors.com \
    --cc=luca.weiss@fairphone.com \
    --cc=marek.vasut+renesas@mailbox.org \
    --cc=marek.vasut@mailbox.org \
    --cc=michal.simek@amd.com \
    --cc=mkorpershoek@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=patrice.chotard@foss.st.com \
    --cc=peng.fan@nxp.com \
    --cc=philip.molloy@analog.com \
    --cc=quentin.schulz@cherry.de \
    --cc=ravi@prevas.dk \
    --cc=raymond.mao@riscstar.com \
    --cc=sjg@chromium.org \
    --cc=stefan.roese@mailbox.org \
    --cc=sughosh.ganu@arm.com \
    --cc=trini@konsulko.com \
    --cc=u-boot-qcom@groups.io \
    --cc=u-boot@lists.denx.de \
    --cc=varadarajan.narayanan@oss.qualcomm.com \
    --cc=visitorckw@gmail.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