{"id":2223980,"url":"http://patchwork.ozlabs.org/api/patches/2223980/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/20260416053928.2834699-8-varadarajan.narayanan@oss.qualcomm.com/","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/projects/18/?format=json","name":"U-Boot","link_name":"uboot","list_id":"u-boot.lists.denx.de","list_email":"u-boot@lists.denx.de","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260416053928.2834699-8-varadarajan.narayanan@oss.qualcomm.com>","list_archive_url":null,"date":"2026-04-16T05:39:25","name":"[v3,07/10] mach-snapdragon: spl: Update SMEM with boot details","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"239a1264adca43a8e6ee85c74b81595709bbe6d1","submitter":{"id":92283,"url":"http://patchwork.ozlabs.org/api/people/92283/?format=json","name":"Varadarajan Narayanan","email":"varadarajan.narayanan@oss.qualcomm.com"},"delegate":{"id":151538,"url":"http://patchwork.ozlabs.org/api/users/151538/?format=json","username":"kcxt","first_name":"Casey","last_name":"Connolly","email":"casey.connolly@linaro.org"},"mbox":"http://patchwork.ozlabs.org/project/uboot/patch/20260416053928.2834699-8-varadarajan.narayanan@oss.qualcomm.com/mbox/","series":[{"id":500162,"url":"http://patchwork.ozlabs.org/api/series/500162/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/list/?series=500162","date":"2026-04-16T05:39:18","name":"Qualcomm IPQ5210 SoC bringup","version":3,"mbox":"http://patchwork.ozlabs.org/series/500162/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2223980/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2223980/checks/","tags":{},"related":[],"headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256\n header.s=qcppdkim1 header.b=KsbOpug6;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com\n header.a=rsa-sha256 header.s=google header.b=XLYHJmo8;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=none (p=none dis=none) header.from=oss.qualcomm.com","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=qualcomm.com header.i=@qualcomm.com\n header.b=\"KsbOpug6\";\n\tdkim=pass (2048-bit key;\n unprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com\n header.b=\"XLYHJmo8\";\n\tdkim-atps=neutral","phobos.denx.de; dmarc=none (p=none dis=none)\n header.from=oss.qualcomm.com","phobos.denx.de; spf=pass\n smtp.mailfrom=varadarajan.narayanan@oss.qualcomm.com"],"Received":["from phobos.denx.de (phobos.denx.de\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fxJTf1JCzz1yHP\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 16 Apr 2026 23:17:42 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 1F56684286;\n\tThu, 16 Apr 2026 15:16:31 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id CCA9E83C2B; Thu, 16 Apr 2026 07:41:10 +0200 (CEST)","from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com\n [205.220.168.131])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 1CD5583EEF\n for <u-boot@lists.denx.de>; Thu, 16 Apr 2026 07:41:07 +0200 (CEST)","from pps.filterd (m0279866.ppops.net [127.0.0.1])\n by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 63G0ckom2834976\n for <u-boot@lists.denx.de>; Thu, 16 Apr 2026 05:41:06 GMT","from mail-pf1-f199.google.com (mail-pf1-f199.google.com\n [209.85.210.199])\n by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4djcsvjepv-1\n (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)\n for <u-boot@lists.denx.de>; Thu, 16 Apr 2026 05:41:05 +0000 (GMT)","by mail-pf1-f199.google.com with SMTP id\n d2e1a72fcca58-82d40278103so5136738b3a.2\n for <u-boot@lists.denx.de>; Wed, 15 Apr 2026 22:41:05 -0700 (PDT)","from hu-varada-blr.qualcomm.com\n (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com. [103.229.18.19])\n by smtp.gmail.com with ESMTPSA id\n d2e1a72fcca58-82f673e3824sm3994496b3a.34.2026.04.15.22.40.53\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 15 Apr 2026 22:41:03 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,\n RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED,\n SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2","DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=\n content-transfer-encoding:date:from:in-reply-to:message-id\n :mime-version:references:subject:to; s=qcppdkim1; bh=Lv1P0/yL5AB\n 15QHy9SMaLAFfhONrUt+3yf2vSVWO3lo=; b=KsbOpug6M5kT3G0GaYuMIwgtbQH\n S8RGZFZrd7sZesGBVCRXFJ6uD4KGeK9pb4H29zortJEQMzTu4zMU+OIBmr0dLwxY\n 5XbMpjPAOd0t3qSxNbd+9Pv3U0fQXLQxgZkoNRSDfnk6NsJsznW+8m1YYASgM44l\n d5JbbxqQ1NTphztZ2URoJqacOz2Xxxn3z6j3bYsSrqmKOWL2cXYfO59LQGv77Yz5\n TMtgnEWliSwlnrEXl7vEApbFSl+UDTC7sv/ErtldRAzWEFMCQlF/fi+KoRgO7H8b\n 2D2RwtYBjfJC5OGp3C23weyCfGTg21LoQz+c4FDz8yfdQMrdm1oiIOcau1g==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=oss.qualcomm.com; s=google; t=1776318065; x=1776922865; darn=lists.denx.de;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:to:from:from:to:cc:subject:date:message-id\n :reply-to; bh=Lv1P0/yL5AB15QHy9SMaLAFfhONrUt+3yf2vSVWO3lo=;\n b=XLYHJmo8Qa97sH+XG19t4TyUIeSESgkCmTt7tnmVl6GfYWy1k281pR1nobVkr8zMMK\n 7rWEI6WrOJRcVZupD7nmdSOdHJVvzkb7JbpxwWxhPbZ0wcGGgJlHpNY+pRxdHT6PMC1l\n iLqS3YYAv8DYozRVEc33dnj/IXtdkn68nGoAgHQ31yjV9fPrWnUVENaEHXHAtKo/X0dp\n H8O15LzKU5Lcxff4YkWMOoCL3HGbEhxOYWvfhVBrVl0Tg7UW3NPv5Aa44l6jcGrpi3G3\n Qqi53HZxvwhKYlW8WcDP0u0lhmauDt467Q+kpLfHlsqWccG/ZmVp5lZt1IIcRTXAi2KA\n 4osw=="],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776318065; x=1776922865;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to\n :cc:subject:date:message-id:reply-to;\n bh=Lv1P0/yL5AB15QHy9SMaLAFfhONrUt+3yf2vSVWO3lo=;\n b=VZFWripxtGiMO1q61wwZiXNt5hH7+zUzqJEO81RbwOV4hcAm+G8NJUKjzgXMt2B5DL\n bc0TFTbf+/+yUYA8wtGdnHHXyKFoHS+HCpJsADdgWzlmFzoR1yfpivubmjl9sff0/Lbz\n YycKx/mivv/xvqJO3zChKectGY84AJUajHoZdvLCPBiGTqjus0pWgb9+DvgqQo7+3mqG\n FH+Ze5/BYd04xsAViPiXgPksV6uj9cHnWcc/7k9Yfc8lh4vYNTrlMeyvBiRPd48Hw3qo\n +DUCCqPOE2Vix/0fLfFiV+0FOP8idlVJL0/E3Lgx9reSbB+lq2LnGpufhCnohaY99z1e\n FM3g==","X-Forwarded-Encrypted":"i=1;\n AFNElJ8VwgaNhExteVy3iLhR42CwTK8U0LjRq7CvSuBK7nP5TWaxkGC0BaRsH2jplKUkzLupTooLv3c=@lists.denx.de","X-Gm-Message-State":"AOJu0YzKZCGLINhO9mjyCnmZq3dtblGo3GvvlXngnp2AqvmyZyx5fuTw\n DElqj9ZywiTM53y2kVN+I1FPGRp/bjNlV6FxlcyLHFQF+YcmU+d+xAwRfdJ1G84Bj3/rTvLl9DB\n wTS+OIiGrV3uzFaF2SVIBSyq5Jsv10l31ciSUJxFlgmODqxeR8u8+XAEv","X-Gm-Gg":"AeBDievUvsN3IMj9aYOimGlB2npfJyiJHPnWJWZp91SaOpuU9GZPFLXqlquW9Nk5cjI\n P0g3vr4pDgPOJgxyt0ckdNZ1Rh4gu8W+8kg+99G4+0tbhiiaLdH8X5371LhDfhMST1Tm6WC8r01\n 3sh08Q5abK9o6t5RoJwry8neR2PSQmnfS06q3CPUvpm+NaIlK2uY/n+HpEWVMk4zqwCAEeAvVGJ\n 1zndzQ1YUKtyrvV/+XaXJ70yfRnJfrMxTSIqJtALqxaNYEAlV6DaGW3zaZPIx4BMTNgkmHbrO42\n DvqTOX7Qv6QlGoCfbI4GarxTyB0z3EPopGx6PgkjGGhIOosnqSNFRb3r5Plj7a1lXicc6ZgL3u0\n OtWKDCV9XquwnlUvyqVHUM+O5OKXgGJe/TTxEncF+mf+pbe1ugzkaMcEWwu/8jpfLBaVuQv/ScP\n 6bLC9KCdJW1oth6q0X8hT+tG5k3af/Mmn0qDKbbxYwL2Rhi5hOiGo=","X-Received":["by 2002:a05:6a00:3e13:b0:82f:24e:6a50 with SMTP id\n d2e1a72fcca58-82f0c26b7a9mr25861123b3a.10.1776318064691;\n Wed, 15 Apr 2026 22:41:04 -0700 (PDT)","by 2002:a05:6a00:3e13:b0:82f:24e:6a50 with SMTP id\n d2e1a72fcca58-82f0c26b7a9mr25861047b3a.10.1776318064049;\n Wed, 15 Apr 2026 22:41:04 -0700 (PDT)"],"From":"Varadarajan Narayanan <varadarajan.narayanan@oss.qualcomm.com>","To":"rayagonda.kokatanur@broadcom.com, trini@konsulko.com,\n casey.connolly@linaro.org, neil.armstrong@linaro.org,\n sumit.garg@kernel.org, peng.fan@nxp.com, jh80.chung@samsung.com,\n lukma@denx.de, tien.fong.chee@altera.com, tingting.meng@altera.com,\n anshuld@ti.com, alif.zakuan.yuslaimi@altera.com, alice.guo@nxp.com,\n quentin.schulz@cherry.de, ilias.apalodimas@linaro.org,\n varadarajan.narayanan@oss.qualcomm.com, sjg@chromium.org,\n mkorpershoek@kernel.org, h-salunke@ti.com, alchark@gmail.com,\n dario.binacchi@amarulasolutions.com, ye.li@nxp.com,\n andre.przywara@arm.com, dinesh.maniyam@altera.com,\n luca.weiss@fairphone.com, danila@jiaxyga.com,\n aswin.murugan@oss.qualcomm.com, balaji.selvanathan@oss.qualcomm.com,\n adrian@mainlining.org, n-francis@ti.com, wens@kernel.org,\n jamie.gibbons@microchip.com, justin@tidylabs.net,\n ycliang@andestech.com, david.wronek@mainlining.org,\n james.hilliard1@gmail.com, richard.genoud@bootlin.com,\n michael@amarulasolutions.com, philip.molloy@analog.com,\n sughosh.ganu@arm.com, u-boot@lists.denx.de, u-boot-qcom@groups.io","Subject":"[PATCH v3 07/10] mach-snapdragon: spl: Update SMEM with boot details","Date":"Thu, 16 Apr 2026 11:09:25 +0530","Message-Id":"<20260416053928.2834699-8-varadarajan.narayanan@oss.qualcomm.com>","X-Mailer":"git-send-email 2.34.1","In-Reply-To":"<20260416053928.2834699-1-varadarajan.narayanan@oss.qualcomm.com>","References":"<20260416053928.2834699-1-varadarajan.narayanan@oss.qualcomm.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-Proofpoint-GUID":"E2dk5_JB-7QOlQYU-0HmQlZc0IMpjpS4","X-Proofpoint-Spam-Details-Enc":"AW1haW4tMjYwNDE2MDA1MSBTYWx0ZWRfX+KES2qBdEHye\n SKDtO79ASotg+AeO+xaFj3J/ZfVa7chsGqrU3lF0PTcQMXpGePrNKd9Bh6XtH3tC0IEZQ0Cmal2\n VZqrThXzV3xekCkXrYpNA6rKyUvqA2DAzC+6bdDtyCJJjebIX0A+vQuinI014ZaRgb8pUp2m4x3\n F5D3Mvvu6WKFOtMZhTyi3SFmhWQCVsTU7AvT0FSoUoOqngDg7xnM7GTSc1k6GFdYnxXEYZGJ6St\n 78CZiKmf9B90dCFiGl38+hRWTbV3jQjRw0i73UX+kKyGCRjTMHc80h/btRQUX37Uo78O+YMN+7X\n n71a0ulbs00AR4Lm3q05jcmdx0dKVRFTj4cqkAMmT/5j66kRRH+ISNY6XY8Ywq6jLKRRSlgmukA\n MeMT2+q5aDEWdbGONOGwTSKNnX/vmr0BlV5XfHY/8O50Z6zdsKu3yLAzmY/+HlmU1Tjir7Os3Ug\n oFJLBtJJ7Ctpp8YHcgg==","X-Authority-Analysis":"v=2.4 cv=Iby3n2qa c=1 sm=1 tr=0 ts=69e07671 cx=c_pps\n a=WW5sKcV1LcKqjgzy2JUPuA==:117 a=Ou0eQOY4+eZoSc0qltEV5Q==:17\n a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22\n a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22 a=EUspDBNiAAAA:8\n a=0SPA9odgS42ATgxe00IA:9 a=OpyuDcXvxspvyRM73sMx:22","X-Proofpoint-ORIG-GUID":"E2dk5_JB-7QOlQYU-0HmQlZc0IMpjpS4","X-Proofpoint-Virus-Version":"vendor=baseguard\n engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49\n definitions=2026-04-16_01,2026-04-13_04,2025-10-01_01","X-Proofpoint-Spam-Details":"rule=outbound_notspam policy=outbound score=0\n spamscore=0 clxscore=1015 priorityscore=1501 suspectscore=0 phishscore=0\n bulkscore=0 lowpriorityscore=0 impostorscore=0 malwarescore=0 adultscore=0\n classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0\n reason=mlx scancount=1 engine=8.22.0-2604070000 definitions=main-2604160051","X-Mailman-Approved-At":"Thu, 16 Apr 2026 15:16:28 +0200","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.39","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<https://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>","X-Virus-Scanned":"clamav-milter 0.103.8 at phobos.denx.de","X-Virus-Status":"Clean"},"content":"Update SMEM with the storage medium from which the system booted.\n\nSigned-off-by: Varadarajan Narayanan <varadarajan.narayanan@oss.qualcomm.com>\n---\nv3: Move SMEM init from previous patch to this new patch\n---\n arch/arm/mach-snapdragon/spl.c | 65 ++++++++++++++++++++++++++++++++++\n include/smem.h                 |  3 ++\n 2 files changed, 68 insertions(+)","diff":"diff --git a/arch/arm/mach-snapdragon/spl.c b/arch/arm/mach-snapdragon/spl.c\nindex 8cc28bbee82..82b390ba3d7 100644\n--- a/arch/arm/mach-snapdragon/spl.c\n+++ b/arch/arm/mach-snapdragon/spl.c\n@@ -11,6 +11,7 @@\n #include <asm/io.h>\n #include <asm/system.h>\n #include <asm/sections.h>\n+#include <smem.h>\n #include <atf_common.h>\n #include <linux/err.h>\n #include <dm/device-internal.h>\n@@ -169,6 +170,46 @@ static int qcom_spl_get_fit_img_entry_point(void *fit, int node,\n \treturn ret;\n }\n \n+#if IS_ENABLED(CONFIG_SPL_SMEM)\n+/**\n+ * qcom_spl_populate_smem() - Populate shared memory (SMEM) information.\n+ * @ctx:\tPointer to the global SPL context.\n+ *\n+ * This function initializes and populates various SMEM items with boot-related\n+ * information, such as flash type, try-mode status, and ATF enable status.\n+ * Return: 0 on success, or a negative error code on failure.\n+ */\n+static int qcom_spl_populate_smem(void *ctx)\n+{\n+\tint ret;\n+\tsize_t size;\n+\tstruct udevice *smem;\n+\tu32 *fltype;\n+\n+\tret = uclass_get_device(UCLASS_SMEM, 0, &smem);\n+\tif (ret) {\n+\t\tpr_err(\"Failed to find SMEM node (%d)\\n\", ret);\n+\t\treturn ret;\n+\t}\n+\n+\tsize = sizeof(u32);\n+\tret = smem_alloc(smem, -1, SMEM_BOOT_FLASH_TYPE, size);\n+\tif (ret) {\n+\t\tpr_err(\"Failed to alloc item: SMEM_BOOT_FLASH_TYPE (%d)\\n\", ret);\n+\t\treturn ret;\n+\t}\n+\n+\tfltype = (u32 *)smem_get(smem, -1, SMEM_BOOT_FLASH_TYPE, &size);\n+\tif (!fltype) {\n+\t\tpr_err(\"Failed to get item: SMEM_BOOT_FLASH_TYPE\\n\");\n+\t\treturn -ENOENT;\n+\t}\n+\n+\tif (IS_ENABLED(CONFIG_SPL_MMC))\n+\t\t*fltype = SMEM_BOOT_MMC_FLASH;\n+\treturn 0;\n+}\n+#endif /* IS_ENABLED(CONFIG_SPL_SMEM) */\n /**\n  * qcom_spl_get_iftbl_entry_by_name() - Get an interface table entry by name.\n  * @if_tbl:\tPointer to the QCLIB interface table.\n@@ -330,6 +371,30 @@ int qclib_post_process_from_spl(void)\n \treturn 0;\n }\n \n+#if IS_ENABLED(CONFIG_SPL_SMEM)\n+/**\n+ * spl_board_prepare_for_boot() - Prepare board for boot\n+ *\n+ * This function is called by SPL before jumping to the next stage.\n+ * It populates SMEM during coldboot.\n+ */\n+void spl_board_prepare_for_boot(void)\n+{\n+\tint ret;\n+\n+\t/*\n+\t * Populate SMEM in coldboot (Dload bit not set)\n+\t */\n+\tif (!QCOM_SPL_IS_DLOAD_BIT_SET) {\n+\t\tprintf(\"Populating SMEM\\n\");\n+\t\tret = qcom_spl_populate_smem(NULL);\n+\t\tif (ret) {\n+\t\t\tpr_err(\"Failed to populate SMEM (%d)\\n\", ret);\n+\t\t\tqcom_spl_error_handler(NULL);\n+\t\t}\n+\t}\n+}\n+#endif /* IS_ENABLED(CONFIG_SPL_SMEM) */\n \n /**\n  * spl_get_load_buffer() - Allocate a cache-aligned buffer for image loading.\ndiff --git a/include/smem.h b/include/smem.h\nindex b19c534ebc4..f16ba7d63dc 100644\n--- a/include/smem.h\n+++ b/include/smem.h\n@@ -87,4 +87,7 @@ void *smem_get(struct udevice *dev, unsigned int host, unsigned int item, size_t\n  */\n int smem_get_free_space(struct udevice *dev, unsigned int host);\n \n+#define SMEM_BOOT_FLASH_TYPE\t\t\t498\n+#define SMEM_BOOT_MMC_FLASH\t\t\t5\n+\n #endif /* _smem_h_ */\n","prefixes":["v3","07/10"]}