All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/15] qcom: smem: modernize SMEM in U-Boot
@ 2026-05-04 18:57 Casey Connolly
  2026-05-04 18:57 ` [PATCH v2 01/15] Revert "dm: SMEM (Shared memory) uclass" Casey Connolly
                   ` (15 more replies)
  0 siblings, 16 replies; 51+ messages in thread
From: Casey Connolly @ 2026-05-04 18:57 UTC (permalink / raw)
  To: u-boot, Sumit Garg, u-boot-qcom
  Cc: Tom Rini, Simon Glass, Casey Connolly, Peng Fan, Marek Vasut,
	Alice Guo, Quentin Schulz, Ilias Apalodimas, Neil Armstrong,
	Mattijs Korpershoek, Kuan-Wei Chiu, Raymond Mao, Stefan Roese,
	Philip Molloy, Jerome Forissier, Marek Vasut,
	Varadarajan Narayanan, Patrice Chotard, Aswin Murugan,
	Rasmus Villemoes, Heiko Schocher, Michal Simek, Sughosh Ganu,
	Antony Kurniawan Soemardi, Luca Weiss, Balaji Selvanathan

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 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.
- 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

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)


^ permalink raw reply	[flat|nested] 51+ messages in thread

end of thread, other threads:[~2026-05-21 13:36 UTC | newest]

Thread overview: 51+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.