From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0DC2EFF885A for ; Tue, 5 May 2026 12:35:41 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 89438848BB; Tue, 5 May 2026 14:35:39 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="YjMZo5IG"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7E10B848DC; Tue, 5 May 2026 14:35:38 +0200 (CEST) Received: from sea.source.kernel.org (sea.source.kernel.org [IPv6:2600:3c0a:e001:78e:0:1991:8:25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 9A0F2848B7 for ; Tue, 5 May 2026 14:35:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sumit.garg@kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id E5AD74080D; Tue, 5 May 2026 12:35:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2E2FFC2BCB4; Tue, 5 May 2026 12:35:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777984533; bh=ztsPfB9MqjHOiPmRR9Wi9ML+D6gR6k8/f/o7UtfwgZo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YjMZo5IGkffaxBCsuZXMvtlB732n62YV6zCf/Clg045RtVk8SYYvGdFOl1jFzwobi bcqBLA6pf/bxZhPJbvNcckaStnnRoUnjcCfyeOiKQmfPI1Zh/eiJuOPZycLcx/c5HU sIx2BTtpYxd4WtWgSnrTTwiMhpsfQrWVxAuFhSfu+R2YqdCtz3H3j30bz6/WdZimeY oDzM0RexupABvNaNMcU+3MVEiK83sNu46Qy2CCACIiCSWWOP5F8pKPDtHhIJI8U7sD Ttich0b1Yf2Nh4Urz/tADlCSOGWrNguKb3l7nYJPQD4glRNWrLKtm5iHg0WHwgxPnk l1Oyc57wY1FRw== Date: Tue, 5 May 2026 18:05:22 +0530 From: Sumit Garg To: Casey Connolly Cc: u-boot@lists.denx.de, u-boot-qcom@groups.io, Tom Rini , Simon Glass , 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 Subject: Re: [PATCH v2 00/15] qcom: smem: modernize SMEM in U-Boot Message-ID: References: <20260504-b4-modernise-smem-v2-0-c01ec2ff3886@linaro.org> <21d5d2a1-e904-44b0-92c2-378035e158c0@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <21d5d2a1-e904-44b0-92c2-378035e158c0@linaro.org> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean 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 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 > > > > I will give a proper review to this series soon. > > Thanks > > > > -Sumit > > > >> To: u-boot@lists.denx.de > >> To: Sumit Garg > >> To: u-boot-qcom@groups.io > >> Cc: Tom Rini > >> Cc: Simon Glass > >> Cc: Casey Connolly > >> Cc: Peng Fan > >> Cc: Marek Vasut > >> Cc: Alice Guo > >> Cc: Quentin Schulz > >> Cc: Ilias Apalodimas > >> Cc: Neil Armstrong > >> Cc: Mattijs Korpershoek > >> Cc: Kuan-Wei Chiu > >> Cc: Raymond Mao > >> Cc: Stefan Roese > >> Cc: Philip Molloy > >> Cc: Jerome Forissier > >> Cc: Marek Vasut > >> Cc: Varadarajan Narayanan > >> Cc: Patrice Chotard > >> Cc: Aswin Murugan > >> Cc: Rasmus Villemoes > >> Cc: Heiko Schocher > >> Cc: Michal Simek > >> Cc: Sughosh Ganu > >> Cc: Antony Kurniawan Soemardi > >> Cc: Luca Weiss > >> Cc: Balaji Selvanathan > >> > >> --- > >> 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) >