{"id":2221919,"url":"http://patchwork.ozlabs.org/api/1.2/patches/2221919/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/20260410091154.1001021-8-varadarajan.narayanan@oss.qualcomm.com/","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/1.2/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":"<20260410091154.1001021-8-varadarajan.narayanan@oss.qualcomm.com>","list_archive_url":null,"date":"2026-04-10T09:11:52","name":"[v2,7/9] mach-snapdragon: Add initial support for IPQ5210 SPL","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"b8abcc429262eb961ee68555413d2e6c80344302","submitter":{"id":92283,"url":"http://patchwork.ozlabs.org/api/1.2/people/92283/?format=json","name":"Varadarajan Narayanan","email":"varadarajan.narayanan@oss.qualcomm.com"},"delegate":{"id":151538,"url":"http://patchwork.ozlabs.org/api/1.2/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/20260410091154.1001021-8-varadarajan.narayanan@oss.qualcomm.com/mbox/","series":[{"id":499455,"url":"http://patchwork.ozlabs.org/api/1.2/series/499455/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/list/?series=499455","date":"2026-04-10T09:11:45","name":"Qualcomm IPQ5210 SoC bringup","version":2,"mbox":"http://patchwork.ozlabs.org/series/499455/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2221919/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2221919/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=KrOdd0P7;\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=BJBzpX3V;\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=\"KrOdd0P7\";\n\tdkim=pass (2048-bit key;\n unprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com\n header.b=\"BJBzpX3V\";\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 4fscH31wTlz1yGS\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 10 Apr 2026 22:55:43 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 883E184214;\n\tFri, 10 Apr 2026 14:54:25 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id 5409784106; Fri, 10 Apr 2026 11:13:40 +0200 (CEST)","from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com\n [205.220.180.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 A99E383DC9\n for <u-boot@lists.denx.de>; Fri, 10 Apr 2026 11:13:37 +0200 (CEST)","from pps.filterd (m0279869.ppops.net [127.0.0.1])\n by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 63A8w6UU115016\n for <u-boot@lists.denx.de>; Fri, 10 Apr 2026 09:13:36 GMT","from mail-pl1-f197.google.com (mail-pl1-f197.google.com\n [209.85.214.197])\n by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dee8xb6d6-1\n (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)\n for <u-boot@lists.denx.de>; Fri, 10 Apr 2026 09:13:35 +0000 (GMT)","by mail-pl1-f197.google.com with SMTP id\n d9443c01a7336-2b256ed2cc8so18905385ad.3\n for <u-boot@lists.denx.de>; Fri, 10 Apr 2026 02:13:35 -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 98e67ed59e1d1-35e4123a29fsm2564871a91.8.2026.04.10.02.13.22\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Fri, 10 Apr 2026 02:13:33 -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=xUqERPFh5Tk\n 4l/IxhLnuBGctYlsiYvEj04kGUjEeUJ8=; b=KrOdd0P7e3mYf2r73VNOowiPnyQ\n KvGjhFTx2iT2twpN3AMcZRRTbFOr4dtIkXCC+ONtE7XsOo9Ad1TiOU8kem84V1pN\n gdVhttbkFVbGiweDU/eJ3V2LbVsNKg7+CpaY07HVkg8otv1DpvOm4fERQ6EJFo1X\n o1wgPtcF7fJ5gvcNKrk8aZMfqeNqjcBbvbpBiBEmCamdfTKJeRE9lZMef7kiro8F\n /bjd/O7Btdc0iI7h4H89QWl3axIGSKFAW7VUC4odhKaLz2ABiZ4olQo8p5sRJ32W\n NTCWcusJ1G8prero+jZDjQ2KlsWrKCPPJYJETnakmQGuRVRZyTZNA2jf9+Q==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=oss.qualcomm.com; s=google; t=1775812415; x=1776417215; 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=xUqERPFh5Tk4l/IxhLnuBGctYlsiYvEj04kGUjEeUJ8=;\n b=BJBzpX3VCgB6Y+HujUcKxqSDd3DXYpcFVAxDUIwkRqRydQE0ForsAFcI+2qflsoere\n shfqFAhZ0Yi6NCjWgAHlB2OjMsGRDAQoev9cbB9p5+5Pi6srFAqkU5Vj3D/+f8iBZ3gX\n rlvEh9SIXvZ9lFL/GfcRB/cL9RDtWWdFCXIA4dO7DnIDU6u7cGFx+a41XXoYMi6CKtCm\n W849GDQhyaiT+VCAYWjCgweO938ZSAf4jTmDXSyZIAvgUxmpFYVBnEqj7YuC6Lb0EVg/\n GGSZVhNdIlsTu0+UaLRkaDS2n+u3zMfW7s1pp8Z2cqUc5noSZPo7JCecDoYll2uz7raJ\n 62vQ=="],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775812415; x=1776417215;\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=xUqERPFh5Tk4l/IxhLnuBGctYlsiYvEj04kGUjEeUJ8=;\n b=W9BBlN8iNG59fFPe+30RUf6ZZDZAlQBMNqpoNnrnPk802WVojHIckZwBNsI5Fajx1H\n E2M/fb2+UdjIevt4I+bfiwVmh3MXZf7LHBRTg22KKiOxQdZ+4d1vfPPcfT8V20Tc6iv9\n HlO2lwl25w0JU1HYxJOtfo2AFE2GsodOZl1z/nfs2IVcTQh5QJm4StQ9v9BpN4kjpeE/\n kWo0aEPu/A+8oF0gdc3NiDlDqST3uNanlq+VRVY1HWQAuCNKbFPdsbRL2NglnmoDLg7t\n c1z8NZubWMnz0fprQOB7QF38fUo9AeOn5+pUfumeCwwf2moMHqcNiy0FJexhG4TozSy+\n nvoQ==","X-Forwarded-Encrypted":"i=1;\n AJvYcCUPHzGMsTF6cXJUy8t4v028qkp04TOAtlT2lclOh6GQ05+U3iJa0PltIQEmeDxnHGFFbQbyics=@lists.denx.de","X-Gm-Message-State":"AOJu0YwDmoRt2lIzNNHos3jRouvT60HpN7aaz9FsZaoMKHLSiBGzJN+Y\n Y5xe7jY2dzG0Kf8bBqKximm4gTQklTVdbP+u5DhTGQYtbBxLkyLri2BwRvNnUeeQzC4kavLmuhr\n dkN7N1qWjyo+Nv0cCx3/BakF9el6+Vc7m/gbDKvkDgD0OB4t6AfEKA15d","X-Gm-Gg":"AeBDietVYbx+L9FAdZ1xmn+i3f6l/0wYh8Q/Uf4CHuryDBYuB2+hyqokLdwuMcTrOht\n sJmpkNUiU1xIC+2r789mpNEXfwyMs+ge/zy6MFgBNZGasTrIOcZiL7PTwLCNW8KnIvIG27kJSAt\n UTOTOnha7RNrlTezJqKoQQgDgDnuYuwFGB3qO23BlACnrMKhiBA41OUjIJqRIfuFbZFqJS/6P4N\n eCru8OYDA7ncsSgGJwgCr5lS6QK4W0eJtjYkuSs0xwT5LmWPm1XGGq0Pw5bxZNIMgQqE267Lohk\n HXxI7+E+f6TMS8a4gfxXIIVwKKy5HWBDKmZsPq73aBqFxcVAi5HB9nq4+z+qV8wNT/Fko2qob/e\n nrdcR7odKcLVaAEuYS+K6I8h+SUvbnJy+JQNj3HhEguhi7z7UkW83j4tCCVkAKOQ3d5lAkDHANQ\n my4MiiIeFUe4IxDrx/Q+AMcuD2aOkCQlnq7Enq+ldJejsSU5835As=","X-Received":["by 2002:a17:90b:2e8c:b0:35d:a3b4:2ef6 with SMTP id\n 98e67ed59e1d1-35e4282eeecmr2568611a91.21.1775812414340;\n Fri, 10 Apr 2026 02:13:34 -0700 (PDT)","by 2002:a17:90b:2e8c:b0:35d:a3b4:2ef6 with SMTP id\n 98e67ed59e1d1-35e4282eeecmr2568552a91.21.1775812413661;\n Fri, 10 Apr 2026 02:13:33 -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, anshuld@ti.com,\n alif.zakuan.yuslaimi@altera.com, tingting.meng@altera.com,\n alice.guo@nxp.com, quentin.schulz@cherry.de,\n ilias.apalodimas@linaro.org, varadarajan.narayanan@oss.qualcomm.com,\n xypron.glpk@gmx.de, mkorpershoek@kernel.org, h-salunke@ti.com,\n alchark@gmail.com, dario.binacchi@amarulasolutions.com, ye.li@nxp.com,\n andre.przywara@arm.com, afd@ti.com, dinesh.maniyam@altera.com,\n balaji.selvanathan@oss.qualcomm.com, danila@jiaxyga.com,\n aswin.murugan@oss.qualcomm.com, luca.weiss@fairphone.com,\n adrian@mainlining.org, justin@tidylabs.net, n-francis@ti.com,\n wens@kernel.org, jamie.gibbons@microchip.com,\n david.wronek@mainlining.org, alexeymin@postmarketos.org,\n james.hilliard1@gmail.com, michael@amarulasolutions.com,\n richard.genoud@bootlin.com, philip.molloy@analog.com,\n sughosh.ganu@arm.com, u-boot@lists.denx.de, u-boot-qcom@groups.io","Subject":"[PATCH v2 7/9] mach-snapdragon: Add initial support for IPQ5210 SPL","Date":"Fri, 10 Apr 2026 14:41:52 +0530","Message-Id":"<20260410091154.1001021-8-varadarajan.narayanan@oss.qualcomm.com>","X-Mailer":"git-send-email 2.34.1","In-Reply-To":"<20260410091154.1001021-1-varadarajan.narayanan@oss.qualcomm.com>","References":"<20260410091154.1001021-1-varadarajan.narayanan@oss.qualcomm.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-Proofpoint-Spam-Details-Enc":"AW1haW4tMjYwNDEwMDA4MSBTYWx0ZWRfXz8JEBchHol1s\n gvhrWmo+CLyCRVJNSBQduhmkGa+0gp1CVWYtUzOFg3NCaSnDfd2cn0gUh+7d4JxZXkUSlIB9/fn\n nML0efWl23kVhARdQQl6jaCm+KLplnvT9wZvlfnrN4Qp9YdNUYGKmOj1XLrXdCup6tPlHTD8lkp\n NtW/G36B4P6OjqfV2WQsvNU+ssr+TcxqB8blavRlC+1mpNRHR1JW8p0x8JmHsTNX03seygkOrPS\n eKohUeFk4BO3ADdEntm6okYKI23WmHqV7enx3Km/T9NxT+UH/wrWeAmw0pUxknFwTT7OHEPtnuV\n Se2axlvD1AbO9PMM0rLx32XZOn5Dl21QWhkY9VspDW8RxJs0pD1wX3vbDCyOHKt/Q8CSs1Sv552\n 66KlV3RoGIGHQcQNAsJ0MQkbOcoMgT3ktlmHIZnGyC/0OAVGi/Bg46JqqEK5u1SrepanmMd5Tpa\n jcaUieg2fA0WWdY/4bg==","X-Proofpoint-GUID":"5NBkkyQ0BLsd3iZmDkQPZv_iVyZ9M5sJ","X-Proofpoint-ORIG-GUID":"5NBkkyQ0BLsd3iZmDkQPZv_iVyZ9M5sJ","X-Authority-Analysis":"v=2.4 cv=O7YJeh9W c=1 sm=1 tr=0 ts=69d8bf3f cx=c_pps\n a=cmESyDAEBpBGqyK7t0alAg==:117 a=Ou0eQOY4+eZoSc0qltEV5Q==:17\n a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22\n a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=EUspDBNiAAAA:8\n a=pGLkceISAAAA:8 a=b2O72gnjNZcLiAo3fN4A:9 a=gKGqEOmO23dpcm9D:21\n a=1OuFwYUASf3TG4hYMiVC:22","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-10_02,2026-04-09_02,2025-10-01_01","X-Proofpoint-Spam-Details":"rule=outbound_notspam policy=outbound score=0\n bulkscore=0 spamscore=0 phishscore=0 priorityscore=1501 adultscore=0\n impostorscore=0 malwarescore=0 suspectscore=0 lowpriorityscore=0\n clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc=\n route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604010000\n definitions=main-2604100081","X-Mailman-Approved-At":"Fri, 10 Apr 2026 14:54:22 +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":"Add basic SPL infrastructure for IPQ5210 SoC. This handles basic serial\nconsole init, identifying the boot media, loading the additional\nfirmware binaries to setup DDR, TFA and eventually jump to U-Boot.\n\nSigned-off-by: Varadarajan Narayanan <varadarajan.narayanan@oss.qualcomm.com>\n---\nv2: Remove couple of unused local variables\n---\n arch/arm/Kconfig                  |   5 +-\n arch/arm/mach-snapdragon/Makefile |   3 +\n arch/arm/mach-snapdragon/spl.c    | 701 ++++++++++++++++++++++++++++++\n include/smem.h                    |   3 +\n 4 files changed, 710 insertions(+), 2 deletions(-)\n create mode 100644 arch/arm/mach-snapdragon/spl.c","diff":"diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig\nindex 03416c55265..54fa4cb2dac 100644\n--- a/arch/arm/Kconfig\n+++ b/arch/arm/Kconfig\n@@ -1135,12 +1135,13 @@ config ARCH_SNAPDRAGON\n \tselect SPMI\n \tselect BOARD_LATE_INIT\n \tselect OF_BOARD\n-\tselect SAVE_PREV_BL_FDT_ADDR if !ENABLE_ARM_SOC_BOOT0_HOOK\n-\tselect LINUX_KERNEL_IMAGE_HEADER if !ENABLE_ARM_SOC_BOOT0_HOOK\n+\tselect SAVE_PREV_BL_FDT_ADDR if !ENABLE_ARM_SOC_BOOT0_HOOK && !SPL\n+\tselect LINUX_KERNEL_IMAGE_HEADER if !ENABLE_ARM_SOC_BOOT0_HOOK && !SPL\n \tselect SYSRESET\n \tselect SYSRESET_PSCI\n \tselect ANDROID_BOOT_IMAGE_IGNORE_BLOB_ADDR\n \tselect MMU_PGPROT\n+\tselect SUPPORT_SPL\n \timply OF_UPSTREAM\n \timply CMD_DM\n \timply DM_USB_GADGET\ndiff --git a/arch/arm/mach-snapdragon/Makefile b/arch/arm/mach-snapdragon/Makefile\nindex 343e825c6fd..70a2ce585f2 100644\n--- a/arch/arm/mach-snapdragon/Makefile\n+++ b/arch/arm/mach-snapdragon/Makefile\n@@ -2,6 +2,9 @@\n #\n # (C) Copyright 2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>\n \n+ifndef CONFIG_XPL_BUILD\n obj-y += board.o\n obj-$(CONFIG_EFI_HAVE_CAPSULE_SUPPORT) += capsule_update.o\n obj-$(CONFIG_OF_LIVE) += of_fixup.o\n+endif\n+obj-$(CONFIG_SPL_BUILD) += spl.o\ndiff --git a/arch/arm/mach-snapdragon/spl.c b/arch/arm/mach-snapdragon/spl.c\nnew file mode 100644\nindex 00000000000..4c36ac5d5df\n--- /dev/null\n+++ b/arch/arm/mach-snapdragon/spl.c\n@@ -0,0 +1,701 @@\n+// SPDX-License-Identifier: GPL-2.0\n+/*\n+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n+ */\n+#include <hang.h>\n+#include <cpu_func.h>\n+#include <init.h>\n+#include <image.h>\n+#include <spl.h>\n+#include <spl_load.h>\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+#include <part.h>\n+#include <blk.h>\n+#include <dm/uclass.h>\n+\n+#define QCOM_SPL_TCSR_REG_ADDR\t\t0x195c100\n+#define QCOM_SPL_DLOAD_MASK\t\tGENMASK(4, 4)\n+#define QCOM_SPL_DLOAD_SHFT\t\t0x4\n+\n+#define QCOM_SPL_IS_DLOAD_BIT_SET\t((readl(QCOM_SPL_TCSR_REG_ADDR) & \\\n+\t\t\t\t\tQCOM_SPL_DLOAD_MASK) >> \\\n+\t\t\t\t\tQCOM_SPL_DLOAD_SHFT)\n+\n+#define QCOM_SPL_FIT_IMG_PARTITION\t\"0:BOOTLDR\"\n+\n+#define MAGIC_KEY\t\t\t\"QCLIB_CB\"\n+#define MAX_ENTRIES\t\t\t0xF\n+#define IF_TABLE_VERSION\t\t0x1\n+#define QCCONFIG\t\t\t\"qc_config\"\n+#define QCSDI\t\t\t\t\"qcsdi\"\n+\n+/**\n+ * struct interface_table_entry - Meta data for blobs in QCLIB interface\n+ * @entry_name:\tName of the data blob (e.g., \"dcb_settings\").\n+ * @address:\tAddress of the data blob.\n+ * @size:\tSize of the data blob.\n+ * @attributes:\tAttributes for the blob (e.g., save to storage).\n+ */\n+struct interface_table_entry {\n+\tchar entry_name[24];\n+\tu64 address;\n+\tu32 size;\n+\tu32 attributes;\n+};\n+\n+/**\n+ * struct interface_table - QCLIB Interface table header\n+ * @magic_key:\t\tMagic key for validation (\"QCLIB_CB\").\n+ * @version:\t\tInterface table version.\n+ * @num_entries:\tNumber of valid entries.\n+ * @max_entries:\tMaximum allowable entries.\n+ * @global_attributes:\tFlags for global attributes (e.g., SDI path).\n+ * @reserved1:\t\tReserved for future use.\n+ * @reserved2:\t\tReserved for future use.\n+ * @if_table_entries:\tArray of interface table entries.\n+ */\n+struct interface_table {\n+\tchar magic_key[8];\n+\tu32 version;\n+\tu32 num_entries;\n+\tu32 max_entries;\n+\tu32 global_attributes;\n+\tu32 reserved1;\n+\tu32 reserved2;\n+\tstruct interface_table_entry if_table_entries[MAX_ENTRIES];\n+};\n+\n+/**\n+ * qcom_spl_jump_img_entry_t - Type definition for image entry point functions.\n+ * @arg1:\tFirst argument passed to the entry point.\n+ * @arg2:\tSecond argument passed to the entry point.\n+ */\n+typedef void (*qcom_spl_jump_img_entry_t)(void *arg1, void *arg2);\n+\n+/*\n+ * Global QCSDI address populated by qclib_post_process_from_spl\n+ * Placed in .data section to ensure it persists\n+ */\n+static u64 g_qcsdi_address __section(\".data\");\n+\n+/**\n+ * lowlevel_init() - Early low-level initialization.\n+ *\n+ * This function performs very early hardware initialization,\n+ * specifically disabling the MMU if enabled by PBL.\n+ */\n+void lowlevel_init(void)\n+{\n+\tunsigned long sctlr;\n+\n+\tsctlr = get_sctlr();\n+\tset_sctlr(sctlr & ~(CR_M));\t/* Early disable the MMU */\n+}\n+\n+/**\n+ * qcom_spl_error_handler() - Centralized SPL error handler.\n+ * @arg:\tGeneric argument (unused).\n+ *\n+ * This function is invoked upon critical errors during the SPL boot process.\n+ */\n+void qcom_spl_error_handler(void *arg)\n+{\n+\tpr_err(\"Entered the SPL Error Handler\\n\");\n+\thang();\n+}\n+\n+/**\n+ * qcom_spl_malloc_init_f() - Initialize malloc for SPL.\n+ *\n+ * This function initializes the malloc subsystem using the memory region\n+ */\n+void qcom_spl_malloc_init_f(void)\n+{\n+\tif (!CONFIG_IS_ENABLED(SYS_MALLOC_F))\n+\t\treturn;\n+\t/*\n+\t * Set up by crt0.S\n+\t */\n+\tassert(gd->malloc_base);\n+\tgd->malloc_limit = CONFIG_VAL(SYS_MALLOC_F_LEN);\n+\tgd->malloc_ptr = 0;\n+\n+\tmem_malloc_init(gd->malloc_base, gd->malloc_limit);\n+\tgd->flags |= GD_FLG_FULL_MALLOC_INIT;\n+}\n+\n+/**\n+ * qcom_spl_get_fit_img_entry_point() - Get entry point from FIT image node.\n+ * @fit:\tPointer to the FIT image blob.\n+ * @node:\tNode ID within the FIT image.\n+ * @entry_point:Pointer to store the retrieved entry point.\n+ *\n+ * Return: 0 on success, or a negative error code on failure.\n+ */\n+static int qcom_spl_get_fit_img_entry_point(void *fit, int node,\n+\t\t\t\t\t    u64 *entry_point)\n+{\n+\tint ret;\n+\n+\tif (!fit) {\n+\t\tpr_err(\"FIT image blob is NULL\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\tif (node <= 0) {\n+\t\tpr_err(\"Invalid FIT node ID %d\\n\", node);\n+\t\treturn -EINVAL;\n+\t}\n+\tif (!entry_point) {\n+\t\tpr_err(\"Entry point pointer is NULL\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tret = fit_image_get_entry(fit, node, (ulong *)entry_point);\n+\tif (ret) {\n+\t\tpr_debug(\"No entry point for node %d, trying load address\\n\",\n+\t\t\t node);\n+\t\tret = fit_image_get_load(fit, node, (ulong *)entry_point);\n+\t\tif (ret)\n+\t\t\tpr_err(\"No load address for node %d (%d)\\n\", node, ret);\n+\t}\n+\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+ * @name:\tName of the entry to find.\n+ * @entry:\tPointer to a buffer where the found entry will be copied.\n+ *\n+ * Return: 0 on success, or a negative error code on failure.\n+ */\n+static int qcom_spl_get_iftbl_entry_by_name(struct interface_table *if_tbl,\n+\t\t\t\t\t    char *name,\n+\t\t\t\t\t    struct interface_table_entry *entry)\n+{\n+\tu8 uc_index;\n+\n+\tif (!if_tbl) {\n+\t\tpr_err(\"Invalid interface table\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\tif (!name) {\n+\t\tpr_err(\"Invalid name\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\tif (!entry) {\n+\t\tpr_err(\"Invalid entry pointer\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tfor (uc_index = 0; uc_index < MAX_ENTRIES; uc_index++) {\n+\t\tif (strcmp(if_tbl->if_table_entries[uc_index].entry_name,\n+\t\t\t   name) == 0) {\n+\t\t\tmemcpy(entry,\n+\t\t\t       &if_tbl->if_table_entries[uc_index],\n+\t\t\t       sizeof(struct interface_table_entry));\n+\t\t\treturn 0;\n+\t\t}\n+\t}\n+\tpr_err(\"Interface table entry '%s' not found\\n\", name);\n+\n+\treturn -ENOENT;\n+}\n+\n+/**\n+ * qclib_post_process_from_spl() - Post-process QCLIB image from SPL FIT address\n+ *\n+ * This function performs the same operations as qclib_post_process() but\n+ * takes no arguments. It gets the FIT image from CONFIG_SPL_LOAD_FIT_ADDRESS\n+ * and finds the qclib_1 node automatically.\n+ *\n+ * Return: 0 on success, or a negative error code on failure.\n+ */\n+int qclib_post_process_from_spl(void)\n+{\n+\tint ret;\n+\tint entry_idx;\n+\tint images_node;\n+\tint qcconfig_node;\n+\tint qclib_node;\n+\tconst void *fit;\n+\tstruct interface_table if_tbl;\n+\tstruct interface_table_entry qcsdi_entry;\n+\tqcom_spl_jump_img_entry_t qclib_entry;\n+\tu64 entry_point;\n+\n+\t/* Get FIT image from SPL load address */\n+\tfit = (const void *)CONFIG_SPL_LOAD_FIT_ADDRESS;\n+\n+\tif (!fit) {\n+\t\tpr_err(\"FIT image not found at CONFIG_SPL_LOAD_FIT_ADDRESS\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tpr_debug(\"QCLIB post-processing from SPL: fit=%p\\n\", fit);\n+\n+\t/*\n+\t * Find \"images\" node in FIT (get it once and reuse)\n+\t */\n+\timages_node = fdt_subnode_offset(fit, 0, \"images\");\n+\tif (images_node < 0) {\n+\t\tpr_err(\"Failed to find images node in FIT\\n\");\n+\t\treturn -ENOENT;\n+\t}\n+\n+\t/*\n+\t * Find \"qcconfig_1\" image node\n+\t */\n+\tqcconfig_node = fdt_subnode_offset(fit, images_node, \"qcconfig_1\");\n+\tif (qcconfig_node < 0) {\n+\t\tpr_err(\"Failed to find qcconfig_1 node in FIT\\n\");\n+\t\treturn -ENOENT;\n+\t}\n+\n+\t/*\n+\t * Find \"qclib_1\" image node\n+\t */\n+\tqclib_node = fdt_subnode_offset(fit, images_node, \"qclib_1\");\n+\tif (qclib_node < 0) {\n+\t\tpr_err(\"Failed to find qclib_1 node in FIT\\n\");\n+\t\treturn -ENOENT;\n+\t}\n+\n+\t/*\n+\t * Initialize the local interface table\n+\t */\n+\tmemset(&if_tbl, 0, sizeof(struct interface_table));\n+\tmemcpy(if_tbl.magic_key, MAGIC_KEY, strlen(MAGIC_KEY));\n+\n+\tif_tbl.version = IF_TABLE_VERSION;\n+\tif_tbl.num_entries = 0;\n+\tif_tbl.max_entries = MAX_ENTRIES;\n+\n+\t/*\n+\t * Add QCCONFIG entry to the interface table\n+\t */\n+\tentry_idx = 0;\n+\tmemcpy(if_tbl.if_table_entries[entry_idx].entry_name,\n+\t       QCCONFIG, strlen(QCCONFIG));\n+\n+\tret = qcom_spl_get_fit_img_entry_point((void *)fit,\n+\t\t\t\t\t       qcconfig_node,\n+\t\t\t\t\t       &if_tbl.if_table_entries[entry_idx].address);\n+\tif (ret) {\n+\t\tpr_err(\"Failed to get qcconfig_1 entry point (%d)\\n\", ret);\n+\t\treturn ret;\n+\t}\n+\tif_tbl.if_table_entries[entry_idx].attributes = 0;\n+\tif_tbl.num_entries = entry_idx + 1;\n+\n+\t/*\n+\t * Add QCSDI entry to the interface table\n+\t */\n+\tentry_idx++;\n+\tmemcpy(if_tbl.if_table_entries[entry_idx].entry_name,\n+\t       QCSDI, strlen(QCSDI));\n+\n+\tif_tbl.if_table_entries[entry_idx].address = 0;\n+\tif_tbl.if_table_entries[entry_idx].attributes = 0;\n+\tif_tbl.num_entries = entry_idx + 1;\n+\n+\t/*\n+\t * Get qclib_1 entry point\n+\t */\n+\tret = qcom_spl_get_fit_img_entry_point((void *)fit,\n+\t\t\t\t\t       qclib_node,\n+\t\t\t\t\t       &entry_point);\n+\tif (ret) {\n+\t\tpr_err(\"Failed to get qclib_1 entry point (%d)\\n\", ret);\n+\t\treturn ret;\n+\t}\n+\n+\tqclib_entry = (qcom_spl_jump_img_entry_t)entry_point;\n+\n+\tpr_info(\"Jumping to qclib_1 at 0x%llx\\n\", entry_point);\n+\tqclib_entry(&if_tbl, NULL);\n+\n+\t/* Parse the interface table to extract QCSDI address */\n+\tret = qcom_spl_get_iftbl_entry_by_name(&if_tbl, QCSDI, &qcsdi_entry);\n+\tif (ret) {\n+\t\tpr_err(\"Failed to get QCSDI entry from interface table (%d)\\n\", ret);\n+\t\treturn ret;\n+\t}\n+\n+\tg_qcsdi_address = qcsdi_entry.address;\n+\tpr_info(\"QCSDI address: 0x%llx\\n\", g_qcsdi_address);\n+\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.\n+ * @offset:\tOffset (unused, typically 0 for SPL).\n+ * @size:\tSize of the buffer to allocate.\n+ *\n+ * Return: Pointer to the allocated buffer, or NULL on failure.\n+ */\n+struct legacy_img_hdr *spl_get_load_buffer(ssize_t offset, size_t size)\n+{\n+\treturn (void *)(CONFIG_SPL_LOAD_FIT_ADDRESS);\n+}\n+\n+/**\n+ * board_spl_fit_buffer_addr() - Get the address of the FIT image buffer.\n+ * @fit_size:\tSize of the FIT image.\n+ * @sectors:\tNumber of sectors.\n+ * @bl_len:\tBlock length.\n+ *\n+ * Return: Address of the FIT image buffer.\n+ */\n+void *board_spl_fit_buffer_addr(ulong fit_size, int sectors, int bl_len)\n+{\n+\tvoid *buffer = spl_get_load_buffer(0, sectors * bl_len);\n+\n+\tif (!buffer) {\n+\t\tpr_err(\"Failed to get FIT load buffer\\n\");\n+\t\tqcom_spl_error_handler(NULL);\n+\t}\n+\n+\treturn buffer;\n+}\n+\n+/**\n+ * bl2_plat_get_bl31_params_v2() - Retrieve and fixup BL31 parameters.\n+ * @bl32_entry:\tEntry point for BL32 (OP-TEE).\n+ * @bl33_entry:\tEntry point for BL33 (U-Boot/kernel).\n+ * @fdt_addr:\tAddress of the Device Tree Blob (FDT).\n+ *\n+ * Return: Pointer to the populated BL31 parameters structure.\n+ */\n+struct bl_params *bl2_plat_get_bl31_params_v2(uintptr_t bl32_entry,\n+\t\t\t\t\t      uintptr_t bl33_entry,\n+\t\t\t\t\t      uintptr_t fdt_addr)\n+{\n+\tstruct bl_params *bl_params;\n+\tstruct bl_params_node *node;\n+\n+\t/*\n+\t * Populate the bl31 params with default values.\n+\t */\n+\tbl_params = bl2_plat_get_bl31_params_v2_default(bl32_entry, bl33_entry,\n+\t\t\t\t\t\t\tfdt_addr);\n+\n+\t/*\n+\t * Fixup the bl31 params based on platform requirements.\n+\t */\n+\tfor_each_bl_params_node(bl_params, node) {\n+\t\tif (node->image_id == ATF_BL31_IMAGE_ID) {\n+\t\t\t/*\n+\t\t\t * Pass QCSDI address to BL31 via arg0\n+\t\t\t * This address was populated by qclib_post_process()\n+\t\t\t */\n+\t\t\tif (g_qcsdi_address == 0)\n+\t\t\t\tpr_warn(\"QCSDI address not set, BL31 may not function correctly\\n\");\n+\n+\t\t\tnode->ep_info->args.arg0 = g_qcsdi_address;\n+\t\t\tpr_debug(\"Setting BL31 arg0 to QCSDI address: 0x%llx\\n\", g_qcsdi_address);\n+\t\t}\n+\t}\n+\n+\treturn bl_params;\n+}\n+\n+/**\n+ * qcom_spl_loader_pre_ddr() - SPL loader for pre-DDR stage.\n+ * @boot_device:Type of boot device.\n+ *\n+ * Return: 0 on success, or a negative error code on failure.\n+ */\n+static int qcom_spl_loader_pre_ddr(u8 boot_device)\n+{\n+\tstruct spl_image_loader *loader, *drv;\n+\tstruct spl_image_info spl_image = { 0 };\n+\tstruct spl_boot_device boot_dev = { .boot_device = boot_device, };\n+\tint ret = -ENODEV, n_ents;\n+\n+\tdrv = ll_entry_start(struct spl_image_loader, spl_image_loader);\n+\tn_ents = ll_entry_count(struct spl_image_loader, spl_image_loader);\n+\n+\tfor (loader = drv; loader && (loader != drv + n_ents); loader++) {\n+\t\tif (boot_device != loader->boot_device)\n+\t\t\tcontinue;\n+\n+\t\tret = loader->load_image(&spl_image, &boot_dev);\n+\t\tif (!ret)\n+\t\t\tbreak;\n+\n+\t\tprintf(\"%s: Error: %d\\n\", __func__, ret);\n+\t}\n+\n+\treturn ret;\n+}\n+\n+/**\n+ * spl_find_partition_info() - Find partition information by name\n+ * @uclass_id: Device class ID (UCLASS_MMC)\n+ * @device_num: Device number within the class\n+ * @part_name: Name of the partition to find\n+ * @info: Pointer to store partition information\n+ *\n+ * This function provides partition lookup logic for MMC.\n+ * Return: Partition number on success, negative error code on failure\n+ */\n+static int spl_find_partition_info(enum uclass_id uclass_id, int device_num,\n+\t\t\t\t   const char *part_name,\n+\t\t\t\t   struct disk_partition *info)\n+{\n+\tint ret;\n+\tstruct blk_desc *desc;\n+\n+\tif (!part_name || !info) {\n+\t\tprintf(\"Invalid parameters for partition lookup\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\t/*\n+\t * Get block device descriptor\n+\t */\n+\tdesc = blk_get_devnum_by_uclass_id(uclass_id, device_num);\n+\tif (!desc) {\n+\t\tprintf(\"Block device not found for class %d, device %d\\n\",\n+\t\t       uclass_id, device_num);\n+\t\treturn -ENODEV;\n+\t}\n+\n+\t/*\n+\t * Initialize partition table if needed\n+\t */\n+\tif (desc->part_type == PART_TYPE_UNKNOWN) {\n+\t\tprintf(\"Initializing partition table\\n\");\n+\t\t/*\n+\t\t * Prefer EFI/GPT\n+\t\t */\n+\t\tdesc->part_type = PART_TYPE_EFI;\n+\t}\n+\n+\t/*\n+\t * Find partition by name\n+\t */\n+\tret = part_get_info_by_name(desc, part_name, info);\n+\tif (ret < 0) {\n+\t\tprintf(\"Partition '%s' not found\\n\", part_name);\n+\t\treturn -ENOENT;\n+\t}\n+\n+\tprintf(\"Found partition '%s' at partition number %d\\n\", part_name, ret);\n+\treturn ret;\n+}\n+\n+#if CONFIG_IS_ENABLED(MMC)\n+/**\n+ * spl_mmc_boot_mode() - Determine the boot mode for MMC\n+ * @mmc:\tPointer to the MMC device\n+ * @boot_device:\tBoot device ID\n+ *\n+ * Return: MMCSD_MODE_RAW to use raw partition access\n+ */\n+u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device)\n+{\n+\treturn MMCSD_MODE_RAW;\n+}\n+\n+/**\n+ * spl_mmc_boot_partition() - Determine which partition to boot from\n+ * @boot_device:\tBoot device ID\n+ *\n+ * Return: Partition number to boot from, or default partition on error\n+ */\n+int spl_mmc_boot_partition(const u32 boot_device)\n+{\n+\tint ret;\n+\tstruct disk_partition info;\n+\n+\t/*\n+\t * Use common partition lookup function\n+\t */\n+\tret = spl_find_partition_info(UCLASS_MMC, 0, QCOM_SPL_FIT_IMG_PARTITION, &info);\n+\tif (ret < 0) {\n+\t\tprintf(\"Using default MMC partition %d\\n\",\n+\t\t       CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION);\n+\t\treturn CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION;\n+\t}\n+\n+\treturn ret;\n+}\n+\n+/**\n+ * spl_mmc_get_uboot_raw_sector() - Find the raw sector offset\n+ * @mmc:\tPointer to the MMC device\n+ * @raw_sect:\tSector\n+ *\n+ * Return: 0 if the image is at the starting of the partition without any offset.\n+ */\n+unsigned long spl_mmc_get_uboot_raw_sector(struct mmc *mmc, ulong raw_sect)\n+{\n+\treturn 0;\n+}\n+#endif /* CONFIG_IS_ENABLED(MMC) */\n+\n+/**\n+ * spl_boot_device() - Determine the boot device.\n+ *\n+ * Return: The mapped boot device type,\n+ *\t   or BOOT_DEVICE_NONE if the device is invalid.\n+ */\n+u32 spl_boot_device(void)\n+{\n+\tif (IS_ENABLED(CONFIG_SPL_MMC)) {\n+\t\tprintf(\"Selected boot device: MMC\\n\");\n+\t\treturn BOOT_DEVICE_MMC1;\n+\t}\n+\n+\tpr_err(\"No boot device configured\\n\");\n+\treturn BOOT_DEVICE_NONE;\n+}\n+\n+#if defined(CONFIG_SPL_BUILD) && !defined(CONFIG_SPL_FRAMEWORK_BOARD_INIT_F)\n+/**\n+ * board_init_f() - Main entry point for SPL.\n+ * @dummy:\tDummy argument (unused).\n+ */\n+void board_init_f(ulong dummy)\n+{\n+\tint ret;\n+\n+\tmemset(__bss_start, 0, __bss_end - __bss_start); /* Clear BSS */\n+\n+\tqcom_spl_malloc_init_f();\n+\n+\tret = spl_early_init();\n+\tif (ret) {\n+\t\tpr_debug(\"spl_early_init() failed (%d)\\n\", ret);\n+\t\tgoto fail;\n+\t}\n+\n+\tpreloader_console_init();\n+\n+\tret = qcom_spl_loader_pre_ddr(spl_boot_device());\n+\tif (ret) {\n+\t\tpr_debug(\"qcom_spl_loader_pre_ddr() failed (%d)\\n\", ret);\n+\t\tgoto fail;\n+\t}\n+\n+\tqclib_post_process_from_spl();\n+\n+\tboard_init_r(NULL, 0);\n+\n+fail:\n+\tif (ret)\n+\t\tqcom_spl_error_handler(NULL);\n+}\n+#endif /* CONFIG_SPL_BUILD && !defined(CONFIG_SPL_FRAMEWORK_BOARD_INIT_F) */\n+\n+int board_fit_config_name_match(const char *name)\n+{\n+\t/*\n+\t * SPL loads the pre-HLOS images from bootldr FIT image\n+\t * as below\n+\t *\n+\t * In board_init_f() - Matches \"pre-ddr\" configuration node and\n+\t * load the images mentioned in its <loadables>\n+\t *\n+\t * In board_init_r() - Matches \"post-ddr\" configuration node and\n+\t * load the images mentioned in its <loadables>\n+\t *\n+\t */\n+\tif (!(gd->flags & GD_FLG_SPL_INIT)) {\n+\t\tif (!strcmp(name, \"pre-ddr\")) {\n+\t\t\tprintf(\"Selected FIT Config: %s\\n\", name);\n+\t\t\treturn 0;\n+\t\t}\n+\t} else {\n+\t\tif (!strcmp(name, \"post-ddr\")) {\n+\t\t\tprintf(\"Selected FIT Config: %s\\n\", name);\n+\t\t\treturn 0;\n+\t\t}\n+\t}\n+\n+\treturn -EINVAL;\n+}\n+\n+int board_fdt_blob_setup(void **fdtp)\n+{\n+\treturn 0;\n+}\n+\n+void reset_cpu(void)\n+{\n+}\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":["v2","7/9"]}